1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 %This preamble is designed to ensure that the document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}
22 \fi % end if pdflatex is used
24 % the pages of the TOC is numbered roman
25 % and a pdf-bookmark for the TOC is added
26 \let\myTOC\tableofcontents
27 \renewcommand\tableofcontents{%
29 \pdfbookmark[1]{\contentsname}{}
33 % redefine the \LyX macro for PDF bookmarks
34 \def\LyX{\texorpdfstring{%
35 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
38 \use_default_options false
42 \maintain_unincluded_children false
48 \font_typewriter default
49 \font_default_family default
57 \default_output_format default
58 \bibtex_command default
59 \index_command default
63 \pdf_title "The LyX Tutorial"
64 \pdf_author "LyX Team"
65 \pdf_subject "LyX-documentation Tutorial"
66 \pdf_keywords "LyX, documentation"
68 \pdf_bookmarksnumbered true
69 \pdf_bookmarksopen true
70 \pdf_bookmarksopenlevel 1
75 \pdf_pdfusetitle false
76 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
85 \paperorientation portrait
93 \paragraph_separation indent
94 \paragraph_indentation default
95 \quotes_language english
98 \paperpagestyle headings
99 \tracking_changes true
100 \output_changes false
101 \html_use_mathml true
103 \author 2 "Richard Heck"
117 \begin_layout Plain Layout
118 If you have comments or error corrections, please send them to the LyX Documenta
122 \begin_inset CommandInset href
124 target "lyx-docs@lists.lyx.org"
139 \begin_layout Standard
140 \begin_inset CommandInset toc
141 LatexCommand tableofcontents
148 \begin_layout Chapter
152 \begin_layout Section
156 \begin_layout Standard
157 This file is designed for all of you who have never heard of LaTeX, or do
158 not know it very well.
159 Now, do not panic - you will not need to learn LaTeX to use LyX.
160 That is, after all, the whole point of LyX: to provide an almost-WYSIWYG
162 There are some things you will need to learn, however, in order to use
166 \begin_layout Standard
167 Some of you probably found your way to this document because you tried to
168 put two spaces after a
169 \begin_inset Quotes eld
173 \begin_inset Quotes erd
176 or tried to put three blank lines between paragraphs.
177 You found out you could not and in fact, you will find out that most of
178 the little tricks you are accustomed to use in other word processors will
180 That is because most word processors you have used before allow you to
181 manually enter all spacings, font changes, and so on.
182 So you end up not only writing a document but typesetting it, too.
183 LyX does the typesetting for you, in a consistent fashion, letting you
184 focus on the important things, like the content of your writing.
187 \begin_layout Standard
188 So read on to learn more about LyX.
189 Reading this tutorial is definitely worth the time.
192 \begin_layout Section
202 \begin_layout Standard
203 Before we get started with this section, we want to make a quick note of
209 uses the notation outlined in the
214 If you came to this manual first, please read the
218 before you continue with the
225 \begin_layout Standard
226 Now that you know which fonts mean what, we want to talk a bit about what
234 \begin_layout Subsection
235 Getting the most out of the Tutorial
238 \begin_layout Standard
239 This tutorial consists of examples and exercises.
240 To get the most out of this document, you should read through the document,
241 typing all the little things we are telling you to type and trying out
242 all of the exercises to see if you get them right.
243 For convenience, you might want to print out the PDF version of this document.
246 \begin_layout Standard
247 If you are familiar with LaTeX, you will probably be able to read the
251 somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
252 However, LyX has features you will want to learn about.
253 Even if you do not feel like reading the rest of the
257 , you should definitely check out Section
262 \begin_inset CommandInset ref
264 reference "sec:latexusers"
268 , which is specifically written for experienced LaTeX users.
271 \begin_layout Subsection
279 \begin_layout Itemize
280 Detailed explanations of all of LyX's features.
284 \begin_layout Standard
293 \begin_layout Itemize
294 Detailed explanations of LaTeX.
298 \begin_layout Standard
300 If you want to learn some of the neat tricks you can do with LaTeX in LyX,
301 you can have a look at the
313 \begin_layout Standard
314 It is time to move onwards, time for your first document \SpecialChar \ldots{}
318 \begin_layout Chapter
319 Getting started with LyX
322 \begin_layout Section
323 Your first LyX document
326 \begin_layout Standard
328 You are ready to start writing.
329 Before you do, there are a few things we need to mention, which will hopefully
330 make the Tutorial more instructive and useful.
334 \begin_layout Standard
335 Because there is information we cannot give you in the Tutorial, the
341 thing that you need to do is find the
348 Start up LyX, Choose the
357 You may want to load the
361 as well (if you are not reading it within LyX already).
362 This way, you can read them while you are writing your own file.
366 \begin_layout Plain Layout
367 They can also serve as good examples of how to use the many features of
373 Note that once you have got more than one document open, you can use the
378 menu or the document tabs to switch between them.
381 \begin_layout Standard
382 In this Tutorial, we are going to assume that you have a fully working version
383 of LyX, as well as a LaTeX-distribution, a DVI-, and a PDF-viewer.
384 This should be the case on all major Linux- and BSD-distributions, as well
385 as on Windows, where this is setup by the LyX installers.
388 \begin_layout Standard
389 Finally, we have written a file called
393 to let you practice your LyX skills.
394 Imagine that it was typed by someone who did not know about any of LyX's
396 As you learn new LyX functions, we will suggest that you fix those parts
402 It also contains `subtle' hints about how to fix things.
406 \begin_layout Plain Layout
407 The hints are located in yellow
408 \begin_inset Quotes eld
412 \begin_inset Quotes erd
416 Access the text in a note by clicking on it.
421 If you want to cheat, or check what you have done, there is also a file
426 which contains the same text written and typeset by a LyX master.
429 \begin_layout Standard
430 The example files can be found in the
434 directory of LyX's installation folder.
435 Open the raw document, and use
437 File\SpecialChar \menuseparator
444 to save a copy in your own directory for you to work on.
445 As you fix parts of the raw document, check to see how those changes affect
449 \begin_layout Standard
454 directory contains lots of other examples files.
455 They will show you how to do various fancy things with LyX.
456 After you have read the Tutorial, or when you are confused about how to
457 do something fancy in LyX, take a look at these files.
460 \begin_layout Subsection
461 Typing, Viewing, and Exporting
464 \begin_layout Itemize
467 File\SpecialChar \menuseparator
471 \begin_layout Itemize
472 Type a sentence like:
474 This is my first LyX document!
477 \begin_layout Itemize
478 Save your document with
480 File\SpecialChar \menuseparator
489 \begin_layout Itemize
490 Run LaTeX to create a DVI file, with
492 View\SpecialChar \menuseparator
495 or the toolbar button
496 \begin_inset Graphics
497 filename ../images/buffer-view_dvi.png
503 LyX will open a DVI-viewer program displaying your document as it will
508 \begin_layout Plain Layout
509 You can save time by leaving the DVI-viewer running in the background.
512 View\SpecialChar \menuseparator
513 Update\SpecialChar \menuseparator
516 or the toolbar button
517 \begin_inset Graphics
518 filename ../images/buffer-update_dvi.png
523 and just click on the DVI-viewer window (or unminimize it) after LaTeX
532 \begin_layout Itemize
533 Export the ready to print document with
535 File\SpecialChar \menuseparator
543 \begin_layout Standard
544 Congratulations! You have written your first LyX document.
545 All of the rest is just details, which are covered in the other manuals.
548 \begin_layout Subsection
552 \begin_layout Standard
553 LyX can of course do most of the things you are used to do with a word processor.
554 It will word-wrap and indent paragraphs automatically.
555 Here is a quick description of how to do some simple actions.
558 \begin_layout Description
559 Undo LyX has multiple levels of undo, which means you can undo everything
560 you have done since your current editing session started, by selecting
563 Edit\SpecialChar \menuseparator
567 \begin_inset Graphics
568 filename ../images/undo.png
573 ) over and over again.
574 If you undo too much, just select
576 Edit\SpecialChar \menuseparator
580 \begin_inset Graphics
581 filename ../images/redo.png
591 \begin_layout Standard
592 Currently, undo is limited to 100 steps.
596 \begin_layout Description
599 Edit\SpecialChar \menuseparator
603 \begin_inset Graphics
604 filename ../images/cut.png
611 Edit\SpecialChar \menuseparator
615 \begin_inset Graphics
616 filename ../images/copy.png
623 Edit\SpecialChar \menuseparator
627 \begin_inset Graphics
628 filename ../images/paste.png
633 ) to cut, copy, and paste.
634 Or automatically paste selected text (including selections from other programs)
642 \begin_layout Description
645 Edit\SpecialChar \menuseparator
657 \begin_inset Graphics
658 filename ../images/dialog-show_findreplace.png
664 In the dialog, search with the
676 button to replace a word you have found.
680 \begin_layout Plain Layout
681 Close the window when you are done or leave it open if you find it more
683 Most dialog boxes in LyX can operate like this.
684 Just be sure you have the right window focus when you are trying to type
685 in the main LyX window or a LyX dialog.
690 If you like, you can specify whether to make the search case-sensitive,
691 or to search for only complete words; you can also search backwards through
695 \begin_layout Description
704 text (which will by default print characters in italics), set it in
712 (usually small caps, used for people's names), or use your own formatting
715 Edit\SpecialChar \menuseparator
722 dialog (toolbar button
723 \begin_inset Graphics
724 filename ../images/dialog-show_character.png
732 \begin_layout Description
733 Toolbar There are buttons on the toolbar (just below the menus) which allow
734 you to do some of the more popular functions, such as
745 \begin_layout Standard
746 Of course, you have not yet written enough to make most of these functions
748 As you write more, though, try undoing, pasting, etc.
751 \begin_layout Subsection
752 WYSIWYM: Whitespace in LyX
755 \begin_layout Standard
756 One of the hardest things for new users to get used to is the way that LyX
758 As many times as you hit
762 , you will only get one blank line.
763 As many times as you hit
767 , you will only get one space.
768 On a blank line, LyX will not let you type even one space.
773 key will not move you forward one tab stop; in fact there
777 no tab stops! There is no ruler at the top of the page to let you set tabs
781 \begin_layout Standard
782 Many word processors are based on the WYSIWYG principle:
783 \begin_inset Quotes eld
786 What You See Is What You Get.
787 \begin_inset Quotes erd
790 LyX, on the other hand, is based on the principle that
791 \begin_inset Quotes eld
794 What You See Is What You
799 \begin_inset Quotes erd
802 You type what you mean, and LyX will take care of typesetting it for you,
803 so that the output looks nice.
808 grammatically separates paragraphs, and a
812 grammatically separates words, so there is no reason to have several of
817 has no grammatical function at all, so LyX does not support it.
818 Using LyX, you will spend more of your time worrying about the
822 of your document, and less time worrying about the
831 for more information on the WYSIWYM concept.
834 \begin_layout Standard
835 LyX does have (many) ways to fine-tune the formatting of your document.
836 After all, LyX might not typeset
845 has information about all that.
846 It includes horizontal fills and vertical space — which are more powerful
847 and versatile than multiple spaces or blank lines — and ways to change
848 font sizes, character styles, and paragraph alignments by hand.
849 The idea, though, is that you can write your whole document, focusing on
850 content, and just worry about that fine-tuning at the end.
851 With standard word processors, you will be distracted by document formatting
852 throughout the writing process.
855 \begin_layout Section
859 \begin_layout Standard
860 Different parts of a document have different purposes; we call these parts
866 Most of a document is made up of regular text.
867 Section titles (chapter, subsection, etc.) let the reader know that a new
868 topic or subtopic will be discussed.
869 Certain types of documents have special environments.
870 A journal article will have an abstract and a title.
871 A letter will have neither of these, but will probably have an environment
872 that gives the writer's address.
875 \begin_layout Standard
876 Environments are a major part of the
877 \begin_inset Quotes eld
880 What You See Is What You Mean
881 \begin_inset Quotes erd
885 A given environment may require a certain font style, font size, indenting,
886 line spacing, and more.
887 This problem is aggravated, because the exact formatting for a given environmen
888 t may change: one journal may use boldface, 18 point, centered type for
889 section titles while another uses italicized, 15 point, left justified
890 type; different languages may have different standards for indenting; and
891 bibliography formats can vary widely.
892 LyX lets you avoid learning all the different formatting styles.
895 \begin_layout Standard
900 choice box is located on the left end of the toolbar and looks like this:
902 \begin_inset Graphics
903 filename clipart/ToolbarEnvBox.png
910 It indicates in which environment you are currently writing.
911 While you were writing your first document, it said
912 \begin_inset Quotes eld
916 \begin_inset Quotes erd
919 which is the default environment for text.
920 Now you will put a number of environments in your new document so that
921 you can see how they work.
924 \begin_layout Subsection
925 Sections and Subsections
928 \begin_layout Standard
933 on the first line of your LyX file, and select
945 \begin_layout Plain Layout
951 If nothing is selected, LyX changes the paragraph you are currently in
952 to the selected environment.
953 Alternatively, you can change several paragraphs to a different environment
954 by selecting them before picking an environment.
971 , which will be covered below.
972 LyX numbers the section
973 \begin_inset Quotes eld
977 \begin_inset Quotes erd
980 and typesets the section heading (title) in a larger font.
991 \begin_inset Quotes eld
995 \begin_inset Quotes erd
999 \begin_inset Quotes eld
1003 \begin_inset Quotes erd
1007 Section headings, like most environments, are assumed to end when you type
1013 Type the document introduction:
1016 \begin_layout LyX-Code
1017 This is an introduction to my first LyX document.
1020 \begin_layout Standard
1035 \begin_inset Quotes eld
1039 \begin_inset Quotes erd
1042 and waits for you to type a title.
1044 \begin_inset Quotes eld
1050 \begin_inset space ~
1056 \begin_inset Quotes erd
1059 , and you will see that LyX again sets it as a section title.
1062 \begin_layout Standard
1064 Go to the end of Section
1065 \begin_inset space ~
1069 \begin_inset Quotes eld
1072 my first LyX document
1073 \begin_inset Quotes erd
1090 \begin_inset Quotes eld
1094 \begin_inset Quotes erd
1097 and waits for you to type a title.
1104 \begin_inset space ~
1108 \begin_inset Quotes eld
1112 \begin_inset Quotes erd
1116 \begin_inset space ~
1119 2, has been automatically renumbered to Section
1120 \begin_inset space ~
1123 3! In true WYSIWYM fashion, you just need to identify the text that makes
1124 up the section titles, and LyX takes care of numbering the sections and
1128 \begin_layout Standard
1137 environment, and type the following five lines:
1140 \begin_layout LyX-Code
1141 Sections and subsections are described below.
1144 \begin_layout LyX-Code
1148 \begin_layout LyX-Code
1149 Sections are bigger than subsections.
1152 \begin_layout LyX-Code
1153 Subsection description
1156 \begin_layout LyX-Code
1157 Subsections are smaller than sections.
1160 \begin_layout Standard
1161 Click on the second line and select
1170 LyX numbers the subsection
1171 \begin_inset Quotes eld
1175 \begin_inset Quotes erd
1178 , and typesets it in a font which is bigger than regular text but smaller
1179 than the section title.
1180 Change the fourth line
1184 environment as well.
1185 As you probably expected, LyX automatically numbered the section
1186 \begin_inset Quotes eld
1190 \begin_inset Quotes erd
1194 If you put yet another section before Section
1195 \begin_inset space ~
1199 \begin_inset space ~
1202 2 will be renumbered as Section 3, and the subsections will be renumbered
1204 \begin_inset Quotes eld
1208 \begin_inset Quotes erd
1212 \begin_inset Quotes eld
1216 \begin_inset Quotes erd
1223 \begin_layout Standard
1224 Further levels of sectioning include
1237 We will let you play with these on your own.
1238 You may notice that paragraph and subparagraph headings are not numbered
1239 by default, and that subparagraphs are indented; see the
1243 for an explanation and how to change this.
1248 headings are actually the highest level of sectioning, above
1252 s, but you are only allowed to use them in certain types (text classes)
1253 of LyX documents (see Section
1254 \begin_inset space ~
1258 \begin_inset CommandInset ref
1260 reference "sec:Document-Classes"
1268 \begin_layout Standard
1269 Finally, you may want to have sections or subsections that are not numbered.
1270 There are environments for this as well.
1271 If you change one of your section headings to the
1275 environment (you may have to scroll down in the
1279 box to find it), LyX will use the same font size for the heading as it
1280 uses for a regular section, but it will not number that section.
1281 There are corresponding
1282 \begin_inset Quotes eld
1286 \begin_inset Quotes erd
1289 heading environments for
1298 Try changing some of your sections or subsections to the starred environments,
1299 and note how the other section numbers are updated.
1302 \begin_layout Standard
1307 : Fix the section and subsection headings in
1315 \begin_layout Subsection
1319 \begin_layout Standard
1320 LyX has several different environments for typesetting lists.
1321 The various list environments free you from hitting
1325 a million times when writing an outline, or from renumbering a whole list
1326 when you want to add a point in the middle of the list.
1327 Different types of documents logically require different list environments:
1330 \begin_layout Itemize
1331 A slide presentation might use the
1335 environment's bulleted lists to describe different points.
1339 \begin_layout Itemize
1340 An outline would use the
1344 environment's numbered lists (and lettered sublists).
1348 \begin_layout Itemize
1349 A document describing several software packages could use the
1353 environment, where each item in the list begins with a bold-faced word.
1357 \begin_layout Itemize
1362 environment is a variation on the
1369 \begin_layout Standard
1370 Let us write a list of reasons why LyX is better than other word processors.
1371 Somewhere in your document, type:
1374 \begin_layout Standard
1377 LyX is better than other word processors because:
1380 \begin_layout Standard
1396 \begin_inset Quotes eld
1400 \begin_inset Quotes erd
1404 Type in your reasons:
1407 \begin_layout LyX-Code
1408 Typesetting is done for you.
1411 \begin_layout LyX-Code
1415 \begin_layout LyX-Code
1416 Lists are very easy to create!
1419 \begin_layout Standard
1420 List environments, unlike headings, do not end when you type
1425 Instead, LyX assumes you are going on to the next item in the list.
1426 The above will therefore result in a three-item list.
1427 If you want more than one paragraph within one list
1431 , one way is to use the
1434 \begin_inset space ~
1439 , which you get by typing
1444 In order to get out of the list, you need to reselect the
1448 environment (or just use the key binding,
1451 \begin_inset space ~
1459 \begin_layout Standard
1460 You have got a beautiful itemized list.
1461 You might want to run LaTeX to see how the list looks when printed out.
1462 But what if you wanted to number the reasons? Well, just select the whole
1467 \begin_layout Plain Layout
1468 LyX will not let you select the first bullet unless you also select the
1473 the list, which you probably do not want to do.
1474 Similarly, you cannot select the actual number in a numbered section title.
1475 This is on purpose because the bullet or number depends on the document
1476 settings or text position, respectively.
1490 Pow! As we mentioned, if you add or delete a list item, LyX will fix the
1494 \begin_layout Standard
1495 While the list is still selected, you can change to the other two list environme
1504 , in order to see what they look like.
1505 For those two environments, each list item is made up of a term, which
1506 is the item's first word, followed by a definition, which is the rest of
1507 the paragraph (until you hit
1511 .) The term is either typeset in boldface (
1516 \begin_inset Quotes eld
1520 \begin_inset Quotes erd
1527 \begin_layout Plain Layout
1528 But a typesetter's tab, which will change to fit the size of the largest
1529 term, not a pathetic, rigid, unchangeable typewriter
1542 ) from the rest of the paragraph.
1543 If you want to have more than one word in the definition, then separate
1547 \begin_inset space ~
1555 \begin_layout Standard
1560 : Typeset the list in
1565 \begin_layout Standard
1566 You can nest lists within each other in all sorts of interesting ways.
1567 An obvious example would be writing outlines.
1568 Numbered and bulleted lists will have different numbering and bulleting
1569 schemes for sublists.
1574 for details on the different sorts of lists and for examples of nestings.
1577 \begin_layout Subsection
1578 Other environments: Verses, Quotations, and more
1581 \begin_layout Standard
1582 There are two environments for setting quotations apart from surrounding
1587 for short quotes and
1600 \begin_layout Plain Layout
1601 used in this Tutorial for the long typing examples
1610 font; this environment is the only place in LyX where you are allowed to
1611 use multiple spaces to allow code indenting.
1612 You can even write poetry using the
1620 to separate stanzas, and
1624 to separate lines within a stanza.
1629 for more complete descriptions of all of the available LyX environments.
1632 \begin_layout Standard
1637 : Correctly typeset the
1646 \begin_inset Newline newline
1654 \begin_layout Chapter
1658 \begin_layout Standard
1659 The previous chapter hopefully allowed you to get used to writing in LyX.
1660 It introduced you to the basic editing operations in LyX, as well as the
1661 powerful method of writing with environments.
1662 Most people who use LyX, though, will want to write documents: papers,
1663 articles, books, manuals, or letters.
1664 This chapter is meant to take you from simply writing text with LyX to
1665 writing a complete document.
1666 It will introduce you to text classes, which allow you to write different
1668 It will then describe many of the additions that turn text into a document,
1669 such as titles, footnotes, cross references, bibliographies, and tables
1673 \begin_layout Section
1675 \begin_inset CommandInset label
1677 name "sec:Document-Classes"
1684 \begin_layout Standard
1685 Different sorts of documents should be typeset differently.
1686 For example, books are generally printed double-sided, while articles are
1688 In addition, many documents contain special environments: letters contain
1689 some environments — such as the sender's address and the signature — which
1690 do not make sense in a book or article.
1699 \begin_layout Plain Layout
1700 for LaTeX users: this is equivalent to the LaTeX document class
1705 takes care of these large scale differences between different sorts of
1707 This Tutorial, for example, was written in the
1712 Document classes are another major part of the WYSIWYM philosophy; they
1713 tell LyX how to typeset the document, so you do not need to know how.
1716 \begin_layout Standard
1717 Your document is probably being written in the
1725 \begin_layout Plain Layout
1726 That is usually the default document class
1731 Try changing to other document classes (using the
1733 Document\SpecialChar \menuseparator
1736 dialog) to see how they are typeset differently.
1737 If you change your document to the
1741 document class and look at the
1745 box, you will see that most of the allowed environments are the same.
1746 However, you can now use the
1751 If you are ever unsure about which environments you can use in a given
1752 document class, just consult the
1759 \begin_layout Standard
1760 Font sizes, one- or two-column printing, and page headings are just some
1761 of the ways journals typesettings differ from one another.
1762 As the Computer Age continues to mature, journals have begun accepting
1763 electronic submissions, creating LaTeX
1764 \begin_inset Quotes eld
1768 \begin_inset Quotes erd
1771 so that authors can submit correctly typeset articles.
1772 LyX is set up to support this as well.
1773 For example, LyX supports typesetting (and extra environments) for the
1774 American Mathematics Society journals using the
1777 \begin_inset space ~
1785 \begin_layout Standard
1786 Here is a very quick reference to some of the document classes.
1789 Special Document Classes
1795 manual for many more details.
1798 \begin_layout Standard
1800 \begin_inset Tabular
1801 <lyxtabular version="3" rows="7" columns="2">
1802 <features tabularvalignment="middle">
1803 <column alignment="center" valignment="top" width="0pt">
1804 <column alignment="center" valignment="top" width="0pt">
1806 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1809 \begin_layout Plain Layout
1815 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1818 \begin_layout Plain Layout
1826 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1829 \begin_layout Plain Layout
1835 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1838 \begin_layout Plain Layout
1839 one-sided, no chapters
1846 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1849 \begin_layout Plain Layout
1855 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1858 \begin_layout Plain Layout
1859 layout & environments for American Math Society
1866 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1869 \begin_layout Plain Layout
1875 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1878 \begin_layout Plain Layout
1879 longer than article, two-sided
1886 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1889 \begin_layout Plain Layout
1895 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1898 \begin_layout Plain Layout
1899 report + front and back matter
1906 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1909 \begin_layout Plain Layout
1915 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1918 \begin_layout Plain Layout
1926 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1929 \begin_layout Plain Layout
1935 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1938 \begin_layout Plain Layout
1939 lots of extra environments for address, signature\SpecialChar \ldots{}
1953 \begin_layout Section
1954 Templates: Writing a Letter
1957 \begin_layout Standard
1958 One way to write a letter would be to open a new file, and choose a
1964 Document\SpecialChar \menuseparator
1968 While this is the most obvious way to write a letter, it seems like extra
1970 Every time you write a business letter, you want to have your address,
1971 the address to which you are sending it, a body, a signature, etc.
1976 for letters, which contains a sample letter; once you have a template,
1977 you can just replace a couple of parts of the letter with your text each
1978 time you write a letter.
1981 \begin_layout Standard
1982 Open a new file with
1984 File\SpecialChar \menuseparator
1986 \begin_inset space ~
1990 \begin_inset space ~
2001 Save and print the file to see how the various environments are typeset.
2004 \begin_layout Standard
2005 When you look at the
2009 box, you will see several environments, like the
2012 \begin_inset space ~
2017 environment, which do not even exist in most other document classes.
2027 You can play around for a while to figure out how the various environments
2029 You will notice for example that the
2033 environment has the word
2034 \begin_inset Quotes eld
2038 \begin_inset Quotes eld
2041 in red before the actual text of the signature.
2042 This word does not show up in the actual letter, as you will see if you
2043 view/export the file.
2044 It is just there to let you know where the signature goes.
2045 Also, note that it does not matter where in the file the
2050 Remember, LyX is WYSIWYM; you can put the
2054 environment anywhere you want, but LyX knows that in the printout, the
2055 signature should be at the end.
2058 \begin_layout Standard
2059 A template is just a regular LyX file.
2060 This means you can fill in your address and signature and save the file
2062 From now on, any time you want to write a letter, you can use the new template
2064 We do not have to suggest an actual
2065 \begin_inset Quotes eld
2069 \begin_inset Quotes erd
2072 here; just write a letter to someone!
2076 \begin_layout Plain Layout
2077 One warning, if you are writing from a template.
2078 If you erase all of the text in an environment — for example, if you erase
2082 \begin_inset space ~
2087 field so that you can replace it with your own — and then you move the
2088 cursor without writing any text, the environment may disappear.
2089 This is because most environments cannot exist without any text in them.
2090 Just reselect the environment from the
2102 \begin_layout Standard
2103 Templates can be a huge time-saver, and we urge you to use them whenever
2105 In addition, they can help a person learn how to use some of the fancier
2107 Finally, they may be useful for a person who is configuring LyX for a bunch
2108 of less computer-aware users.
2109 When they are first learning LyX, it will be much less intimidating if
2110 they have a letter template customized for their company, for example.
2113 \begin_layout Section
2117 \begin_layout Standard
2118 LyX (like LaTeX) considers the title — which may contain the actual title,
2119 the author, the date, and even an abstract of a paper — to be a separate
2120 part of the document.
2123 \begin_layout Standard
2124 Go back to your LyX document and make sure it is using the
2132 \begin_layout Plain Layout
2133 You should not be using the letter any more, since the
2137 document class does not allow titles.
2142 Type a title on the first line, and change the line to the
2147 On the next line, type your name and change it to the
2152 On the next line, write the date in the
2157 Type a paragraph or two summarizing your document using the
2162 Notice how the title is presented when it is printed out.
2163 If you change the document format to Book, you will get a separate title
2164 page, like the first page of this tutorial.
2167 \begin_layout Standard
2172 : Fix the title, date, and author in
2177 \begin_layout Section
2178 Labels and Cross-References
2181 \begin_layout Standard
2182 You can label section headings, list items, formulas, footnotes, and floats
2186 \begin_layout Plain Layout
2187 Floats are explained in the
2201 Once you do so, you can refer to this section in other parts of the document,
2202 using cross-references.
2203 You can refer either to the section's number, or to the page that the section
2205 As with section numbering, LyX also takes care about cross-reference numbering
2207 Automatic labels and cross-references are among the most significant advantages
2208 of LyX (and LaTeX) over conventional word processors.
2212 \begin_layout Subsection
2216 \begin_layout Standard
2217 Go to our second section, whose title is
2218 \begin_inset Quotes eld
2222 \begin_inset Quotes erd
2226 Click at the end of the section title line, and select
2228 Insert\SpecialChar \menuseparator
2231 or the toolbar button
2232 \begin_inset Graphics
2233 filename ../images/label-insert.png
2240 A dialog asks you for a label name, and gives you a suggestion.
2245 , the label name will be placed in a box next to the section title.
2248 \begin_layout Standard
2249 So far you have not done anything — the DVI output will look exactly the
2250 same, since labels do not show up in the printed document.
2251 However, now that you have added a label, you can refer to that label with
2253 We will do that next.
2256 \begin_layout Subsection
2257 Your first cross-reference
2260 \begin_layout Standard
2261 Place the cursor somewhere in section
2262 \begin_inset space ~
2269 \begin_layout LyX-Code
2270 If you want to know more about this document, then see
2271 \begin_inset Newline newline
2274 section, which can be found on page.
2277 \begin_layout Standard
2278 Now — with the cursor after the word `Section' — choose
2280 Insert\SpecialChar \menuseparator
2282 \begin_inset space ~
2287 or the toolbar button
2288 \begin_inset Graphics
2289 filename ../images/dialog-show-new-inset_ref.png
2296 The Cross-reference dialog pops up.
2297 It shows a list of the possible labels you can reference.
2298 At the moment, there should be only one, `sec:About-This-Document'.
2299 First, select the drop-down menu labeled Format and select '<reference>
2300 on page <page>.' Then select `sec:About-This-Document' (it may be selected
2301 by default), and a reference marker will appear containing `Ref+Text: sec:About
2302 -This-Document' (To be really correct, you should put a
2305 \begin_inset space ~
2310 in between the word `Section' and the reference).
2311 Alternatively to that method, you can right-click on a label and use in
2312 the appearing context menu
2317 The cross-reference to this label is now in the clipboard and can be copied
2318 to the actual cursor position via the menu
2320 Edit\SpecialChar \menuseparator
2328 In the printed document, this reference marker will be replaced with the
2329 section number and then the page number.
2330 View your document as DVI, and you will see that LaTeX has been even cleverer
2332 It refers to `Section 2' and depending how much text you have between the
2333 start of Section 2 and this cross-reference you may see `on this page,'
2334 'on the previous page' or `on page n' (whereas
2338 is the page number).
2341 \begin_layout Standard
2342 Conveniently, a cross-reference acts as a hyperlink when you are editing
2343 a document in LyX; clicking on it will pop up the
2350 \begin_inset space ~
2354 \begin_inset space ~
2359 will move the cursor to the referenced label.
2362 \begin_layout Subsection
2363 More fun with labels
2366 \begin_layout Standard
2367 We told you that LyX takes care about numbering cross-references; now you
2369 Add a new section before Section
2370 \begin_inset space ~
2374 Update the DVI view, and — voilà ! — the section cross reference changed
2376 \begin_inset Quotes eld
2380 \begin_inset Quotes erd
2383 ! Change the section
2384 \begin_inset Quotes eld
2388 \begin_inset Quotes erd
2391 to a subsection, and the cross-reference will reference Subsection
2392 \begin_inset space ~
2395 2.1 instead of Section
2396 \begin_inset space ~
2400 The page reference will not change unless you add a whole page of text
2401 before the label, of course.
2405 \begin_layout Standard
2406 If you want some more practice with labels, then try putting a new label
2407 where your first cross-reference was, and refer to that label from elsewhere
2409 If you will be inserting cross-references often, it may be convenient to
2417 \begin_layout Standard
2418 If you want to make sure that the cross-referencing gets the pages right
2419 even for larger documents,
2423 a couple pages of text from the
2427 to the clipboard, and
2431 the stolen text into your document.
2435 \begin_layout Plain Layout
2436 By the way, copying a chapter title may cause an error, because chapters
2437 are not allowed in the article class, see section
2438 \begin_inset space ~
2442 \begin_inset CommandInset ref
2444 reference "sec:Document-Classes"
2449 If this happens, just delete the chapter title.
2457 \begin_layout Standard
2462 : Fix the references in
2467 \begin_layout Section
2468 Footnotes and Margin Notes
2471 \begin_layout Standard
2472 Footnotes can be added using the toolbar button
2473 \begin_inset Graphics
2474 filename ../images/footnote-insert.png
2482 Insert\SpecialChar \menuseparator
2486 Click at the end of the word
2487 \begin_inset Quotes eld
2491 \begin_inset Quotes erd
2494 somewhere in your document and click the
2495 \begin_inset Graphics
2496 filename ../images/footnote-insert.png
2503 A footnote box appears where you can enter the text of the footnote.
2504 LyX should place the cursor at the beginning of the footnote box.
2508 \begin_layout LyX-Code
2509 LyX is a typesetting word processor.
2512 \begin_layout Standard
2513 Now click on the button labeled
2514 \begin_inset Quotes eld
2518 \begin_inset Quotes erd
2522 The footnote box is closed, leaving the button showing where the footnote
2523 marker will be in the printed text; this is called
2524 \begin_inset Quotes eld
2528 \begin_inset Quotes erd
2532 You can unfold the footnote at any time and re-edit its text by clicking
2534 \begin_inset Quotes eld
2538 \begin_inset Quotes erd
2544 \begin_layout Standard
2545 A footnote can be cut and pasted like normal text.
2546 Go ahead; try it! All you need to do is select the footnote button
2550 \begin_layout Plain Layout
2551 It may be easier to select it using the keyboard.
2552 You might accidentally open the footnote if you are trying to select the
2553 marker itself with the mouse.
2567 In addition, you can change regular text to a footnote, by selecting it
2569 \begin_inset Graphics
2570 filename ../images/footnote-insert.png
2576 button; change a footnote to regular text by hitting the
2580 key when the cursor is in the first position of a footnote, or by hitting
2585 key when the cursor is in the very last position of the footnote, respectively.
2588 \begin_layout Standard
2589 Margin notes can be added using the menu
2591 Insert\SpecialChar \menuseparator
2593 \begin_inset space ~
2598 or the toolbar button
2599 \begin_inset Graphics
2600 filename ../images/marginalnote-insert.png
2607 Margin notes are like footnotes, except that:
2610 \begin_layout Itemize
2611 the on-screen boxes say
2612 \begin_inset Quotes eld
2616 \begin_inset Quotes erd
2620 \begin_inset Quotes eld
2624 \begin_inset Quotes erd
2630 \begin_layout Itemize
2631 the notes will be placed in the margin, instead of below the text
2634 \begin_layout Itemize
2635 margin notes are not numbered
2638 \begin_layout Standard
2639 Change your LyX footnote back to text, then select and change it to a margin
2641 Run LaTeX again to see what the margin note looks like.
2644 \begin_layout Standard
2649 : Fix the footnote in
2654 \begin_layout Section
2656 \begin_inset CommandInset label
2658 name "sec:bibliographies"
2665 \begin_layout Standard
2666 Bibliographies (at least in the exact sciences) are similar to cross references.
2667 The bibliography contains a list of references at the end of the document,
2668 and they can be referenced from within the document.
2669 Like section titles, LyX and LaTeX make your job easier by automatically
2670 numbering the bibliography items and changing citations when the item numbers
2674 \begin_layout Standard
2675 Go to the end of the document and switch to the
2680 Now, each paragraph you type will be a reference.
2682 \begin_inset Quotes eld
2687 The Lyx Tutorial, by the LyX Documentation Team
2690 \begin_inset Quotes erd
2693 as your first reference.
2694 Note that LyX automatically puts a number in a box before each reference.
2695 Click on the boxed reference number, and the
2698 \begin_inset space ~
2708 is to refer to this reference within the LyX document, the
2717 is set (default), you will see the number of the bibliography in the output.
2723 \begin_inset Quotes eld
2727 \begin_inset Quotes erd
2730 to make it easy to remember.
2733 \begin_layout Standard
2734 Now pick somewhere in your document that you would like to insert a reference.
2737 Insert\SpecialChar \menuseparator
2740 or the toolbar button
2741 \begin_inset Graphics
2742 filename ../images/dialog-show-new-inset_citation.png
2754 The right panel in this dialog lists all the bibliography entries, and
2755 this field allows you to choose which bibliography item you want to cite.
2757 \begin_inset Quotes eld
2761 \begin_inset Quotes erd
2764 (right now, that is the only item in the bibliography), then use the
2768 button in the center to insert it.
2769 (You can have multiple citations in the same place by transferring a number
2770 of keys this way.) Now view your file as DVI, and you will see that the
2771 citation appears in brackets in the text, referring to the bibliography
2772 at the end of the document.
2775 \begin_layout Standard
2779 \begin_inset space ~
2788 dialog will put a remark (such as a reference to a page or chapter within
2789 the referenced book or article) in the brackets after the reference.
2790 If you want the references to have labels instead of numbers in the printed
2791 output (for example, some journals would use
2792 \begin_inset Quotes eld
2796 \begin_inset Quotes erd
2799 to refer to a paper written by Smith in 1995), use the
2806 \begin_inset space ~
2819 \begin_layout Standard
2824 Fix the bibliography and citation in
2829 \begin_layout Section
2833 \begin_layout Standard
2834 You may want to put a table of contents at the beginning of your document.
2835 LyX makes this very easy to do.
2840 after your document title and before your first section title and choose
2843 Insert\SpecialChar \menuseparator
2845 \begin_inset space ~
2849 \begin_inset space ~
2852 TOC\SpecialChar \menuseparator
2854 \begin_inset space ~
2858 \begin_inset space ~
2865 \begin_inset Quotes eld
2869 \begin_inset Quotes erd
2872 will appear in a button on the first line of the document.
2876 \begin_layout Standard
2877 This may not appear to be very useful.
2878 However, if you look at your DVI file, you will see that a table of contents
2879 has been generated, listing the various sections and subsections in your
2881 As usual, if you reorder sections or create new ones, you will see those
2882 changes in the DVI file when you update it.
2886 \begin_layout Standard
2887 The table of contents is not printed in the on-screen version of the document.
2888 But you can display the table of contents in a separate window by clicking
2889 on the table of contents button, or by using
2891 Document\SpecialChar \menuseparator
2894 or the toolbar button
2895 \begin_inset Graphics
2896 filename ../images/dialog-toggle_toc.png
2903 This menu will work even if you do not have a table of contents inset in
2905 This is a very useful tool for moving around your document parts.
2906 Clicking on a (sub)section title in the
2910 window will highlight that line and move the display (in the LyX editing
2911 window) to that place in the document.
2912 You can also use the arrow keys to move up and down in the table of contents.
2913 You may therefore find it convenient to leave this window open throughout
2915 You can get similar functionality from the
2919 menu, though, where the table of contents appears automatically.
2922 \begin_layout Standard
2923 To get rid of the Table of Contents, you can delete the table of contents
2924 button just like any other text.
2927 \begin_layout Standard
2932 : Fix the table of contents in
2937 \begin_layout Chapter
2941 \begin_layout Standard
2942 LaTeX is used by many scientists because it outputs great looking equations,
2943 avoiding the control characters used by word processors and their equation
2945 Many of these scientists are frustrated, however, because writing equations
2946 in LaTeX is more like programming than writing.
2947 Happily, LyX has WYSIWYM support for equations.
2948 If you are used to LaTeX, you will find that all of the usual LaTeX math
2949 commands can be typed in normally, but they will show up in a WYSIWYM fashion.
2950 If, on the other hand, you have never written in LaTeX, then the
2953 \begin_inset space ~
2958 will allow you to write professional-looking math quickly and easily.
2961 \begin_layout Section
2965 \begin_layout Standard
2966 Somewhere in your LyX document, type:
2969 \begin_layout LyX-Code
2970 I like what Einstein said, E=mc^2, because it is so simple.
2974 \begin_layout Standard
2975 Now, that equation does not look very good in LyX and in the output; there
2976 is no space between the letters and the equals sign, and you would like
2977 to write an actual superscript for the
2978 \begin_inset Quotes eld
2982 \begin_inset Quotes erd
2986 That bad typesetting happened because we did not tell LyX that we were
2987 writing a mathematical expression, so it typeset the equation like regular
2991 \begin_layout Standard
2992 Instead, we create a formula that will get typeset properly.
2993 In order to create a formula, just click the toolbar button
2994 \begin_inset Graphics
2995 filename ../images/math-mode.png
3003 Insert\SpecialChar \menuseparator
3004 Math\SpecialChar \menuseparator
3006 \begin_inset space ~
3012 LyX will insert a little blue square, which is an empty math formula.
3018 The expression is typed in blue, and the blue square disappears as soon
3019 as the formula is not empty.
3024 to leave the equation The purple markers disappear, leaving the cursor
3025 to the right of the expression, and now if you type something, it will
3029 \begin_layout Standard
3030 Looking at the output you will notice that the expression was typeset nicely,
3031 with spaces between the letters and the equals sign, and a superscript
3033 \begin_inset Quotes eld
3037 \begin_inset Quotes erd
3041 Letters in math mode are assumed to be variables, and come out in italics.
3042 Numbers are just numbers.
3045 \begin_layout Standard
3046 This math editor is another example of the WYSIWYM philosophy.
3047 In LaTeX, you write a mathematical expression using text and commands like
3054 ; this can be frustrating, because you cannot see what an expression looks
3055 like until you run the file under LaTeX and you may have to spend time
3057 \begin_inset space \thinspace{}
3061 \begin_inset space \space{}
3065 LyX does not attempt to get the expression to look perfect (WYSIWYG), but
3066 it gives you an extremely good idea of what the expression will look like.
3067 LaTeX then takes care of the professional typesetting.
3070 \begin_layout Section
3071 Navigating an Equation
3074 \begin_layout Standard
3076 \begin_inset Formula $E=mc^{2}$
3080 \begin_inset Formula $E=1+mc^{2}$
3084 Use the arrow keys to move the cursor into the expression.
3085 Note that when you enter the expression, the purple markers appear to let
3086 you know you are editing math.
3095 to move the cursor past the equals sign, and just type
3096 \begin_inset Quotes eld
3100 \begin_inset Quotes erd
3104 Again, you can use the arrow keys or
3108 to leave the formula\SpecialChar \@.
3112 \begin_layout Standard
3113 Other than the special keys described below, typing in math mode is like
3114 editing regular text.
3124 Select text either with the arrow keys or with the mouse.
3127 Edit\SpecialChar \menuseparator
3130 works in math mode as well as cut and paste.
3131 One thing to be careful of: if you are left or right outside a formula
3140 respectively, you delete the whole formula.
3141 Luckily, you can just use
3148 \begin_layout Standard
3149 What if you want to change
3150 \begin_inset Formula $E=mc^{2}$
3154 \begin_inset Formula $E=mc^{2.5}+1$
3157 ? Again, you can use the mouse to click in the right place.
3158 However, you can also use the arrow keys.
3159 If the cursor is just after the
3160 \begin_inset Quotes eld
3164 \begin_inset Quotes erd
3168 \begin_inset Quotes eld
3172 \begin_inset Quotes erd
3179 and the cursor is moved to the level of the superscript, just before the
3181 \begin_inset Quotes eld
3185 \begin_inset Quotes erd
3190 \begin_inset Quotes eld
3194 \begin_inset Quotes erd
3202 will move the cursor back to the regular level.
3211 , the cursor will be placed
3215 the superscript (so that you can then type the
3216 \begin_inset Quotes eld
3220 \begin_inset Quotes erd
3226 \begin_layout Section
3227 Exponents and Indices
3230 \begin_layout Standard
3231 An exponent can be entered from the
3234 \begin_inset space ~
3239 (see below), but it is actually simpler just to type the caret key,
3240 \begin_inset Quotes eld
3244 \begin_inset Quotes erd
3248 LyX will place another blue rectangle in the superscript, so that whatever
3249 you write next will be superscripted, and in a smaller font size.
3250 Everything you type until you hit a
3258 to exit the formula entirely) will be in the superscript.
3261 \begin_layout Standard
3262 Writing a subscript (index) is just easy; start one by typing the underscore
3264 \begin_inset Quotes eld
3268 \begin_inset Quotes erd
3272 You can subscript and superscript both subscripts and superscripts like
3274 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3281 \begin_layout Standard
3293 \begin_layout Section
3297 \begin_layout Standard
3301 \begin_inset space ~
3306 is a convenient way to enter symbols or to perform complicated formula
3308 Many of these operations can be accomplished from the keyboard or the
3310 Edit\SpecialChar \menuseparator
3315 Insert\SpecialChar \menuseparator
3319 However, we are going to concentrate on using the
3322 \begin_inset space ~
3327 , just to let you know what is out there; you can learn keyboard shortcuts
3328 and commands later from the
3335 \begin_layout Standard
3339 \begin_inset space ~
3344 is shown when the cursor is in a formula and can also be turned on manually
3347 View\SpecialChar \menuseparator
3351 When you click there on
3352 \begin_inset Quotes eld
3356 \begin_inset Quotes erd
3359 the toolbar will be shown permanently at the bottom; this state is visualized
3364 menu with a checkmark.
3365 When you click in this state again on
3366 \begin_inset Quotes eld
3370 \begin_inset Quotes erd
3381 is only shown when the cursor is within a formula; this state is visualized
3382 by the renaming of the menu entry from
3383 \begin_inset Quotes eld
3387 \begin_inset Quotes erd
3391 \begin_inset Quotes eld
3395 \begin_inset space ~
3399 \begin_inset Quotes erd
3405 \begin_layout Subsection
3409 \begin_layout Standard
3413 \begin_inset space ~
3418 allows you to choose from a large array of symbols used in math: operators,
3419 arrows, relationships, delimiters, special characters, sums and integrals.
3420 Note that subscripting and superscripting allow you to put lower and upper
3421 limits on sums and integrals.
3425 \begin_layout Subsection
3426 Square roots, accents, and delimiters
3429 \begin_layout Standard
3430 To type a square root, just click on the button
3431 \begin_inset Graphics
3432 filename ../images/math/sqrt.png
3439 The square root appears, and the cursor is in a new insertion point inside
3441 You can type variables, numbers, other square roots, fractions, whatever
3443 LyX will automatically resize the square root to fit what is inside.
3446 \begin_layout Standard
3447 Accenting a character (
3448 \begin_inset Formula $\overrightarrow{v}$
3451 ) or group of characters (
3452 \begin_inset Formula $\overrightarrow{a+b}$
3455 ) is done the same way.
3456 Decorations are available from the toolbar via the button
3457 \begin_inset Graphics
3458 filename ../images/math/hat.png
3465 Click on a decoration, and LyX will insert that decoration with an insertion
3466 point under (or over) it.
3467 Just type what you want in the insertion point.
3468 There are two sets of decorations: those that resize with the text you
3469 type, and those that have a fixed size, and are most appropriate for a
3474 \begin_layout Standard
3475 Delimiters such as parentheses, brackets, and braces work similarly, but
3476 are a bit more complicated.
3477 Hit the delimiter button
3478 \begin_inset Graphics
3479 filename ../images/dialog-show_mathdelimiter.png
3490 Your current selection of delimiters is displayed in a box.
3491 It is a pair of parentheses by default, but you can choose a pair of braces,
3492 a brace and a parenthesis, or choose the empty square to have something
3494 \begin_inset Quotes eld
3498 \begin_inset Formula $a=\left\langle 7\right.$
3502 \begin_inset Quotes erd
3505 (the empty delimiter is displayed as a broken line in LyX, but will not
3506 show up in the output).
3509 \begin_layout Standard
3510 If you are lazy, you can type actual parentheses in math mode, rather than
3516 However, those parentheses will be the same size as regular text, which
3517 will look bad if you have a big fraction or matrix inside the parentheses.
3518 So it is better in this case to use one of the three delimiter buttons
3519 that insert directly e.
3520 \begin_inset space \thinspace{}
3524 \begin_inset space \space{}
3528 \begin_inset space \thinspace{}
3534 \begin_layout Standard
3535 You can also put delimiters or a square root sign or a decoration on already
3536 existing formula parts.
3537 Select the portion of the formula that you want to adjust, and then click
3538 on the button you want from the
3541 \begin_inset space ~
3547 Try using this to change Newton's second law from scalar to vector form
3549 \begin_inset Formula $f=ma$
3553 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3557 Once you have learned about matrices, this is how you will put parentheses
3558 or brackets around them.
3561 \begin_layout Subsection
3565 \begin_layout Standard
3566 To create a fraction, click on the fraction button
3567 \begin_inset Graphics
3568 filename ../images/math/frac.png
3578 \begin_inset space ~
3584 LyX writes two insertion points in a fraction.
3585 As you would expect, you can use arrow keys or the mouse to move around
3587 Click on the top square and type
3588 \begin_inset Quotes eld
3592 \begin_inset Quotes erd
3601 \begin_inset Quotes eld
3605 \begin_inset Quotes erd
3609 You have made a fraction! Of course you can type anything within each of
3610 the two boxes: variables with exponents, square roots, other fractions,
3615 \begin_layout Standard
3627 \begin_layout Subsection
3628 Functions: lim, log, sin and others
3631 \begin_layout Standard
3632 Because letters in math mode are considered to be variables, if you type
3634 \begin_inset Quotes eld
3638 \begin_inset Quotes erd
3641 in math mode, LyX thinks you are typing the product of the three variables
3643 \begin_inset Formula $s$
3647 \begin_inset Formula $i$
3651 \begin_inset Formula $n$
3655 The three letters will be typeset in italics, when what you really wanted
3657 \begin_inset Quotes eld
3661 \begin_inset Quotes erd
3665 In addition, LyX will not put a space between the word
3666 \begin_inset Quotes eld
3670 \begin_inset Quotes erd
3674 \begin_inset Quotes eld
3678 \begin_inset Quotes erd
3685 will exit the formula).
3687 \begin_inset Quotes eld
3691 \begin_inset Formula $\sin(x)$
3695 \begin_inset Quotes erd
3699 \begin_inset Quotes eld
3703 \begin_inset Formula $sin(x)$
3707 \begin_inset Quotes erd
3713 \begin_layout Standard
3717 \begin_inset space ~
3723 \begin_inset Graphics
3724 filename ../images/math/functions.png
3731 \begin_inset Quotes eld
3735 \begin_inset Quotes erd
3738 in the appearing function list.
3740 \begin_inset Quotes eld
3744 \begin_inset Quotes erd
3747 is displayed in LyX in black, and set in upright roman type.
3748 The whole word is treated as one symbol, so if you type
3752 , it will delete the whole word.
3754 \begin_inset Quotes eld
3758 \begin_inset Quotes erd
3761 , which will be written in blue italics, like you expect in a formula.
3762 In the output, the expression will be correctly typeset.
3766 \begin_layout Standard
3767 The function list includes other trigonometric functions and their inverses,
3768 hyperbolic functions, logarithms, limits, and quite a few others.
3769 These functions can take subscripts and superscripts, important for typing
3771 \begin_inset Quotes eld
3775 \begin_inset Formula $\cos^{2}\theta$
3779 \begin_inset Quotes erd
3783 \begin_inset Quotes eld
3787 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3791 \begin_inset Quotes erd
3797 \begin_layout Standard
3809 \begin_layout Subsection
3813 \begin_layout Standard
3814 Click on the matrix button
3815 \begin_inset Graphics
3816 filename ../images/dialog-show_mathmatrix.png
3825 \begin_inset space ~
3831 The appearing dialog allows you to choose how many rows and columns you
3832 want in your matrix.
3833 Choose 2 rows and 3 columns and hit
3838 LyX prints 6 insertion points in a
3839 \begin_inset Formula $2\times3$
3843 As usual, you can put any sort of formula expression (a square root, another
3844 matrix, etc.) in each insertion point.
3845 You can also leave some of the insertion points empty if you want.
3848 \begin_layout Standard
3853 can be used to move horizontally between the columns of a matrix.
3854 Alternatively, you can use the arrow keys to move around - hitting
3858 at the end of one box will move to the next box,
3862 will move to the next row, etc.
3865 \begin_layout Standard
3866 If you need to change the number of rows and columns, use the menu
3868 Edit\SpecialChar \menuseparator
3870 \begin_inset space \thinspace{}
3874 \begin_inset space \thinspace{}
3879 or the math toolbar buttons
3880 \begin_inset Graphics
3881 filename ../images/tabular-feature_append-row.png
3888 \begin_inset Graphics
3889 filename ../images/tabular-feature_delete-row.png
3896 \begin_inset Graphics
3897 filename ../images/tabular-feature_append-column.png
3904 \begin_inset Graphics
3905 filename ../images/tabular-feature_delete-column.png
3914 \begin_layout Standard
3919 for information on how to change the horizontal alignment of each column,
3920 and how to change the vertical position of the whole matrix.
3921 Note that if you want to write a table containing text, you should use
3922 LyX's wonderful table support, rather than trying to write text in a matrix.
3925 \begin_layout Subsection
3929 \begin_layout Standard
3930 All of the expressions we have written so far have been on the same line
3931 as the text that came before and after them, otherwise known as inline
3933 This is fine for short, simple expressions, but if you want to write larger
3934 ones, or if you want your expressions to stand out from the text, you need
3935 to write them in display mode.
3936 In addition, only displayed expressions can be labeled and numbered (see
3941 ), and multi-line equations must be in display mode.
3944 \begin_layout Standard
3945 While being in a formula, click on the display button
3946 \begin_inset Graphics
3947 filename ../images/math-display.png
3956 \begin_inset space ~
3962 This centers the formula and adds a blank line before and after it.
3963 Now type in an expression and compile your file to see how it looks.
3964 The display button is actually a toggle; use it now to change a couple
3965 of your expressions to display mode and back.
3969 \begin_layout Standard
3970 Display mode has a couple differences from inline mode:
3973 \begin_layout Itemize
3974 The default font is larger for a few symbols, like
3975 \begin_inset Formula $\sum$
3979 \begin_inset Formula $\int$
3985 \begin_layout Itemize
3986 Subscripts and superscripts for limits and sums (but not integrals) are
3987 written under and over rather than next to the symbols
3990 \begin_layout Itemize
3994 \begin_layout Standard
3995 Other than these differences, though, displayed expressions and inline expressio
3996 ns are very similar.
3999 \begin_layout Standard
4000 One final note about the way displayed formulas are typeset: Be careful
4001 about whether you are putting your equation into a new paragraph or not.
4002 If your formula is in the middle of a sentence or paragraph, then do not
4008 Doing so will cause the text
4012 the formula to start a new paragraph.
4013 That text will be indented or follow a blank line, depending on your document
4014 paragraph settings, which is probably not what you want.
4017 \begin_layout Standard
4022 : Put the various equations in
4026 into display mode, and see how they are typeset differently.
4029 \begin_layout Standard
4034 : Using various tools you have learned in this section, you should be able
4035 to write an equation like:
4039 \begin_layout Plain Layout
4040 After you have done it the hard way, give
4042 Insert\SpecialChar \menuseparator
4043 Math\SpecialChar \menuseparator
4045 \begin_inset space ~
4056 \begin_inset Formula \[
4057 f(x)=\left\{ \begin{array}{cc}
4060 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0
4061 \end{array}\right.\]
4068 \begin_layout Section
4072 \begin_layout Standard
4073 LyX's math editor can do a lot more.
4074 Now you are familiar with the basics, you can refer to the
4081 \begin_layout Itemize
4082 Label and number expressions
4085 \begin_layout Itemize
4086 Create multi-line equations
4089 \begin_layout Itemize
4090 Change typefaces, e.
4091 \begin_inset space \thinspace{}
4095 \begin_inset space \space{}
4098 to write bold-face text in an expression.
4101 \begin_layout Itemize
4102 Fine-tune font sizes and spacing within an expression.
4103 (Do not worry about this until your final draft!)
4106 \begin_layout Itemize
4108 These are very powerful, because you just define them once at the top of
4109 the document, and then you can use them throughout the document.
4112 \begin_layout Itemize
4113 Do lots of other things that we have no space for in this Tutorial.
4116 \begin_layout Chapter
4120 \begin_layout Section
4121 Other major LyX Features
4124 \begin_layout Standard
4125 We have not gone through all the possible commands in LyX, and we are not
4134 \begin_inset space ~
4139 manual for more information.
4140 We will just mention a couple more major things LyX can do:
4143 \begin_layout Itemize
4144 LyX has WYSIWYM support for tables.
4147 Insert\SpecialChar \menuseparator
4151 \begin_inset Graphics
4152 filename ../images/tabular-insert.png
4159 Click on the table with the
4166 \begin_inset space ~
4171 dialog box which allows extensive table editing.
4174 \begin_layout Itemize
4175 LyX also supports including pictures in any format within documents.
4178 Insert\SpecialChar \menuseparator
4182 \begin_inset Graphics
4183 filename ../images/dialog-show-new-inset_graphics.png
4190 Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4191 can have captions, and LyX will automatically generate lists of figures
4195 \begin_layout Itemize
4196 LyX is heavily configurable.
4197 Everything from how the LyX window looks to how the output comes out can
4198 be configured in a number of ways.
4199 Much configuration is done through
4201 Tools\SpecialChar \menuseparator
4205 For more information on this, check out
4207 Help\SpecialChar \menuseparator
4208 Customization\SpecialChar \@.
4212 \begin_layout Itemize
4213 LyX is being developed by a team of programmers on five continents.
4214 Therefore, LyX has better support for non-English languages (such as Dutch,
4215 German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4216 ) than many word processors.
4217 Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4218 languages Chinese Japanese, and Korean are supported.
4219 You can write documents in other languages and you can also configure LyX
4220 to show its menus and error messages in other languages.
4224 \begin_layout Itemize
4225 The LyX menus feature keybindings.
4226 This means that you can do
4228 File\SpecialChar \menuseparator
4239 or by using the binding which is shown next to it in the menu (Ctrl+O by
4241 Keybindings are also configurable.
4242 For information on this, check out
4244 Help\SpecialChar \menuseparator
4245 Customization\SpecialChar \@.
4249 \begin_layout Itemize
4250 LyX can read LaTeX documents.
4252 \begin_inset space ~
4256 \begin_inset CommandInset ref
4258 reference "sec:tex2lyx"
4265 \begin_layout Itemize
4266 Spell-checking, thesaurus, and word count facilities are available.
4269 \begin_layout Itemize
4270 Generation of indexes and nomenclatures/glossaries is supported.
4273 \begin_layout Section
4275 \begin_inset CommandInset label
4277 name "sec:latexusers"
4284 \begin_layout Standard
4285 If you do not know anything about LaTeX, you do not have to read this section.
4286 Actually, you might want to
4290 about LaTeX, and then read this chapter.
4291 However, some who begin to use LyX will be familiar with LaTeX.
4292 If you are such a person, you may be wondering if LyX can really do everything
4294 The short answer is that LyX can do pretty much everything LaTeX can do
4295 in one form or another, and it definitely simplifies most parts of writing
4299 \begin_layout Standard
4300 Because this is just a tutorial, we are only going to mention things that
4301 new LyX users will most likely be interested in.
4302 In the interests of keeping the Tutorial short, we will give only minimal
4307 \begin_inset space ~
4315 \begin_inset space ~
4320 manual have a great deal of information on differences between LyX and
4321 LaTeX, and how to do various LaTeX tricks in LyX.
4324 \begin_layout Subsection
4328 \begin_layout Standard
4329 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4330 will be displayed in red on the screen.
4331 You can use TeX commands in LyX by choosing
4333 Insert\SpecialChar \menuseparator
4335 \begin_inset space ~
4341 \begin_inset Graphics
4342 filename ../images/ert-insert.png
4349 This creates a box where everything within it is passed straight to LaTeX.
4352 \begin_layout Standard
4353 In a math formula, TeX mode is handled a bit differently.
4354 TeX mode is there entered by typing a backslash.
4355 The backslash is not written out, but anything you type afterwards will
4357 You exit TeX mode by typing
4361 or some other non-alphabetic character, like a number, underscore, caret,
4363 Once you exit TeX mode, if LyX knows the TeX command you have typed in,
4364 it will convert it to WYSIWYM\SpecialChar \@.
4366 \begin_inset Quotes eld
4376 \begin_inset Quotes erd
4379 in a formula and then press
4383 , LyX will change the red
4384 \begin_inset Quotes eld
4388 \begin_inset Quotes erd
4392 \begin_inset Quotes eld
4396 \begin_inset Formula $\gamma$
4400 \begin_inset Quotes erd
4404 This will work for almost all, non-complicated math macros.
4405 This may be faster than using the
4408 \begin_inset space ~
4413 , and will be especially convenient for experienced LaTeX users.
4416 \begin_layout Standard
4417 As a special case, if you type
4418 \begin_inset Quotes eld
4428 \begin_inset Quotes erd
4431 in a formula, the beginning
4435 ending braces will be inserted in red while the cursor is placed between
4437 This makes it more convenient to type those commands which take an argument.
4440 \begin_layout Standard
4441 LyX cannot do absolutely everything that LaTeX can do.
4442 Some fancy functions are not supported at all, while some work but are
4444 TeX mode allows users to get the full flexibility of LaTeX, while having
4445 all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4446 LyX could never support every LaTeX package.
4453 in the preamble (see section
4454 \begin_inset space ~
4458 \begin_inset CommandInset ref
4460 reference "sec:preamble"
4464 ), you can use any package you want — although you will not have WYSIWYM
4465 support for that package's features.
4468 \begin_layout Subsection
4469 Importing LaTeX Documents
4470 \change_deleted 2 1263335457
4472 \change_inserted 2 1263335459
4480 \begin_inset CommandInset label
4489 \begin_layout Standard
4490 You can import a LaTeX file into LyX by using the
4492 File\SpecialChar \menuseparator
4493 Import\SpecialChar \menuseparator
4495 \begin_inset space ~
4501 This will call the program
4502 \begin_inset Flex CharStyle:Code
4505 \begin_layout Plain Layout
4511 which will create a file
4512 \begin_inset Flex CharStyle:Code
4515 \begin_layout Plain Layout
4522 \begin_inset Flex CharStyle:Code
4525 \begin_layout Plain Layout
4532 \change_inserted 2 1263337184
4534 \change_deleted 2 1263337185
4537 then open that file.
4538 If the translation does not work, you can try calling
4539 \begin_inset Flex CharStyle:Code
4542 \begin_layout Plain Layout
4548 from the command line, possibly using fancier options.
4551 \begin_layout Standard
4553 \change_inserted 2 1263337199
4554 Even when the translation does work,
4557 \begin_inset Flex CharStyle:Code
4560 \begin_layout Plain Layout
4567 \change_inserted 2 1263337202
4569 \change_deleted 2 1263337203
4573 \change_deleted 2 1263337205
4574 most legal LaTeX, but not
4577 \change_inserted 2 1263337217
4578 , though it does handle most legal LaTeX
4581 It will leave things it does not understand in TeX mode; so, after translating
4583 \begin_inset Flex CharStyle:Code
4586 \begin_layout Plain Layout
4592 , you can look for the red text and manually edit it to get it right.
4595 \begin_layout Standard
4596 \begin_inset Flex CharStyle:Code
4599 \begin_layout Plain Layout
4606 \change_inserted 2 1263337255
4608 \change_deleted 2 1263337260
4610 \change_inserted 2 1263337293
4611 , which *nix users can access via
4612 \begin_inset Flex CharStyle:Code
4615 \begin_layout Plain Layout
4617 \change_inserted 2 1263337285
4626 The manpage describes
4627 \change_deleted 2 1263337296
4630 which LaTeX commands and environments are not supported,
4631 \change_inserted 2 1263335470
4632 what bugs you might run into
4633 \change_deleted 2 1263335471
4636 (and how to get around them), and how to use the various options.
4637 \change_inserted 2 1263335473
4641 \begin_layout Standard
4643 \change_inserted 2 1263337717
4644 It is extremely important to understand that
4645 \begin_inset Flex CharStyle:Code
4648 \begin_layout Plain Layout
4650 \change_inserted 2 1263335502
4658 can only translate files whose document class is
4659 \begin_inset Quotes eld
4663 \begin_inset Quotes erd
4666 to LyX, that is, for which there is a corresponding LyX `layout file'.
4667 If there is no layout file, then you will get an error saying that the
4668 conversion could not be performed.
4669 The reason for this is that, in a sense, LyX doesn't know anything about
4670 LaTeX: very little of the information LyX has about LaTeX is contained
4671 in the program itself.
4672 That information is instead contained in layout files.
4673 You can think of the layout file for a document class as a translation
4674 manual between LyX constructs---paragraphs with their corresponding styles,
4675 etc---and the corresponding LaTeX commands and environments.
4676 So, unless you have a layout for
4677 \begin_inset Flex CharStyle:Code
4680 \begin_layout Plain Layout
4682 \change_inserted 2 1263336322
4691 \begin_inset Flex CharStyle:Code
4694 \begin_layout Plain Layout
4696 \change_inserted 2 1263336331
4704 simply will not now how to translate the LaTeX that it finds there into
4705 things LyX understands.
4708 \begin_layout Standard
4710 \change_inserted 2 1263337784
4711 When you installed LyX, you also installed layout files for almost 100 different
4712 document types (though some of these are DocBook, rather than LaTeX).
4713 Still, there are many, many more document classes than that, and new ones
4714 are probably invented every day.
4715 There is no way that LyX itself can include layout files for every document
4716 class you might want to use.
4719 \begin_layout Standard
4721 \change_inserted 2 1263337857
4722 So what can you do if LyX does not include a layout file for your fancy
4723 new document class? Create your own.
4724 If your new document class is based upon, or very similar to, one for which
4725 there already is a layout file, which is true in many cases, then creating
4726 a new layout file may be as easy as copying a file and changing a few lines.
4727 In the other cases, you may have more work to do.
4728 But while you will have to learn a bit, it is not really that difficult,
4729 and many of the people who contribute to the users' mailing list have a
4730 great deal of experience they are willing to share.
4735 \begin_layout Standard
4737 \change_inserted 2 1263337162
4738 The format of LyX's layout files and the process of creating new ones are
4739 discussed in detail in Chapter 5 of the
4748 \begin_layout Subsection
4749 Converting LyX Documents to LaTeX
4752 \begin_layout Standard
4753 You might wish to convert a LyX Document to a LaTeX file.
4754 For example, a co-worker or co-author who does not have LyX might want
4758 File\SpecialChar \menuseparator
4759 Export\SpecialChar \menuseparator
4763 This will create a file
4771 file you are editing.
4772 LyX always creates temporary LaTeX files when viewing or printing files.
4775 \begin_layout Subsection
4779 \begin_layout Subsubsection
4783 \begin_layout Standard
4786 Document\SpecialChar \menuseparator
4789 dialog takes care of the document-wide options.
4790 You can change there the document class, default font size and paper size.
4791 Document class options but also options for LaTeX packages can be entered
4795 \begin_inset space ~
4803 \begin_layout Subsubsection
4804 Other Preamble Matter
4805 \begin_inset CommandInset label
4814 \begin_layout Standard
4815 If you have special commands to put in the preamble of a LaTeX file, you
4816 can use them in a LyX document as well.
4819 Document\SpecialChar \menuseparator
4820 Settings\SpecialChar \menuseparator
4822 \begin_inset space ~
4827 and type in the dialog window (or from the document settings dialog, depending
4829 Anything you type will (as with TeX mode) be sent directly to LaTeX.
4832 \begin_layout Subsection
4836 \begin_layout Standard
4837 LyX has support for BibTeX, which allows you to build databases of bibliographic
4838 al references to be used in multiple documents.
4841 Insert\SpecialChar \menuseparator
4843 \begin_inset space \thinspace{}
4847 \begin_inset space \thinspace{}
4850 TOC\SpecialChar \menuseparator
4852 \begin_inset space ~
4866 field you load BibTeX files, in the
4870 field you can load BibTeX style files.
4873 \begin_layout Standard
4874 After you have done this, you can use citations from any bibliographies
4875 you are including with
4877 Insert\SpecialChar \menuseparator
4881 \begin_inset space ~
4885 \begin_inset CommandInset ref
4887 reference "sec:bibliographies"
4892 LyX will take care of running BibTeX.
4897 dialog will show a list of all the references in your
4904 \begin_layout Section
4908 \begin_layout Standard
4909 Sometimes when you try to view a document, there will be errors, things
4910 that LyX or LaTeX cannot understand.
4911 When this happens, LyX will open a
4914 \begin_inset space ~
4920 Clicking on individual errors in this dialog will take you to the place
4921 in the LyX document where the error occurs and also display the detailed
4922 LaTeX error message.