1 #LyX 1.6.0 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 \fi % end if pdflatex is used
24 % the pages of the TOC is numbered roman
25 % and a pdf-bookmark for the TOC is added
26 \let\myTOC\tableofcontents
27 \renewcommand\tableofcontents{%
29 \pdfbookmark[1]{\contentsname}{}
33 % redefine the \LyX macro for PDF bookmarks
34 \def\LyX{\texorpdfstring{%
35 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
38 \use_default_options false
43 \font_typewriter default
44 \font_default_family default
53 \pdf_title "The LyX Tutorial"
54 \pdf_author "LyX Team"
55 \pdf_subject "LyX-documentation Tutorial"
56 \pdf_keywords "LyX, documentation"
58 \pdf_bookmarksnumbered true
59 \pdf_bookmarksopen true
60 \pdf_bookmarksopenlevel 2
65 \pdf_pdfusetitle false
66 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
73 \paperorientation portrait
76 \paragraph_separation indent
78 \quotes_language english
81 \paperpagestyle headings
82 \tracking_changes false
99 \begin_layout Plain Layout
100 If you have comments or error corrections, please send them to the LyX Documenta
104 \begin_inset CommandInset href
106 target "lyx-docs@lists.lyx.org"
121 \begin_layout Standard
122 \begin_inset CommandInset toc
123 LatexCommand tableofcontents
130 \begin_layout Chapter
134 \begin_layout Section
138 \begin_layout Standard
139 This file is designed for all of you who have never heard of LaTeX, or don't
141 Now, don't panic - you won't need to learn LaTeX to use LyX.
142 That is, after all, the whole point of LyX: to provide an almost-WYSIWYG
144 There are some things you will need to learn, however, in order to use
148 \begin_layout Standard
149 Some of you probably found your way to this document because you tried to
150 put two spaces after a
151 \begin_inset Quotes eld
155 \begin_inset Quotes erd
158 or tried to put 3 blank lines between paragraphs.
159 You found out you couldn't and in fact, you'll find out that most of the
160 little tricks you're accustomed to use in other word processors won't work
162 That's because most word processors you've used before allow you to manually
163 enter all spacings, font changes, and so on.
164 So you end up not only writing a document but typesetting it, too.
165 LyX does the typesetting for you, in a consistent fashion, letting you
166 focus on the important things, like the content of your writing.
169 \begin_layout Standard
170 So read on to learn more about LyX.
171 Reading this tutorial is definitely worth the time.
174 \begin_layout Section
184 \begin_layout Standard
185 Before we get started with this section, we want to make a quick note of
191 uses the notation outlined in the
196 If you came to this manual first, please read the
200 before you continue with the
207 \begin_layout Standard
208 Now that you know which fonts mean what, we want to talk a bit about what
216 \begin_layout Subsection
217 Getting the most out of the Tutorial
220 \begin_layout Standard
221 This tutorial consists of examples and exercises.
222 To get the most out of this document, you should read through the document,
223 typing all the little things we're telling you to type and trying out all
224 of the exercises to see if you get them right.
225 For convenience, you might want to print out the PDF version of this document.
228 \begin_layout Standard
229 If you are familiar with LaTeX, you'll probably be able to read the
233 somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
234 However, LyX have features you'll want to learn about.
235 Even if you don't feel like reading the rest of the
239 , you should definitely check out Section
244 \begin_inset CommandInset ref
246 reference "sec:latexusers"
250 , which is specifically written for experienced LaTeX users.
253 \begin_layout Subsection
261 \begin_layout Itemize
262 Detailed explanations of all of LyX's features.
266 \begin_layout Standard
275 \begin_layout Itemize
276 Detailed explanations of LaTeX.
280 \begin_layout Standard
282 If you want to learn some of the neat tricks you can do with LaTeX in LyX,
283 you can have a look at the
295 \begin_layout Standard
296 It's time to move onwards, time for your first document \SpecialChar \ldots{}
300 \begin_layout Chapter
301 Getting started with LyX
304 \begin_layout Section
305 Your first LyX document
308 \begin_layout Standard
310 You're ready to start writing.
311 Before you do, there are a few things we need to mention, which will hopefully
312 make the Tutorial more instructive and useful.
316 \begin_layout Standard
317 Because there are informations we can't give you in the Tutorial, the
323 thing that you need to do is find the
330 Start up LyX, Choose the
339 You may want to load the
343 as well (if you're not reading it within LyX already).
344 This way, you can read them while you're writing your own file.
348 \begin_layout Plain Layout
349 They can also serve as good examples of how to use the many features of
355 Note that once you've got more than one document open, you can use the
360 menu or the document tabs to switch between them.
363 \begin_layout Standard
364 In this Tutorial, we're going to assume that you have a fully working version
365 of LyX, as well as a LaTeX-distribution, a DVI-, and a PDF-viewer.
366 This should be the case on all major Linux- and BSD-distribution, as well
367 as on Windows, where this is setup by the LyX installer.
370 \begin_layout Standard
371 Finally, we've written a file to let you practice your LyX skills on, it's
377 Imagine that it was typed by someone who didn't know about any of LyX's
379 As you learn new LyX functions, we'll suggest that you fix those parts
386 \begin_inset Quotes eld
390 \begin_inset Quotes erd
393 hints about how to fix things
397 \begin_layout Plain Layout
398 The hints are located in yellow
399 \begin_inset Quotes eld
403 \begin_inset Quotes erd
407 Access the text in a note by clicking on it.
413 If you want to cheat, or check what you've done, there's also a file called
418 which contains the same text written and typeset by a LyX master.
421 \begin_layout Standard
422 The example files can be found in the
426 directory of LyX's installation folder.
427 Open the raw document, and use
429 File\SpecialChar \menuseparator
436 to save a copy in your own directory for you to work on.
437 As you fix parts of the raw document, check to see how those changes affect
441 \begin_layout Standard
446 directory contains lots of other examples files.
447 They will show you how to do various fancy things with LyX.
448 After you read the Tutorial, or when you're confused about how to do something
449 fancy in LyX, take a look at these files.
452 \begin_layout Subsection
453 Typing, Viewing, and Exporting
456 \begin_layout Itemize
459 File\SpecialChar \menuseparator
463 \begin_layout Itemize
464 Type a sentence like:
466 This is my first LyX document!
469 \begin_layout Itemize
470 Save your document with
472 File\SpecialChar \menuseparator
481 \begin_layout Itemize
482 Run LaTeX to create a DVI file, with
484 View\SpecialChar \menuseparator
487 or the toolbar button
488 \begin_inset Graphics
489 filename ../images/buffer-view_dvi.png
495 LyX will open a DVI-viewer program displaying your document looking like
500 \begin_layout Plain Layout
501 You can save time by leaving the DVI-viewer running in the background.
504 View\SpecialChar \menuseparator
505 Update\SpecialChar \menuseparator
508 or the toolbar button
509 \begin_inset Graphics
510 filename ../images/buffer-update_dvi.png
515 and just click on the DVI-viewer window (or unminimize it) after LaTeX
524 \begin_layout Itemize
525 Export the ready to print document with
527 File\SpecialChar \menuseparator
535 \begin_layout Standard
536 Congratulations! You've written your first LyX document.
537 All of the rest is just details, which is covered in the other manuals.
540 \begin_layout Subsection
544 \begin_layout Standard
545 LyX can of course do most of the things you're used to do with a word processor.
546 It will word-wrap and indent paragraphs automatically.
547 Here's a quick description of how to do some simple actions.
550 \begin_layout Description
551 Undo LyX has multiple levels of undo, which means you can undo everything
552 you've done since your current editing session started, by selecting
554 Edit\SpecialChar \menuseparator
558 \begin_inset Graphics
559 filename ../images/undo.png
564 ) over and over again.
565 If you undo too much, just select
567 Edit\SpecialChar \menuseparator
571 \begin_inset Graphics
572 filename ../images/redo.png
582 \begin_layout Standard
583 Currently, undo is limited to 100 steps.
584 Undo also doesn't work for
588 ; for instance, not for changes to the document layout what is really a
593 \begin_layout Description
596 Edit\SpecialChar \menuseparator
600 \begin_inset Graphics
601 filename ../images/cut.png
608 Edit\SpecialChar \menuseparator
612 \begin_inset Graphics
613 filename ../images/copy.png
620 Edit\SpecialChar \menuseparator
624 \begin_inset Graphics
625 filename ../images/paste.png
630 ) to cut, copy, and paste.
631 Or automatically paste selected text (including selections from other programs)
639 \begin_layout Description
642 Edit\SpecialChar \menuseparator
654 \begin_inset Graphics
655 filename ../images/dialog-show_findreplace.png
661 In the dialog, search with the
673 button to replace a word you've found
677 \begin_layout Plain Layout
678 Close the window when you're done or leave it open if you find it more convenien
680 Most dialog boxes in LyX can operate like this.
681 Just be sure you have the right window focus when you're trying to type
682 in the main LyX window or a LyX dialog.
688 If you like, you can specify whether to make the search case-sensitive,
689 or to search for only complete words; you can also search backwards through
693 \begin_layout Description
702 text (which will by default print characters in italics), set it in
710 (usually small caps, used for people's names) from the toggle buttons in
713 Edit\SpecialChar \menuseparator
720 dialog (toolbar button
721 \begin_inset Graphics
722 filename ../images/dialog-show_character.png
730 \begin_layout Description
731 Toolbar There are buttons on the toolbar (just below the menus) which allow
732 you to do some of the more popular functions, such as
743 \begin_layout Standard
744 Of course, you haven't yet written enough to make most of these functions
746 As you write more, though, try undoing, pasting, etc.
749 \begin_layout Subsection
750 WYSIWYM: Whitespace in LyX
753 \begin_layout Standard
754 One of the hardest things for new users to get used to is the way that LyX
756 As many times as you hit
760 , you'll only get one blank line.
761 As many times as you hit
765 , you'll only get one space.
766 On a blank line, LyX won't let you type even one space.
771 key won't move you forward one tab stop; in fact there
775 no tab stops! There's no ruler at the top of the page to let you set tabs
779 \begin_layout Standard
780 Many word processors are based on the WYSIWYG principle:
781 \begin_inset Quotes eld
784 What You See Is What You Get.
785 \begin_inset Quotes erd
788 LyX, on the other hand, is based on the principle that
789 \begin_inset Quotes eld
792 What You See Is What You
797 \begin_inset Quotes erd
800 You type what you mean, and LyX will take care of typesetting it for you,
801 so that the output looks nice.
806 grammatically separates paragraphs, and a
810 grammatically separates words, so there is no reason to have several of
815 has no grammatical function at all, so LyX does not support it.
816 Using LyX, you'll spend more of your time worrying about the
820 of your document, and less time worrying about the
829 for more information on the WYSIWYM concept.
832 \begin_layout Standard
833 LyX does have (many) ways to fine-tune the formatting of your document.
834 After all, LyX might not typeset
843 has information about all that.
848 s and vertical space --- which are more powerful and versatile than multiple
849 spaces or blank lines --- and ways to change font sizes, character styles,
850 and paragraph alignments by hand.
851 The idea, though, is that you can write your whole document, focusing on
852 content, and just worry about that fine-tuning at the end.
853 With standard word processors, you'll be distracted by document formatting
854 throughout the writing process.
857 \begin_layout Section
861 \begin_layout Standard
862 Different parts of a document have different purposes; we call these parts
868 Most of a document is made up of regular text.
869 Section titles (chapter, subsection, etc.) let the reader know that a new
870 topic or subtopic will be discussed.
871 Certain types of documents have special environments.
872 A journal article will have an abstract and a title.
873 A letter will have neither of these, but will probably have an environment
874 that gives the writer's address.
877 \begin_layout Standard
878 Environments are a major part of the
879 \begin_inset Quotes eld
882 What You See Is What You Mean
883 \begin_inset Quotes erd
887 A given environment may require a certain font style, font size, indenting,
888 line spacing, and more.
889 This problem is aggravated, because the exact formatting for a given environmen
890 t may change: one journal may use boldface, 18 point, centered type for
891 section titles while another uses italicized, 15 point, left justified
892 type; different languages may have different standards for indenting; and
893 bibliography formats can vary widely.
894 LyX lets you avoid learning all the different formatting styles.
897 \begin_layout Standard
902 choice box is located on the left end of the toolbar and looks like this:
904 \begin_inset Graphics
905 filename clipart/ToolbarEnvBox.png
912 It indicates which environment you're currently writing in.
913 While you were writing your first document, it said
914 \begin_inset Quotes eld
918 \begin_inset Quotes erd
921 which is the default environment for text.
922 Now you will put a number of environments in your new document so that
923 you can see how they work.
926 \begin_layout Subsection
927 Sections and Subsections
930 \begin_layout Standard
935 on the first line of your LyX file, and select
947 \begin_layout Plain Layout
953 If nothing is selected, LyX changes the paragraph you are currently in
954 to the selected environment.
955 Alternatively, you can change several paragraphs to a different environment
956 by selecting them before picking an environment.
973 , which will be covered below.
974 LyX numbers the section
975 \begin_inset Quotes eld
979 \begin_inset Quotes erd
982 and typesets the section heading (title) in a larger font.
993 \begin_inset Quotes eld
997 \begin_inset Quotes erd
1001 \begin_inset Quotes eld
1005 \begin_inset Quotes erd
1009 Section headings, like most environments, are assumed to end when you type
1015 Type the document introduction:
1018 \begin_layout LyX-Code
1019 This is an introduction to my first LyX document.
1022 \begin_layout Standard
1037 \begin_inset Quotes eld
1041 \begin_inset Quotes erd
1044 and waits for you to type a title.
1046 \begin_inset Quotes eld
1052 \begin_inset space ~
1058 \begin_inset Quotes erd
1061 , and you'll see that LyX again sets it as a section title.
1064 \begin_layout Standard
1066 Go to the end of Section
1067 \begin_inset space ~
1071 \begin_inset Quotes eld
1074 my first LyX document
1075 \begin_inset Quotes erd
1092 \begin_inset Quotes eld
1096 \begin_inset Quotes erd
1099 and waits for you to type a title.
1106 \begin_inset space ~
1110 \begin_inset Quotes eld
1114 \begin_inset Quotes erd
1117 , which used to be Section
1118 \begin_inset space ~
1121 2, has been automatically renumbered to Section
1122 \begin_inset space ~
1125 3! In true WYSIWYM fashion, you just need to identify the text that makes
1126 up the section titles, and LyX takes care of numbering the sections and
1130 \begin_layout Standard
1139 environment, and type the following five lines:
1142 \begin_layout LyX-Code
1143 Sections and subsections are described below.
1146 \begin_layout LyX-Code
1150 \begin_layout LyX-Code
1151 Sections are bigger than subsections.
1154 \begin_layout LyX-Code
1155 Subsection description
1158 \begin_layout LyX-Code
1159 Subsections are smaller than sections.
1162 \begin_layout Standard
1163 Click on the second line and select
1172 LyX numbers the subsection
1173 \begin_inset Quotes eld
1177 \begin_inset Quotes erd
1180 , and typesets it in a font which is bigger than regular text but smaller
1181 than the section title.
1182 Change the fourth line
1186 environment as well.
1187 As you probably expected, LyX automatically numbered the section
1188 \begin_inset Quotes eld
1192 \begin_inset Quotes erd
1196 If you put yet another section before Section
1197 \begin_inset space ~
1201 \begin_inset space ~
1204 2 will be renumbered as Section 3, and the subsections will be renumbered
1206 \begin_inset Quotes eld
1210 \begin_inset Quotes erd
1214 \begin_inset Quotes eld
1218 \begin_inset Quotes erd
1225 \begin_layout Standard
1226 Further levels of sectioning include
1239 We'll let you play with these on your own.
1240 You may notice that paragraph and subparagraph headings are not numbered
1241 by default, and that subparagraphs are indented; see the
1245 for an explanation and how to change this.
1250 headings are actually the highest level of sectioning, above
1254 s, but you're only allowed to use them in certain types (text classes) of
1255 LyX documents (see Section
1256 \begin_inset space ~
1260 \begin_inset CommandInset ref
1262 reference "sec:Document-Classes"
1270 \begin_layout Standard
1271 Finally, you may want to have sections or subsections that are not numbered.
1272 There are environments for this as well.
1273 If you change one of your section headings to the
1277 environment (you may have to scroll down in the
1281 box to find it), LyX will use the same font size for the heading as it
1282 uses for a regular section, but it won't number that section.
1283 There are corresponding
1284 \begin_inset Quotes eld
1288 \begin_inset Quotes erd
1291 heading environments for
1300 Try changing some of your sections or subsections to the starred environments,
1301 and note how the other sections' numbers are updated.
1304 \begin_layout Standard
1309 : Fix the section and subsection headings in
1317 \begin_layout Subsection
1321 \begin_layout Standard
1322 LyX has several different environments for typesetting lists.
1323 The various list environments free you from hitting
1327 a million times when writing an outline, or from renumbering a whole list
1328 when you want to add a point in the middle of the list.
1329 Different types of documents logically require different list environments:
1332 \begin_layout Itemize
1333 A slide presentation might use the
1337 environment's bulleted lists to describe different points.
1341 \begin_layout Itemize
1342 An outline would use the
1346 environment's numbered lists (and lettered sublists).
1350 \begin_layout Itemize
1351 A document describing several software packages could use the
1355 environment, where each item in the list begins with a bold-faced word.
1359 \begin_layout Itemize
1364 environment --- not found in LaTeX --- is a slightly different form of
1372 \begin_layout Standard
1373 Let's write a list of reasons why LyX is better than other word processors.
1374 Somewhere in your document, type:
1377 \begin_layout Standard
1380 LyX is better than other word processors because:
1383 \begin_layout Standard
1399 \begin_inset Quotes eld
1403 \begin_inset Quotes erd
1407 Type in your reasons:
1410 \begin_layout LyX-Code
1411 Typesetting is done for you.
1414 \begin_layout LyX-Code
1418 \begin_layout LyX-Code
1419 Lists are very easy to create!
1422 \begin_layout Standard
1423 List environments, unlike headings, do not end when you type
1428 Instead, LyX assumes you're going on to the next item in the list.
1429 The above will therefore result in a three-item list.
1430 If you want more than one paragraph within one list
1434 , one way is to use the
1437 \begin_inset space ~
1442 , which you get by typing
1447 In order to get out of the list, you need to reselect the
1451 environment (or just use the keybinding,
1454 \begin_inset space ~
1462 \begin_layout Standard
1463 You've got a beautiful itemized list.
1464 You might want to run LaTeX to see how the list looks when printed out.
1465 But what if you wanted to number the reasons? Well, just select the whole
1470 \begin_layout Plain Layout
1471 LyX won't let you select the first bullet unless you also select the paragraph
1476 the list, which you probably don't want to do.
1477 Similarly, you can't select the actual number in a numbered section title.
1478 This is on purpose because the bullet or number depends on the document
1479 settings or text position, respectively.
1493 Pow! As we mentioned, if you add or delete a list item, LyX will fix the
1497 \begin_layout Standard
1498 While the list is still selected, you can change to the other two list environme
1507 , in order to see what they look like.
1508 For those two environments, each list item is made up of a term, which
1509 is the item's first word, followed by a definition, which is the rest of
1510 the paragraph (until you hit
1514 .) The term is either typeset in boldface (
1519 \begin_inset Quotes eld
1523 \begin_inset Quotes erd
1530 \begin_layout Plain Layout
1531 But a typesetter's tab, which will change to fit the size of the largest
1532 term, not a pathetic, rigid, unchangeable typewriter
1545 ) from the rest of the paragraph.
1546 If you want to have more than one word in the definition, then separate
1550 \begin_inset space ~
1558 \begin_layout Standard
1563 : Typeset the list in
1568 \begin_layout Standard
1569 You can nest lists within each other in all sorts of interesting ways.
1570 An obvious example would be writing outlines.
1571 Numbered and bulleted lists will have different numbering and bulleting
1572 schemes for sublists.
1577 for details on the different sorts of lists and for examples of nestings.
1580 \begin_layout Subsection
1581 Other environments: Verses, Quotations, and more
1584 \begin_layout Standard
1585 There are two environments for setting quotations apart from surrounding
1590 for short quotes and
1603 \begin_layout Plain Layout
1604 used in this Tutorial for the long typing examples
1613 font; this environment is the only place in LyX where you're allowed to
1614 use multiple spaces to allow code indenting.
1615 You can even write poetry using the
1623 to separate stanzas, and
1627 to separate lines within a stanza.
1632 for more complete descriptions of all of the available LyX environments.
1635 \begin_layout Standard
1640 : Correctly typeset the
1649 \begin_inset Newline newline
1657 \begin_layout Chapter
1661 \begin_layout Standard
1662 The previous chapter hopefully allowed you to get used to writing in LyX.
1663 It introduced you to the basic editing operations in LyX, as well as the
1664 powerful method of writing with environments.
1665 Most people who use LyX, though, will want to write documents: papers,
1666 articles, books, manuals, or letters.
1667 This chapter is meant to take you from simply writing text with LyX to
1668 writing a complete document.
1669 It will introduce you to text classes, which allow you to write different
1671 It will then describe many of the additions that turn text into a document,
1672 such as titles, footnotes, cross references, bibliographies, and tables
1676 \begin_layout Section
1678 \begin_inset CommandInset label
1680 name "sec:Document-Classes"
1687 \begin_layout Standard
1688 Different sorts of documents should be typeset differently.
1689 For example, books are generally printed double-sided, while articles are
1691 In addition, many documents contain special environments: letters contain
1692 some environments --- such as the sender's address and the signature ---
1693 which do not make sense in a book or article.
1702 \begin_layout Plain Layout
1703 for LaTeX users: this is equivalent to the LaTeX document class
1708 takes care of these large scale differences between different sorts of
1710 This Tutorial, for example, was written in the
1715 Document classes are another major part of the WYSIWYM philosophy; they
1716 tell LyX how to typeset the document, so you don't need to know how.
1719 \begin_layout Standard
1720 Your document is probably being written in the
1728 \begin_layout Plain Layout
1729 That's usually the default document class
1734 Try changing to other document classes (using the
1736 Document\SpecialChar \menuseparator
1739 dialog) to see how they are typeset differently.
1740 If you change your document to the
1744 document class and look at the
1748 box, you'll see that most of the allowed environments are the same.
1749 However, you can now use the
1754 If you are ever unsure about which environments you can use in a given
1755 document class, just consult the
1762 \begin_layout Standard
1763 Font sizes, one- or two-column printing, and page headings are just some
1764 of the ways journals' typesettings differ from one another.
1765 As the Computer Age continues to mature, journals have begun accepting
1766 electronic submissions, creating LaTeX
1767 \begin_inset Quotes eld
1771 \begin_inset Quotes erd
1774 so that authors can submit correctly typeset articles.
1775 LyX is set up to support this as well.
1776 For example, LyX supports typesetting (and extra environments) for the
1777 American Mathematics Society journals using the
1780 \begin_inset space ~
1788 \begin_layout Standard
1789 Here is a very quick reference to some of the document classes.
1792 Special Document Classes
1798 manual for many more details.
1801 \begin_layout Standard
1803 \begin_inset Tabular
1804 <lyxtabular version="3" rows="7" columns="2">
1806 <column alignment="center" valignment="top" width="0pt">
1807 <column alignment="center" valignment="top" width="0pt">
1809 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1812 \begin_layout Plain Layout
1818 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1821 \begin_layout Plain Layout
1829 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1832 \begin_layout Plain Layout
1838 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1841 \begin_layout Plain Layout
1842 one-sided, no chapters
1849 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1852 \begin_layout Plain Layout
1858 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1861 \begin_layout Plain Layout
1862 layout & environments for American Math Society
1869 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1872 \begin_layout Plain Layout
1878 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1881 \begin_layout Plain Layout
1882 longer than article, two-sided
1889 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1892 \begin_layout Plain Layout
1898 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1901 \begin_layout Plain Layout
1902 report + front and back matter
1909 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1912 \begin_layout Plain Layout
1918 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1921 \begin_layout Plain Layout
1929 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1932 \begin_layout Plain Layout
1938 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1941 \begin_layout Plain Layout
1942 lots of extra environments for address, signature\SpecialChar \ldots{}
1956 \begin_layout Section
1957 Templates: Writing a Letter
1960 \begin_layout Standard
1961 One way to write a letter would be to open a new file, and choose a
1967 Document\SpecialChar \menuseparator
1971 While this is the most obvious way to write a letter, it seems like extra
1973 Every time you write a business letter, you want to have your address,
1974 the address you're sending to, a body, a signature, etc.
1979 for letters, which contains a sample letter; once you have a template,
1980 you can just replace a couple parts of the letter with your text each time
1984 \begin_layout Standard
1985 Open a new file with
1987 File\SpecialChar \menuseparator
1989 \begin_inset space ~
1993 \begin_inset space ~
2004 Save and print the file to see how the various environments are typeset.
2007 \begin_layout Standard
2008 When you look at the
2012 box, you'll see several environments, like the
2015 \begin_inset space ~
2020 environment, which don't even exist in most other document classes.
2030 You can play around for a while to figure out how the various environments
2032 You'll notice for example that the
2036 environment has the word
2037 \begin_inset Quotes eld
2041 \begin_inset Quotes eld
2044 in red before the actual text of the signature.
2045 This word doesn't show up in the actual letter, as you'll see if you view/expor
2047 It's just there to let you know where the signature goes.
2048 Also, note that it doesn't matter where in the file the
2053 Remember, LyX is WYSIWYM; you can put the
2057 environment anywhere you want, but LyX knows that in the printout, the
2058 signature should be at the end.
2061 \begin_layout Standard
2062 A template is just a regular LyX file.
2063 This means you can fill in your address and signature and save the file
2065 From now on, any time you want to write a letter, you can use the new template
2067 We don't have to suggest an actual
2068 \begin_inset Quotes eld
2072 \begin_inset Quotes erd
2075 here; just write a letter to someone!
2079 \begin_layout Plain Layout
2080 One warning, if you're writing from a template.
2081 If you erase all of the text in an environment --- for example, if you
2085 \begin_inset space ~
2090 field so that you can replace it with your own --- and then you move the
2091 cursor without writing any text, the environment may disappear.
2092 This is because most environments cannot exist without any text in them.
2093 Just reselect the environment from the
2105 \begin_layout Standard
2106 Templates can be a huge time-saver, and we urge you to use them whenever
2108 In addition, they can help a person learn how to use some of the fancier
2110 Finally, they may be useful for a person who is configuring LyX for a bunch
2111 of less computer-aware users.
2112 When they're first learning LyX, it will be much less intimidating if they
2113 have a letter template customized for their company, for example.
2116 \begin_layout Section
2120 \begin_layout Standard
2121 LyX (like LaTeX) considers the title --- which may contain the actual title,
2122 the author, the date, and even an abstract of a paper --- to be a separate
2123 part of the document.
2126 \begin_layout Standard
2127 Go back to your LyX document and make sure it's using the
2135 \begin_layout Plain Layout
2136 You should not be using the letter any more, since the
2140 document class doesn't allow titles.
2145 Type a title on the first line, and change the line to the
2150 On the next line, type your name and change it to the
2155 On the next line, write the date in the
2160 Type a paragraph or two summarizing your document using the
2165 Notice how the title is presented when it's printed out.
2166 If you changed the document format to Book, you'll get a separate title
2167 page, like the first page of this tutorial.
2170 \begin_layout Standard
2175 : Fix the title, date, and author in
2180 \begin_layout Section
2181 Labels and Cross-References
2184 \begin_layout Standard
2185 You can label section headings, list items, formulas, footnotes, and floats
2189 \begin_layout Plain Layout
2190 Floats are explained in the
2204 Once you do so, you can refer to this section in other parts of the document,
2205 using cross-references.
2206 You can refer either to the section's number, or to the page that the section
2208 As with section numbering, LyX also takes care about cross-reference numbering
2210 Automatic labels and cross-references are one of the best advantages of
2211 LyX (and LaTeX) over conventional word processors.
2214 \begin_layout Subsection*
2218 \begin_layout Standard
2219 Go to our second section, whose title is
2220 \begin_inset Quotes eld
2224 \begin_inset Quotes erd
2228 Click at the end of the section title line, and select
2230 Insert\SpecialChar \menuseparator
2233 or the toolbar button
2234 \begin_inset Graphics
2235 filename ../images/label-insert.png
2242 A dialog asks you for a label name, and gives you a suggestion.
2247 , the label name will be placed in a box next to the section title.
2250 \begin_layout Standard
2251 By the way, you could have put the label right anywhere within the section
2252 as well; section references will refer to the last section or subsection
2253 whose heading comes before the label.
2254 However, putting it on the same line as the section title (or, perhaps,
2255 on the first line of the section's text) ensures that page references will
2256 reference the beginning of the section.
2259 \begin_layout Standard
2260 So far you haven't done anything --- the DVI output will look exactly the
2261 same, since labels don't show up in the printed document.
2262 However, now that you have added a label, you can refer to that label with
2267 \begin_layout Subsection*
2268 Your first cross-reference
2271 \begin_layout Standard
2272 Place the cursor somewhere in Section
2273 \begin_inset space ~
2280 \begin_layout LyX-Code
2281 If you want to know more about this document, then see
2282 \begin_inset Newline newline
2285 Section , which can be found on page .
2288 \begin_layout Standard
2289 Now --- with the cursor after the word
2290 \begin_inset Quotes eld
2294 \begin_inset Quotes erd
2299 Insert\SpecialChar \menuseparator
2301 \begin_inset space ~
2306 or the toolbar button
2307 \begin_inset Graphics
2308 filename ../images/dialog-show-new-inset_ref.png
2320 It shows a list of the possible labels you can reference.
2321 At the moment, there should be only one,
2322 \begin_inset Quotes eld
2325 sec:About-This-Document
2326 \begin_inset Quotes erd
2330 Select it (it may be selected by default), and click
2335 Now put the cursor after the word
2336 \begin_inset Quotes eld
2340 \begin_inset Quotes erd
2343 , and change the reference format to use the page number then click
2348 (To be really correct, you should put a
2351 \begin_inset space ~
2357 \begin_inset Quotes eld
2361 \begin_inset Quotes erd
2365 Same for the page reference.)
2368 \begin_layout Standard
2369 LyX puts the references in a box right where the cursor was.
2370 In the printed document, this reference marker will be replaced with either
2371 the page or section number (depending on what you selected in the
2376 View your document as DVI, and you'll see that on the last page we refer
2378 \begin_inset Quotes eld
2382 \begin_inset space ~
2386 \begin_inset Quotes erd
2390 \begin_inset Quotes eld
2394 \begin_inset space ~
2398 \begin_inset Quotes erd
2401 (or whatever page Section
2402 \begin_inset space ~
2408 \begin_layout Standard
2409 Conveniently, a cross-reference acts as a hyperlink when you are editing
2410 a document in LyX; clicking on it will pop up the
2417 \begin_inset space ~
2421 \begin_inset space ~
2426 will move the cursor to the referenced label.
2429 \begin_layout Subsection*
2430 More fun with labels
2433 \begin_layout Standard
2434 We told you that LyX takes care about numbering cross-references; now you
2436 Add a new section before Section
2437 \begin_inset space ~
2441 Update the DVI view, and --- voilà ! --- the section cross reference changed
2443 \begin_inset Quotes eld
2447 \begin_inset Quotes erd
2450 ! Change the section
2451 \begin_inset Quotes eld
2455 \begin_inset Quotes erd
2458 to a subsection, and the cross-reference will reference Subsection
2459 \begin_inset space ~
2462 2.1 instead of Section
2463 \begin_inset space ~
2467 The page reference won't change unless you add a whole page of text before
2468 the label, of course.
2472 \begin_layout Standard
2473 If you want some more practice with labels, then try putting a new label
2474 where your first cross-reference was, and refer to that label from elsewhere
2476 If you'll be inserting cross-references often, it may be convenient to
2484 \begin_layout Standard
2485 If you want to make sure that the cross-referencing gets the pages right
2486 even for larger documents,
2490 a couple pages of text from the
2494 to the clipboard, and
2498 the stolen text into your document.
2502 \begin_layout Plain Layout
2503 By the way, copying a chapter title may cause an error, because chapters
2504 aren't allowed in the article class, see section
2505 \begin_inset space ~
2509 \begin_inset CommandInset ref
2511 reference "sec:Document-Classes"
2516 If this happens, just delete the chapter title.
2524 \begin_layout Standard
2529 : Fix the references in
2534 \begin_layout Section
2535 Footnotes and Margin Notes
2538 \begin_layout Standard
2539 Footnotes can be added using the toolbar button
2540 \begin_inset Graphics
2541 filename ../images/footnote-insert.png
2549 Insert\SpecialChar \menuseparator
2553 Click at the end of the word
2554 \begin_inset Quotes eld
2558 \begin_inset Quotes erd
2561 somewhere in your document and click the
2562 \begin_inset Graphics
2563 filename ../images/footnote-insert.png
2570 A footnote box appears where you can enter the text of the footnote.
2571 LyX should place the cursor at the beginning of the footnote box.
2575 \begin_layout LyX-Code
2576 LyX is a typesetting word processor.
2579 \begin_layout Standard
2580 Now click on the button labelled
2581 \begin_inset Quotes eld
2585 \begin_inset Quotes erd
2589 The footnote box is closed, leaving the button showing where the footnote
2590 marker will be in the printed text; this is called
2591 \begin_inset Quotes eld
2595 \begin_inset Quotes erd
2599 You can unfold the footnote at any time --- and re-edit its text, if you
2600 want --- by clicking again on the
2601 \begin_inset Quotes eld
2605 \begin_inset Quotes erd
2611 \begin_layout Standard
2612 You may wonder why the footnote button is a word instead of a number.
2613 The answer is that LyX takes care about the footnote numbering for you
2614 in the printed text.
2615 You can see this yourself by looking at the DVI file (or printout).
2616 If you add other footnotes, LyX will renumber the footnotes.
2617 Since LyX (well, LaTeX, actually) takes care of the footnote numbering,
2618 there's really no need to put the numbers in the LyX file.
2621 \begin_layout Standard
2622 A footnote can be cut and pasted like normal text.
2623 Go ahead; try it! All you need to do is select the footnote button
2627 \begin_layout Plain Layout
2628 It may be easier to select it using the keyboard.
2629 You might accidentally open the footnote if you're trying to select the
2630 marker itself with the mouse.
2644 In addition, you can change regular text to a footnote, by selecting it
2646 \begin_inset Graphics
2647 filename ../images/footnote-insert.png
2653 button; change a footnote to regular text by hitting the
2657 key when the cursor is in the first position of a footnote, or by hitting
2662 key when the cursor is in the very last position of the footnote, respectively.
2665 \begin_layout Standard
2666 Margin notes can be added using the menu
2668 Insert\SpecialChar \menuseparator
2670 \begin_inset space ~
2675 or the toolbar button
2676 \begin_inset Graphics
2677 filename ../images/marginalnote-insert.png
2684 Margin notes are like footnotes, except that:
2687 \begin_layout Itemize
2688 the on-screen boxes say
2689 \begin_inset Quotes eld
2693 \begin_inset Quotes erd
2697 \begin_inset Quotes eld
2701 \begin_inset Quotes erd
2707 \begin_layout Itemize
2708 the notes will be placed in the margin, instead of below the text
2711 \begin_layout Itemize
2712 margin notes are not numbered
2715 \begin_layout Standard
2716 Change your LyX footnote back to text, then select and change it to a margin
2718 Run LaTeX again to see what the margin note looks like.
2721 \begin_layout Standard
2726 : Fix the footnote in
2731 \begin_layout Section
2733 \begin_inset CommandInset label
2735 name "sec:bibliographies"
2742 \begin_layout Standard
2743 Bibliographies (at least in the exact sciences) are similar to cross references.
2744 The bibliography contains a list of references at the end of the document,
2745 and they can be referenced from within the document.
2746 Like section titles, LyX and LaTeX make your job easier by automatically
2747 numbering the bibliography items and changing citations when the item numbers
2751 \begin_layout Standard
2752 Go to the end of the document and switch to the
2757 Now, each paragraph you type will be a reference.
2759 \begin_inset Quotes eld
2764 The Lyx Tutorial, by the LyX Documentation Team
2767 \begin_inset Quotes erd
2770 as your first reference.
2771 Note that LyX automatically puts a number in a box before each reference.
2772 Click on the boxed reference number, and the
2775 \begin_inset space ~
2785 is to refer to this reference within the LyX document, the
2794 is set (default), you will see the number of the bibliography in the output.
2800 \begin_inset Quotes eld
2804 \begin_inset Quotes erd
2807 to make it easy to remember.
2810 \begin_layout Standard
2811 Now pick somewhere in your document that you would like to insert a reference.
2814 Insert\SpecialChar \menuseparator
2817 or the toolbar button
2818 \begin_inset Graphics
2819 filename ../images/dialog-show-new-inset_citation.png
2831 The right panel in this dialog lists all the bibliography entries, and
2832 this field allows you to choose which bibliography item you want to cite.
2834 \begin_inset Quotes eld
2838 \begin_inset Quotes erd
2841 (right now, that's the only item in the bibliography), then use the
2845 button in the center to insert it.
2846 (You can have multiple citations in the same place by transferring a number
2847 of keys this way.) Now view your file as DVI, and you'll see that the citation
2848 appears in brackets in the text, referring to the bibliography at the end
2852 \begin_layout Standard
2856 \begin_inset space ~
2865 dialog will put a remark (such as a reference to a page or chapter within
2866 the referenced book or article) in the brackets after the reference.
2867 If you want the references to have labels instead of numbers in the printed
2868 output (for example, some journals would use
2869 \begin_inset Quotes eld
2873 \begin_inset Quotes erd
2876 to refer to a paper written by Smith in 1995), use the
2883 \begin_inset space ~
2896 \begin_layout Standard
2901 Fix the bibliography and citation in
2906 \begin_layout Section
2910 \begin_layout Standard
2911 You may want to put a table of contents at the beginning of your document.
2912 LyX makes this very easy to do.
2917 after your document title and before your first section title and choose
2920 Insert\SpecialChar \menuseparator
2922 \begin_inset space ~
2926 \begin_inset space ~
2929 TOC\SpecialChar \menuseparator
2931 \begin_inset space ~
2935 \begin_inset space ~
2942 \begin_inset Quotes eld
2946 \begin_inset Quotes erd
2949 will appear in a button on the first line of the document.
2953 \begin_layout Standard
2954 This may not appear to be very useful.
2955 However, if you look at your DVI file, you will see that a table of contents
2956 has been generated, listing the various sections and subsections in your
2958 As usual, if you reorder sections or create new ones, you will see those
2959 changes in the DVI file when you update it.
2963 \begin_layout Standard
2964 The table of contents is not printed in the on-screen version of the document
2965 to keep the overview in your file.
2966 But you can display the table of contents in a separate window by clicking
2967 on the table of contents button, or by using
2969 Document\SpecialChar \menuseparator
2972 or the toolbar button
2973 \begin_inset Graphics
2974 filename ../images/dialog-toggle_toc.png
2981 This menu will work even if you don't have a table of contents inset in
2983 This is a very useful tool where you can move around your document parts.
2984 Clicking on a (sub)section title in the
2988 window will highlight that line and move the display (in the LyX editing
2989 window) to that place in the document.
2990 You can also use the arrow keys to move up and down in the table of contents.
2991 You may therefore find it convenient to leave this window open throughout
2993 You can get similar functionality from the
2997 menu, though, where the table of contents appears automatically.
3000 \begin_layout Standard
3001 To get rid of the Table of Contents, you can delete the table of contents
3002 button just like any other text.
3005 \begin_layout Standard
3010 : Fix the table of contents in
3015 \begin_layout Chapter
3019 \begin_layout Standard
3020 LaTeX is used by many scientists because it outputs great looking equations,
3021 avoiding the control characters used by word processors and their equation
3023 Many of these scientists are frustrated, however, because writing equations
3024 in LaTeX is more like programming than writing.
3025 Happily, LyX has WYSIWYM support for equations.
3026 If you are used to LaTeX, you'll find that all of the usual LaTeX math
3027 commands can be typed in normally, but they will show up in a WYSIWYM fashion.
3028 If, on the other hand, you've never written in LaTeX, then the
3031 \begin_inset space ~
3036 will allow you to write professional-looking math quickly and easily.
3039 \begin_layout Section
3043 \begin_layout Standard
3044 Somewhere in your LyX document, type:
3047 \begin_layout LyX-Code
3048 I like what Einstein said, E=mc^2, because it's so simple.
3052 \begin_layout Standard
3053 Now, that equation doesn't look very good in LyX and in the output; there's
3054 no space between the letters and the equals sign, and you'd like to write
3055 an actual superscript for the
3056 \begin_inset Quotes eld
3060 \begin_inset Quotes erd
3064 That bad typesetting happened because we didn't tell LyX that we were writing
3065 a mathematical expression, so it typeset the equation like regular old
3069 \begin_layout Standard
3070 Instead, we create a formula that will get typeset properly.
3071 In order to create a formula, just click the toolbar button
3072 \begin_inset Graphics
3073 filename ../images/math-mode.png
3081 Insert\SpecialChar \menuseparator
3082 Math\SpecialChar \menuseparator
3084 \begin_inset space ~
3090 LyX will insert a little blue square, which is an empty math formula.
3096 The expression is typed in blue, and the blue square disappears as soon
3097 as the formula is not empty.
3102 to leave the equation The purple markers disappear, leaving the cursor
3103 to the right of the expression, and now if you type something, it will
3107 \begin_layout Standard
3108 Run LaTeX and look at the output.
3109 Notice that the expression was typeset nicely, with spaces between the
3110 letters and the equals sign, and a superscript
3111 \begin_inset Quotes eld
3115 \begin_inset Quotes erd
3119 Letters in math mode are assumed to be variables, and come out in italics.
3120 Numbers are just numbers.
3123 \begin_layout Standard
3124 This math editor is another example of the WYSIWYM philosophy.
3125 In LaTeX, you write a mathematical expression using text and commands like
3132 ; this can be frustrating, because you can't see what an expression looks
3133 like until you LaTeX the file, and may have to spend time to find e.
3134 \begin_inset space \thinspace{}
3138 \begin_inset space \space{}
3142 LyX doesn't attempt to get the expression to look perfect (WYSIWYG), but
3143 it gives you an extremely good idea of what the expression will look like.
3144 LaTeX then takes care of the professional typesetting.
3147 \begin_layout Section
3148 Navigating an Equation
3151 \begin_layout Standard
3153 \begin_inset Formula $E=mc^{2}$
3157 \begin_inset Formula $E=1+mc^{2}$
3161 Use the arrow keys to move the cursor into the expression.
3162 Note that when you enter the expression, the purple markers appear to let
3163 you know you're editing math.
3172 to move the cursor past the equals sign, and just type
3173 \begin_inset Quotes eld
3177 \begin_inset Quotes erd
3181 Again, you can use the arrow keys or
3185 to leave the formula\SpecialChar \@.
3189 \begin_layout Standard
3190 Other than the special keys described below, typing in math mode is like
3191 editing regular text.
3201 Select text either with the arrow keys or with the mouse.
3204 Edit\SpecialChar \menuseparator
3207 works in math mode as well as cut and paste.
3208 One thing to be careful of: If you are left or right outside a formula
3217 , respectively, you delete the whole formula.
3218 Luckily, you can just use
3225 \begin_layout Standard
3226 What if you want to change
3227 \begin_inset Formula $E=mc^{2}$
3231 \begin_inset Formula $E=mc^{2.5}+1$
3234 ? Again, you can use the mouse to click in the right place.
3235 However, you can also use the arrow keys.
3236 If the cursor is just after the
3237 \begin_inset Quotes eld
3241 \begin_inset Quotes erd
3245 \begin_inset Quotes eld
3249 \begin_inset Quotes erd
3256 and the cursor is moved to the level of the superscript, just before the
3258 \begin_inset Quotes eld
3262 \begin_inset Quotes erd
3267 \begin_inset Quotes eld
3271 \begin_inset Quotes erd
3279 will move the cursor back to the regular level.
3288 , the cursor will be placed
3292 the superscript (so that you can then type the
3293 \begin_inset Quotes eld
3297 \begin_inset Quotes erd
3303 \begin_layout Section
3304 Exponents and Indices
3307 \begin_layout Standard
3308 An exponent can be entered from the
3311 \begin_inset space ~
3316 (see below), but it's actually simpler just to type the caret key,
3317 \begin_inset Quotes eld
3321 \begin_inset Quotes erd
3325 LyX will place another blue rectangle in the superscript, so that whatever
3326 you write next will be superscripted, and in a smaller font size.
3327 Everything you type until you hit a
3335 to exit the formula entirely) will be in the superscript.
3338 \begin_layout Standard
3339 Writing a subscript (index) is just as easy --- start one by typing the
3341 \begin_inset Quotes eld
3345 \begin_inset Quotes eld
3349 You can subscript and superscript both subscripts and superscripts like
3351 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3358 \begin_layout Standard
3370 \begin_layout Section
3374 \begin_layout Standard
3378 \begin_inset space ~
3383 is a convenient way to enter symbols or to perform complicated formula
3385 Many of these operations can be accomplished from the keyboard or the
3387 Edit\SpecialChar \menuseparator
3392 Insert\SpecialChar \menuseparator
3396 However, we're going to concentrate on using the
3399 \begin_inset space ~
3404 , just to let you know what's out there; you can learn keyboard shortcuts
3405 later, from other manuals.
3408 \begin_layout Standard
3413 is shown when the cursor is in a formula and can also be turned on manually
3416 View\SpecialChar \menuseparator
3420 When you click there on
3421 \begin_inset Quotes eld
3425 \begin_inset Quotes erd
3428 the toolbar will be shown permanently at the bottom; this state is visualized
3433 menu with a checkmark.
3434 When you click in this state again on
3435 \begin_inset Quotes eld
3439 \begin_inset Quotes erd
3450 is only shown when the cursor is within a formula; this state is visualized
3451 by the renaming of the menu entry from
3452 \begin_inset Quotes eld
3456 \begin_inset Quotes erd
3460 \begin_inset Quotes eld
3464 \begin_inset space ~
3468 \begin_inset Quotes erd
3474 \begin_layout Subsection
3478 \begin_layout Standard
3482 \begin_inset space ~
3487 which allow you to choose from a large array of symbols used in math: various
3488 arrows, relations, operators, and sums and integrals.
3489 Note that subscripting and superscripting allow you to put lower and upper
3490 limits on sums and integrals.
3494 \begin_layout Standard
3495 \begin_inset Quotes eld
3498 Nothing you can do that can't be done\SpecialChar \ldots{}
3500 \begin_inset Formula $\heartsuit$
3504 \begin_inset Quotes erd
3510 \begin_layout Subsection
3511 Square roots, accents, and delimiters
3514 \begin_layout Standard
3515 To type a square root, just click on the button
3516 \begin_inset Graphics
3517 filename ../images/math/sqrt.png
3524 The square root appears, and the cursor is in a new insertion point inside
3526 You can type variables, numbers, other square roots, fractions, whatever
3528 LyX will automatically resize the square root to fit what's inside.
3531 \begin_layout Standard
3532 Accenting a character (
3533 \begin_inset Formula $\overrightarrow{v}$
3536 ) or group of characters (
3537 \begin_inset Formula $\overrightarrow{a+b}$
3540 ) is done the same way.
3541 Decorations are available from the toolbar via the button
3542 \begin_inset Graphics
3543 filename ../images/math/hat.png
3550 Click on a decoration, and LyX will insert that decoration with an insertion
3551 point under (or over) it.
3552 Just type what you want in the insertion point.
3553 There are two sets of decorations: those that resize with the text you
3554 type, and those that have fixed size, and are most appropriate for a single
3559 \begin_layout Standard
3560 Delimiters such as parentheses, brackets, and braces work similarly, but
3561 are a bit more complicated.
3562 Hit the delimiter button
3563 \begin_inset Graphics
3564 filename ../images/dialog-show_mathdelimiter.png
3575 Your current selection of delimiters is displayed in a box.
3576 It's a pair of parentheses by default, but you can choose a pair of braces,
3577 a brace and a parenthesis, or choose the empty square to have something
3579 \begin_inset Quotes eld
3583 \begin_inset Formula $a=\left\langle 7\right.$
3587 \begin_inset Quotes erd
3590 (the empty delimiter is displayed as a broken line in LyX, but won't show
3594 \begin_layout Standard
3595 If you're lazy, you can type actual parentheses in math mode, rather than
3601 However, those parentheses will be the same size as regular text, which
3602 will look bad if you have a big fraction or matrix inside the parentheses.
3603 So better use in this case one of the three delimiter buttons that insert
3605 \begin_inset space \thinspace{}
3609 \begin_inset space \space{}
3613 \begin_inset space \thinspace{}
3619 \begin_layout Standard
3620 You can also put delimiters or a square root sign or a decoration on already
3621 existing formula parts.
3622 Select the portion of the formula that you want to adjust, and then click
3623 on the button you want from the
3626 \begin_inset space ~
3632 Try using this to change Newton's second law from scalar to vector form
3634 \begin_inset Formula $f=ma$
3638 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3642 Once you've learned about matrices, this is how you'll put parentheses
3643 or brackets around them.
3646 \begin_layout Subsection
3650 \begin_layout Standard
3651 To create a fraction, click on the fraction button
3652 \begin_inset Graphics
3653 filename ../images/math/frac.png
3663 \begin_inset space ~
3669 LyX writes two insertion points in a fraction.
3670 As you would expect, you can use arrow keys or the mouse to move around
3672 Click on the top square and type
3673 \begin_inset Quotes eld
3677 \begin_inset Quotes erd
3686 \begin_inset Quotes eld
3690 \begin_inset Quotes erd
3694 You've made a fraction! Of course you can type anything within each of
3695 the two boxes: variables with exponents, square roots, other fractions,
3700 \begin_layout Standard
3712 \begin_layout Subsection
3713 TeX mode: Limits, log, sin and others
3716 \begin_layout Standard
3717 Because letters in math mode are considered to be variables, if you type
3719 \begin_inset Quotes eld
3723 \begin_inset Quotes erd
3726 in math mode, LyX thinks you are typing the product of the three variables
3728 \begin_inset Formula $s$
3732 \begin_inset Formula $i$
3736 \begin_inset Formula $n$
3740 The three letters will be typeset in italics, when what you really wanted
3742 \begin_inset Quotes eld
3746 \begin_inset Quotes erd
3750 In addition, LyX won't put a space between the word
3751 \begin_inset Quotes eld
3755 \begin_inset Quotes erd
3759 \begin_inset Quotes eld
3763 \begin_inset Quotes erd
3770 will exit the formula).
3772 \begin_inset Quotes eld
3776 \begin_inset Formula $\sin(x)$
3780 \begin_inset Quotes erd
3784 \begin_inset Quotes eld
3788 \begin_inset Formula $sin(x)$
3792 \begin_inset Quotes erd
3798 \begin_layout Standard
3802 \begin_inset space ~
3808 \begin_inset Graphics
3809 filename ../images/math/functions.png
3816 \begin_inset Quotes eld
3820 \begin_inset Quotes erd
3823 in the appearing function list.
3825 \begin_inset Quotes eld
3829 \begin_inset Quotes erd
3832 is displayed in LyX in black, and set in upright roman type.
3833 The whole word is treated as one symbol, so if you type
3837 , it will delete the whole word.
3839 \begin_inset Quotes eld
3843 \begin_inset Quotes erd
3846 , which will be written in blue italics, like you expect in a formula.
3847 In the output, the expression will be correctly typeset.
3851 \begin_layout Standard
3852 The function list include other trigonometric functions and their inverses,
3853 hyperbolic functions, logarithms, limits, and quite a few others.
3854 These functions can take subscripts and superscripts, important for typing
3856 \begin_inset Quotes eld
3860 \begin_inset Formula $\cos^{2}\theta$
3864 \begin_inset Quotes erd
3868 \begin_inset Quotes eld
3872 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3876 \begin_inset Quotes erd
3882 \begin_layout Standard
3894 \begin_layout Subsection
3898 \begin_layout Standard
3899 Click on the matrix button
3900 \begin_inset Graphics
3901 filename ../images/dialog-show_mathmatrix.png
3910 \begin_inset space ~
3916 The appearing dialog allows you to choose how many rows and columns you
3917 want in your matrix.
3918 Choose 2 rows and 3 columns and hit
3923 LyX prints 6 insertion points in a
3924 \begin_inset Formula $2\times3$
3928 As usual, you can put any sort of formula expression (a square root, another
3929 matrix, etc.) in each insertion point.
3930 You can also leave some of the insertion points empty if you want.
3933 \begin_layout Standard
3938 can be used to move horizontally between the columns of a matrix.
3939 Alternatively, you can use the arrow keys to move around - hitting
3943 at the end of one box will move to the next box,
3947 will move to the next row, etc.
3950 \begin_layout Standard
3951 If you need to change the number of rows and columns, use the menu
3953 Edit\SpecialChar \menuseparator
3954 Math\SpecialChar \menuseparator
3956 \begin_inset space \thinspace{}
3960 \begin_inset space \thinspace{}
3965 or the math toolbar buttons
3966 \begin_inset Graphics
3967 filename ../images/tabular-feature_append-row.png
3974 \begin_inset Graphics
3975 filename ../images/tabular-feature_delete-row.png
3982 \begin_inset Graphics
3983 filename ../images/tabular-feature_append-column.png
3990 \begin_inset Graphics
3991 filename ../images/tabular-feature_delete-column.png
4000 \begin_layout Standard
4005 for information on how to change the horizontal alignment of each column,
4006 and how to change the vertical position of the whole matrix.
4007 Note that if you want to write a table containing text, you should use
4008 LyX's wonderful table support, rather than trying to write text in a matrix.
4011 \begin_layout Subsection
4015 \begin_layout Standard
4016 All of the expressions we have written so far have been on the same line
4017 as the text that came before and after them, otherwise known as inline
4019 This is fine for short, simple expressions, but if you want to write larger
4020 ones, or if you want your expressions to stand out from the text, you need
4021 to write them in display mode.
4022 In addition, only displayed expressions can be labeled and numbered (see
4027 ), and multi-line equations must be in display mode.
4030 \begin_layout Standard
4031 Click on the display button
4032 \begin_inset Graphics
4033 filename ../images/math-display.png
4042 \begin_inset space ~
4047 , which represents a couple lines of text before and after a centered blue
4049 LyX inserts a formula, but the insertion point is on a new line, and it's
4050 centered within that line.
4051 Now type an expression and run LaTeX to see how it looks.
4052 The display button is actually a toggle; use it now to change a couple
4053 of your expressions to display mode and back.
4057 \begin_layout Standard
4058 Display mode has a couple differences from inline mode:
4061 \begin_layout Itemize
4062 The default font is larger for a few symbols, like
4063 \begin_inset Formula $\sum$
4067 \begin_inset Formula $\int$
4073 \begin_layout Itemize
4074 Subscripts and superscripts for limits and sums (but not integrals) are
4075 written under rather than next to the symbols
4078 \begin_layout Itemize
4082 \begin_layout Standard
4083 Other than these differences, though, displayed expressions and inline expressio
4084 ns are very similar.
4087 \begin_layout Standard
4088 One final note about the way displayed formulas are typeset: Be careful
4089 about whether you're putting your equation into a new paragraph or not.
4090 If your formula is in the middle of a sentence or paragraph, then don't
4096 Doing so will cause the text
4100 the formula to start a new paragraph.
4101 That text will therefore eventually be indented, depending on your document
4102 paragraph settings, which is probably not what you want.
4105 \begin_layout Standard
4110 : Put the various equations in
4114 into display mode, and see how they're typeset differently.
4117 \begin_layout Standard
4122 : Using various tools you've learned in this section, you should be able
4123 to write an equation like
4127 \begin_layout Plain Layout
4128 After you've done it the hard way, give
4130 Insert\SpecialChar \menuseparator
4131 Math\SpecialChar \menuseparator
4133 \begin_inset space ~
4144 \begin_inset Formula \[
4145 f(x)=\left\{ \begin{array}{cc}
4148 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0\end{array}\right.\]
4155 \begin_layout Section
4159 \begin_layout Standard
4160 LyX's math editor can do plenty more.
4161 By now, you're familiar with the basics, so we refer to the
4168 \begin_layout Itemize
4169 Labeling and numbering expressions
4172 \begin_layout Itemize
4173 Multi-line equations
4176 \begin_layout Itemize
4177 Change typefaces, e.
4178 \begin_inset space \thinspace{}
4182 \begin_inset space \space{}
4185 to write bold-face text in an expression.
4188 \begin_layout Itemize
4189 Fine-tune font sizes and spacing within an expression.
4190 (Don't worry about this until your final draft!)
4193 \begin_layout Itemize
4195 These are very powerful, because you just define them once at the top of
4196 the document, and then you can use them throughout the document.
4199 \begin_layout Itemize
4200 Do lots of other things that can't be mentioned in this Tutorial.
4203 \begin_layout Chapter
4207 \begin_layout Section
4208 Other major LyX Features
4211 \begin_layout Standard
4212 We haven't gone through all the possible commands in LyX, and we aren't
4221 \begin_inset space ~
4226 manual for more information.
4227 We'll just mention a couple more major things LyX can do:
4230 \begin_layout Itemize
4231 LyX has WYSIWYM support for tables.
4234 Insert\SpecialChar \menuseparator
4238 \begin_inset Graphics
4239 filename ../images/tabular-insert.png
4246 Click on the table with the
4253 \begin_inset space ~
4258 dialog box which allows extensive table editing.
4261 \begin_layout Itemize
4262 LyX also supports including pictures in any format within documents.
4265 Insert\SpecialChar \menuseparator
4269 \begin_inset Graphics
4270 filename ../images/dialog-show-new-inset_graphics.png
4277 Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4278 can have captions, and LyX will automatically generate lists of figures
4282 \begin_layout Itemize
4283 LyX is heavily configurable.
4284 Everything from how the LyX window looks to how the output comes out can
4285 be configured in a number of ways.
4286 Much configuration is done through
4288 Tools\SpecialChar \menuseparator
4292 For more information on this, check out
4294 Help\SpecialChar \menuseparator
4295 Customization\SpecialChar \@.
4299 \begin_layout Itemize
4300 LyX is being developed by a team of programmers on five continents.
4301 Therefore, LyX has better support for non-English languages (such as Dutch,
4302 German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4303 ) than many word processors.
4304 Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4305 languages Chinese Japanese, and Korean are supported.
4306 You can write documents in other languages and you can also configure LyX
4307 to show its menus and error messages in other languages.
4311 \begin_layout Itemize
4312 The LyX menus feature keybindings.
4313 This means that you can do
4315 File\SpecialChar \menuseparator
4326 or by using the binding which is shown next to it in the menu (C-O by default).
4327 Keybindings are also configurable.
4328 For information on this, check out
4330 Help\SpecialChar \menuseparator
4331 Customization\SpecialChar \@.
4335 \begin_layout Itemize
4336 LyX can read LaTeX documents.
4338 \begin_inset space ~
4342 \begin_inset CommandInset ref
4344 reference "sec:tex2lyx"
4351 \begin_layout Itemize
4352 Spellchecking, thesaurus, and word count facilities are available.
4355 \begin_layout Itemize
4356 Generation of indexes and nomenclatures/glossaries is supported.
4359 \begin_layout Section
4361 \begin_inset CommandInset label
4363 name "sec:latexusers"
4370 \begin_layout Standard
4371 If you don't know anything about LaTeX, you don't have to read this section.
4372 Actually, you might want to
4376 about LaTeX, and then read this chapter.
4377 However, some who begin to use LyX will be familiar with LaTeX.
4378 If you are such a person, you may be wondering if LyX can really do everything
4380 The short answer is that LyX can do pretty much everything LaTeX can do
4381 in one form or another, and it definitely simplifies most parts of writing
4385 \begin_layout Standard
4386 Because this is just a tutorial, we are only going to mention things that
4387 new LyX users will most likely be interested in.
4388 In the interests of keeping the Tutorial short, we will give only minimal
4393 \begin_inset space ~
4401 \begin_inset space ~
4406 manual have a great deal of information on differences between LyX and
4407 LaTeX, and how to do various LaTeX tricks in LyX.
4410 \begin_layout Subsection
4414 \begin_layout Standard
4415 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4416 will be displayed in red on the screen.
4417 You can use TeX commands in LyX by choosing
4419 Insert\SpecialChar \menuseparator
4421 \begin_inset space ~
4427 \begin_inset Graphics
4428 filename ../images/ert-insert.png
4435 This creates a box where everything within it is passed straight to LaTeX.
4438 \begin_layout Standard
4439 In a math formula, TeX mode is handled a bit differently.
4440 TeX mode is there entered by typing a backslash.
4441 The backslash is not written out, but anything you type afterwards will
4443 You exit TeX mode by typing
4447 or some other non-alphabetic character, like a number, underscore, caret,
4449 Once you exit TeX mode, if LyX knows the TeX command you've typed in, it
4450 will convert it to WYSIWYM\SpecialChar \@.
4452 \begin_inset Quotes eld
4462 \begin_inset Quotes erd
4465 in a formula and then press
4469 , LyX will change the red
4470 \begin_inset Quotes eld
4474 \begin_inset Quotes erd
4478 \begin_inset Quotes eld
4482 \begin_inset Formula $\gamma$
4486 \begin_inset Quotes erd
4490 This will work for almost all, non-complicated math macros.
4491 This may be faster than using the
4494 \begin_inset space ~
4499 , and will be especially convenient for experienced LaTeX users.
4502 \begin_layout Standard
4503 As a special case, if you type a brace in TeX mode, then the beginning
4507 ending braces will be inserted in red, then take you
4511 of TeX mode and place the cursor between the braces.
4512 This makes it more convenient to type commands that LyX doesn't know which
4516 \begin_layout Standard
4517 LyX can't do absolutely everything that LaTeX can do.
4518 Some fancy functions are not supported at all, while some work but aren't
4520 TeX mode allows users to get the full flexibility of LaTeX, while having
4521 all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4522 LyX could never support every LaTeX package.
4529 in the preamble (see section
4530 \begin_inset space ~
4534 \begin_inset CommandInset ref
4536 reference "sec:preamble"
4540 ), you can use any package you want --- although you won't have WYSIWYM
4541 support for that package's features.
4544 \begin_layout Subsection
4545 Importing LaTeX Documents ---
4550 \begin_inset CommandInset label
4559 \begin_layout Standard
4560 You can import a LaTeX file into LyX by using the
4562 File\SpecialChar \menuseparator
4563 Import\SpecialChar \menuseparator
4565 \begin_inset space ~
4571 This will call the program
4575 which will create a file
4583 and then open that file.
4584 If the translation doesn't work, you can try calling
4588 from the command line, possibly using fancier options.
4591 \begin_layout Standard
4596 will translate most legal LaTeX, but not everything.
4597 It will leave things it doesn't understand in TeX mode, so after translating
4602 , you can look for red text and hand-edit it to look right.
4605 \begin_layout Standard
4610 has its own manpage.
4611 Read it to find out about which LaTeX commands and environments aren't
4612 supported, bugs (and how to get around them), and how to use the various
4616 \begin_layout Subsection
4617 Converting LyX Documents to LaTeX
4620 \begin_layout Standard
4621 You might wish to convert a LyX Document to a LaTeX file.
4622 For example, a co-worker or co-author who doesn't have LyX might want to
4626 File\SpecialChar \menuseparator
4627 Export\SpecialChar \menuseparator
4631 This will create a file
4639 file you are editing.
4640 LyX always creates temporary LaTeX files when viewing or printing files.
4643 \begin_layout Subsection
4647 \begin_layout Subsubsection
4651 \begin_layout Standard
4654 Document\SpecialChar \menuseparator
4657 dialog takes care of many of the options that you would input in a
4664 Change the class, default font size and paper size here.
4665 Put any extra options to the
4678 \begin_inset space ~
4686 \begin_layout Subsubsection
4687 Other Preamble Matter
4688 \begin_inset CommandInset label
4697 \begin_layout Standard
4698 If you have special commands to put in the preamble of a LaTeX file, you
4699 can use them in a LyX document as well.
4702 Document\SpecialChar \menuseparator
4703 Settings\SpecialChar \menuseparator
4705 \begin_inset space ~
4710 and type in the dialog window (or from the document settings dialog, depending
4712 Anything you type will (like with TeX mode) be sent directly to LaTeX.
4715 \begin_layout Subsection
4719 \begin_layout Standard
4720 LyX has support for BibTeX, which allows you to build databases of bibliographic
4721 al references to be used in multiple documents.
4727 nsert\SpecialChar \menuseparator
4729 \begin_inset space ~
4733 \begin_inset space ~
4740 C\SpecialChar \menuseparator
4746 \begin_inset space ~
4760 field you load BibTeX files, in the
4764 field you can load BibTeX style files.
4767 \begin_layout Standard
4768 After you've done this, you can use citations from any bibliographies you're
4771 Insert\SpecialChar \menuseparator
4775 \begin_inset space ~
4779 \begin_inset CommandInset ref
4781 reference "sec:bibliographies"
4786 LyX will take care of running BibTeX.
4791 dialog will show a list of all the references in your
4798 \begin_layout Section
4802 \begin_layout Standard
4803 Sometimes when you LaTeX a document, there will be errors, things that LyX
4804 or LaTeX can't understand.
4805 When this happens, LyX will open a
4808 \begin_inset space ~
4814 Clicking on individual errors in this dialog will take you to the place
4815 in the LyX document where the error occurs and also display the detailed
4816 LaTeX error message.