1 #LyX 2.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 \use_default_options false
37 \maintain_unincluded_children false
39 \language_package default
44 \font_typewriter default
45 \font_default_family default
46 \use_non_tex_fonts false
53 \default_output_format default
55 \bibtex_command default
56 \index_command default
60 \pdf_title "The LyX Tutorial"
61 \pdf_author "LyX Team"
62 \pdf_subject "LyX-documentation Tutorial"
63 \pdf_keywords "LyX, documentation"
65 \pdf_bookmarksnumbered true
66 \pdf_bookmarksopen true
67 \pdf_bookmarksopenlevel 1
72 \pdf_pdfusetitle false
73 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
83 \paperorientation portrait
92 \paragraph_separation indent
93 \paragraph_indentation default
94 \quotes_language english
97 \paperpagestyle headings
98 \tracking_changes false
102 \html_be_strict false
116 \begin_layout Plain Layout
118 If you have comments on or corrections to this documentation, please send
119 them to the LyX Documentation mailing list:
120 \begin_inset CommandInset href
122 target "lyx-docs@lists.lyx.org"
135 \begin_layout Standard
136 \begin_inset CommandInset toc
137 LatexCommand tableofcontents
144 \begin_layout Chapter
148 \begin_layout Section
152 \begin_layout Standard
153 This manual is designed for all of you who have never heard of LaTeX, or
154 do not know it very well.
155 Now, do not panic - you will not need to learn LaTeX to use LyX.
156 That is, after all, the whole point of LyX: to provide an almost-WYSIWYG
158 There are some things you will need to learn, however, in order to use
162 \begin_layout Standard
163 Some of you probably found your way to this document because you tried to
164 put two spaces after a
165 \begin_inset Quotes eld
169 \begin_inset Quotes erd
172 or tried to put three blank lines between paragraphs.
173 You found out you could not and, in fact, you will find out that most of
174 the little tricks you are accustomed to use in word processors will not
176 That is because most word processors you have used before allow you manually
177 to enter all spacings, font changes, and so on.
178 So you end up not only writing a document but typesetting it, too.
179 LyX does the typesetting for you, in a consistent fashion, letting you
180 focus on the important things, like the content of your writing.
183 \begin_layout Standard
184 So read on to learn more about LyX.
185 Reading this tutorial is definitely worth the time.
188 \begin_layout Section
198 \begin_layout Standard
199 Before we get started with this section, you need to know that this
203 uses the notation outlined in the
208 If you came to this manual first, please read the
212 before you continue with the
219 \begin_layout Standard
220 Now that you know which fonts mean what in the documentation, we want to
221 talk a bit about what this
228 \begin_layout Subsection
229 Getting the most out of the Tutorial
232 \begin_layout Standard
233 This tutorial consists of examples and exercises.
234 To get the most out of this document, you should read through it, typing
235 all the little things we are telling you to type and trying out all of
236 the exercises to see if you get them right.
237 For convenience, you might want to print out the PDF version of this document.
240 \begin_layout Standard
241 If you are familiar with LaTeX, you will probably be able to read the
245 somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
246 However, LyX has features you will want to learn about.
247 Even if you do not feel like reading the rest of the
251 , you should definitely check out Section
256 \begin_inset CommandInset ref
258 reference "sec:latexusers"
262 , which is specifically written for experienced LaTeX users.
265 \begin_layout Subsection
273 \begin_layout Itemize
274 Detailed explanations of all of LyX's features.
278 \begin_layout Standard
287 \begin_layout Itemize
288 Detailed explanations of LaTeX.
292 \begin_layout Standard
294 If you want to learn some of the neat tricks you can do with LaTeX in LyX,
295 you can have a look at the
307 \begin_layout Standard
308 It is time to move on, time for your first document \SpecialChar \ldots{}
312 \begin_layout Chapter
313 Getting started with LyX
316 \begin_layout Section
317 Your first LyX document
320 \begin_layout Standard
322 You are ready to start writing.
323 Before you do, there are a few things we need to mention, which will hopefully
324 make the Tutorial more instructive and useful.
328 \begin_layout Standard
329 Because there is information we cannot give you in the Tutorial, the
335 thing that you need to do is find the
342 Start up LyX, select the
351 You may want to load the
355 as well (if you are not reading it within LyX already).
356 This way, you can read them while you are writing your own file.
360 \begin_layout Plain Layout
361 They can also serve as good examples of how to use the many features of
367 Note that once you have got more than one document open, you can use the
372 menu or the document tabs to switch between them.
375 \begin_layout Standard
376 In this Tutorial, we are going to assume that you have a fully working version
377 of LyX, as well as a LaTeX-distribution and a PDF-viewer.
378 This should be the case on all major Linux- and BSD-distributions, as well
379 as on Windows, where this is setup by the LyX installers.
382 \begin_layout Standard
383 Finally, we have written a file called
387 to let you practice your LyX skills.
388 Imagine that it was typed by someone who did not know about any of LyX's
390 As you learn new LyX functions, we will suggest that you fix those parts
396 It also contains `subtle' hints about how to fix things.
400 \begin_layout Plain Layout
401 The hints are located in yellow
402 \begin_inset Quotes eld
406 \begin_inset Quotes erd
410 Access the text in a note by clicking on it.
415 If you want to cheat, or check what you have done, there is also a file
420 which contains the same text written and typeset by a LyX master.
423 \begin_layout Standard
424 The example files can be found in the
428 directory of LyX's installation folder.
435 File\SpecialChar \menuseparator
442 to save a copy in your own directory for you to work on.
443 As you fix parts of the raw document, check to see how those changes affect
447 \begin_layout Standard
452 directory contains lots of other examples files.
453 They will show you how to do various fancy things with LyX.
454 After you have read the Tutorial, or when you are confused about how to
455 do something fancy in LyX, take a look at these files.
458 \begin_layout Subsection
459 Typing, Viewing, and Exporting
462 \begin_layout Itemize
465 File\SpecialChar \menuseparator
469 \begin_layout Itemize
470 Type a sentence like:
472 This is my first LyX document!
475 \begin_layout Itemize
476 Save your document with
478 File\SpecialChar \menuseparator
487 \begin_layout Itemize
488 Create a PDF file, with
490 View\SpecialChar \menuseparator
493 or the toolbar button
500 LyX will open a PDF-viewer program displaying your document as it will
505 \begin_layout Plain Layout
506 You can save time by leaving the PDF-viewer running in the background.
509 View\SpecialChar \menuseparator
512 or the toolbar button
518 and just click on the PDF-viewer window (or unminimize it) afterwards.
526 \begin_layout Itemize
527 Export the ready to print document with
529 File\SpecialChar \menuseparator
537 \begin_layout Standard
538 Congratulations! You have written your first LyX document.
539 All of the rest is just details.
542 \begin_layout Subsection
546 \begin_layout Standard
547 LyX can of course do most of the things you are used to doing with a word
549 It will word-wrap and indent paragraphs automatically.
550 Here is a quick description of how to do some simple actions.
553 \begin_layout Description
554 Undo LyX has multiple levels of undo, which means you can undo everything
555 you have done since your current editing session started, by selecting
558 Edit\SpecialChar \menuseparator
567 ) over and over again.
568 If you undo too much, just select
570 Edit\SpecialChar \menuseparator
583 \begin_layout Standard
584 Currently, undo is limited to 100 steps.
588 \begin_layout Description
591 Edit\SpecialChar \menuseparator
602 Edit\SpecialChar \menuseparator
613 Edit\SpecialChar \menuseparator
622 ) to cut, copy, and paste.
623 Or automatically paste selected text (including selections from other programs)
631 \begin_layout Description
634 Edit\SpecialChar \menuseparator
648 arg "dialog-show findreplace"
652 In the dialog, search with the
664 button to replace a word you have found.
668 \begin_layout Plain Layout
669 Close the window when you are done or leave it open if you find it more
671 Most dialog boxes in LyX can operate like this.
672 Just be sure you have the right window in focus when you are trying to
673 type in the main LyX window or a LyX dialog.
678 If you like, you can specify whether to make the search case-sensitive,
679 or to search for only complete words; you can also search backwards through
683 \begin_layout Description
698 , which will by default print characters in italics), set it in
708 , usually small caps, used for people's names), or use your own formatting
711 Edit\SpecialChar \menuseparator
716 Style\SpecialChar \menuseparator
719 dialog (toolbar button
722 arg "dialog-show character"
728 \begin_layout Description
729 Toolbar Other buttons on the toolbar allow you to do some of the more popular
757 \begin_layout Standard
758 Of course, you have not yet written enough to make most of these functions
760 As you write more, though, try undoing, pasting, etc.
763 \begin_layout Subsection
764 WYSIWYM: Whitespace in LyX
767 \begin_layout Standard
768 One of the hardest things for new users to get used to is the way that LyX
770 As many times as you hit
774 , you will only get one blank line.
775 As many times as you hit
779 , you will only get one space.
780 On a blank line, LyX will not let you type even one space.
785 key will not move you forward one tab stop; in fact there
789 no tab stops! There is no ruler at the top of the page to let you set tabs
793 \begin_layout Standard
794 Many word processors are based on the WYSIWYG principle:
795 \begin_inset Quotes eld
798 What You See Is What You Get.
799 \begin_inset Quotes erd
802 LyX, on the other hand, is based on the principle that
803 \begin_inset Quotes eld
806 What You See Is What You
811 \begin_inset Quotes erd
814 You type what you mean and LyX will take care of typesetting it for you
815 so that the output looks nice.
820 grammatically separates paragraphs and a
824 grammatically separates words; so there is no reason to have several of
829 has no grammatical function at all - so LyX does not support it.
830 Using LyX, you will spend more of your time worrying about the
834 of your document and less time worrying about the
843 for more information on the WYSIWYM concept.
846 \begin_layout Standard
847 LyX does have (many) ways to fine-tune the formatting of your document.
848 After all, LyX might not typeset
857 has information about all that.
858 It includes horizontal fills and vertical space — which are more powerful
859 and versatile than multiple spaces or blank lines — and ways to change
860 font sizes, character styles, and paragraph alignments by hand.
861 The idea, though, is that you can write your whole document, focusing on
862 content, and just worry about that fine-tuning at the end.
863 With standard word processors, you will be distracted by document formatting
864 throughout the writing process.
867 \begin_layout Section
871 \begin_layout Standard
872 Different parts of a document have different purposes; we call these parts
878 Most of a document is made up of regular text.
879 Section titles (chapter, subsection, etc.) let the reader know that a new
880 topic or subtopic will be discussed.
881 Certain types of documents have special environments.
882 A journal article will have an abstract and a title.
883 A letter will have neither of these, but will probably have an environment
884 that gives the writer's address.
887 \begin_layout Standard
888 Environments are a major part of the
889 \begin_inset Quotes eld
892 What You See Is What You Mean
893 \begin_inset Quotes erd
897 A given environment may require a certain font style, font size, indenting,
898 line spacing, and more.
899 This problem is aggravated, because the exact formatting for a given environmen
900 t may change: one journal may use boldface, 18 point, centered type for
901 section titles while another uses italicized, 15 point, left justified
902 type; different languages may have different standards for indenting; and
903 bibliography formats can vary widely.
904 LyX lets you avoid learning all the different formatting styles.
907 \begin_layout Standard
912 choice box is located on the left end of the toolbar and looks like this:
914 \begin_inset Graphics
915 filename clipart/ToolbarEnvBox.png
922 It indicates in which environment you are currently writing.
923 While you were writing your first document, it said
924 \begin_inset Quotes eld
928 \begin_inset Quotes erd
931 which is the default environment for text.
932 Now you will put a number of environments in your new document so that
933 you can see how they work.
936 \begin_layout Subsection
937 Sections and Subsections
940 \begin_layout Standard
945 on the first line of your new LyX file, and select
957 \begin_layout Plain Layout
963 If nothing is selected, LyX changes the paragraph you are currently in
964 to the selected environment.
965 Alternatively, you can change several paragraphs to a different environment
966 by selecting them before picking an environment.
983 , which will be covered below.
984 LyX numbers the section
985 \begin_inset Quotes eld
989 \begin_inset Quotes erd
992 and typesets the section heading (title) in a larger font.
1003 \begin_inset Quotes eld
1007 \begin_inset Quotes erd
1011 \begin_inset Quotes eld
1015 \begin_inset Quotes erd
1019 Section headings, like most environments, are assumed to end when you type
1025 Type the document introduction:
1028 \begin_layout LyX-Code
1029 This is an introduction to my first LyX document.
1032 \begin_layout Standard
1047 \begin_inset Quotes eld
1051 \begin_inset Quotes erd
1054 and waits for you to type a title.
1056 \begin_inset Quotes eld
1062 \begin_inset space ~
1068 \begin_inset Quotes erd
1071 , and you will see that LyX again sets it as a section title.
1074 \begin_layout Standard
1076 Go to the end of Section
1077 \begin_inset space ~
1081 \begin_inset Quotes eld
1084 my first LyX document.
1085 \begin_inset Quotes erd
1102 \begin_inset Quotes eld
1106 \begin_inset Quotes erd
1109 and waits for you to type a title.
1116 \begin_inset space ~
1120 \begin_inset Quotes eld
1124 \begin_inset Quotes erd
1128 \begin_inset space ~
1131 2, has been automatically renumbered to Section
1132 \begin_inset space ~
1135 3! In true WYSIWYM fashion, you just need to identify the text that makes
1136 up the section titles, and LyX takes care of numbering the sections and
1140 \begin_layout Standard
1149 environment, and type the following five lines:
1152 \begin_layout LyX-Code
1153 Sections and subsections are described below.
1156 \begin_layout LyX-Code
1160 \begin_layout LyX-Code
1161 Sections are bigger than subsections.
1164 \begin_layout LyX-Code
1165 Subsection description
1168 \begin_layout LyX-Code
1169 Subsections are smaller than sections.
1172 \begin_layout Standard
1173 Click on the second line and select
1182 LyX numbers the subsection
1183 \begin_inset Quotes eld
1187 \begin_inset Quotes erd
1190 , and typesets it in a font which is bigger than regular text but smaller
1191 than the section title.
1192 Change the fourth line to the
1196 environment as well.
1197 As you probably expected, LyX automatically numbered the section
1198 \begin_inset Quotes eld
1202 \begin_inset Quotes erd
1206 If you put yet another section before Section
1207 \begin_inset space ~
1211 \begin_inset space ~
1214 2 will be renumbered as Section 3, and the subsections will be renumbered
1216 \begin_inset Quotes eld
1220 \begin_inset Quotes erd
1224 \begin_inset Quotes eld
1228 \begin_inset Quotes erd
1234 \begin_layout Standard
1235 Further levels of sectioning include
1248 We will let you play with these on your own.
1249 You may notice that paragraph and subparagraph headings are not numbered
1250 by default, and that subparagraphs are indented; see the
1254 for an explanation and how to change this.
1259 headings are actually the highest level of sectioning, above
1263 s, but you are only allowed to use them in certain types (text classes)
1264 of LyX documents (see Section
1265 \begin_inset space ~
1269 \begin_inset CommandInset ref
1271 reference "sec:Document-Classes"
1278 \begin_layout Standard
1279 Finally, you may want to have sections or subsections that are not numbered.
1280 There are environments for this as well.
1281 If you change one of your section headings to the
1285 environment (you may have to scroll down in the
1289 box to find it), LyX will use the same font size for the heading as it
1290 uses for a regular section, but it will not number that section.
1291 There are corresponding
1292 \begin_inset Quotes eld
1296 \begin_inset Quotes erd
1299 heading environments for
1308 Try changing some of your sections or subsections to the starred environments,
1309 and note how the other section numbers are updated.
1312 \begin_layout Standard
1317 : Fix the section and subsection headings in
1325 \begin_layout Subsection
1329 \begin_layout Standard
1330 LyX has several different environments for typesetting lists.
1331 The various list environments free you from hitting
1335 a million times when writing an outline, or from renumbering a whole list
1336 when you want to add a point in the middle of the list.
1337 Different types of documents logically require different list environments:
1340 \begin_layout Itemize
1341 A slide presentation might use the
1345 environment's bulleted lists to describe different points.
1348 \begin_layout Itemize
1349 An outline would use the
1353 environment's numbered lists (and lettered sublists).
1356 \begin_layout Itemize
1357 A document describing several software packages could use the
1361 environment, where each item in the list begins with a bold-faced word.
1364 \begin_layout Itemize
1373 ) environment is a variation on the
1380 \begin_layout Standard
1381 Let us write a list of reasons why LyX is better than other word processors.
1382 Somewhere in your document, type:
1385 \begin_layout Standard
1388 LyX is better than other word processors because:
1391 \begin_layout Standard
1408 arg "layout Itemize"
1413 \begin_inset Quotes eld
1417 \begin_inset Quotes erd
1421 Type in your reasons:
1424 \begin_layout LyX-Code
1425 Typesetting is done for you.
1428 \begin_layout LyX-Code
1432 \begin_layout LyX-Code
1433 Lists are very easy to create!
1436 \begin_layout Standard
1437 List environments, unlike headings, do not end when you type
1442 Instead, LyX assumes you are going on to the next item in the list.
1443 The above will therefore result in a three-item list.
1444 If you want more than one paragraph within one list
1448 , one way is to use the
1451 \begin_inset space ~
1456 , which you get by typing
1461 In order to get out of the list, you need to reselect the
1465 environment (or just use the key binding
1468 arg "layout Standard"
1474 \begin_layout Standard
1475 You now have a beautiful itemized list.
1476 You might want to run LaTeX to see how the list looks when printed out.
1477 But what if you wanted to number the reasons? Well, just select the whole
1482 \begin_layout Plain Layout
1483 LyX will not let you select the first bullet (or the actual number in a
1484 numbered section title) unless you also select the paragraph
1488 it, which you probably do not want to do.
1489 This is on purpose because the bullet or number depends on the document
1490 settings or text position, respectively.
1506 arg "layout Enumerate"
1510 Pow! As we mentioned, if you add or delete a list item, LyX will fix the
1514 \begin_layout Standard
1515 While the list is still selected, you can change to the other two list environme
1523 \begin_inset space \thinspace{}
1529 \begin_inset space \thinspace{}
1539 arg "layout Description"
1548 ), in order to see what they look like.
1549 For those two environments, each list item is made up of a term, which
1550 is the item's first word, followed by a definition, which is the rest of
1551 the paragraph (until you hit
1556 The term is either typeset in boldface (
1561 \begin_inset Quotes eld
1565 \begin_inset Quotes erd
1572 \begin_layout Plain Layout
1573 But a typesetter's tab, which will change to fit the size of the largest
1574 term, not a pathetic, rigid, unchangeable typewriter
1587 ) from the rest of the paragraph.
1588 If you want to have more than one word in the definition, then separate
1592 \begin_inset space ~
1600 \begin_layout Standard
1605 : Typeset the list in
1610 \begin_layout Standard
1611 You can nest lists within each other in all sorts of interesting ways.
1612 An obvious example would be writing outlines.
1613 Numbered and bulleted lists will have different numbering and bulleting
1614 schemes for sublists.
1619 for details on the different sorts of lists and for examples of nestings.
1622 \begin_layout Subsection
1623 Other environments: Verses, Quotations, and more
1626 \begin_layout Standard
1627 There are two environments for setting quotations apart from surrounding
1632 for short quotes and
1645 \begin_layout Plain Layout
1646 used in this Tutorial for the long typing examples
1655 font; this environment is the only place in LyX where you are allowed to
1656 use multiple spaces to allow code indenting.
1657 You can even write poetry using the
1665 to separate stanzas, and
1669 to separate lines within a stanza.
1674 for more complete descriptions of all of the available LyX environments.
1677 \begin_layout Standard
1682 : Correctly typeset the
1695 \begin_layout Chapter
1699 \begin_layout Standard
1700 The previous chapter hopefully allowed you to get used to writing in LyX.
1701 It introduced you to the basic editing operations in LyX, as well as the
1702 powerful method of writing with environments.
1703 Most people who use LyX, though, will want to write documents: papers,
1704 articles, books, manuals, or letters.
1705 This chapter is meant to take you from simply writing text with LyX to
1706 writing a complete document.
1707 It will introduce you to text classes, which allow you to write different
1709 It will then describe many of the additions that turn text into a document,
1710 such as titles, footnotes, cross references, bibliographies, and tables
1714 \begin_layout Section
1716 \begin_inset CommandInset label
1718 name "sec:Document-Classes"
1725 \begin_layout Standard
1726 Different sorts of documents should be typeset differently.
1727 For example, books are generally printed double-sided, while articles are
1729 In addition, many documents contain special environments: letters contain
1730 some environments — such as the sender's address and the signature — which
1731 do not make sense in a book or article.
1740 \begin_layout Plain Layout
1741 for LaTeX users: this is equivalent to the LaTeX document class
1746 takes care of these large scale differences between different sorts of
1748 This Tutorial, for example, was written in the
1753 Document classes are another major part of the WYSIWYM philosophy; they
1754 tell LyX how to typeset the document, so you do not need to know how.
1757 \begin_layout Standard
1758 Your document is probably being written in the
1766 \begin_layout Plain Layout
1767 That is usually the default document class
1772 Try changing to other document classes (using the
1774 Document\SpecialChar \menuseparator
1777 dialog) to see how they are typeset differently.
1778 If you change your document to the
1782 document class and look at the
1786 box, you will see that most of the allowed environments are the same.
1787 However, you can now use the
1792 If you are ever unsure about which environments you can use in a given
1793 document class, just consult the
1800 \begin_layout Standard
1801 Font sizes, one- or two-column printing, and page headings are just some
1802 of the ways journals' typesettings differ from one another.
1803 As the Computer Age continues to mature, journals have begun accepting
1804 electronic submissions, creating LaTeX
1805 \begin_inset Quotes eld
1809 \begin_inset Quotes erd
1812 so that authors can submit correctly typeset articles.
1813 LyX is set up to support this as well.
1814 For example, LyX supports typesetting (and extra environments) for the
1815 American Mathematics Society journals using the
1818 \begin_inset space ~
1826 \begin_layout Standard
1827 Here is a very quick reference to some of the document classes.
1830 Special Document Classes
1836 manual for many more details.
1839 \begin_layout Standard
1841 \begin_inset Tabular
1842 <lyxtabular version="3" rows="7" columns="2">
1843 <features tabularvalignment="middle">
1844 <column alignment="center" valignment="top" width="0pt">
1845 <column alignment="center" valignment="top" width="0pt">
1847 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1850 \begin_layout Plain Layout
1856 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1859 \begin_layout Plain Layout
1867 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1870 \begin_layout Plain Layout
1876 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1879 \begin_layout Plain Layout
1880 one-sided, no chapters
1887 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1890 \begin_layout Plain Layout
1896 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1899 \begin_layout Plain Layout
1900 layout & environments for American Math Society
1907 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1910 \begin_layout Plain Layout
1916 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1919 \begin_layout Plain Layout
1920 longer than article, two-sided
1927 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1930 \begin_layout Plain Layout
1936 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1939 \begin_layout Plain Layout
1940 report + front and back matter
1947 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1950 \begin_layout Plain Layout
1956 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1959 \begin_layout Plain Layout
1967 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1970 \begin_layout Plain Layout
1976 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1979 \begin_layout Plain Layout
1980 lots of extra environments for address, signature\SpecialChar \ldots{}
1994 \begin_layout Section
1995 Templates: Writing a Letter
1998 \begin_layout Standard
1999 One way to write a letter would be to open a new file, and choose a
2005 Document\SpecialChar \menuseparator
2009 While this is the most obvious way to write a letter, it seems like extra
2011 Every time you write a business letter, you want to have your address,
2012 the address to which you are sending it, a body, a signature, etc.
2017 for letters, which contains a sample letter; once you have a template,
2018 you can just replace a couple of parts of the letter with your text each
2019 time you write a letter.
2022 \begin_layout Standard
2023 Open a new file with
2025 File\SpecialChar \menuseparator
2027 \begin_inset space ~
2031 \begin_inset space ~
2042 Save and print the file to see how the various environments are typeset.
2045 \begin_layout Standard
2046 When you look at the
2050 box, you will see several environments, like the
2053 \begin_inset space ~
2058 environment, that do not exist in most other document classes.
2064 You can play around for a while to figure out how the various environments
2066 You will notice for example that the
2070 environment has the word
2071 \begin_inset Quotes eld
2075 \begin_inset Quotes erd
2078 in red before the actual text of the signature.
2079 This word does not show up in the actual letter, as you will see if you
2080 view/export the file.
2081 It is just there to let you know where the signature goes.
2082 Also, note that it does not matter where in the file the
2087 Remember, LyX is WYSIWYM; you can put the
2091 environment anywhere you want, but LyX knows that in the printout, the
2092 signature should be at the end.
2095 \begin_layout Standard
2096 A template is just a regular LyX file.
2097 This means you can fill in your address and signature and save the file
2099 From now on, any time you want to write a letter, you can use the new template
2101 We do not have to suggest an actual
2102 \begin_inset Quotes eld
2106 \begin_inset Quotes erd
2109 here; just write a letter to someone!
2113 \begin_layout Plain Layout
2114 One warning, if you are writing from a template.
2115 If you erase all of the text in an environment — for example, if you erase
2119 \begin_inset space ~
2124 field so that you can replace it with your own — and then you move the
2125 cursor without writing any text, the environment may disappear.
2126 This is because most environments cannot exist without any text in them.
2127 Just reselect the environment from the
2139 \begin_layout Standard
2140 Templates can be a huge time-saver, and we urge you to use them whenever
2142 In addition, they can help a person learn how to use some of the fancier
2144 Finally, they may be useful for a person who is configuring LyX for a bunch
2145 of less computer-aware users.
2146 When they are first learning LyX, it will be less intimidating if they
2147 have a letter template customized for their company, for example.
2150 \begin_layout Section
2154 \begin_layout Standard
2155 LyX (like LaTeX) considers the title — which may contain the actual title,
2156 the author, the date, and even an abstract of a paper — to be a separate
2157 part of the document.
2160 \begin_layout Standard
2161 Go back to your first LyX document and make sure it is using the
2169 \begin_layout Plain Layout
2170 You should not be using the letter any more, since the
2174 document class does not allow titles.
2179 Type a title on the first line, and change the line to the
2184 On the next line, type your name and change it to the
2189 On the next line, write the date in the
2194 Type a paragraph or two summarizing your document using the
2199 Notice how the title is presented when it is printed out.
2200 If you change the document format to Book, you will get a separate title
2201 page, like the first page of this tutorial.
2204 \begin_layout Standard
2209 : Fix the title, date, and author in
2214 \begin_layout Section
2215 Labels and Cross-References
2218 \begin_layout Standard
2219 You can label section headings, list items, formulas, footnotes, and floats
2223 \begin_layout Plain Layout
2224 Floats are explained in the
2238 Once you do so, you can refer to the element in other parts of the document,
2239 using cross-references.
2240 You can refer to a section's number, to the page on which the section begins
2242 As with section numbering, LyX also takes care of cross-reference numbering
2244 Automatic management of labels and cross-references is among the most significa
2245 nt advantages of LyX (and LaTeX) over conventional word processors.
2248 \begin_layout Subsection
2252 \begin_layout Standard
2253 Go to our second section, whose title is
2254 \begin_inset Quotes eld
2258 \begin_inset Quotes erd
2262 Click at the end of the section title line, and select
2264 Insert\SpecialChar \menuseparator
2267 or the toolbar button
2274 A dialog asks you for a label name, and gives you a suggestion.
2279 , the label name will be placed in a box next to the section title.
2282 \begin_layout Standard
2283 So far you have not done anything — the output will look exactly the same,
2284 since labels do not show up in the printed document.
2285 However, now that you have added a label, you can refer to that label with
2287 We will do that next.
2290 \begin_layout Subsection
2291 Your first cross-reference
2294 \begin_layout Standard
2295 Place the cursor somewhere in Section
2296 \begin_inset space ~
2303 \begin_layout LyX-Code
2304 If you want to know more about this document, then see
2305 \begin_inset Newline newline
2308 Section, which can be found on page.
2311 \begin_layout Standard
2312 Now, with the cursor after the word
2313 \begin_inset Quotes eld
2317 \begin_inset Quotes erd
2322 Insert\SpecialChar \menuseparator
2324 \begin_inset space ~
2329 or the toolbar button
2332 arg "dialog-show-new-inset ref"
2336 The Cross-reference dialog pops up.
2337 It shows a list of the possible labels you can reference.
2338 At the moment, there should be only one,
2339 \begin_inset Quotes eld
2342 sec:About-This-Document
2343 \begin_inset Quotes erd
2347 First, select the drop-down menu labeled
2348 \begin_inset Quotes eld
2352 \begin_inset Quotes erd
2356 \begin_inset Quotes eld
2359 <reference> on page <page>
2360 \begin_inset Quotes erd
2365 \begin_inset Quotes eld
2368 sec:About-This-Document
2369 \begin_inset Quotes erd
2372 (it may be selected by default), and a reference marker will appear containing
2374 \begin_inset Quotes eld
2377 Ref+Text: sec:About-This-Document
2378 \begin_inset Quotes erd
2381 (To be really correct, you should put a
2384 \begin_inset space ~
2392 arg "command-alternatives space-insert protected ; math-space"
2395 ) in between the word
2396 \begin_inset Quotes eld
2400 \begin_inset Quotes erd
2403 and the reference.) An alternative way to reference a label is to right-click
2404 the label and select
2408 in the pop-up context menu.
2409 The cross-reference to this label is now in the clipboard and can be copied
2410 to the actual cursor position via the menu
2412 Edit\SpecialChar \menuseparator
2422 In the printed document, this reference marker will be replaced with the
2423 section number and then the page number.
2424 Preview your document and you will see that LaTeX has been even cleverer
2427 \begin_inset Quotes eld
2431 \begin_inset Quotes erd
2434 and depending how much text you have between the start of Section
2435 \begin_inset space ~
2438 2 and this cross-reference you may see
2439 \begin_inset Quotes eld
2443 \begin_inset Quotes erd
2447 \begin_inset Quotes eld
2450 on the previous page
2451 \begin_inset Quotes erd
2455 \begin_inset Quotes eld
2459 \begin_inset Quotes erd
2466 is the page number).
2469 \begin_layout Standard
2470 Conveniently, a cross-reference acts as a hyperlink when you are editing
2471 a document in LyX; clicking on it will pop up the
2478 \begin_inset space ~
2482 \begin_inset space ~
2487 will move the cursor to the referenced label.
2490 \begin_layout Subsection
2491 More fun with labels
2494 \begin_layout Standard
2495 We told you that LyX takes care of numbering cross-references; now you can
2497 Add a new section before Section
2498 \begin_inset space ~
2502 Update the preview, and — voilà! — the section cross-reference changed
2504 \begin_inset Quotes eld
2508 \begin_inset Quotes erd
2511 ! Change the section
2512 \begin_inset Quotes eld
2516 \begin_inset Quotes erd
2519 to a subsection, and the cross-reference will reference Subsection
2520 \begin_inset space ~
2523 2.1 instead of Section
2524 \begin_inset space ~
2528 The page reference will not change unless you add a whole page of text
2529 before the label, of course.
2533 \begin_layout Standard
2534 If you want some more practice with labels, then try putting a new label
2535 where your first cross-reference was, and refer to that label from elsewhere
2537 If you will be inserting cross-references often, it may be convenient to
2545 \begin_layout Standard
2546 If you want to confirm that the cross-referencing gets the pages right even
2547 for larger documents,
2551 a couple pages of text from the
2555 to the clipboard, and
2559 them into your document.
2563 \begin_layout Plain Layout
2564 By the way, copying a chapter title may cause an error, because chapters
2565 are not allowed in the article class, see Section
2566 \begin_inset space ~
2570 \begin_inset CommandInset ref
2572 reference "sec:Document-Classes"
2577 If this happens, just delete the chapter title.
2585 \begin_layout Standard
2590 : Fix the references in
2595 \begin_layout Section
2596 Footnotes and Margin Notes
2599 \begin_layout Standard
2600 Footnotes can be added using the toolbar button
2603 arg "footnote-insert"
2608 Insert\SpecialChar \menuseparator
2612 Click at the end of the word
2613 \begin_inset Quotes eld
2617 \begin_inset Quotes erd
2620 somewhere in your document and insert a footnote.
2621 A footnote box appears where you can enter the text of the footnote.
2622 LyX should place the cursor at the beginning of the footnote box.
2626 \begin_layout LyX-Code
2627 LyX is a typesetting word processor.
2630 \begin_layout Standard
2631 Now click on the button labeled
2632 \begin_inset Quotes eld
2636 \begin_inset Quotes erd
2640 The footnote box is closed, leaving the button showing where the footnote
2641 marker will be in the printed text; this is called
2642 \begin_inset Quotes eld
2646 \begin_inset Quotes erd
2650 You can unfold the footnote at any time and re-edit its text by clicking
2652 \begin_inset Quotes eld
2656 \begin_inset Quotes erd
2662 \begin_layout Standard
2663 A footnote can be cut and pasted like normal text.
2664 Go ahead; try it! All you need to do is select the footnote button
2668 \begin_layout Plain Layout
2669 It may be easier to select it using the keyboard.
2670 You might accidentally open the footnote if you are trying to select the
2671 marker itself with the mouse.
2685 In addition, you can change regular text to a footnote, by selecting it
2689 arg "footnote-insert"
2692 button; change a footnote to regular text by hitting the
2696 key when the cursor is in the first position of a footnote, or by hitting
2701 key when the cursor is in the very last position of the footnote.
2704 \begin_layout Standard
2705 Margin notes can be added using the menu
2707 Insert\SpecialChar \menuseparator
2709 \begin_inset space ~
2714 or the toolbar button
2717 arg "marginalnote-insert"
2721 Margin notes are like footnotes, except that:
2724 \begin_layout Itemize
2725 the on-screen boxes say
2726 \begin_inset Quotes eld
2730 \begin_inset Quotes erd
2734 \begin_inset Quotes eld
2738 \begin_inset Quotes erd
2744 \begin_layout Itemize
2745 the notes will be placed in the margin, instead of below the text
2748 \begin_layout Itemize
2749 margin notes are not numbered
2752 \begin_layout Standard
2753 Change your LyX footnote back to text, then select and change it to a margin
2755 Run LaTeX again to see what the margin note looks like.
2758 \begin_layout Standard
2763 : Fix the footnote in
2768 \begin_layout Section
2770 \begin_inset CommandInset label
2772 name "sec:bibliographies"
2779 \begin_layout Standard
2780 Bibliographies are similar to cross-references.
2781 The bibliography contains a list of references at the end of the document,
2782 and they can be referenced from within the document.
2783 Like section titles, LyX and LaTeX make your job easier by automatically
2784 numbering the bibliography items and changing citations when the item numbers
2788 \begin_layout Standard
2789 Go to the end of the document and switch to the
2794 Now, each paragraph you type will be a reference.
2796 \begin_inset Quotes eld
2801 The Lyx Tutorial, by the LyX Documentation Team
2804 \begin_inset Quotes erd
2807 as your first reference.
2808 Note that LyX automatically puts a number in a box before each reference.
2809 Click on the boxed reference number, and the
2812 \begin_inset space ~
2822 is to refer to this reference within the LyX document, the
2831 is set (default), you will see the number of the bibliography in the output.
2837 \begin_inset Quotes eld
2841 \begin_inset Quotes erd
2844 to make it easy to remember.
2847 \begin_layout Standard
2848 Now pick somewhere in your document that you would like to insert a reference.
2851 Insert\SpecialChar \menuseparator
2854 or the toolbar button
2857 arg "dialog-show-new-inset citation"
2866 The left panel in this dialog lists all the bibliography entries, and this
2867 field allows you to choose which bibliography item you want to cite.
2869 \begin_inset Quotes eld
2873 \begin_inset Quotes erd
2876 (right now, that is the only item in the bibliography), then use the
2880 button in the center to insert it.
2881 (You can have multiple citations in the same place by transferring a number
2886 \begin_layout Plain Layout
2887 If one uses label names for references that are easy to remember it is easier
2888 to find the entry in the list of references.
2898 Now preview your file and you will see that the citation appears in brackets
2899 in the text, referring to the bibliography at the end of the document.
2902 \begin_layout Standard
2906 \begin_inset space ~
2915 dialog will put a remark (such as a reference to a page or chapter within
2916 the referenced book or article) in the brackets after the reference.
2917 If you want the references to have labels instead of numbers in the printed
2918 output (for example, some journals would use
2919 \begin_inset Quotes eld
2923 \begin_inset Quotes erd
2926 to refer to a paper written by Smith in 1995), use the
2933 \begin_inset space ~
2946 \begin_layout Standard
2951 Fix the bibliography and citation in
2956 \begin_layout Section
2960 \begin_layout Standard
2961 You may want to put a table of contents at the beginning of your document.
2962 LyX makes this easy to do.
2967 after your document title and before your first section title and select
2970 Insert\SpecialChar \menuseparator
2972 \begin_inset space ~
2976 \begin_inset space ~
2979 TOC\SpecialChar \menuseparator
2981 \begin_inset space ~
2985 \begin_inset space ~
2992 \begin_inset Quotes eld
2996 \begin_inset Quotes erd
2999 will appear in a button on the first line of the document.
3003 \begin_layout Standard
3004 This may not appear to be very useful.
3005 However, if you look at your preview, you will see that a table of contents
3006 has been generated, listing the various sections and subsections in your
3008 As usual, if you reorder sections or create new ones, you will see those
3009 changes in the preview when you update it.
3013 \begin_layout Standard
3014 The table of contents is not printed in the on-screen version of the document.
3015 But you can display the table of contents in a separate window by clicking
3016 on the table of contents button, or by using
3018 Document\SpecialChar \menuseparator
3021 or the toolbar button
3024 arg "dialog-toggle toc"
3028 This menu will work even if you do not have a table of contents inset in
3030 This is a very useful tool for rearranging your document parts.
3031 Clicking on a (sub)section title in the
3035 window will highlight that line and move the display (in the LyX editing
3036 window) to that place in the document.
3037 You can also use the arrow keys to move up and down in the table of contents.
3038 You may therefore find it convenient to leave this window open throughout
3040 You can get similar functionality from the
3044 menu, though, where the table of contents appears automatically.
3047 \begin_layout Standard
3048 To get rid of the Table of Contents, you can delete the table of contents
3049 button just like any other text.
3052 \begin_layout Standard
3057 : Fix the table of contents in
3062 \begin_layout Chapter
3066 \begin_layout Standard
3067 LaTeX is used by many scientists because it outputs great looking equations,
3068 avoiding the control characters used by word processors and their equation
3070 Many of these scientists are frustrated, however, because writing equations
3071 in LaTeX is more like programming than writing.
3072 Happily, LyX has WYSIWYM support for equations.
3073 If you are used to LaTeX, you will find that all of the usual LaTeX math
3074 commands can be typed in normally, but they will show up in a WYSIWYM fashion.
3075 If, on the other hand, you have never written in LaTeX, then the
3078 \begin_inset space ~
3083 will allow you to write professional-looking math quickly and easily.
3086 \begin_layout Section
3090 \begin_layout Standard
3091 Somewhere in your LyX document, type:
3094 \begin_layout LyX-Code
3095 I like what Einstein said, E=mc^2, because it is so simple.
3099 \begin_layout Standard
3100 Now, that equation does not look very good in LyX and in the output; there
3101 is no space between the letters and the equals sign, and you would like
3102 to write an actual superscript for the
3103 \begin_inset Quotes eld
3107 \begin_inset Quotes erd
3111 That bad typesetting happened because we did not tell LyX that we were
3112 writing a mathematical expression, so it typeset the equation like regular
3116 \begin_layout Standard
3117 But we can create a formula that will be typeset properly.
3118 Highlight the equation and click the toolbar button
3126 Insert\SpecialChar \menuseparator
3127 Math\SpecialChar \menuseparator
3129 \begin_inset space ~
3135 If nothing is highlighted LyX inserts a little blue square, which is an
3137 The expression appears in blue and the blue square disappears as soon as
3138 the formula is not empty.
3143 to leave the equation.
3144 The purple markers disappear, leaving the cursor to the right of the expression.
3145 Now, if you type something, it will be regular text.
3148 \begin_layout Standard
3149 Looking at the output you will notice that the expression was typeset nicely,
3150 with spaces between the letters and the equals sign, and a superscript
3152 \begin_inset Quotes eld
3156 \begin_inset Quotes erd
3160 Letters in math mode are assumed to be variables, and come out in italics.
3161 Numbers are just numbers.
3164 \begin_layout Standard
3165 This math editor is another example of the WYSIWYM philosophy.
3166 In LaTeX, you write a mathematical expression using text and commands like
3173 ; this can be frustrating, because you cannot see what an expression looks
3174 like until you run the file under LaTeX and you may have to spend time,
3175 for example, finding missing brackets.
3176 LyX does not attempt to get the expression to look perfect (WYSIWYG), but
3177 it gives you an extremely good idea of what the expression will look like.
3178 LaTeX then takes care of the professional typesetting.
3181 \begin_layout Section
3182 Navigating an Equation
3185 \begin_layout Standard
3187 \begin_inset Formula $E=mc^{2}$
3191 \begin_inset Formula $E=1+mc^{2}$
3195 Use the arrow keys to move the cursor into the expression.
3196 Note that when you enter the expression, the purple markers appear to let
3197 you know you are editing math.
3206 to move the cursor past the equals sign, and just type
3207 \begin_inset Quotes eld
3211 \begin_inset Quotes erd
3215 Again, you can use the arrow keys or
3219 to leave the formula\SpecialChar \@.
3223 \begin_layout Standard
3224 Other than the special keys described below, typing in math mode is like
3225 editing regular text.
3235 Select text either with the arrow keys or with the mouse.
3238 Edit\SpecialChar \menuseparator
3241 works in math mode as well as cut and paste.
3242 One thing to be careful of: if you are left or right outside a formula
3251 respectively, you delete the whole formula.
3252 Luckily, you can just use
3259 \begin_layout Standard
3260 What if you want to change
3261 \begin_inset Formula $E=mc^{2}$
3265 \begin_inset Formula $E=mc^{2.5}+1$
3268 ? Again, you can use the mouse to click in the right place.
3269 However, you can also use the arrow keys.
3270 If the cursor is just after the
3271 \begin_inset Quotes eld
3275 \begin_inset Quotes erd
3279 \begin_inset Quotes eld
3283 \begin_inset Quotes erd
3290 and the cursor is moved to the level of the superscript, just before the
3292 \begin_inset Quotes eld
3296 \begin_inset Quotes erd
3301 \begin_inset Quotes eld
3305 \begin_inset Quotes erd
3313 will move the cursor back to the regular level.
3322 , the cursor will be placed
3326 the superscript (so that you can then type the
3327 \begin_inset Quotes eld
3331 \begin_inset Quotes erd
3337 \begin_layout Section
3338 Exponents and Indices
3341 \begin_layout Standard
3342 An exponent can be entered from the
3345 \begin_inset space ~
3350 (see below), but it is actually simpler just to type the caret key,
3351 \begin_inset Quotes eld
3355 \begin_inset Quotes erd
3359 LyX will place another blue rectangle in the superscript, so that whatever
3360 you write next will be superscripted, and in a smaller font size.
3361 Everything you type until you hit a
3369 to exit the formula entirely) will be in the superscript.
3372 \begin_layout Standard
3373 Writing a subscript (index) is just as easy; start one by typing the underscore
3375 \begin_inset Quotes eld
3379 \begin_inset Quotes erd
3383 You can subscript and superscript both subscripts and superscripts like
3385 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3392 \begin_layout Standard
3404 \begin_layout Section
3408 \begin_layout Standard
3412 \begin_inset space ~
3417 is a convenient way to enter symbols and/or to perform complicated formula
3419 Many of these operations can be accomplished from the keyboard or the
3421 Insert\SpecialChar \menuseparator
3426 Edit\SpecialChar \menuseparator
3429 menus (the latter only appears when you are in Math mode).
3430 However, we are going to concentrate on using the
3433 \begin_inset space ~
3438 , just to let you know what is out there; you can learn keyboard shortcuts
3439 and commands later from the
3446 \begin_layout Standard
3450 \begin_inset space ~
3455 is shown when the cursor is in a formula and can also be turned on manually
3458 View\SpecialChar \menuseparator
3462 When you click there on
3463 \begin_inset Quotes eld
3467 \begin_inset Quotes erd
3473 arg "toolbar-toggle math"
3476 ) the toolbar will be shown permanently at the bottom; this state is visualized
3481 menu with a checkmark.
3482 When you click in this state again on
3483 \begin_inset Quotes eld
3487 \begin_inset Quotes erd
3497 \begin_inset space ~
3502 is only shown when the cursor is within a formula; this state is visualized
3503 by the renaming of the menu entry from
3504 \begin_inset Quotes eld
3508 \begin_inset Quotes erd
3512 \begin_inset Quotes eld
3516 \begin_inset space ~
3520 \begin_inset Quotes erd
3526 \begin_layout Subsection
3530 \begin_layout Standard
3534 \begin_inset space ~
3539 allows you to choose from a large array of symbols used in math: operators,
3540 arrows, relationships, delimiters, special characters, sums and integrals.
3541 Note that subscripting and superscripting allow you to put lower and upper
3542 limits on sums and integrals.
3545 \begin_layout Subsection
3546 Roots, decorations, and delimiters
3549 \begin_layout Standard
3550 To type a square root, just click on the button
3553 arg "math-insert \\sqrt"
3557 The square root appears, and the cursor is in a new insertion point inside
3559 You can type variables, numbers, other square roots, fractions, whatever
3561 LyX will automatically resize the square root to fit what is inside.
3564 \begin_layout Standard
3566 \begin_inset Quotes eld
3570 \begin_inset Quotes erd
3574 \begin_inset Formula $\overrightarrow{a}$
3577 ) or group of characters (
3578 \begin_inset Formula $\overrightarrow{a+b}$
3581 ) is done similarly.
3582 Decorations are available from the toolbar via the button
3585 arg "math-insert \\hat"
3589 Click on a decoration, and LyX will insert that decoration with an insertion
3590 point under (or over) it.
3591 Just type what you want in the insertion point.
3592 There are two sets of decorations: those that resize with the text you
3593 type, and those that have a fixed size, and are most appropriate for a
3598 \begin_layout Standard
3599 Delimiters such as parentheses, brackets, and braces work similarly, but
3600 are a bit more complicated.
3601 Hit the delimiter button
3604 arg "dialog-show mathdelimiter"
3612 Your current selection of delimiters is displayed in a box.
3613 It is a pair of parentheses by default, but you can choose a pair of braces,
3614 a brace and a parenthesis, or choose the empty square to have something
3616 \begin_inset Quotes eld
3620 \begin_inset Formula $a=\left\langle 7\right.$
3624 \begin_inset Quotes erd
3627 (the empty delimiter is displayed as a broken line in LyX, but will not
3628 show up in the output).
3631 \begin_layout Standard
3632 If you are lazy, you can type actual parentheses in math mode, rather than
3638 However, those parentheses will be the same size as regular text, which
3639 will look bad if you have a big fraction or matrix inside the parentheses.
3640 So it is better to use one of the three delimiter buttons that insert them
3641 directly, for example
3644 arg "math-delim ( )"
3650 \begin_layout Standard
3651 You can also put delimiters or a square root sign or a decoration on already
3652 existing formula parts.
3653 Select the portion of the formula that you want to adjust, and then click
3654 on the button you want from the
3657 \begin_inset space ~
3663 Try using this to change Newton's second law from scalar to vector form
3665 \begin_inset Formula $f=ma$
3669 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3673 Once you have learned about matrices, this is how you will put parentheses
3674 or brackets around them.
3677 \begin_layout Subsection
3681 \begin_layout Standard
3682 To create a fraction, click on the fraction button
3685 arg "math-insert \\frac-square"
3691 \begin_inset space ~
3697 LyX writes two insertion points in a fraction.
3698 As you would expect, you can use arrow keys or the mouse to move around
3700 Click on the top square and type
3701 \begin_inset Quotes eld
3705 \begin_inset Quotes erd
3714 \begin_inset Quotes eld
3718 \begin_inset Quotes erd
3722 You have made a fraction! Of course you can type anything within each of
3723 the two boxes: variables with exponents, square roots, other fractions,
3728 \begin_layout Standard
3740 \begin_layout Subsection
3741 Functions: lim, log, sin and others
3744 \begin_layout Standard
3745 Because letters in math mode are considered to be variables, if you type
3747 \begin_inset Quotes eld
3751 \begin_inset Quotes erd
3754 in math mode, LyX thinks you are typing the product of the three variables
3756 \begin_inset Formula $s$
3760 \begin_inset Formula $i$
3764 \begin_inset Formula $n$
3768 The three letters will be typeset in italics, when what you really wanted
3770 \begin_inset Quotes eld
3774 \begin_inset Quotes erd
3778 In addition, LyX will not put a space between the word
3779 \begin_inset Quotes eld
3783 \begin_inset Quotes erd
3787 \begin_inset Quotes eld
3791 \begin_inset Quotes erd
3798 will exit the formula).
3800 \begin_inset Quotes eld
3804 \begin_inset Formula $\sin(x)$
3808 \begin_inset Quotes erd
3812 \begin_inset Quotes eld
3816 \begin_inset Formula $sin(x)$
3820 \begin_inset Quotes erd
3826 \begin_layout Standard
3830 \begin_inset space ~
3838 arg "math-insert \\functions"
3842 \begin_inset Quotes eld
3846 \begin_inset Quotes erd
3849 in the pop-up function list.
3851 \begin_inset Quotes eld
3855 \begin_inset Quotes erd
3858 is displayed in LyX in black, and set in upright roman type.
3859 The whole word is treated as one symbol, so if you type
3863 , it will delete the whole word.
3865 \begin_inset Quotes eld
3869 \begin_inset Quotes erd
3872 , which will be written in blue italics, like you expect in a formula.
3873 In the output, the expression will be correctly typeset.
3877 \begin_layout Standard
3878 The function list includes other trigonometric functions and their inverses,
3879 hyperbolic functions, logarithms, limits, and quite a few others.
3880 These functions can take subscripts and superscripts, important for typing
3882 \begin_inset Quotes eld
3886 \begin_inset Formula $\cos^{2}\theta$
3890 \begin_inset Quotes erd
3894 \begin_inset Quotes eld
3898 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3902 \begin_inset Quotes erd
3908 \begin_layout Standard
3920 \begin_layout Subsection
3924 \begin_layout Standard
3925 Click on the matrix button
3928 arg "dialog-show mathmatrix"
3934 \begin_inset space ~
3940 A pop-up dialog allows you to choose how many rows and columns you want
3942 Choose 2 rows and 3 columns and hit
3947 LyX prints 6 insertion points in a
3948 \begin_inset Formula $2\times3$
3952 As usual, you can put any sort of formula expression (a square root, another
3953 matrix, etc.) in each insertion point.
3954 You can also leave some of the insertion points empty if you want.
3957 \begin_layout Standard
3962 can be used to move horizontally between the columns of a matrix.
3963 Alternatively, you can use the arrow keys to move around - hitting
3967 at the end of one box will move to the next box,
3971 will move to the next row, etc.
3974 \begin_layout Standard
3975 If you need to change the number of rows and columns, use the menu
3977 Edit\SpecialChar \menuseparator
3979 \begin_inset space \thinspace{}
3983 \begin_inset space \thinspace{}
3988 or the math toolbar buttons
3991 arg "inset-modify tabular append-row"
3997 arg "inset-modify tabular delete-row"
4003 arg "inset-modify tabular append-column"
4009 arg "inset-modify tabular delete-column"
4015 \begin_layout Standard
4020 for information on how to change the horizontal alignment of each column,
4021 and how to change the vertical position of the whole matrix.
4022 Note that if you want to write a table containing text, you should use
4023 LyX's wonderful table support, rather than trying to write text in a matrix.
4026 \begin_layout Subsection
4030 \begin_layout Standard
4031 All of the expressions we have written so far have been on the same line
4032 as the text that came before and after them, otherwise known as inline
4034 This is fine for short, simple expressions, but if you want to write larger
4035 ones, or if you want your expressions to stand out from the text, you need
4036 to write them in display mode.
4037 In addition, only displayed expressions can be labeled and numbered (see
4042 ), and multi-line equations must be in display mode.
4045 \begin_layout Standard
4046 While being in a formula, click on the display button
4055 \begin_inset space ~
4061 This centers the formula and adds a blank line before and after it.
4062 Now type in an expression and compile your file to see how it looks.
4063 The display button is actually a toggle; use it now to change a couple
4064 of your expressions to display mode and back.
4068 \begin_layout Standard
4069 Display mode has a couple differences from inline mode:
4072 \begin_layout Itemize
4073 The default font is larger for a few symbols, like
4074 \begin_inset Formula $\sum$
4078 \begin_inset Formula $\int$
4084 \begin_layout Itemize
4085 Subscripts and superscripts for limits and sums (but not integrals) are
4086 written under and over rather than next to the symbols
4089 \begin_layout Itemize
4093 \begin_layout Standard
4094 Other than these differences, though, displayed expressions and inline expressio
4095 ns are very similar.
4098 \begin_layout Standard
4099 One final note about the way displayed formulas are typeset: be careful
4100 about whether you are putting your equation into a new paragraph or not.
4101 If your formula is in the middle of a sentence or paragraph, then do not
4107 Doing so will cause the text
4111 the formula to start a new paragraph.
4112 That text will be indented or follow a blank line, depending on your document
4113 paragraph settings, which is probably not what you want.
4116 \begin_layout Standard
4121 : Put the various equations in
4125 into display mode, and see how they are typeset differently.
4128 \begin_layout Standard
4133 : Using various tools you have learned in this section, you should be able
4134 to write an equation like:
4138 \begin_layout Plain Layout
4139 After you have done it the hard way, give
4141 Insert\SpecialChar \menuseparator
4142 Math\SpecialChar \menuseparator
4144 \begin_inset space ~
4155 \begin_inset Formula
4157 f(x)=\left\{ \begin{array}{cc}
4160 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0
4169 \begin_layout Section
4173 \begin_layout Standard
4174 Now you are familiar with the basics.
4175 LyX's math editor can do a lot more.
4176 You can refer to the
4180 manual for tips on how to:
4183 \begin_layout Itemize
4184 Label and number expressions.
4187 \begin_layout Itemize
4188 Create multi-line equations.
4191 \begin_layout Itemize
4192 Change typefaces, e.
4193 \begin_inset space \thinspace{}
4197 \begin_inset space \space{}
4200 to write bold-face text in an expression.
4203 \begin_layout Itemize
4204 Fine-tune font sizes and spacing within an expression.
4205 (Do not worry about this until your final draft!)
4208 \begin_layout Itemize
4210 These are very powerful, because you just define them once at the top of
4211 the document, and then you can use them throughout the document.
4214 \begin_layout Itemize
4215 Do almost all you can do with math.
4218 \begin_layout Chapter
4222 \begin_layout Section
4223 Other major LyX Features
4226 \begin_layout Standard
4227 We have not gone through all the possible commands in LyX, and we are not
4236 \begin_inset space ~
4241 manual for more information.
4242 We will just mention a couple more major things LyX can do:
4245 \begin_layout Itemize
4246 LyX has WYSIWYM support for tables.
4249 Insert\SpecialChar \menuseparator
4255 arg "tabular-insert"
4259 Click on the table with the
4266 \begin_inset space ~
4271 dialog box which allows extensive table editing.
4275 arg "toolbar-toggle table"
4278 the table toolbar will appear permanently.
4281 \begin_layout Itemize
4282 LyX also supports including pictures in any format within documents.
4285 Insert\SpecialChar \menuseparator
4291 arg "dialog-show-new-inset graphics"
4295 Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4296 can have captions, and LyX will automatically generate lists of figures
4300 \begin_layout Itemize
4301 LyX is heavily configurable.
4302 Everything from how the LyX window looks to how the output comes out can
4303 be configured in a number of ways.
4304 Much configuration is done through
4306 Tools\SpecialChar \menuseparator
4310 For more information on this, check out
4312 Help\SpecialChar \menuseparator
4313 Customization\SpecialChar \@.
4317 \begin_layout Itemize
4318 LyX is being developed by a team of programmers on five continents.
4319 Therefore, LyX has better support for non-English languages (such as Dutch,
4320 German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4321 ) than many word processors.
4322 Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4323 languages Chinese Japanese, and Korean are supported.
4324 You can write documents in other languages and you can also configure LyX
4325 to show its menus and error messages in other languages.
4329 \begin_layout Itemize
4330 The LyX menus feature keybindings.
4331 This means that you can do
4333 File\SpecialChar \menuseparator
4344 or by using the binding which is shown next to it in the menu (
4351 Keybindings are also configurable.
4352 For information on this, check out
4354 Help\SpecialChar \menuseparator
4355 Customization\SpecialChar \@.
4359 \begin_layout Itemize
4360 LyX can read LaTeX documents.
4362 \begin_inset space ~
4366 \begin_inset CommandInset ref
4368 reference "sec:tex2lyx"
4375 \begin_layout Itemize
4376 Spell-checking, thesaurus, and word count facilities are available.
4379 \begin_layout Itemize
4380 Generation of indexes and nomenclatures/glossaries is supported.
4383 \begin_layout Section
4385 \begin_inset CommandInset label
4387 name "sec:latexusers"
4394 \begin_layout Standard
4395 If you do not know anything about LaTeX, you do not have to read this section.
4396 Actually, you might want to
4400 about LaTeX, and then read this chapter.
4401 However, some of those who begin to use LyX will be familiar with LaTeX.
4402 If you are such a person, you may be wondering if LyX can really do everything
4404 The short answer is that LyX can do pretty much everything LaTeX can do
4405 in one form or another, and it definitely simplifies most parts of writing
4409 \begin_layout Standard
4410 Because this is just a tutorial, we are only going to mention things that
4411 new LyX users will most likely be interested in.
4412 In the interests of keeping the Tutorial short, we will give only minimal
4417 \begin_inset space ~
4425 \begin_inset space ~
4430 manuals have a great deal of information on differences between LyX and
4431 LaTeX, and how to do various LaTeX tricks in LyX.
4434 \begin_layout Subsection
4438 \begin_layout Standard
4439 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4440 will be displayed in red on the screen.
4441 You can use TeX commands in LyX by choosing
4443 Insert\SpecialChar \menuseparator
4445 \begin_inset space ~
4457 This creates a box where everything within it is passed straight to LaTeX.
4460 \begin_layout Standard
4461 In a math formula, TeX mode is handled a bit differently.
4462 TeX mode is entered there by typing a backslash.
4463 The backslash is not written out, but anything you type afterwards will
4465 You exit TeX mode by typing
4469 or some other non-alphabetic character, like a number, underscore, caret
4471 Once you exit TeX mode, if LyX knows the TeX command you have typed in,
4472 it will convert it to WYSIWYM\SpecialChar \@.
4474 \begin_inset Quotes eld
4484 \begin_inset Quotes erd
4487 in a formula and then press
4491 , LyX will change the red
4492 \begin_inset Quotes eld
4496 \begin_inset Quotes erd
4500 \begin_inset Quotes eld
4504 \begin_inset Formula $\gamma$
4508 \begin_inset Quotes erd
4512 This will work for almost all, non-complicated math macros.
4513 This may be faster than using the
4516 \begin_inset space ~
4521 , and will be especially convenient for experienced LaTeX users.
4524 \begin_layout Standard
4525 As a special case, if you type
4526 \begin_inset Quotes eld
4536 \begin_inset Quotes erd
4539 in a formula, the beginning
4543 ending braces will be inserted in red while the cursor is placed between
4545 This makes it more convenient to type those commands that take an argument.
4548 \begin_layout Standard
4549 LyX cannot do absolutely everything that LaTeX can do.
4550 Some fancy functions are not supported at all, while some work but are
4552 TeX mode allows users to get the full flexibility of LaTeX, while having
4553 all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4554 LyX could never support every LaTeX package.
4561 in the preamble (see Section
4562 \begin_inset space ~
4566 \begin_inset CommandInset ref
4568 reference "sec:preamble"
4572 ), you can use any package you want — although you will not have WYSIWYM
4573 support for that package's features.
4576 \begin_layout Subsection
4577 Importing LaTeX Documents —
4582 \begin_inset CommandInset label
4591 \begin_layout Standard
4592 You can import a LaTeX file into LyX by using the
4594 File\SpecialChar \menuseparator
4595 Import\SpecialChar \menuseparator
4597 \begin_inset space ~
4603 This will call the program
4607 which will create a file foo.lyx from the file foo.tex.
4608 LyX will then open that file.
4609 If the translation does not work, you can try calling
4613 from the command line, possibly using fancier options.
4616 \begin_layout Standard
4617 Even when the translation does work,
4621 may not translate everything, though it does handle most legal LaTeX.
4622 It will leave things it does not understand in TeX mode; so, after translating
4627 , you can look for the red text and manually edit it to get it right.
4630 \begin_layout Standard
4635 has its own documentation (manpage), which Unix/Linux users can access
4636 via the console command
4639 \begin_inset space ~
4645 The manpage describes which LaTeX commands and environments are not supported,
4646 what bugs you might run into (and how to get around them), and how to use
4647 the various options.
4650 \begin_layout Standard
4651 It is important to understand that
4655 can only translate files whose document class is
4656 \begin_inset Quotes eld
4660 \begin_inset Quotes erd
4663 to LyX, that is, for which there is a corresponding LyX
4668 If there is no layout file, then you will get an error saying that the
4669 conversion could not be performed.
4670 So, unless you have a layout for the document class of your LaTeX file,
4675 simply will not know how to translate the LaTeX that it finds there into
4676 things LyX understands.
4677 More about layout files and how they are created is explained in detail
4685 \begin_layout Subsection
4686 Converting LyX Documents to LaTeX
4689 \begin_layout Standard
4690 You might wish to convert a LyX Document to a LaTeX file.
4691 For example, a co-worker or co-author who does not have LyX might want
4695 File\SpecialChar \menuseparator
4696 Export\SpecialChar \menuseparator
4700 This will create a file
4708 file you are editing.
4711 \begin_layout Subsection
4715 \begin_layout Subsubsection
4719 \begin_layout Standard
4722 Document\SpecialChar \menuseparator
4725 dialog takes care of the document-wide options, such as changing the document
4726 class, default font size and paper size.
4727 Document class options and also options for LaTeX packages can be entered
4731 \begin_inset space ~
4739 \begin_layout Subsubsection
4740 Other Preamble Matter
4741 \begin_inset CommandInset label
4750 \begin_layout Standard
4751 If you have special commands to put in the preamble of a LaTeX file, you
4752 can use them in a LyX document as well.
4755 Document\SpecialChar \menuseparator
4756 Settings\SpecialChar \menuseparator
4758 \begin_inset space ~
4763 and type in the dialog window (or from the document settings dialog, depending
4765 Anything you type will (as with TeX mode) be sent directly to LaTeX.
4768 \begin_layout Subsection
4772 \begin_layout Standard
4773 LyX has support for BibTeX, which allows you to build databases of bibliographic
4774 al references to be used in multiple documents.
4777 Insert\SpecialChar \menuseparator
4779 \begin_inset space \thinspace{}
4783 \begin_inset space \thinspace{}
4786 TOC\SpecialChar \menuseparator
4788 \begin_inset space ~
4802 field you load BibTeX files, in the
4806 field you can load BibTeX style files.
4809 \begin_layout Standard
4810 After you have done this, you can use citations from any bibliographies
4811 you have included with
4813 Insert\SpecialChar \menuseparator
4817 \begin_inset space ~
4821 \begin_inset CommandInset ref
4823 reference "sec:bibliographies"
4832 dialog will show a list of all the references in your
4839 \begin_layout Section
4843 \begin_layout Standard
4844 Sometimes when you try to view a document, there will be errors, things
4845 that LyX or LaTeX cannot understand.
4846 When this happens, LyX will open a
4849 \begin_inset space ~
4855 Clicking on individual errors in this dialog will take you to the place
4856 in the LyX document where the error occurs and also display the detailed
4857 LaTeX error message.