Contents

inset

Chapter

Introduction Section

Welcome to LyX! Standard

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.

Standard

Some of you probably found your way to this document because you tried to put two spaces after a _inset Quotes eld inset

. _inset Quotes erd inset

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. Standard

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

What the Tutorial on is default and What it on isn't Standard

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

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

Getting the Most out of the Tutorial Standard

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. Standard

If you are familiar with LaTeX, you'll probably be able to read the on Tutorial default somewhat faster, since many LyX ideas are just LaTeX ideas in disguise. However, LyX does have idiosyncrasies _float footnote Standard

or, more optimistically, _inset Quotes eld inset

features _inset Quotes erd inset

float you'll want to learn about. Even if you don't feel like reading the rest of the on Tutorial default , you should definitely check out Section _separator

_inset LatexCommand [*]

inset

, which is specifically written for experienced LaTeX users. Standard

Section _separator

_inset LatexCommand [*]

inset

is a holdover from an earlier version of the Tutorial, and is a bit pithy. Still it's a nice _inset Quotes eld inset

at-a-distance _inset Quotes erd inset

introduction to LyX, so you might want to glance over it to get a feel for what LyX is all about. Subsection

What You on won't default Find: Itemize

Spoon-feeding or other dumbing-down. _deeper Standard

The trend in computer self-help literature these days _float footnote deeper Standard

Note from on John default Weiss: ... well, at least in America, where we dumb everything down to the lowest common denominator...

float seems to be: _inset Quotes eld inset

Assume the user has the I. Q. of a potato. _inset Quotes erd inset

We don't do that.

_deeper Standard

On the other hand, we do realize that most users go to a manual, especially a tutorial, when they're lost. So, while we'll assume that you, the user, are on not default stupid, we do understand that you might be a tad clueless or confused. deeper Itemize

Instructions how to use a mouse or a keyboard. _deeper Standard

If you haven't figured out by now how to use your computer, we can't help you, as such things are beyond the scope of the LyX manuals. _float footnote deeper Standard

Besides which, if you're using LyX to begin with, you'll probably have more than half a brain in your head. float Itemize

Detailed explanations of all of LyX's features. _deeper Standard

What, you want the on User's Guide default twice? Standard

Seriously, though, we're here to get you up and running so that all you need is the on User's Guide default . If we tried to duplicate all of the information about all of LyX's features in here, the on Tutorial default would be redundant, too long, and forever out of date. All we do here is introduce things; imagine there is a _inset Quotes eld inset

see the on User's Guide default

_inset Quotes erd inset

at the end of every section. deeper Itemize

Detailed explanations of LaTeX. _deeper Standard

Unnecessary. If you're really curious about learning some of the neat tricks you can do with LaTeX, you can always go get a LaTeX book. There are several good ones on the market. No need to reinvent the wheel, after all...

deeper Standard

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 _separator

_inset LatexCommand [*]

inset

. Section

What is LyX? _inset LatexCommand

inset

Subsection

Overview Standard

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 _inset Quotes eld inset

_ _inset Quotes erd inset

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. Standard

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

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. Standard

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

Suppose you're writing a report. To begin your report, you want a section called _inset Quotes eld inset

Introduction.

_inset Quotes erd inset

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, _inset Quotes eld inset

1. _separator

_separator Introduction _inset Quotes erd inset

. 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.

Standard

In LyX, you go to the pull-down on the far left of the button bar and select

sans Section default , and type _inset Quotes eld inset

Introduction.

_inset Quotes erd inset

Standard

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. Standard

Now let's look at the problem of consistency. Five days later, you reopen your report and start Section _separator 4. However, you forget that you were using 18pt bold instead of 16pt, so you type in the heading for Section _separator 4 in a different font that what you used for Section _separator 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. Standard

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. Standard

So, the basic idea behind LyX is: specify what you're doing, not how to do it. Instead of _inset Quotes eld inset

what you see is what you get, _inset Quotes erd inset

the LyX model is _inset Quotes eld inset

what you see is what you on mean default

_inset Quotes erd inset

or _inset Quotes eld inset

WYSIWYM. _inset Quotes erd inset

Subsection

Differences between LyX and Word Processors _float footnote Standard

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 99float Standard

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

The document ruler Itemize

Tab stops Itemize

Extra whitespace [i.e. hitting sans Enter default or sans Space default two or more times] Standard

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. Standard

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

Indenting controls Itemize

Page breaks Itemize

Line spacing [i.e. single spaced, double spaced, etc.] Itemize

Whitespace, horizontal and vertical Itemize

Fonts and font sizes Itemize

Typefaces [bold, italic, underline, etc.] Standard

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. _float footnote Standard

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 on User's Guide default for details. float

Standard

Lastly, there are a few areas where LyX [and LaTeX] surpasses many word processors: Itemize

Hyphenation Itemize

Lists of any type Itemize

Mathematics Itemize

Tables Itemize

Cross-referencing Standard

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 on works default . All of the bugs have been long since ironed out. _float footnote Standard

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

A final, and most important, difference between LyX and other word processors is stability. Unlike certain commercial word processors, LyX does on not default claim to be stable only to crash every 30 minutes when given a large document. The LyX Team knows we won't catch every single bug, nor do we try to pass off bugs as features. When those bugs [oh, sorry...

_inset Quotes eld inset

features _inset Quotes erd inset

... ] rear their ugly head, you might think LyX will drag your last 3 pages of creative endeavor into oblivion with it.

Standard

Nope.

Standard

Whenever LyX crashes, it dumps any document in memory to an emergency save file before dying. Upon restart, LyX will notice these emergency saves, specifically when you try and reload the affected file[s]. LyX then prompts you, asking whether to load the emergency save file, or the original file, depending on which is newer. Many users have written their doctoral dissertations using LyX. They seldom, if ever, lost a page, despite an occasional crash. Subsection

What the heck on is default LaTeX? Standard

LaTeX is a document preparation system designed by Leslie Lamport in 1985. _float footnote Standard

The source for the info in this section is _inset Quotes eld inset

on A Guide to LaTeX2e default , _inset Quotes erd inset

by Helmut Kopka and Patrick Daly, which has an entry in the bibliography of the on User's Guide default .

float It, in turn, was built up from a typesetting language called TeX, created by Donald Knuth in 1984.

_inset Quotes eld inset

TeX _inset Quotes erd inset

is pronounced like _inset Quotes eld inset

blech! _inset Quotes erd inset

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 _inset Quotes eld inset

device independent _inset Quotes erd inset

format file, or typewriter dvi default for short. You can then feed the typewriter dvi default file to anything that understands typewriter dvi default , or converts typewriter dvi default to other formats like PostScript«.

Standard

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. Standard

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. This is where Leslie Lamport enters our story. He wanted a macro package that was more user-oriented and less typesetter-orien ted, 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. Standard

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 use 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.

Standard

There are two ways to extend LaTeX: classes and styles. A on class default 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 on style default differs from a class in that it doesn't define a new type of document, but a different type of on behavior default 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. Standard

Here's a summary: List 00.00.0000

TeX: Typesetting language with macro capability. List 00.00.0000

LaTeX: Macro package built upon TeX.

List 00.00.0000

classes: Descriptions of a type of document, using LaTeX.

List 00.00.0000

styles: Alters the default behavior of LaTeX in some way. List 00.00.0000

LyX: Visual, WYSIWYM word-processor that uses LaTeX in all its glory to do its printing. Standard

The idea of this section was to try and explain on why default 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 — on what default you are typing. The computer then handles how it should look. Standard

Oh — one last thing. LaTeX is pronounced like TeX is. It rhymes with _inset Quotes eld inset

hey blech. _inset Quotes erd inset

_float footnote Standard

or _inset Quotes eld inset

ha blech _inset Quotes erd inset

, depending on how you pronounce your _inset Quotes eld inset

a _inset Quotes erd inset

s...

float Usually. Lamport says in his book, though, that _inset Quotes eld inset

on lay default -tecks is also possible _inset Quotes erd inset

.

_inset Quotes eld inset

LyX, _inset Quotes erd inset

on the other hand, is pronounced _inset Quotes eld inset

licks. _inset Quotes erd inset

Or _inset Quotes eld inset

lucks, _inset Quotes erd inset

or _inset Quotes eld inset

looks, _inset Quotes erd inset

depending on what country you're from...

Chapter

Getting Started with LyX Section

Your First LyX Document Standard

_inset LatexCommand

inset

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 on Tutorial default more instructive, useful, and fun.

Standard

Because there's lots of information that we won't be giving you, the on first medium default thing that you need to do is find the default other medium help files. Luckily, this is very simple.

default Start up LyX. Choose the on User's Guide default from the sans ūnder H d̄efault elp default menu. You may want to load the on Tutorial default as well (if you're not reading it on screen already). This way, you can read them while you're writing your own file _float footnote Standard

They can also serve as good examples of how to use the many features of LyX. float . Note that once you've got more than one document open, you can use the

sans ūnder D d̄efault ocuments default menu to switch between them. The on Tutorial default 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 on Tutorial default 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. Standard

In this on Tutorial default , we're going to assume that you have a fully working version of LyX, as well as LaTeX, typewriter xdvi default or some other dvi viewer, typewriter dvips default or some other way of converting typewriter dvi default 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. Standard

Finally, we've written a file to let you practice your LyX skills on. It's called typewriter example_raw.lyx default . 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 typewriter example_raw.lyx default . It also contains _inset Quotes eld inset

subtle _inset Quotes erd inset

hints about how to fix things _float footnote Standard

The hints are located in yellow _inset Quotes eld inset

Notes _inset Quotes erd inset

. Access the text in a note by clicking on it. float . If you want to cheat (or check what you've done), there's also a file called

typewriter example_lyxified.lyx default which contains the same text as written and typeset by a LyX master. Standard

The example files can be found in the typewriter examples/ default directory, which you can get to by selecting sans ūnder F d̄efault ile

ūnder O d̄efault pen default and then clicking on the sans Examples default button. Open the raw document, and use sans ūnder F d̄efault ile Save ūnder A d̄efault s default 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. Standard

By the way, the typewriter examples/ default 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 on Tutorial default , or when you're confused about how to do something fancy in LyX, take a look at these files. Subsection

Typing, Viewing, and Printing Itemize

Open a new file with sans ūnder F d̄efault ile

ūnder N d̄efault ew Itemize

Type a sentence like: typewriter This is my first LyX document! _float footnote Standard

All right. You could actually type anything you want. It really doesn't matter. We'll apologize here for the inanity of this sentence, as well as anything we ask you to type in the future. float Itemize

Save your document with sans ūnder F d̄efault ile Save _separator

ūnder A d̄efault s.

Itemize

Run LaTeX to create a typewriter dvi default file, with sans ūnder F d̄efault ile View _separator dvi default . You may see things being printed in the window you ran the typewriter lyx default command from. These are messages from LaTeX, which you can ignore for now. LyX will run typewriter xdvi default (or some other typewriter dvi default viewer), which will pop up a new window displaying what your document will look like when printed. _float footnote Standard

You can save time by leaving typewriter xdvi default running in the background. Then, you can use sans ūnder F d̄efault ile

ūnder U d̄efault pdate _separator dvi default and just click on the typewriter xdvi default window (or unminimize it) after LaTeX finishes running. float Itemize

Print by using sans ūnder F d̄efault ile

ūnder P d̄efault rint default and hitting sans OK.

Standard

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 on Tutorial default , the on User's Guide default , and the on Reference default . Subsection

Simple Operations Standard

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 now _float footnote Standard

If you're like many on unix default users, you did so long before starting to read the on Tutorial default . float and you'll see that most of the simple commands (e.g., sans ūnder F d̄efault ile E ūnder x d̄efault it, ūnder E d̄efault dit

ūnder P d̄efault aste, ūnder F d̄efault ile

ūnder P d̄efault rint) default 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. Description

Undo LyX has on capacity default for _inset Quotes eld inset

infinite undo _inset Quotes erd inset

, which means you can undo everything you've done since your current editing session started, by selecting sans ūnder E d̄efault dit

ūnder U d̄efault ndo default over and over again. If you undo too much, just select sans ūnder E d̄efault dit

ūnder R d̄efault edo default to get it back.

_deeper Standard

[Currently, undo is limited to 100 steps. Undo also doesn't work for on everything default , not for changes to the document layout for instance.] deeper Description

Cut/Paste/Copy Use sans ūnder E d̄efault dit

ūnder C d̄efault ut default , sans ūnder E d̄efault dit

ūnder P d̄efault aste default , and sans ūnder E d̄efault dit C ūnder o d̄efault py default to cut, paste, and copy. Or automatically paste selected text with the on middle button default . Description

Find/Replace Use sans ūnder E d̄efault dit

ūnder F d̄efault ind _separator & _separator Replace default for a case-sensitive search. In the resulting popup, search with the forward and backward arrows, and use the sans ūnder R d̄efault eplace default button to replace a word you've found. _float footnote Standard

Close the window when you're done. Or leave it open if you find it more convenient. Most popups in LyX — including the sans ūnder F d̄efault ind _separator & _separator Replace default , sans Table _separator of _separator Contents default , and sans Layout default popups, as well as the various math popups — are windows that may be lowered, rather than closed. A few popups, like sans ūnder F d̄efault ile

ūnder O d̄efault pen default , won't let you type anything in the main LyX window until you actually close the popup. Just be sure you have the right window focus when you're trying to type in the main LyX window or give a command in some other LyX popup. float Description

Character _separator Formatting You can on emphasize default text (which will generally put characters in italics), put it in bold bold face default , or in on Noun Style default (usually small caps, used for people's names) from the toggle buttons in the sans ūnder L d̄efault ayout default menu. Description

Toolbar There are buttons on the toolbar (just below the menus) which allow you to do some of the more popular functions, such as sans Paste default and sans Print default . If you hold the mouse above one of the buttons on the toolbar, a little yellow note will tell you that button's function. Description

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 on type default 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. Standard

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

WYSIWYM: Whitespace in LyX Standard

_inset LatexCommand

inset

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 sans Return default , you'll only get one blank line. As many times as you hit sans Space default , you'll only get one space. On a blank line, LyX won't let you type even one space. The sans Tab default key won't move you forward one tab stop; in fact there on are default no tab stops! There's no ruler at the top of the page to let you set tabs or margins, either. Standard

Many commercial word processors are based on the WYSIWYG principle: _inset Quotes eld inset

What You See Is What You Get. _inset Quotes erd inset

LyX, on the other hand, is based on the principle that _inset Quotes eld inset

What You See Is What You on Mean default . _inset Quotes erd inset

You type what you mean, and LyX will take care of typesetting it for you, so that the output looks nice. A sans Return default grammatically separates paragraphs, and a sans Space default grammatically separates words, so there is no reason to have several of them in a row; a sans Tab default has no grammatical function at all, so LyX does not support it. Using LyX, you'll spend more of your time worrying about the on content default of your document, and less time worrying about the on format.

default See Section _separator

_inset LatexCommand [*]

inset

for more information on the WYSIWYM concept. Standard

LyX does have (many) ways to fine-tune the formatting of your document. After all, LyX might not typeset on exactly default what you mean. The on User's Guide default has information about all that. It includes sans HFill default s 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. Standard

Another special kind of whitespace is the sans Protected _separator Blank default , which is made by typing sans C-Space default (or sans ūnder I d̄efault nsert

ūnder S d̄efault pecial _separator Character Protected _separator

ūnder B d̄efault lank default ) and shows up as a small pink _inset Quotes eld inset

u _inset Quotes erd inset

on the screen _float footnote Standard

If you've been reading this online, you probably noticed and wondered about these. float . If you put a sans Protected _separator Blank default between two words, it prints out just like a regular space on paper. However, a sans Protected _separator Blank default tells LaTeX not to put a linebreak in between those two words. A popular usage is when writing something like, _inset Quotes eld inset

see Section _separator 1, _inset Quotes erd inset

where you want to make sure that _inset Quotes eld inset

Section _inset Quotes erd inset

and _inset Quotes eld inset

1 _inset Quotes erd inset

are on the same line _float footnote Standard

In the on Tutorial default , we also use them when describing menu names, or special characters like...

sans Protected _separator Blank default s! float . Section

Environments Standard

Different parts of a document have different purposes; we call these parts

on environments default . 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. Standard

Environments are a major part of the _inset Quotes eld inset

What You See Is What You Mean _inset Quotes erd inset

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 environmen t 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. Standard

The sans Environment default box is located on the left end of the toolbar (just under the sans ūnder F d̄efault ile default menu). It indicates which environment you're currently writing in. While you were writing your first document, it said _inset Quotes eld inset

Standard, _inset Quotes erd inset

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 sans Environment default menu, which you open by clicking on the _inset Quotes eld inset

down arrow _inset Quotes erd inset

icon just to the right of the sans Environment default box. Subsection

Sections and Subsections Standard

Type the word typewriter Introduction default on the first line of your LyX file, and select sans Section default from the sans Environment default menu _float footnote Standard

You don't have to on select default 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. float . LyX numbers the section _inset Quotes eld inset

1 _inset Quotes erd inset

and typesets the section heading (title) in a larger font. (Of course, the section heading will also be typeset correctly in the typewriter dvi default or printed document.) Now hit sans Return default . Note that the sans Environment default box changes from _inset Quotes eld inset

Section _inset Quotes erd inset

back to _inset Quotes eld inset

Standard _inset Quotes erd inset

. Section headings, like most environments, are assumed to end when you type

sans Return default .

_float footnote Standard

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

This is an introduction to my first LyX document. Standard

Hit sans Return default again, and select sans Section default from the sans Environment default menu again. LyX writes a _inset Quotes eld inset

2 _inset Quotes erd inset

and waits for you to type a title. Type typewriter More Stuff default , and you'll see that LyX again sets it as a section title. Standard

It gets better. Go to the end of Section _separator 1 again (after _inset Quotes eld inset

my first LyX document _inset Quotes erd inset

) and hit sans Return default again, and select sans Section default from the sans Environment default menu again. Again, LyX writes _inset Quotes eld inset

2 _inset Quotes erd inset

and waits for you to type a title. Type typewriter About This Document default . Section _separator

_inset Quotes eld inset

More Stuff _inset Quotes erd inset

, which used to be Section _separator 2, has been automatically renumbered to Section _separator 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. Standard

Hit sans Return default to get back to the sans Standard default environment, and type the following five lines: LyX-Code

Sections and subsections are described below. LyX-Code

Section Description LyX-Code

Sections are bigger than subsections. LyX-Code

Subsection description LyX-Code

Subsections are smaller than sections. Standard

Click on the second line and select sans Subsection default from the sans Environment default menu. LyX numbers the subsection _inset Quotes eld inset

2.1 _inset Quotes erd inset

, and typesets it in a font which is bigger than regular text but smaller than the section title. Change the fourth line sans Subsection default environment as well. As you probably expected, LyX automatically numbered the section _inset Quotes eld inset

2.2 _inset Quotes erd inset

. If you put yet another section before Section _separator 2, Section _separator 2 will be renumbered as Section 3, and the subsections will be renumbered to _inset Quotes eld inset

3.1 _inset Quotes erd inset

and _inset Quotes eld inset

3.2 _inset Quotes erd inset

.

Standard

Further levels of sectioning include sans Subsubsection default , sans Paragraph default , and sans Subparagraph default . 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 on User's Guide default to change this.

sans Chapter default headings are actually the highest level of sectioning, above sans Section default s, but you're only allowed to use them in certain types (textclasses) of LyX documents (see Section _separator

_inset LatexCommand [*]

inset

).

Standard

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 sans Section* default environment (you may have to scroll down in the sans Environment default 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 _inset Quotes eld inset

starred _inset Quotes erd inset

heading environments for sans Subsection default and sans Subsubsection default . Try changing some of your sections or subsections to the starred environments, and note how the other sections' numbers are updated. Standard

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

Subsection

Lists and sublists Standard

LyX has several different environments for typesetting lists. The various list environments free you from hitting sans Tab default 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 concentrat e on the list content. _float footnote Standard

Yes, we're overemphasizing this point throughout the on Tutorial default . But it on is default the main philosophy of LyX, so please forgive us. float Different types of documents logically require different list environments: Itemize

A slide presentation might use the sans Itemize default environment's bulleted lists to describe different points.

Itemize

An outline would use the sans Enumerate default environment's numbered lists (and lettered sublists).

Itemize

A document describing several software packages could use the sans Description default environment, where each item in the list begins with a boldfaced word.

Itemize

The sans List default environment — not found in LaTeX — is a slightly different form of

sans Description default . Standard

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

typewriter Lyx is better than other word processors because: Standard

and hit sans Return default . Now select sans Itemize default from the sans Environment default menu. LyX writes a _inset Quotes eld inset

bullet _inset Quotes erd inset

(actually, an asterisk, which will be converted to a round circle on output) on the line. Type in your reasons: LyX-Code

Typesetting is done for you. LyX-Code

Math is WYSIWYG LyX-Code

Lists are very easy to create! Standard

List environments, unlike headings, do not end when you type sans Return default . 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 on item default , one way is to use the sans Protected _separator Return default , which you get by typing sans C-Return default . In order to get out of the list, you need to reselect the sans Standard default environment (or just use the keybinding, sans M-p _separator s default ). Standard

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 list _float footnote Standard

LyX won't let you select the first bullet unless you also select the paragraph

on before default 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. float and choose sans Enumerate default from the sans Environment default menu. Pow! As we mentioned, if you add or delete a list item, LyX will fix the numbering. Standard

While the list is still selected, you can change to the other two list environme nts, sans Description default and sans List default , 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 sans Return default .) The term is either typeset in boldface ( sans Description default ) or separated by a _inset Quotes eld inset

Tab _inset Quotes erd inset

_float footnote Standard

But a typesetter's tab, which will change to fit the size of the largest term, not a pathetic, rigid, unchangeable typewriter sans Tab default . float ( sans List default ) from the rest of the paragraph. If you want to have more than one word in the definition, then separate the words with sans Protected _separator Blank default s. Standard

bold Exercise default : Typeset the list in typewriter example_raw.lyx Standard

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 on User's Guide default for details on the different sorts of lists, as well as examples which use on a lot default of nesting. Subsection

Other Environments: Verses, Quotations, and More Standard

There are two environments for setting quotations apart from surrounding text: sans Quote default for short quotes and sans Quotation default for longer ones. Computer code (the sans LyX-Code default environment, also used in the on Tutorial default for the long typing examples) is written in a typewriter typewriter default 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 poetry _float footnote Standard

... assuming you're creative enough to come up with poetry in the first place. float using the sans Verse default style, using sans Return default to separate stanzas, and sans C-Return default to separate lines within a stanza. See the on User's Guide default for more complete descriptions of all of the available LyX environments. Standard

bold Exercise default : Correctly typeset the sans Quote, LyX-Code, default and sans Verse default in atex

linebreak efault

typewriter example_raw.lyx Chapter

Writing Documents Standard

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. Section

Textclasses and Templates: Writing Letters Standard

_inset LatexCommand

inset

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 on textclass _float footnote Standard

LaTeX users: this is equivalent to the LaTeX documentclass float takes care of these large scale differences between different sorts of documents. This on Tutorial default , for example, was written in the sans Book default textclass. Textclasses are another major part of the WYSIWYM philosophy; they tell LyX how to typeset the document, so you don't need to know how. Standard

Your document is probably being written in the sans Article default textclass _float footnote Standard

That's usually the default textclass, although you can set it in your typewriter lyxrc default file. float . Try changing to other textclasses (using the sans ūnder C d̄efault lass default menu in the sans ūnder L d̄efault ayout

ūnder D d̄efault ocument default popup) to see how they are typeset differently. If you change your document to the sans Book default textclass and look at the sans Environment default menu, you'll see that most of the allowed environments are the same. However, you can now use the sans Chapter default environment. If you're ever unsure about which environments you can use in a given textclass , just consult the sans Environment default menu. Standard

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 _inset Quotes eld inset

style files _inset Quotes erd inset

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 sans Article _separator (AMS) default textclass. Standard

Here's a very quick reference to some of the textclasses. As usual, see the on User's Guide default for details. Standard _space_top 0.3cm _space_bottom 0.3cm center multicol5 7 2 0 0 -1 -1 -1 -1 1 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 8 1 0 "" "" 8 1 1 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" "" 0 8 1 0 0 0 0 "" ""

Name
Notes
article
one-sided, no chapters
article (AMS)
layout & environments for American Math Society
report
longer than article, two-sided
book
report + front and back matter
slides
transparencies (also including FoilTeX)
letter
lots of extra environments for address, signature...

Section

Templates: Writing a Letter Standard

One of the most popular textclasses is sans Letter default . One way to write a letter would be to open a sans ūnder N d̄efault ew default file, and choose sans Letter default from the sans ūnder C d̄efault lass default menu in the sans ūnder L d̄efault ayout

ūnder D d̄efault ocument default 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 on template default 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. Standard

Open a new file with sans ūnder F d̄efault ile New _separator from _separator

ūnder t d̄efault emplate default . After choosing a new filename, select typewriter letter.lyx default from the sans Choose _separator Template default popup. Save and print the file to see how the various environments are typeset. Standard

When you look at the sans Environment default menu, you'll see several environments, like the sans My _separator Address default environment, which don't even exist in most other textclasses. Others, like sans Quote default and sans Description default , are familiar. You can play around for a while to figure out how the various environments work. You'll notice for example that the sans Signature default environment has the word _inset Quotes eld inset

Signature: _inset Quotes eld inset

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 sans Signature default line is placed. Remember, LyX is WYSIWYM; you can put the sans Signature default environment anywhere you want, but LyX knows that in the printout, the signature should be at the end. Standard

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 _inset Quotes eld inset

exercise _inset Quotes erd inset

here; just write a letter to someone _float footnote Standard

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 sans My _separator Address default 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 sans Environment default menu to get it back. float ! Standard

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. Section

Document Titles Standard

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. Standard

Go back to your typewriter newfile.lyx default document and make sure it's using the sans Article default textclass. _float footnote Standard

You should not be using the letter any more, since the sans Letter default textclass doesn't allow titles. float Type a title on the first line, and change the line to the sans Title default environment. On the next line, type your name and change it to the sans Author default environment. On the next line, write the date in the sans Date default environment. Type a paragraph or two summarizing your document using the sans Abstract default environment. Now see how it looks when printed. Standard

bold Exercise default : Fix the title, date, and author in typewriter example_raw.lyx Section

Labels and Cross-References Standard

_inset LatexCommand

inset

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. Subsection*

Your first label Standard

Let's mark our second section, whose title is _inset Quotes eld inset

About This Document _inset Quotes erd inset

. Click at the end of the section title line, and select sans ūnder I d̄efault nsert

ūnder L d̄efault abel default . A popup asks you for a section name. Type typewriter sec:aboutdocument default , which seems like a good descriptive label that won't get confused with other labels we might add. _float footnote Standard

We write _inset Quotes eld inset

sec: _inset Quotes eld inset

because you can also label equations, tables, and figures. float When you click on sans OK default , the label name will be placed in a box next to the section title. Standard

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. Standard

So far you haven't done anything — the typewriter dvi default 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. Subsection*

Your first cross-references Standard

Place the cursor somewhere in Section _separator 2 of your document. Type LyX-Code

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

Now — with the cursor after the word _inset Quotes eld inset

section _inset Quotes erd inset

typewriter

default — choose sans ūnder I d̄efault nsert

ūnder C d̄efault ross-Reference default . The sans Insert _separator Reference default popup pops up. It shows a list of the possible labels you can reference. At the moment, there should be only one, _inset Quotes eld inset

sec:aboutdocument _inset Quotes erd inset

. Select it (it may be selected by default) and click on sans ūnder I d̄efault nsert _separator Reference default . Now put the cursor after the word _inset Quotes eld inset

page _inset Quotes erd inset

, and click on sans Insert _separator

ūnder P d̄efault age _separator Number default from the sans Insert _separator Reference default popup. (To be really correct, you should put a sans Protected _separator Blank default in between the word _inset Quotes eld inset

Section _inset Quotes erd inset

and the reference. Same for the page reference.) Standard

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 sans Insert _separator Reference default 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, and sans C-< default will then move the cursor back to the reference. Use sans ūnder F d̄efault ile

ūnder U d̄efault pdate _separator dvi default , and you'll see that on the last page we refer to _inset Quotes eld inset

Section _separator 2 _inset Quotes erd inset

and _inset Quotes eld inset

Page _separator 1 _inset Quotes erd inset

(or whatever page Section _separator 2's title is on). Subsection*

More fun with labels Standard

We told you that LyX worries about numbering cross-references; now you can test that. Add a new section before Section _separator 2. Now rerun LaTeX, and — voilα! — the section cross reference changed to _inset Quotes eld inset

3 _inset Quotes erd inset

! Change _inset Quotes eld inset

About this Document _inset Quotes erd inset

to a subsection, and the cross-reference will reference Subsection _separator 2.1 instead of Section _separator 3. The page reference won't change unless you add a whole page of text before the label, of course.

Standard

atex

beginsloppypar Standard

If you want some more practice with labels, then try putting a label, _inset Quotes eld inset

sec:myfirstlabel _inset Quotes erd inset

, 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 sans Insert _separator Reference default window open. Standard

atex

endsloppypar Standard

If you want to make sure that the cross-referencing gets the pages right even for larger documents, sans ūnder C d̄efault opy default a couple pages of text from the on User's Guide default to the clipboard, and sans ūnder P d̄efault aste default the stolen text into your document _float footnote Standard

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 _separator

_inset LatexCommand [*]

inset

.

float . Standard

bold Exercise default : Fix the references in typewriter example_raw.lyx Section

Footnotes and Margin Notes Standard

Footnotes can be added using the sans Insert _separator Footnote default button in the toolbar _float footnote Standard

The button shows an arrow pointing to red text, which is just below some black text. float or sans ūnder I d̄efault nsert

ūnder F d̄efault ootnote default . Click at the end of the word _inset Quotes eld inset

LyX _inset Quotes erd inset

somewhere in your document and hit the sans Insert _separator Footnote default 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 _inset Quotes eld inset

foot _inset Quotes erd inset

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-Code

LyX is a typesetting word processor. Standard

Now click on the word _inset Quotes eld inset

foot. _inset Quotes erd inset

The footnote line disappears, leaving the word _inset Quotes eld inset

foot _inset Quotes erd inset

, superscripted in red, showing where the footnote marker will be in the printed text; this is called _inset Quotes eld inset

folding _inset Quotes erd inset

the footnote. You can unfold the footnote at any time — and re-edit its text, if you want — by clicking on the red _inset Quotes eld inset

foot _inset Quotes erd inset

marker. Standard

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 typewriter dvi default 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. Standard

A footnote can be cut and pasted like normal text. Go ahead; try it! All you need to do is select the footnote marker _float footnote Standard

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. float and sans ūnder C d̄efault ut default and sans ūnder P d̄efault aste default it. In addition, you can change regular text to a footnote, by selecting it and hitting the sans Insert _separator Footnote default button; change a footnote to regular text by clicking the sans Insert _separator Footnote default button when the cursor is in a footnote. Standard

Margin notes can be added using the sans Insert _separator Margin _separator Note default button _float footnote Standard

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 sans Insert _separator Footnote default button in the toolbar. float or sans ūnder I d̄efault nsert

ūnder M d̄efault argin _separator Note default . Margin notes are like footnotes, except that: Itemize

the on-screen markers say _inset Quotes eld inset

margin _inset Quotes erd inset

instead of _inset Quotes eld inset

foot _inset Quotes erd inset

Itemize

the notes will be placed in the margin, instead of below the text Itemize

margin notes are not numbered Itemize

when a note is folded, an exclamation point will be placed in the margin. This exclamation point will not show up in the printed text. Standard

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. Standard

bold Exercise default : Fix the footnote in typewriter example_raw.lyx Section

Bibliographies Standard

_inset LatexCommand

inset

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. Standard

Go to the end of the document and switch to the sans Bibliography default environment. Now, each paragraph you type will be a reference. Type typewriter The Lyx Tutorial, by the LyX DocTeam default 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 sans Bibliography _separator item default popup appears. You use the first field, the sans Key default , to refer to this reference within the LyX document. By default, it is a number. Change the sans Key default field to _inset Quotes eld inset

lyxtutorial _inset Quotes erd inset

to make it easy to remember. Standard

Now pick somewhere in your document that you would like to insert a reference. Do so with sans ūnder I d̄efault nsert C ūnder i d̄efault tation _separator Reference.

default LyX draws a gray box with three question marks surrounded by brackets, and a sans Citation default popup appears. The first field in this popup is also called sans Key default , and this field allows you to choose which bibliography item you want to cite _float footnote Standard

This is why it's a good idea to give the keys unique and logical names, instead of leaving the default numbers in the sans Key default field. float . Using the arrow pulldown menu at the right of the sans Key default field, select _inset Quotes eld inset

lyxtutorial _inset Quotes erd inset

(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. Standard

How are the other fields used? The sans ūnder R d̄efault emark default field in the sans Citation default 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 _inset Quotes eld inset

[Smi95] _inset Quotes erd inset

to refer to a paper written by Smith in 1995), use the sans Label default field in the sans Bibliography _separator item default popup. As usual, you can see the on User's Guide default for details. Standard

bold Exercise: default Fix the bibliography and citation in typewriter example_raw.lyx Section

Table of Contents Standard

You may want to put a table of contents at the beginning of your document. LyX makes this very easy to do. Just hit sans Return default after your document title and before your first section title _float footnote Standard

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 LyX takes care of section numbering. float and choose sans ūnder I d̄efault nsert Lists _separator & _separator

ūnder T d̄efault OC Table _separator of _separator

ūnder C d̄efault ontents default . The words _inset Quotes eld inset

Table of Contents _inset Quotes erd inset

will appear in a box (otherwise known as an inset) on the first line of the document.

Standard

This may not appear to be very useful. However, if you look at your typewriter dvi default 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 typewriter dvi default file when you update it.

Standard

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 sans ūnder E d̄efault dit

ūnder T d̄efault able _separator of _separator Contents _float footnote Standard

The menu command will work even if you don't have a table of contents inset in your document. float . This is a very useful tool. You can use the sans Table _separator of _separator Contents default window to move around your document. Clicking on a (sub)section title in the sans Table _separator of _separator Contents default 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. Standard

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

bold Exercise default : Fix the table of contents in typewriter example_raw.lyx Chapter

Using Math Standard

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 sans Math _separator Panel default will allow you to write professional-looking math quickly and easily _float footnote Standard

LyX can't check if the math you're writing is actually on correct default . Sorry. float . Section

Math Mode Standard

Somewhere in your LyX document, type: LyX-Code

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

Standard

Now, that equation doesn't look very good, even in the typewriter dvi default file; there's no space between the letters and the equals sign, and you'd like to write an actual superscript for the _inset Quotes eld inset

2 _inset Quotes erd inset

. 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. Standard

Math is written in Mathed, otherwise known as math mode. In order to enter math mode, just click the toolbar button with _inset Formula ${\frac{{a+b}}{{c}}}$ inset

written on it in blue. LyX will open a little blue square, with a purple rectangle around it. The blue square is an on insertion point default , 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 typewriter E=mc^2 default again. The expression is typed in blue, and the blue square disappears as soon as the insertion point is not empty. Now type sans Esc default to leave Mathed (Note: clicking on the sans math default button again will on not default 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. Standard

Run LaTeX and look at the typewriter dvi default file. Notice that the expression was typeset nicely, with spaces between the letters and the equals sign, and a superscript _inset Quotes eld inset

2 _inset Quotes erd inset

. Letters in math mode are assumed to be variables, and come out in italics. Numbers are just numbers. Standard

Mathed is another example of the WYSIWYM philosophy. In LaTeX, you write a mathematical expression using text and commands like

typewriter

sqrt default ; 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 _inset Quotes eld inset

bugs _inset Quotes erd inset

. 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. 99spacing that LaTeX outputs. This way (sorry to be so repetitive) you can focus on the on content default of your mathematical expressions, not their format. Section

Navigating an Equation Standard

Now let's change _inset Formula E = mc2 inset

to _inset Formula E = 1 + mc2 inset

. 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 sans Left default and sans Right default to move the cursor past the equals sign, and just type _inset Quotes eld inset

1+ _inset Quotes erd inset

. Again, you can use the arrow keys or sans Esc default 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. Standard

Other than the special keys described below, typing in math mode is like editing regular text. Use sans Delete default (or sans Backspace default ) to delete things. Select text either with the arrow keys or with the mouse.

sans ūnder E d̄efault dit

ūnder U d̄efault ndo default 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 sans Delete default (or sans Backspace default ), it will delete the whole expression. Luckily, you can just use sans Undo default to get it back. Standard

What if you want to change _inset Formula E = mc2 inset

to _inset Formula E = mc2.5 + 1 inset

? 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 _inset Quotes eld inset

c _inset Quotes erd inset

but before the _inset Quotes eld inset

2 _inset Quotes erd inset

, then typing sans Up default will move the cursor to the level of the superscript, just before the _inset Quotes eld inset

2 _inset Quotes erd inset

. Add the _inset Quotes eld inset

.5 _inset Quotes erd inset

. Now, hitting sans Down default will move the cursor back to the regular level. In fact, if you hit sans Down default from anywhere within the superscript, the cursor will be placed just on after default the superscript (so that you can then type the _inset Quotes eld inset

+1 _inset Quotes erd inset

). Standard

You can also use sans Space default 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 sans Space default will move the cursor past that structure, but will stay within Mathed. So, if the cursor is anywhere in the superscript, typing sans Space default will move the cursor down to the regular level and just after the superscript. This means you can type _inset Formula E = mc1+x - 2 inset

without using the mouse on or default the arrow keys, a method you'll probably prefer once you're more experienced. Just be careful not to type sans Space default 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 _inset Quotes eld inset

m _inset Quotes erd inset

and the _inset Quotes eld inset

c _inset Quotes erd inset

), sans Space default will do nothing _float footnote Standard

sans Space default and sans Tab default are bold not default 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.

_inset LatexCommand [*]

inset

). If you're not entirely satisfied, there are ways to fine-tune spacing, for which you can see the on User's Guide default — but don't bother with fine-tuning until you're done putting all the content into your document. float . Standard

Note that if you type your expression and exit with sans Esc default , 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 sans Space default after you exit Mathed. As a shortcut, though, if you are at the very end of a Mathed expression, then pressing sans Space default will exit Mathed on and default print a space after the expression. That way you can write _inset Quotes eld inset

_inset Formula f = ma inset

is my favorite equation _inset Quotes erd inset

instead of _inset Quotes eld inset

_inset Formula f = ma inset

is my favorite equation. _inset Quotes erd inset

Section

Exponents and Indices Standard

An exponent can be entered from the sans ūnder M d̄efault ath default menu, but it's actually simpler just to type the caret key, _inset Quotes eld inset

^ _inset Quotes erd inset

. LyX will place an insertion point (the blue square, remember?) in the superscri pt, so that whatever you write next will be superscripted, and in a smaller font size. Everything you type until you hit a sans Space default (or sans Esc default to exit Mathed entirely) will be in the superscript. Standard

Writing a subscript (index) is just as easy — start one by typing the underscore key, _inset Quotes eld inset

_ _inset Quotes eld inset

. You can subscript and superscript both subscripts and superscripts like this: _inset Formula Aa0+b2 + Ca0+b2 inset

.

Standard

bold Exercise default : Put equation 1 of typewriter example_raw.lyx default into math mode. Section

The sans Math Panel Standard

The sans Math _separator Panel default 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 sans ūnder M d̄efault ath default menu. However, we're going to concentrate on using the sans Math _separator Panel default , just to let you know what's out there; you can learn keyboard shortcuts later, from other manuals (hint, hint). So open up the sans Math _separator Panel default now and leave it open while reading this section. Subsection

Greek and symbols Standard

If you click on the button marked _inset Quotes eld inset

_inset Formula Γρεεκ inset

_inset Quotes erd inset

, 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

sans Math _separator Panel default , and Mathed will automatically be opened. Standard

Four other buttons at the bottom of the sans Math _separator Panel default 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.

_inset Quotes eld inset

Nothing you can do that can't be done... All you need is _inset Formula ♥ inset

. _inset Quotes erd inset

Subsection

Square roots, accents, and delimiters Standard

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. Standard

Accenting a character ( _inset Formula $\overrightarrow{v} $ inset

) or group of characters ( _inset Formula $\overrightarrow{a+b} $ inset

) is done the same way. Hit the sans Decoration default button , which has a blue square with a black tilde _separator ( ) over it, to open the sans Decoration default 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 sans Space default to _inset Quotes eld inset

exit _inset Quotes erd inset

the decoration. Standard

Delimiters such as parentheses, brackets, and braces work similarly, but are a bit more complicated. Hit the sans Delimiter default button, which features a blue square surrounded by brackets, to pop up the sans Delimiter default window. Click on a left delimiter with the on left mouse button default and a right delimiter with the on right mouse button default . (Alternatively, use the radio buttons labeled _inset Quotes eld inset

ūnder L d̄efault eft _inset Quotes erd inset

and _inset Quotes eld inset

ūnder R d̄efault ight _inset Quotes erd inset

and then click on delimiters with the on left mouse button default .) 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 _inset Quotes eld inset

_inset Formula a = $\left\langle\vphantom{ 7}\right.$7 inset

_inset Quotes erd inset

(the empty delimiter is displayed as a broken black line in LyX, but won't show up in the output). Standard

Once you've chosen your delimiters, click on sans OK default to put them into your expression (or hit sans Apply default 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 sans Delimiter default 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 sans Delimiter default window will guarantee that the delimiters are sized based on what's inside them. Standard

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 sans Math _separator Panel default . Try using this to change Newton's second law from scalar to vector form ( _inset Formula f = ma inset

to _inset Formula $\overrightarrow{f}$ = m$\overrightarrow{a} $ inset

). Once you've learned about matrices, this is how you'll put parentheses or brackets around them. Subsection

Fractions Standard

Fractions are simple in Mathed. Just click on the sans fraction default button in the sans Math _separator Panel default , 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 _inset Quotes eld inset

1 _inset Quotes erd inset

. Now hit sans Down default and type _inset Quotes eld inset

2 _inset Quotes erd inset

. 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.

Standard

bold Exercise default : Put equation 2 of typewriter example_raw.lyx default into math mode. Subsection

TeX mode: Limits, log, sin and others Standard

Because letters in math mode are considered to be variables, if you type

_inset Quotes eld inset

sin _inset Quotes erd inset

in math mode, LyX thinks you're typing the product of the three variables

_inset Formula s inset

, _inset Formula i inset

, and _inset Formula n inset

. The three letters will be typeset in italics, when what you really wanted was the word _inset Quotes eld inset

sin _inset Quotes erd inset

typeset in Roman. In addition, LyX won't put a space between the word _inset Quotes eld inset

sin _inset Quotes erd inset

and the _inset Quotes eld inset

x _inset Quotes erd inset

(typing sans Space default will just exit math mode). So how do you get _inset Quotes eld inset

_inset Formula sin x inset

_inset Quotes erd inset

instead of _inset Quotes eld inset

_inset Formula sinx inset

_inset Quotes erd inset

? Standard

Click on _inset Quotes eld inset

sin _inset Quotes erd inset

in the sans Functions default listbox in the sans Math _separator Panel default . The word _inset Quotes eld inset

sin _inset Quotes erd inset

is written in red, in Roman type, otherwise known as TeX mode. The whole word is treated as one symbol, so if you type sans Backspace default , it will delete the whole word. Now type _inset Quotes eld inset

x _inset Quotes erd inset

, which will be written in blue italics, like you expect in Mathed. In the typewriter dvi default file, the expression will be correctly typeset. Try it. Standard

Other commands you need to type in TeX mode using the sans Functions default 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

_inset Quotes eld inset

_inset Formula cos2θ inset

_inset Quotes erd inset

or _inset Quotes eld inset

_inset Formula $\lim_{{n\rightarrow \infty }}^{}$ inset

_inset Quotes erd inset

. Standard

bold Exercise default : Put equation 3 of typewriter example_raw.lyx default into math mode. Subsection

Matrices Standard

_inset LatexCommand

inset

Click on the sans matrix default button in the sans Math _separator Panel default . 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 sans Apply default or sans OK default . LyX prints 6 insertion points in a _inset Formula 2×3 inset

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. Standard

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

See the on User's Guide default 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. Subsection

Display mode Standard

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 on User's Guide default ), and multi-line equations (see Sec.

_inset LatexCommand [*]

inset

) must be in display mode. Standard

Click on the sans display default button in the sans Math _separator Panel default , 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 sans display default button is actually a toggle; use it now to change a couple of your expressions to display mode and back.

Standard

Display mode has a couple differences from regular Mathed: Itemize

The default font is smaller for a few symbols, like _inset Formula $\sum$ inset

and _inset Formula $\int$ inset

Itemize

Subscripts and superscripts for limits and sums (but not integrals) are written under rather than next to the symbols Itemize

Text is centered Standard

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

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 sans Return default . Doing so will cause the text on after default the equation to start a new paragraph. That text will therefore be indented, which is probably not what you want. Standard

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

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

f (x) = $\displaystyle \left\{\vphantom{ \begin{array}{cc}
\log _{8}x & x>0\\
0 & x=0\\
\sum ^{5}_{i=1}\alpha _{i}+\sqrt{-\frac{1}{x}} & x<0
\end{array}}\right.$$\displaystyle \begin{array}{cc}
\log _{8}x & x>0\\
0 & x=0\\
\sum ^{5}_{i=1}\alpha _{i}+\sqrt{-\frac{1}{x}} & x<0
\end{array}$

inset

Section

Multi-Line Equations Standard

_inset LatexCommand

inset

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

Standard

_inset Formula

x = y + y + y + y + y

inset

Standard

_inset Formula

= 5y

inset

Standard

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.

_inset Formula

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

inset

Standard

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

In order to start a multi-line equation, open a displayed Mathed expression and type sans C-Return default . LyX will print two lines, each with three empty insertion points. Like with matrices, you can use the mouse, arrow keys, or sans Tab default 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-lin e equation. This can be useful either for examples like the one above, or for splitting very long equations, like: _inset Formula

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

inset

Standard

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.

_inset LatexCommand [*]

inset

). Standard

If you want an even longer set of equations, use sans C-Return default 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 sans C-Return default 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 sans C-Tab default to move it to the second field. Then move past the equals sign, and sans C-Tab default again to move the right side of the equation to the third field. Try changing your _inset Formula E = mc2 inset

equation to _inset Formula

E = mc2  
  = mc×c  

inset

Standard

If you've written too many lines, put the cursor at the end of a line and use sans M-e _separator k default 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 sans M-e _separator k default when you're not at the end of the line can lead to strange behavior. Section

More Math Stuff Standard

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

Labeling and numbering expressions Itemize

Change typefaces, e.g., to write boldface text in an expression. We'll note here that clicking on the sans math default button in the toolbar while you're already in Mathed will write Roman text until you type a (non-protected) space. Itemize

Fine-tune font sizes and spacing within an expression. (Don't worry about this until your final draft!) Itemize

Write macros. These are very powerful, because you just define them once at the top of the document, and then you can use them throughout the document. If you change the macro definition, the references to the macro will be changed throughout the document. Macros can even take arguments. Itemize

Do lots of other things we didn't have time to mention in this on Tutorial default . Chapter

Miscellaneous Section

Other Major LyX Features Standard

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

Itemize

LyX has WYSIWYG support for tables. Use the sans ūnder I d̄efault nsert Ta ūnder b d̄efault le default to get a table. Click on the table with the on right button default to get a sans Table _separator Layout default popup which allows extensive table editing. Itemize

LyX also supports including PostScript« (or raw LaTeX) pictures within documents. (You guessed it: sans ūnder I d̄efault nsert Fi ūnder g d̄efault ure default . Then click on the figure to choose the file to include, rotate or scale it, etc. ) Tables and figures can have captions, and LyX will automatically generate lists of figures and/or tables. Itemize

Version control is supported, using RCS ( typewriter man rcsintro default for more info). Itemize

LyX is heavily configurable. Everything from how the LyX window looks to how the output comes out can be configured in a number of ways. Much configuration is done by editing the typewriter lyxrc default file _float footnote Standard

Currently, you need to edit the typewriter lyxrc default file with a text editor. Developers hope to create a GUI configuration that will run within LyX. float . For information on this, check out sans ūnder H d̄efault elp

ūnder C d̄efault ustomization.

Itemize

LyX is being developed by a team of programmers on five continents. Therefore, LyX has better support for non-English languages (such as Dutch, German, Greek, Czech, Turkish, ... ) than many word processors. You can write documents in other languages, but you can also configure LyX to show its menus and error messages in other languages. Itemize

The LyX menus feature keybindings. This means that you can do sans ūnder F d̄efault ile

ūnder O d̄efault pen default by typing sans M-F default followed by sans O default . Keybindings are also configurable (and keybindings even exist for some of the menus which have been translated from English). For information on this, check out sans ūnder H d̄efault elp

ūnder C d̄efault ustomization.

Itemize

LyX can read in LaTeX documents. See Section _separator

_inset LatexCommand [*]

inset

. Itemize

Spellcheck your document with sans ūnder E d̄efault dit

ūnder S d̄efault pellchecker default .

_float footnote Standard

Note that the spellchecker only checks from the cursor to the end of the document. float Section

LyX for LaTeX Users Standard

_inset LatexCommand

inset

If you don't know anything about LaTeX, you don't have to read this section. Actually, you might want to on learn default 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 LyX can 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. Standard

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 on Tutorial default short, we will give only minimal information here. The on User's Guide default has a great deal of information on differences between LyX and LaTeX, and how to do various LaTeX tricks in LyX. Subsection

TeX Mode Standard

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 sans ūnder L d̄efault ayout

ūnder T d̄efault ex _separator Style default or by clicking on the red TeX toggle button in the toolbar. Standard

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 sans Space default 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 typewriter

gamma default , then when you type sans Space default , LyX will change the red _inset Quotes eld inset

gamma _inset Quotes erd inset

to a blue _inset Quotes eld inset

_inset Formula γ inset

_inset Quotes erd inset

. This will work for almost all, non-complicated math macros (although note that functions like typewriter

sin default will remain in red, since that is already WYSIWYM). This may be faster than using the sans Math _separator Panel default , and will be especially convenient for experienced LaTeX users. Standard

As a special case, if you type a brace in Mathed's TeX mode, then Mathed will type the beginning on and default ending braces in red, then take you on out default 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. Standard

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. LyX could never support every LaTeX package. However, by typing typewriter

usepackagefoo default in the preamble (see Section _separator

_inset LatexCommand [*]

inset

), you can use any package you want — although you won't have WYSIWYG support for that package's features. Subsection

Importing LaTeX Documents— typewriter reLyX Standard

_inset LatexCommand

inset

You can import a LaTeX file into LyX by using the sans ūnder F d̄efault ile

ūnder I d̄efault mport LaTeX default command in LyX. This will call a Perl script called typewriter reLyX default —which will create a file typewriter foo.lyx default from the file typewriter foo.tex default —and then open that file. If the translation doesn't work, you can try calling typewriter reLyX default from the command line _float footnote Standard

When LyX is installed, a separate executable called typewriter reLyX default will be placed in the same folder as the typewriter lyx default executable (e.g., typewriter /usr/local/bin/reLyX default ).

typewriter reLyX default requires Perl (version 5.002 as of this writing). float , possibly using fancier options. Standard

typewriter reLyX default 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 typewriter reLyX default , you can look for red text and hand-edit it to look right. Standard

typewriter reLyX default 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. Subsection

Converting LyX Documents to LaTeX Standard

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 sans ūnder F d̄efault ile

ūnder E d̄efault xport as _separator LaTeX default . This will create a file typewriter whatever.tex default from the typewriter whatever.lyx default file you are editing. LyX always creates temporary LaTeX files when viewing or printing files, so it is very good at generating LaTeX. Subsection

LaTeX Preamble Subsubsection

Document Class Standard

The sans ūnder L d̄efault ayout

ūnder D d̄efault ocument default popup takes care of many of the options that you would input in a typewriter

documentclass default command. Change the class, default font size and paper size here. Put any extra options to the typewriter

documentclass default command in the sans E ūnder x d̄efault tra _separator Options default area. Subsubsection

Other Preamble Matter Standard

_inset LatexCommand

inset

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 sans ūnder L d̄efault ayout

ūnder L d̄efault atex _separator Preamble default and type in the popup window. Anything you type will (like TeX mode) be sent directly to LaTeX. Subsection

BibTeX Standard

LyX has support for BibTeX, which allows you to build databases of bibliographic al references to be used in multiple documents. Select sans ūnder I d̄efault nsert Lists _separator & _separator

ūnder T d̄efault OC

ūnder B d̄efault ibTeX _separator Reference default to include a typewriter bib default file. Click on the resulting _inset Quotes eld inset

BibTeX _separator Generated _separator References _inset Quotes erd inset

inset, and you will get a sans BibTeX default popup. In the sans Database default field, type what you would type inside the braces of a typewriter

bibliography default command _float footnote Standard

Like in regular LaTeX, multiple bibliographies should be separated by commas, with no whitespace. float . Similarly, in the sans Style default field, type what you would type inside the braces of a typewriter

bibliographystyle default command. Standard

After you've done this, you can use citations from any bibliographies you're including with sans ūnder I d̄efault nsert C ūnder i d̄efault tation _separator Reference default (see Section _separator

_inset LatexCommand [*]

inset

). LyX will take care of running BibTeX. As of LyX 1.0.1, the combobox in the sans Citation default popup will show a list of all the references in your typewriter bib default file. Subsection

Miscellaneous Standard

See the sans ūnder I d̄efault nsert

ūnder S d̄efault pecial _separator Character default menu for other special characters, including ellipsis, forced linebreak, and hyphenation point. Section

Errors! Standard

Sometimes when you LaTeX a document, there will be errors, things that LyX or LaTeX can't understand. When this happens, LyX will create an error box (a box with the word _inset Quotes eld inset

error _inset Quotes erd inset

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. _end