Quellcode-Bibliothek
© Kompilation durch diese Firma
[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]
Datei:
Ereignis.dat
Sprache: Delphi
Untersuchungsergebnis.lyx Download desShell {Shell[53] Scala[70] Lex[127]}zum Wurzelverzeichnis wechseln #This file was created by <mike> Thu Dec 24 12:02:43 1998
#LyX 1.0 (C) 1995-1998 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass book
\language default
\inputencoding latin1
\fontscheme default
\graphics none
\paperfontsize default
\spacing single
\papersize letterpaper
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 2
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 2
\paperpagestyle headings
\layout Title
The LyX Tutorial
\layout Author
by Amir Karger and the LyX Team
\layout Standard
\begin_inset LatexCommand \tableofcontents
\end_inset
\layout Chapter
Introduction
\layout Section
Welcome to LyX!
\layout 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.
\layout Standard
Some of you probably found your way to this document because you tried to
put two spaces after a
\begin_inset Quotes eld
\end_inset
.
\begin_inset Quotes erd
\end_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.
\layout Standard
So, bear with us and read on.
Reading this tutorial is definitely worth the time.
\layout Section
What the Tutorial
\emph on
is
\emph default
and What it
\emph on
isn't
\layout Standard
Before we get started with this section, we want to make a quick note of
something.
The
\emph on
Tutorial
\emph default
uses the notation outlined in the
\emph on
Introduction
\emph default
\SpecialChar \@.
If you came to this manual first, go read the
\emph on
Introduction
\emph default
\SpecialChar \@.
Yes, we mean now.
\layout Standard
Now that you know which fonts mean what, we want to talk a bit about what
this
\emph on
Tutorial
\emph default
is for.
\layout Subsection
Getting the Most out of the Tutorial
\layout 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.
\layout Standard
If you are familiar with LaTeX, you'll probably be able to read the
\emph on
Tutorial
\emph default
somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
However, LyX does have idiosyncrasies
\begin_float footnote
\layout Standard
or, more optimistically,
\begin_inset Quotes eld
\end_inset
features
\begin_inset Quotes erd
\end_inset
\end_float
you'll want to learn about.
Even if you don't feel like reading the rest of the
\emph on
Tutorial
\emph default
, you should definitely check out Section
\begin_inset LatexCommand \ref{sec:latexusers}
\end_inset
, which is specifically written for experienced LaTeX users.
\layout Standard
Section
\begin_inset LatexCommand \ref{sec:what-is-lyx}
\end_inset
is a holdover from an earlier version of the Tutorial, and is a bit pithy.
Still it's a nice
\begin_inset Quotes eld
\end_inset
at-a-distance
\begin_inset Quotes erd
\end_inset
introduction to LyX, so you might want to glance over it to get a feel
for what LyX is all about.
\layout Subsection
What You
\emph on
won't
\emph default
Find:
\layout Itemize
Spoon-feeding or other dumbing-down.
\begin_deeper
\layout Standard
The trend in computer self-help literature these days
\begin_float footnote
\end_deeper
\layout Standard
Note from
\noun on
John
\noun default
Weiss: \SpecialChar \ldots{}
well, at least in America, where we dumb everything down to the lowest
common denominator\SpecialChar \ldots{}
\end_float
seems to be:
\begin_inset Quotes eld
\end_inset
Assume the user has the I.
Q.
of a potato.
\begin_inset Quotes erd
\end_inset
We don't do that.
\begin_deeper
\layout 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
\emph on
not
\emph default
stupid, we do understand that you might be a tad clueless or confused.
\end_deeper
\layout Itemize
Instructions how to use a mouse or a keyboard.
\begin_deeper
\layout 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.
\begin_float footnote
\end_deeper
\layout Standard
Besides which, if you're using LyX to begin with, you'll probably have more
than half a brain in your head.
\end_float
\layout Itemize
Detailed explanations of all of LyX's features.
\begin_deeper
\layout Standard
What, you want the
\emph on
User's Guide
\emph default
twice?
\layout Standard
Seriously, though, we're here to get you up and running so that all you
need is the
\emph on
User's Guide
\emph default
.
If we tried to duplicate all of the information about all of LyX's features
in here, the
\emph on
Tutorial
\emph default
would be redundant, too long, and forever out of date.
All we do here is introduce things; imagine there is a
\begin_inset Quotes eld
\end_inset
see the
\emph on
User's Guide
\emph default
\begin_inset Quotes erd
\end_inset
at the end of every section.
\end_deeper
\layout Itemize
Detailed explanations of LaTeX.
\begin_deeper
\layout 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\SpecialChar \ldots{}
\end_deeper
\layout 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
\begin_inset LatexCommand \ref{sec:first-doc-ex}
\end_inset
.
\layout Section
What is LyX?
\begin_inset LatexCommand \label{sec:what-is-lyx}
\end_inset
\layout Subsection
Overview
\layout 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
\begin_inset Quotes eld
\end_inset
_
\begin_inset Quotes erd
\end_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.
\layout Standard
In other words, we've all been trained to worry about the little details
of which character goes where.
\layout 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.
\layout Standard
This is where LyX differs from an ordinary word processor.
You don't concern yourself with what character goes where.
You tell LyX
\emph on
what you're doing
\emph default
and LyX takes care of the rest, following a set of rules called a
\emph on
style
\emph default
.
Let's look at a little example:
\layout Standard
Suppose you're writing a report.
To begin your report, you want a section called
\begin_inset Quotes eld
\end_inset
Introduction\SpecialChar \@.
\begin_inset Quotes erd
\end_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,
\begin_inset Quotes eld
\end_inset
1.__Introduction
\begin_inset Quotes erd
\end_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.
\layout Standard
In LyX, you go to the pull-down on the far left of the button bar and select
\family sans
Section
\family default
, and type
\begin_inset Quotes eld
\end_inset
Introduction\SpecialChar \@.
\begin_inset Quotes erd
\end_inset
\layout 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.
\layout Standard
Then there's the problem of consistency.
Five days later, you reopen your report and start section 4.
However, you forget that you were using 18pt bold instead of 16pt, so you
type in the heading for section 4 in a different font that what you used
for section 1.
That problem doesn't even exist in LyX.
The computer takes care of all that silly bookkeeping about which thing
has what size font, not you.
After all, that's what a computer is good at.
\layout 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.
\layout Standard
So, the basic idea behind LyX is: specify what you're doing, not how to
do it.
Instead of
\begin_inset Quotes eld
\end_inset
what you see is what you get,
\begin_inset Quotes erd
\end_inset
the LyX model is
\begin_inset Quotes eld
\end_inset
what you see is what you
\emph on
mean
\emph default
\begin_inset Quotes erd
\end_inset
(WYSIWYM).
\layout Subsection
Differences between LyX and Word Processors
\begin_float footnote
\layout 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 99% of people have about word processing.
\end_float
\layout Standard
Here's a list of things you won't find in LyX:
\layout Itemize
The document ruler
\layout Itemize
Tab stops
\layout Itemize
Extra whitespace [i.e.
hitting
\family sans
Enter
\family default
or
\family sans
Space
\family default
two or more times]
\layout 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.
\layout Standard
Here are some things that exist in LyX, but aren't used as you might think:
\layout Itemize
Indenting controls
\layout Itemize
Page breaks
\layout Itemize
Line spacing [i.e.
single spaced, double spaced, etc.]
\layout Itemize
Whitespace, horizontal and vertical
\layout Itemize
Fonts and font sizes
\layout Itemize
Typefaces [bold, italic, underline, etc.]
\layout 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.
\begin_float footnote
\layout 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
\emph on
User's Guide
\emph default
for details.
\end_float
\layout Standard
Lastly, there are a few areas where LyX [and LaTeX] surpasses many word
processors:
\layout Itemize
Hyphenation
\layout Itemize
Lists of any type
\layout Itemize
Mathematics
\layout Itemize
Tables
\layout Itemize
Cross-referencing
\layout 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
\emph on
works
\emph default
.
All of the bugs have been long since ironed out.
\begin_float footnote
\layout Standard
Okay, we know nothing is perfect, but LaTeX is as close to bug-free as any
computer program can get.
\end_float
\layout Subsection
What the heck
\emph on
is
\emph default
LaTeX?
\layout Standard
LaTeX is a document preparation system designed by Leslie Lamport in 1985.
\begin_float footnote
\layout Standard
The source for the info in this section is
\begin_inset Quotes eld
\end_inset
\emph on
A Guide to LaTeX2e
\emph default
,
\begin_inset Quotes erd
\end_inset
by Helmut Kopka and Patrick Daly, which has an entry in the bibliography
of the
\emph on
User's Guide
\emph default
\SpecialChar \@.
\end_float
It, in turn, was built up from a typesetting language called TeX, created
by Donald Knuth in 1984.
\begin_inset Quotes eld
\end_inset
TeX
\begin_inset Quotes erd
\end_inset
is pronounced like
\begin_inset Quotes eld
\end_inset
blech!
\begin_inset Quotes erd
\end_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
\begin_inset Quotes eld
\end_inset
device independent
\begin_inset Quotes erd
\end_inset
format file, or
\family typewriter
dvi
\family default
for short.
You can then feed the
\family typewriter
dvi
\family default
file to anything that understands
\family typewriter
dvi
\family default
, or converts
\family typewriter
dvi
\family default
to other formats like PostScript®.
\layout 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.
\layout 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\SpecialChar \@.
Ordinary users
don't work with raw TeX, which are the bare-bones typesetting commands.
People creating new macro-packages do that.
And here's where Leslie Lamport enters our story.
He wanted a macro package that was more user-oriented and less typesetter-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.
\layout 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 using of new
fonts, and so on.
In fact, LaTeX is quite an extensive language in its own right! Users around
the world have been creating their own add-ons for LaTeX beyond the standard
ones.
\layout Standard
There are two ways to extend LaTeX: classes and styles.
A
\emph on
class
\emph 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\SpecialChar \ldots{}
some universities
even have a class for their thesis format! A
\emph on
style
\emph default
differs from a class in that it doesn't define a new type of document,
but a different type of
\emph on
behavior
\emph 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.
\layout Standard
Here's a summary:
\layout List
\labelwidthstring 00.00.0000
TeX: Typesetting language with macro capability.
\layout List
\labelwidthstring 00.00.0000
LaTeX: Macro package built upon TeX\SpecialChar \@.
\layout List
\labelwidthstring 00.00.0000
classes: Descriptions of a type of document, using LaTeX\SpecialChar \@.
\layout List
\labelwidthstring 00.00.0000
styles: Alters the default behavior of LaTeX in some way.
\layout List
\labelwidthstring 00.00.0000
LyX: Visual, WYSIWYM word-processor that uses LaTeX in all its glory to
do its printing.
\layout Standard
The idea of this section was to try and explain
\emph on
why
\emph 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 ---
\emph on
what
\emph default
you are typing.
The computer then handles how it should look.
\layout Standard
Oh --- one last thing.
LaTeX is pronounced like TeX is.
It rhymes with
\begin_inset Quotes eld
\end_inset
hey blech.
\begin_inset Quotes erd
\end_inset
\begin_float footnote
\layout Standard
or
\begin_inset Quotes eld
\end_inset
ha blech
\begin_inset Quotes erd
\end_inset
, depending on how you pronounce your
\begin_inset Quotes eld
\end_inset
a
\begin_inset Quotes erd
\end_inset
s\SpecialChar \ldots{}
\end_float
Usually.
Lamport says in his book, though, that
\begin_inset Quotes eld
\end_inset
\emph on
lay
\emph default
-tecks is also possible
\begin_inset Quotes erd
\end_inset
.
\begin_inset Quotes eld
\end_inset
LyX,
\begin_inset Quotes erd
\end_inset
on the other hand, is pronounced
\begin_inset Quotes eld
\end_inset
licks.
\begin_inset Quotes erd
\end_inset
Or
\begin_inset Quotes eld
\end_inset
lucks,
\begin_inset Quotes erd
\end_inset
or
\begin_inset Quotes eld
\end_inset
looks,
\begin_inset Quotes erd
\end_inset
depending on what country you're from\SpecialChar \ldots{}
\layout Chapter
Getting Started with LyX
\layout Section
Your First LyX Document
\layout Standard
\begin_inset LatexCommand \label{sec:first-doc-ex}
\end_inset
OK\SpecialChar \@.
You're ready to start writing.
Before you do, though, there are a few things we need to mention, which
will hopefully make the
\emph on
Tutorial
\emph default
more instructive, useful, and fun.
\layout Standard
Because there's lots of information that we won't be giving you, the
\series bold
first
\series medium
thing that you need to do is find the
\series default
other
\series medium
help files.
Luckily, this is very simple.
\series default
Start up LyX.
Choose the
\emph on
User's Guide
\emph default
from the
\family sans
\bar under
H
\bar default
elp
\family default
menu.
You may want to load the
\emph on
Tutorial
\emph 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
\begin_float footnote
\layout Standard
They can also serve as good examples of how to use the many features of
LyX.
\end_float
.
Note that once you've got more than one document open, you can use the
\family sans
\bar under
D
\bar default
ocuments
\family default
menu to switch between them.
The
\emph on
Tutorial
\emph 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
\emph on
Tutorial
\emph 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.
\layout Standard
In this
\emph on
Tutorial
\emph default
, we're going to assume that you have a fully working version of LyX, as
well as LaTeX,
\family typewriter
xdvi
\family default
or some other dvi viewer,
\family typewriter
dvips
\family default
or some other way of converting
\family typewriter
dvi
\family 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.
\layout Standard
Finally, we've written a file to let you practice your LyX skills on.
It's called
\family typewriter
example_raw.lyx
\family 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
\family typewriter
example_raw.lyx
\family default
.
It also contains
\begin_inset Quotes eld
\end_inset
subtle
\begin_inset Quotes erd
\end_inset
hints about how to fix things.
If you want to cheat (or check what you've done), there's also a file called
\family typewriter
example_lyxified.lyx
\family default
which contains the same text as written and typeset by a LyX master.
\layout Subsection
Typing, Viewing, and Printing
\layout Itemize
Open a new file with
\family sans
\bar under
F
\bar default
ile->
\bar under
N
\bar default
ew
\layout Itemize
Type a sentence like:
\family typewriter
This is my first LyX document!
\begin_float footnote
\layout 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 any thing
we ask you to type in the future.
\end_float
\layout Itemize
Save your document with
\family sans
\bar under
F
\bar default
ile->Save
\protected_separator
\bar under
A
\bar default
s\SpecialChar \@.
\layout Itemize
Run LaTeX to create a
\family typewriter
dvi
\family default
file, with
\family sans
\bar under
F
\bar default
ile->View
\protected_separator
dvi
\family default
\SpecialChar \@.
You may see things being printed in the window you ran the
\family typewriter
lyx
\family default
command from.
These are messages from LaTeX, which you can ignore for now.
LyX will run
\family typewriter
xdvi
\family default
(or some other
\family typewriter
dvi
\family default
viewer), which will pop up a new window displaying what your document will
look like when printed.
\begin_float footnote
\layout Standard
You can save time by leaving
\family typewriter
xdvi
\family default
running in the background.
Then, you can use
\family sans
\bar under
F
\bar default
ile->
\bar under
U
\bar default
pdate
\protected_separator
dvi
\family default
and just click on the
\family typewriter
xdvi
\family default
window (or unminimize it) after LaTeX finishes running.
\end_float
\layout Itemize
Print by using
\family sans
\bar under
F
\bar default
ile->
\bar under
P
\bar default
rint
\family default
and hitting
\family sans
OK\SpecialChar \@.
\layout 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
\emph on
Tutorial
\emph default
, the
\emph on
User's Guide
\emph default
, and the
\emph on
Reference
\emph default
.
\layout Subsection
Simple Operations
\layout 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
\begin_float footnote
\layout Standard
If you're like many
\noun on
unix
\noun default
users, you did so long before starting to read the
\emph on
Tutorial
\emph default
.
\end_float
and you'll see that most of the simple commands (e.g.,
\family sans
E
\bar under
x
\bar default
it,
\bar under
P
\bar default
aste,
\bar under
P
\bar default
rint)
\family 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.
\layout Description
Undo LyX has
\emph on
capacity
\emph default
for
\begin_inset Quotes eld
\end_inset
infinite undo
\begin_inset Quotes erd
\end_inset
, which means you can undo everything you've done since your current editing
session started, by selecting
\family sans
\bar under
E
\bar default
dit->
\bar under
U
\bar default
ndo
\family default
over and over again.
If you undo too much, just select
\family sans
\bar under
E
\bar default
dit->
\bar under
R
\bar default
edo
\family default
to get it back.
\emph on
Currently---in the beta-version---the undo levels is limited to 100 steps,
until the undo mechanism has been thoroughly tested.
Undo also doesn't work for
\emph default
everything
\emph on
, not for changes to the document layout for instance.
\layout Description
Cut/Paste/Copy Use
\family sans
\bar under
E
\bar default
dit->
\bar under
C
\bar default
ut
\family default
,
\family sans
\bar under
E
\bar default
dit->
\bar under
P
\bar default
aste
\family default
, and
\family sans
\bar under
E
\bar default
dit->C
\bar under
o
\bar default
py
\family default
to cut, paste, and copy.
Or automatically paste selected text with the
\emph on
middle button
\emph default
.
\layout Description
Find/Replace Use
\family sans
\bar under
E
\bar default
dit->
\bar under
F
\bar default
ind
\protected_separator
&
\protected_separator
Replace
\family default
for a case-sensitive search.
In the resulting popup, search with the forward and backward arrows, and
use the
\family sans
\bar under
R
\bar default
eplace
\family default
button to replace a word you've found.
\begin_float footnote
\layout Standard
Close the window when you'r done.
Or leave it open if you find it more convenient.
Most popups in LyX --- including the
\family sans
\bar under
F
\bar default
ind
\protected_separator
&
\protected_separator
Replace
\family default
,
\family sans
Table
\protected_separator
of
\protected_separator
Contents
\family default
, and
\family sans
Layout
\family default
popups, as well as the various math popups --- are windows that may be
lowered, rather than closed.
A few popups, like
\family sans
\bar under
F
\bar default
ile->
\bar under
O
\bar default
pen
\family 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.
\end_float
\layout Description
Character
\protected_separator
Formatting You can
\emph on
emphasize
\emph default
text (which will generally put characters in italics), put it in
\series bold
bold face
\series default
, or in
\noun on
Noun Style
\noun default
(usually small caps, used for people's names) from the toggle buttons in
the
\family sans
\bar under
L
\bar default
ayout
\family default
menu.
\layout 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
\family sans
Paste
\family default
and
\family sans
Print
\family 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.
\layout 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.
\layout Subsection
WYSIWYM: Whitespace in LyX
\layout Standard
\begin_inset LatexCommand \label{sec:whitespace}
\end_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
\family sans
Return
\family default
, you'll only get one blank line.
As many times as you hit
\family sans
Space
\family default
, you'll only get one space.
On a blank line, LyX won't let you type even one space.
The
\family sans
Tab
\family default
key won't move you forward one tab stop; in fact there
\emph on
are
\emph default
no tab stops! There's no ruler at the top of the page to let you set tabs
or margins, either.
\layout Standard
Many commercial word processors are based on the WYSIWYG principle:
\begin_inset Quotes eld
\end_inset
What You See Is What You Get.
\begin_inset Quotes erd
\end_inset
LyX, on the other hand, is based on the principle that
\begin_inset Quotes eld
\end_inset
What You See Is What You
\emph on
Mean
\emph default
.
\begin_inset Quotes erd
\end_inset
You type what you mean, and LyX will take care of typesetting it for you,
so that the output looks nice.
A
\family sans
Return
\family default
grammatically separates paragraphs, and a
\family sans
Space
\family default
grammatically separates words, so there is no reason to have several of
them in a row; a
\family sans
Tab
\family 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
\emph on
content
\emph default
of your document, and less time worrying about the
\emph on
format.
\emph default
See Section
\begin_inset LatexCommand \ref{sec:what-is-lyx}
\end_inset
for more information on the WYSIWYM concept.
\layout Standard
LyX does have (many) ways to fine-tune the formatting of your document.
After all, LyX might not typeset
\emph on
exactly
\emph default
what you mean.
The
\emph on
User's Guide
\emph default
has information about all that.
It includes
\family sans
HFill
\family 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.
\layout Section
Environments
\layout Standard
Different parts of a document have different purposes; we call these parts
\emph on
environments
\emph 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.
\layout Standard
Environments are a major part of the
\begin_inset Quotes eld
\end_inset
What You See Is What You Mean
\begin_inset Quotes erd
\end_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.
\layout Standard
The
\family sans
Environment
\family default
box is located on the left end of the toolbar (just under the
\family sans
\bar under
F
\bar default
ile
\family default
menu).
It indicates which environment you're currently writing in.
While you were writing your first document, it said
\begin_inset Quotes eld
\end_inset
Standard,
\begin_inset Quotes erd
\end_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
\family sans
Environment
\family default
menu, which you open by clicking on the
\begin_inset Quotes eld
\end_inset
down arrow
\begin_inset Quotes erd
\end_inset
icon just to the right of the
\family sans
Environment
\family default
box.
\layout Subsection
Sections and Subsections
\layout Standard
Type the word
\family typewriter
Introduction
\family default
on the first line of your LyX file, and select
\family sans
Section
\family default
from the
\family sans
Environment
\family default
menu
\begin_float footnote
\layout Standard
You don't have to
\emph on
select
\emph 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.
\end_float
.
LyX numbers the section
\begin_inset Quotes eld
\end_inset
1
\begin_inset Quotes erd
\end_inset
and typesets the section heading (title) in a larger font.
(Of course, the section heading will also be typeset correctly in the
\family typewriter
dvi
\family default
or printed document.) Now hit
\family sans
Return
\family default
\SpecialChar \@.
Note that the
\family sans
Environment
\family default
box changes from
\begin_inset Quotes eld
\end_inset
Section
\begin_inset Quotes erd
\end_inset
back to
\begin_inset Quotes eld
\end_inset
Standard
\begin_inset Quotes erd
\end_inset
.
Section headings, like most environments, are assumed to end when you type
\family sans
Return
\family default
\SpecialChar \@.
\begin_float footnote
\layout Standard
See the
\emph on
User's Guide
\emph default
for ways to write titles with two or more lines.
The
\family sans
Standard
\family default
environment can of course continue for several paragraphs.
The various list environments (see below) also don't end when you hit
\family sans
Return
\family default
.
You can always tell what environment you're currently in by looking at
the
\family sans
Environment
\family default
box.
\end_float
Type the document introduction:
\layout LyX-Code
This is an introduction to my first LyX document.
\layout Standard
Hit
\family sans
Return
\family default
again, and select
\family sans
Section
\family default
from the
\family sans
Environment
\family default
menu again.
LyX writes a
\begin_inset Quotes eld
\end_inset
2
\begin_inset Quotes erd
\end_inset
and waits for you to type a title.
Type
\family typewriter
More Stuff
\family default
, and you'll see that LyX again sets it as a section title.
\layout Standard
It gets better.
Go to the end of section one again (after
\begin_inset Quotes eld
\end_inset
my first LyX document
\begin_inset Quotes erd
\end_inset
) and hit
\family sans
Return
\family default
again, and select
\family sans
Section
\family default
from the
\family sans
Environment
\family default
menu again.
Again, LyX writes
\begin_inset Quotes eld
\end_inset
2
\begin_inset Quotes erd
\end_inset
and waits for you to type a title.
Type
\family typewriter
About This Document
\family default
.
Section
\begin_inset Quotes eld
\end_inset
More Stuff
\begin_inset Quotes erd
\end_inset
, which used to be section 2, has been automatically renumbered to section
3! In true WYSIWYM fashion, you just need to identify the text that makes
up the section titles, and LyX takes care of numbering the sections and
typesetting them.
\layout Standard
Hit
\family sans
Return
\family default
to get back to the
\family sans
Standard
\family default
environment, and type the following five lines:
\layout LyX-Code
Sections and subsections are described below.
\layout LyX-Code
Section Description
\layout LyX-Code
Sections are bigger than subsections.
\layout LyX-Code
Subsection description
\layout LyX-Code
Subsections are smaller than sections.
\layout Standard
Click on the second line and select
\family sans
Subsection
\family default
from the
\family sans
Environment
\family default
menu.
LyX numbers the subsection
\begin_inset Quotes eld
\end_inset
2.1
\begin_inset Quotes erd
\end_inset
, and typesets it in a font which is bigger than regular text but smaller
than the section title.
Change the fourth line
\family sans
Subsection
\family default
environment as well.
As you probably expected, LyX automatically numbered the section
\begin_inset Quotes eld
\end_inset
2.2
\begin_inset Quotes erd
\end_inset
.
If you put yet another section before section 2, section 2 will be renumbered
as section 3, and the subsections will be renumbered to
\begin_inset Quotes eld
\end_inset
3.1
\begin_inset Quotes erd
\end_inset
and
\begin_inset Quotes eld
\end_inset
3.2
\begin_inset Quotes erd
\end_inset
.
\layout Standard
Further levels of sectioning include
\family sans
Subsubsection
\family default
,
\family sans
Paragraph
\family default
, and
\family sans
Subparagraph
\family 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
\emph on
User's Guide
\emph default
to change this.
\family sans
Chapter
\family default
headings are actually the highest level of sectioning, above
\family sans
Section
\family default
s, but you're only allowed to use them in certain types (textclasses) of
LyX documents (see Section
\begin_inset LatexCommand \ref{sec:textclasses}
\end_inset
).
\layout 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
\family sans
Section*
\family default
environment (you may have to scroll down in the
\family sans
Environment
\family 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
\begin_inset Quotes eld
\end_inset
starred
\begin_inset Quotes erd
\end_inset
heading environments for
\family sans
Subsection
\family default
and
\family sans
Subsubsection
\family default
.
Try changing some of your sections or subsections to the starred environments,
and note how the other sections' numbers are updated.
\layout Standard
\series bold
Exercise
\series default
: Fix the section and subsection headings in
\family typewriter
example_raw.lyx
\family default
.
You'll find this document in the
\family typewriter
examples/
\family default
directory, which you can get to by selecting
\family sans
\bar under
O
\bar default
pen->
\bar under
F
\bar default
ile
\family default
and then clicking on the
\family sans
Examples
\family default
button.
Open the document, and use
\family sans
\bar under
F
\bar default
ile->Save
\bar under
A
\bar default
s
\family default
to save a copy in your own directory for you to work on.
\layout Subsection
Lists and sublists
\layout Standard
LyX has several different environments for typesetting lists.
The various list environments free you from hitting
\family sans
Tab
\family 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.
\begin_float footnote
\layout Standard
Yes, we're overemphasizing this point throughout the
\emph on
Tutorial
\emph default
.
But it
\emph on
is
\emph default
the main philosophy of LyX, so please forgive us.
\end_float
Different types of documents logically require different list environments:
\layout Itemize
A slide presentation might use the
\family sans
Itemize
\family default
environment's bulleted lists to describe different points.
\layout Itemize
An outline would use the
\family sans
Enumerate
\family default
environment's numbered lists (and lettered sublists).
\layout Itemize
A document describing several software packages could use the
\family sans
Description
\family default
environment, where each item in the list begins with a boldfaced word.
\layout Itemize
The
\family sans
List
\family default
environment --- not found in LaTeX --- is a slightly different form of
\family sans
Description
\family default
.
\layout Standard
Let's write a list of reasons why LyX is better than other word processors.
Somewhere in your document, type:
\layout Standard
\family typewriter
Lyx is better than other word processors because:
\layout Standard
and hit
\family sans
Return
\family default
.
Now select
\family sans
Itemize
\family default
from the
\family sans
Environment
\family default
menu.
LyX writes a
\begin_inset Quotes eld
\end_inset
bullet
\begin_inset Quotes erd
\end_inset
(actually, an asterisk, which will be converted to a round circle on output)
on the line.
Type in your reasons:
\layout LyX-Code
Typesetting is done for you.
\layout LyX-Code
Math is WYSIWYG
\layout LyX-Code
Lists are very easy to create!
\layout Standard
List environments, unlike headings, do not end when you type
\family sans
Return
\family 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
\emph on
item
\emph default
, one way is to use the
\family sans
Protected
\protected_separator
Return
\family default
, which you get by typing
\family sans
C-Return
\family default
.
In order to get out of the list, you need to reselect the
\family sans
Standard
\family default
environment (or just use the keybinding,
\family sans
M-p
\protected_separator
s
\family default
).
\layout 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
\begin_float footnote
\layout Standard
LyX won't let you select the first bullet unless you also select the paragraph
\emph on
before
\emph 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.
\end_float
and choose
\family sans
Enumerate
\family default
from the
\family sans
Environment
\family default
menu.
Pow! As we mentioned, if you add or delete a list item, LyX will fix the
numbering.
\layout Standard
While the list is still selected, you can change to the other two list environme
nts,
\family sans
Description
\family default
and
\family sans
List
\family 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
\family sans
Return
\family default
.) The term is either typeset in boldface (
\family sans
Description
\family default
) or separated by a
\begin_inset Quotes eld
\end_inset
Tab
\begin_inset Quotes erd
\end_inset
\begin_float footnote
\layout Standard
But a typesetter's tab, which will change to fit the size of the largest
term, not a pathetic, rigid, unchangeable typewriter
\family sans
Tab
\family default
.
\end_float
(
\family sans
List
\family default
) from the rest of the paragraph.
If you want to have more than one word in the definition, then separate
the words with
\family sans
Protected
\protected_separator
Space
\family default
s, which are made by typing
\family sans
C-Space
\family default
and show up as small pink
\begin_inset Quotes eld
\end_inset
u
\begin_inset Quotes erd
\end_inset
s.
\layout Standard
\series bold
Exercise
\series default
: Typeset the list in
\family typewriter
example_raw.lyx
\layout 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
\emph on
User's Guide
\emph default
for details on the different sorts of lists, as well as examples which
use
\emph on
a lot
\emph default
of nesting.
\layout Subsection
Other Environments: Verses, Quotations, and More
\layout Standard
There are two environments for setting quotations apart from surrounding
text:
\family sans
Quote
\family default
for short quotes and
\family sans
Quotation
\family default
for longer ones.
Computer code (the
\family sans
LyX-Code
\family default
environment, also used in the
\emph on
Tutorial
\emph default
for the long typing examples) is written in a
\family typewriter
typewriter
\family 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
\begin_float footnote
\layout Standard
\SpecialChar \ldots{}
assuming you're creative enough to come up with poetry in the first place.
\end_float
using the
\family sans
Verse
\family default
style, using
\family sans
Return
\family default
to separate stanzas, and
\family sans
C-Return
\family default
to separate lines within a stanza.
See the
\emph on
User's Guide
\emph default
for more complete descriptions of all of the available LyX environments.
\layout Standard
\series bold
Exercise
\series default
: Correctly typeset the
\family sans
Quote, LyX-Code,
\family default
and
\family sans
Verse
\family default
in
\latex latex
\backslash
linebreak
\latex default
\family typewriter
example_raw.lyx
\layout Chapter
Writing Documents
\layout 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.
\layout Section
Textclasses and Templates: Writing Letters
\layout Standard
\begin_inset LatexCommand \label{sec:textclasses}
\end_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
\emph on
textclass
\begin_float footnote
\layout Standard
LaTeX users: this is equivalent to the LaTeX documentclass
\end_float
takes care of these large scale differences between different sorts of
documents.
This
\emph on
Tutorial
\emph default
, for example, was written in the
\family sans
Book
\family 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.
\layout Standard
Your document is probably being written in the
\family sans
Article
\family default
textclass
\begin_float footnote
\layout Standard
That's usually the default textclass, although you can set it in your
\family typewriter
lyxrc
\family default
file.
\end_float
.
Try changing to other textclasses (using the
\family sans
\bar under
C
\bar default
lass
\family default
menu in the
\family sans
\bar under
L
\bar default
ayout->
\bar under
D
\bar default
ocument
\family default
popup) to see how they are typeset differently.
If you change your document to the
\family sans
Book
\family default
textclass and look at the
\family sans
Environment
\family default
menu, you'll see that most of the allowed environments are the same.
However, you can now use the
\family sans
Chapter
\family default
environment.
If you're ever unsure about which environments you can use in a given textclass
, just consult the
\family sans
Environment
\family default
menu.
\layout 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
\begin_inset Quotes eld
\end_inset
style files
\begin_inset Quotes erd
\end_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
\family sans
Article
\protected_separator
(AMS)
\family default
textclass.
\layout Standard
Here's a very quick reference to some of the textclasses.
As usual, see the
\emph on
User's Guide
\emph default
for details.
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
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
\newline
Notes
\newline
article
\newline
one-sided, no chapters
\newline
article (AMS)
\newline
layout & environments for American Math Society
\newline
report
\newline
longer than article, two-sided
\newline
book
\newline
report + front and back matter
\newline
slides
\newline
transparencies (also including FoilTeX)
\newline
letter
\newline
lots of extra environments for address, signature\SpecialChar \ldots{}
\layout Section
Templates: Writing a Letter
\layout Standard
One of the most popular textclasses is
\family sans
Letter
\family default
\SpecialChar \@.
One way to write a letter would be to open a
\family sans
\bar under
N
\bar default
ew
\family default
file, and choose
\family sans
Letter
\family default
from the
\family sans
\bar under
C
\bar default
lass
\family default
menu in the
\family sans
\bar under
L
\bar default
ayout->
\bar under
D
\bar default
ocument
\family 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
\emph on
template
\emph 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.
\layout Standard
Open a new file with
\family sans
\bar under
F
\bar default
ile->New
\protected_separator
from
\protected_separator
\bar under
t
\bar default
emplate
\family default
.
After choosing a new filename, select
\family typewriter
latex_letter.lyx
\family default
from the
\family sans
Choose
\protected_separator
Template
\family default
popup.
Save and print the file to see how the various environments are typeset.
\layout Standard
When you look at the
\family sans
Environment
\family default
menu, you'll see several environments, like the
\family sans
My
\protected_separator
Address
\family default
environment, which don't even exist in most other textclasses.
Others, like
\family sans
Quote
\family default
and
\family sans
Description
\family 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
\family sans
Signature
\family default
environment has the word
\begin_inset Quotes eld
\end_inset
Signature:
\begin_inset Quotes eld
\end_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
\family sans
Signature
\family default
line is placed.
Remember, LyX is WYSIWYM; you can put the
\family sans
Signature
\family default
environment anywhere you want, but LyX knows that in the printout, the
signature should be at the end.
\layout 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
\begin_inset Quotes eld
\end_inset
exercise
\begin_inset Quotes erd
\end_inset
here; just write a letter to someone
\begin_float footnote
\layout 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
\family sans
My
\protected_separator
Address
\family 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 an environment cannot exist without any text in it.
Just reselect the environment from the
\family sans
Environment
\family default
menu to get it back.
\end_float
!
\layout Section
Document Titles
\layout 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.
\layout Standard
Go back to your
\family typewriter
newfile.lyx
\family default
document and make sure it's using the
\family sans
Article
\family default
textclass.
\begin_float footnote
\layout Standard
You should not be using the letter any more, since the
\family sans
Letter
\family default
textclass doesn't allow titles.
\end_float
Type a title on the first line, and change the line to the
\family sans
Title
\family default
environment.
On the next line, type your name and change it to the
\family sans
Author
\family default
environment.
On the next line, write the date in the
\family sans
Date
\family default
environment.
Type a paragraph or two summarizing your document using the
\family sans
Abstract
\family default
environment.
Now see how it looks when printed.
\layout Standard
\series bold
Exercise
\series default
: Fix the title, date, and author in
\family typewriter
example_raw.lyx
\layout Section
Labels and Cross-References
\layout Standard
\begin_inset LatexCommand \label{sec:labels}
\end_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.
\layout Subsection*
Your first label
\layout Standard
Let's mark our second section, whose title is
\begin_inset Quotes eld
\end_inset
About This Document
\begin_inset Quotes erd
\end_inset
.
Click at the end of the section title line, and select
\family sans
\bar under
I
\bar default
nsert->
\bar under
L
\bar default
abel
\family default
.
A popup asks you for a section name.
Type
\family typewriter
sec:aboutdocument
\family default
, which seems like a good descriptive label that won't get confused with
other labels we might add.
\begin_float footnote
\layout Standard
We write
\begin_inset Quotes eld
\end_inset
sec:
\begin_inset Quotes eld
\end_inset
because you can also label equations, tables, and figures.
\end_float
When you click on
\family sans
OK
\family default
, the label name will be placed in a box next to the section title.
\layout 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.
\layout Standard
So far you haven't done anything --- the
\family typewriter
dvi
\family 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.
\layout Subsection*
Your first cross-references
\layout Standard
Place the cursor somewhere in section 2 of your document.
Type
\layout LyX-Code
If you want to know more about this document, then see
\newline
section
\protected_separator
, which can be found on page
\protected_separator
.
\layout Standard
Now --- with the cursor after the word
\begin_inset Quotes eld
\end_inset
section
\begin_inset Quotes erd
\end_inset
\family typewriter
\family default
--- choose
\family sans
\bar under
I
\bar default
nsert->
\bar under
C
\bar default
ross-Reference
\family default
.
The
\family sans
Insert
\protected_separator
Reference
\family default
popup pops up.
It shows a list of the possible labels you can reference.
At the moment, there should be only one,
\begin_inset Quotes eld
\end_inset
sec:aboutdocument
\begin_inset Quotes erd
\end_inset
.
Select it (it may be selected by default) and click on
\family sans
\bar under
I
\bar default
nsert
\protected_separator
Reference
\family default
.
Now put the cursor after the word
\begin_inset Quotes eld
\end_inset
page
\begin_inset Quotes erd
\end_inset
, and click on
\family sans
Insert
\protected_separator
\bar under
P
\bar default
age
\protected_separator
Number
\family default
from the
\family sans
Insert
\protected_separator
Reference
\family default
popup.
\layout 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
\family sans
Insert
\protected_separator
Reference
\family 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.
Use
\family sans
\bar under
F
\bar default
ile->
\bar under
U
\bar default
pdate
\protected_separator
dvi
\family default
, and you'll see that on the last page we refer to
\begin_inset Quotes eld
\end_inset
section 2
\begin_inset Quotes erd
\end_inset
and
\begin_inset Quotes eld
\end_inset
page 1
\begin_inset Quotes erd
\end_inset
(or whatever page section 2's title is on).
\layout Subsection*
More fun with labels
\layout Standard
We told you that LyX worries about numbering cross-references; now you can
test that.
Add a new section before section 2.
Now rerun LaTeX, and --- voilà! --- the section cross reference changed
to 3! Change
\begin_inset Quotes eld
\end_inset
About this Document
\begin_inset Quotes erd
\end_inset
to a subsection, and the cross-reference will reference subsection 2.1 instead
of section 3.
The page reference won't change unless you add a whole page of text before
the label, of course.
\layout Standard
\latex latex
\backslash
begin{sloppypar}
\layout Standard
If you want some more practice with labels, then try putting a label,
\begin_inset Quotes eld
\end_inset
sec:myfirstlabel
\begin_inset Quotes erd
\end_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
\family sans
Insert
\protected_separator
Reference
\family default
window open.
\layout Standard
\latex latex
\backslash
end{sloppypar}
\layout Standard
If you want to make sure that the cross-referencing gets the pages right
even for larger documents,
\family sans
\bar under
C
\bar default
opy
\family default
a couple pages of text from the
\emph on
User's Guide
\emph default
to the clipboard, and
\family sans
\bar under
P
\bar default
aste
\family default
the stolen text into your document
\begin_float footnote
\layout 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
\begin_inset LatexCommand \ref{sec:textclasses}
\end_inset
.
\end_float
.
\layout Standard
\series bold
Exercise
\series default
: Fix the references in
\family typewriter
example_raw.lyx
\layout Section
Footnotes and Margin Notes
\layout Standard
Footnotes can be added using the
\family sans
Insert
\protected_separator
Footnote
\family default
button in the toolbar
\begin_float footnote
\layout Standard
The button shows an arrow pointing to red text, which is just below some
black text.
\end_float
or
\family sans
\bar under
I
\bar default
nsert->
\bar under
F
\bar default
ootnote
\family default
\SpecialChar \@.
Click at the end of the word
\begin_inset Quotes eld
\end_inset
LyX
\begin_inset Quotes erd
\end_inset
somewhere in your document and hit the
\family sans
Insert
\protected_separator
Footnote
\family 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
\begin_inset Quotes eld
\end_inset
foot
\begin_inset Quotes erd
\end_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
\layout LyX-Code
LyX is a typesetting word processor.
\layout Standard
Now click on the word
\begin_inset Quotes eld
\end_inset
foot.
\begin_inset Quotes erd
\end_inset
The footnote line disappears, leaving the word
\begin_inset Quotes eld
\end_inset
foot
\begin_inset Quotes erd
\end_inset
, superscripted in red, showing where the footnote marker will be in the
printed text; this is called
\begin_inset Quotes eld
\end_inset
folding
\begin_inset Quotes erd
\end_inset
the footnote.
You can unfold the footnote at any time --- and re-edit its text, if you
want --- by clicking on the red
\begin_inset Quotes eld
\end_inset
foot
\begin_inset Quotes erd
\end_inset
marker.
\layout 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
\family typewriter
dvi
\family 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.
\layout 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
--> --------------------
--> maximum size reached
--> --------------------
[ zur Elbe Produktseite wechseln0.207Quellennavigators
]
|
|