1 #LyX 1.5.4svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 %This preamble is designed to ensure that the document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}
22 % link all cross references and URLs in pdf output
23 \usepackage[colorlinks=true, bookmarks, bookmarksnumbered,
24 bookmarksopen, bookmarksopenlevel=2,
25 linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,
26 pdfpagelayout=OneColumn, pdfnewwindow=true,
27 pdfstartview=XYZ, plainpages=false, pdfpagelabels,
28 pdfauthor={LyX Team}, pdftex,
29 pdftitle={The LyX Tutorial},pdfsubject={LyX-documentation Tutorial},
30 pdfkeywords={LyX, documentation}]{hyperref}
32 \else % if dvi or ps is produced
34 % link all cross references and URLs in dvi output
35 \usepackage[ps2pdf]{hyperref}
37 \fi % end if pdflatex is used
39 % the pages of the TOC are numbered roman
40 % and a pdf-bookmark for the TOC is added
42 \let\myTOC\tableofcontents
43 \renewcommand\tableofcontents{%
44 \pdfbookmark[1]{Contents}{}
47 \pagenumbering{arabic} }
49 % redefine the \LyX macro for PDF bookmarks
50 \def\LyX{\texorpdfstring{%
51 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
58 \font_typewriter default
59 \font_default_family default
73 \paperorientation portrait
76 \paragraph_separation indent
78 \quotes_language english
81 \paperpagestyle headings
82 \tracking_changes false
99 \begin_layout Standard
100 If you have comments or error corrections, please send them to the LyX Documenta
103 lyx-docs@lists.lyx.org
113 \begin_layout Standard
114 \begin_inset LatexCommand tableofcontents
121 \begin_layout Chapter
125 \begin_layout Section
129 \begin_layout Standard
130 This file is designed for all of you who have never heard of LaTeX, or don't
132 Now, don't panic - you won't need to learn LaTeX to use LyX.
133 That is, after all, the whole point of LyX: to provide an almost-WYSIWYG
135 There are some things you will need to learn, however, in order to use
139 \begin_layout Standard
140 Some of you probably found your way to this document because you tried to
141 put two spaces after a
142 \begin_inset Quotes eld
146 \begin_inset Quotes erd
149 or tried to put 3 blank lines between paragraphs.
150 You found out you couldn't and in fact, you'll find out that most of the
151 little tricks you're accustomed to use in other word processors won't work
153 That's because most word processors you've used before allow you to manually
154 enter all spacings, font changes, and so on.
155 So you end up not only writing a document but typesetting it, too.
156 LyX does the typesetting for you, in a consistent fashion, letting you
157 focus on the important things, like the content of your writing.
160 \begin_layout Standard
161 So read on to learn more about LyX.
162 Reading this tutorial is definitely worth the time.
165 \begin_layout Section
175 \begin_layout Standard
176 Before we get started with this section, we want to make a quick note of
182 uses the notation outlined in the
187 If you came to this manual first, please read the
191 before you continue with the
198 \begin_layout Standard
199 Now that you know which fonts mean what, we want to talk a bit about what
207 \begin_layout Subsection
208 Getting the most out of the Tutorial
211 \begin_layout Standard
212 This tutorial consists of examples and exercises.
213 To get the most out of this document, you should read through the document,
214 typing all the little things we're telling you to type and trying out all
215 of the exercises to see if you get them right.
216 For convenience, you might want to print out the PDF version of this document.
219 \begin_layout Standard
220 If you are familiar with LaTeX, you'll probably be able to read the
224 somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
225 However, LyX have features you'll want to learn about.
226 Even if you don't feel like reading the rest of the
230 , you should definitely check out Section\InsetSpace ~
232 \begin_inset LatexCommand ref
233 reference "sec:latexusers"
237 , which is specifically written for experienced LaTeX users.
240 \begin_layout Subsection
248 \begin_layout Itemize
249 Detailed explanations of all of LyX's features.
253 \begin_layout Standard
262 \begin_layout Itemize
263 Detailed explanations of LaTeX.
267 \begin_layout Standard
269 If you want to learn some of the neat tricks you can do with LaTeX in LyX,
270 you can have a look at the
272 Embedded\InsetSpace ~
279 \begin_layout Standard
280 It's time to move onwards, time for your first document \SpecialChar \ldots{}
284 \begin_layout Chapter
285 Getting started with LyX
288 \begin_layout Section
289 Your first LyX document
290 \begin_inset LatexCommand label
291 name "sec:Your-first-LyX"
298 \begin_layout Standard
300 You're ready to start writing.
301 Before you do, there are a few things we need to mention, which will hopefully
302 make the Tutorial more instructive and useful.
306 \begin_layout Standard
307 Because there are informations we can't give you in the Tutorial, the
313 thing that you need to do is find the
320 Start up LyX, Choose the
329 You may want to load the
333 as well (if you're not reading it within LyX already).
334 This way, you can read them while you're writing your own file.
338 \begin_layout Standard
339 They can also serve as good examples of how to use the many features of
345 Note that once you've got more than one document open, you can use the
350 menu or the document tabs to switch between them.
353 \begin_layout Standard
354 In this Tutorial, we're going to assume that you have a fully working version
355 of LyX, as well as a LaTeX-distribution, a DVI-, and a PDF-viewer.
356 This should be the case on all major Linux- and BSD-distribution, as well
357 as on Windows, where this is setup by the LyX installer.
360 \begin_layout Standard
361 Finally, we've written a file to let you practice your LyX skills on, it's
367 Imagine that it was typed by someone who didn't know about any of LyX's
369 As you learn new LyX functions, we'll suggest that you fix those parts
376 \begin_inset Quotes eld
380 \begin_inset Quotes erd
383 hints about how to fix things
387 \begin_layout Standard
388 The hints are located in yellow
389 \begin_inset Quotes eld
393 \begin_inset Quotes erd
397 Access the text in a note by clicking on it.
403 If you want to cheat, or check what you've done, there's also a file called
408 which contains the same text written and typeset by a LyX master.
411 \begin_layout Standard
412 The example files can be found in the
416 directory of LyX's installation folder.
417 Open the raw document, and use
419 File\SpecialChar \menuseparator
423 to save a copy in your own directory for you to work on.
424 As you fix parts of the raw document, check to see how those changes affect
428 \begin_layout Standard
433 directory contains lots of other examples files.
434 They will show you how to do various fancy things with LyX.
435 After you read the Tutorial, or when you're confused about how to do something
436 fancy in LyX, take a look at these files.
439 \begin_layout Subsection
440 Typing, Viewing, and Exporting
443 \begin_layout Itemize
446 File\SpecialChar \menuseparator
450 \begin_layout Itemize
451 Type a sentence like:
453 This is my first LyX document!
456 \begin_layout Itemize
457 Save your document with
459 File\SpecialChar \menuseparator
465 \begin_layout Itemize
466 Run LaTeX to create a DVI file, with
468 View\SpecialChar \menuseparator
471 or the toolbar button
472 \begin_inset Graphics
473 filename ../images/buffer-view_dvi.png
479 LyX will open a DVI-viewer program displaying your document looking like
484 \begin_layout Standard
485 You can save time by leaving the DVI-viewer running in the background.
488 View\SpecialChar \menuseparator
489 Update\SpecialChar \menuseparator
492 or the toolbar button
493 \begin_inset Graphics
494 filename ../images/buffer-update_dvi.png
499 and just click on the DVI-viewer window (or unminimize it) after LaTeX
508 \begin_layout Itemize
509 Export the ready to print document with
511 File\SpecialChar \menuseparator
519 \begin_layout Standard
520 Congratulations! You've written your first LyX document.
521 All of the rest is just details, which is covered in the other manuals.
524 \begin_layout Subsection
528 \begin_layout Standard
529 LyX can of course do most of the things you're used to do with a word processor.
530 It will word-wrap and indent paragraphs automatically.
531 Here's a quick description of how to do some simple actions.
534 \begin_layout Description
535 Undo LyX has multiple levels of undo, which means you can undo everything
536 you've done since your current editing session started, by selecting
538 Edit\SpecialChar \menuseparator
542 \begin_inset Graphics
543 filename ../images/undo.png
548 ) over and over again.
549 If you undo too much, just select
551 Edit\SpecialChar \menuseparator
555 \begin_inset Graphics
556 filename ../images/redo.png
566 \begin_layout Standard
567 Currently, undo is limited to 100 steps.
568 Undo also doesn't work for
572 ; for instance, not for changes to the document layout what is really a
577 \begin_layout Description
580 Edit\SpecialChar \menuseparator
584 \begin_inset Graphics
585 filename ../images/cut.png
592 Edit\SpecialChar \menuseparator
596 \begin_inset Graphics
597 filename ../images/copy.png
604 Edit\SpecialChar \menuseparator
608 \begin_inset Graphics
609 filename ../images/paste.png
614 ) to cut, copy, and paste.
615 Or automatically paste selected text (including selections from other programs)
623 \begin_layout Description
626 Edit\SpecialChar \menuseparator
632 \begin_inset Graphics
633 filename ../images/dialog-show_findreplace.png
639 In the dialog, search with the
648 button to replace a word you've found
652 \begin_layout Standard
653 Close the window when you're done or leave it open if you find it more convenien
655 Most dialog boxes in LyX can operate like this.
656 Just be sure you have the right window focus when you're trying to type
657 in the main LyX window or a LyX dialog.
663 If you like, you can specify whether to make the search case-sensitive,
664 or to search for only complete words; you can also search backwards through
668 \begin_layout Description
669 Character\InsetSpace ~
674 text (which will by default print characters in italics), set it in
682 (usually small caps, used for people's names) from the toggle buttons in
685 Edit\SpecialChar \menuseparator
689 dialog (toolbar button
690 \begin_inset Graphics
691 filename ../images/dialog-show_character.png
699 \begin_layout Description
700 Toolbar There are buttons on the toolbar (just below the menus) which allow
701 you to do some of the more popular functions, such as
712 \begin_layout Standard
713 Of course, you haven't yet written enough to make most of these functions
715 As you write more, though, try undoing, pasting, etc.
718 \begin_layout Subsection
719 WYSIWYM: Whitespace in LyX
720 \begin_inset LatexCommand label
721 name "sec:whitespace"
728 \begin_layout Standard
729 One of the hardest things for new users to get used to is the way that LyX
731 As many times as you hit
735 , you'll only get one blank line.
736 As many times as you hit
740 , you'll only get one space.
741 On a blank line, LyX won't let you type even one space.
746 key won't move you forward one tab stop; in fact there
750 no tab stops! There's no ruler at the top of the page to let you set tabs
754 \begin_layout Standard
755 Many commercial word processors are based on the WYSIWYG principle:
756 \begin_inset Quotes eld
759 What You See Is What You Get.
760 \begin_inset Quotes erd
763 LyX, on the other hand, is based on the principle that
764 \begin_inset Quotes eld
767 What You See Is What You
772 \begin_inset Quotes erd
775 You type what you mean, and LyX will take care of typesetting it for you,
776 so that the output looks nice.
781 grammatically separates paragraphs, and a
785 grammatically separates words, so there is no reason to have several of
790 has no grammatical function at all, so LyX does not support it.
791 Using LyX, you'll spend more of your time worrying about the
795 of your document, and less time worrying about the
804 for more information on the WYSIWYM concept.
807 \begin_layout Standard
808 LyX does have (many) ways to fine-tune the formatting of your document.
809 After all, LyX might not typeset
818 has information about all that.
823 s and vertical space --- which are more powerful and versatile than multiple
824 spaces or blank lines --- and ways to change font sizes, character styles,
825 and paragraph alignments by hand.
826 The idea, though, is that you can write your whole document, focusing on
827 content, and just worry about that fine-tuning at the end.
828 With standard word processors, you'll be distracted by document formatting
829 throughout the writing process.
832 \begin_layout Section
836 \begin_layout Standard
837 Different parts of a document have different purposes; we call these parts
843 Most of a document is made up of regular text.
844 Section titles (chapter, subsection, etc.) let the reader know that a new
845 topic or subtopic will be discussed.
846 Certain types of documents have special environments.
847 A journal article will have an abstract and a title.
848 A letter will have neither of these, but will probably have an environment
849 that gives the writer's address.
852 \begin_layout Standard
853 Environments are a major part of the
854 \begin_inset Quotes eld
857 What You See Is What You Mean
858 \begin_inset Quotes erd
862 A given environment may require a certain font style, font size, indenting,
863 line spacing, and more.
864 This problem is aggravated, because the exact formatting for a given environmen
865 t may change: one journal may use boldface, 18 point, centered type for
866 section titles while another uses italicized, 15 point, left justified
867 type; different languages may have different standards for indenting; and
868 bibliography formats can vary widely.
869 LyX lets you avoid learning all the different formatting styles.
872 \begin_layout Standard
877 choice box is located on the left end of the toolbar and looks like this:
879 \begin_inset Graphics
880 filename clipart/ToolbarEnvBox.png
887 It indicates which environment you're currently writing in.
888 While you were writing your first document, it said
889 \begin_inset Quotes eld
893 \begin_inset Quotes erd
896 which is the default environment for text.
897 Now you will put a number of environments in your new document so that
898 you can see how they work.
901 \begin_layout Subsection
902 Sections and Subsections
905 \begin_layout Standard
910 on the first line of your LyX file, and select
922 \begin_layout Standard
928 If nothing is selected, LyX changes the paragraph you are currently in
929 to the selected environment.
930 Alternatively, you can change several paragraphs to a different environment
931 by selecting them before picking an environment.
948 , which will be covered below.
949 LyX numbers the section
950 \begin_inset Quotes eld
954 \begin_inset Quotes erd
957 and typesets the section heading (title) in a larger font.
968 \begin_inset Quotes eld
972 \begin_inset Quotes erd
976 \begin_inset Quotes eld
980 \begin_inset Quotes erd
984 Section headings, like most environments, are assumed to end when you type
990 Type the document introduction:
993 \begin_layout LyX-Code
994 This is an introduction to my first LyX document.
997 \begin_layout Standard
1012 \begin_inset Quotes eld
1016 \begin_inset Quotes erd
1019 and waits for you to type a title.
1021 \begin_inset Quotes eld
1030 \begin_inset Quotes erd
1033 , and you'll see that LyX again sets it as a section title.
1036 \begin_layout Standard
1038 Go to the end of Section\InsetSpace ~
1040 \begin_inset Quotes eld
1043 my first LyX document
1044 \begin_inset Quotes erd
1061 \begin_inset Quotes eld
1065 \begin_inset Quotes erd
1068 and waits for you to type a title.
1074 Section\InsetSpace ~
1076 \begin_inset Quotes eld
1080 \begin_inset Quotes erd
1083 , which used to be Section\InsetSpace ~
1084 2, has been automatically renumbered to Section\InsetSpace ~
1086 In true WYSIWYM fashion, you just need to identify the text that makes
1087 up the section titles, and LyX takes care of numbering the sections and
1091 \begin_layout Standard
1100 environment, and type the following five lines:
1103 \begin_layout LyX-Code
1104 Sections and subsections are described below.
1107 \begin_layout LyX-Code
1111 \begin_layout LyX-Code
1112 Sections are bigger than subsections.
1115 \begin_layout LyX-Code
1116 Subsection description
1119 \begin_layout LyX-Code
1120 Subsections are smaller than sections.
1123 \begin_layout Standard
1124 Click on the second line and select
1133 LyX numbers the subsection
1134 \begin_inset Quotes eld
1138 \begin_inset Quotes erd
1141 , and typesets it in a font which is bigger than regular text but smaller
1142 than the section title.
1143 Change the fourth line
1147 environment as well.
1148 As you probably expected, LyX automatically numbered the section
1149 \begin_inset Quotes eld
1153 \begin_inset Quotes erd
1157 If you put yet another section before Section\InsetSpace ~
1158 2, Section\InsetSpace ~
1159 2 will be renumbered
1160 as Section 3, and the subsections will be renumbered to
1161 \begin_inset Quotes eld
1165 \begin_inset Quotes erd
1169 \begin_inset Quotes eld
1173 \begin_inset Quotes erd
1180 \begin_layout Standard
1181 Further levels of sectioning include
1194 We'll let you play with these on your own.
1195 You may notice that paragraph and subparagraph headings are not numbered
1196 by default, and that subparagraphs are indented; see the
1200 for an explanation and how to change this.
1205 headings are actually the highest level of sectioning, above
1209 s, but you're only allowed to use them in certain types (text classes) of
1210 LyX documents (see Section\InsetSpace ~
1212 \begin_inset LatexCommand ref
1213 reference "sec:Document-Classes"
1221 \begin_layout Standard
1222 Finally, you may want to have sections or subsections that are not numbered.
1223 There are environments for this as well.
1224 If you change one of your section headings to the
1228 environment (you may have to scroll down in the
1232 box to find it), LyX will use the same font size for the heading as it
1233 uses for a regular section, but it won't number that section.
1234 There are corresponding
1235 \begin_inset Quotes eld
1239 \begin_inset Quotes erd
1242 heading environments for
1251 Try changing some of your sections or subsections to the starred environments,
1252 and note how the other sections' numbers are updated.
1255 \begin_layout Standard
1260 : Fix the section and subsection headings in
1268 \begin_layout Subsection
1272 \begin_layout Standard
1273 LyX has several different environments for typesetting lists.
1274 The various list environments free you from hitting
1278 a million times when writing an outline, or from renumbering a whole list
1279 when you want to add a point in the middle of the list.
1280 Different types of documents logically require different list environments:
1283 \begin_layout Itemize
1284 A slide presentation might use the
1288 environment's bulleted lists to describe different points.
1292 \begin_layout Itemize
1293 An outline would use the
1297 environment's numbered lists (and lettered sublists).
1301 \begin_layout Itemize
1302 A document describing several software packages could use the
1306 environment, where each item in the list begins with a bold-faced word.
1310 \begin_layout Itemize
1315 environment --- not found in LaTeX --- is a slightly different form of
1323 \begin_layout Standard
1324 Let's write a list of reasons why LyX is better than other word processors.
1325 Somewhere in your document, type:
1328 \begin_layout Standard
1331 LyX is better than other word processors because:
1334 \begin_layout Standard
1350 \begin_inset Quotes eld
1354 \begin_inset Quotes erd
1358 Type in your reasons:
1361 \begin_layout LyX-Code
1362 Typesetting is done for you.
1365 \begin_layout LyX-Code
1369 \begin_layout LyX-Code
1370 Lists are very easy to create!
1373 \begin_layout Standard
1374 List environments, unlike headings, do not end when you type
1379 Instead, LyX assumes you're going on to the next item in the list.
1380 The above will therefore result in a three-item list.
1381 If you want more than one paragraph within one list
1385 , one way is to use the
1387 Protected\InsetSpace ~
1390 , which you get by typing
1395 In order to get out of the list, you need to reselect the
1399 environment (or just use the keybinding,
1407 \begin_layout Standard
1408 You've got a beautiful itemized list.
1409 You might want to run LaTeX to see how the list looks when printed out.
1410 But what if you wanted to number the reasons? Well, just select the whole
1415 \begin_layout Standard
1416 LyX won't let you select the first bullet unless you also select the paragraph
1421 the list, which you probably don't want to do.
1422 Similarly, you can't select the actual number in a numbered section title.
1423 This is on purpose because the bullet or number depends on the document
1424 settings or text position, respectively.
1438 Pow! As we mentioned, if you add or delete a list item, LyX will fix the
1442 \begin_layout Standard
1443 While the list is still selected, you can change to the other two list environme
1452 , in order to see what they look like.
1453 For those two environments, each list item is made up of a term, which
1454 is the item's first word, followed by a definition, which is the rest of
1455 the paragraph (until you hit
1459 .) The term is either typeset in boldface (
1464 \begin_inset Quotes eld
1468 \begin_inset Quotes erd
1475 \begin_layout Standard
1476 But a typesetter's tab, which will change to fit the size of the largest
1477 term, not a pathetic, rigid, unchangeable typewriter
1490 ) from the rest of the paragraph.
1491 If you want to have more than one word in the definition, then separate
1494 Protected\InsetSpace ~
1500 \begin_layout Standard
1505 : Typeset the list in
1510 \begin_layout Standard
1511 You can nest lists within each other in all sorts of interesting ways.
1512 An obvious example would be writing outlines.
1513 Numbered and bulleted lists will have different numbering and bulleting
1514 schemes for sublists.
1519 for details on the different sorts of lists and for examples of nestings.
1522 \begin_layout Subsection
1523 Other environments: Verses, Quotations, and more
1526 \begin_layout Standard
1527 There are two environments for setting quotations apart from surrounding
1532 for short quotes and
1545 \begin_layout Standard
1546 used in this Tutorial for the long typing examples
1555 font; this environment is the only place in LyX where you're allowed to
1556 use multiple spaces to allow code indenting.
1557 You can even write poetry using the
1565 to separate stanzas, and
1569 to separate lines within a stanza.
1574 for more complete descriptions of all of the available LyX environments.
1577 \begin_layout Standard
1582 : Correctly typeset the
1597 \begin_layout Chapter
1601 \begin_layout Standard
1602 The previous chapter hopefully allowed you to get used to writing in LyX.
1603 It introduced you to the basic editing operations in LyX, as well as the
1604 powerful method of writing with environments.
1605 Most people who use LyX, though, will want to write documents: papers,
1606 articles, books, manuals, or letters.
1607 This chapter is meant to take you from simply writing text with LyX to
1608 writing a complete document.
1609 It will introduce you to text classes, which allow you to write different
1611 It will then describe many of the additions that turn text into a document,
1612 such as titles, footnotes, cross references, bibliographies, and tables
1616 \begin_layout Section
1618 \begin_inset LatexCommand label
1619 name "sec:Document-Classes"
1626 \begin_layout Standard
1627 Different sorts of documents should be typeset differently.
1628 For example, books are generally printed double-sided, while articles are
1630 In addition, many documents contain special environments: letters contain
1631 some environments --- such as the sender's address and the signature ---
1632 which do not make sense in a book or article.
1641 \begin_layout Standard
1642 for LaTeX users: this is equivalent to the LaTeX document class
1647 takes care of these large scale differences between different sorts of
1649 This Tutorial, for example, was written in the
1654 Document classes are another major part of the WYSIWYM philosophy; they
1655 tell LyX how to typeset the document, so you don't need to know how.
1658 \begin_layout Standard
1659 Your document is probably being written in the
1667 \begin_layout Standard
1668 That's usually the default document class
1673 Try changing to other document classes (using the
1675 Document\SpecialChar \menuseparator
1678 dialog) to see how they are typeset differently.
1679 If you change your document to the
1683 document class and look at the
1687 box, you'll see that most of the allowed environments are the same.
1688 However, you can now use the
1693 If you are ever unsure about which environments you can use in a given
1694 document class, just consult the
1701 \begin_layout Standard
1702 Font sizes, one- or two-column printing, and page headings are just some
1703 of the ways journals' typesettings differ from one another.
1704 As the Computer Age continues to mature, journals have begun accepting
1705 electronic submissions, creating LaTeX
1706 \begin_inset Quotes eld
1710 \begin_inset Quotes erd
1713 so that authors can submit correctly typeset articles.
1714 LyX is set up to support this as well.
1715 For example, LyX supports typesetting (and extra environments) for the
1716 American Mathematics Society journals using the
1718 Article\InsetSpace ~
1724 \begin_layout Standard
1725 Here is a very quick reference to some of the document classes.
1728 Special Document Classes
1734 manual for many more details.
1737 \begin_layout Standard
1739 \begin_inset Tabular
1740 <lyxtabular version="3" rows="7" columns="2">
1742 <column alignment="center" valignment="top" leftline="true" width="0pt">
1743 <column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
1744 <row topline="true" bottomline="true">
1745 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1748 \begin_layout Standard
1754 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1757 \begin_layout Standard
1764 <row topline="true">
1765 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1768 \begin_layout Standard
1774 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1777 \begin_layout Standard
1778 one-sided, no chapters
1784 <row topline="true">
1785 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1788 \begin_layout Standard
1794 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1797 \begin_layout Standard
1798 layout & environments for American Math Society
1804 <row topline="true">
1805 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1808 \begin_layout Standard
1814 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1817 \begin_layout Standard
1818 longer than article, two-sided
1824 <row topline="true" bottomline="true">
1825 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1828 \begin_layout Standard
1834 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1837 \begin_layout Standard
1838 report + front and back matter
1844 <row bottomline="true">
1845 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1848 \begin_layout Standard
1854 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1857 \begin_layout Standard
1864 <row bottomline="true">
1865 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1868 \begin_layout Standard
1874 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1877 \begin_layout Standard
1878 lots of extra environments for address, signature\SpecialChar \ldots{}
1892 \begin_layout Section
1893 Templates: Writing a Letter
1896 \begin_layout Standard
1897 One way to write a letter would be to open a new file, and choose a
1903 Document\SpecialChar \menuseparator
1907 While this is the most obvious way to write a letter, it seems like extra
1909 Every time you write a business letter, you want to have your address,
1910 the address you're sending to, a body, a signature, etc.
1915 for letters, which contains a sample letter; once you have a template,
1916 you can just replace a couple parts of the letter with your text each time
1920 \begin_layout Standard
1921 Open a new file with
1923 File\SpecialChar \menuseparator
1934 Save and print the file to see how the various environments are typeset.
1937 \begin_layout Standard
1938 When you look at the
1942 box, you'll see several environments, like the
1947 environment, which don't even exist in most other document classes.
1957 You can play around for a while to figure out how the various environments
1959 You'll notice for example that the
1963 environment has the word
1964 \begin_inset Quotes eld
1968 \begin_inset Quotes eld
1971 in red before the actual text of the signature.
1972 This word doesn't show up in the actual letter, as you'll see if you view/expor
1974 It's just there to let you know where the signature goes.
1975 Also, note that it doesn't matter where in the file the
1980 Remember, LyX is WYSIWYM; you can put the
1984 environment anywhere you want, but LyX knows that in the printout, the
1985 signature should be at the end.
1988 \begin_layout Standard
1989 A template is just a regular LyX file.
1990 This means you can fill in your address and signature and save the file
1992 From now on, any time you want to write a letter, you can use the new template
1994 We don't have to suggest an actual
1995 \begin_inset Quotes eld
1999 \begin_inset Quotes erd
2002 here; just write a letter to someone!
2006 \begin_layout Standard
2007 One warning, if you're writing from a template.
2008 If you erase all of the text in an environment --- for example, if you
2014 field so that you can replace it with your own --- and then you move the
2015 cursor without writing any text, the environment may disappear.
2016 This is because most environments cannot exist without any text in them.
2017 Just reselect the environment from the
2029 \begin_layout Standard
2030 Templates can be a huge time-saver, and we urge you to use them whenever
2032 In addition, they can help a person learn how to use some of the fancier
2034 Finally, they may be useful for a person who is configuring LyX for a bunch
2035 of less computer-aware users.
2036 When they're first learning LyX, it will be much less intimidating if they
2037 have a letter template customized for their company, for example.
2040 \begin_layout Section
2044 \begin_layout Standard
2045 LyX (like LaTeX) considers the title --- which may contain the actual title,
2046 the author, the date, and even an abstract of a paper --- to be a separate
2047 part of the document.
2050 \begin_layout Standard
2051 Go back to your LyX document and make sure it's using the
2059 \begin_layout Standard
2060 You should not be using the letter any more, since the
2064 document class doesn't allow titles.
2069 Type a title on the first line, and change the line to the
2074 On the next line, type your name and change it to the
2079 On the next line, write the date in the
2084 Type a paragraph or two summarizing your document using the
2089 Notice how the title is presented when it's printed out.
2090 If you changed the document format to Book, you'll get a separate title
2091 page, like the first page of this tutorial.
2094 \begin_layout Standard
2099 : Fix the title, date, and author in
2104 \begin_layout Section
2105 Labels and Cross-References
2106 \begin_inset LatexCommand label
2114 \begin_layout Standard
2115 You can label section headings, list items, formulas, footnotes, and floats
2119 \begin_layout Standard
2120 Floats are explained in the
2134 Once you do so, you can refer to this section in other parts of the document,
2135 using cross-references.
2136 You can refer either to the section's number, or to the page that the section
2138 As with section numbering, LyX also takes care about cross-reference numbering
2140 Automatic labels and cross-references are one of the best advantages of
2141 LyX (and LaTeX) over conventional word processors.
2144 \begin_layout Subsection*
2148 \begin_layout Standard
2149 Go to our second section, whose title is
2150 \begin_inset Quotes eld
2154 \begin_inset Quotes erd
2158 Click at the end of the section title line, and select
2160 Insert\SpecialChar \menuseparator
2163 or the toolbar button
2164 \begin_inset Graphics
2165 filename ../images/label-insert.png
2172 A dialog asks you for a label name, and gives you a suggestion.
2177 , the label name will be placed in a box next to the section title.
2180 \begin_layout Standard
2181 By the way, you could have put the label right anywhere within the section
2182 as well; section references will refer to the last section or subsection
2183 whose heading comes before the label.
2184 However, putting it on the same line as the section title (or, perhaps,
2185 on the first line of the section's text) ensures that page references will
2186 reference the beginning of the section.
2189 \begin_layout Standard
2190 So far you haven't done anything --- the DVI output will look exactly the
2191 same, since labels don't show up in the printed document.
2192 However, now that you have added a label, you can refer to that label with
2197 \begin_layout Subsection*
2198 Your first cross-reference
2201 \begin_layout Standard
2202 Place the cursor somewhere in Section\InsetSpace ~
2207 \begin_layout LyX-Code
2208 If you want to know more about this document, then see
2214 \begin_layout Standard
2215 Now --- with the cursor after the word
2216 \begin_inset Quotes eld
2220 \begin_inset Quotes erd
2225 Insert\SpecialChar \menuseparator
2229 or the toolbar button
2230 \begin_inset Graphics
2231 filename ../images/dialog-show-new-inset_ref.png
2243 It shows a list of the possible labels you can reference.
2244 At the moment, there should be only one,
2245 \begin_inset Quotes eld
2248 sec:About-This-Document
2249 \begin_inset Quotes erd
2253 Select it (it may be selected by default), and click
2258 Now put the cursor after the word
2259 \begin_inset Quotes eld
2263 \begin_inset Quotes erd
2266 , and change the reference format to use the page number then click
2271 (To be really correct, you should put a
2273 Protected\InsetSpace ~
2277 \begin_inset Quotes eld
2281 \begin_inset Quotes erd
2285 Same for the page reference.)
2288 \begin_layout Standard
2289 LyX puts the references in a box right where the cursor was.
2290 In the printed document, this reference marker will be replaced with either
2291 the page or section number (depending on what you selected in the
2296 View your document as DVI, and you'll see that on the last page we refer
2298 \begin_inset Quotes eld
2301 Section\InsetSpace ~
2303 \begin_inset Quotes erd
2307 \begin_inset Quotes eld
2312 \begin_inset Quotes erd
2315 (or whatever page Section\InsetSpace ~
2319 \begin_layout Standard
2320 Conveniently, a cross-reference acts as a hyperlink when you are editing
2321 a document in LyX; clicking on it will pop up the
2331 will move the cursor to the referenced label.
2334 \begin_layout Subsection*
2335 More fun with labels
2338 \begin_layout Standard
2339 We told you that LyX takes care about numbering cross-references; now you
2341 Add a new section before Section\InsetSpace ~
2343 Update the DVI view, and --- voilà ! --- the section cross reference changed
2345 \begin_inset Quotes eld
2349 \begin_inset Quotes erd
2352 ! Change the section
2353 \begin_inset Quotes eld
2357 \begin_inset Quotes erd
2360 to a subsection, and the cross-reference will reference Subsection\InsetSpace ~
2362 of Section\InsetSpace ~
2364 The page reference won't change unless you add a whole page of text before
2365 the label, of course.
2369 \begin_layout Standard
2370 If you want some more practice with labels, then try putting a new label
2371 where your first cross-reference was, and refer to that label from elsewhere
2373 If you'll be inserting cross-references often, it may be convenient to
2381 \begin_layout Standard
2382 If you want to make sure that the cross-referencing gets the pages right
2383 even for larger documents,
2387 a couple pages of text from the
2391 to the clipboard, and
2395 the stolen text into your document.
2399 \begin_layout Standard
2400 By the way, copying a chapter title may cause an error, because chapters
2401 aren't allowed in the article class, see section\InsetSpace ~
2403 \begin_inset LatexCommand ref
2404 reference "sec:Document-Classes"
2409 If this happens, just delete the chapter title.
2417 \begin_layout Standard
2422 : Fix the references in
2427 \begin_layout Section
2428 Footnotes and Margin Notes
2431 \begin_layout Standard
2432 Footnotes can be added using the toolbar button
2433 \begin_inset Graphics
2434 filename ../images/footnote-insert.png
2442 Insert\SpecialChar \menuseparator
2446 Click at the end of the word
2447 \begin_inset Quotes eld
2451 \begin_inset Quotes erd
2454 somewhere in your document and click the
2455 \begin_inset Graphics
2456 filename ../images/footnote-insert.png
2463 A footnote box appears where you can enter the text of the footnote.
2464 LyX should place the cursor at the beginning of the footnote box.
2468 \begin_layout LyX-Code
2469 LyX is a typesetting word processor.
2472 \begin_layout Standard
2473 Now click on the button labelled
2474 \begin_inset Quotes eld
2478 \begin_inset Quotes erd
2482 The footnote box is closed, leaving the button showing where the footnote
2483 marker will be in the printed text; this is called
2484 \begin_inset Quotes eld
2488 \begin_inset Quotes erd
2492 You can unfold the footnote at any time --- and re-edit its text, if you
2493 want --- by clicking again on the
2494 \begin_inset Quotes eld
2498 \begin_inset Quotes erd
2504 \begin_layout Standard
2505 You may wonder why the footnote button is a word instead of a number.
2506 The answer is that LyX takes care about the footnote numbering for you
2507 in the printed text.
2508 You can see this yourself by looking at the DVI file (or printout).
2509 If you add other footnotes, LyX will renumber the footnotes.
2510 Since LyX (well, LaTeX, actually) takes care of the footnote numbering,
2511 there's really no need to put the numbers in the LyX file.
2514 \begin_layout Standard
2515 A footnote can be cut and pasted like normal text.
2516 Go ahead; try it! All you need to do is select the footnote button
2520 \begin_layout Standard
2521 It may be easier to select it using the keyboard.
2522 You might accidentally open the footnote if you're trying to select the
2523 marker itself with the mouse.
2537 In addition, you can change regular text to a footnote, by selecting it
2539 \begin_inset Graphics
2540 filename ../images/footnote-insert.png
2546 button; change a footnote to regular text by hitting the
2550 key when the cursor is in the first position of a footnote, or by hitting
2555 key when the cursor is in the very last position of the footnote, respectively.
2558 \begin_layout Standard
2559 Margin notes can be added using the menu
2561 Insert\SpecialChar \menuseparator
2562 Marginal\InsetSpace ~
2565 or the toolbar button
2566 \begin_inset Graphics
2567 filename ../images/marginalnote-insert.png
2574 Margin notes are like footnotes, except that:
2577 \begin_layout Itemize
2578 the on-screen boxes say
2579 \begin_inset Quotes eld
2583 \begin_inset Quotes erd
2587 \begin_inset Quotes eld
2591 \begin_inset Quotes erd
2597 \begin_layout Itemize
2598 the notes will be placed in the margin, instead of below the text
2601 \begin_layout Itemize
2602 margin notes are not numbered
2605 \begin_layout Standard
2606 Change your LyX footnote back to text, then select and change it to a margin
2608 Run LaTeX again to see what the margin note looks like.
2611 \begin_layout Standard
2616 : Fix the footnote in
2621 \begin_layout Section
2623 \begin_inset LatexCommand label
2624 name "sec:bibliographies"
2631 \begin_layout Standard
2632 Bibliographies (at least in the exact sciences) are similar to cross references.
2633 The bibliography contains a list of references at the end of the document,
2634 and they can be referenced from within the document.
2635 Like section titles, LyX and LaTeX make your job easier by automatically
2636 numbering the bibliography items and changing citations when the item numbers
2640 \begin_layout Standard
2641 Go to the end of the document and switch to the
2646 Now, each paragraph you type will be a reference.
2648 \begin_inset Quotes eld
2653 The Lyx Tutorial, by the LyX Documentation Team
2656 \begin_inset Quotes erd
2659 as your first reference.
2660 Note that LyX automatically puts a number in a box before each reference.
2661 Click on the boxed reference number, and the
2663 Bibliography\InsetSpace ~
2671 is to refer to this reference within the LyX document, the
2680 is set (default), you will see the number of the bibliography in the output.
2686 \begin_inset Quotes eld
2690 \begin_inset Quotes erd
2693 to make it easy to remember.
2696 \begin_layout Standard
2697 Now pick somewhere in your document that you would like to insert a reference.
2700 Insert\SpecialChar \menuseparator
2703 or the toolbar button
2704 \begin_inset Graphics
2705 filename ../images/dialog-show-new-inset_citation.png
2717 The right panel in this dialog lists all the bibliography entries, and
2718 this field allows you to choose which bibliography item you want to cite.
2720 \begin_inset Quotes eld
2724 \begin_inset Quotes erd
2727 (right now, that's the only item in the bibliography), then use the
2731 button in the center to insert it.
2732 (You can have multiple citations in the same place by transferring a number
2733 of keys this way.) Now view your file as DVI, and you'll see that the citation
2734 appears in brackets in the text, referring to the bibliography at the end
2738 \begin_layout Standard
2748 dialog will put a remark (such as a reference to a page or chapter within
2749 the referenced book or article) in the brackets after the reference.
2750 If you want the references to have labels instead of numbers in the printed
2751 output (for example, some journals would use
2752 \begin_inset Quotes eld
2756 \begin_inset Quotes erd
2759 to refer to a paper written by Smith in 1995), use the
2765 Bibliography\InsetSpace ~
2776 \begin_layout Standard
2781 Fix the bibliography and citation in
2786 \begin_layout Section
2790 \begin_layout Standard
2791 You may want to put a table of contents at the beginning of your document.
2792 LyX makes this very easy to do.
2797 after your document title and before your first section title and choose
2800 Insert\SpecialChar \menuseparator
2803 TOC\SpecialChar \menuseparator
2810 \begin_inset Quotes eld
2814 \begin_inset Quotes erd
2817 will appear in a button on the first line of the document.
2821 \begin_layout Standard
2822 This may not appear to be very useful.
2823 However, if you look at your DVI file, you will see that a table of contents
2824 has been generated, listing the various sections and subsections in your
2826 As usual, if you reorder sections or create new ones, you will see those
2827 changes in the DVI file when you update it.
2831 \begin_layout Standard
2832 The table of contents is not printed in the on-screen version of the document
2833 to keep the overview in your file.
2834 But you can display the table of contents in a separate window by clicking
2835 on the table of contents button, or by using
2837 Document\SpecialChar \menuseparator
2840 or the toolbar button
2841 \begin_inset Graphics
2842 filename ../images/dialog-toggle_toc.png
2849 This menu will work even if you don't have a table of contents inset in
2851 This is a very useful tool where you can move around your document parts.
2852 Clicking on a (sub)section title in the
2856 window will highlight that line and move the display (in the LyX editing
2857 window) to that place in the document.
2858 You can also use the arrow keys to move up and down in the table of contents.
2859 You may therefore find it convenient to leave this window open throughout
2861 You can get similar functionality from the
2865 menu, though, where the table of contents appears automatically.
2868 \begin_layout Standard
2869 To get rid of the Table of Contents, you can delete the table of contents
2870 button just like any other text.
2873 \begin_layout Standard
2878 : Fix the table of contents in
2883 \begin_layout Chapter
2887 \begin_layout Standard
2888 LaTeX is used by many scientists because it outputs great looking equations,
2889 avoiding the control characters used by word processors and their equation
2891 Many of these scientists are frustrated, however, because writing equations
2892 in LaTeX is more like programming than writing.
2893 Happily, LyX has WYSIWYM support for equations.
2894 If you are used to LaTeX, you'll find that all of the usual LaTeX math
2895 commands can be typed in normally, but they will show up in a WYSIWYM fashion.
2896 If, on the other hand, you've never written in LaTeX, then the
2901 will allow you to write professional-looking math quickly and easily.
2904 \begin_layout Section
2908 \begin_layout Standard
2909 Somewhere in your LyX document, type:
2912 \begin_layout LyX-Code
2913 I like what Einstein said, E=mc^2, because it's so simple.
2917 \begin_layout Standard
2918 Now, that equation doesn't look very good in LyX and in the output; there's
2919 no space between the letters and the equals sign, and you'd like to write
2920 an actual superscript for the
2921 \begin_inset Quotes eld
2925 \begin_inset Quotes erd
2929 That bad typesetting happened because we didn't tell LyX that we were writing
2930 a mathematical expression, so it typeset the equation like regular old
2934 \begin_layout Standard
2935 Instead, we create a formula that will get typeset properly.
2936 In order to create a formula, just click the toolbar button
2937 \begin_inset Graphics
2938 filename ../images/math-mode.png
2946 Insert\SpecialChar \menuseparator
2947 Math\SpecialChar \menuseparator
2952 LyX will insert a little blue square, which is an empty math formula.
2958 The expression is typed in blue, and the blue square disappears as soon
2959 as the formula is not empty.
2964 to leave the equation The purple markers disappear, leaving the cursor
2965 to the right of the expression, and now if you type something, it will
2969 \begin_layout Standard
2970 Run LaTeX and look at the output.
2971 Notice that the expression was typeset nicely, with spaces between the
2972 letters and the equals sign, and a superscript
2973 \begin_inset Quotes eld
2977 \begin_inset Quotes erd
2981 Letters in math mode are assumed to be variables, and come out in italics.
2982 Numbers are just numbers.
2985 \begin_layout Standard
2986 This math editor is another example of the WYSIWYM philosophy.
2987 In LaTeX, you write a mathematical expression using text and commands like
2994 ; this can be frustrating, because you can't see what an expression looks
2995 like until you LaTeX the file, and may have to spend time to find e.\InsetSpace \thinspace{}
2999 LyX doesn't attempt to get the expression to look perfect (WYSIWYG), but
3000 it gives you an extremely good idea of what the expression will look like.
3001 LaTeX then takes care of the professional typesetting.
3004 \begin_layout Section
3005 Navigating an Equation
3008 \begin_layout Standard
3010 \begin_inset Formula $E=mc^{2}$
3014 \begin_inset Formula $E=1+mc^{2}$
3018 Use the arrow keys to move the cursor into the expression.
3019 Note that when you enter the expression, the purple markers appear to let
3020 you know you're editing math.
3029 to move the cursor past the equals sign, and just type
3030 \begin_inset Quotes eld
3034 \begin_inset Quotes erd
3038 Again, you can use the arrow keys or
3042 to leave the formula\SpecialChar \@.
3046 \begin_layout Standard
3047 Other than the special keys described below, typing in math mode is like
3048 editing regular text.
3058 Select text either with the arrow keys or with the mouse.
3061 Edit\SpecialChar \menuseparator
3064 works in math mode as well as cut and paste.
3065 One thing to be careful of: If you are left or right outside a formula
3074 , respectively, you delete the whole formula.
3075 Luckily, you can just use
3082 \begin_layout Standard
3083 What if you want to change
3084 \begin_inset Formula $E=mc^{2}$
3088 \begin_inset Formula $E=mc^{2.5}+1$
3091 ? Again, you can use the mouse to click in the right place.
3092 However, you can also use the arrow keys.
3093 If the cursor is just after the
3094 \begin_inset Quotes eld
3098 \begin_inset Quotes erd
3102 \begin_inset Quotes eld
3106 \begin_inset Quotes erd
3113 and the cursor is moved to the level of the superscript, just before the
3115 \begin_inset Quotes eld
3119 \begin_inset Quotes erd
3124 \begin_inset Quotes eld
3128 \begin_inset Quotes erd
3136 will move the cursor back to the regular level.
3145 , the cursor will be placed
3149 the superscript (so that you can then type the
3150 \begin_inset Quotes eld
3154 \begin_inset Quotes erd
3160 \begin_layout Section
3161 Exponents and Indices
3164 \begin_layout Standard
3165 An exponent can be entered from the
3170 (see below), but it's actually simpler just to type the caret key,
3171 \begin_inset Quotes eld
3175 \begin_inset Quotes erd
3179 LyX will place another blue rectangle in the superscript, so that whatever
3180 you write next will be superscripted, and in a smaller font size.
3181 Everything you type until you hit a
3189 to exit the formula entirely) will be in the superscript.
3192 \begin_layout Standard
3193 Writing a subscript (index) is just as easy --- start one by typing the
3195 \begin_inset Quotes eld
3199 \begin_inset Quotes eld
3203 You can subscript and superscript both subscripts and superscripts like
3205 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3212 \begin_layout Standard
3224 \begin_layout Section
3228 \begin_layout Standard
3234 is a convenient way to enter symbols or to perform complicated formula
3236 Many of these operations can be accomplished from the keyboard or the
3238 Edit\SpecialChar \menuseparator
3243 Insert\SpecialChar \menuseparator
3247 However, we're going to concentrate on using the
3252 , just to let you know what's out there; you can learn keyboard shortcuts
3253 later, from other manuals.
3256 \begin_layout Standard
3261 is shown when the cursor is in a formula and can also be turned on manually
3264 View\SpecialChar \menuseparator
3268 When you click there on
3269 \begin_inset Quotes eld
3273 \begin_inset Quotes erd
3276 the toolbar will be shown permanently at the bottom; this state is visualized
3281 menu with a checkmark.
3282 When you click in this state again on
3283 \begin_inset Quotes eld
3287 \begin_inset Quotes erd
3298 is only shown when the cursor is within a formula; this state is visualized
3299 by the renaming of the menu entry from
3300 \begin_inset Quotes eld
3304 \begin_inset Quotes erd
3308 \begin_inset Quotes eld
3313 \begin_inset Quotes erd
3319 \begin_layout Subsection
3323 \begin_layout Standard
3329 which allow you to choose from a large array of symbols used in math: various
3330 arrows, relations, operators, and sums and integrals.
3331 Note that subscripting and superscripting allow you to put lower and upper
3332 limits on sums and integrals.
3336 \begin_layout Standard
3337 \begin_inset Quotes eld
3340 Nothing you can do that can't be done\SpecialChar \ldots{}
3342 \begin_inset Formula $\heartsuit$
3346 \begin_inset Quotes erd
3352 \begin_layout Subsection
3353 Square roots, accents, and delimiters
3356 \begin_layout Standard
3357 To type a square root, just click on the button
3358 \begin_inset Graphics
3359 filename ../images/math/sqrt.png
3366 The square root appears, and the cursor is in a new insertion point inside
3368 You can type variables, numbers, other square roots, fractions, whatever
3370 LyX will automatically resize the square root to fit what's inside.
3373 \begin_layout Standard
3374 Accenting a character (
3375 \begin_inset Formula $\overrightarrow{v}$
3378 ) or group of characters (
3379 \begin_inset Formula $\overrightarrow{a+b}$
3382 ) is done the same way.
3383 Decorations are available from the toolbar via the button
3384 \begin_inset Graphics
3385 filename ../images/math/hat.png
3392 Click on a decoration, and LyX will insert that decoration with an insertion
3393 point under (or over) it.
3394 Just type what you want in the insertion point.
3395 There are two sets of decorations: those that resize with the text you
3396 type, and those that have fixed size, and are most appropriate for a single
3401 \begin_layout Standard
3402 Delimiters such as parentheses, brackets, and braces work similarly, but
3403 are a bit more complicated.
3404 Hit the delimiter button
3405 \begin_inset Graphics
3406 filename ../images/dialog-show_mathdelimiter.png
3417 Your current selection of delimiters is displayed in a box.
3418 It's a pair of parentheses by default, but you can choose a pair of braces,
3419 a brace and a parenthesis, or choose the empty square to have something
3421 \begin_inset Quotes eld
3425 \begin_inset Formula $a=\left\langle 7\right.$
3429 \begin_inset Quotes erd
3432 (the empty delimiter is displayed as a broken line in LyX, but won't show
3436 \begin_layout Standard
3437 If you're lazy, you can type actual parentheses in math mode, rather than
3443 However, those parentheses will be the same size as regular text, which
3444 will look bad if you have a big fraction or matrix inside the parentheses.
3445 So better use in this case one of the three delimiter buttons that insert
3446 directly e.\InsetSpace \thinspace{}
3448 a (\InsetSpace \thinspace{}
3452 \begin_layout Standard
3453 You can also put delimiters or a square root sign or a decoration on already
3454 existing formula parts.
3455 Select the portion of the formula that you want to adjust, and then click
3456 on the button you want from the
3462 Try using this to change Newton's second law from scalar to vector form
3464 \begin_inset Formula $f=ma$
3468 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3472 Once you've learned about matrices, this is how you'll put parentheses
3473 or brackets around them.
3476 \begin_layout Subsection
3480 \begin_layout Standard
3481 To create a fraction, click on the fraction button
3482 \begin_inset Graphics
3483 filename ../images/math/frac.png
3496 LyX writes two insertion points in a fraction.
3497 As you would expect, you can use arrow keys or the mouse to move around
3499 Click on the top square and type
3500 \begin_inset Quotes eld
3504 \begin_inset Quotes erd
3513 \begin_inset Quotes eld
3517 \begin_inset Quotes erd
3521 You've made a fraction! Of course you can type anything within each of
3522 the two boxes: variables with exponents, square roots, other fractions,
3527 \begin_layout Standard
3539 \begin_layout Subsection
3540 TeX mode: Limits, log, sin and others
3543 \begin_layout Standard
3544 Because letters in math mode are considered to be variables, if you type
3546 \begin_inset Quotes eld
3550 \begin_inset Quotes erd
3553 in math mode, LyX thinks you are typing the product of the three variables
3555 \begin_inset Formula $s$
3559 \begin_inset Formula $i$
3563 \begin_inset Formula $n$
3567 The three letters will be typeset in italics, when what you really wanted
3569 \begin_inset Quotes eld
3573 \begin_inset Quotes erd
3577 In addition, LyX won't put a space between the word
3578 \begin_inset Quotes eld
3582 \begin_inset Quotes erd
3586 \begin_inset Quotes eld
3590 \begin_inset Quotes erd
3597 will exit the formula).
3599 \begin_inset Quotes eld
3603 \begin_inset Formula $\sin(x)$
3607 \begin_inset Quotes erd
3611 \begin_inset Quotes eld
3615 \begin_inset Formula $sin(x)$
3619 \begin_inset Quotes erd
3625 \begin_layout Standard
3632 \begin_inset Graphics
3633 filename ../images/math/functions.png
3640 \begin_inset Quotes eld
3644 \begin_inset Quotes erd
3647 in the appearing function list.
3649 \begin_inset Quotes eld
3653 \begin_inset Quotes erd
3656 is displayed in LyX in black, and set in upright roman type.
3657 The whole word is treated as one symbol, so if you type
3661 , it will delete the whole word.
3663 \begin_inset Quotes eld
3667 \begin_inset Quotes erd
3670 , which will be written in blue italics, like you expect in a formula.
3671 In the output, the expression will be correctly typeset.
3675 \begin_layout Standard
3676 The function list include other trigonometric functions and their inverses,
3677 hyperbolic functions, logarithms, limits, and quite a few others.
3678 These functions can take subscripts and superscripts, important for typing
3680 \begin_inset Quotes eld
3684 \begin_inset Formula $\cos^{2}\theta$
3688 \begin_inset Quotes erd
3692 \begin_inset Quotes eld
3696 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3700 \begin_inset Quotes erd
3706 \begin_layout Standard
3718 \begin_layout Subsection
3720 \begin_inset LatexCommand label
3728 \begin_layout Standard
3729 Click on the matrix button
3730 \begin_inset Graphics
3731 filename ../images/dialog-show_mathmatrix.png
3743 The appearing dialog allows you to choose how many rows and columns you
3744 want in your matrix.
3745 Choose 2 rows and 3 columns and hit
3750 LyX prints 6 insertion points in a
3751 \begin_inset Formula $2\times3$
3755 As usual, you can put any sort of formula expression (a square root, another
3756 matrix, etc.) in each insertion point.
3757 You can also leave some of the insertion points empty if you want.
3760 \begin_layout Standard
3765 can be used to move horizontally between the columns of a matrix.
3766 Alternatively, you can use the arrow keys to move around - hitting
3770 at the end of one box will move to the next box,
3774 will move to the next row, etc.
3777 \begin_layout Standard
3778 If you need to change the number of rows and columns, use the menu
3780 Edit\SpecialChar \menuseparator
3781 Math\SpecialChar \menuseparator
3782 Rows\InsetSpace \thinspace{}
3783 &\InsetSpace \thinspace{}
3786 or the math toolbar buttons
3787 \begin_inset Graphics
3788 filename ../images/tabular-feature_append-row.png
3795 \begin_inset Graphics
3796 filename ../images/tabular-feature_delete-row.png
3803 \begin_inset Graphics
3804 filename ../images/tabular-feature_append-column.png
3811 \begin_inset Graphics
3812 filename ../images/tabular-feature_delete-column.png
3821 \begin_layout Standard
3826 for information on how to change the horizontal alignment of each column,
3827 and how to change the vertical position of the whole matrix.
3828 Note that if you want to write a table containing text, you should use
3829 LyX's wonderful table support, rather than trying to write text in a matrix.
3832 \begin_layout Subsection
3836 \begin_layout Standard
3837 All of the expressions we have written so far have been on the same line
3838 as the text that came before and after them, otherwise known as inline
3840 This is fine for short, simple expressions, but if you want to write larger
3841 ones, or if you want your expressions to stand out from the text, you need
3842 to write them in display mode.
3843 In addition, only displayed expressions can be labeled and numbered (see
3848 ), and multi-line equations must be in display mode.
3851 \begin_layout Standard
3852 Click on the display button
3853 \begin_inset Graphics
3854 filename ../images/math-display.png
3865 , which represents a couple lines of text before and after a centered blue
3867 LyX inserts a formula, but the insertion point is on a new line, and it's
3868 centered within that line.
3869 Now type an expression and run LaTeX to see how it looks.
3870 The display button is actually a toggle; use it now to change a couple
3871 of your expressions to display mode and back.
3875 \begin_layout Standard
3876 Display mode has a couple differences from inline mode:
3879 \begin_layout Itemize
3880 The default font is larger for a few symbols, like
3881 \begin_inset Formula $\sum$
3885 \begin_inset Formula $\int$
3891 \begin_layout Itemize
3892 Subscripts and superscripts for limits and sums (but not integrals) are
3893 written under rather than next to the symbols
3896 \begin_layout Itemize
3900 \begin_layout Standard
3901 Other than these differences, though, displayed expressions and inline expressio
3902 ns are very similar.
3905 \begin_layout Standard
3906 One final note about the way displayed formulas are typeset: Be careful
3907 about whether you're putting your equation into a new paragraph or not.
3908 If your formula is in the middle of a sentence or paragraph, then don't
3914 Doing so will cause the text
3918 the formula to start a new paragraph.
3919 That text will therefore eventually be indented, depending on your document
3920 paragraph settings, which is probably not what you want.
3923 \begin_layout Standard
3928 : Put the various equations in
3932 into display mode, and see how they're typeset differently.
3935 \begin_layout Standard
3940 : Using various tools you've learned in this section, you should be able
3941 to write an equation like
3945 \begin_layout Standard
3946 After you've done it the hard way, give
3948 Insert\SpecialChar \menuseparator
3949 Math\SpecialChar \menuseparator
3959 \begin_inset Formula \[
3960 f(x)=\left\{ \begin{array}{cc}
3963 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0\end{array}\right.\]
3970 \begin_layout Section
3974 \begin_layout Standard
3975 LyX's math editor can do plenty more.
3976 By now, you're familiar with the basics, so we refer to the
3983 \begin_layout Itemize
3984 Labeling and numbering expressions
3987 \begin_layout Itemize
3988 Multi-line equations
3991 \begin_layout Itemize
3992 Change typefaces, e.g., to write bold-face text in an expression.
3995 \begin_layout Itemize
3996 Fine-tune font sizes and spacing within an expression.
3997 (Don't worry about this until your final draft!)
4000 \begin_layout Itemize
4002 These are very powerful, because you just define them once at the top of
4003 the document, and then you can use them throughout the document.
4006 \begin_layout Itemize
4007 Do lots of other things that can't be mentioned in this Tutorial.
4010 \begin_layout Chapter
4014 \begin_layout Section
4015 Other major LyX Features
4018 \begin_layout Standard
4019 We haven't gone through all the possible commands in LyX, and we aren't
4027 Embedded\InsetSpace ~
4030 manual for more information.
4031 We'll just mention a couple more major things LyX can do:
4034 \begin_layout Itemize
4035 LyX has WYSIWYM support for tables.
4038 Insert\SpecialChar \menuseparator
4042 \begin_inset Graphics
4043 filename ../images/tabular-insert.png
4050 Click on the table with the
4059 dialog box which allows extensive table editing.
4062 \begin_layout Itemize
4063 LyX also supports including pictures in any format within documents.
4066 Insert\SpecialChar \menuseparator
4070 \begin_inset Graphics
4071 filename ../images/dialog-show-new-inset_graphics.png
4078 Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4079 can have captions, and LyX will automatically generate lists of figures
4083 \begin_layout Itemize
4084 LyX is heavily configurable.
4085 Everything from how the LyX window looks to how the output comes out can
4086 be configured in a number of ways.
4087 Much configuration is done through
4089 Tools\SpecialChar \menuseparator
4093 For more information on this, check out
4095 Help\SpecialChar \menuseparator
4096 Customization\SpecialChar \@.
4100 \begin_layout Itemize
4101 LyX is being developed by a team of programmers on five continents.
4102 Therefore, LyX has better support for non-English languages (such as Dutch,
4103 German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4104 ) than many word processors.
4105 Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4106 languages Chinese Japanese, and Korean are supported.
4107 You can write documents in other languages and you can also configure LyX
4108 to show its menus and error messages in other languages.
4112 \begin_layout Itemize
4113 The LyX menus feature keybindings.
4114 This means that you can do
4116 File\SpecialChar \menuseparator
4127 or by using the binding which is shown next to it in the menu (C-O by default).
4128 Keybindings are also configurable.
4129 For information on this, check out
4131 Help\SpecialChar \menuseparator
4132 Customization\SpecialChar \@.
4136 \begin_layout Itemize
4137 LyX can read LaTeX documents.
4138 See section\InsetSpace ~
4140 \begin_inset LatexCommand ref
4141 reference "sec:tex2lyx"
4148 \begin_layout Itemize
4149 Spellchecking, thesaurus, and word count facilities are available.
4152 \begin_layout Itemize
4153 Generation of indexes and nomenclatures/glossaries is supported.
4156 \begin_layout Section
4158 \begin_inset LatexCommand label
4159 name "sec:latexusers"
4166 \begin_layout Standard
4167 If you don't know anything about LaTeX, you don't have to read this section.
4168 Actually, you might want to
4172 about LaTeX, and then read this chapter.
4173 However, some who begin to use LyX will be familiar with LaTeX.
4174 If you are such a person, you may be wondering if LyX can really do everything
4176 The short answer is that LyX can do pretty much everything LaTeX can do
4177 in one form or another, and it definitely simplifies most parts of writing
4181 \begin_layout Standard
4182 Because this is just a tutorial, we are only going to mention things that
4183 new LyX users will most likely be interested in.
4184 In the interests of keeping the Tutorial short, we will give only minimal
4188 Extended\InsetSpace ~
4193 Embedded\InsetSpace ~
4196 manual have a great deal of information on differences between LyX and
4197 LaTeX, and how to do various LaTeX tricks in LyX.
4200 \begin_layout Subsection
4204 \begin_layout Standard
4205 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4206 will be displayed in red on the screen.
4207 You can use TeX commands in LyX by choosing
4209 Insert\SpecialChar \menuseparator
4214 \begin_inset Graphics
4215 filename ../images/ert-insert.png
4222 This creates a box where everything within it is passed straight to LaTeX.
4225 \begin_layout Standard
4226 In a math formula, TeX mode is handled a bit differently.
4227 TeX mode is there entered by typing a backslash.
4228 The backslash is not written out, but anything you type afterwards will
4230 You exit TeX mode by typing
4234 or some other non-alphabetic character, like a number, underscore, caret,
4236 Once you exit TeX mode, if LyX knows the TeX command you've typed in, it
4237 will convert it to WYSIWYM\SpecialChar \@.
4239 \begin_inset Quotes eld
4249 \begin_inset Quotes erd
4252 in a formula and then press
4256 , LyX will change the red
4257 \begin_inset Quotes eld
4261 \begin_inset Quotes erd
4265 \begin_inset Quotes eld
4269 \begin_inset Formula $\gamma$
4273 \begin_inset Quotes erd
4277 This will work for almost all, non-complicated math macros.
4278 This may be faster than using the
4283 , and will be especially convenient for experienced LaTeX users.
4286 \begin_layout Standard
4287 As a special case, if you type a brace in TeX mode, then the beginning
4291 ending braces will be inserted in red, then take you
4295 of TeX mode and place the cursor between the braces.
4296 This makes it more convenient to type commands that LyX doesn't know which
4300 \begin_layout Standard
4301 LyX can't do absolutely everything that LaTeX can do.
4302 Some fancy functions are not supported at all, while some work but aren't
4304 TeX mode allows users to get the full flexibility of LaTeX, while having
4305 all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4306 LyX could never support every LaTeX package.
4313 in the preamble (see section\InsetSpace ~
4315 \begin_inset LatexCommand ref
4316 reference "sec:preamble"
4320 ), you can use any package you want --- although you won't have WYSIWYM
4321 support for that package's features.
4324 \begin_layout Subsection
4325 Importing LaTeX Documents ---
4330 \begin_inset LatexCommand label
4338 \begin_layout Standard
4339 You can import a LaTeX file into LyX by using the
4341 File\SpecialChar \menuseparator
4342 Import\SpecialChar \menuseparator
4347 This will call the program
4351 which will create a file
4359 and then open that file.
4360 If the translation doesn't work, you can try calling
4364 from the command line, possibly using fancier options.
4367 \begin_layout Standard
4372 will translate most legal LaTeX, but not everything.
4373 It will leave things it doesn't understand in TeX mode, so after translating
4378 , you can look for red text and hand-edit it to look right.
4381 \begin_layout Standard
4386 has its own manpage.
4387 Read it to find out about which LaTeX commands and environments aren't
4388 supported, bugs (and how to get around them), and how to use the various
4392 \begin_layout Subsection
4393 Converting LyX Documents to LaTeX
4396 \begin_layout Standard
4397 You might wish to convert a LyX Document to a LaTeX file.
4398 For example, a co-worker or co-author who doesn't have LyX might want to
4402 File\SpecialChar \menuseparator
4403 Export\SpecialChar \menuseparator
4407 This will create a file
4415 file you are editing.
4416 LyX always creates temporary LaTeX files when viewing or printing files.
4419 \begin_layout Subsection
4423 \begin_layout Subsubsection
4427 \begin_layout Standard
4430 Document\SpecialChar \menuseparator
4433 dialog takes care of many of the options that you would input in a
4440 Change the class, default font size and paper size here.
4441 Put any extra options to the
4459 \begin_layout Subsubsection
4460 Other Preamble Matter
4461 \begin_inset LatexCommand label
4469 \begin_layout Standard
4470 If you have special commands to put in the preamble of a LaTeX file, you
4471 can use them in a LyX document as well.
4474 Document\SpecialChar \menuseparator
4475 Settings\SpecialChar \menuseparator
4479 and type in the dialog window (or from the document settings dialog, depending
4481 Anything you type will (like with TeX mode) be sent directly to LaTeX.
4484 \begin_layout Subsection
4488 \begin_layout Standard
4489 LyX has support for BibTeX, which allows you to build databases of bibliographic
4490 al references to be used in multiple documents.
4496 nsert\SpecialChar \menuseparator
4503 C\SpecialChar \menuseparator
4520 field you load BibTeX files, in the
4524 field you can load BibTeX style files.
4527 \begin_layout Standard
4528 After you've done this, you can use citations from any bibliographies you're
4531 Insert\SpecialChar \menuseparator
4534 (see section\InsetSpace ~
4536 \begin_inset LatexCommand ref
4537 reference "sec:bibliographies"
4542 LyX will take care of running BibTeX.
4547 dialog will show a list of all the references in your
4554 \begin_layout Section
4558 \begin_layout Standard
4559 Sometimes when you LaTeX a document, there will be errors, things that LyX
4560 or LaTeX can't understand.
4561 When this happens, LyX will open a
4567 Clicking on individual errors in this dialog will take you to the place
4568 in the LyX document where the error occurs and also display the detailed
4569 LaTeX error message.