1 #LyX 2.0.0svn 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
42 \maintain_unincluded_children false
48 \font_typewriter default
49 \font_default_family default
57 \default_output_format default
59 \bibtex_command default
60 \index_command default
64 \pdf_title "The LyX Tutorial"
65 \pdf_author "LyX Team"
66 \pdf_subject "LyX-documentation Tutorial"
67 \pdf_keywords "LyX, documentation"
69 \pdf_bookmarksnumbered true
70 \pdf_bookmarksopen true
71 \pdf_bookmarksopenlevel 1
76 \pdf_pdfusetitle false
77 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
87 \paperorientation portrait
96 \paragraph_separation indent
97 \paragraph_indentation default
98 \quotes_language english
101 \paperpagestyle headings
102 \tracking_changes false
103 \output_changes false
105 \html_be_strict false
119 \begin_layout Plain Layout
120 If you have comments or error corrections, please send them to the LyX Documenta
124 \begin_inset CommandInset href
126 target "lyx-docs@lists.lyx.org"
141 \begin_layout Standard
142 \begin_inset CommandInset toc
143 LatexCommand tableofcontents
150 \begin_layout Chapter
154 \begin_layout Section
158 \begin_layout Standard
159 This file is designed for all of you who have never heard of LaTeX, or do
160 not know it very well.
161 Now, do not panic - you will not need to learn LaTeX to use LyX.
162 That is, after all, the whole point of LyX: to provide an almost-WYSIWYG
164 There are some things you will need to learn, however, in order to use
168 \begin_layout Standard
169 Some of you probably found your way to this document because you tried to
170 put two spaces after a
171 \begin_inset Quotes eld
175 \begin_inset Quotes erd
178 or tried to put three blank lines between paragraphs.
179 You found out you could not and in fact, you will find out that most of
180 the little tricks you are accustomed to use in other word processors will
182 That is because most word processors you have used before allow you to
183 manually enter all spacings, font changes, and so on.
184 So you end up not only writing a document but typesetting it, too.
185 LyX does the typesetting for you, in a consistent fashion, letting you
186 focus on the important things, like the content of your writing.
189 \begin_layout Standard
190 So read on to learn more about LyX.
191 Reading this tutorial is definitely worth the time.
194 \begin_layout Section
204 \begin_layout Standard
205 Before we get started with this section, we want to make a quick note of
211 uses the notation outlined in the
216 If you came to this manual first, please read the
220 before you continue with the
227 \begin_layout Standard
228 Now that you know which fonts mean what, we want to talk a bit about what
236 \begin_layout Subsection
237 Getting the most out of the Tutorial
240 \begin_layout Standard
241 This tutorial consists of examples and exercises.
242 To get the most out of this document, you should read through the document,
243 typing all the little things we are telling you to type and trying out
244 all of the exercises to see if you get them right.
245 For convenience, you might want to print out the PDF version of this document.
248 \begin_layout Standard
249 If you are familiar with LaTeX, you will probably be able to read the
253 somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
254 However, LyX has features you will want to learn about.
255 Even if you do not feel like reading the rest of the
259 , you should definitely check out Section
264 \begin_inset CommandInset ref
266 reference "sec:latexusers"
270 , which is specifically written for experienced LaTeX users.
273 \begin_layout Subsection
281 \begin_layout Itemize
282 Detailed explanations of all of LyX's features.
286 \begin_layout Standard
295 \begin_layout Itemize
296 Detailed explanations of LaTeX.
300 \begin_layout Standard
302 If you want to learn some of the neat tricks you can do with LaTeX in LyX,
303 you can have a look at the
315 \begin_layout Standard
316 It is time to move onwards, time for your first document \SpecialChar \ldots{}
320 \begin_layout Chapter
321 Getting started with LyX
324 \begin_layout Section
325 Your first LyX document
328 \begin_layout Standard
330 You are ready to start writing.
331 Before you do, there are a few things we need to mention, which will hopefully
332 make the Tutorial more instructive and useful.
336 \begin_layout Standard
337 Because there is information we cannot give you in the Tutorial, the
343 thing that you need to do is find the
350 Start up LyX, Choose the
359 You may want to load the
363 as well (if you are not reading it within LyX already).
364 This way, you can read them while you are writing your own file.
368 \begin_layout Plain Layout
369 They can also serve as good examples of how to use the many features of
375 Note that once you have got more than one document open, you can use the
380 menu or the document tabs to switch between them.
383 \begin_layout Standard
384 In this Tutorial, we are going to assume that you have a fully working version
385 of LyX, as well as a LaTeX-distribution, a DVI-, and a PDF-viewer.
386 This should be the case on all major Linux- and BSD-distributions, as well
387 as on Windows, where this is setup by the LyX installers.
390 \begin_layout Standard
391 Finally, we have written a file called
395 to let you practice your LyX skills.
396 Imagine that it was typed by someone who did not know about any of LyX's
398 As you learn new LyX functions, we will suggest that you fix those parts
404 It also contains `subtle' hints about how to fix things.
408 \begin_layout Plain Layout
409 The hints are located in yellow
410 \begin_inset Quotes eld
414 \begin_inset Quotes erd
418 Access the text in a note by clicking on it.
423 If you want to cheat, or check what you have done, there is also a file
428 which contains the same text written and typeset by a LyX master.
431 \begin_layout Standard
432 The example files can be found in the
436 directory of LyX's installation folder.
437 Open the raw document, and use
439 File\SpecialChar \menuseparator
446 to save a copy in your own directory for you to work on.
447 As you fix parts of the raw document, check to see how those changes affect
451 \begin_layout Standard
456 directory contains lots of other examples files.
457 They will show you how to do various fancy things with LyX.
458 After you have read the Tutorial, or when you are confused about how to
459 do something fancy in LyX, take a look at these files.
462 \begin_layout Subsection
463 Typing, Viewing, and Exporting
466 \begin_layout Itemize
469 File\SpecialChar \menuseparator
473 \begin_layout Itemize
474 Type a sentence like:
476 This is my first LyX document!
479 \begin_layout Itemize
480 Save your document with
482 File\SpecialChar \menuseparator
491 \begin_layout Itemize
492 Run LaTeX to create a DVI file, with
494 View\SpecialChar \menuseparator
497 or the toolbar button
498 \begin_inset Graphics
499 filename ../images/buffer-view_dvi.png
505 LyX will open a DVI-viewer program displaying your document as it will
510 \begin_layout Plain Layout
511 You can save time by leaving the DVI-viewer running in the background.
514 View\SpecialChar \menuseparator
515 Update\SpecialChar \menuseparator
518 or the toolbar button
519 \begin_inset Graphics
520 filename ../images/buffer-update_dvi.png
525 and just click on the DVI-viewer window (or unminimize it) after LaTeX
534 \begin_layout Itemize
535 Export the ready to print document with
537 File\SpecialChar \menuseparator
545 \begin_layout Standard
546 Congratulations! You have written your first LyX document.
547 All of the rest is just details, which are covered in the other manuals.
550 \begin_layout Subsection
554 \begin_layout Standard
555 LyX can of course do most of the things you are used to do with a word processor.
556 It will word-wrap and indent paragraphs automatically.
557 Here is a quick description of how to do some simple actions.
560 \begin_layout Description
561 Undo LyX has multiple levels of undo, which means you can undo everything
562 you have done since your current editing session started, by selecting
565 Edit\SpecialChar \menuseparator
569 \begin_inset Graphics
570 filename ../images/undo.png
575 ) over and over again.
576 If you undo too much, just select
578 Edit\SpecialChar \menuseparator
582 \begin_inset Graphics
583 filename ../images/redo.png
593 \begin_layout Standard
594 Currently, undo is limited to 100 steps.
598 \begin_layout Description
601 Edit\SpecialChar \menuseparator
605 \begin_inset Graphics
606 filename ../images/cut.png
613 Edit\SpecialChar \menuseparator
617 \begin_inset Graphics
618 filename ../images/copy.png
625 Edit\SpecialChar \menuseparator
629 \begin_inset Graphics
630 filename ../images/paste.png
635 ) to cut, copy, and paste.
636 Or automatically paste selected text (including selections from other programs)
644 \begin_layout Description
647 Edit\SpecialChar \menuseparator
659 \begin_inset Graphics
660 filename ../images/dialog-show_findreplace.png
666 In the dialog, search with the
678 button to replace a word you have found.
682 \begin_layout Plain Layout
683 Close the window when you are done or leave it open if you find it more
685 Most dialog boxes in LyX can operate like this.
686 Just be sure you have the right window focus when you are trying to type
687 in the main LyX window or a LyX dialog.
692 If you like, you can specify whether to make the search case-sensitive,
693 or to search for only complete words; you can also search backwards through
697 \begin_layout Description
706 text (which will by default print characters in italics), set it in
714 (usually small caps, used for people's names), or use your own formatting
717 Edit\SpecialChar \menuseparator
724 dialog (toolbar button
725 \begin_inset Graphics
726 filename ../images/dialog-show_character.png
734 \begin_layout Description
735 Toolbar There are buttons on the toolbar (just below the menus) which allow
736 you to do some of the more popular functions, such as
747 \begin_layout Standard
748 Of course, you have not yet written enough to make most of these functions
750 As you write more, though, try undoing, pasting, etc.
753 \begin_layout Subsection
754 WYSIWYM: Whitespace in LyX
757 \begin_layout Standard
758 One of the hardest things for new users to get used to is the way that LyX
760 As many times as you hit
764 , you will only get one blank line.
765 As many times as you hit
769 , you will only get one space.
770 On a blank line, LyX will not let you type even one space.
775 key will not move you forward one tab stop; in fact there
779 no tab stops! There is no ruler at the top of the page to let you set tabs
783 \begin_layout Standard
784 Many word processors are based on the WYSIWYG principle:
785 \begin_inset Quotes eld
788 What You See Is What You Get.
789 \begin_inset Quotes erd
792 LyX, on the other hand, is based on the principle that
793 \begin_inset Quotes eld
796 What You See Is What You
801 \begin_inset Quotes erd
804 You type what you mean, and LyX will take care of typesetting it for you,
805 so that the output looks nice.
810 grammatically separates paragraphs, and a
814 grammatically separates words, so there is no reason to have several of
819 has no grammatical function at all, so LyX does not support it.
820 Using LyX, you will spend more of your time worrying about the
824 of your document, and less time worrying about the
833 for more information on the WYSIWYM concept.
836 \begin_layout Standard
837 LyX does have (many) ways to fine-tune the formatting of your document.
838 After all, LyX might not typeset
847 has information about all that.
848 It includes horizontal fills and vertical space — which are more powerful
849 and versatile than multiple spaces or blank lines — and ways to change
850 font sizes, character styles, 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 will 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 in which environment you are currently writing.
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 will 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
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 to the
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 will 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 are only allowed to use them in certain types (text classes)
1255 of 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 will not 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 section 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 is a variation on the
1371 \begin_layout Standard
1372 Let us write a list of reasons why LyX is better than other word processors.
1373 Somewhere in your document, type:
1376 \begin_layout Standard
1379 LyX is better than other word processors because:
1382 \begin_layout Standard
1398 \begin_inset Quotes eld
1402 \begin_inset Quotes erd
1406 Type in your reasons:
1409 \begin_layout LyX-Code
1410 Typesetting is done for you.
1413 \begin_layout LyX-Code
1417 \begin_layout LyX-Code
1418 Lists are very easy to create!
1421 \begin_layout Standard
1422 List environments, unlike headings, do not end when you type
1427 Instead, LyX assumes you are going on to the next item in the list.
1428 The above will therefore result in a three-item list.
1429 If you want more than one paragraph within one list
1433 , one way is to use the
1436 \begin_inset space ~
1441 , which you get by typing
1446 In order to get out of the list, you need to reselect the
1450 environment (or just use the key binding,
1453 \begin_inset space ~
1461 \begin_layout Standard
1462 You have got a beautiful itemized list.
1463 You might want to run LaTeX to see how the list looks when printed out.
1464 But what if you wanted to number the reasons? Well, just select the whole
1469 \begin_layout Plain Layout
1470 LyX will not let you select the first bullet unless you also select the
1475 the list, which you probably do not want to do.
1476 Similarly, you cannot select the actual number in a numbered section title.
1477 This is on purpose because the bullet or number depends on the document
1478 settings or text position, respectively.
1492 Pow! As we mentioned, if you add or delete a list item, LyX will fix the
1496 \begin_layout Standard
1497 While the list is still selected, you can change to the other two list environme
1506 , in order to see what they look like.
1507 For those two environments, each list item is made up of a term, which
1508 is the item's first word, followed by a definition, which is the rest of
1509 the paragraph (until you hit
1513 .) The term is either typeset in boldface (
1518 \begin_inset Quotes eld
1522 \begin_inset Quotes erd
1529 \begin_layout Plain Layout
1530 But a typesetter's tab, which will change to fit the size of the largest
1531 term, not a pathetic, rigid, unchangeable typewriter
1544 ) from the rest of the paragraph.
1545 If you want to have more than one word in the definition, then separate
1549 \begin_inset space ~
1557 \begin_layout Standard
1562 : Typeset the list in
1567 \begin_layout Standard
1568 You can nest lists within each other in all sorts of interesting ways.
1569 An obvious example would be writing outlines.
1570 Numbered and bulleted lists will have different numbering and bulleting
1571 schemes for sublists.
1576 for details on the different sorts of lists and for examples of nestings.
1579 \begin_layout Subsection
1580 Other environments: Verses, Quotations, and more
1583 \begin_layout Standard
1584 There are two environments for setting quotations apart from surrounding
1589 for short quotes and
1602 \begin_layout Plain Layout
1603 used in this Tutorial for the long typing examples
1612 font; this environment is the only place in LyX where you are allowed to
1613 use multiple spaces to allow code indenting.
1614 You can even write poetry using the
1622 to separate stanzas, and
1626 to separate lines within a stanza.
1631 for more complete descriptions of all of the available LyX environments.
1634 \begin_layout Standard
1639 : Correctly typeset the
1648 \begin_inset Newline newline
1656 \begin_layout Chapter
1660 \begin_layout Standard
1661 The previous chapter hopefully allowed you to get used to writing in LyX.
1662 It introduced you to the basic editing operations in LyX, as well as the
1663 powerful method of writing with environments.
1664 Most people who use LyX, though, will want to write documents: papers,
1665 articles, books, manuals, or letters.
1666 This chapter is meant to take you from simply writing text with LyX to
1667 writing a complete document.
1668 It will introduce you to text classes, which allow you to write different
1670 It will then describe many of the additions that turn text into a document,
1671 such as titles, footnotes, cross references, bibliographies, and tables
1675 \begin_layout Section
1677 \begin_inset CommandInset label
1679 name "sec:Document-Classes"
1686 \begin_layout Standard
1687 Different sorts of documents should be typeset differently.
1688 For example, books are generally printed double-sided, while articles are
1690 In addition, many documents contain special environments: letters contain
1691 some environments — such as the sender's address and the signature — which
1692 do not make sense in a book or article.
1701 \begin_layout Plain Layout
1702 for LaTeX users: this is equivalent to the LaTeX document class
1707 takes care of these large scale differences between different sorts of
1709 This Tutorial, for example, was written in the
1714 Document classes are another major part of the WYSIWYM philosophy; they
1715 tell LyX how to typeset the document, so you do not need to know how.
1718 \begin_layout Standard
1719 Your document is probably being written in the
1727 \begin_layout Plain Layout
1728 That is usually the default document class
1733 Try changing to other document classes (using the
1735 Document\SpecialChar \menuseparator
1738 dialog) to see how they are typeset differently.
1739 If you change your document to the
1743 document class and look at the
1747 box, you will see that most of the allowed environments are the same.
1748 However, you can now use the
1753 If you are ever unsure about which environments you can use in a given
1754 document class, just consult the
1761 \begin_layout Standard
1762 Font sizes, one- or two-column printing, and page headings are just some
1763 of the ways journals' typesettings differ from one another.
1764 As the Computer Age continues to mature, journals have begun accepting
1765 electronic submissions, creating LaTeX
1766 \begin_inset Quotes eld
1770 \begin_inset Quotes erd
1773 so that authors can submit correctly typeset articles.
1774 LyX is set up to support this as well.
1775 For example, LyX supports typesetting (and extra environments) for the
1776 American Mathematics Society journals using the
1779 \begin_inset space ~
1787 \begin_layout Standard
1788 Here is a very quick reference to some of the document classes.
1791 Special Document Classes
1797 manual for many more details.
1800 \begin_layout Standard
1802 \begin_inset Tabular
1803 <lyxtabular version="3" rows="7" columns="2">
1804 <features tabularvalignment="middle">
1805 <column alignment="center" valignment="top" width="0pt">
1806 <column alignment="center" valignment="top" width="0pt">
1808 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1811 \begin_layout Plain Layout
1817 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1820 \begin_layout Plain Layout
1828 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1831 \begin_layout Plain Layout
1837 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1840 \begin_layout Plain Layout
1841 one-sided, no chapters
1848 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1851 \begin_layout Plain Layout
1857 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1860 \begin_layout Plain Layout
1861 layout & environments for American Math Society
1868 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1871 \begin_layout Plain Layout
1877 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1880 \begin_layout Plain Layout
1881 longer than article, two-sided
1888 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1891 \begin_layout Plain Layout
1897 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1900 \begin_layout Plain Layout
1901 report + front and back matter
1908 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1911 \begin_layout Plain Layout
1917 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1920 \begin_layout Plain Layout
1928 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1931 \begin_layout Plain Layout
1937 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1940 \begin_layout Plain Layout
1941 lots of extra environments for address, signature\SpecialChar \ldots{}
1955 \begin_layout Section
1956 Templates: Writing a Letter
1959 \begin_layout Standard
1960 One way to write a letter would be to open a new file, and choose a
1966 Document\SpecialChar \menuseparator
1970 While this is the most obvious way to write a letter, it seems like extra
1972 Every time you write a business letter, you want to have your address,
1973 the address to which you are sending it, a body, a signature, etc.
1978 for letters, which contains a sample letter; once you have a template,
1979 you can just replace a couple of parts of the letter with your text each
1980 time you write a letter.
1983 \begin_layout Standard
1984 Open a new file with
1986 File\SpecialChar \menuseparator
1988 \begin_inset space ~
1992 \begin_inset space ~
2003 Save and print the file to see how the various environments are typeset.
2006 \begin_layout Standard
2007 When you look at the
2011 box, you will see several environments, like the
2014 \begin_inset space ~
2019 environment, which do not even exist in most other document classes.
2025 You can play around for a while to figure out how the various environments
2027 You will notice for example that the
2031 environment has the word
2032 \begin_inset Quotes eld
2036 \begin_inset Quotes eld
2039 in red before the actual text of the signature.
2040 This word does not show up in the actual letter, as you will see if you
2041 view/export the file.
2042 It is just there to let you know where the signature goes.
2043 Also, note that it does not matter where in the file the
2048 Remember, LyX is WYSIWYM; you can put the
2052 environment anywhere you want, but LyX knows that in the printout, the
2053 signature should be at the end.
2056 \begin_layout Standard
2057 A template is just a regular LyX file.
2058 This means you can fill in your address and signature and save the file
2060 From now on, any time you want to write a letter, you can use the new template
2062 We do not have to suggest an actual
2063 \begin_inset Quotes eld
2067 \begin_inset Quotes erd
2070 here; just write a letter to someone!
2074 \begin_layout Plain Layout
2075 One warning, if you are writing from a template.
2076 If you erase all of the text in an environment — for example, if you erase
2080 \begin_inset space ~
2085 field so that you can replace it with your own — and then you move the
2086 cursor without writing any text, the environment may disappear.
2087 This is because most environments cannot exist without any text in them.
2088 Just reselect the environment from the
2100 \begin_layout Standard
2101 Templates can be a huge time-saver, and we urge you to use them whenever
2103 In addition, they can help a person learn how to use some of the fancier
2105 Finally, they may be useful for a person who is configuring LyX for a bunch
2106 of less computer-aware users.
2107 When they are first learning LyX, it will be much less intimidating if
2108 they have a letter template customized for their company, for example.
2111 \begin_layout Section
2115 \begin_layout Standard
2116 LyX (like LaTeX) considers the title — which may contain the actual title,
2117 the author, the date, and even an abstract of a paper — to be a separate
2118 part of the document.
2121 \begin_layout Standard
2122 Go back to your LyX document and make sure it is using the
2130 \begin_layout Plain Layout
2131 You should not be using the letter any more, since the
2135 document class does not allow titles.
2140 Type a title on the first line, and change the line to the
2145 On the next line, type your name and change it to the
2150 On the next line, write the date in the
2155 Type a paragraph or two summarizing your document using the
2160 Notice how the title is presented when it is printed out.
2161 If you change the document format to Book, you will get a separate title
2162 page, like the first page of this tutorial.
2165 \begin_layout Standard
2170 : Fix the title, date, and author in
2175 \begin_layout Section
2176 Labels and Cross-References
2179 \begin_layout Standard
2180 You can label section headings, list items, formulas, footnotes, and floats
2184 \begin_layout Plain Layout
2185 Floats are explained in the
2199 Once you do so, you can refer to this section in other parts of the document,
2200 using cross-references.
2201 You can refer either to the section's number, or to the page that the section
2203 As with section numbering, LyX also takes care about cross-reference numbering
2205 Automatic labels and cross-references are among the most significant advantages
2206 of LyX (and LaTeX) over conventional word processors.
2210 \begin_layout Subsection
2214 \begin_layout Standard
2215 Go to our second section, whose title is
2216 \begin_inset Quotes eld
2220 \begin_inset Quotes erd
2224 Click at the end of the section title line, and select
2226 Insert\SpecialChar \menuseparator
2229 or the toolbar button
2230 \begin_inset Graphics
2231 filename ../images/label-insert.png
2238 A dialog asks you for a label name, and gives you a suggestion.
2243 , the label name will be placed in a box next to the section title.
2246 \begin_layout Standard
2247 So far you have not done anything — the DVI output will look exactly the
2248 same, since labels do not show up in the printed document.
2249 However, now that you have added a label, you can refer to that label with
2251 We will do that next.
2254 \begin_layout Subsection
2255 Your first cross-reference
2258 \begin_layout Standard
2259 Place the cursor somewhere in section
2260 \begin_inset space ~
2267 \begin_layout LyX-Code
2268 If you want to know more about this document, then see
2269 \begin_inset Newline newline
2272 section, which can be found on page.
2275 \begin_layout Standard
2276 Now — with the cursor after the word `Section' — choose
2278 Insert\SpecialChar \menuseparator
2280 \begin_inset space ~
2285 or the toolbar button
2286 \begin_inset Graphics
2287 filename ../images/dialog-show-new-inset_ref.png
2294 The Cross-reference dialog pops up.
2295 It shows a list of the possible labels you can reference.
2296 At the moment, there should be only one, `sec:About-This-Document'.
2297 First, select the drop-down menu labeled Format and select '<reference>
2298 on page <page>.' Then select `sec:About-This-Document' (it may be selected
2299 by default), and a reference marker will appear containing `Ref+Text: sec:About
2300 -This-Document' (To be really correct, you should put a
2303 \begin_inset space ~
2308 in between the word `Section' and the reference).
2309 Alternatively to that method, you can right-click on a label and use in
2310 the appearing context menu
2315 The cross-reference to this label is now in the clipboard and can be copied
2316 to the actual cursor position via the menu
2318 Edit\SpecialChar \menuseparator
2326 In the printed document, this reference marker will be replaced with the
2327 section number and then the page number.
2328 View your document as DVI, and you will see that LaTeX has been even cleverer
2330 It refers to `Section 2' and depending how much text you have between the
2331 start of Section 2 and this cross-reference you may see `on this page,'
2332 'on the previous page' or `on page n' (whereas
2336 is the page number).
2339 \begin_layout Standard
2340 Conveniently, a cross-reference acts as a hyperlink when you are editing
2341 a document in LyX; clicking on it will pop up the
2348 \begin_inset space ~
2352 \begin_inset space ~
2357 will move the cursor to the referenced label.
2360 \begin_layout Subsection
2361 More fun with labels
2364 \begin_layout Standard
2365 We told you that LyX takes care about numbering cross-references; now you
2367 Add a new section before Section
2368 \begin_inset space ~
2372 Update the DVI view, and — voilà ! — the section cross reference changed
2374 \begin_inset Quotes eld
2378 \begin_inset Quotes erd
2381 ! Change the section
2382 \begin_inset Quotes eld
2386 \begin_inset Quotes erd
2389 to a subsection, and the cross-reference will reference Subsection
2390 \begin_inset space ~
2393 2.1 instead of Section
2394 \begin_inset space ~
2398 The page reference will not change unless you add a whole page of text
2399 before the label, of course.
2403 \begin_layout Standard
2404 If you want some more practice with labels, then try putting a new label
2405 where your first cross-reference was, and refer to that label from elsewhere
2407 If you will be inserting cross-references often, it may be convenient to
2415 \begin_layout Standard
2416 If you want to make sure that the cross-referencing gets the pages right
2417 even for larger documents,
2421 a couple pages of text from the
2425 to the clipboard, and
2429 the stolen text into your document.
2433 \begin_layout Plain Layout
2434 By the way, copying a chapter title may cause an error, because chapters
2435 are not allowed in the article class, see section
2436 \begin_inset space ~
2440 \begin_inset CommandInset ref
2442 reference "sec:Document-Classes"
2447 If this happens, just delete the chapter title.
2455 \begin_layout Standard
2460 : Fix the references in
2465 \begin_layout Section
2466 Footnotes and Margin Notes
2469 \begin_layout Standard
2470 Footnotes can be added using the toolbar button
2471 \begin_inset Graphics
2472 filename ../images/footnote-insert.png
2480 Insert\SpecialChar \menuseparator
2484 Click at the end of the word
2485 \begin_inset Quotes eld
2489 \begin_inset Quotes erd
2492 somewhere in your document and click the
2493 \begin_inset Graphics
2494 filename ../images/footnote-insert.png
2501 A footnote box appears where you can enter the text of the footnote.
2502 LyX should place the cursor at the beginning of the footnote box.
2506 \begin_layout LyX-Code
2507 LyX is a typesetting word processor.
2510 \begin_layout Standard
2511 Now click on the button labeled
2512 \begin_inset Quotes eld
2516 \begin_inset Quotes erd
2520 The footnote box is closed, leaving the button showing where the footnote
2521 marker will be in the printed text; this is called
2522 \begin_inset Quotes eld
2526 \begin_inset Quotes erd
2530 You can unfold the footnote at any time and re-edit its text by clicking
2532 \begin_inset Quotes eld
2536 \begin_inset Quotes erd
2542 \begin_layout Standard
2543 A footnote can be cut and pasted like normal text.
2544 Go ahead; try it! All you need to do is select the footnote button
2548 \begin_layout Plain Layout
2549 It may be easier to select it using the keyboard.
2550 You might accidentally open the footnote if you are trying to select the
2551 marker itself with the mouse.
2565 In addition, you can change regular text to a footnote, by selecting it
2567 \begin_inset Graphics
2568 filename ../images/footnote-insert.png
2574 button; change a footnote to regular text by hitting the
2578 key when the cursor is in the first position of a footnote, or by hitting
2583 key when the cursor is in the very last position of the footnote, respectively.
2586 \begin_layout Standard
2587 Margin notes can be added using the menu
2589 Insert\SpecialChar \menuseparator
2591 \begin_inset space ~
2596 or the toolbar button
2597 \begin_inset Graphics
2598 filename ../images/marginalnote-insert.png
2605 Margin notes are like footnotes, except that:
2608 \begin_layout Itemize
2609 the on-screen boxes say
2610 \begin_inset Quotes eld
2614 \begin_inset Quotes erd
2618 \begin_inset Quotes eld
2622 \begin_inset Quotes erd
2628 \begin_layout Itemize
2629 the notes will be placed in the margin, instead of below the text
2632 \begin_layout Itemize
2633 margin notes are not numbered
2636 \begin_layout Standard
2637 Change your LyX footnote back to text, then select and change it to a margin
2639 Run LaTeX again to see what the margin note looks like.
2642 \begin_layout Standard
2647 : Fix the footnote in
2652 \begin_layout Section
2654 \begin_inset CommandInset label
2656 name "sec:bibliographies"
2663 \begin_layout Standard
2664 Bibliographies (at least in the exact sciences) are similar to cross references.
2665 The bibliography contains a list of references at the end of the document,
2666 and they can be referenced from within the document.
2667 Like section titles, LyX and LaTeX make your job easier by automatically
2668 numbering the bibliography items and changing citations when the item numbers
2672 \begin_layout Standard
2673 Go to the end of the document and switch to the
2678 Now, each paragraph you type will be a reference.
2680 \begin_inset Quotes eld
2685 The Lyx Tutorial, by the LyX Documentation Team
2688 \begin_inset Quotes erd
2691 as your first reference.
2692 Note that LyX automatically puts a number in a box before each reference.
2693 Click on the boxed reference number, and the
2696 \begin_inset space ~
2706 is to refer to this reference within the LyX document, the
2715 is set (default), you will see the number of the bibliography in the output.
2721 \begin_inset Quotes eld
2725 \begin_inset Quotes erd
2728 to make it easy to remember.
2731 \begin_layout Standard
2732 Now pick somewhere in your document that you would like to insert a reference.
2735 Insert\SpecialChar \menuseparator
2738 or the toolbar button
2739 \begin_inset Graphics
2740 filename ../images/dialog-show-new-inset_citation.png
2752 The right panel in this dialog lists all the bibliography entries, and
2753 this field allows you to choose which bibliography item you want to cite.
2755 \begin_inset Quotes eld
2759 \begin_inset Quotes erd
2762 (right now, that is the only item in the bibliography), then use the
2766 button in the center to insert it.
2767 (You can have multiple citations in the same place by transferring a number
2768 of keys this way.) Now view your file as DVI, and you will see that the
2769 citation appears in brackets in the text, referring to the bibliography
2770 at the end of the document.
2773 \begin_layout Standard
2777 \begin_inset space ~
2786 dialog will put a remark (such as a reference to a page or chapter within
2787 the referenced book or article) in the brackets after the reference.
2788 If you want the references to have labels instead of numbers in the printed
2789 output (for example, some journals would use
2790 \begin_inset Quotes eld
2794 \begin_inset Quotes erd
2797 to refer to a paper written by Smith in 1995), use the
2804 \begin_inset space ~
2817 \begin_layout Standard
2822 Fix the bibliography and citation in
2827 \begin_layout Section
2831 \begin_layout Standard
2832 You may want to put a table of contents at the beginning of your document.
2833 LyX makes this very easy to do.
2838 after your document title and before your first section title and choose
2841 Insert\SpecialChar \menuseparator
2843 \begin_inset space ~
2847 \begin_inset space ~
2850 TOC\SpecialChar \menuseparator
2852 \begin_inset space ~
2856 \begin_inset space ~
2863 \begin_inset Quotes eld
2867 \begin_inset Quotes erd
2870 will appear in a button on the first line of the document.
2874 \begin_layout Standard
2875 This may not appear to be very useful.
2876 However, if you look at your DVI file, you will see that a table of contents
2877 has been generated, listing the various sections and subsections in your
2879 As usual, if you reorder sections or create new ones, you will see those
2880 changes in the DVI file when you update it.
2884 \begin_layout Standard
2885 The table of contents is not printed in the on-screen version of the document.
2886 But you can display the table of contents in a separate window by clicking
2887 on the table of contents button, or by using
2889 Document\SpecialChar \menuseparator
2892 or the toolbar button
2893 \begin_inset Graphics
2894 filename ../images/dialog-toggle_toc.png
2901 This menu will work even if you do not have a table of contents inset in
2903 This is a very useful tool for moving around your document parts.
2904 Clicking on a (sub)section title in the
2908 window will highlight that line and move the display (in the LyX editing
2909 window) to that place in the document.
2910 You can also use the arrow keys to move up and down in the table of contents.
2911 You may therefore find it convenient to leave this window open throughout
2913 You can get similar functionality from the
2917 menu, though, where the table of contents appears automatically.
2920 \begin_layout Standard
2921 To get rid of the Table of Contents, you can delete the table of contents
2922 button just like any other text.
2925 \begin_layout Standard
2930 : Fix the table of contents in
2935 \begin_layout Chapter
2939 \begin_layout Standard
2940 LaTeX is used by many scientists because it outputs great looking equations,
2941 avoiding the control characters used by word processors and their equation
2943 Many of these scientists are frustrated, however, because writing equations
2944 in LaTeX is more like programming than writing.
2945 Happily, LyX has WYSIWYM support for equations.
2946 If you are used to LaTeX, you will find that all of the usual LaTeX math
2947 commands can be typed in normally, but they will show up in a WYSIWYM fashion.
2948 If, on the other hand, you have never written in LaTeX, then the
2951 \begin_inset space ~
2956 will allow you to write professional-looking math quickly and easily.
2959 \begin_layout Section
2963 \begin_layout Standard
2964 Somewhere in your LyX document, type:
2967 \begin_layout LyX-Code
2968 I like what Einstein said, E=mc^2, because it is so simple.
2972 \begin_layout Standard
2973 Now, that equation does not look very good in LyX and in the output; there
2974 is no space between the letters and the equals sign, and you would like
2975 to write an actual superscript for the
2976 \begin_inset Quotes eld
2980 \begin_inset Quotes erd
2984 That bad typesetting happened because we did not tell LyX that we were
2985 writing a mathematical expression, so it typeset the equation like regular
2989 \begin_layout Standard
2990 Instead, we create a formula that will get typeset properly.
2991 In order to create a formula, just click the toolbar button
2992 \begin_inset Graphics
2993 filename ../images/math-mode.png
3001 Insert\SpecialChar \menuseparator
3002 Math\SpecialChar \menuseparator
3004 \begin_inset space ~
3010 LyX will insert a little blue square, which is an empty math formula.
3016 The expression is typed in blue, and the blue square disappears as soon
3017 as the formula is not empty.
3022 to leave the equation The purple markers disappear, leaving the cursor
3023 to the right of the expression, and now if you type something, it will
3027 \begin_layout Standard
3028 Looking at the output you will notice that the expression was typeset nicely,
3029 with spaces between the letters and the equals sign, and a superscript
3031 \begin_inset Quotes eld
3035 \begin_inset Quotes erd
3039 Letters in math mode are assumed to be variables, and come out in italics.
3040 Numbers are just numbers.
3043 \begin_layout Standard
3044 This math editor is another example of the WYSIWYM philosophy.
3045 In LaTeX, you write a mathematical expression using text and commands like
3052 ; this can be frustrating, because you cannot see what an expression looks
3053 like until you run the file under LaTeX and you may have to spend time
3055 \begin_inset space \thinspace{}
3059 \begin_inset space \space{}
3063 LyX does not attempt to get the expression to look perfect (WYSIWYG), but
3064 it gives you an extremely good idea of what the expression will look like.
3065 LaTeX then takes care of the professional typesetting.
3068 \begin_layout Section
3069 Navigating an Equation
3072 \begin_layout Standard
3074 \begin_inset Formula $E=mc^{2}$
3078 \begin_inset Formula $E=1+mc^{2}$
3082 Use the arrow keys to move the cursor into the expression.
3083 Note that when you enter the expression, the purple markers appear to let
3084 you know you are editing math.
3093 to move the cursor past the equals sign, and just type
3094 \begin_inset Quotes eld
3098 \begin_inset Quotes erd
3102 Again, you can use the arrow keys or
3106 to leave the formula\SpecialChar \@.
3110 \begin_layout Standard
3111 Other than the special keys described below, typing in math mode is like
3112 editing regular text.
3122 Select text either with the arrow keys or with the mouse.
3125 Edit\SpecialChar \menuseparator
3128 works in math mode as well as cut and paste.
3129 One thing to be careful of: if you are left or right outside a formula
3138 respectively, you delete the whole formula.
3139 Luckily, you can just use
3146 \begin_layout Standard
3147 What if you want to change
3148 \begin_inset Formula $E=mc^{2}$
3152 \begin_inset Formula $E=mc^{2.5}+1$
3155 ? Again, you can use the mouse to click in the right place.
3156 However, you can also use the arrow keys.
3157 If the cursor is just after the
3158 \begin_inset Quotes eld
3162 \begin_inset Quotes erd
3166 \begin_inset Quotes eld
3170 \begin_inset Quotes erd
3177 and the cursor is moved to the level of the superscript, just before the
3179 \begin_inset Quotes eld
3183 \begin_inset Quotes erd
3188 \begin_inset Quotes eld
3192 \begin_inset Quotes erd
3200 will move the cursor back to the regular level.
3209 , the cursor will be placed
3213 the superscript (so that you can then type the
3214 \begin_inset Quotes eld
3218 \begin_inset Quotes erd
3224 \begin_layout Section
3225 Exponents and Indices
3228 \begin_layout Standard
3229 An exponent can be entered from the
3232 \begin_inset space ~
3237 (see below), but it is actually simpler just to type the caret key,
3238 \begin_inset Quotes eld
3242 \begin_inset Quotes erd
3246 LyX will place another blue rectangle in the superscript, so that whatever
3247 you write next will be superscripted, and in a smaller font size.
3248 Everything you type until you hit a
3256 to exit the formula entirely) will be in the superscript.
3259 \begin_layout Standard
3260 Writing a subscript (index) is just easy; start one by typing the underscore
3262 \begin_inset Quotes eld
3266 \begin_inset Quotes erd
3270 You can subscript and superscript both subscripts and superscripts like
3272 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3279 \begin_layout Standard
3291 \begin_layout Section
3295 \begin_layout Standard
3299 \begin_inset space ~
3304 is a convenient way to enter symbols or to perform complicated formula
3306 Many of these operations can be accomplished from the keyboard or the
3308 Edit\SpecialChar \menuseparator
3313 Insert\SpecialChar \menuseparator
3317 However, we are going to concentrate on using the
3320 \begin_inset space ~
3325 , just to let you know what is out there; you can learn keyboard shortcuts
3326 and commands later from the
3333 \begin_layout Standard
3337 \begin_inset space ~
3342 is shown when the cursor is in a formula and can also be turned on manually
3345 View\SpecialChar \menuseparator
3349 When you click there on
3350 \begin_inset Quotes eld
3354 \begin_inset Quotes erd
3357 the toolbar will be shown permanently at the bottom; this state is visualized
3362 menu with a checkmark.
3363 When you click in this state again on
3364 \begin_inset Quotes eld
3368 \begin_inset Quotes erd
3379 is only shown when the cursor is within a formula; this state is visualized
3380 by the renaming of the menu entry from
3381 \begin_inset Quotes eld
3385 \begin_inset Quotes erd
3389 \begin_inset Quotes eld
3393 \begin_inset space ~
3397 \begin_inset Quotes erd
3403 \begin_layout Subsection
3407 \begin_layout Standard
3411 \begin_inset space ~
3416 allows you to choose from a large array of symbols used in math: operators,
3417 arrows, relationships, delimiters, special characters, sums and integrals.
3418 Note that subscripting and superscripting allow you to put lower and upper
3419 limits on sums and integrals.
3423 \begin_layout Subsection
3424 Square roots, accents, and delimiters
3427 \begin_layout Standard
3428 To type a square root, just click on the button
3429 \begin_inset Graphics
3430 filename ../images/math/sqrt.png
3437 The square root appears, and the cursor is in a new insertion point inside
3439 You can type variables, numbers, other square roots, fractions, whatever
3441 LyX will automatically resize the square root to fit what is inside.
3444 \begin_layout Standard
3445 Accenting a character (
3446 \begin_inset Formula $\overrightarrow{v}$
3449 ) or group of characters (
3450 \begin_inset Formula $\overrightarrow{a+b}$
3453 ) is done the same way.
3454 Decorations are available from the toolbar via the button
3455 \begin_inset Graphics
3456 filename ../images/math/hat.png
3463 Click on a decoration, and LyX will insert that decoration with an insertion
3464 point under (or over) it.
3465 Just type what you want in the insertion point.
3466 There are two sets of decorations: those that resize with the text you
3467 type, and those that have a fixed size, and are most appropriate for a
3472 \begin_layout Standard
3473 Delimiters such as parentheses, brackets, and braces work similarly, but
3474 are a bit more complicated.
3475 Hit the delimiter button
3476 \begin_inset Graphics
3477 filename ../images/dialog-show_mathdelimiter.png
3488 Your current selection of delimiters is displayed in a box.
3489 It is a pair of parentheses by default, but you can choose a pair of braces,
3490 a brace and a parenthesis, or choose the empty square to have something
3492 \begin_inset Quotes eld
3496 \begin_inset Formula $a=\left\langle 7\right.$
3500 \begin_inset Quotes erd
3503 (the empty delimiter is displayed as a broken line in LyX, but will not
3504 show up in the output).
3507 \begin_layout Standard
3508 If you are lazy, you can type actual parentheses in math mode, rather than
3514 However, those parentheses will be the same size as regular text, which
3515 will look bad if you have a big fraction or matrix inside the parentheses.
3516 So it is better in this case to use one of the three delimiter buttons
3517 that insert directly e.
3518 \begin_inset space \thinspace{}
3522 \begin_inset space \space{}
3526 \begin_inset space \thinspace{}
3532 \begin_layout Standard
3533 You can also put delimiters or a square root sign or a decoration on already
3534 existing formula parts.
3535 Select the portion of the formula that you want to adjust, and then click
3536 on the button you want from the
3539 \begin_inset space ~
3545 Try using this to change Newton's second law from scalar to vector form
3547 \begin_inset Formula $f=ma$
3551 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3555 Once you have learned about matrices, this is how you will put parentheses
3556 or brackets around them.
3559 \begin_layout Subsection
3563 \begin_layout Standard
3564 To create a fraction, click on the fraction button
3565 \begin_inset Graphics
3566 filename ../images/math/frac.png
3576 \begin_inset space ~
3582 LyX writes two insertion points in a fraction.
3583 As you would expect, you can use arrow keys or the mouse to move around
3585 Click on the top square and type
3586 \begin_inset Quotes eld
3590 \begin_inset Quotes erd
3599 \begin_inset Quotes eld
3603 \begin_inset Quotes erd
3607 You have made a fraction! Of course you can type anything within each of
3608 the two boxes: variables with exponents, square roots, other fractions,
3613 \begin_layout Standard
3625 \begin_layout Subsection
3626 Functions: lim, log, sin and others
3629 \begin_layout Standard
3630 Because letters in math mode are considered to be variables, if you type
3632 \begin_inset Quotes eld
3636 \begin_inset Quotes erd
3639 in math mode, LyX thinks you are typing the product of the three variables
3641 \begin_inset Formula $s$
3645 \begin_inset Formula $i$
3649 \begin_inset Formula $n$
3653 The three letters will be typeset in italics, when what you really wanted
3655 \begin_inset Quotes eld
3659 \begin_inset Quotes erd
3663 In addition, LyX will not put a space between the word
3664 \begin_inset Quotes eld
3668 \begin_inset Quotes erd
3672 \begin_inset Quotes eld
3676 \begin_inset Quotes erd
3683 will exit the formula).
3685 \begin_inset Quotes eld
3689 \begin_inset Formula $\sin(x)$
3693 \begin_inset Quotes erd
3697 \begin_inset Quotes eld
3701 \begin_inset Formula $sin(x)$
3705 \begin_inset Quotes erd
3711 \begin_layout Standard
3715 \begin_inset space ~
3721 \begin_inset Graphics
3722 filename ../images/math/functions.png
3729 \begin_inset Quotes eld
3733 \begin_inset Quotes erd
3736 in the appearing function list.
3738 \begin_inset Quotes eld
3742 \begin_inset Quotes erd
3745 is displayed in LyX in black, and set in upright roman type.
3746 The whole word is treated as one symbol, so if you type
3750 , it will delete the whole word.
3752 \begin_inset Quotes eld
3756 \begin_inset Quotes erd
3759 , which will be written in blue italics, like you expect in a formula.
3760 In the output, the expression will be correctly typeset.
3764 \begin_layout Standard
3765 The function list includes other trigonometric functions and their inverses,
3766 hyperbolic functions, logarithms, limits, and quite a few others.
3767 These functions can take subscripts and superscripts, important for typing
3769 \begin_inset Quotes eld
3773 \begin_inset Formula $\cos^{2}\theta$
3777 \begin_inset Quotes erd
3781 \begin_inset Quotes eld
3785 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3789 \begin_inset Quotes erd
3795 \begin_layout Standard
3807 \begin_layout Subsection
3811 \begin_layout Standard
3812 Click on the matrix button
3813 \begin_inset Graphics
3814 filename ../images/dialog-show_mathmatrix.png
3823 \begin_inset space ~
3829 The appearing dialog allows you to choose how many rows and columns you
3830 want in your matrix.
3831 Choose 2 rows and 3 columns and hit
3836 LyX prints 6 insertion points in a
3837 \begin_inset Formula $2\times3$
3841 As usual, you can put any sort of formula expression (a square root, another
3842 matrix, etc.) in each insertion point.
3843 You can also leave some of the insertion points empty if you want.
3846 \begin_layout Standard
3851 can be used to move horizontally between the columns of a matrix.
3852 Alternatively, you can use the arrow keys to move around - hitting
3856 at the end of one box will move to the next box,
3860 will move to the next row, etc.
3863 \begin_layout Standard
3864 If you need to change the number of rows and columns, use the menu
3866 Edit\SpecialChar \menuseparator
3868 \begin_inset space \thinspace{}
3872 \begin_inset space \thinspace{}
3877 or the math toolbar buttons
3878 \begin_inset Graphics
3879 filename ../images/tabular-feature_append-row.png
3886 \begin_inset Graphics
3887 filename ../images/tabular-feature_delete-row.png
3894 \begin_inset Graphics
3895 filename ../images/tabular-feature_append-column.png
3902 \begin_inset Graphics
3903 filename ../images/tabular-feature_delete-column.png
3912 \begin_layout Standard
3917 for information on how to change the horizontal alignment of each column,
3918 and how to change the vertical position of the whole matrix.
3919 Note that if you want to write a table containing text, you should use
3920 LyX's wonderful table support, rather than trying to write text in a matrix.
3923 \begin_layout Subsection
3927 \begin_layout Standard
3928 All of the expressions we have written so far have been on the same line
3929 as the text that came before and after them, otherwise known as inline
3931 This is fine for short, simple expressions, but if you want to write larger
3932 ones, or if you want your expressions to stand out from the text, you need
3933 to write them in display mode.
3934 In addition, only displayed expressions can be labeled and numbered (see
3939 ), and multi-line equations must be in display mode.
3942 \begin_layout Standard
3943 While being in a formula, click on the display button
3944 \begin_inset Graphics
3945 filename ../images/math-display.png
3954 \begin_inset space ~
3960 This centers the formula and adds a blank line before and after it.
3961 Now type in an expression and compile your file to see how it looks.
3962 The display button is actually a toggle; use it now to change a couple
3963 of your expressions to display mode and back.
3967 \begin_layout Standard
3968 Display mode has a couple differences from inline mode:
3971 \begin_layout Itemize
3972 The default font is larger for a few symbols, like
3973 \begin_inset Formula $\sum$
3977 \begin_inset Formula $\int$
3983 \begin_layout Itemize
3984 Subscripts and superscripts for limits and sums (but not integrals) are
3985 written under and over rather than next to the symbols
3988 \begin_layout Itemize
3992 \begin_layout Standard
3993 Other than these differences, though, displayed expressions and inline expressio
3994 ns are very similar.
3997 \begin_layout Standard
3998 One final note about the way displayed formulas are typeset: Be careful
3999 about whether you are putting your equation into a new paragraph or not.
4000 If your formula is in the middle of a sentence or paragraph, then do not
4006 Doing so will cause the text
4010 the formula to start a new paragraph.
4011 That text will be indented or follow a blank line, depending on your document
4012 paragraph settings, which is probably not what you want.
4015 \begin_layout Standard
4020 : Put the various equations in
4024 into display mode, and see how they are typeset differently.
4027 \begin_layout Standard
4032 : Using various tools you have learned in this section, you should be able
4033 to write an equation like:
4037 \begin_layout Plain Layout
4038 After you have done it the hard way, give
4040 Insert\SpecialChar \menuseparator
4041 Math\SpecialChar \menuseparator
4043 \begin_inset space ~
4054 \begin_inset Formula \[
4055 f(x)=\left\{ \begin{array}{cc}
4058 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0
4059 \end{array}\right.\]
4066 \begin_layout Section
4070 \begin_layout Standard
4071 LyX's math editor can do a lot more.
4072 Now you are familiar with the basics, you can refer to the
4079 \begin_layout Itemize
4080 Label and number expressions
4083 \begin_layout Itemize
4084 Create multi-line equations
4087 \begin_layout Itemize
4088 Change typefaces, e.
4089 \begin_inset space \thinspace{}
4093 \begin_inset space \space{}
4096 to write bold-face text in an expression.
4099 \begin_layout Itemize
4100 Fine-tune font sizes and spacing within an expression.
4101 (Do not worry about this until your final draft!)
4104 \begin_layout Itemize
4106 These are very powerful, because you just define them once at the top of
4107 the document, and then you can use them throughout the document.
4110 \begin_layout Itemize
4111 Do lots of other things that we have no space for in this Tutorial.
4114 \begin_layout Chapter
4118 \begin_layout Section
4119 Other major LyX Features
4122 \begin_layout Standard
4123 We have not gone through all the possible commands in LyX, and we are not
4132 \begin_inset space ~
4137 manual for more information.
4138 We will just mention a couple more major things LyX can do:
4141 \begin_layout Itemize
4142 LyX has WYSIWYM support for tables.
4145 Insert\SpecialChar \menuseparator
4149 \begin_inset Graphics
4150 filename ../images/tabular-insert.png
4157 Click on the table with the
4164 \begin_inset space ~
4169 dialog box which allows extensive table editing.
4172 \begin_layout Itemize
4173 LyX also supports including pictures in any format within documents.
4176 Insert\SpecialChar \menuseparator
4180 \begin_inset Graphics
4181 filename ../images/dialog-show-new-inset_graphics.png
4188 Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4189 can have captions, and LyX will automatically generate lists of figures
4193 \begin_layout Itemize
4194 LyX is heavily configurable.
4195 Everything from how the LyX window looks to how the output comes out can
4196 be configured in a number of ways.
4197 Much configuration is done through
4199 Tools\SpecialChar \menuseparator
4203 For more information on this, check out
4205 Help\SpecialChar \menuseparator
4206 Customization\SpecialChar \@.
4210 \begin_layout Itemize
4211 LyX is being developed by a team of programmers on five continents.
4212 Therefore, LyX has better support for non-English languages (such as Dutch,
4213 German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4214 ) than many word processors.
4215 Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4216 languages Chinese Japanese, and Korean are supported.
4217 You can write documents in other languages and you can also configure LyX
4218 to show its menus and error messages in other languages.
4222 \begin_layout Itemize
4223 The LyX menus feature keybindings.
4224 This means that you can do
4226 File\SpecialChar \menuseparator
4237 or by using the binding which is shown next to it in the menu (Ctrl+O by
4239 Keybindings are also configurable.
4240 For information on this, check out
4242 Help\SpecialChar \menuseparator
4243 Customization\SpecialChar \@.
4247 \begin_layout Itemize
4248 LyX can read LaTeX documents.
4250 \begin_inset space ~
4254 \begin_inset CommandInset ref
4256 reference "sec:tex2lyx"
4263 \begin_layout Itemize
4264 Spell-checking, thesaurus, and word count facilities are available.
4267 \begin_layout Itemize
4268 Generation of indexes and nomenclatures/glossaries is supported.
4271 \begin_layout Section
4273 \begin_inset CommandInset label
4275 name "sec:latexusers"
4282 \begin_layout Standard
4283 If you do not know anything about LaTeX, you do not have to read this section.
4284 Actually, you might want to
4288 about LaTeX, and then read this chapter.
4289 However, some who begin to use LyX will be familiar with LaTeX.
4290 If you are such a person, you may be wondering if LyX can really do everything
4292 The short answer is that LyX can do pretty much everything LaTeX can do
4293 in one form or another, and it definitely simplifies most parts of writing
4297 \begin_layout Standard
4298 Because this is just a tutorial, we are only going to mention things that
4299 new LyX users will most likely be interested in.
4300 In the interests of keeping the Tutorial short, we will give only minimal
4305 \begin_inset space ~
4313 \begin_inset space ~
4318 manual have a great deal of information on differences between LyX and
4319 LaTeX, and how to do various LaTeX tricks in LyX.
4322 \begin_layout Subsection
4326 \begin_layout Standard
4327 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4328 will be displayed in red on the screen.
4329 You can use TeX commands in LyX by choosing
4331 Insert\SpecialChar \menuseparator
4333 \begin_inset space ~
4339 \begin_inset Graphics
4340 filename ../images/ert-insert.png
4347 This creates a box where everything within it is passed straight to LaTeX.
4350 \begin_layout Standard
4351 In a math formula, TeX mode is handled a bit differently.
4352 TeX mode is there entered by typing a backslash.
4353 The backslash is not written out, but anything you type afterwards will
4355 You exit TeX mode by typing
4359 or some other non-alphabetic character, like a number, underscore, caret,
4361 Once you exit TeX mode, if LyX knows the TeX command you have typed in,
4362 it will convert it to WYSIWYM\SpecialChar \@.
4364 \begin_inset Quotes eld
4374 \begin_inset Quotes erd
4377 in a formula and then press
4381 , LyX will change the red
4382 \begin_inset Quotes eld
4386 \begin_inset Quotes erd
4390 \begin_inset Quotes eld
4394 \begin_inset Formula $\gamma$
4398 \begin_inset Quotes erd
4402 This will work for almost all, non-complicated math macros.
4403 This may be faster than using the
4406 \begin_inset space ~
4411 , and will be especially convenient for experienced LaTeX users.
4414 \begin_layout Standard
4415 As a special case, if you type
4416 \begin_inset Quotes eld
4426 \begin_inset Quotes erd
4429 in a formula, the beginning
4433 ending braces will be inserted in red while the cursor is placed between
4435 This makes it more convenient to type those commands which take an argument.
4438 \begin_layout Standard
4439 LyX cannot do absolutely everything that LaTeX can do.
4440 Some fancy functions are not supported at all, while some work but are
4442 TeX mode allows users to get the full flexibility of LaTeX, while having
4443 all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4444 LyX could never support every LaTeX package.
4451 in the preamble (see section
4452 \begin_inset space ~
4456 \begin_inset CommandInset ref
4458 reference "sec:preamble"
4462 ), you can use any package you want — although you will not have WYSIWYM
4463 support for that package's features.
4466 \begin_layout Subsection
4467 Importing LaTeX Documents —
4472 \begin_inset CommandInset label
4481 \begin_layout Standard
4482 You can import a LaTeX file into LyX by using the
4484 File\SpecialChar \menuseparator
4485 Import\SpecialChar \menuseparator
4487 \begin_inset space ~
4493 This will call the program
4497 which will create a file foo.lyx from the file foo.tex.
4498 LyX will then open that file.
4499 If the translation does not work, you can try calling
4503 from the command line, possibly using fancier options.
4506 \begin_layout Standard
4507 Even when the translation does work,
4511 may not translate everything, though it does handle most legal LaTeX.
4512 It will leave things it does not understand in TeX mode; so, after translating
4517 , you can look for the red text and manually edit it to get it right.
4520 \begin_layout Standard
4525 has its own documentation (manpage), which Unix/Linux users can access
4526 via the console command
4529 \begin_inset space ~
4535 The manpage describes which LaTeX commands and environments are not supported,
4536 what bugs you might run into (and how to get around them), and how to use
4537 the various options.
4540 \begin_layout Standard
4541 It is important to understand that
4545 can only translate files whose document class is
4546 \begin_inset Quotes eld
4550 \begin_inset Quotes erd
4553 to LyX, that is, for which there is a corresponding LyX
4558 If there is no layout file, then you will get an error saying that the
4559 conversion could not be performed.
4560 So, unless you have a layout for the document class of your LaTeX file,
4565 simply will not know how to translate the LaTeX that it finds there into
4566 things LyX understands.
4567 More about layout files and how they are created is explained in detail
4575 \begin_layout Subsection
4576 Converting LyX Documents to LaTeX
4579 \begin_layout Standard
4580 You might wish to convert a LyX Document to a LaTeX file.
4581 For example, a co-worker or co-author who does not have LyX might want
4585 File\SpecialChar \menuseparator
4586 Export\SpecialChar \menuseparator
4590 This will create a file
4598 file you are editing.
4599 LyX always creates temporary LaTeX files when viewing or printing files.
4602 \begin_layout Subsection
4606 \begin_layout Subsubsection
4610 \begin_layout Standard
4613 Document\SpecialChar \menuseparator
4616 dialog takes care of the document-wide options.
4617 You can change there the document class, default font size and paper size.
4618 Document class options but also options for LaTeX packages can be entered
4622 \begin_inset space ~
4630 \begin_layout Subsubsection
4631 Other Preamble Matter
4632 \begin_inset CommandInset label
4641 \begin_layout Standard
4642 If you have special commands to put in the preamble of a LaTeX file, you
4643 can use them in a LyX document as well.
4646 Document\SpecialChar \menuseparator
4647 Settings\SpecialChar \menuseparator
4649 \begin_inset space ~
4654 and type in the dialog window (or from the document settings dialog, depending
4656 Anything you type will (as with TeX mode) be sent directly to LaTeX.
4659 \begin_layout Subsection
4663 \begin_layout Standard
4664 LyX has support for BibTeX, which allows you to build databases of bibliographic
4665 al references to be used in multiple documents.
4668 Insert\SpecialChar \menuseparator
4670 \begin_inset space \thinspace{}
4674 \begin_inset space \thinspace{}
4677 TOC\SpecialChar \menuseparator
4679 \begin_inset space ~
4693 field you load BibTeX files, in the
4697 field you can load BibTeX style files.
4700 \begin_layout Standard
4701 After you have done this, you can use citations from any bibliographies
4702 you are including with
4704 Insert\SpecialChar \menuseparator
4708 \begin_inset space ~
4712 \begin_inset CommandInset ref
4714 reference "sec:bibliographies"
4719 LyX will take care of running BibTeX.
4724 dialog will show a list of all the references in your
4731 \begin_layout Section
4735 \begin_layout Standard
4736 Sometimes when you try to view a document, there will be errors, things
4737 that LyX or LaTeX cannot understand.
4738 When this happens, LyX will open a
4741 \begin_inset space ~
4747 Clicking on individual errors in this dialog will take you to the place
4748 in the LyX document where the error occurs and also display the detailed
4749 LaTeX error message.