1 #LyX 1.6.8svn 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
46 \font_typewriter default
47 \font_default_family default
57 \pdf_title "The LyX Tutorial"
58 \pdf_author "LyX Team"
59 \pdf_subject "LyX-documentation Tutorial"
60 \pdf_keywords "LyX, documentation"
62 \pdf_bookmarksnumbered true
63 \pdf_bookmarksopen true
64 \pdf_bookmarksopenlevel 1
69 \pdf_pdfusetitle false
70 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
77 \paperorientation portrait
80 \paragraph_separation indent
82 \quotes_language english
85 \paperpagestyle headings
86 \tracking_changes false
103 \begin_layout Plain Layout
104 If you have comments or error corrections, please send them to the LyX Documenta
108 \begin_inset CommandInset href
110 target "lyx-docs@lists.lyx.org"
125 \begin_layout Standard
126 \begin_inset CommandInset toc
127 LatexCommand tableofcontents
134 \begin_layout Chapter
138 \begin_layout Section
142 \begin_layout Standard
143 This file is designed for all of you who have never heard of LaTeX, or do
144 not know it very well.
145 Now, do not panic - you will not need to learn LaTeX to use LyX.
146 That is, after all, the whole point of LyX: to provide an almost-WYSIWYG
148 There are some things you will need to learn, however, in order to use
152 \begin_layout Standard
153 Some of you probably found your way to this document because you tried to
154 put two spaces after a
155 \begin_inset Quotes eld
159 \begin_inset Quotes erd
162 or tried to put three blank lines between paragraphs.
163 You found out you could not and in fact, you will find out that most of
164 the little tricks you are accustomed to use in other word processors will
166 That is because most word processors you have used before allow you to
167 manually enter all spacings, font changes, and so on.
168 So you end up not only writing a document but typesetting it, too.
169 LyX does the typesetting for you, in a consistent fashion, letting you
170 focus on the important things, like the content of your writing.
173 \begin_layout Standard
174 So read on to learn more about LyX.
175 Reading this tutorial is definitely worth the time.
178 \begin_layout Section
188 \begin_layout Standard
189 Before we get started with this section, we want to make a quick note of
195 uses the notation outlined in the
200 If you came to this manual first, please read the
204 before you continue with the
211 \begin_layout Standard
212 Now that you know which fonts mean what, we want to talk a bit about what
220 \begin_layout Subsection
221 Getting the most out of the Tutorial
224 \begin_layout Standard
225 This tutorial consists of examples and exercises.
226 To get the most out of this document, you should read through the document,
227 typing all the little things we are telling you to type and trying out
228 all of the exercises to see if you get them right.
229 For convenience, you might want to print out the PDF version of this document.
232 \begin_layout Standard
233 If you are familiar with LaTeX, you will probably be able to read the
237 somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
238 However, LyX has features you will want to learn about.
239 Even if you do not feel like reading the rest of the
243 , you should definitely check out Section
248 \begin_inset CommandInset ref
250 reference "sec:latexusers"
254 , which is specifically written for experienced LaTeX users.
257 \begin_layout Subsection
265 \begin_layout Itemize
266 Detailed explanations of all of LyX's features.
270 \begin_layout Standard
279 \begin_layout Itemize
280 Detailed explanations of LaTeX.
284 \begin_layout Standard
286 If you want to learn some of the neat tricks you can do with LaTeX in LyX,
287 you can have a look at the
299 \begin_layout Standard
300 It is time to move onwards, time for your first document \SpecialChar \ldots{}
304 \begin_layout Chapter
305 Getting started with LyX
308 \begin_layout Section
309 Your first LyX document
312 \begin_layout Standard
314 You are ready to start writing.
315 Before you do, there are a few things we need to mention, which will hopefully
316 make the Tutorial more instructive and useful.
320 \begin_layout Standard
321 Because there is information we cannot give you in the Tutorial, the
327 thing that you need to do is find the
334 Start up LyX, Choose the
343 You may want to load the
347 as well (if you are not reading it within LyX already).
348 This way, you can read them while you are writing your own file.
352 \begin_layout Plain Layout
353 They can also serve as good examples of how to use the many features of
359 Note that once you have got more than one document open, you can use the
364 menu or the document tabs to switch between them.
367 \begin_layout Standard
368 In this Tutorial, we are going to assume that you have a fully working version
369 of LyX, as well as a LaTeX-distribution, a DVI-, and a PDF-viewer.
370 This should be the case on all major Linux- and BSD-distributions, as well
371 as on Windows, where this is setup by the LyX installers.
374 \begin_layout Standard
375 Finally, we have written a file called
379 to let you practice your LyX skills.
380 Imagine that it was typed by someone who did not know about any of LyX's
382 As you learn new LyX functions, we will suggest that you fix those parts
388 It also contains `subtle' hints about how to fix things.
392 \begin_layout Plain Layout
393 The hints are located in yellow
394 \begin_inset Quotes eld
398 \begin_inset Quotes erd
402 Access the text in a note by clicking on it.
407 If you want to cheat, or check what you have done, there is also a file
412 which contains the same text written and typeset by a LyX master.
415 \begin_layout Standard
416 The example files can be found in the
420 directory of LyX's installation folder.
421 Open the raw document, and use
423 File\SpecialChar \menuseparator
430 to save a copy in your own directory for you to work on.
431 As you fix parts of the raw document, check to see how those changes affect
435 \begin_layout Standard
440 directory contains lots of other examples files.
441 They will show you how to do various fancy things with LyX.
442 After you have read the Tutorial, or when you are confused about how to
443 do something fancy in LyX, take a look at these files.
446 \begin_layout Subsection
447 Typing, Viewing, and Exporting
450 \begin_layout Itemize
453 File\SpecialChar \menuseparator
457 \begin_layout Itemize
458 Type a sentence like:
460 This is my first LyX document!
463 \begin_layout Itemize
464 Save your document with
466 File\SpecialChar \menuseparator
475 \begin_layout Itemize
476 Run LaTeX to create a DVI file, with
478 View\SpecialChar \menuseparator
481 or the toolbar button
482 \begin_inset Graphics
483 filename ../images/buffer-view_dvi.png
489 LyX will open a DVI-viewer program displaying your document as it will
494 \begin_layout Plain Layout
495 You can save time by leaving the DVI-viewer running in the background.
498 View\SpecialChar \menuseparator
499 Update\SpecialChar \menuseparator
502 or the toolbar button
503 \begin_inset Graphics
504 filename ../images/buffer-update_dvi.png
509 and just click on the DVI-viewer window (or unminimize it) after LaTeX
518 \begin_layout Itemize
519 Export the ready to print document with
521 File\SpecialChar \menuseparator
529 \begin_layout Standard
530 Congratulations! You have written your first LyX document.
531 All of the rest is just details, which are covered in the other manuals.
534 \begin_layout Subsection
538 \begin_layout Standard
539 LyX can of course do most of the things you are used to do with a word processor.
540 It will word-wrap and indent paragraphs automatically.
541 Here is a quick description of how to do some simple actions.
544 \begin_layout Description
545 Undo LyX has multiple levels of undo, which means you can undo everything
546 you have done since your current editing session started, by selecting
549 Edit\SpecialChar \menuseparator
553 \begin_inset Graphics
554 filename ../images/undo.png
559 ) over and over again.
560 If you undo too much, just select
562 Edit\SpecialChar \menuseparator
566 \begin_inset Graphics
567 filename ../images/redo.png
577 \begin_layout Standard
578 Currently, undo is limited to 100 steps.
582 \begin_layout Description
585 Edit\SpecialChar \menuseparator
589 \begin_inset Graphics
590 filename ../images/cut.png
597 Edit\SpecialChar \menuseparator
601 \begin_inset Graphics
602 filename ../images/copy.png
609 Edit\SpecialChar \menuseparator
613 \begin_inset Graphics
614 filename ../images/paste.png
619 ) to cut, copy, and paste.
620 Or automatically paste selected text (including selections from other programs)
628 \begin_layout Description
631 Edit\SpecialChar \menuseparator
643 \begin_inset Graphics
644 filename ../images/dialog-show_findreplace.png
650 In the dialog, search with the
662 button to replace a word you have found.
666 \begin_layout Plain Layout
667 Close the window when you are done or leave it open if you find it more
669 Most dialog boxes in LyX can operate like this.
670 Just be sure you have the right window focus when you are trying to type
671 in the main LyX window or a LyX dialog.
676 If you like, you can specify whether to make the search case-sensitive,
677 or to search for only complete words; you can also search backwards through
681 \begin_layout Description
690 text (which will by default print characters in italics), set it in
698 (usually small caps, used for people's names), or use your own formatting
701 Edit\SpecialChar \menuseparator
708 dialog (toolbar button
709 \begin_inset Graphics
710 filename ../images/dialog-show_character.png
718 \begin_layout Description
719 Toolbar There are buttons on the toolbar (just below the menus) which allow
720 you to do some of the more popular functions, such as
731 \begin_layout Standard
732 Of course, you have not yet written enough to make most of these functions
734 As you write more, though, try undoing, pasting, etc.
737 \begin_layout Subsection
738 WYSIWYM: Whitespace in LyX
741 \begin_layout Standard
742 One of the hardest things for new users to get used to is the way that LyX
744 As many times as you hit
748 , you will only get one blank line.
749 As many times as you hit
753 , you will only get one space.
754 On a blank line, LyX will not let you type even one space.
759 key will not move you forward one tab stop; in fact there
763 no tab stops! There is no ruler at the top of the page to let you set tabs
767 \begin_layout Standard
768 Many word processors are based on the WYSIWYG principle:
769 \begin_inset Quotes eld
772 What You See Is What You Get.
773 \begin_inset Quotes erd
776 LyX, on the other hand, is based on the principle that
777 \begin_inset Quotes eld
780 What You See Is What You
785 \begin_inset Quotes erd
788 You type what you mean, and LyX will take care of typesetting it for you,
789 so that the output looks nice.
794 grammatically separates paragraphs, and a
798 grammatically separates words, so there is no reason to have several of
803 has no grammatical function at all, so LyX does not support it.
804 Using LyX, you will spend more of your time worrying about the
808 of your document, and less time worrying about the
817 for more information on the WYSIWYM concept.
820 \begin_layout Standard
821 LyX does have (many) ways to fine-tune the formatting of your document.
822 After all, LyX might not typeset
831 has information about all that.
832 It includes horizontal fills and vertical space — which are more powerful
833 and versatile than multiple spaces or blank lines — and ways to change
834 font sizes, character styles, and paragraph alignments by hand.
835 The idea, though, is that you can write your whole document, focusing on
836 content, and just worry about that fine-tuning at the end.
837 With standard word processors, you will be distracted by document formatting
838 throughout the writing process.
841 \begin_layout Section
845 \begin_layout Standard
846 Different parts of a document have different purposes; we call these parts
852 Most of a document is made up of regular text.
853 Section titles (chapter, subsection, etc.) let the reader know that a new
854 topic or subtopic will be discussed.
855 Certain types of documents have special environments.
856 A journal article will have an abstract and a title.
857 A letter will have neither of these, but will probably have an environment
858 that gives the writer's address.
861 \begin_layout Standard
862 Environments are a major part of the
863 \begin_inset Quotes eld
866 What You See Is What You Mean
867 \begin_inset Quotes erd
871 A given environment may require a certain font style, font size, indenting,
872 line spacing, and more.
873 This problem is aggravated, because the exact formatting for a given environmen
874 t may change: one journal may use boldface, 18 point, centered type for
875 section titles while another uses italicized, 15 point, left justified
876 type; different languages may have different standards for indenting; and
877 bibliography formats can vary widely.
878 LyX lets you avoid learning all the different formatting styles.
881 \begin_layout Standard
886 choice box is located on the left end of the toolbar and looks like this:
888 \begin_inset Graphics
889 filename clipart/ToolbarEnvBox.png
896 It indicates in which environment you are currently writing.
897 While you were writing your first document, it said
898 \begin_inset Quotes eld
902 \begin_inset Quotes erd
905 which is the default environment for text.
906 Now you will put a number of environments in your new document so that
907 you can see how they work.
910 \begin_layout Subsection
911 Sections and Subsections
914 \begin_layout Standard
919 on the first line of your LyX file, and select
931 \begin_layout Plain Layout
937 If nothing is selected, LyX changes the paragraph you are currently in
938 to the selected environment.
939 Alternatively, you can change several paragraphs to a different environment
940 by selecting them before picking an environment.
957 , which will be covered below.
958 LyX numbers the section
959 \begin_inset Quotes eld
963 \begin_inset Quotes erd
966 and typesets the section heading (title) in a larger font.
977 \begin_inset Quotes eld
981 \begin_inset Quotes erd
985 \begin_inset Quotes eld
989 \begin_inset Quotes erd
993 Section headings, like most environments, are assumed to end when you type
999 Type the document introduction:
1002 \begin_layout LyX-Code
1003 This is an introduction to my first LyX document.
1006 \begin_layout Standard
1021 \begin_inset Quotes eld
1025 \begin_inset Quotes erd
1028 and waits for you to type a title.
1030 \begin_inset Quotes eld
1036 \begin_inset space ~
1042 \begin_inset Quotes erd
1045 , and you will see that LyX again sets it as a section title.
1048 \begin_layout Standard
1050 Go to the end of Section
1051 \begin_inset space ~
1055 \begin_inset Quotes eld
1058 my first LyX document
1059 \begin_inset Quotes erd
1076 \begin_inset Quotes eld
1080 \begin_inset Quotes erd
1083 and waits for you to type a title.
1090 \begin_inset space ~
1094 \begin_inset Quotes eld
1098 \begin_inset Quotes erd
1102 \begin_inset space ~
1105 2, has been automatically renumbered to Section
1106 \begin_inset space ~
1109 3! In true WYSIWYM fashion, you just need to identify the text that makes
1110 up the section titles, and LyX takes care of numbering the sections and
1114 \begin_layout Standard
1123 environment, and type the following five lines:
1126 \begin_layout LyX-Code
1127 Sections and subsections are described below.
1130 \begin_layout LyX-Code
1134 \begin_layout LyX-Code
1135 Sections are bigger than subsections.
1138 \begin_layout LyX-Code
1139 Subsection description
1142 \begin_layout LyX-Code
1143 Subsections are smaller than sections.
1146 \begin_layout Standard
1147 Click on the second line and select
1156 LyX numbers the subsection
1157 \begin_inset Quotes eld
1161 \begin_inset Quotes erd
1164 , and typesets it in a font which is bigger than regular text but smaller
1165 than the section title.
1166 Change the fourth line
1170 environment as well.
1171 As you probably expected, LyX automatically numbered the section
1172 \begin_inset Quotes eld
1176 \begin_inset Quotes erd
1180 If you put yet another section before Section
1181 \begin_inset space ~
1185 \begin_inset space ~
1188 2 will be renumbered as Section 3, and the subsections will be renumbered
1190 \begin_inset Quotes eld
1194 \begin_inset Quotes erd
1198 \begin_inset Quotes eld
1202 \begin_inset Quotes erd
1209 \begin_layout Standard
1210 Further levels of sectioning include
1223 We will let you play with these on your own.
1224 You may notice that paragraph and subparagraph headings are not numbered
1225 by default, and that subparagraphs are indented; see the
1229 for an explanation and how to change this.
1234 headings are actually the highest level of sectioning, above
1238 s, but you are only allowed to use them in certain types (text classes)
1239 of LyX documents (see Section
1240 \begin_inset space ~
1244 \begin_inset CommandInset ref
1246 reference "sec:Document-Classes"
1254 \begin_layout Standard
1255 Finally, you may want to have sections or subsections that are not numbered.
1256 There are environments for this as well.
1257 If you change one of your section headings to the
1261 environment (you may have to scroll down in the
1265 box to find it), LyX will use the same font size for the heading as it
1266 uses for a regular section, but it will not number that section.
1267 There are corresponding
1268 \begin_inset Quotes eld
1272 \begin_inset Quotes erd
1275 heading environments for
1284 Try changing some of your sections or subsections to the starred environments,
1285 and note how the other section numbers are updated.
1288 \begin_layout Standard
1293 : Fix the section and subsection headings in
1301 \begin_layout Subsection
1305 \begin_layout Standard
1306 LyX has several different environments for typesetting lists.
1307 The various list environments free you from hitting
1311 a million times when writing an outline, or from renumbering a whole list
1312 when you want to add a point in the middle of the list.
1313 Different types of documents logically require different list environments:
1316 \begin_layout Itemize
1317 A slide presentation might use the
1321 environment's bulleted lists to describe different points.
1325 \begin_layout Itemize
1326 An outline would use the
1330 environment's numbered lists (and lettered sublists).
1334 \begin_layout Itemize
1335 A document describing several software packages could use the
1339 environment, where each item in the list begins with a bold-faced word.
1343 \begin_layout Itemize
1348 environment is a variation on the
1355 \begin_layout Standard
1356 Let us write a list of reasons why LyX is better than other word processors.
1357 Somewhere in your document, type:
1360 \begin_layout Standard
1363 LyX is better than other word processors because:
1366 \begin_layout Standard
1382 \begin_inset Quotes eld
1386 \begin_inset Quotes erd
1390 Type in your reasons:
1393 \begin_layout LyX-Code
1394 Typesetting is done for you.
1397 \begin_layout LyX-Code
1401 \begin_layout LyX-Code
1402 Lists are very easy to create!
1405 \begin_layout Standard
1406 List environments, unlike headings, do not end when you type
1411 Instead, LyX assumes you are going on to the next item in the list.
1412 The above will therefore result in a three-item list.
1413 If you want more than one paragraph within one list
1417 , one way is to use the
1420 \begin_inset space ~
1425 , which you get by typing
1430 In order to get out of the list, you need to reselect the
1434 environment (or just use the key binding,
1437 \begin_inset space ~
1445 \begin_layout Standard
1446 You have got a beautiful itemized list.
1447 You might want to run LaTeX to see how the list looks when printed out.
1448 But what if you wanted to number the reasons? Well, just select the whole
1453 \begin_layout Plain Layout
1454 LyX will not let you select the first bullet unless you also select the
1459 the list, which you probably do not want to do.
1460 Similarly, you cannot select the actual number in a numbered section title.
1461 This is on purpose because the bullet or number depends on the document
1462 settings or text position, respectively.
1476 Pow! As we mentioned, if you add or delete a list item, LyX will fix the
1480 \begin_layout Standard
1481 While the list is still selected, you can change to the other two list environme
1490 , in order to see what they look like.
1491 For those two environments, each list item is made up of a term, which
1492 is the item's first word, followed by a definition, which is the rest of
1493 the paragraph (until you hit
1497 .) The term is either typeset in boldface (
1502 \begin_inset Quotes eld
1506 \begin_inset Quotes erd
1513 \begin_layout Plain Layout
1514 But a typesetter's tab, which will change to fit the size of the largest
1515 term, not a pathetic, rigid, unchangeable typewriter
1528 ) from the rest of the paragraph.
1529 If you want to have more than one word in the definition, then separate
1533 \begin_inset space ~
1541 \begin_layout Standard
1546 : Typeset the list in
1551 \begin_layout Standard
1552 You can nest lists within each other in all sorts of interesting ways.
1553 An obvious example would be writing outlines.
1554 Numbered and bulleted lists will have different numbering and bulleting
1555 schemes for sublists.
1560 for details on the different sorts of lists and for examples of nestings.
1563 \begin_layout Subsection
1564 Other environments: Verses, Quotations, and more
1567 \begin_layout Standard
1568 There are two environments for setting quotations apart from surrounding
1573 for short quotes and
1586 \begin_layout Plain Layout
1587 used in this Tutorial for the long typing examples
1596 font; this environment is the only place in LyX where you are allowed to
1597 use multiple spaces to allow code indenting.
1598 You can even write poetry using the
1606 to separate stanzas, and
1610 to separate lines within a stanza.
1615 for more complete descriptions of all of the available LyX environments.
1618 \begin_layout Standard
1623 : Correctly typeset the
1632 \begin_inset Newline newline
1640 \begin_layout Chapter
1644 \begin_layout Standard
1645 The previous chapter hopefully allowed you to get used to writing in LyX.
1646 It introduced you to the basic editing operations in LyX, as well as the
1647 powerful method of writing with environments.
1648 Most people who use LyX, though, will want to write documents: papers,
1649 articles, books, manuals, or letters.
1650 This chapter is meant to take you from simply writing text with LyX to
1651 writing a complete document.
1652 It will introduce you to text classes, which allow you to write different
1654 It will then describe many of the additions that turn text into a document,
1655 such as titles, footnotes, cross references, bibliographies, and tables
1659 \begin_layout Section
1661 \begin_inset CommandInset label
1663 name "sec:Document-Classes"
1670 \begin_layout Standard
1671 Different sorts of documents should be typeset differently.
1672 For example, books are generally printed double-sided, while articles are
1674 In addition, many documents contain special environments: letters contain
1675 some environments — such as the sender's address and the signature — which
1676 do not make sense in a book or article.
1685 \begin_layout Plain Layout
1686 for LaTeX users: this is equivalent to the LaTeX document class
1691 takes care of these large scale differences between different sorts of
1693 This Tutorial, for example, was written in the
1698 Document classes are another major part of the WYSIWYM philosophy; they
1699 tell LyX how to typeset the document, so you do not need to know how.
1702 \begin_layout Standard
1703 Your document is probably being written in the
1711 \begin_layout Plain Layout
1712 That is usually the default document class
1717 Try changing to other document classes (using the
1719 Document\SpecialChar \menuseparator
1722 dialog) to see how they are typeset differently.
1723 If you change your document to the
1727 document class and look at the
1731 box, you will see that most of the allowed environments are the same.
1732 However, you can now use the
1737 If you are ever unsure about which environments you can use in a given
1738 document class, just consult the
1745 \begin_layout Standard
1746 Font sizes, one- or two-column printing, and page headings are just some
1747 of the ways journals typesettings differ from one another.
1748 As the Computer Age continues to mature, journals have begun accepting
1749 electronic submissions, creating LaTeX
1750 \begin_inset Quotes eld
1754 \begin_inset Quotes erd
1757 so that authors can submit correctly typeset articles.
1758 LyX is set up to support this as well.
1759 For example, LyX supports typesetting (and extra environments) for the
1760 American Mathematics Society journals using the
1763 \begin_inset space ~
1771 \begin_layout Standard
1772 Here is a very quick reference to some of the document classes.
1775 Special Document Classes
1781 manual for many more details.
1784 \begin_layout Standard
1786 \begin_inset Tabular
1787 <lyxtabular version="3" rows="7" columns="2">
1789 <column alignment="center" valignment="top" width="0pt">
1790 <column alignment="center" valignment="top" width="0pt">
1792 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1795 \begin_layout Plain Layout
1801 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1804 \begin_layout Plain Layout
1812 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1815 \begin_layout Plain Layout
1821 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1824 \begin_layout Plain Layout
1825 one-sided, no chapters
1832 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1835 \begin_layout Plain Layout
1841 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1844 \begin_layout Plain Layout
1845 layout & environments for American Math Society
1852 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1855 \begin_layout Plain Layout
1861 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1864 \begin_layout Plain Layout
1865 longer than article, two-sided
1872 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1875 \begin_layout Plain Layout
1881 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1884 \begin_layout Plain Layout
1885 report + front and back matter
1892 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1895 \begin_layout Plain Layout
1901 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1904 \begin_layout Plain Layout
1912 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1915 \begin_layout Plain Layout
1921 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1924 \begin_layout Plain Layout
1925 lots of extra environments for address, signature\SpecialChar \ldots{}
1939 \begin_layout Section
1940 Templates: Writing a Letter
1943 \begin_layout Standard
1944 One way to write a letter would be to open a new file, and choose a
1950 Document\SpecialChar \menuseparator
1954 While this is the most obvious way to write a letter, it seems like extra
1956 Every time you write a business letter, you want to have your address,
1957 the address to which you are sending it, a body, a signature, etc.
1962 for letters, which contains a sample letter; once you have a template,
1963 you can just replace a couple of parts of the letter with your text each
1964 time you write a letter.
1967 \begin_layout Standard
1968 Open a new file with
1970 File\SpecialChar \menuseparator
1972 \begin_inset space ~
1976 \begin_inset space ~
1987 Save and print the file to see how the various environments are typeset.
1990 \begin_layout Standard
1991 When you look at the
1995 box, you will see several environments, like the
1998 \begin_inset space ~
2003 environment, which do not even exist in most other document classes.
2009 You can play around for a while to figure out how the various environments
2011 You will notice for example that the
2015 environment has the word
2016 \begin_inset Quotes eld
2020 \begin_inset Quotes eld
2023 in red before the actual text of the signature.
2024 This word does not show up in the actual letter, as you will see if you
2025 view/export the file.
2026 It is just there to let you know where the signature goes.
2027 Also, note that it does not matter where in the file the
2032 Remember, LyX is WYSIWYM; you can put the
2036 environment anywhere you want, but LyX knows that in the printout, the
2037 signature should be at the end.
2040 \begin_layout Standard
2041 A template is just a regular LyX file.
2042 This means you can fill in your address and signature and save the file
2044 From now on, any time you want to write a letter, you can use the new template
2046 We do not have to suggest an actual
2047 \begin_inset Quotes eld
2051 \begin_inset Quotes erd
2054 here; just write a letter to someone!
2058 \begin_layout Plain Layout
2059 One warning, if you are writing from a template.
2060 If you erase all of the text in an environment — for example, if you erase
2064 \begin_inset space ~
2069 field so that you can replace it with your own — and then you move the
2070 cursor without writing any text, the environment may disappear.
2071 This is because most environments cannot exist without any text in them.
2072 Just reselect the environment from the
2084 \begin_layout Standard
2085 Templates can be a huge time-saver, and we urge you to use them whenever
2087 In addition, they can help a person learn how to use some of the fancier
2089 Finally, they may be useful for a person who is configuring LyX for a bunch
2090 of less computer-aware users.
2091 When they are first learning LyX, it will be much less intimidating if
2092 they have a letter template customized for their company, for example.
2095 \begin_layout Section
2099 \begin_layout Standard
2100 LyX (like LaTeX) considers the title — which may contain the actual title,
2101 the author, the date, and even an abstract of a paper — to be a separate
2102 part of the document.
2105 \begin_layout Standard
2106 Go back to your LyX document and make sure it is using the
2114 \begin_layout Plain Layout
2115 You should not be using the letter any more, since the
2119 document class does not allow titles.
2124 Type a title on the first line, and change the line to the
2129 On the next line, type your name and change it to the
2134 On the next line, write the date in the
2139 Type a paragraph or two summarizing your document using the
2144 Notice how the title is presented when it is printed out.
2145 If you change the document format to Book, you will get a separate title
2146 page, like the first page of this tutorial.
2149 \begin_layout Standard
2154 : Fix the title, date, and author in
2159 \begin_layout Section
2160 Labels and Cross-References
2163 \begin_layout Standard
2164 You can label section headings, list items, formulas, footnotes, and floats
2168 \begin_layout Plain Layout
2169 Floats are explained in the
2183 Once you do so, you can refer to this section in other parts of the document,
2184 using cross-references.
2185 You can refer either to the section's number, or to the page that the section
2187 As with section numbering, LyX also takes care about cross-reference numbering
2189 Automatic labels and cross-references are among the most significant advantages
2190 of LyX (and LaTeX) over conventional word processors.
2194 \begin_layout Subsection
2198 \begin_layout Standard
2199 Go to our second section, whose title is
2200 \begin_inset Quotes eld
2204 \begin_inset Quotes erd
2208 Click at the end of the section title line, and select
2210 Insert\SpecialChar \menuseparator
2213 or the toolbar button
2214 \begin_inset Graphics
2215 filename ../images/label-insert.png
2222 A dialog asks you for a label name, and gives you a suggestion.
2227 , the label name will be placed in a box next to the section title.
2230 \begin_layout Standard
2231 So far you have not done anything — the DVI output will look exactly the
2232 same, since labels do not show up in the printed document.
2233 However, now that you have added a label, you can refer to that label with
2235 We will do that next.
2238 \begin_layout Subsection
2239 Your first cross-reference
2242 \begin_layout Standard
2243 Place the cursor somewhere in section
2244 \begin_inset space ~
2251 \begin_layout LyX-Code
2252 If you want to know more about this document, then see
2253 \begin_inset Newline newline
2256 section, which can be found on page.
2259 \begin_layout Standard
2260 Now — with the cursor after the word `Section' — choose
2262 Insert\SpecialChar \menuseparator
2264 \begin_inset space ~
2269 or the toolbar button
2270 \begin_inset Graphics
2271 filename ../images/dialog-show-new-inset_ref.png
2278 The Cross-reference dialog pops up.
2279 It shows a list of the possible labels you can reference.
2280 At the moment, there should be only one, `sec:About-This-Document'.
2281 First, select the drop-down menu labeled Format and select '<reference>
2282 on page <page>.' Then select `sec:About-This-Document' (it may be selected
2283 by default), and a reference marker will appear containing `Ref+Text: sec:About
2284 -This-Document' (To be really correct, you should put a
2287 \begin_inset space ~
2292 in between the word `Section' and the reference).
2293 Alternatively to that method, you can right-click on a label and use in
2294 the appearing context menu
2299 The cross-reference to this label is now in the clipboard and can be copied
2300 to the actual cursor position via the menu
2302 Edit\SpecialChar \menuseparator
2310 In the printed document, this reference marker will be replaced with the
2311 section number and then the page number.
2312 View your document as DVI, and you will see that LaTeX has been even cleverer
2314 It refers to `Section 2' and depending how much text you have between the
2315 start of Section 2 and this cross-reference you may see `on this page,'
2316 'on the previous page' or `on page n' (whereas
2320 is the page number).
2323 \begin_layout Standard
2324 Conveniently, a cross-reference acts as a hyperlink when you are editing
2325 a document in LyX; clicking on it will pop up the
2332 \begin_inset space ~
2336 \begin_inset space ~
2341 will move the cursor to the referenced label.
2344 \begin_layout Subsection
2345 More fun with labels
2348 \begin_layout Standard
2349 We told you that LyX takes care about numbering cross-references; now you
2351 Add a new section before Section
2352 \begin_inset space ~
2356 Update the DVI view, and — voilà ! — the section cross reference changed
2358 \begin_inset Quotes eld
2362 \begin_inset Quotes erd
2365 ! Change the section
2366 \begin_inset Quotes eld
2370 \begin_inset Quotes erd
2373 to a subsection, and the cross-reference will reference Subsection
2374 \begin_inset space ~
2377 2.1 instead of Section
2378 \begin_inset space ~
2382 The page reference will not change unless you add a whole page of text
2383 before the label, of course.
2387 \begin_layout Standard
2388 If you want some more practice with labels, then try putting a new label
2389 where your first cross-reference was, and refer to that label from elsewhere
2391 If you will be inserting cross-references often, it may be convenient to
2399 \begin_layout Standard
2400 If you want to make sure that the cross-referencing gets the pages right
2401 even for larger documents,
2405 a couple pages of text from the
2409 to the clipboard, and
2413 the stolen text into your document.
2417 \begin_layout Plain Layout
2418 By the way, copying a chapter title may cause an error, because chapters
2419 are not allowed in the article class, see section
2420 \begin_inset space ~
2424 \begin_inset CommandInset ref
2426 reference "sec:Document-Classes"
2431 If this happens, just delete the chapter title.
2439 \begin_layout Standard
2444 : Fix the references in
2449 \begin_layout Section
2450 Footnotes and Margin Notes
2453 \begin_layout Standard
2454 Footnotes can be added using the toolbar button
2455 \begin_inset Graphics
2456 filename ../images/footnote-insert.png
2464 Insert\SpecialChar \menuseparator
2468 Click at the end of the word
2469 \begin_inset Quotes eld
2473 \begin_inset Quotes erd
2476 somewhere in your document and click the
2477 \begin_inset Graphics
2478 filename ../images/footnote-insert.png
2485 A footnote box appears where you can enter the text of the footnote.
2486 LyX should place the cursor at the beginning of the footnote box.
2490 \begin_layout LyX-Code
2491 LyX is a typesetting word processor.
2494 \begin_layout Standard
2495 Now click on the button labeled
2496 \begin_inset Quotes eld
2500 \begin_inset Quotes erd
2504 The footnote box is closed, leaving the button showing where the footnote
2505 marker will be in the printed text; this is called
2506 \begin_inset Quotes eld
2510 \begin_inset Quotes erd
2514 You can unfold the footnote at any time and re-edit its text by clicking
2516 \begin_inset Quotes eld
2520 \begin_inset Quotes erd
2526 \begin_layout Standard
2527 A footnote can be cut and pasted like normal text.
2528 Go ahead; try it! All you need to do is select the footnote button
2532 \begin_layout Plain Layout
2533 It may be easier to select it using the keyboard.
2534 You might accidentally open the footnote if you are trying to select the
2535 marker itself with the mouse.
2549 In addition, you can change regular text to a footnote, by selecting it
2551 \begin_inset Graphics
2552 filename ../images/footnote-insert.png
2558 button; change a footnote to regular text by hitting the
2562 key when the cursor is in the first position of a footnote, or by hitting
2567 key when the cursor is in the very last position of the footnote, respectively.
2570 \begin_layout Standard
2571 Margin notes can be added using the menu
2573 Insert\SpecialChar \menuseparator
2575 \begin_inset space ~
2580 or the toolbar button
2581 \begin_inset Graphics
2582 filename ../images/marginalnote-insert.png
2589 Margin notes are like footnotes, except that:
2592 \begin_layout Itemize
2593 the on-screen boxes say
2594 \begin_inset Quotes eld
2598 \begin_inset Quotes erd
2602 \begin_inset Quotes eld
2606 \begin_inset Quotes erd
2612 \begin_layout Itemize
2613 the notes will be placed in the margin, instead of below the text
2616 \begin_layout Itemize
2617 margin notes are not numbered
2620 \begin_layout Standard
2621 Change your LyX footnote back to text, then select and change it to a margin
2623 Run LaTeX again to see what the margin note looks like.
2626 \begin_layout Standard
2631 : Fix the footnote in
2636 \begin_layout Section
2638 \begin_inset CommandInset label
2640 name "sec:bibliographies"
2647 \begin_layout Standard
2648 Bibliographies (at least in the exact sciences) are similar to cross references.
2649 The bibliography contains a list of references at the end of the document,
2650 and they can be referenced from within the document.
2651 Like section titles, LyX and LaTeX make your job easier by automatically
2652 numbering the bibliography items and changing citations when the item numbers
2656 \begin_layout Standard
2657 Go to the end of the document and switch to the
2662 Now, each paragraph you type will be a reference.
2664 \begin_inset Quotes eld
2669 The Lyx Tutorial, by the LyX Documentation Team
2672 \begin_inset Quotes erd
2675 as your first reference.
2676 Note that LyX automatically puts a number in a box before each reference.
2677 Click on the boxed reference number, and the
2680 \begin_inset space ~
2690 is to refer to this reference within the LyX document, the
2699 is set (default), you will see the number of the bibliography in the output.
2705 \begin_inset Quotes eld
2709 \begin_inset Quotes erd
2712 to make it easy to remember.
2715 \begin_layout Standard
2716 Now pick somewhere in your document that you would like to insert a reference.
2719 Insert\SpecialChar \menuseparator
2722 or the toolbar button
2723 \begin_inset Graphics
2724 filename ../images/dialog-show-new-inset_citation.png
2736 The right panel in this dialog lists all the bibliography entries, and
2737 this field allows you to choose which bibliography item you want to cite.
2739 \begin_inset Quotes eld
2743 \begin_inset Quotes erd
2746 (right now, that is the only item in the bibliography), then use the
2750 button in the center to insert it.
2751 (You can have multiple citations in the same place by transferring a number
2752 of keys this way.) Now view your file as DVI, and you will see that the
2753 citation appears in brackets in the text, referring to the bibliography
2754 at the end of the document.
2757 \begin_layout Standard
2761 \begin_inset space ~
2770 dialog will put a remark (such as a reference to a page or chapter within
2771 the referenced book or article) in the brackets after the reference.
2772 If you want the references to have labels instead of numbers in the printed
2773 output (for example, some journals would use
2774 \begin_inset Quotes eld
2778 \begin_inset Quotes erd
2781 to refer to a paper written by Smith in 1995), use the
2788 \begin_inset space ~
2801 \begin_layout Standard
2806 Fix the bibliography and citation in
2811 \begin_layout Section
2815 \begin_layout Standard
2816 You may want to put a table of contents at the beginning of your document.
2817 LyX makes this very easy to do.
2822 after your document title and before your first section title and choose
2825 Insert\SpecialChar \menuseparator
2827 \begin_inset space ~
2831 \begin_inset space ~
2834 TOC\SpecialChar \menuseparator
2836 \begin_inset space ~
2840 \begin_inset space ~
2847 \begin_inset Quotes eld
2851 \begin_inset Quotes erd
2854 will appear in a button on the first line of the document.
2858 \begin_layout Standard
2859 This may not appear to be very useful.
2860 However, if you look at your DVI file, you will see that a table of contents
2861 has been generated, listing the various sections and subsections in your
2863 As usual, if you reorder sections or create new ones, you will see those
2864 changes in the DVI file when you update it.
2868 \begin_layout Standard
2869 The table of contents is not printed in the on-screen version of the document.
2870 But you can display the table of contents in a separate window by clicking
2871 on the table of contents button, or by using
2873 Document\SpecialChar \menuseparator
2876 or the toolbar button
2877 \begin_inset Graphics
2878 filename ../images/dialog-toggle_toc.png
2885 This menu will work even if you do not have a table of contents inset in
2887 This is a very useful tool for moving around your document parts.
2888 Clicking on a (sub)section title in the
2892 window will highlight that line and move the display (in the LyX editing
2893 window) to that place in the document.
2894 You can also use the arrow keys to move up and down in the table of contents.
2895 You may therefore find it convenient to leave this window open throughout
2897 You can get similar functionality from the
2901 menu, though, where the table of contents appears automatically.
2904 \begin_layout Standard
2905 To get rid of the Table of Contents, you can delete the table of contents
2906 button just like any other text.
2909 \begin_layout Standard
2914 : Fix the table of contents in
2919 \begin_layout Chapter
2923 \begin_layout Standard
2924 LaTeX is used by many scientists because it outputs great looking equations,
2925 avoiding the control characters used by word processors and their equation
2927 Many of these scientists are frustrated, however, because writing equations
2928 in LaTeX is more like programming than writing.
2929 Happily, LyX has WYSIWYM support for equations.
2930 If you are used to LaTeX, you will find that all of the usual LaTeX math
2931 commands can be typed in normally, but they will show up in a WYSIWYM fashion.
2932 If, on the other hand, you have never written in LaTeX, then the
2935 \begin_inset space ~
2940 will allow you to write professional-looking math quickly and easily.
2943 \begin_layout Section
2947 \begin_layout Standard
2948 Somewhere in your LyX document, type:
2951 \begin_layout LyX-Code
2952 I like what Einstein said, E=mc^2, because it is so simple.
2956 \begin_layout Standard
2957 Now, that equation does not look very good in LyX and in the output; there
2958 is no space between the letters and the equals sign, and you would like
2959 to write an actual superscript for the
2960 \begin_inset Quotes eld
2964 \begin_inset Quotes erd
2968 That bad typesetting happened because we did not tell LyX that we were
2969 writing a mathematical expression, so it typeset the equation like regular
2973 \begin_layout Standard
2974 Instead, we create a formula that will get typeset properly.
2975 In order to create a formula, just click the toolbar button
2976 \begin_inset Graphics
2977 filename ../images/math-mode.png
2985 Insert\SpecialChar \menuseparator
2986 Math\SpecialChar \menuseparator
2988 \begin_inset space ~
2994 LyX will insert a little blue square, which is an empty math formula.
3000 The expression is typed in blue, and the blue square disappears as soon
3001 as the formula is not empty.
3006 to leave the equation The purple markers disappear, leaving the cursor
3007 to the right of the expression, and now if you type something, it will
3011 \begin_layout Standard
3012 Looking at the output you will notice that the expression was typeset nicely,
3013 with spaces between the letters and the equals sign, and a superscript
3015 \begin_inset Quotes eld
3019 \begin_inset Quotes erd
3023 Letters in math mode are assumed to be variables, and come out in italics.
3024 Numbers are just numbers.
3027 \begin_layout Standard
3028 This math editor is another example of the WYSIWYM philosophy.
3029 In LaTeX, you write a mathematical expression using text and commands like
3036 ; this can be frustrating, because you cannot see what an expression looks
3037 like until you run the file under LaTeX and you may have to spend time
3039 \begin_inset space \thinspace{}
3043 \begin_inset space \space{}
3047 LyX does not attempt to get the expression to look perfect (WYSIWYG), but
3048 it gives you an extremely good idea of what the expression will look like.
3049 LaTeX then takes care of the professional typesetting.
3052 \begin_layout Section
3053 Navigating an Equation
3056 \begin_layout Standard
3058 \begin_inset Formula $E=mc^{2}$
3062 \begin_inset Formula $E=1+mc^{2}$
3066 Use the arrow keys to move the cursor into the expression.
3067 Note that when you enter the expression, the purple markers appear to let
3068 you know you are editing math.
3077 to move the cursor past the equals sign, and just type
3078 \begin_inset Quotes eld
3082 \begin_inset Quotes erd
3086 Again, you can use the arrow keys or
3090 to leave the formula\SpecialChar \@.
3094 \begin_layout Standard
3095 Other than the special keys described below, typing in math mode is like
3096 editing regular text.
3106 Select text either with the arrow keys or with the mouse.
3109 Edit\SpecialChar \menuseparator
3112 works in math mode as well as cut and paste.
3113 One thing to be careful of: if you are left or right outside a formula
3122 respectively, you delete the whole formula.
3123 Luckily, you can just use
3130 \begin_layout Standard
3131 What if you want to change
3132 \begin_inset Formula $E=mc^{2}$
3136 \begin_inset Formula $E=mc^{2.5}+1$
3139 ? Again, you can use the mouse to click in the right place.
3140 However, you can also use the arrow keys.
3141 If the cursor is just after the
3142 \begin_inset Quotes eld
3146 \begin_inset Quotes erd
3150 \begin_inset Quotes eld
3154 \begin_inset Quotes erd
3161 and the cursor is moved to the level of the superscript, just before the
3163 \begin_inset Quotes eld
3167 \begin_inset Quotes erd
3172 \begin_inset Quotes eld
3176 \begin_inset Quotes erd
3184 will move the cursor back to the regular level.
3193 , the cursor will be placed
3197 the superscript (so that you can then type the
3198 \begin_inset Quotes eld
3202 \begin_inset Quotes erd
3208 \begin_layout Section
3209 Exponents and Indices
3212 \begin_layout Standard
3213 An exponent can be entered from the
3216 \begin_inset space ~
3221 (see below), but it is actually simpler just to type the caret key,
3222 \begin_inset Quotes eld
3226 \begin_inset Quotes erd
3230 LyX will place another blue rectangle in the superscript, so that whatever
3231 you write next will be superscripted, and in a smaller font size.
3232 Everything you type until you hit a
3240 to exit the formula entirely) will be in the superscript.
3243 \begin_layout Standard
3244 Writing a subscript (index) is just easy; start one by typing the underscore
3246 \begin_inset Quotes eld
3250 \begin_inset Quotes erd
3254 You can subscript and superscript both subscripts and superscripts like
3256 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3263 \begin_layout Standard
3275 \begin_layout Section
3279 \begin_layout Standard
3283 \begin_inset space ~
3288 is a convenient way to enter symbols or to perform complicated formula
3290 Many of these operations can be accomplished from the keyboard or the
3292 Edit\SpecialChar \menuseparator
3297 Insert\SpecialChar \menuseparator
3301 However, we are going to concentrate on using the
3304 \begin_inset space ~
3309 , just to let you know what is out there; you can learn keyboard shortcuts
3310 and commands later from the
3317 \begin_layout Standard
3321 \begin_inset space ~
3326 is shown when the cursor is in a formula and can also be turned on manually
3329 View\SpecialChar \menuseparator
3333 When you click there on
3334 \begin_inset Quotes eld
3338 \begin_inset Quotes erd
3341 the toolbar will be shown permanently at the bottom; this state is visualized
3346 menu with a checkmark.
3347 When you click in this state again on
3348 \begin_inset Quotes eld
3352 \begin_inset Quotes erd
3363 is only shown when the cursor is within a formula; this state is visualized
3364 by the renaming of the menu entry from
3365 \begin_inset Quotes eld
3369 \begin_inset Quotes erd
3373 \begin_inset Quotes eld
3377 \begin_inset space ~
3381 \begin_inset Quotes erd
3387 \begin_layout Subsection
3391 \begin_layout Standard
3395 \begin_inset space ~
3400 allows you to choose from a large array of symbols used in math: operators,
3401 arrows, relationships, delimiters, special characters, sums and integrals.
3402 Note that subscripting and superscripting allow you to put lower and upper
3403 limits on sums and integrals.
3407 \begin_layout Subsection
3408 Square roots, accents, and delimiters
3411 \begin_layout Standard
3412 To type a square root, just click on the button
3413 \begin_inset Graphics
3414 filename ../images/math/sqrt.png
3421 The square root appears, and the cursor is in a new insertion point inside
3423 You can type variables, numbers, other square roots, fractions, whatever
3425 LyX will automatically resize the square root to fit what is inside.
3428 \begin_layout Standard
3429 Accenting a character (
3430 \begin_inset Formula $\overrightarrow{v}$
3433 ) or group of characters (
3434 \begin_inset Formula $\overrightarrow{a+b}$
3437 ) is done the same way.
3438 Decorations are available from the toolbar via the button
3439 \begin_inset Graphics
3440 filename ../images/math/hat.png
3447 Click on a decoration, and LyX will insert that decoration with an insertion
3448 point under (or over) it.
3449 Just type what you want in the insertion point.
3450 There are two sets of decorations: those that resize with the text you
3451 type, and those that have a fixed size, and are most appropriate for a
3456 \begin_layout Standard
3457 Delimiters such as parentheses, brackets, and braces work similarly, but
3458 are a bit more complicated.
3459 Hit the delimiter button
3460 \begin_inset Graphics
3461 filename ../images/dialog-show_mathdelimiter.png
3472 Your current selection of delimiters is displayed in a box.
3473 It is a pair of parentheses by default, but you can choose a pair of braces,
3474 a brace and a parenthesis, or choose the empty square to have something
3476 \begin_inset Quotes eld
3480 \begin_inset Formula $a=\left\langle 7\right.$
3484 \begin_inset Quotes erd
3487 (the empty delimiter is displayed as a broken line in LyX, but will not
3488 show up in the output).
3491 \begin_layout Standard
3492 If you are lazy, you can type actual parentheses in math mode, rather than
3498 However, those parentheses will be the same size as regular text, which
3499 will look bad if you have a big fraction or matrix inside the parentheses.
3500 So it is better in this case to use one of the three delimiter buttons
3501 that insert directly e.
3502 \begin_inset space \thinspace{}
3506 \begin_inset space \space{}
3510 \begin_inset space \thinspace{}
3516 \begin_layout Standard
3517 You can also put delimiters or a square root sign or a decoration on already
3518 existing formula parts.
3519 Select the portion of the formula that you want to adjust, and then click
3520 on the button you want from the
3523 \begin_inset space ~
3529 Try using this to change Newton's second law from scalar to vector form
3531 \begin_inset Formula $f=ma$
3535 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3539 Once you have learned about matrices, this is how you will put parentheses
3540 or brackets around them.
3543 \begin_layout Subsection
3547 \begin_layout Standard
3548 To create a fraction, click on the fraction button
3549 \begin_inset Graphics
3550 filename ../images/math/frac.png
3560 \begin_inset space ~
3566 LyX writes two insertion points in a fraction.
3567 As you would expect, you can use arrow keys or the mouse to move around
3569 Click on the top square and type
3570 \begin_inset Quotes eld
3574 \begin_inset Quotes erd
3583 \begin_inset Quotes eld
3587 \begin_inset Quotes erd
3591 You have made a fraction! Of course you can type anything within each of
3592 the two boxes: variables with exponents, square roots, other fractions,
3597 \begin_layout Standard
3609 \begin_layout Subsection
3610 Functions: lim, log, sin and others
3613 \begin_layout Standard
3614 Because letters in math mode are considered to be variables, if you type
3616 \begin_inset Quotes eld
3620 \begin_inset Quotes erd
3623 in math mode, LyX thinks you are typing the product of the three variables
3625 \begin_inset Formula $s$
3629 \begin_inset Formula $i$
3633 \begin_inset Formula $n$
3637 The three letters will be typeset in italics, when what you really wanted
3639 \begin_inset Quotes eld
3643 \begin_inset Quotes erd
3647 In addition, LyX will not put a space between the word
3648 \begin_inset Quotes eld
3652 \begin_inset Quotes erd
3656 \begin_inset Quotes eld
3660 \begin_inset Quotes erd
3667 will exit the formula).
3669 \begin_inset Quotes eld
3673 \begin_inset Formula $\sin(x)$
3677 \begin_inset Quotes erd
3681 \begin_inset Quotes eld
3685 \begin_inset Formula $sin(x)$
3689 \begin_inset Quotes erd
3695 \begin_layout Standard
3699 \begin_inset space ~
3705 \begin_inset Graphics
3706 filename ../images/math/functions.png
3713 \begin_inset Quotes eld
3717 \begin_inset Quotes erd
3720 in the appearing function list.
3722 \begin_inset Quotes eld
3726 \begin_inset Quotes erd
3729 is displayed in LyX in black, and set in upright roman type.
3730 The whole word is treated as one symbol, so if you type
3734 , it will delete the whole word.
3736 \begin_inset Quotes eld
3740 \begin_inset Quotes erd
3743 , which will be written in blue italics, like you expect in a formula.
3744 In the output, the expression will be correctly typeset.
3748 \begin_layout Standard
3749 The function list includes other trigonometric functions and their inverses,
3750 hyperbolic functions, logarithms, limits, and quite a few others.
3751 These functions can take subscripts and superscripts, important for typing
3753 \begin_inset Quotes eld
3757 \begin_inset Formula $\cos^{2}\theta$
3761 \begin_inset Quotes erd
3765 \begin_inset Quotes eld
3769 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3773 \begin_inset Quotes erd
3779 \begin_layout Standard
3791 \begin_layout Subsection
3795 \begin_layout Standard
3796 Click on the matrix button
3797 \begin_inset Graphics
3798 filename ../images/dialog-show_mathmatrix.png
3807 \begin_inset space ~
3813 The appearing dialog allows you to choose how many rows and columns you
3814 want in your matrix.
3815 Choose 2 rows and 3 columns and hit
3820 LyX prints 6 insertion points in a
3821 \begin_inset Formula $2\times3$
3825 As usual, you can put any sort of formula expression (a square root, another
3826 matrix, etc.) in each insertion point.
3827 You can also leave some of the insertion points empty if you want.
3830 \begin_layout Standard
3835 can be used to move horizontally between the columns of a matrix.
3836 Alternatively, you can use the arrow keys to move around - hitting
3840 at the end of one box will move to the next box,
3844 will move to the next row, etc.
3847 \begin_layout Standard
3848 If you need to change the number of rows and columns, use the menu
3850 Edit\SpecialChar \menuseparator
3852 \begin_inset space \thinspace{}
3856 \begin_inset space \thinspace{}
3861 or the math toolbar buttons
3862 \begin_inset Graphics
3863 filename ../images/tabular-feature_append-row.png
3870 \begin_inset Graphics
3871 filename ../images/tabular-feature_delete-row.png
3878 \begin_inset Graphics
3879 filename ../images/tabular-feature_append-column.png
3886 \begin_inset Graphics
3887 filename ../images/tabular-feature_delete-column.png
3896 \begin_layout Standard
3901 for information on how to change the horizontal alignment of each column,
3902 and how to change the vertical position of the whole matrix.
3903 Note that if you want to write a table containing text, you should use
3904 LyX's wonderful table support, rather than trying to write text in a matrix.
3907 \begin_layout Subsection
3911 \begin_layout Standard
3912 All of the expressions we have written so far have been on the same line
3913 as the text that came before and after them, otherwise known as inline
3915 This is fine for short, simple expressions, but if you want to write larger
3916 ones, or if you want your expressions to stand out from the text, you need
3917 to write them in display mode.
3918 In addition, only displayed expressions can be labeled and numbered (see
3923 ), and multi-line equations must be in display mode.
3926 \begin_layout Standard
3927 While being in a formula, click on the display button
3928 \begin_inset Graphics
3929 filename ../images/math-display.png
3938 \begin_inset space ~
3944 This centers the formula and adds a blank line before and after it.
3945 Now type in an expression and compile your file to see how it looks.
3946 The display button is actually a toggle; use it now to change a couple
3947 of your expressions to display mode and back.
3951 \begin_layout Standard
3952 Display mode has a couple differences from inline mode:
3955 \begin_layout Itemize
3956 The default font is larger for a few symbols, like
3957 \begin_inset Formula $\sum$
3961 \begin_inset Formula $\int$
3967 \begin_layout Itemize
3968 Subscripts and superscripts for limits and sums (but not integrals) are
3969 written under and over rather than next to the symbols
3972 \begin_layout Itemize
3976 \begin_layout Standard
3977 Other than these differences, though, displayed expressions and inline expressio
3978 ns are very similar.
3981 \begin_layout Standard
3982 One final note about the way displayed formulas are typeset: Be careful
3983 about whether you are putting your equation into a new paragraph or not.
3984 If your formula is in the middle of a sentence or paragraph, then do not
3990 Doing so will cause the text
3994 the formula to start a new paragraph.
3995 That text will be indented or follow a blank line, depending on your document
3996 paragraph settings, which is probably not what you want.
3999 \begin_layout Standard
4004 : Put the various equations in
4008 into display mode, and see how they are typeset differently.
4011 \begin_layout Standard
4016 : Using various tools you have learned in this section, you should be able
4017 to write an equation like:
4021 \begin_layout Plain Layout
4022 After you have done it the hard way, give
4024 Insert\SpecialChar \menuseparator
4025 Math\SpecialChar \menuseparator
4027 \begin_inset space ~
4038 \begin_inset Formula \[
4039 f(x)=\left\{ \begin{array}{cc}
4042 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0\end{array}\right.\]
4049 \begin_layout Section
4053 \begin_layout Standard
4054 LyX's math editor can do a lot more.
4055 Now you are familiar with the basics, you can refer to the
4062 \begin_layout Itemize
4063 Label and number expressions
4066 \begin_layout Itemize
4067 Create multi-line equations
4070 \begin_layout Itemize
4071 Change typefaces, e.
4072 \begin_inset space \thinspace{}
4076 \begin_inset space \space{}
4079 to write bold-face text in an expression.
4082 \begin_layout Itemize
4083 Fine-tune font sizes and spacing within an expression.
4084 (Do not worry about this until your final draft!)
4087 \begin_layout Itemize
4089 These are very powerful, because you just define them once at the top of
4090 the document, and then you can use them throughout the document.
4093 \begin_layout Itemize
4094 Do lots of other things that we have no space for in this Tutorial.
4097 \begin_layout Chapter
4101 \begin_layout Section
4102 Other major LyX Features
4105 \begin_layout Standard
4106 We have not gone through all the possible commands in LyX, and we are not
4115 \begin_inset space ~
4120 manual for more information.
4121 We will just mention a couple more major things LyX can do:
4124 \begin_layout Itemize
4125 LyX has WYSIWYM support for tables.
4128 Insert\SpecialChar \menuseparator
4132 \begin_inset Graphics
4133 filename ../images/tabular-insert.png
4140 Click on the table with the
4147 \begin_inset space ~
4152 dialog box which allows extensive table editing.
4155 \begin_layout Itemize
4156 LyX also supports including pictures in any format within documents.
4159 Insert\SpecialChar \menuseparator
4163 \begin_inset Graphics
4164 filename ../images/dialog-show-new-inset_graphics.png
4171 Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4172 can have captions, and LyX will automatically generate lists of figures
4176 \begin_layout Itemize
4177 LyX is heavily configurable.
4178 Everything from how the LyX window looks to how the output comes out can
4179 be configured in a number of ways.
4180 Much configuration is done through
4182 Tools\SpecialChar \menuseparator
4186 For more information on this, check out
4188 Help\SpecialChar \menuseparator
4189 Customization\SpecialChar \@.
4193 \begin_layout Itemize
4194 LyX is being developed by a team of programmers on five continents.
4195 Therefore, LyX has better support for non-English languages (such as Dutch,
4196 German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4197 ) than many word processors.
4198 Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4199 languages Chinese Japanese, and Korean are supported.
4200 You can write documents in other languages and you can also configure LyX
4201 to show its menus and error messages in other languages.
4205 \begin_layout Itemize
4206 The LyX menus feature keybindings.
4207 This means that you can do
4209 File\SpecialChar \menuseparator
4220 or by using the binding which is shown next to it in the menu (Ctrl+O by
4222 Keybindings are also configurable.
4223 For information on this, check out
4225 Help\SpecialChar \menuseparator
4226 Customization\SpecialChar \@.
4230 \begin_layout Itemize
4231 LyX can read LaTeX documents.
4233 \begin_inset space ~
4237 \begin_inset CommandInset ref
4239 reference "sec:tex2lyx"
4246 \begin_layout Itemize
4247 Spell-checking, thesaurus, and word count facilities are available.
4250 \begin_layout Itemize
4251 Generation of indexes and nomenclatures/glossaries is supported.
4254 \begin_layout Section
4256 \begin_inset CommandInset label
4258 name "sec:latexusers"
4265 \begin_layout Standard
4266 If you do not know anything about LaTeX, you do not have to read this section.
4267 Actually, you might want to
4271 about LaTeX, and then read this chapter.
4272 However, some who begin to use LyX will be familiar with LaTeX.
4273 If you are such a person, you may be wondering if LyX can really do everything
4275 The short answer is that LyX can do pretty much everything LaTeX can do
4276 in one form or another, and it definitely simplifies most parts of writing
4280 \begin_layout Standard
4281 Because this is just a tutorial, we are only going to mention things that
4282 new LyX users will most likely be interested in.
4283 In the interests of keeping the Tutorial short, we will give only minimal
4288 \begin_inset space ~
4296 \begin_inset space ~
4301 manual have a great deal of information on differences between LyX and
4302 LaTeX, and how to do various LaTeX tricks in LyX.
4305 \begin_layout Subsection
4309 \begin_layout Standard
4310 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4311 will be displayed in red on the screen.
4312 You can use TeX commands in LyX by choosing
4314 Insert\SpecialChar \menuseparator
4316 \begin_inset space ~
4322 \begin_inset Graphics
4323 filename ../images/ert-insert.png
4330 This creates a box where everything within it is passed straight to LaTeX.
4333 \begin_layout Standard
4334 In a math formula, TeX mode is handled a bit differently.
4335 TeX mode is there entered by typing a backslash.
4336 The backslash is not written out, but anything you type afterwards will
4338 You exit TeX mode by typing
4342 or some other non-alphabetic character, like a number, underscore, caret,
4344 Once you exit TeX mode, if LyX knows the TeX command you have typed in,
4345 it will convert it to WYSIWYM\SpecialChar \@.
4347 \begin_inset Quotes eld
4357 \begin_inset Quotes erd
4360 in a formula and then press
4364 , LyX will change the red
4365 \begin_inset Quotes eld
4369 \begin_inset Quotes erd
4373 \begin_inset Quotes eld
4377 \begin_inset Formula $\gamma$
4381 \begin_inset Quotes erd
4385 This will work for almost all, non-complicated math macros.
4386 This may be faster than using the
4389 \begin_inset space ~
4394 , and will be especially convenient for experienced LaTeX users.
4397 \begin_layout Standard
4398 As a special case, if you type
4399 \begin_inset Quotes eld
4409 \begin_inset Quotes erd
4412 in a formula, the beginning
4416 ending braces will be inserted in red while the cursor is placed between
4418 This makes it more convenient to type those commands which take an argument.
4421 \begin_layout Standard
4422 LyX cannot do absolutely everything that LaTeX can do.
4423 Some fancy functions are not supported at all, while some work but are
4425 TeX mode allows users to get the full flexibility of LaTeX, while having
4426 all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4427 LyX could never support every LaTeX package.
4434 in the preamble (see section
4435 \begin_inset space ~
4439 \begin_inset CommandInset ref
4441 reference "sec:preamble"
4445 ), you can use any package you want — although you will not have WYSIWYM
4446 support for that package's features.
4449 \begin_layout Subsection
4450 Importing LaTeX Documents —
4455 \begin_inset CommandInset label
4464 \begin_layout Standard
4465 You can import a LaTeX file into LyX by using the
4467 File\SpecialChar \menuseparator
4468 Import\SpecialChar \menuseparator
4470 \begin_inset space ~
4476 This will call the program
4480 which will create a file foo.lyx from the file foo.tex.
4481 LyX will then open that file.
4482 If the translation does not work, you can try calling
4486 from the command line, possibly using fancier options.
4489 \begin_layout Standard
4490 Even when the translation does work,
4494 may not translate everything, though it does handle most legal LaTeX.
4495 It will leave things it does not understand in TeX mode; so, after translating
4500 , you can look for the red text and manually edit it to get it right.
4503 \begin_layout Standard
4508 has its own documentation (manpage), which Unix/Linux users can access
4509 via the console command
4512 \begin_inset space ~
4518 The manpage describes which LaTeX commands and environments are not supported,
4519 what bugs you might run into (and how to get around them), and how to use
4520 the various options.
4523 \begin_layout Standard
4524 It is important to understand that
4528 can only translate files whose document class is
4529 \begin_inset Quotes eld
4533 \begin_inset Quotes erd
4536 to LyX, that is, for which there is a corresponding LyX
4541 If there is no layout file, then you will get an error saying that the
4542 conversion could not be performed.
4543 So, unless you have a layout for the document class of your LaTeX file,
4548 simply will not know how to translate the LaTeX that it finds there into
4549 things LyX understands.
4550 More about layout files and how they are created is explained in detail
4558 \begin_layout Subsection
4559 Converting LyX Documents to LaTeX
4562 \begin_layout Standard
4563 You might wish to convert a LyX Document to a LaTeX file.
4564 For example, a co-worker or co-author who does not have LyX might want
4568 File\SpecialChar \menuseparator
4569 Export\SpecialChar \menuseparator
4573 This will create a file
4581 file you are editing.
4582 LyX always creates temporary LaTeX files when viewing or printing files.
4585 \begin_layout Subsection
4589 \begin_layout Subsubsection
4593 \begin_layout Standard
4596 Document\SpecialChar \menuseparator
4599 dialog takes care of the document-wide options.
4600 You can change there the document class, default font size and paper size.
4601 Document class options but also options for LaTeX packages can be entered
4605 \begin_inset space ~
4613 \begin_layout Subsubsection
4614 Other Preamble Matter
4615 \begin_inset CommandInset label
4624 \begin_layout Standard
4625 If you have special commands to put in the preamble of a LaTeX file, you
4626 can use them in a LyX document as well.
4629 Document\SpecialChar \menuseparator
4630 Settings\SpecialChar \menuseparator
4632 \begin_inset space ~
4637 and type in the dialog window (or from the document settings dialog, depending
4639 Anything you type will (as with TeX mode) be sent directly to LaTeX.
4642 \begin_layout Subsection
4646 \begin_layout Standard
4647 LyX has support for BibTeX, which allows you to build databases of bibliographic
4648 al references to be used in multiple documents.
4651 Insert\SpecialChar \menuseparator
4653 \begin_inset space \thinspace{}
4657 \begin_inset space \thinspace{}
4660 TOC\SpecialChar \menuseparator
4662 \begin_inset space ~
4676 field you load BibTeX files, in the
4680 field you can load BibTeX style files.
4683 \begin_layout Standard
4684 After you have done this, you can use citations from any bibliographies
4685 you are including with
4687 Insert\SpecialChar \menuseparator
4691 \begin_inset space ~
4695 \begin_inset CommandInset ref
4697 reference "sec:bibliographies"
4702 LyX will take care of running BibTeX.
4707 dialog will show a list of all the references in your
4714 \begin_layout Section
4718 \begin_layout Standard
4719 Sometimes when you try to view a document, there will be errors, things
4720 that LyX or LaTeX cannot understand.
4721 When this happens, LyX will open a
4724 \begin_inset space ~
4730 Clicking on individual errors in this dialog will take you to the place
4731 in the LyX document where the error occurs and also display the detailed
4732 LaTeX error message.