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
117 If you have comments or error corrections, please send them to the LyX Documenta
121 \begin_inset CommandInset href
123 target "lyx-docs@lists.lyx.org"
138 \begin_layout Standard
139 \begin_inset CommandInset toc
140 LatexCommand tableofcontents
147 \begin_layout Chapter
151 \begin_layout Section
155 \begin_layout Standard
156 This file is designed for all of you who have never heard of LaTeX, or do
157 not know it very well.
158 Now, do not panic - you will not need to learn LaTeX to use LyX.
159 That is, after all, the whole point of LyX: to provide an almost-WYSIWYG
161 There are some things you will need to learn, however, in order to use
165 \begin_layout Standard
166 Some of you probably found your way to this document because you tried to
167 put two spaces after a
168 \begin_inset Quotes eld
172 \begin_inset Quotes erd
175 or tried to put three blank lines between paragraphs.
176 You found out you could not and in fact, you will find out that most of
177 the little tricks you are accustomed to use in other word processors will
179 That is because most word processors you have used before allow you to
180 manually enter all spacings, font changes, and so on.
181 So you end up not only writing a document but typesetting it, too.
182 LyX does the typesetting for you, in a consistent fashion, letting you
183 focus on the important things, like the content of your writing.
186 \begin_layout Standard
187 So read on to learn more about LyX.
188 Reading this tutorial is definitely worth the time.
191 \begin_layout Section
201 \begin_layout Standard
202 Before we get started with this section, we want to make a quick note of
208 uses the notation outlined in the
213 If you came to this manual first, please read the
217 before you continue with the
224 \begin_layout Standard
225 Now that you know which fonts mean what, we want to talk a bit about what
233 \begin_layout Subsection
234 Getting the most out of the Tutorial
237 \begin_layout Standard
238 This tutorial consists of examples and exercises.
239 To get the most out of this document, you should read through the it, typing
240 all the little things we are telling you to type and trying out all of
241 the exercises to see if you get them right.
242 For convenience, you might want to print out the PDF version of this document.
245 \begin_layout Standard
246 If you are familiar with LaTeX, you will probably be able to read the
250 somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
251 However, LyX has features you will want to learn about.
252 Even if you do not feel like reading the rest of the
256 , you should definitely check out Section
261 \begin_inset CommandInset ref
263 reference "sec:latexusers"
267 , which is specifically written for experienced LaTeX users.
270 \begin_layout Subsection
278 \begin_layout Itemize
279 Detailed explanations of all of LyX's features.
283 \begin_layout Standard
292 \begin_layout Itemize
293 Detailed explanations of LaTeX.
297 \begin_layout Standard
299 If you want to learn some of the neat tricks you can do with LaTeX in LyX,
300 you can have a look at the
312 \begin_layout Standard
313 It is time to move onwards, time for your first document \SpecialChar \ldots{}
317 \begin_layout Chapter
318 Getting started with LyX
321 \begin_layout Section
322 Your first LyX document
325 \begin_layout Standard
327 You are ready to start writing.
328 Before you do, there are a few things we need to mention, which will hopefully
329 make the Tutorial more instructive and useful.
333 \begin_layout Standard
334 Because there is information we cannot give you in the Tutorial, the
340 thing that you need to do is find the
347 Start up LyX, Choose the
356 You may want to load the
360 as well (if you are not reading it within LyX already).
361 This way, you can read them while you are writing your own file.
365 \begin_layout Plain Layout
366 They can also serve as good examples of how to use the many features of
372 Note that once you have got more than one document open, you can use the
377 menu or the document tabs to switch between them.
380 \begin_layout Standard
381 In this Tutorial, we are going to assume that you have a fully working version
382 of LyX, as well as a LaTeX-distribution and a PDF-viewer.
383 This should be the case on all major Linux- and BSD-distributions, as well
384 as on Windows, where this is setup by the LyX installers.
387 \begin_layout Standard
388 Finally, we have written a file called
392 to let you practice your LyX skills.
393 Imagine that it was typed by someone who did not know about any of LyX's
395 As you learn new LyX functions, we will suggest that you fix those parts
401 It also contains `subtle' hints about how to fix things.
405 \begin_layout Plain Layout
406 The hints are located in yellow
407 \begin_inset Quotes eld
411 \begin_inset Quotes erd
415 Access the text in a note by clicking on it.
420 If you want to cheat, or check what you have done, there is also a file
425 which contains the same text written and typeset by a LyX master.
428 \begin_layout Standard
429 The example files can be found in the
433 directory of LyX's installation folder.
434 Open the raw document, and use
436 File\SpecialChar \menuseparator
443 to save a copy in your own directory for you to work on.
444 As you fix parts of the raw document, check to see how those changes affect
448 \begin_layout Standard
453 directory contains lots of other examples files.
454 They will show you how to do various fancy things with LyX.
455 After you have read the Tutorial, or when you are confused about how to
456 do something fancy in LyX, take a look at these files.
459 \begin_layout Subsection
460 Typing, Viewing, and Exporting
463 \begin_layout Itemize
466 File\SpecialChar \menuseparator
470 \begin_layout Itemize
471 Type a sentence like:
473 This is my first LyX document!
476 \begin_layout Itemize
477 Save your document with
479 File\SpecialChar \menuseparator
488 \begin_layout Itemize
489 Create a PDF file, with
491 View\SpecialChar \menuseparator
494 or the toolbar button
505 LyX will open a PDF-viewer program displaying your document as it will
510 \begin_layout Plain Layout
511 You can save time by leaving the PDF-viewer running in the background.
514 View\SpecialChar \menuseparator
517 or the toolbar button
527 and just click on the PDF-viewer window (or unminimize it) afterwards.
535 \begin_layout Itemize
536 Export the ready to print document with
538 File\SpecialChar \menuseparator
546 \begin_layout Standard
547 Congratulations! You have written your first LyX document.
548 All of the rest is just details, which are covered in the other manuals.
551 \begin_layout Subsection
555 \begin_layout Standard
556 LyX can of course do most of the things you are used to doing with a word
558 It will word-wrap and indent paragraphs automatically.
559 Here is a quick description of how to do some simple actions.
562 \begin_layout Description
563 Undo LyX has multiple levels of undo, which means you can undo everything
564 you have done since your current editing session started, by selecting
567 Edit\SpecialChar \menuseparator
580 ) over and over again.
581 If you undo too much, just select
583 Edit\SpecialChar \menuseparator
600 \begin_layout Standard
601 Currently, undo is limited to 100 steps.
605 \begin_layout Description
608 Edit\SpecialChar \menuseparator
623 Edit\SpecialChar \menuseparator
638 Edit\SpecialChar \menuseparator
652 \begin_inset Graphics
653 filename ../images/paste.png
658 ) to cut, copy, and paste.
659 Or automatically paste selected text (including selections from other programs)
667 \begin_layout Description
670 Edit\SpecialChar \menuseparator
686 arg "dialog-show findreplace"
692 In the dialog, search with the
704 button to replace a word you have found.
708 \begin_layout Plain Layout
709 Close the window when you are done or leave it open if you find it more
711 Most dialog boxes in LyX can operate like this.
712 Just be sure you have the right window in focus when you are trying to
713 type in the main LyX window or a LyX dialog.
718 If you like, you can specify whether to make the search case-sensitive,
719 or to search for only complete words; you can also search backwards through
723 \begin_layout Description
732 text (which will by default print characters in italics), set it in
740 (usually small caps, used for people's names), or use your own formatting
743 Edit\SpecialChar \menuseparator
750 dialog (toolbar button
755 arg "dialog-show character"
763 \begin_layout Description
764 Toolbar There are buttons on the toolbar (just below the menus) which allow
765 you to do some of the more popular functions, such as
776 \begin_layout Standard
777 Of course, you have not yet written enough to make most of these functions
779 As you write more, though, try undoing, pasting, etc.
782 \begin_layout Subsection
783 WYSIWYM: Whitespace in LyX
786 \begin_layout Standard
787 One of the hardest things for new users to get used to is the way that LyX
789 As many times as you hit
793 , you will only get one blank line.
794 As many times as you hit
798 , you will only get one space.
799 On a blank line, LyX will not let you type even one space.
804 key will not move you forward one tab stop; in fact there
808 no tab stops! There is no ruler at the top of the page to let you set tabs
812 \begin_layout Standard
813 Many word processors are based on the WYSIWYG principle:
814 \begin_inset Quotes eld
817 What You See Is What You Get.
818 \begin_inset Quotes erd
821 LyX, on the other hand, is based on the principle that
822 \begin_inset Quotes eld
825 What You See Is What You
830 \begin_inset Quotes erd
833 You type what you mean, and LyX will take care of typesetting it for you,
834 so that the output looks nice.
839 grammatically separates paragraphs, and a
843 grammatically separates words, so there is no reason to have several of
848 has no grammatical function at all, so LyX does not support it.
849 Using LyX, you will spend more of your time worrying about the
853 of your document, and less time worrying about the
862 for more information on the WYSIWYM concept.
865 \begin_layout Standard
866 LyX does have (many) ways to fine-tune the formatting of your document.
867 After all, LyX might not typeset
876 has information about all that.
877 It includes horizontal fills and vertical space — which are more powerful
878 and versatile than multiple spaces or blank lines — and ways to change
879 font sizes, character styles, and paragraph alignments by hand.
880 The idea, though, is that you can write your whole document, focusing on
881 content, and just worry about that fine-tuning at the end.
882 With standard word processors, you will be distracted by document formatting
883 throughout the writing process.
886 \begin_layout Section
890 \begin_layout Standard
891 Different parts of a document have different purposes; we call these parts
897 Most of a document is made up of regular text.
898 Section titles (chapter, subsection, etc.) let the reader know that a new
899 topic or subtopic will be discussed.
900 Certain types of documents have special environments.
901 A journal article will have an abstract and a title.
902 A letter will have neither of these, but will probably have an environment
903 that gives the writer's address.
906 \begin_layout Standard
907 Environments are a major part of the
908 \begin_inset Quotes eld
911 What You See Is What You Mean
912 \begin_inset Quotes erd
916 A given environment may require a certain font style, font size, indenting,
917 line spacing, and more.
918 This problem is aggravated, because the exact formatting for a given environmen
919 t may change: one journal may use boldface, 18 point, centered type for
920 section titles while another uses italicized, 15 point, left justified
921 type; different languages may have different standards for indenting; and
922 bibliography formats can vary widely.
923 LyX lets you avoid learning all the different formatting styles.
926 \begin_layout Standard
931 choice box is located on the left end of the toolbar and looks like this:
933 \begin_inset Graphics
934 filename clipart/ToolbarEnvBox.png
941 It indicates in which environment you are currently writing.
942 While you were writing your first document, it said
943 \begin_inset Quotes eld
947 \begin_inset Quotes erd
950 which is the default environment for text.
951 Now you will put a number of environments in your new document so that
952 you can see how they work.
955 \begin_layout Subsection
956 Sections and Subsections
959 \begin_layout Standard
964 on the first line of your LyX file, and select
976 \begin_layout Plain Layout
982 If nothing is selected, LyX changes the paragraph you are currently in
983 to the selected environment.
984 Alternatively, you can change several paragraphs to a different environment
985 by selecting them before picking an environment.
1002 , which will be covered below.
1003 LyX numbers the section
1004 \begin_inset Quotes eld
1008 \begin_inset Quotes erd
1011 and typesets the section heading (title) in a larger font.
1022 \begin_inset Quotes eld
1026 \begin_inset Quotes erd
1030 \begin_inset Quotes eld
1034 \begin_inset Quotes erd
1038 Section headings, like most environments, are assumed to end when you type
1044 Type the document introduction:
1047 \begin_layout LyX-Code
1048 This is an introduction to my first LyX document.
1051 \begin_layout Standard
1066 \begin_inset Quotes eld
1070 \begin_inset Quotes erd
1073 and waits for you to type a title.
1075 \begin_inset Quotes eld
1081 \begin_inset space ~
1087 \begin_inset Quotes erd
1090 , and you will see that LyX again sets it as a section title.
1093 \begin_layout Standard
1095 Go to the end of Section
1096 \begin_inset space ~
1100 \begin_inset Quotes eld
1103 my first LyX document
1104 \begin_inset Quotes erd
1121 \begin_inset Quotes eld
1125 \begin_inset Quotes erd
1128 and waits for you to type a title.
1135 \begin_inset space ~
1139 \begin_inset Quotes eld
1143 \begin_inset Quotes erd
1147 \begin_inset space ~
1150 2, has been automatically renumbered to Section
1151 \begin_inset space ~
1154 3! In true WYSIWYM fashion, you just need to identify the text that makes
1155 up the section titles, and LyX takes care of numbering the sections and
1159 \begin_layout Standard
1168 environment, and type the following five lines:
1171 \begin_layout LyX-Code
1172 Sections and subsections are described below.
1175 \begin_layout LyX-Code
1179 \begin_layout LyX-Code
1180 Sections are bigger than subsections.
1183 \begin_layout LyX-Code
1184 Subsection description
1187 \begin_layout LyX-Code
1188 Subsections are smaller than sections.
1191 \begin_layout Standard
1192 Click on the second line and select
1201 LyX numbers the subsection
1202 \begin_inset Quotes eld
1206 \begin_inset Quotes erd
1209 , and typesets it in a font which is bigger than regular text but smaller
1210 than the section title.
1211 Change the fourth line to the
1215 environment as well.
1216 As you probably expected, LyX automatically numbered the section
1217 \begin_inset Quotes eld
1221 \begin_inset Quotes erd
1225 If you put yet another section before Section
1226 \begin_inset space ~
1230 \begin_inset space ~
1233 2 will be renumbered as Section 3, and the subsections will be renumbered
1235 \begin_inset Quotes eld
1239 \begin_inset Quotes erd
1243 \begin_inset Quotes eld
1247 \begin_inset Quotes erd
1253 \begin_layout Standard
1254 Further levels of sectioning include
1267 We will let you play with these on your own.
1268 You may notice that paragraph and subparagraph headings are not numbered
1269 by default, and that subparagraphs are indented; see the
1273 for an explanation and how to change this.
1278 headings are actually the highest level of sectioning, above
1282 s, but you are only allowed to use them in certain types (text classes)
1283 of LyX documents (see Section
1284 \begin_inset space ~
1288 \begin_inset CommandInset ref
1290 reference "sec:Document-Classes"
1298 \begin_layout Standard
1299 Finally, you may want to have sections or subsections that are not numbered.
1300 There are environments for this as well.
1301 If you change one of your section headings to the
1305 environment (you may have to scroll down in the
1309 box to find it), LyX will use the same font size for the heading as it
1310 uses for a regular section, but it will not number that section.
1311 There are corresponding
1312 \begin_inset Quotes eld
1316 \begin_inset Quotes erd
1319 heading environments for
1328 Try changing some of your sections or subsections to the starred environments,
1329 and note how the other section numbers are updated.
1332 \begin_layout Standard
1337 : Fix the section and subsection headings in
1345 \begin_layout Subsection
1349 \begin_layout Standard
1350 LyX has several different environments for typesetting lists.
1351 The various list environments free you from hitting
1355 a million times when writing an outline, or from renumbering a whole list
1356 when you want to add a point in the middle of the list.
1357 Different types of documents logically require different list environments:
1360 \begin_layout Itemize
1361 A slide presentation might use the
1365 environment's bulleted lists to describe different points.
1368 \begin_layout Itemize
1369 An outline would use the
1373 environment's numbered lists (and lettered sublists).
1376 \begin_layout Itemize
1377 A document describing several software packages could use the
1381 environment, where each item in the list begins with a bold-faced word.
1384 \begin_layout Itemize
1389 environment is a variation on the
1396 \begin_layout Standard
1397 Let us write a list of reasons why LyX is better than other word processors.
1398 Somewhere in your document, type:
1401 \begin_layout Standard
1404 LyX is better than other word processors because:
1407 \begin_layout Standard
1426 arg "layout Itemize"
1433 \begin_inset Quotes eld
1437 \begin_inset Quotes erd
1441 Type in your reasons:
1444 \begin_layout LyX-Code
1445 Typesetting is done for you.
1448 \begin_layout LyX-Code
1452 \begin_layout LyX-Code
1453 Lists are very easy to create!
1456 \begin_layout Standard
1457 List environments, unlike headings, do not end when you type
1462 Instead, LyX assumes you are going on to the next item in the list.
1463 The above will therefore result in a three-item list.
1464 If you want more than one paragraph within one list
1468 , one way is to use the
1471 \begin_inset space ~
1476 , which you get by typing
1481 In order to get out of the list, you need to reselect the
1485 environment (or just use the key binding,
1488 \begin_inset space ~
1496 \begin_layout Standard
1497 You have got a beautiful itemized list.
1498 You might want to run LaTeX to see how the list looks when printed out.
1499 But what if you wanted to number the reasons? Well, just select the whole
1504 \begin_layout Plain Layout
1505 LyX will not let you select the first bullet unless you also select the
1510 the list, which you probably do not want to do.
1511 Similarly, you cannot select the actual number in a numbered section title.
1512 This is on purpose because the bullet or number depends on the document
1513 settings or text position, respectively.
1531 arg "layout Enumerate"
1537 Pow! As we mentioned, if you add or delete a list item, LyX will fix the
1541 \begin_layout Standard
1542 While the list is still selected, you can change to the other two list environme
1556 arg "layout Description"
1571 ), in order to see what they look like.
1572 For those two environments, each list item is made up of a term, which
1573 is the item's first word, followed by a definition, which is the rest of
1574 the paragraph (until you hit
1579 The term is either typeset in boldface (
1584 \begin_inset Quotes eld
1588 \begin_inset Quotes erd
1595 \begin_layout Plain Layout
1596 But a typesetter's tab, which will change to fit the size of the largest
1597 term, not a pathetic, rigid, unchangeable typewriter
1610 ) from the rest of the paragraph.
1611 If you want to have more than one word in the definition, then separate
1615 \begin_inset space ~
1623 \begin_layout Standard
1628 : Typeset the list in
1633 \begin_layout Standard
1634 You can nest lists within each other in all sorts of interesting ways.
1635 An obvious example would be writing outlines.
1636 Numbered and bulleted lists will have different numbering and bulleting
1637 schemes for sublists.
1642 for details on the different sorts of lists and for examples of nestings.
1645 \begin_layout Subsection
1646 Other environments: Verses, Quotations, and more
1649 \begin_layout Standard
1650 There are two environments for setting quotations apart from surrounding
1655 for short quotes and
1668 \begin_layout Plain Layout
1669 used in this Tutorial for the long typing examples
1678 font; this environment is the only place in LyX where you are allowed to
1679 use multiple spaces to allow code indenting.
1680 You can even write poetry using the
1688 to separate stanzas, and
1692 to separate lines within a stanza.
1697 for more complete descriptions of all of the available LyX environments.
1700 \begin_layout Standard
1705 : Correctly typeset the
1714 \begin_inset Newline newline
1722 \begin_layout Chapter
1726 \begin_layout Standard
1727 The previous chapter hopefully allowed you to get used to writing in LyX.
1728 It introduced you to the basic editing operations in LyX, as well as the
1729 powerful method of writing with environments.
1730 Most people who use LyX, though, will want to write documents: papers,
1731 articles, books, manuals, or letters.
1732 This chapter is meant to take you from simply writing text with LyX to
1733 writing a complete document.
1734 It will introduce you to text classes, which allow you to write different
1736 It will then describe many of the additions that turn text into a document,
1737 such as titles, footnotes, cross references, bibliographies, and tables
1741 \begin_layout Section
1743 \begin_inset CommandInset label
1745 name "sec:Document-Classes"
1752 \begin_layout Standard
1753 Different sorts of documents should be typeset differently.
1754 For example, books are generally printed double-sided, while articles are
1756 In addition, many documents contain special environments: letters contain
1757 some environments — such as the sender's address and the signature — which
1758 do not make sense in a book or article.
1767 \begin_layout Plain Layout
1768 for LaTeX users: this is equivalent to the LaTeX document class
1773 takes care of these large scale differences between different sorts of
1775 This Tutorial, for example, was written in the
1780 Document classes are another major part of the WYSIWYM philosophy; they
1781 tell LyX how to typeset the document, so you do not need to know how.
1784 \begin_layout Standard
1785 Your document is probably being written in the
1793 \begin_layout Plain Layout
1794 That is usually the default document class
1799 Try changing to other document classes (using the
1801 Document\SpecialChar \menuseparator
1804 dialog) to see how they are typeset differently.
1805 If you change your document to the
1809 document class and look at the
1813 box, you will see that most of the allowed environments are the same.
1814 However, you can now use the
1819 If you are ever unsure about which environments you can use in a given
1820 document class, just consult the
1827 \begin_layout Standard
1828 Font sizes, one- or two-column printing, and page headings are just some
1829 of the ways journals' typesettings differ from one another.
1830 As the Computer Age continues to mature, journals have begun accepting
1831 electronic submissions, creating LaTeX
1832 \begin_inset Quotes eld
1836 \begin_inset Quotes erd
1839 so that authors can submit correctly typeset articles.
1840 LyX is set up to support this as well.
1841 For example, LyX supports typesetting (and extra environments) for the
1842 American Mathematics Society journals using the
1845 \begin_inset space ~
1853 \begin_layout Standard
1854 Here is a very quick reference to some of the document classes.
1857 Special Document Classes
1863 manual for many more details.
1866 \begin_layout Standard
1868 \begin_inset Tabular
1869 <lyxtabular version="3" rows="7" columns="2">
1870 <features tabularvalignment="middle">
1871 <column alignment="center" valignment="top" width="0pt">
1872 <column alignment="center" valignment="top" width="0pt">
1874 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1877 \begin_layout Plain Layout
1883 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1886 \begin_layout Plain Layout
1894 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1897 \begin_layout Plain Layout
1903 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1906 \begin_layout Plain Layout
1907 one-sided, no chapters
1914 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1917 \begin_layout Plain Layout
1923 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1926 \begin_layout Plain Layout
1927 layout & environments for American Math Society
1934 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1937 \begin_layout Plain Layout
1943 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1946 \begin_layout Plain Layout
1947 longer than article, two-sided
1954 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1957 \begin_layout Plain Layout
1963 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1966 \begin_layout Plain Layout
1967 report + front and back matter
1974 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1977 \begin_layout Plain Layout
1983 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1986 \begin_layout Plain Layout
1994 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1997 \begin_layout Plain Layout
2003 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
2006 \begin_layout Plain Layout
2007 lots of extra environments for address, signature\SpecialChar \ldots{}
2021 \begin_layout Section
2022 Templates: Writing a Letter
2025 \begin_layout Standard
2026 One way to write a letter would be to open a new file, and choose a
2032 Document\SpecialChar \menuseparator
2036 While this is the most obvious way to write a letter, it seems like extra
2038 Every time you write a business letter, you want to have your address,
2039 the address to which you are sending it, a body, a signature, etc.
2044 for letters, which contains a sample letter; once you have a template,
2045 you can just replace a couple of parts of the letter with your text each
2046 time you write a letter.
2049 \begin_layout Standard
2050 Open a new file with
2052 File\SpecialChar \menuseparator
2054 \begin_inset space ~
2058 \begin_inset space ~
2069 Save and print the file to see how the various environments are typeset.
2072 \begin_layout Standard
2073 When you look at the
2077 box, you will see several environments, like the
2080 \begin_inset space ~
2085 environment, that do not exist in most other document classes.
2091 You can play around for a while to figure out how the various environments
2093 You will notice for example that the
2097 environment has the word
2098 \begin_inset Quotes eld
2102 \begin_inset Quotes erd
2105 in red before the actual text of the signature.
2106 This word does not show up in the actual letter, as you will see if you
2107 view/export the file.
2108 It is just there to let you know where the signature goes.
2109 Also, note that it does not matter where in the file the
2114 Remember, LyX is WYSIWYM; you can put the
2118 environment anywhere you want, but LyX knows that in the printout, the
2119 signature should be at the end.
2122 \begin_layout Standard
2123 A template is just a regular LyX file.
2124 This means you can fill in your address and signature and save the file
2126 From now on, any time you want to write a letter, you can use the new template
2128 We do not have to suggest an actual
2129 \begin_inset Quotes eld
2133 \begin_inset Quotes erd
2136 here; just write a letter to someone!
2140 \begin_layout Plain Layout
2141 One warning, if you are writing from a template.
2142 If you erase all of the text in an environment — for example, if you erase
2146 \begin_inset space ~
2151 field so that you can replace it with your own — and then you move the
2152 cursor without writing any text, the environment may disappear.
2153 This is because most environments cannot exist without any text in them.
2154 Just reselect the environment from the
2166 \begin_layout Standard
2167 Templates can be a huge time-saver, and we urge you to use them whenever
2169 In addition, they can help a person learn how to use some of the fancier
2171 Finally, they may be useful for a person who is configuring LyX for a bunch
2172 of less computer-aware users.
2173 When they are first learning LyX, it will be less intimidating if they
2174 have a letter template customized for their company, for example.
2177 \begin_layout Section
2181 \begin_layout Standard
2182 LyX (like LaTeX) considers the title — which may contain the actual title,
2183 the author, the date, and even an abstract of a paper — to be a separate
2184 part of the document.
2187 \begin_layout Standard
2188 Go back to your LyX document and make sure it is using the
2196 \begin_layout Plain Layout
2197 You should not be using the letter any more, since the
2201 document class does not allow titles.
2206 Type a title on the first line, and change the line to the
2211 On the next line, type your name and change it to the
2216 On the next line, write the date in the
2221 Type a paragraph or two summarizing your document using the
2226 Notice how the title is presented when it is printed out.
2227 If you change the document format to Book, you will get a separate title
2228 page, like the first page of this tutorial.
2231 \begin_layout Standard
2236 : Fix the title, date, and author in
2241 \begin_layout Section
2242 Labels and Cross-References
2245 \begin_layout Standard
2246 You can label section headings, list items, formulas, footnotes, and floats
2250 \begin_layout Plain Layout
2251 Floats are explained in the
2265 Once you do so, you can refer to this section in other parts of the document,
2266 using cross-references.
2267 You can refer either to the section's number, or to the page that the section
2269 As with section numbering, LyX also takes care of cross-reference numbering
2271 Automatic management of labels and cross-references is among the most significa
2272 nt advantages of LyX (and LaTeX) over conventional word processors.
2275 \begin_layout Subsection
2279 \begin_layout Standard
2280 Go to our second section, whose title is
2281 \begin_inset Quotes eld
2285 \begin_inset Quotes erd
2289 Click at the end of the section title line, and select
2291 Insert\SpecialChar \menuseparator
2294 or the toolbar button
2305 A dialog asks you for a label name, and gives you a suggestion.
2310 , the label name will be placed in a box next to the section title.
2313 \begin_layout Standard
2314 So far you have not done anything — the DVI output will look exactly the
2315 same, since labels do not show up in the printed document.
2316 However, now that you have added a label, you can refer to that label with
2318 We will do that next.
2321 \begin_layout Subsection
2322 Your first cross-reference
2325 \begin_layout Standard
2326 Place the cursor somewhere in Section
2327 \begin_inset space ~
2334 \begin_layout LyX-Code
2335 If you want to know more about this document, then see
2336 \begin_inset Newline newline
2339 Section, which can be found on page.
2342 \begin_layout Standard
2343 Now — with the cursor after the word
2344 \begin_inset Quotes eld
2348 \begin_inset Quotes erd
2353 Insert\SpecialChar \menuseparator
2355 \begin_inset space ~
2360 or the toolbar button
2365 arg "dialog-show-new-inset ref"
2371 The Cross-reference dialog pops up.
2372 It shows a list of the possible labels you can reference.
2373 At the moment, there should be only one,
2374 \begin_inset Quotes eld
2377 sec:About-This-Document
2378 \begin_inset Quotes erd
2382 First, select the drop-down menu labeled
2383 \begin_inset Quotes eld
2387 \begin_inset Quotes erd
2391 \begin_inset Quotes eld
2394 <reference> on page <page>
2395 \begin_inset Quotes erd
2400 \begin_inset Quotes eld
2403 sec:About-This-Document
2404 \begin_inset Quotes erd
2407 (it may be selected by default), and a reference marker will appear containing
2409 \begin_inset Quotes eld
2412 Ref+Text: sec:About-This-Document
2413 \begin_inset Quotes erd
2416 (To be really correct, you should put a
2419 \begin_inset space ~
2425 \begin_inset Quotes eld
2429 \begin_inset Quotes erd
2433 An alternative way to reference a label is to right-click the label and
2438 in the appearing context menu.
2439 The cross-reference to this label is now in the clipboard and can be copied
2440 to the actual cursor position via the menu
2442 Edit\SpecialChar \menuseparator
2450 In the printed document, this reference marker will be replaced with the
2451 section number and then the page number.
2452 View your document as DVI, and you will see that LaTeX has been even cleverer
2455 \begin_inset Quotes eld
2459 \begin_inset Quotes erd
2462 and depending how much text you have between the start of Section
2463 \begin_inset space ~
2466 2 and this cross-reference you may see
2467 \begin_inset Quotes eld
2471 \begin_inset Quotes erd
2475 \begin_inset Quotes eld
2478 on the previous page
2479 \begin_inset Quotes erd
2483 \begin_inset Quotes eld
2487 \begin_inset Quotes erd
2494 is the page number).
2497 \begin_layout Standard
2498 Conveniently, a cross-reference acts as a hyperlink when you are editing
2499 a document in LyX; clicking on it will pop up the
2506 \begin_inset space ~
2510 \begin_inset space ~
2515 will move the cursor to the referenced label.
2518 \begin_layout Subsection
2519 More fun with labels
2522 \begin_layout Standard
2523 We told you that LyX takes careof numbering cross-references; now you can
2525 Add a new section before Section
2526 \begin_inset space ~
2530 Update the DVI view, and — voilà ! — the section cross-reference changed
2532 \begin_inset Quotes eld
2536 \begin_inset Quotes erd
2539 ! Change the section
2540 \begin_inset Quotes eld
2544 \begin_inset Quotes erd
2547 to a subsection, and the cross-reference will reference Subsection
2548 \begin_inset space ~
2551 2.1 instead of Section
2552 \begin_inset space ~
2556 The page reference will not change unless you add a whole page of text
2557 before the label, of course.
2561 \begin_layout Standard
2562 If you want some more practice with labels, then try putting a new label
2563 where your first cross-reference was, and refer to that label from elsewhere
2565 If you will be inserting cross-references often, it may be convenient to
2573 \begin_layout Standard
2574 If you want to confirm that the cross-referencing gets the pages right even
2575 for larger documents,
2579 a couple pages of text from the
2583 to the clipboard, and
2587 it into your document.
2591 \begin_layout Plain Layout
2592 By the way, copying a chapter title may cause an error, because chapters
2593 are not allowed in the article class, see Section
2594 \begin_inset space ~
2598 \begin_inset CommandInset ref
2600 reference "sec:Document-Classes"
2605 If this happens, just delete the chapter title.
2613 \begin_layout Standard
2618 : Fix the references in
2623 \begin_layout Section
2624 Footnotes and Margin Notes
2627 \begin_layout Standard
2628 Footnotes can be added using the toolbar button
2633 arg "footnote-insert"
2640 Insert\SpecialChar \menuseparator
2644 Click at the end of the word
2645 \begin_inset Quotes eld
2649 \begin_inset Quotes erd
2652 somewhere in your document and insert a footnote.
2653 A footnote box appears where you can enter the text of the footnote.
2654 LyX should place the cursor at the beginning of the footnote box.
2658 \begin_layout LyX-Code
2659 LyX is a typesetting word processor.
2662 \begin_layout Standard
2663 Now click on the button labeled
2664 \begin_inset Quotes eld
2668 \begin_inset Quotes erd
2672 The footnote box is closed, leaving the button showing where the footnote
2673 marker will be in the printed text; this is called
2674 \begin_inset Quotes eld
2678 \begin_inset Quotes erd
2682 You can unfold the footnote at any time and re-edit its text by clicking
2684 \begin_inset Quotes eld
2688 \begin_inset Quotes erd
2694 \begin_layout Standard
2695 A footnote can be cut and pasted like normal text.
2696 Go ahead; try it! All you need to do is select the footnote button
2700 \begin_layout Plain Layout
2701 It may be easier to select it using the keyboard.
2702 You might accidentally open the footnote if you are trying to select the
2703 marker itself with the mouse.
2717 In addition, you can change regular text to a footnote, by selecting it
2723 arg "footnote-insert"
2728 button; change a footnote to regular text by hitting the
2732 key when the cursor is in the first position of a footnote, or by hitting
2737 key when the cursor is in the very last position of the footnote.
2740 \begin_layout Standard
2741 Margin notes can be added using the menu
2743 Insert\SpecialChar \menuseparator
2745 \begin_inset space ~
2750 or the toolbar button
2755 arg "marginalnote-insert"
2761 Margin notes are like footnotes, except that:
2764 \begin_layout Itemize
2765 the on-screen boxes say
2766 \begin_inset Quotes eld
2770 \begin_inset Quotes erd
2774 \begin_inset Quotes eld
2778 \begin_inset Quotes erd
2784 \begin_layout Itemize
2785 the notes will be placed in the margin, instead of below the text
2788 \begin_layout Itemize
2789 margin notes are not numbered
2792 \begin_layout Standard
2793 Change your LyX footnote back to text, then select and change it to a margin
2795 Run LaTeX again to see what the margin note looks like.
2798 \begin_layout Standard
2803 : Fix the footnote in
2808 \begin_layout Section
2810 \begin_inset CommandInset label
2812 name "sec:bibliographies"
2819 \begin_layout Standard
2820 Bibliographies (at least in the exact sciences) are similar to cross-references.
2821 The bibliography contains a list of references at the end of the document,
2822 and they can be referenced from within the document.
2823 Like section titles, LyX and LaTeX make your job easier by automatically
2824 numbering the bibliography items and changing citations when the item numbers
2828 \begin_layout Standard
2829 Go to the end of the document and switch to the
2834 Now, each paragraph you type will be a reference.
2836 \begin_inset Quotes eld
2841 The Lyx Tutorial, by the LyX Documentation Team
2844 \begin_inset Quotes erd
2847 as your first reference.
2848 Note that LyX automatically puts a number in a box before each reference.
2849 Click on the boxed reference number, and the
2852 \begin_inset space ~
2862 is to refer to this reference within the LyX document, the
2871 is set (default), you will see the number of the bibliography in the output.
2877 \begin_inset Quotes eld
2881 \begin_inset Quotes erd
2884 to make it easy to remember.
2887 \begin_layout Standard
2888 Now pick somewhere in your document that you would like to insert a reference.
2891 Insert\SpecialChar \menuseparator
2894 or the toolbar button
2899 arg "dialog-show-new-inset citation"
2910 The right panel in this dialog lists all the bibliography entries, and
2911 this field allows you to choose which bibliography item you want to cite.
2913 \begin_inset Quotes eld
2917 \begin_inset Quotes erd
2920 (right now, that is the only item in the bibliography), then use the
2924 button in the center to insert it.
2925 (You can have multiple citations in the same place by transferring a number
2926 of keys this way.) Now view your file as DVI, and you will see that the
2927 citation appears in brackets in the text, referring to the bibliography
2928 at the end of the document.
2931 \begin_layout Standard
2935 \begin_inset space ~
2944 dialog will put a remark (such as a reference to a page or chapter within
2945 the referenced book or article) in the brackets after the reference.
2946 If you want the references to have labels instead of numbers in the printed
2947 output (for example, some journals would use
2948 \begin_inset Quotes eld
2952 \begin_inset Quotes erd
2955 to refer to a paper written by Smith in 1995), use the
2962 \begin_inset space ~
2975 \begin_layout Standard
2980 Fix the bibliography and citation in
2985 \begin_layout Section
2989 \begin_layout Standard
2990 You may want to put a table of contents at the beginning of your document.
2991 LyX makes this easy to do.
2996 after your document title and before your first section title and choose
2999 Insert\SpecialChar \menuseparator
3001 \begin_inset space ~
3005 \begin_inset space ~
3008 TOC\SpecialChar \menuseparator
3010 \begin_inset space ~
3014 \begin_inset space ~
3021 \begin_inset Quotes eld
3025 \begin_inset Quotes erd
3028 will appear in a button on the first line of the document.
3032 \begin_layout Standard
3033 This may not appear to be very useful.
3034 However, if you look at your DVI file, you will see that a table of contents
3035 has been generated, listing the various sections and subsections in your
3037 As usual, if you reorder sections or create new ones, you will see those
3038 changes in the DVI file when you update it.
3042 \begin_layout Standard
3043 The table of contents is not printed in the on-screen version of the document.
3044 But you can display the table of contents in a separate window by clicking
3045 on the table of contents button, or by using
3047 Document\SpecialChar \menuseparator
3050 or the toolbar button
3055 arg "dialog-toggle toc"
3061 This menu will work even if you do not have a table of contents inset in
3063 This is a very useful tool for rearranging your document parts.
3064 Clicking on a (sub)section title in the
3068 window will highlight that line and move the display (in the LyX editing
3069 window) to that place in the document.
3070 You can also use the arrow keys to move up and down in the table of contents.
3071 You may therefore find it convenient to leave this window open throughout
3073 You can get similar functionality from the
3077 menu, though, where the table of contents appears automatically.
3080 \begin_layout Standard
3081 To get rid of the Table of Contents, you can delete the table of contents
3082 button just like any other text.
3085 \begin_layout Standard
3090 : Fix the table of contents in
3095 \begin_layout Chapter
3099 \begin_layout Standard
3100 LaTeX is used by many scientists because it outputs great looking equations,
3101 avoiding the control characters used by word processors and their equation
3103 Many of these scientists are frustrated, however, because writing equations
3104 in LaTeX is more like programming than writing.
3105 Happily, LyX has WYSIWYM support for equations.
3106 If you are used to LaTeX, you will find that all of the usual LaTeX math
3107 commands can be typed in normally, but they will show up in a WYSIWYM fashion.
3108 If, on the other hand, you have never written in LaTeX, then the
3111 \begin_inset space ~
3116 will allow you to write professional-looking math quickly and easily.
3119 \begin_layout Section
3123 \begin_layout Standard
3124 Somewhere in your LyX document, type:
3127 \begin_layout LyX-Code
3128 I like what Einstein said, E=mc^2, because it is so simple.
3132 \begin_layout Standard
3133 Now, that equation does not look very good in LyX and in the output; there
3134 is no space between the letters and the equals sign, and you would like
3135 to write an actual superscript for the
3136 \begin_inset Quotes eld
3140 \begin_inset Quotes erd
3144 That bad typesetting happened because we did not tell LyX that we were
3145 writing a mathematical expression, so it typeset the equation like regular
3149 \begin_layout Standard
3150 Instead, we create a formula that will get typeset properly.
3151 In order to create a formula, just click the toolbar button
3163 Insert\SpecialChar \menuseparator
3164 Math\SpecialChar \menuseparator
3166 \begin_inset space ~
3172 LyX will insert a little blue square, which is an empty math formula.
3178 The expression is typed in blue, and the blue square disappears as soon
3179 as the formula is not empty.
3184 to leave the equation The purple markers disappear, leaving the cursor
3185 to the right of the expression, and now if you type something, it will
3189 \begin_layout Standard
3190 Looking at the output you will notice that the expression was typeset nicely,
3191 with spaces between the letters and the equals sign, and a superscript
3193 \begin_inset Quotes eld
3197 \begin_inset Quotes erd
3201 Letters in math mode are assumed to be variables, and come out in italics.
3202 Numbers are just numbers.
3205 \begin_layout Standard
3206 This math editor is another example of the WYSIWYM philosophy.
3207 In LaTeX, you write a mathematical expression using text and commands like
3214 ; this can be frustrating, because you cannot see what an expression looks
3215 like until you run the file under LaTeX and you may have to spend time
3217 \begin_inset space \thinspace{}
3221 \begin_inset space \space{}
3225 LyX does not attempt to get the expression to look perfect (WYSIWYG), but
3226 it gives you an extremely good idea of what the expression will look like.
3227 LaTeX then takes care of the professional typesetting.
3230 \begin_layout Section
3231 Navigating an Equation
3234 \begin_layout Standard
3236 \begin_inset Formula $E=mc^{2}$
3240 \begin_inset Formula $E=1+mc^{2}$
3244 Use the arrow keys to move the cursor into the expression.
3245 Note that when you enter the expression, the purple markers appear to let
3246 you know you are editing math.
3255 to move the cursor past the equals sign, and just type
3256 \begin_inset Quotes eld
3260 \begin_inset Quotes erd
3264 Again, you can use the arrow keys or
3268 to leave the formula\SpecialChar \@.
3272 \begin_layout Standard
3273 Other than the special keys described below, typing in math mode is like
3274 editing regular text.
3284 Select text either with the arrow keys or with the mouse.
3287 Edit\SpecialChar \menuseparator
3290 works in math mode as well as cut and paste.
3291 One thing to be careful of: if you are left or right outside a formula
3300 respectively, you delete the whole formula.
3301 Luckily, you can just use
3308 \begin_layout Standard
3309 What if you want to change
3310 \begin_inset Formula $E=mc^{2}$
3314 \begin_inset Formula $E=mc^{2.5}+1$
3317 ? Again, you can use the mouse to click in the right place.
3318 However, you can also use the arrow keys.
3319 If the cursor is just after the
3320 \begin_inset Quotes eld
3324 \begin_inset Quotes erd
3328 \begin_inset Quotes eld
3332 \begin_inset Quotes erd
3339 and the cursor is moved to the level of the superscript, just before the
3341 \begin_inset Quotes eld
3345 \begin_inset Quotes erd
3350 \begin_inset Quotes eld
3354 \begin_inset Quotes erd
3362 will move the cursor back to the regular level.
3371 , the cursor will be placed
3375 the superscript (so that you can then type the
3376 \begin_inset Quotes eld
3380 \begin_inset Quotes erd
3386 \begin_layout Section
3387 Exponents and Indices
3390 \begin_layout Standard
3391 An exponent can be entered from the
3394 \begin_inset space ~
3399 (see below), but it is actually simpler just to type the caret key,
3400 \begin_inset Quotes eld
3404 \begin_inset Quotes erd
3408 LyX will place another blue rectangle in the superscript, so that whatever
3409 you write next will be superscripted, and in a smaller font size.
3410 Everything you type until you hit a
3418 to exit the formula entirely) will be in the superscript.
3421 \begin_layout Standard
3422 Writing a subscript (index) is just as easy; start one by typing the underscore
3424 \begin_inset Quotes eld
3428 \begin_inset Quotes erd
3432 You can subscript and superscript both subscripts and superscripts like
3434 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3441 \begin_layout Standard
3453 \begin_layout Section
3457 \begin_layout Standard
3461 \begin_inset space ~
3466 is a convenient way to enter symbols and/or to perform complicated formula
3468 Many of these operations can be accomplished from the keyboard or the
3470 Edit\SpecialChar \menuseparator
3475 Insert\SpecialChar \menuseparator
3479 However, we are going to concentrate on using the
3482 \begin_inset space ~
3487 , just to let you know what is out there; you can learn keyboard shortcuts
3488 and commands later from the
3495 \begin_layout Standard
3499 \begin_inset space ~
3504 is shown when the cursor is in a formula and can also be turned on manually
3507 View\SpecialChar \menuseparator
3511 When you click there on
3512 \begin_inset Quotes eld
3516 \begin_inset Quotes erd
3524 arg "toolbar-toggle math"
3529 ) the toolbar will be shown permanently at the bottom; this state is visualized
3534 menu with a checkmark.
3535 When you click in this state again on
3536 \begin_inset Quotes eld
3540 \begin_inset Quotes erd
3551 is only shown when the cursor is within a formula; this state is visualized
3552 by the renaming of the menu entry from
3553 \begin_inset Quotes eld
3557 \begin_inset Quotes erd
3561 \begin_inset Quotes eld
3565 \begin_inset space ~
3569 \begin_inset Quotes erd
3575 \begin_layout Subsection
3579 \begin_layout Standard
3583 \begin_inset space ~
3588 allows you to choose from a large array of symbols used in math: operators,
3589 arrows, relationships, delimiters, special characters, sums and integrals.
3590 Note that subscripting and superscripting allow you to put lower and upper
3591 limits on sums and integrals.
3594 \begin_layout Subsection
3595 Square roots, accents, and delimiters
3598 \begin_layout Standard
3599 To type a square root, just click on the button
3604 arg "math-insert \\sqrt"
3610 The square root appears, and the cursor is in a new insertion point inside
3612 You can type variables, numbers, other square roots, fractions, whatever
3614 LyX will automatically resize the square root to fit what is inside.
3617 \begin_layout Standard
3618 Accenting a character (
3619 \begin_inset Formula $\overrightarrow{a}$
3622 ) or group of characters (
3623 \begin_inset Formula $\overrightarrow{a+b}$
3626 ) is done similarly, and is an example of inserting a
3627 \begin_inset Quotes eld
3631 \begin_inset Quotes erd
3635 Decorations are available from the toolbar via the button
3640 arg "math-insert \\hat"
3646 Click on a decoration, and LyX will insert that decoration with an insertion
3647 point under (or over) it.
3648 Just type what you want in the insertion point.
3649 There are two sets of decorations: those that resize with the text you
3650 type, and those that have a fixed size, and are most appropriate for a
3655 \begin_layout Standard
3656 Delimiters such as parentheses, brackets, and braces work similarly, but
3657 are a bit more complicated.
3658 Hit the delimiter button
3663 arg "dialog-show mathdelimiter"
3673 Your current selection of delimiters is displayed in a box.
3674 It is a pair of parentheses by default, but you can choose a pair of braces,
3675 a brace and a parenthesis, or choose the empty square to have something
3677 \begin_inset Quotes eld
3681 \begin_inset Formula $a=\left\langle 7\right.$
3685 \begin_inset Quotes erd
3688 (the empty delimiter is displayed as a broken line in LyX, but will not
3689 show up in the output).
3692 \begin_layout Standard
3693 If you are lazy, you can type actual parentheses in math mode, rather than
3699 However, those parentheses will be the same size as regular text, which
3700 will look bad if you have a big fraction or matrix inside the parentheses.
3701 So it is better in this case to use one of the three delimiter buttons
3702 that insert directly e.
3703 \begin_inset space \thinspace{}
3707 \begin_inset space \space{}
3711 \begin_inset space \thinspace{}
3717 \begin_layout Standard
3718 You can also put delimiters or a square root sign or a decoration on already
3719 existing formula parts.
3720 Select the portion of the formula that you want to adjust, and then click
3721 on the button you want from the
3724 \begin_inset space ~
3730 Try using this to change Newton's second law from scalar to vector form
3732 \begin_inset Formula $f=ma$
3736 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3740 Once you have learned about matrices, this is how you will put parentheses
3741 or brackets around them.
3744 \begin_layout Subsection
3748 \begin_layout Standard
3749 To create a fraction, click on the fraction button
3754 arg "math-insert \\frac"
3764 arg "math-insert \\frac-square"
3772 \begin_inset space ~
3778 LyX writes two insertion points in a fraction.
3779 As you would expect, you can use arrow keys or the mouse to move around
3781 Click on the top square and type
3782 \begin_inset Quotes eld
3786 \begin_inset Quotes erd
3795 \begin_inset Quotes eld
3799 \begin_inset Quotes erd
3803 You have made a fraction! Of course you can type anything within each of
3804 the two boxes: variables with exponents, square roots, other fractions,
3809 \begin_layout Standard
3821 \begin_layout Subsection
3822 Functions: lim, log, sin and others
3825 \begin_layout Standard
3826 Because letters in math mode are considered to be variables, if you type
3828 \begin_inset Quotes eld
3832 \begin_inset Quotes erd
3835 in math mode, LyX thinks you are typing the product of the three variables
3837 \begin_inset Formula $s$
3841 \begin_inset Formula $i$
3845 \begin_inset Formula $n$
3849 The three letters will be typeset in italics, when what you really wanted
3851 \begin_inset Quotes eld
3855 \begin_inset Quotes erd
3859 In addition, LyX will not put a space between the word
3860 \begin_inset Quotes eld
3864 \begin_inset Quotes erd
3868 \begin_inset Quotes eld
3872 \begin_inset Quotes erd
3879 will exit the formula).
3881 \begin_inset Quotes eld
3885 \begin_inset Formula $\sin(x)$
3889 \begin_inset Quotes erd
3893 \begin_inset Quotes eld
3897 \begin_inset Formula $sin(x)$
3901 \begin_inset Quotes erd
3907 \begin_layout Standard
3911 \begin_inset space ~
3921 arg "math-insert \\functions"
3927 \begin_inset Quotes eld
3931 \begin_inset Quotes erd
3934 in the appearing function list.
3936 \begin_inset Quotes eld
3940 \begin_inset Quotes erd
3943 is displayed in LyX in black, and set in upright roman type.
3944 The whole word is treated as one symbol, so if you type
3948 , it will delete the whole word.
3950 \begin_inset Quotes eld
3954 \begin_inset Quotes erd
3957 , which will be written in blue italics, like you expect in a formula.
3958 In the output, the expression will be correctly typeset.
3962 \begin_layout Standard
3963 The function list includes other trigonometric functions and their inverses,
3964 hyperbolic functions, logarithms, limits, and quite a few others.
3965 These functions can take subscripts and superscripts, important for typing
3967 \begin_inset Quotes eld
3971 \begin_inset Formula $\cos^{2}\theta$
3975 \begin_inset Quotes erd
3979 \begin_inset Quotes eld
3983 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3987 \begin_inset Quotes erd
3993 \begin_layout Standard
4005 \begin_layout Subsection
4009 \begin_layout Standard
4010 Click on the matrix button
4015 arg "dialog-show mathmatrix"
4023 \begin_inset space ~
4029 The appearing dialog allows you to choose how many rows and columns you
4030 want in your matrix.
4031 Choose 2 rows and 3 columns and hit
4036 LyX prints 6 insertion points in a
4037 \begin_inset Formula $2\times3$
4041 As usual, you can put any sort of formula expression (a square root, another
4042 matrix, etc.) in each insertion point.
4043 You can also leave some of the insertion points empty if you want.
4046 \begin_layout Standard
4051 can be used to move horizontally between the columns of a matrix.
4052 Alternatively, you can use the arrow keys to move around - hitting
4056 at the end of one box will move to the next box,
4060 will move to the next row, etc.
4063 \begin_layout Standard
4064 If you need to change the number of rows and columns, use the menu
4066 Edit\SpecialChar \menuseparator
4068 \begin_inset space \thinspace{}
4072 \begin_inset space \thinspace{}
4077 or the math toolbar buttons
4082 arg "inset-modify tabular append-row"
4092 arg "inset-modify tabular delete-row"
4102 arg "inset-modify tabular append-column"
4112 arg "inset-modify tabular delete-column"
4120 \begin_layout Standard
4125 for information on how to change the horizontal alignment of each column,
4126 and how to change the vertical position of the whole matrix.
4127 Note that if you want to write a table containing text, you should use
4128 LyX's wonderful table support, rather than trying to write text in a matrix.
4131 \begin_layout Subsection
4135 \begin_layout Standard
4136 All of the expressions we have written so far have been on the same line
4137 as the text that came before and after them, otherwise known as inline
4139 This is fine for short, simple expressions, but if you want to write larger
4140 ones, or if you want your expressions to stand out from the text, you need
4141 to write them in display mode.
4142 In addition, only displayed expressions can be labeled and numbered (see
4147 ), and multi-line equations must be in display mode.
4150 \begin_layout Standard
4151 While being in a formula, click on the display button
4164 \begin_inset space ~
4170 This centers the formula and adds a blank line before and after it.
4171 Now type in an expression and compile your file to see how it looks.
4172 The display button is actually a toggle; use it now to change a couple
4173 of your expressions to display mode and back.
4177 \begin_layout Standard
4178 Display mode has a couple differences from inline mode:
4181 \begin_layout Itemize
4182 The default font is larger for a few symbols, like
4183 \begin_inset Formula $\sum$
4187 \begin_inset Formula $\int$
4193 \begin_layout Itemize
4194 Subscripts and superscripts for limits and sums (but not integrals) are
4195 written under and over rather than next to the symbols
4198 \begin_layout Itemize
4202 \begin_layout Standard
4203 Other than these differences, though, displayed expressions and inline expressio
4204 ns are very similar.
4207 \begin_layout Standard
4208 One final note about the way displayed formulas are typeset: Be careful
4209 about whether you are putting your equation into a new paragraph or not.
4210 If your formula is in the middle of a sentence or paragraph, then do not
4216 Doing so will cause the text
4220 the formula to start a new paragraph.
4221 That text will be indented or follow a blank line, depending on your document
4222 paragraph settings, which is probably not what you want.
4225 \begin_layout Standard
4230 : Put the various equations in
4234 into display mode, and see how they are typeset differently.
4237 \begin_layout Standard
4242 : Using various tools you have learned in this section, you should be able
4243 to write an equation like:
4247 \begin_layout Plain Layout
4248 After you have done it the hard way, give
4250 Insert\SpecialChar \menuseparator
4251 Math\SpecialChar \menuseparator
4253 \begin_inset space ~
4264 \begin_inset Formula
4266 f(x)=\left\{ \begin{array}{cc}
4269 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0
4278 \begin_layout Section
4282 \begin_layout Standard
4283 Now you are familiar with the basics.
4284 LyX's math editor can do a lot more.
4285 You can refer to the
4289 manual for tips on how to:
4292 \begin_layout Itemize
4293 Label and number expressions.
4296 \begin_layout Itemize
4297 Create multi-line equations.
4300 \begin_layout Itemize
4301 Change typefaces, e.
4302 \begin_inset space \thinspace{}
4306 \begin_inset space \space{}
4309 to write bold-face text in an expression.
4312 \begin_layout Itemize
4313 Fine-tune font sizes and spacing within an expression.
4314 (Do not worry about this until your final draft!)
4317 \begin_layout Itemize
4319 These are very powerful, because you just define them once at the top of
4320 the document, and then you can use them throughout the document.
4323 \begin_layout Itemize
4324 Almost all you can do with math.
4327 \begin_layout Chapter
4331 \begin_layout Section
4332 Other major LyX Features
4335 \begin_layout Standard
4336 We have not gone through all the possible commands in LyX, and we are not
4345 \begin_inset space ~
4350 manual for more information.
4351 We will just mention a couple more major things LyX can do:
4354 \begin_layout Itemize
4355 LyX has WYSIWYM support for tables.
4358 Insert\SpecialChar \menuseparator
4366 arg "tabular-insert"
4372 Click on the table with the
4379 \begin_inset space ~
4384 dialog box which allows extensive table editing.
4390 arg "toolbar-toggle table"
4395 the table toolbar will appear permanently.
4398 \begin_layout Itemize
4399 LyX also supports including pictures in any format within documents.
4402 Insert\SpecialChar \menuseparator
4410 arg "dialog-show-new-inset graphics"
4416 Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4417 can have captions, and LyX will automatically generate lists of figures
4421 \begin_layout Itemize
4422 LyX is heavily configurable.
4423 Everything from how the LyX window looks to how the output comes out can
4424 be configured in a number of ways.
4425 Much configuration is done through
4427 Tools\SpecialChar \menuseparator
4431 For more information on this, check out
4433 Help\SpecialChar \menuseparator
4434 Customization\SpecialChar \@.
4438 \begin_layout Itemize
4439 LyX is being developed by a team of programmers on five continents.
4440 Therefore, LyX has better support for non-English languages (such as Dutch,
4441 German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4442 ) than many word processors.
4443 Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4444 languages Chinese Japanese, and Korean are supported.
4445 You can write documents in other languages and you can also configure LyX
4446 to show its menus and error messages in other languages.
4450 \begin_layout Itemize
4451 The LyX menus feature keybindings.
4452 This means that you can do
4454 File\SpecialChar \menuseparator
4465 or by using the binding which is shown next to it in the menu (Ctrl+O by
4467 Keybindings are also configurable.
4468 For information on this, check out
4470 Help\SpecialChar \menuseparator
4471 Customization\SpecialChar \@.
4475 \begin_layout Itemize
4476 LyX can read LaTeX documents.
4478 \begin_inset space ~
4482 \begin_inset CommandInset ref
4484 reference "sec:tex2lyx"
4491 \begin_layout Itemize
4492 Spell-checking, thesaurus, and word count facilities are available.
4495 \begin_layout Itemize
4496 Generation of indexes and nomenclatures/glossaries is supported.
4499 \begin_layout Section
4501 \begin_inset CommandInset label
4503 name "sec:latexusers"
4510 \begin_layout Standard
4511 If you do not know anything about LaTeX, you do not have to read this section.
4512 Actually, you might want to
4516 about LaTeX, and then read this chapter.
4517 However, some who begin to use LyX will be familiar with LaTeX.
4518 If you are such a person, you may be wondering if LyX can really do everything
4520 The short answer is that LyX can do pretty much everything LaTeX can do
4521 in one form or another, and it definitely simplifies most parts of writing
4525 \begin_layout Standard
4526 Because this is just a tutorial, we are only going to mention things that
4527 new LyX users will most likely be interested in.
4528 In the interests of keeping the Tutorial short, we will give only minimal
4533 \begin_inset space ~
4541 \begin_inset space ~
4546 manual have a great deal of information on differences between LyX and
4547 LaTeX, and how to do various LaTeX tricks in LyX.
4550 \begin_layout Subsection
4554 \begin_layout Standard
4555 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4556 will be displayed in red on the screen.
4557 You can use TeX commands in LyX by choosing
4559 Insert\SpecialChar \menuseparator
4561 \begin_inset space ~
4577 This creates a box where everything within it is passed straight to LaTeX.
4580 \begin_layout Standard
4581 In a math formula, TeX mode is handled a bit differently.
4582 TeX mode is entered there by typing a backslash.
4583 The backslash is not written out, but anything you type afterwards will
4585 You exit TeX mode by typing
4589 or some other non-alphabetic character, like a number, underscore, caret,
4591 Once you exit TeX mode, if LyX knows the TeX command you have typed in,
4592 it will convert it to WYSIWYM\SpecialChar \@.
4594 \begin_inset Quotes eld
4604 \begin_inset Quotes erd
4607 in a formula and then press
4611 , LyX will change the red
4612 \begin_inset Quotes eld
4616 \begin_inset Quotes erd
4620 \begin_inset Quotes eld
4624 \begin_inset Formula $\gamma$
4628 \begin_inset Quotes erd
4632 This will work for almost all, non-complicated math macros.
4633 This may be faster than using the
4636 \begin_inset space ~
4641 , and will be especially convenient for experienced LaTeX users.
4644 \begin_layout Standard
4645 As a special case, if you type
4646 \begin_inset Quotes eld
4656 \begin_inset Quotes erd
4659 in a formula, the beginning
4663 ending braces will be inserted in red while the cursor is placed between
4665 This makes it more convenient to type those commands that take an argument.
4668 \begin_layout Standard
4669 LyX cannot do absolutely everything that LaTeX can do.
4670 Some fancy functions are not supported at all, while some work but are
4672 TeX mode allows users to get the full flexibility of LaTeX, while having
4673 all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4674 LyX could never support every LaTeX package.
4681 in the preamble (see Section
4682 \begin_inset space ~
4686 \begin_inset CommandInset ref
4688 reference "sec:preamble"
4692 ), you can use any package you want — although you will not have WYSIWYM
4693 support for that package's features.
4696 \begin_layout Subsection
4697 Importing LaTeX Documents —
4702 \begin_inset CommandInset label
4711 \begin_layout Standard
4712 You can import a LaTeX file into LyX by using the
4714 File\SpecialChar \menuseparator
4715 Import\SpecialChar \menuseparator
4717 \begin_inset space ~
4723 This will call the program
4727 which will create a file foo.lyx from the file foo.tex.
4728 LyX will then open that file.
4729 If the translation does not work, you can try calling
4733 from the command line, possibly using fancier options.
4736 \begin_layout Standard
4737 Even when the translation does work,
4741 may not translate everything, though it does handle most legal LaTeX.
4742 It will leave things it does not understand in TeX mode; so, after translating
4747 , you can look for the red text and manually edit it to get it right.
4750 \begin_layout Standard
4755 has its own documentation (manpage), which Unix/Linux users can access
4756 via the console command
4759 \begin_inset space ~
4765 The manpage describes which LaTeX commands and environments are not supported,
4766 what bugs you might run into (and how to get around them), and how to use
4767 the various options.
4770 \begin_layout Standard
4771 It is important to understand that
4775 can only translate files whose document class is
4776 \begin_inset Quotes eld
4780 \begin_inset Quotes erd
4783 to LyX, that is, for which there is a corresponding LyX
4788 If there is no layout file, then you will get an error saying that the
4789 conversion could not be performed.
4790 So, unless you have a layout for the document class of your LaTeX file,
4795 simply will not know how to translate the LaTeX that it finds there into
4796 things LyX understands.
4797 More about layout files and how they are created is explained in detail
4805 \begin_layout Subsection
4806 Converting LyX Documents to LaTeX
4809 \begin_layout Standard
4810 You might wish to convert a LyX Document to a LaTeX file.
4811 For example, a co-worker or co-author who does not have LyX might want
4815 File\SpecialChar \menuseparator
4816 Export\SpecialChar \menuseparator
4820 This will create a file
4828 file you are editing.
4831 \begin_layout Subsection
4835 \begin_layout Subsubsection
4839 \begin_layout Standard
4842 Document\SpecialChar \menuseparator
4845 dialog takes care of the document-wide options, such as changing the document
4846 class, default font size and paper size.
4847 Document class options and also options for LaTeX packages can be entered
4851 \begin_inset space ~
4859 \begin_layout Subsubsection
4860 Other Preamble Matter
4861 \begin_inset CommandInset label
4870 \begin_layout Standard
4871 If you have special commands to put in the preamble of a LaTeX file, you
4872 can use them in a LyX document as well.
4875 Document\SpecialChar \menuseparator
4876 Settings\SpecialChar \menuseparator
4878 \begin_inset space ~
4883 and type in the dialog window (or from the document settings dialog, depending
4885 Anything you type will (as with TeX mode) be sent directly to LaTeX.
4888 \begin_layout Subsection
4892 \begin_layout Standard
4893 LyX has support for BibTeX, which allows you to build databases of bibliographic
4894 al references to be used in multiple documents.
4897 Insert\SpecialChar \menuseparator
4899 \begin_inset space \thinspace{}
4903 \begin_inset space \thinspace{}
4906 TOC\SpecialChar \menuseparator
4908 \begin_inset space ~
4922 field you load BibTeX files, in the
4926 field you can load BibTeX style files.
4929 \begin_layout Standard
4930 After you have done this, you can use citations from any bibliographies
4931 you have included with
4933 Insert\SpecialChar \menuseparator
4937 \begin_inset space ~
4941 \begin_inset CommandInset ref
4943 reference "sec:bibliographies"
4952 dialog will show a list of all the references in your
4959 \begin_layout Section
4963 \begin_layout Standard
4964 Sometimes when you try to view a document, there will be errors, things
4965 that LyX or LaTeX cannot understand.
4966 When this happens, LyX will open a
4969 \begin_inset space ~
4975 Clicking on individual errors in this dialog will take you to the place
4976 in the LyX document where the error occurs and also display the detailed
4977 LaTeX error message.