1 #LyX 1.6.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 are numbered roman
25 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
29 \pdfbookmark[1]{\contentsname}{}
32 \pagenumbering{arabic} }
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
43 \font_typewriter default
44 \font_default_family default
54 \pdf_title "The LyX Tutorial"
55 \pdf_author "LyX Team"
56 \pdf_subject "LyX-documentation Tutorial"
57 \pdf_keywords "LyX, documentation"
59 \pdf_bookmarksnumbered true
60 \pdf_bookmarksopen true
61 \pdf_bookmarksopenlevel 2
66 \pdf_pagebackref false
67 \pdf_pdfusetitle false
68 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
75 \paperorientation portrait
78 \paragraph_separation indent
80 \quotes_language english
83 \paperpagestyle headings
84 \tracking_changes false
101 \begin_layout Plain Layout
102 If you have comments or error corrections, please send them to the LyX Documenta
106 \begin_inset CommandInset href
108 target "lyx-docs@lists.lyx.org"
123 \begin_layout Standard
124 \begin_inset CommandInset toc
125 LatexCommand tableofcontents
132 \begin_layout Chapter
136 \begin_layout Section
140 \begin_layout Standard
141 This file is designed for all of you who have never heard of LaTeX, or don't
143 Now, don't panic - you won't need to learn LaTeX to use LyX.
144 That is, after all, the whole point of LyX: to provide an almost-WYSIWYG
146 There are some things you will need to learn, however, in order to use
150 \begin_layout Standard
151 Some of you probably found your way to this document because you tried to
152 put two spaces after a
153 \begin_inset Quotes eld
157 \begin_inset Quotes erd
160 or tried to put 3 blank lines between paragraphs.
161 You found out you couldn't and in fact, you'll find out that most of the
162 little tricks you're accustomed to use in other word processors won't work
164 That's because most word processors you've used before allow you to manually
165 enter all spacings, font changes, and so on.
166 So you end up not only writing a document but typesetting it, too.
167 LyX does the typesetting for you, in a consistent fashion, letting you
168 focus on the important things, like the content of your writing.
171 \begin_layout Standard
172 So read on to learn more about LyX.
173 Reading this tutorial is definitely worth the time.
176 \begin_layout Section
186 \begin_layout Standard
187 Before we get started with this section, we want to make a quick note of
193 uses the notation outlined in the
198 If you came to this manual first, please read the
202 before you continue with the
209 \begin_layout Standard
210 Now that you know which fonts mean what, we want to talk a bit about what
218 \begin_layout Subsection
219 Getting the most out of the Tutorial
222 \begin_layout Standard
223 This tutorial consists of examples and exercises.
224 To get the most out of this document, you should read through the document,
225 typing all the little things we're telling you to type and trying out all
226 of the exercises to see if you get them right.
227 For convenience, you might want to print out the PDF version of this document.
230 \begin_layout Standard
231 If you are familiar with LaTeX, you'll probably be able to read the
235 somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
236 However, LyX have features you'll want to learn about.
237 Even if you don't feel like reading the rest of the
241 , you should definitely check out Section
246 \begin_inset CommandInset ref
248 reference "sec:latexusers"
252 , which is specifically written for experienced LaTeX users.
255 \begin_layout Subsection
263 \begin_layout Itemize
264 Detailed explanations of all of LyX's features.
268 \begin_layout Standard
277 \begin_layout Itemize
278 Detailed explanations of LaTeX.
282 \begin_layout Standard
284 If you want to learn some of the neat tricks you can do with LaTeX in LyX,
285 you can have a look at the
297 \begin_layout Standard
298 It's time to move onwards, time for your first document \SpecialChar \ldots{}
302 \begin_layout Chapter
303 Getting started with LyX
306 \begin_layout Section
307 Your first LyX document
308 \begin_inset CommandInset label
310 name "sec:Your-first-LyX"
317 \begin_layout Standard
319 You're ready to start writing.
320 Before you do, there are a few things we need to mention, which will hopefully
321 make the Tutorial more instructive and useful.
325 \begin_layout Standard
326 Because there are informations we can't give you in the Tutorial, the
332 thing that you need to do is find the
339 Start up LyX, Choose the
348 You may want to load the
352 as well (if you're not reading it within LyX already).
353 This way, you can read them while you're writing your own file.
357 \begin_layout Plain Layout
358 They can also serve as good examples of how to use the many features of
364 Note that once you've got more than one document open, you can use the
369 menu or the document tabs to switch between them.
372 \begin_layout Standard
373 In this Tutorial, we're going to assume that you have a fully working version
374 of LyX, as well as a LaTeX-distribution, a DVI-, and a PDF-viewer.
375 This should be the case on all major Linux- and BSD-distribution, as well
376 as on Windows, where this is setup by the LyX installer.
379 \begin_layout Standard
380 Finally, we've written a file to let you practice your LyX skills on, it's
386 Imagine that it was typed by someone who didn't know about any of LyX's
388 As you learn new LyX functions, we'll suggest that you fix those parts
395 \begin_inset Quotes eld
399 \begin_inset Quotes erd
402 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.
422 If you want to cheat, or check what you've done, there's also a file called
427 which contains the same text written and typeset by a LyX master.
430 \begin_layout Standard
431 The example files can be found in the
435 directory of LyX's installation folder.
436 Open the raw document, and use
438 File\SpecialChar \menuseparator
445 to save a copy in your own directory for you to work on.
446 As you fix parts of the raw document, check to see how those changes affect
450 \begin_layout Standard
455 directory contains lots of other examples files.
456 They will show you how to do various fancy things with LyX.
457 After you read the Tutorial, or when you're confused about how to do something
458 fancy in LyX, take a look at these files.
461 \begin_layout Subsection
462 Typing, Viewing, and Exporting
465 \begin_layout Itemize
468 File\SpecialChar \menuseparator
472 \begin_layout Itemize
473 Type a sentence like:
475 This is my first LyX document!
478 \begin_layout Itemize
479 Save your document with
481 File\SpecialChar \menuseparator
490 \begin_layout Itemize
491 Run LaTeX to create a DVI file, with
493 View\SpecialChar \menuseparator
496 or the toolbar button
497 \begin_inset Graphics
498 filename ../images/buffer-view_dvi.png
504 LyX will open a DVI-viewer program displaying your document looking like
509 \begin_layout Plain Layout
510 You can save time by leaving the DVI-viewer running in the background.
513 View\SpecialChar \menuseparator
514 Update\SpecialChar \menuseparator
517 or the toolbar button
518 \begin_inset Graphics
519 filename ../images/buffer-update_dvi.png
524 and just click on the DVI-viewer window (or unminimize it) after LaTeX
533 \begin_layout Itemize
534 Export the ready to print document with
536 File\SpecialChar \menuseparator
544 \begin_layout Standard
545 Congratulations! You've written your first LyX document.
546 All of the rest is just details, which is covered in the other manuals.
549 \begin_layout Subsection
553 \begin_layout Standard
554 LyX can of course do most of the things you're used to do with a word processor.
555 It will word-wrap and indent paragraphs automatically.
556 Here's a quick description of how to do some simple actions.
559 \begin_layout Description
560 Undo LyX has multiple levels of undo, which means you can undo everything
561 you've 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.
593 Undo also doesn't work for
597 ; for instance, not for changes to the document layout what is really a
602 \begin_layout Description
605 Edit\SpecialChar \menuseparator
609 \begin_inset Graphics
610 filename ../images/cut.png
617 Edit\SpecialChar \menuseparator
621 \begin_inset Graphics
622 filename ../images/copy.png
629 Edit\SpecialChar \menuseparator
633 \begin_inset Graphics
634 filename ../images/paste.png
639 ) to cut, copy, and paste.
640 Or automatically paste selected text (including selections from other programs)
648 \begin_layout Description
651 Edit\SpecialChar \menuseparator
663 \begin_inset Graphics
664 filename ../images/dialog-show_findreplace.png
670 In the dialog, search with the
682 button to replace a word you've found
686 \begin_layout Plain Layout
687 Close the window when you're done or leave it open if you find it more convenien
689 Most dialog boxes in LyX can operate like this.
690 Just be sure you have the right window focus when you're trying to type
691 in the main LyX window or a LyX dialog.
697 If you like, you can specify whether to make the search case-sensitive,
698 or to search for only complete words; you can also search backwards through
702 \begin_layout Description
711 text (which will by default print characters in italics), set it in
719 (usually small caps, used for people's names) from the toggle buttons in
722 Edit\SpecialChar \menuseparator
729 dialog (toolbar button
730 \begin_inset Graphics
731 filename ../images/dialog-show_character.png
739 \begin_layout Description
740 Toolbar There are buttons on the toolbar (just below the menus) which allow
741 you to do some of the more popular functions, such as
752 \begin_layout Standard
753 Of course, you haven't yet written enough to make most of these functions
755 As you write more, though, try undoing, pasting, etc.
758 \begin_layout Subsection
759 WYSIWYM: Whitespace in LyX
760 \begin_inset CommandInset label
762 name "sec:whitespace"
769 \begin_layout Standard
770 One of the hardest things for new users to get used to is the way that LyX
772 As many times as you hit
776 , you'll only get one blank line.
777 As many times as you hit
781 , you'll only get one space.
782 On a blank line, LyX won't let you type even one space.
787 key won't move you forward one tab stop; in fact there
791 no tab stops! There's no ruler at the top of the page to let you set tabs
795 \begin_layout Standard
796 Many word processors are based on the WYSIWYG principle:
797 \begin_inset Quotes eld
800 What You See Is What You Get.
801 \begin_inset Quotes erd
804 LyX, on the other hand, is based on the principle that
805 \begin_inset Quotes eld
808 What You See Is What You
813 \begin_inset Quotes erd
816 You type what you mean, and LyX will take care of typesetting it for you,
817 so that the output looks nice.
822 grammatically separates paragraphs, and a
826 grammatically separates words, so there is no reason to have several of
831 has no grammatical function at all, so LyX does not support it.
832 Using LyX, you'll spend more of your time worrying about the
836 of your document, and less time worrying about the
845 for more information on the WYSIWYM concept.
848 \begin_layout Standard
849 LyX does have (many) ways to fine-tune the formatting of your document.
850 After all, LyX might not typeset
859 has information about all that.
864 s and vertical space --- which are more powerful and versatile than multiple
865 spaces or blank lines --- and ways to change font sizes, character styles,
866 and paragraph alignments by hand.
867 The idea, though, is that you can write your whole document, focusing on
868 content, and just worry about that fine-tuning at the end.
869 With standard word processors, you'll be distracted by document formatting
870 throughout the writing process.
873 \begin_layout Section
877 \begin_layout Standard
878 Different parts of a document have different purposes; we call these parts
884 Most of a document is made up of regular text.
885 Section titles (chapter, subsection, etc.) let the reader know that a new
886 topic or subtopic will be discussed.
887 Certain types of documents have special environments.
888 A journal article will have an abstract and a title.
889 A letter will have neither of these, but will probably have an environment
890 that gives the writer's address.
893 \begin_layout Standard
894 Environments are a major part of the
895 \begin_inset Quotes eld
898 What You See Is What You Mean
899 \begin_inset Quotes erd
903 A given environment may require a certain font style, font size, indenting,
904 line spacing, and more.
905 This problem is aggravated, because the exact formatting for a given environmen
906 t may change: one journal may use boldface, 18 point, centered type for
907 section titles while another uses italicized, 15 point, left justified
908 type; different languages may have different standards for indenting; and
909 bibliography formats can vary widely.
910 LyX lets you avoid learning all the different formatting styles.
913 \begin_layout Standard
918 choice box is located on the left end of the toolbar and looks like this:
920 \begin_inset Graphics
921 filename clipart/ToolbarEnvBox.png
928 It indicates which environment you're currently writing in.
929 While you were writing your first document, it said
930 \begin_inset Quotes eld
934 \begin_inset Quotes erd
937 which is the default environment for text.
938 Now you will put a number of environments in your new document so that
939 you can see how they work.
942 \begin_layout Subsection
943 Sections and Subsections
946 \begin_layout Standard
951 on the first line of your LyX file, and select
963 \begin_layout Plain Layout
969 If nothing is selected, LyX changes the paragraph you are currently in
970 to the selected environment.
971 Alternatively, you can change several paragraphs to a different environment
972 by selecting them before picking an environment.
989 , which will be covered below.
990 LyX numbers the section
991 \begin_inset Quotes eld
995 \begin_inset Quotes erd
998 and typesets the section heading (title) in a larger font.
1009 \begin_inset Quotes eld
1013 \begin_inset Quotes erd
1017 \begin_inset Quotes eld
1021 \begin_inset Quotes erd
1025 Section headings, like most environments, are assumed to end when you type
1031 Type the document introduction:
1034 \begin_layout LyX-Code
1035 This is an introduction to my first LyX document.
1038 \begin_layout Standard
1053 \begin_inset Quotes eld
1057 \begin_inset Quotes erd
1060 and waits for you to type a title.
1062 \begin_inset Quotes eld
1068 \begin_inset space ~
1074 \begin_inset Quotes erd
1077 , and you'll see that LyX again sets it as a section title.
1080 \begin_layout Standard
1082 Go to the end of Section
1083 \begin_inset space ~
1087 \begin_inset Quotes eld
1090 my first LyX document
1091 \begin_inset Quotes erd
1108 \begin_inset Quotes eld
1112 \begin_inset Quotes erd
1115 and waits for you to type a title.
1122 \begin_inset space ~
1126 \begin_inset Quotes eld
1130 \begin_inset Quotes erd
1133 , which used to be Section
1134 \begin_inset space ~
1137 2, has been automatically renumbered to Section
1138 \begin_inset space ~
1141 3! In true WYSIWYM fashion, you just need to identify the text that makes
1142 up the section titles, and LyX takes care of numbering the sections and
1146 \begin_layout Standard
1155 environment, and type the following five lines:
1158 \begin_layout LyX-Code
1159 Sections and subsections are described below.
1162 \begin_layout LyX-Code
1166 \begin_layout LyX-Code
1167 Sections are bigger than subsections.
1170 \begin_layout LyX-Code
1171 Subsection description
1174 \begin_layout LyX-Code
1175 Subsections are smaller than sections.
1178 \begin_layout Standard
1179 Click on the second line and select
1188 LyX numbers the subsection
1189 \begin_inset Quotes eld
1193 \begin_inset Quotes erd
1196 , and typesets it in a font which is bigger than regular text but smaller
1197 than the section title.
1198 Change the fourth line
1202 environment as well.
1203 As you probably expected, LyX automatically numbered the section
1204 \begin_inset Quotes eld
1208 \begin_inset Quotes erd
1212 If you put yet another section before Section
1213 \begin_inset space ~
1217 \begin_inset space ~
1220 2 will be renumbered as Section 3, and the subsections will be renumbered
1222 \begin_inset Quotes eld
1226 \begin_inset Quotes erd
1230 \begin_inset Quotes eld
1234 \begin_inset Quotes erd
1241 \begin_layout Standard
1242 Further levels of sectioning include
1255 We'll let you play with these on your own.
1256 You may notice that paragraph and subparagraph headings are not numbered
1257 by default, and that subparagraphs are indented; see the
1261 for an explanation and how to change this.
1266 headings are actually the highest level of sectioning, above
1270 s, but you're only allowed to use them in certain types (text classes) of
1271 LyX documents (see Section
1272 \begin_inset space ~
1276 \begin_inset CommandInset ref
1278 reference "sec:Document-Classes"
1286 \begin_layout Standard
1287 Finally, you may want to have sections or subsections that are not numbered.
1288 There are environments for this as well.
1289 If you change one of your section headings to the
1293 environment (you may have to scroll down in the
1297 box to find it), LyX will use the same font size for the heading as it
1298 uses for a regular section, but it won't number that section.
1299 There are corresponding
1300 \begin_inset Quotes eld
1304 \begin_inset Quotes erd
1307 heading environments for
1316 Try changing some of your sections or subsections to the starred environments,
1317 and note how the other sections' numbers are updated.
1320 \begin_layout Standard
1325 : Fix the section and subsection headings in
1333 \begin_layout Subsection
1337 \begin_layout Standard
1338 LyX has several different environments for typesetting lists.
1339 The various list environments free you from hitting
1343 a million times when writing an outline, or from renumbering a whole list
1344 when you want to add a point in the middle of the list.
1345 Different types of documents logically require different list environments:
1348 \begin_layout Itemize
1349 A slide presentation might use the
1353 environment's bulleted lists to describe different points.
1357 \begin_layout Itemize
1358 An outline would use the
1362 environment's numbered lists (and lettered sublists).
1366 \begin_layout Itemize
1367 A document describing several software packages could use the
1371 environment, where each item in the list begins with a bold-faced word.
1375 \begin_layout Itemize
1380 environment --- not found in LaTeX --- is a slightly different form of
1388 \begin_layout Standard
1389 Let's write a list of reasons why LyX is better than other word processors.
1390 Somewhere in your document, type:
1393 \begin_layout Standard
1396 LyX is better than other word processors because:
1399 \begin_layout Standard
1415 \begin_inset Quotes eld
1419 \begin_inset Quotes erd
1423 Type in your reasons:
1426 \begin_layout LyX-Code
1427 Typesetting is done for you.
1430 \begin_layout LyX-Code
1434 \begin_layout LyX-Code
1435 Lists are very easy to create!
1438 \begin_layout Standard
1439 List environments, unlike headings, do not end when you type
1444 Instead, LyX assumes you're going on to the next item in the list.
1445 The above will therefore result in a three-item list.
1446 If you want more than one paragraph within one list
1450 , one way is to use the
1453 \begin_inset space ~
1458 , which you get by typing
1463 In order to get out of the list, you need to reselect the
1467 environment (or just use the keybinding,
1470 \begin_inset space ~
1478 \begin_layout Standard
1479 You've got a beautiful itemized list.
1480 You might want to run LaTeX to see how the list looks when printed out.
1481 But what if you wanted to number the reasons? Well, just select the whole
1486 \begin_layout Plain Layout
1487 LyX won't let you select the first bullet unless you also select the paragraph
1492 the list, which you probably don't want to do.
1493 Similarly, you can't select the actual number in a numbered section title.
1494 This is on purpose because the bullet or number depends on the document
1495 settings or text position, respectively.
1509 Pow! As we mentioned, if you add or delete a list item, LyX will fix the
1513 \begin_layout Standard
1514 While the list is still selected, you can change to the other two list environme
1523 , in order to see what they look like.
1524 For those two environments, each list item is made up of a term, which
1525 is the item's first word, followed by a definition, which is the rest of
1526 the paragraph (until you hit
1530 .) The term is either typeset in boldface (
1535 \begin_inset Quotes eld
1539 \begin_inset Quotes erd
1546 \begin_layout Plain Layout
1547 But a typesetter's tab, which will change to fit the size of the largest
1548 term, not a pathetic, rigid, unchangeable typewriter
1561 ) from the rest of the paragraph.
1562 If you want to have more than one word in the definition, then separate
1566 \begin_inset space ~
1574 \begin_layout Standard
1579 : Typeset the list in
1584 \begin_layout Standard
1585 You can nest lists within each other in all sorts of interesting ways.
1586 An obvious example would be writing outlines.
1587 Numbered and bulleted lists will have different numbering and bulleting
1588 schemes for sublists.
1593 for details on the different sorts of lists and for examples of nestings.
1596 \begin_layout Subsection
1597 Other environments: Verses, Quotations, and more
1600 \begin_layout Standard
1601 There are two environments for setting quotations apart from surrounding
1606 for short quotes and
1619 \begin_layout Plain Layout
1620 used in this Tutorial for the long typing examples
1629 font; this environment is the only place in LyX where you're allowed to
1630 use multiple spaces to allow code indenting.
1631 You can even write poetry using the
1639 to separate stanzas, and
1643 to separate lines within a stanza.
1648 for more complete descriptions of all of the available LyX environments.
1651 \begin_layout Standard
1656 : Correctly typeset the
1665 \begin_inset Newline newline
1673 \begin_layout Chapter
1677 \begin_layout Standard
1678 The previous chapter hopefully allowed you to get used to writing in LyX.
1679 It introduced you to the basic editing operations in LyX, as well as the
1680 powerful method of writing with environments.
1681 Most people who use LyX, though, will want to write documents: papers,
1682 articles, books, manuals, or letters.
1683 This chapter is meant to take you from simply writing text with LyX to
1684 writing a complete document.
1685 It will introduce you to text classes, which allow you to write different
1687 It will then describe many of the additions that turn text into a document,
1688 such as titles, footnotes, cross references, bibliographies, and tables
1692 \begin_layout Section
1694 \begin_inset CommandInset label
1696 name "sec:Document-Classes"
1703 \begin_layout Standard
1704 Different sorts of documents should be typeset differently.
1705 For example, books are generally printed double-sided, while articles are
1707 In addition, many documents contain special environments: letters contain
1708 some environments --- such as the sender's address and the signature ---
1709 which do not make sense in a book or article.
1718 \begin_layout Plain Layout
1719 for LaTeX users: this is equivalent to the LaTeX document class
1724 takes care of these large scale differences between different sorts of
1726 This Tutorial, for example, was written in the
1731 Document classes are another major part of the WYSIWYM philosophy; they
1732 tell LyX how to typeset the document, so you don't need to know how.
1735 \begin_layout Standard
1736 Your document is probably being written in the
1744 \begin_layout Plain Layout
1745 That's usually the default document class
1750 Try changing to other document classes (using the
1752 Document\SpecialChar \menuseparator
1755 dialog) to see how they are typeset differently.
1756 If you change your document to the
1760 document class and look at the
1764 box, you'll see that most of the allowed environments are the same.
1765 However, you can now use the
1770 If you are ever unsure about which environments you can use in a given
1771 document class, just consult the
1778 \begin_layout Standard
1779 Font sizes, one- or two-column printing, and page headings are just some
1780 of the ways journals' typesettings differ from one another.
1781 As the Computer Age continues to mature, journals have begun accepting
1782 electronic submissions, creating LaTeX
1783 \begin_inset Quotes eld
1787 \begin_inset Quotes erd
1790 so that authors can submit correctly typeset articles.
1791 LyX is set up to support this as well.
1792 For example, LyX supports typesetting (and extra environments) for the
1793 American Mathematics Society journals using the
1796 \begin_inset space ~
1804 \begin_layout Standard
1805 Here is a very quick reference to some of the document classes.
1808 Special Document Classes
1814 manual for many more details.
1817 \begin_layout Standard
1819 \begin_inset Tabular
1820 <lyxtabular version="3" rows="7" columns="2">
1822 <column alignment="center" valignment="top" width="0pt">
1823 <column alignment="center" valignment="top" width="0pt">
1825 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1828 \begin_layout Plain Layout
1834 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1837 \begin_layout Plain Layout
1845 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1848 \begin_layout Plain Layout
1854 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1857 \begin_layout Plain Layout
1858 one-sided, no chapters
1865 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1868 \begin_layout Plain Layout
1874 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1877 \begin_layout Plain Layout
1878 layout & environments for American Math Society
1885 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1888 \begin_layout Plain Layout
1894 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1897 \begin_layout Plain Layout
1898 longer than article, two-sided
1905 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1908 \begin_layout Plain Layout
1914 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1917 \begin_layout Plain Layout
1918 report + front and back matter
1925 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1928 \begin_layout Plain Layout
1934 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1937 \begin_layout Plain Layout
1945 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1948 \begin_layout Plain Layout
1954 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1957 \begin_layout Plain Layout
1958 lots of extra environments for address, signature\SpecialChar \ldots{}
1972 \begin_layout Section
1973 Templates: Writing a Letter
1976 \begin_layout Standard
1977 One way to write a letter would be to open a new file, and choose a
1983 Document\SpecialChar \menuseparator
1987 While this is the most obvious way to write a letter, it seems like extra
1989 Every time you write a business letter, you want to have your address,
1990 the address you're sending to, a body, a signature, etc.
1995 for letters, which contains a sample letter; once you have a template,
1996 you can just replace a couple parts of the letter with your text each time
2000 \begin_layout Standard
2001 Open a new file with
2003 File\SpecialChar \menuseparator
2005 \begin_inset space ~
2009 \begin_inset space ~
2020 Save and print the file to see how the various environments are typeset.
2023 \begin_layout Standard
2024 When you look at the
2028 box, you'll see several environments, like the
2031 \begin_inset space ~
2036 environment, which don't even exist in most other document classes.
2046 You can play around for a while to figure out how the various environments
2048 You'll notice for example that the
2052 environment has the word
2053 \begin_inset Quotes eld
2057 \begin_inset Quotes eld
2060 in red before the actual text of the signature.
2061 This word doesn't show up in the actual letter, as you'll see if you view/expor
2063 It's just there to let you know where the signature goes.
2064 Also, note that it doesn't matter where in the file the
2069 Remember, LyX is WYSIWYM; you can put the
2073 environment anywhere you want, but LyX knows that in the printout, the
2074 signature should be at the end.
2077 \begin_layout Standard
2078 A template is just a regular LyX file.
2079 This means you can fill in your address and signature and save the file
2081 From now on, any time you want to write a letter, you can use the new template
2083 We don't have to suggest an actual
2084 \begin_inset Quotes eld
2088 \begin_inset Quotes erd
2091 here; just write a letter to someone!
2095 \begin_layout Plain Layout
2096 One warning, if you're writing from a template.
2097 If you erase all of the text in an environment --- for example, if you
2101 \begin_inset space ~
2106 field so that you can replace it with your own --- and then you move the
2107 cursor without writing any text, the environment may disappear.
2108 This is because most environments cannot exist without any text in them.
2109 Just reselect the environment from the
2121 \begin_layout Standard
2122 Templates can be a huge time-saver, and we urge you to use them whenever
2124 In addition, they can help a person learn how to use some of the fancier
2126 Finally, they may be useful for a person who is configuring LyX for a bunch
2127 of less computer-aware users.
2128 When they're first learning LyX, it will be much less intimidating if they
2129 have a letter template customized for their company, for example.
2132 \begin_layout Section
2136 \begin_layout Standard
2137 LyX (like LaTeX) considers the title --- which may contain the actual title,
2138 the author, the date, and even an abstract of a paper --- to be a separate
2139 part of the document.
2142 \begin_layout Standard
2143 Go back to your LyX document and make sure it's using the
2151 \begin_layout Plain Layout
2152 You should not be using the letter any more, since the
2156 document class doesn't allow titles.
2161 Type a title on the first line, and change the line to the
2166 On the next line, type your name and change it to the
2171 On the next line, write the date in the
2176 Type a paragraph or two summarizing your document using the
2181 Notice how the title is presented when it's printed out.
2182 If you changed the document format to Book, you'll get a separate title
2183 page, like the first page of this tutorial.
2186 \begin_layout Standard
2191 : Fix the title, date, and author in
2196 \begin_layout Section
2197 Labels and Cross-References
2198 \begin_inset CommandInset label
2207 \begin_layout Standard
2208 You can label section headings, list items, formulas, footnotes, and floats
2212 \begin_layout Plain Layout
2213 Floats are explained in the
2227 Once you do so, you can refer to this section in other parts of the document,
2228 using cross-references.
2229 You can refer either to the section's number, or to the page that the section
2231 As with section numbering, LyX also takes care about cross-reference numbering
2233 Automatic labels and cross-references are one of the best advantages of
2234 LyX (and LaTeX) over conventional word processors.
2237 \begin_layout Subsection*
2241 \begin_layout Standard
2242 Go to our second section, whose title is
2243 \begin_inset Quotes eld
2247 \begin_inset Quotes erd
2251 Click at the end of the section title line, and select
2253 Insert\SpecialChar \menuseparator
2256 or the toolbar button
2257 \begin_inset Graphics
2258 filename ../images/label-insert.png
2265 A dialog asks you for a label name, and gives you a suggestion.
2270 , the label name will be placed in a box next to the section title.
2273 \begin_layout Standard
2274 By the way, you could have put the label right anywhere within the section
2275 as well; section references will refer to the last section or subsection
2276 whose heading comes before the label.
2277 However, putting it on the same line as the section title (or, perhaps,
2278 on the first line of the section's text) ensures that page references will
2279 reference the beginning of the section.
2282 \begin_layout Standard
2283 So far you haven't done anything --- the DVI output will look exactly the
2284 same, since labels don't show up in the printed document.
2285 However, now that you have added a label, you can refer to that label with
2290 \begin_layout Subsection*
2291 Your first cross-reference
2294 \begin_layout Standard
2295 Place the cursor somewhere in Section
2296 \begin_inset space ~
2303 \begin_layout LyX-Code
2304 If you want to know more about this document, then see
2305 \begin_inset Newline newline
2308 Section , which can be found on page .
2311 \begin_layout Standard
2312 Now --- with the cursor after the word
2313 \begin_inset Quotes eld
2317 \begin_inset Quotes erd
2322 Insert\SpecialChar \menuseparator
2324 \begin_inset space ~
2329 or the toolbar button
2330 \begin_inset Graphics
2331 filename ../images/dialog-show-new-inset_ref.png
2343 It shows a list of the possible labels you can reference.
2344 At the moment, there should be only one,
2345 \begin_inset Quotes eld
2348 sec:About-This-Document
2349 \begin_inset Quotes erd
2353 Select it (it may be selected by default), and click
2358 Now put the cursor after the word
2359 \begin_inset Quotes eld
2363 \begin_inset Quotes erd
2366 , and change the reference format to use the page number then click
2371 (To be really correct, you should put a
2374 \begin_inset space ~
2380 \begin_inset Quotes eld
2384 \begin_inset Quotes erd
2388 Same for the page reference.)
2391 \begin_layout Standard
2392 LyX puts the references in a box right where the cursor was.
2393 In the printed document, this reference marker will be replaced with either
2394 the page or section number (depending on what you selected in the
2399 View your document as DVI, and you'll see that on the last page we refer
2401 \begin_inset Quotes eld
2405 \begin_inset space ~
2409 \begin_inset Quotes erd
2413 \begin_inset Quotes eld
2417 \begin_inset space ~
2421 \begin_inset Quotes erd
2424 (or whatever page Section
2425 \begin_inset space ~
2431 \begin_layout Standard
2432 Conveniently, a cross-reference acts as a hyperlink when you are editing
2433 a document in LyX; clicking on it will pop up the
2440 \begin_inset space ~
2444 \begin_inset space ~
2449 will move the cursor to the referenced label.
2452 \begin_layout Subsection*
2453 More fun with labels
2456 \begin_layout Standard
2457 We told you that LyX takes care about numbering cross-references; now you
2459 Add a new section before Section
2460 \begin_inset space ~
2464 Update the DVI view, and --- voilà ! --- the section cross reference changed
2466 \begin_inset Quotes eld
2470 \begin_inset Quotes erd
2473 ! Change the section
2474 \begin_inset Quotes eld
2478 \begin_inset Quotes erd
2481 to a subsection, and the cross-reference will reference Subsection
2482 \begin_inset space ~
2485 2.1 instead of Section
2486 \begin_inset space ~
2490 The page reference won't change unless you add a whole page of text before
2491 the label, of course.
2495 \begin_layout Standard
2496 If you want some more practice with labels, then try putting a new label
2497 where your first cross-reference was, and refer to that label from elsewhere
2499 If you'll be inserting cross-references often, it may be convenient to
2507 \begin_layout Standard
2508 If you want to make sure that the cross-referencing gets the pages right
2509 even for larger documents,
2513 a couple pages of text from the
2517 to the clipboard, and
2521 the stolen text into your document.
2525 \begin_layout Plain Layout
2526 By the way, copying a chapter title may cause an error, because chapters
2527 aren't allowed in the article class, see section
2528 \begin_inset space ~
2532 \begin_inset CommandInset ref
2534 reference "sec:Document-Classes"
2539 If this happens, just delete the chapter title.
2547 \begin_layout Standard
2552 : Fix the references in
2557 \begin_layout Section
2558 Footnotes and Margin Notes
2561 \begin_layout Standard
2562 Footnotes can be added using the toolbar button
2563 \begin_inset Graphics
2564 filename ../images/footnote-insert.png
2572 Insert\SpecialChar \menuseparator
2576 Click at the end of the word
2577 \begin_inset Quotes eld
2581 \begin_inset Quotes erd
2584 somewhere in your document and click the
2585 \begin_inset Graphics
2586 filename ../images/footnote-insert.png
2593 A footnote box appears where you can enter the text of the footnote.
2594 LyX should place the cursor at the beginning of the footnote box.
2598 \begin_layout LyX-Code
2599 LyX is a typesetting word processor.
2602 \begin_layout Standard
2603 Now click on the button labelled
2604 \begin_inset Quotes eld
2608 \begin_inset Quotes erd
2612 The footnote box is closed, leaving the button showing where the footnote
2613 marker will be in the printed text; this is called
2614 \begin_inset Quotes eld
2618 \begin_inset Quotes erd
2622 You can unfold the footnote at any time --- and re-edit its text, if you
2623 want --- by clicking again on the
2624 \begin_inset Quotes eld
2628 \begin_inset Quotes erd
2634 \begin_layout Standard
2635 You may wonder why the footnote button is a word instead of a number.
2636 The answer is that LyX takes care about the footnote numbering for you
2637 in the printed text.
2638 You can see this yourself by looking at the DVI file (or printout).
2639 If you add other footnotes, LyX will renumber the footnotes.
2640 Since LyX (well, LaTeX, actually) takes care of the footnote numbering,
2641 there's really no need to put the numbers in the LyX file.
2644 \begin_layout Standard
2645 A footnote can be cut and pasted like normal text.
2646 Go ahead; try it! All you need to do is select the footnote button
2650 \begin_layout Plain Layout
2651 It may be easier to select it using the keyboard.
2652 You might accidentally open the footnote if you're trying to select the
2653 marker itself with the mouse.
2667 In addition, you can change regular text to a footnote, by selecting it
2669 \begin_inset Graphics
2670 filename ../images/footnote-insert.png
2676 button; change a footnote to regular text by hitting the
2680 key when the cursor is in the first position of a footnote, or by hitting
2685 key when the cursor is in the very last position of the footnote, respectively.
2688 \begin_layout Standard
2689 Margin notes can be added using the menu
2691 Insert\SpecialChar \menuseparator
2693 \begin_inset space ~
2698 or the toolbar button
2699 \begin_inset Graphics
2700 filename ../images/marginalnote-insert.png
2707 Margin notes are like footnotes, except that:
2710 \begin_layout Itemize
2711 the on-screen boxes say
2712 \begin_inset Quotes eld
2716 \begin_inset Quotes erd
2720 \begin_inset Quotes eld
2724 \begin_inset Quotes erd
2730 \begin_layout Itemize
2731 the notes will be placed in the margin, instead of below the text
2734 \begin_layout Itemize
2735 margin notes are not numbered
2738 \begin_layout Standard
2739 Change your LyX footnote back to text, then select and change it to a margin
2741 Run LaTeX again to see what the margin note looks like.
2744 \begin_layout Standard
2749 : Fix the footnote in
2754 \begin_layout Section
2756 \begin_inset CommandInset label
2758 name "sec:bibliographies"
2765 \begin_layout Standard
2766 Bibliographies (at least in the exact sciences) are similar to cross references.
2767 The bibliography contains a list of references at the end of the document,
2768 and they can be referenced from within the document.
2769 Like section titles, LyX and LaTeX make your job easier by automatically
2770 numbering the bibliography items and changing citations when the item numbers
2774 \begin_layout Standard
2775 Go to the end of the document and switch to the
2780 Now, each paragraph you type will be a reference.
2782 \begin_inset Quotes eld
2787 The Lyx Tutorial, by the LyX Documentation Team
2790 \begin_inset Quotes erd
2793 as your first reference.
2794 Note that LyX automatically puts a number in a box before each reference.
2795 Click on the boxed reference number, and the
2798 \begin_inset space ~
2808 is to refer to this reference within the LyX document, the
2817 is set (default), you will see the number of the bibliography in the output.
2823 \begin_inset Quotes eld
2827 \begin_inset Quotes erd
2830 to make it easy to remember.
2833 \begin_layout Standard
2834 Now pick somewhere in your document that you would like to insert a reference.
2837 Insert\SpecialChar \menuseparator
2840 or the toolbar button
2841 \begin_inset Graphics
2842 filename ../images/dialog-show-new-inset_citation.png
2854 The right panel in this dialog lists all the bibliography entries, and
2855 this field allows you to choose which bibliography item you want to cite.
2857 \begin_inset Quotes eld
2861 \begin_inset Quotes erd
2864 (right now, that's the only item in the bibliography), then use the
2868 button in the center to insert it.
2869 (You can have multiple citations in the same place by transferring a number
2870 of keys this way.) Now view your file as DVI, and you'll see that the citation
2871 appears in brackets in the text, referring to the bibliography at the end
2875 \begin_layout Standard
2879 \begin_inset space ~
2888 dialog will put a remark (such as a reference to a page or chapter within
2889 the referenced book or article) in the brackets after the reference.
2890 If you want the references to have labels instead of numbers in the printed
2891 output (for example, some journals would use
2892 \begin_inset Quotes eld
2896 \begin_inset Quotes erd
2899 to refer to a paper written by Smith in 1995), use the
2906 \begin_inset space ~
2919 \begin_layout Standard
2924 Fix the bibliography and citation in
2929 \begin_layout Section
2933 \begin_layout Standard
2934 You may want to put a table of contents at the beginning of your document.
2935 LyX makes this very easy to do.
2940 after your document title and before your first section title and choose
2943 Insert\SpecialChar \menuseparator
2945 \begin_inset space ~
2949 \begin_inset space ~
2952 TOC\SpecialChar \menuseparator
2954 \begin_inset space ~
2958 \begin_inset space ~
2965 \begin_inset Quotes eld
2969 \begin_inset Quotes erd
2972 will appear in a button on the first line of the document.
2976 \begin_layout Standard
2977 This may not appear to be very useful.
2978 However, if you look at your DVI file, you will see that a table of contents
2979 has been generated, listing the various sections and subsections in your
2981 As usual, if you reorder sections or create new ones, you will see those
2982 changes in the DVI file when you update it.
2986 \begin_layout Standard
2987 The table of contents is not printed in the on-screen version of the document
2988 to keep the overview in your file.
2989 But you can display the table of contents in a separate window by clicking
2990 on the table of contents button, or by using
2992 Document\SpecialChar \menuseparator
2995 or the toolbar button
2996 \begin_inset Graphics
2997 filename ../images/dialog-toggle_toc.png
3004 This menu will work even if you don't have a table of contents inset in
3006 This is a very useful tool where you can move around your document parts.
3007 Clicking on a (sub)section title in the
3011 window will highlight that line and move the display (in the LyX editing
3012 window) to that place in the document.
3013 You can also use the arrow keys to move up and down in the table of contents.
3014 You may therefore find it convenient to leave this window open throughout
3016 You can get similar functionality from the
3020 menu, though, where the table of contents appears automatically.
3023 \begin_layout Standard
3024 To get rid of the Table of Contents, you can delete the table of contents
3025 button just like any other text.
3028 \begin_layout Standard
3033 : Fix the table of contents in
3038 \begin_layout Chapter
3042 \begin_layout Standard
3043 LaTeX is used by many scientists because it outputs great looking equations,
3044 avoiding the control characters used by word processors and their equation
3046 Many of these scientists are frustrated, however, because writing equations
3047 in LaTeX is more like programming than writing.
3048 Happily, LyX has WYSIWYM support for equations.
3049 If you are used to LaTeX, you'll find that all of the usual LaTeX math
3050 commands can be typed in normally, but they will show up in a WYSIWYM fashion.
3051 If, on the other hand, you've never written in LaTeX, then the
3054 \begin_inset space ~
3059 will allow you to write professional-looking math quickly and easily.
3062 \begin_layout Section
3066 \begin_layout Standard
3067 Somewhere in your LyX document, type:
3070 \begin_layout LyX-Code
3071 I like what Einstein said, E=mc^2, because it's so simple.
3075 \begin_layout Standard
3076 Now, that equation doesn't look very good in LyX and in the output; there's
3077 no space between the letters and the equals sign, and you'd like to write
3078 an actual superscript for the
3079 \begin_inset Quotes eld
3083 \begin_inset Quotes erd
3087 That bad typesetting happened because we didn't tell LyX that we were writing
3088 a mathematical expression, so it typeset the equation like regular old
3092 \begin_layout Standard
3093 Instead, we create a formula that will get typeset properly.
3094 In order to create a formula, just click the toolbar button
3095 \begin_inset Graphics
3096 filename ../images/math-mode.png
3104 Insert\SpecialChar \menuseparator
3105 Math\SpecialChar \menuseparator
3107 \begin_inset space ~
3113 LyX will insert a little blue square, which is an empty math formula.
3119 The expression is typed in blue, and the blue square disappears as soon
3120 as the formula is not empty.
3125 to leave the equation The purple markers disappear, leaving the cursor
3126 to the right of the expression, and now if you type something, it will
3130 \begin_layout Standard
3131 Run LaTeX and look at the output.
3132 Notice that the expression was typeset nicely, with spaces between the
3133 letters and the equals sign, and a superscript
3134 \begin_inset Quotes eld
3138 \begin_inset Quotes erd
3142 Letters in math mode are assumed to be variables, and come out in italics.
3143 Numbers are just numbers.
3146 \begin_layout Standard
3147 This math editor is another example of the WYSIWYM philosophy.
3148 In LaTeX, you write a mathematical expression using text and commands like
3155 ; this can be frustrating, because you can't see what an expression looks
3156 like until you LaTeX the file, and may have to spend time to find e.
3157 \begin_inset space \thinspace{}
3161 \begin_inset space ~
3165 LyX doesn't attempt to get the expression to look perfect (WYSIWYG), but
3166 it gives you an extremely good idea of what the expression will look like.
3167 LaTeX then takes care of the professional typesetting.
3170 \begin_layout Section
3171 Navigating an Equation
3174 \begin_layout Standard
3176 \begin_inset Formula $E=mc^{2}$
3180 \begin_inset Formula $E=1+mc^{2}$
3184 Use the arrow keys to move the cursor into the expression.
3185 Note that when you enter the expression, the purple markers appear to let
3186 you know you're editing math.
3195 to move the cursor past the equals sign, and just type
3196 \begin_inset Quotes eld
3200 \begin_inset Quotes erd
3204 Again, you can use the arrow keys or
3208 to leave the formula\SpecialChar \@.
3212 \begin_layout Standard
3213 Other than the special keys described below, typing in math mode is like
3214 editing regular text.
3224 Select text either with the arrow keys or with the mouse.
3227 Edit\SpecialChar \menuseparator
3230 works in math mode as well as cut and paste.
3231 One thing to be careful of: If you are left or right outside a formula
3240 , respectively, you delete the whole formula.
3241 Luckily, you can just use
3248 \begin_layout Standard
3249 What if you want to change
3250 \begin_inset Formula $E=mc^{2}$
3254 \begin_inset Formula $E=mc^{2.5}+1$
3257 ? Again, you can use the mouse to click in the right place.
3258 However, you can also use the arrow keys.
3259 If the cursor is just after the
3260 \begin_inset Quotes eld
3264 \begin_inset Quotes erd
3268 \begin_inset Quotes eld
3272 \begin_inset Quotes erd
3279 and the cursor is moved to the level of the superscript, just before the
3281 \begin_inset Quotes eld
3285 \begin_inset Quotes erd
3290 \begin_inset Quotes eld
3294 \begin_inset Quotes erd
3302 will move the cursor back to the regular level.
3311 , the cursor will be placed
3315 the superscript (so that you can then type the
3316 \begin_inset Quotes eld
3320 \begin_inset Quotes erd
3326 \begin_layout Section
3327 Exponents and Indices
3330 \begin_layout Standard
3331 An exponent can be entered from the
3334 \begin_inset space ~
3339 (see below), but it's actually simpler just to type the caret key,
3340 \begin_inset Quotes eld
3344 \begin_inset Quotes erd
3348 LyX will place another blue rectangle in the superscript, so that whatever
3349 you write next will be superscripted, and in a smaller font size.
3350 Everything you type until you hit a
3358 to exit the formula entirely) will be in the superscript.
3361 \begin_layout Standard
3362 Writing a subscript (index) is just as easy --- start one by typing the
3364 \begin_inset Quotes eld
3368 \begin_inset Quotes eld
3372 You can subscript and superscript both subscripts and superscripts like
3374 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3381 \begin_layout Standard
3393 \begin_layout Section
3397 \begin_layout Standard
3401 \begin_inset space ~
3406 is a convenient way to enter symbols or to perform complicated formula
3408 Many of these operations can be accomplished from the keyboard or the
3410 Edit\SpecialChar \menuseparator
3415 Insert\SpecialChar \menuseparator
3419 However, we're going to concentrate on using the
3422 \begin_inset space ~
3427 , just to let you know what's out there; you can learn keyboard shortcuts
3428 later, from other manuals.
3431 \begin_layout Standard
3436 is shown when the cursor is in a formula and can also be turned on manually
3439 View\SpecialChar \menuseparator
3443 When you click there on
3444 \begin_inset Quotes eld
3448 \begin_inset Quotes erd
3451 the toolbar will be shown permanently at the bottom; this state is visualized
3456 menu with a checkmark.
3457 When you click in this state again on
3458 \begin_inset Quotes eld
3462 \begin_inset Quotes erd
3473 is only shown when the cursor is within a formula; this state is visualized
3474 by the renaming of the menu entry from
3475 \begin_inset Quotes eld
3479 \begin_inset Quotes erd
3483 \begin_inset Quotes eld
3487 \begin_inset space ~
3491 \begin_inset Quotes erd
3497 \begin_layout Subsection
3501 \begin_layout Standard
3505 \begin_inset space ~
3510 which allow you to choose from a large array of symbols used in math: various
3511 arrows, relations, operators, and sums and integrals.
3512 Note that subscripting and superscripting allow you to put lower and upper
3513 limits on sums and integrals.
3517 \begin_layout Standard
3518 \begin_inset Quotes eld
3521 Nothing you can do that can't be done\SpecialChar \ldots{}
3523 \begin_inset Formula $\heartsuit$
3527 \begin_inset Quotes erd
3533 \begin_layout Subsection
3534 Square roots, accents, and delimiters
3537 \begin_layout Standard
3538 To type a square root, just click on the button
3539 \begin_inset Graphics
3540 filename ../images/math/sqrt.png
3547 The square root appears, and the cursor is in a new insertion point inside
3549 You can type variables, numbers, other square roots, fractions, whatever
3551 LyX will automatically resize the square root to fit what's inside.
3554 \begin_layout Standard
3555 Accenting a character (
3556 \begin_inset Formula $\overrightarrow{v}$
3559 ) or group of characters (
3560 \begin_inset Formula $\overrightarrow{a+b}$
3563 ) is done the same way.
3564 Decorations are available from the toolbar via the button
3565 \begin_inset Graphics
3566 filename ../images/math/hat.png
3573 Click on a decoration, and LyX will insert that decoration with an insertion
3574 point under (or over) it.
3575 Just type what you want in the insertion point.
3576 There are two sets of decorations: those that resize with the text you
3577 type, and those that have fixed size, and are most appropriate for a single
3582 \begin_layout Standard
3583 Delimiters such as parentheses, brackets, and braces work similarly, but
3584 are a bit more complicated.
3585 Hit the delimiter button
3586 \begin_inset Graphics
3587 filename ../images/dialog-show_mathdelimiter.png
3598 Your current selection of delimiters is displayed in a box.
3599 It's a pair of parentheses by default, but you can choose a pair of braces,
3600 a brace and a parenthesis, or choose the empty square to have something
3602 \begin_inset Quotes eld
3606 \begin_inset Formula $a=\left\langle 7\right.$
3610 \begin_inset Quotes erd
3613 (the empty delimiter is displayed as a broken line in LyX, but won't show
3617 \begin_layout Standard
3618 If you're lazy, you can type actual parentheses in math mode, rather than
3624 However, those parentheses will be the same size as regular text, which
3625 will look bad if you have a big fraction or matrix inside the parentheses.
3626 So better use in this case one of the three delimiter buttons that insert
3628 \begin_inset space \thinspace{}
3632 \begin_inset space ~
3636 \begin_inset space \thinspace{}
3642 \begin_layout Standard
3643 You can also put delimiters or a square root sign or a decoration on already
3644 existing formula parts.
3645 Select the portion of the formula that you want to adjust, and then click
3646 on the button you want from the
3649 \begin_inset space ~
3655 Try using this to change Newton's second law from scalar to vector form
3657 \begin_inset Formula $f=ma$
3661 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3665 Once you've learned about matrices, this is how you'll put parentheses
3666 or brackets around them.
3669 \begin_layout Subsection
3673 \begin_layout Standard
3674 To create a fraction, click on the fraction button
3675 \begin_inset Graphics
3676 filename ../images/math/frac.png
3686 \begin_inset space ~
3692 LyX writes two insertion points in a fraction.
3693 As you would expect, you can use arrow keys or the mouse to move around
3695 Click on the top square and type
3696 \begin_inset Quotes eld
3700 \begin_inset Quotes erd
3709 \begin_inset Quotes eld
3713 \begin_inset Quotes erd
3717 You've made a fraction! Of course you can type anything within each of
3718 the two boxes: variables with exponents, square roots, other fractions,
3723 \begin_layout Standard
3735 \begin_layout Subsection
3736 TeX mode: Limits, log, sin and others
3739 \begin_layout Standard
3740 Because letters in math mode are considered to be variables, if you type
3742 \begin_inset Quotes eld
3746 \begin_inset Quotes erd
3749 in math mode, LyX thinks you are typing the product of the three variables
3751 \begin_inset Formula $s$
3755 \begin_inset Formula $i$
3759 \begin_inset Formula $n$
3763 The three letters will be typeset in italics, when what you really wanted
3765 \begin_inset Quotes eld
3769 \begin_inset Quotes erd
3773 In addition, LyX won't put a space between the word
3774 \begin_inset Quotes eld
3778 \begin_inset Quotes erd
3782 \begin_inset Quotes eld
3786 \begin_inset Quotes erd
3793 will exit the formula).
3795 \begin_inset Quotes eld
3799 \begin_inset Formula $\sin(x)$
3803 \begin_inset Quotes erd
3807 \begin_inset Quotes eld
3811 \begin_inset Formula $sin(x)$
3815 \begin_inset Quotes erd
3821 \begin_layout Standard
3825 \begin_inset space ~
3831 \begin_inset Graphics
3832 filename ../images/math/functions.png
3839 \begin_inset Quotes eld
3843 \begin_inset Quotes erd
3846 in the appearing function list.
3848 \begin_inset Quotes eld
3852 \begin_inset Quotes erd
3855 is displayed in LyX in black, and set in upright roman type.
3856 The whole word is treated as one symbol, so if you type
3860 , it will delete the whole word.
3862 \begin_inset Quotes eld
3866 \begin_inset Quotes erd
3869 , which will be written in blue italics, like you expect in a formula.
3870 In the output, the expression will be correctly typeset.
3874 \begin_layout Standard
3875 The function list include other trigonometric functions and their inverses,
3876 hyperbolic functions, logarithms, limits, and quite a few others.
3877 These functions can take subscripts and superscripts, important for typing
3879 \begin_inset Quotes eld
3883 \begin_inset Formula $\cos^{2}\theta$
3887 \begin_inset Quotes erd
3891 \begin_inset Quotes eld
3895 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3899 \begin_inset Quotes erd
3905 \begin_layout Standard
3917 \begin_layout Subsection
3919 \begin_inset CommandInset label
3928 \begin_layout Standard
3929 Click on the matrix button
3930 \begin_inset Graphics
3931 filename ../images/dialog-show_mathmatrix.png
3940 \begin_inset space ~
3946 The appearing dialog allows you to choose how many rows and columns you
3947 want in your matrix.
3948 Choose 2 rows and 3 columns and hit
3953 LyX prints 6 insertion points in a
3954 \begin_inset Formula $2\times3$
3958 As usual, you can put any sort of formula expression (a square root, another
3959 matrix, etc.) in each insertion point.
3960 You can also leave some of the insertion points empty if you want.
3963 \begin_layout Standard
3968 can be used to move horizontally between the columns of a matrix.
3969 Alternatively, you can use the arrow keys to move around - hitting
3973 at the end of one box will move to the next box,
3977 will move to the next row, etc.
3980 \begin_layout Standard
3981 If you need to change the number of rows and columns, use the menu
3983 Edit\SpecialChar \menuseparator
3984 Math\SpecialChar \menuseparator
3986 \begin_inset space \thinspace{}
3990 \begin_inset space \thinspace{}
3995 or the math toolbar buttons
3996 \begin_inset Graphics
3997 filename ../images/tabular-feature_append-row.png
4004 \begin_inset Graphics
4005 filename ../images/tabular-feature_delete-row.png
4012 \begin_inset Graphics
4013 filename ../images/tabular-feature_append-column.png
4020 \begin_inset Graphics
4021 filename ../images/tabular-feature_delete-column.png
4030 \begin_layout Standard
4035 for information on how to change the horizontal alignment of each column,
4036 and how to change the vertical position of the whole matrix.
4037 Note that if you want to write a table containing text, you should use
4038 LyX's wonderful table support, rather than trying to write text in a matrix.
4041 \begin_layout Subsection
4045 \begin_layout Standard
4046 All of the expressions we have written so far have been on the same line
4047 as the text that came before and after them, otherwise known as inline
4049 This is fine for short, simple expressions, but if you want to write larger
4050 ones, or if you want your expressions to stand out from the text, you need
4051 to write them in display mode.
4052 In addition, only displayed expressions can be labeled and numbered (see
4057 ), and multi-line equations must be in display mode.
4060 \begin_layout Standard
4061 Click on the display button
4062 \begin_inset Graphics
4063 filename ../images/math-display.png
4072 \begin_inset space ~
4077 , which represents a couple lines of text before and after a centered blue
4079 LyX inserts a formula, but the insertion point is on a new line, and it's
4080 centered within that line.
4081 Now type an expression and run LaTeX to see how it looks.
4082 The display button is actually a toggle; use it now to change a couple
4083 of your expressions to display mode and back.
4087 \begin_layout Standard
4088 Display mode has a couple differences from inline mode:
4091 \begin_layout Itemize
4092 The default font is larger for a few symbols, like
4093 \begin_inset Formula $\sum$
4097 \begin_inset Formula $\int$
4103 \begin_layout Itemize
4104 Subscripts and superscripts for limits and sums (but not integrals) are
4105 written under rather than next to the symbols
4108 \begin_layout Itemize
4112 \begin_layout Standard
4113 Other than these differences, though, displayed expressions and inline expressio
4114 ns are very similar.
4117 \begin_layout Standard
4118 One final note about the way displayed formulas are typeset: Be careful
4119 about whether you're putting your equation into a new paragraph or not.
4120 If your formula is in the middle of a sentence or paragraph, then don't
4126 Doing so will cause the text
4130 the formula to start a new paragraph.
4131 That text will therefore eventually be indented, depending on your document
4132 paragraph settings, which is probably not what you want.
4135 \begin_layout Standard
4140 : Put the various equations in
4144 into display mode, and see how they're typeset differently.
4147 \begin_layout Standard
4152 : Using various tools you've learned in this section, you should be able
4153 to write an equation like
4157 \begin_layout Plain Layout
4158 After you've done it the hard way, give
4160 Insert\SpecialChar \menuseparator
4161 Math\SpecialChar \menuseparator
4163 \begin_inset space ~
4174 \begin_inset Formula \[
4175 f(x)=\left\{ \begin{array}{cc}
4178 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0\end{array}\right.\]
4185 \begin_layout Section
4189 \begin_layout Standard
4190 LyX's math editor can do plenty more.
4191 By now, you're familiar with the basics, so we refer to the
4198 \begin_layout Itemize
4199 Labeling and numbering expressions
4202 \begin_layout Itemize
4203 Multi-line equations
4206 \begin_layout Itemize
4207 Change typefaces, e.g., to write bold-face text in an expression.
4210 \begin_layout Itemize
4211 Fine-tune font sizes and spacing within an expression.
4212 (Don't worry about this until your final draft!)
4215 \begin_layout Itemize
4217 These are very powerful, because you just define them once at the top of
4218 the document, and then you can use them throughout the document.
4221 \begin_layout Itemize
4222 Do lots of other things that can't be mentioned in this Tutorial.
4225 \begin_layout Chapter
4229 \begin_layout Section
4230 Other major LyX Features
4233 \begin_layout Standard
4234 We haven't gone through all the possible commands in LyX, and we aren't
4243 \begin_inset space ~
4248 manual for more information.
4249 We'll just mention a couple more major things LyX can do:
4252 \begin_layout Itemize
4253 LyX has WYSIWYM support for tables.
4256 Insert\SpecialChar \menuseparator
4260 \begin_inset Graphics
4261 filename ../images/tabular-insert.png
4268 Click on the table with the
4275 \begin_inset space ~
4280 dialog box which allows extensive table editing.
4283 \begin_layout Itemize
4284 LyX also supports including pictures in any format within documents.
4287 Insert\SpecialChar \menuseparator
4291 \begin_inset Graphics
4292 filename ../images/dialog-show-new-inset_graphics.png
4299 Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4300 can have captions, and LyX will automatically generate lists of figures
4304 \begin_layout Itemize
4305 LyX is heavily configurable.
4306 Everything from how the LyX window looks to how the output comes out can
4307 be configured in a number of ways.
4308 Much configuration is done through
4310 Tools\SpecialChar \menuseparator
4314 For more information on this, check out
4316 Help\SpecialChar \menuseparator
4317 Customization\SpecialChar \@.
4321 \begin_layout Itemize
4322 LyX is being developed by a team of programmers on five continents.
4323 Therefore, LyX has better support for non-English languages (such as Dutch,
4324 German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4325 ) than many word processors.
4326 Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4327 languages Chinese Japanese, and Korean are supported.
4328 You can write documents in other languages and you can also configure LyX
4329 to show its menus and error messages in other languages.
4333 \begin_layout Itemize
4334 The LyX menus feature keybindings.
4335 This means that you can do
4337 File\SpecialChar \menuseparator
4348 or by using the binding which is shown next to it in the menu (C-O by default).
4349 Keybindings are also configurable.
4350 For information on this, check out
4352 Help\SpecialChar \menuseparator
4353 Customization\SpecialChar \@.
4357 \begin_layout Itemize
4358 LyX can read LaTeX documents.
4360 \begin_inset space ~
4364 \begin_inset CommandInset ref
4366 reference "sec:tex2lyx"
4373 \begin_layout Itemize
4374 Spellchecking, thesaurus, and word count facilities are available.
4377 \begin_layout Itemize
4378 Generation of indexes and nomenclatures/glossaries is supported.
4381 \begin_layout Section
4383 \begin_inset CommandInset label
4385 name "sec:latexusers"
4392 \begin_layout Standard
4393 If you don't know anything about LaTeX, you don't have to read this section.
4394 Actually, you might want to
4398 about LaTeX, and then read this chapter.
4399 However, some who begin to use LyX will be familiar with LaTeX.
4400 If you are such a person, you may be wondering if LyX can really do everything
4402 The short answer is that LyX can do pretty much everything LaTeX can do
4403 in one form or another, and it definitely simplifies most parts of writing
4407 \begin_layout Standard
4408 Because this is just a tutorial, we are only going to mention things that
4409 new LyX users will most likely be interested in.
4410 In the interests of keeping the Tutorial short, we will give only minimal
4415 \begin_inset space ~
4423 \begin_inset space ~
4428 manual have a great deal of information on differences between LyX and
4429 LaTeX, and how to do various LaTeX tricks in LyX.
4432 \begin_layout Subsection
4436 \begin_layout Standard
4437 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4438 will be displayed in red on the screen.
4439 You can use TeX commands in LyX by choosing
4441 Insert\SpecialChar \menuseparator
4443 \begin_inset space ~
4449 \begin_inset Graphics
4450 filename ../images/ert-insert.png
4457 This creates a box where everything within it is passed straight to LaTeX.
4460 \begin_layout Standard
4461 In a math formula, TeX mode is handled a bit differently.
4462 TeX mode is there entered by typing a backslash.
4463 The backslash is not written out, but anything you type afterwards will
4465 You exit TeX mode by typing
4469 or some other non-alphabetic character, like a number, underscore, caret,
4471 Once you exit TeX mode, if LyX knows the TeX command you've typed in, it
4472 will convert it to WYSIWYM\SpecialChar \@.
4474 \begin_inset Quotes eld
4484 \begin_inset Quotes erd
4487 in a formula and then press
4491 , LyX will change the red
4492 \begin_inset Quotes eld
4496 \begin_inset Quotes erd
4500 \begin_inset Quotes eld
4504 \begin_inset Formula $\gamma$
4508 \begin_inset Quotes erd
4512 This will work for almost all, non-complicated math macros.
4513 This may be faster than using the
4516 \begin_inset space ~
4521 , and will be especially convenient for experienced LaTeX users.
4524 \begin_layout Standard
4525 As a special case, if you type a brace in TeX mode, then the beginning
4529 ending braces will be inserted in red, then take you
4533 of TeX mode and place the cursor between the braces.
4534 This makes it more convenient to type commands that LyX doesn't know which
4538 \begin_layout Standard
4539 LyX can't do absolutely everything that LaTeX can do.
4540 Some fancy functions are not supported at all, while some work but aren't
4542 TeX mode allows users to get the full flexibility of LaTeX, while having
4543 all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4544 LyX could never support every LaTeX package.
4551 in the preamble (see section
4552 \begin_inset space ~
4556 \begin_inset CommandInset ref
4558 reference "sec:preamble"
4562 ), you can use any package you want --- although you won't have WYSIWYM
4563 support for that package's features.
4566 \begin_layout Subsection
4567 Importing LaTeX Documents ---
4572 \begin_inset CommandInset label
4581 \begin_layout Standard
4582 You can import a LaTeX file into LyX by using the
4584 File\SpecialChar \menuseparator
4585 Import\SpecialChar \menuseparator
4587 \begin_inset space ~
4593 This will call the program
4597 which will create a file
4605 and then open that file.
4606 If the translation doesn't work, you can try calling
4610 from the command line, possibly using fancier options.
4613 \begin_layout Standard
4618 will translate most legal LaTeX, but not everything.
4619 It will leave things it doesn't understand in TeX mode, so after translating
4624 , you can look for red text and hand-edit it to look right.
4627 \begin_layout Standard
4632 has its own manpage.
4633 Read it to find out about which LaTeX commands and environments aren't
4634 supported, bugs (and how to get around them), and how to use the various
4638 \begin_layout Subsection
4639 Converting LyX Documents to LaTeX
4642 \begin_layout Standard
4643 You might wish to convert a LyX Document to a LaTeX file.
4644 For example, a co-worker or co-author who doesn't have LyX might want to
4648 File\SpecialChar \menuseparator
4649 Export\SpecialChar \menuseparator
4653 This will create a file
4661 file you are editing.
4662 LyX always creates temporary LaTeX files when viewing or printing files.
4665 \begin_layout Subsection
4669 \begin_layout Subsubsection
4673 \begin_layout Standard
4676 Document\SpecialChar \menuseparator
4679 dialog takes care of many of the options that you would input in a
4686 Change the class, default font size and paper size here.
4687 Put any extra options to the
4700 \begin_inset space ~
4708 \begin_layout Subsubsection
4709 Other Preamble Matter
4710 \begin_inset CommandInset label
4719 \begin_layout Standard
4720 If you have special commands to put in the preamble of a LaTeX file, you
4721 can use them in a LyX document as well.
4724 Document\SpecialChar \menuseparator
4725 Settings\SpecialChar \menuseparator
4727 \begin_inset space ~
4732 and type in the dialog window (or from the document settings dialog, depending
4734 Anything you type will (like with TeX mode) be sent directly to LaTeX.
4737 \begin_layout Subsection
4741 \begin_layout Standard
4742 LyX has support for BibTeX, which allows you to build databases of bibliographic
4743 al references to be used in multiple documents.
4749 nsert\SpecialChar \menuseparator
4751 \begin_inset space ~
4755 \begin_inset space ~
4762 C\SpecialChar \menuseparator
4768 \begin_inset space ~
4782 field you load BibTeX files, in the
4786 field you can load BibTeX style files.
4789 \begin_layout Standard
4790 After you've done this, you can use citations from any bibliographies you're
4793 Insert\SpecialChar \menuseparator
4797 \begin_inset space ~
4801 \begin_inset CommandInset ref
4803 reference "sec:bibliographies"
4808 LyX will take care of running BibTeX.
4813 dialog will show a list of all the references in your
4820 \begin_layout Section
4824 \begin_layout Standard
4825 Sometimes when you LaTeX a document, there will be errors, things that LyX
4826 or LaTeX can't understand.
4827 When this happens, LyX will open a
4830 \begin_inset space ~
4836 Clicking on individual errors in this dialog will take you to the place
4837 in the LyX document where the error occurs and also display the detailed
4838 LaTeX error message.