1 #LyX 1.6.4 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
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 1
66 \pdf_pdfusetitle false
67 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
74 \paperorientation portrait
77 \paragraph_separation indent
79 \quotes_language english
82 \paperpagestyle headings
83 \tracking_changes false
100 \begin_layout Plain Layout
101 If you have comments or error corrections, please send them to the LyX Documenta
105 \begin_inset CommandInset href
107 target "lyx-docs@lists.lyx.org"
122 \begin_layout Standard
123 \begin_inset CommandInset toc
124 LatexCommand tableofcontents
131 \begin_layout Chapter
135 \begin_layout Section
139 \begin_layout Standard
140 This file is designed for all of you who have never heard of LaTeX, or do
141 not know it very well.
142 Now, do not panic - you will not need to learn LaTeX to use LyX.
143 That is, after all, the whole point of LyX: to provide an almost-WYSIWYG
145 There are some things you will need to learn, however, in order to use
149 \begin_layout Standard
150 Some of you probably found your way to this document because you tried to
151 put two spaces after a
152 \begin_inset Quotes eld
156 \begin_inset Quotes erd
159 or tried to put three blank lines between paragraphs.
160 You found out you could not and in fact, you will find out that most of
161 the little tricks you are accustomed to use in other word processors will
163 That is because most word processors you have used before allow you to
164 manually enter all spacings, font changes, and so on.
165 So you end up not only writing a document but typesetting it, too.
166 LyX does the typesetting for you, in a consistent fashion, letting you
167 focus on the important things, like the content of your writing.
170 \begin_layout Standard
171 So read on to learn more about LyX.
172 Reading this tutorial is definitely worth the time.
175 \begin_layout Section
185 \begin_layout Standard
186 Before we get started with this section, we want to make a quick note of
192 uses the notation outlined in the
197 If you came to this manual first, please read the
201 before you continue with the
208 \begin_layout Standard
209 Now that you know which fonts mean what, we want to talk a bit about what
217 \begin_layout Subsection
218 Getting the most out of the Tutorial
221 \begin_layout Standard
222 This tutorial consists of examples and exercises.
223 To get the most out of this document, you should read through the document,
224 typing all the little things we are telling you to type and trying out
225 all of the exercises to see if you get them right.
226 For convenience, you might want to print out the PDF version of this document.
229 \begin_layout Standard
230 If you are familiar with LaTeX, you will probably be able to read the
234 somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
235 However, LyX has features you will want to learn about.
236 Even if you do not feel like reading the rest of the
240 , you should definitely check out Section
245 \begin_inset CommandInset ref
247 reference "sec:latexusers"
251 , which is specifically written for experienced LaTeX users.
254 \begin_layout Subsection
262 \begin_layout Itemize
263 Detailed explanations of all of LyX's features.
267 \begin_layout Standard
276 \begin_layout Itemize
277 Detailed explanations of LaTeX.
281 \begin_layout Standard
283 If you want to learn some of the neat tricks you can do with LaTeX in LyX,
284 you can have a look at the
296 \begin_layout Standard
297 It is time to move onwards, time for your first document \SpecialChar \ldots{}
301 \begin_layout Chapter
302 Getting started with LyX
305 \begin_layout Section
306 Your first LyX document
309 \begin_layout Standard
311 You are ready to start writing.
312 Before you do, there are a few things we need to mention, which will hopefully
313 make the Tutorial more instructive and useful.
317 \begin_layout Standard
318 Because there is information we cannot give you in the Tutorial, the
324 thing that you need to do is find the
331 Start up LyX, Choose the
340 You may want to load the
344 as well (if you are not reading it within LyX already).
345 This way, you can read them while you are writing your own file.
349 \begin_layout Plain Layout
350 They can also serve as good examples of how to use the many features of
356 Note that once you have got more than one document open, you can use the
361 menu or the document tabs to switch between them.
364 \begin_layout Standard
365 In this Tutorial, we are going to assume that you have a fully working version
366 of LyX, as well as a LaTeX-distribution, a DVI-, and a PDF-viewer.
367 This should be the case on all major Linux- and BSD-distributions, as well
368 as on Windows, where this is setup by the LyX installers.
371 \begin_layout Standard
372 Finally, we have written a file called
376 to let you practice your LyX skills.
377 Imagine that it was typed by someone who did not know about any of LyX's
379 As you learn new LyX functions, we will suggest that you fix those parts
385 It also contains `subtle' hints about how to fix things.
389 \begin_layout Plain Layout
390 The hints are located in yellow
391 \begin_inset Quotes eld
395 \begin_inset Quotes erd
399 Access the text in a note by clicking on it.
404 If you want to cheat, or check what you have done, there is also a file
409 which contains the same text written and typeset by a LyX master.
412 \begin_layout Standard
413 The example files can be found in the
417 directory of LyX's installation folder.
418 Open the raw document, and use
420 File\SpecialChar \menuseparator
427 to save a copy in your own directory for you to work on.
428 As you fix parts of the raw document, check to see how those changes affect
432 \begin_layout Standard
437 directory contains lots of other examples files.
438 They will show you how to do various fancy things with LyX.
439 After you have read the Tutorial, or when you are confused about how to
440 do something fancy in LyX, take a look at these files.
443 \begin_layout Subsection
444 Typing, Viewing, and Exporting
447 \begin_layout Itemize
450 File\SpecialChar \menuseparator
454 \begin_layout Itemize
455 Type a sentence like:
457 This is my first LyX document!
460 \begin_layout Itemize
461 Save your document with
463 File\SpecialChar \menuseparator
472 \begin_layout Itemize
473 Run LaTeX to create a DVI file, with
475 View\SpecialChar \menuseparator
478 or the toolbar button
479 \begin_inset Graphics
480 filename ../images/buffer-view_dvi.png
486 LyX will open a DVI-viewer program displaying your document as it will
491 \begin_layout Plain Layout
492 You can save time by leaving the DVI-viewer running in the background.
495 View\SpecialChar \menuseparator
496 Update\SpecialChar \menuseparator
499 or the toolbar button
500 \begin_inset Graphics
501 filename ../images/buffer-update_dvi.png
506 and just click on the DVI-viewer window (or unminimize it) after LaTeX
515 \begin_layout Itemize
516 Export the ready to print document with
518 File\SpecialChar \menuseparator
526 \begin_layout Standard
527 Congratulations! You have written your first LyX document.
528 All of the rest is just details, which are covered in the other manuals.
531 \begin_layout Subsection
535 \begin_layout Standard
536 LyX can of course do most of the things you are used to do with a word processor.
537 It will word-wrap and indent paragraphs automatically.
538 Here is a quick description of how to do some simple actions.
541 \begin_layout Description
542 Undo LyX has multiple levels of undo, which means you can undo everything
543 you have done since your current editing session started, by selecting
546 Edit\SpecialChar \menuseparator
550 \begin_inset Graphics
551 filename ../images/undo.png
556 ) over and over again.
557 If you undo too much, just select
559 Edit\SpecialChar \menuseparator
563 \begin_inset Graphics
564 filename ../images/redo.png
574 \begin_layout Standard
575 Currently, undo is limited to 100 steps.
579 \begin_layout Description
582 Edit\SpecialChar \menuseparator
586 \begin_inset Graphics
587 filename ../images/cut.png
594 Edit\SpecialChar \menuseparator
598 \begin_inset Graphics
599 filename ../images/copy.png
606 Edit\SpecialChar \menuseparator
610 \begin_inset Graphics
611 filename ../images/paste.png
616 ) to cut, copy, and paste.
617 Or automatically paste selected text (including selections from other programs)
625 \begin_layout Description
628 Edit\SpecialChar \menuseparator
640 \begin_inset Graphics
641 filename ../images/dialog-show_findreplace.png
647 In the dialog, search with the
659 button to replace a word you have found.
663 \begin_layout Plain Layout
664 Close the window when you are done or leave it open if you find it more
666 Most dialog boxes in LyX can operate like this.
667 Just be sure you have the right window focus when you are trying to type
668 in the main LyX window or a LyX dialog.
673 If you like, you can specify whether to make the search case-sensitive,
674 or to search for only complete words; you can also search backwards through
678 \begin_layout Description
687 text (which will by default print characters in italics), set it in
695 (usually small caps, used for people's names), or use your own formatting
698 Edit\SpecialChar \menuseparator
705 dialog (toolbar button
706 \begin_inset Graphics
707 filename ../images/dialog-show_character.png
715 \begin_layout Description
716 Toolbar There are buttons on the toolbar (just below the menus) which allow
717 you to do some of the more popular functions, such as
728 \begin_layout Standard
729 Of course, you have not yet written enough to make most of these functions
731 As you write more, though, try undoing, pasting, etc.
734 \begin_layout Subsection
735 WYSIWYM: Whitespace in LyX
738 \begin_layout Standard
739 One of the hardest things for new users to get used to is the way that LyX
741 As many times as you hit
745 , you will only get one blank line.
746 As many times as you hit
750 , you will only get one space.
751 On a blank line, LyX will not let you type even one space.
756 key will not move you forward one tab stop; in fact there
760 no tab stops! There is no ruler at the top of the page to let you set tabs
764 \begin_layout Standard
765 Many word processors are based on the WYSIWYG principle:
766 \begin_inset Quotes eld
769 What You See Is What You Get.
770 \begin_inset Quotes erd
773 LyX, on the other hand, is based on the principle that
774 \begin_inset Quotes eld
777 What You See Is What You
782 \begin_inset Quotes erd
785 You type what you mean, and LyX will take care of typesetting it for you,
786 so that the output looks nice.
791 grammatically separates paragraphs, and a
795 grammatically separates words, so there is no reason to have several of
800 has no grammatical function at all, so LyX does not support it.
801 Using LyX, you will spend more of your time worrying about the
805 of your document, and less time worrying about the
814 for more information on the WYSIWYM concept.
817 \begin_layout Standard
818 LyX does have (many) ways to fine-tune the formatting of your document.
819 After all, LyX might not typeset
828 has information about all that.
833 s and vertical space — which are more powerful and versatile than multiple
834 spaces or blank lines — and ways to change font sizes, character styles,
835 and paragraph alignments by hand.
836 The idea, though, is that you can write your whole document, focusing on
837 content, and just worry about that fine-tuning at the end.
838 With standard word processors, you will be distracted by document formatting
839 throughout the writing process.
842 \begin_layout Section
846 \begin_layout Standard
847 Different parts of a document have different purposes; we call these parts
853 Most of a document is made up of regular text.
854 Section titles (chapter, subsection, etc.) let the reader know that a new
855 topic or subtopic will be discussed.
856 Certain types of documents have special environments.
857 A journal article will have an abstract and a title.
858 A letter will have neither of these, but will probably have an environment
859 that gives the writer's address.
862 \begin_layout Standard
863 Environments are a major part of the
864 \begin_inset Quotes eld
867 What You See Is What You Mean
868 \begin_inset Quotes erd
872 A given environment may require a certain font style, font size, indenting,
873 line spacing, and more.
874 This problem is aggravated, because the exact formatting for a given environmen
875 t may change: one journal may use boldface, 18 point, centered type for
876 section titles while another uses italicized, 15 point, left justified
877 type; different languages may have different standards for indenting; and
878 bibliography formats can vary widely.
879 LyX lets you avoid learning all the different formatting styles.
882 \begin_layout Standard
887 choice box is located on the left end of the toolbar and looks like this:
889 \begin_inset Graphics
890 filename clipart/ToolbarEnvBox.png
897 It indicates in which environment you are currently writing.
898 While you were writing your first document, it said
899 \begin_inset Quotes eld
903 \begin_inset Quotes erd
906 which is the default environment for text.
907 Now you will put a number of environments in your new document so that
908 you can see how they work.
911 \begin_layout Subsection
912 Sections and Subsections
915 \begin_layout Standard
920 on the first line of your LyX file, and select
932 \begin_layout Plain Layout
938 If nothing is selected, LyX changes the paragraph you are currently in
939 to the selected environment.
940 Alternatively, you can change several paragraphs to a different environment
941 by selecting them before picking an environment.
958 , which will be covered below.
959 LyX numbers the section
960 \begin_inset Quotes eld
964 \begin_inset Quotes erd
967 and typesets the section heading (title) in a larger font.
978 \begin_inset Quotes eld
982 \begin_inset Quotes erd
986 \begin_inset Quotes eld
990 \begin_inset Quotes erd
994 Section headings, like most environments, are assumed to end when you type
1000 Type the document introduction:
1003 \begin_layout LyX-Code
1004 This is an introduction to my first LyX document.
1007 \begin_layout Standard
1022 \begin_inset Quotes eld
1026 \begin_inset Quotes erd
1029 and waits for you to type a title.
1031 \begin_inset Quotes eld
1037 \begin_inset space ~
1043 \begin_inset Quotes erd
1046 , and you will see that LyX again sets it as a section title.
1049 \begin_layout Standard
1051 Go to the end of Section
1052 \begin_inset space ~
1056 \begin_inset Quotes eld
1059 my first LyX document
1060 \begin_inset Quotes erd
1077 \begin_inset Quotes eld
1081 \begin_inset Quotes erd
1084 and waits for you to type a title.
1091 \begin_inset space ~
1095 \begin_inset Quotes eld
1099 \begin_inset Quotes erd
1103 \begin_inset space ~
1106 2, has been automatically renumbered to Section
1107 \begin_inset space ~
1110 3! In true WYSIWYM fashion, you just need to identify the text that makes
1111 up the section titles, and LyX takes care of numbering the sections and
1115 \begin_layout Standard
1124 environment, and type the following five lines:
1127 \begin_layout LyX-Code
1128 Sections and subsections are described below.
1131 \begin_layout LyX-Code
1135 \begin_layout LyX-Code
1136 Sections are bigger than subsections.
1139 \begin_layout LyX-Code
1140 Subsection description
1143 \begin_layout LyX-Code
1144 Subsections are smaller than sections.
1147 \begin_layout Standard
1148 Click on the second line and select
1157 LyX numbers the subsection
1158 \begin_inset Quotes eld
1162 \begin_inset Quotes erd
1165 , and typesets it in a font which is bigger than regular text but smaller
1166 than the section title.
1167 Change the fourth line
1171 environment as well.
1172 As you probably expected, LyX automatically numbered the section
1173 \begin_inset Quotes eld
1177 \begin_inset Quotes erd
1181 If you put yet another section before Section
1182 \begin_inset space ~
1186 \begin_inset space ~
1189 2 will be renumbered as Section 3, and the subsections will be renumbered
1191 \begin_inset Quotes eld
1195 \begin_inset Quotes erd
1199 \begin_inset Quotes eld
1203 \begin_inset Quotes erd
1210 \begin_layout Standard
1211 Further levels of sectioning include
1224 We will let you play with these on your own.
1225 You may notice that paragraph and subparagraph headings are not numbered
1226 by default, and that subparagraphs are indented; see the
1230 for an explanation and how to change this.
1235 headings are actually the highest level of sectioning, above
1239 s, but you are only allowed to use them in certain types (text classes)
1240 of LyX documents (see Section
1241 \begin_inset space ~
1245 \begin_inset CommandInset ref
1247 reference "sec:Document-Classes"
1255 \begin_layout Standard
1256 Finally, you may want to have sections or subsections that are not numbered.
1257 There are environments for this as well.
1258 If you change one of your section headings to the
1262 environment (you may have to scroll down in the
1266 box to find it), LyX will use the same font size for the heading as it
1267 uses for a regular section, but it will not number that section.
1268 There are corresponding
1269 \begin_inset Quotes eld
1273 \begin_inset Quotes erd
1276 heading environments for
1285 Try changing some of your sections or subsections to the starred environments,
1286 and note how the other section numbers are updated.
1289 \begin_layout Standard
1294 : Fix the section and subsection headings in
1302 \begin_layout Subsection
1306 \begin_layout Standard
1307 LyX has several different environments for typesetting lists.
1308 The various list environments free you from hitting
1312 a million times when writing an outline, or from renumbering a whole list
1313 when you want to add a point in the middle of the list.
1314 Different types of documents logically require different list environments:
1317 \begin_layout Itemize
1318 A slide presentation might use the
1322 environment's bulleted lists to describe different points.
1326 \begin_layout Itemize
1327 An outline would use the
1331 environment's numbered lists (and lettered sublists).
1335 \begin_layout Itemize
1336 A document describing several software packages could use the
1340 environment, where each item in the list begins with a bold-faced word.
1344 \begin_layout Itemize
1353 , environment is a variation on the
1360 \begin_layout Standard
1361 Let us write a list of reasons why LyX is better than other word processors.
1362 Somewhere in your document, type:
1365 \begin_layout Standard
1368 LyX is better than other word processors because:
1371 \begin_layout Standard
1387 \begin_inset Quotes eld
1391 \begin_inset Quotes erd
1395 Type in your reasons:
1398 \begin_layout LyX-Code
1399 Typesetting is done for you.
1402 \begin_layout LyX-Code
1406 \begin_layout LyX-Code
1407 Lists are very easy to create!
1410 \begin_layout Standard
1411 List environments, unlike headings, do not end when you type
1416 Instead, LyX assumes you are going on to the next item in the list.
1417 The above will therefore result in a three-item list.
1418 If you want more than one paragraph within one list
1422 , one way is to use the
1425 \begin_inset space ~
1430 , which you get by typing
1435 In order to get out of the list, you need to reselect the
1439 environment (or just use the keybinding,
1442 \begin_inset space ~
1450 \begin_layout Standard
1451 You have got a beautiful itemized list.
1452 You might want to run LaTeX to see how the list looks when printed out.
1453 But what if you wanted to number the reasons? Well, just select the whole
1458 \begin_layout Plain Layout
1459 LyX will not let you select the first bullet unless you also select the
1464 the list, which you probably do not want to do.
1465 Similarly, you cannot select the actual number in a numbered section title.
1466 This is on purpose because the bullet or number depends on the document
1467 settings or text position, respectively.
1481 Pow! As we mentioned, if you add or delete a list item, LyX will fix the
1485 \begin_layout Standard
1486 While the list is still selected, you can change to the other two list environme
1495 , in order to see what they look like.
1496 For those two environments, each list item is made up of a term, which
1497 is the item's first word, followed by a definition, which is the rest of
1498 the paragraph (until you hit
1502 .) The term is either typeset in boldface (
1507 \begin_inset Quotes eld
1511 \begin_inset Quotes erd
1518 \begin_layout Plain Layout
1519 But a typesetter's tab, which will change to fit the size of the largest
1520 term, not a pathetic, rigid, unchangeable typewriter
1533 ) from the rest of the paragraph.
1534 If you want to have more than one word in the definition, then separate
1538 \begin_inset space ~
1546 \begin_layout Standard
1551 : Typeset the list in
1556 \begin_layout Standard
1557 You can nest lists within each other in all sorts of interesting ways.
1558 An obvious example would be writing outlines.
1559 Numbered and bulleted lists will have different numbering and bulleting
1560 schemes for sublists.
1565 for details on the different sorts of lists and for examples of nestings.
1568 \begin_layout Subsection
1569 Other environments: Verses, Quotations, and more
1572 \begin_layout Standard
1573 There are two environments for setting quotations apart from surrounding
1578 for short quotes and
1591 \begin_layout Plain Layout
1592 used in this Tutorial for the long typing examples
1601 font; this environment is the only place in LyX where you are allowed to
1602 use multiple spaces to allow code indenting.
1603 You can even write poetry using the
1611 to separate stanzas, and
1615 to separate lines within a stanza.
1620 for more complete descriptions of all of the available LyX environments.
1623 \begin_layout Standard
1628 : Correctly typeset the
1637 \begin_inset Newline newline
1645 \begin_layout Chapter
1649 \begin_layout Standard
1650 The previous chapter hopefully allowed you to get used to writing in LyX.
1651 It introduced you to the basic editing operations in LyX, as well as the
1652 powerful method of writing with environments.
1653 Most people who use LyX, though, will want to write documents: papers,
1654 articles, books, manuals, or letters.
1655 This chapter is meant to take you from simply writing text with LyX to
1656 writing a complete document.
1657 It will introduce you to text classes, which allow you to write different
1659 It will then describe many of the additions that turn text into a document,
1660 such as titles, footnotes, cross references, bibliographies, and tables
1664 \begin_layout Section
1666 \begin_inset CommandInset label
1668 name "sec:Document-Classes"
1675 \begin_layout Standard
1676 Different sorts of documents should be typeset differently.
1677 For example, books are generally printed double-sided, while articles are
1679 In addition, many documents contain special environments: letters contain
1680 some environments — such as the sender's address and the signature — which
1681 do not make sense in a book or article.
1690 \begin_layout Plain Layout
1691 for LaTeX users: this is equivalent to the LaTeX document class
1696 takes care of these large scale differences between different sorts of
1698 This Tutorial, for example, was written in the
1703 Document classes are another major part of the WYSIWYM philosophy; they
1704 tell LyX how to typeset the document, so you do not need to know how.
1707 \begin_layout Standard
1708 Your document is probably being written in the
1716 \begin_layout Plain Layout
1717 That is usually the default document class
1722 Try changing to other document classes (using the
1724 Document\SpecialChar \menuseparator
1727 dialog) to see how they are typeset differently.
1728 If you change your document to the
1732 document class and look at the
1736 box, you will see that most of the allowed environments are the same.
1737 However, you can now use the
1742 If you are ever unsure about which environments you can use in a given
1743 document class, just consult the
1750 \begin_layout Standard
1751 Font sizes, one- or two-column printing, and page headings are just some
1752 of the ways journals' typesettings differ from one another.
1753 As the Computer Age continues to mature, journals have begun accepting
1754 electronic submissions, creating LaTeX
1755 \begin_inset Quotes eld
1759 \begin_inset Quotes erd
1762 so that authors can submit correctly typeset articles.
1763 LyX is set up to support this as well.
1764 For example, LyX supports typesetting (and extra environments) for the
1765 American Mathematics Society journals using the
1768 \begin_inset space ~
1776 \begin_layout Standard
1777 Here is a very quick reference to some of the document classes.
1780 Special Document Classes
1786 manual for many more details.
1789 \begin_layout Standard
1791 \begin_inset Tabular
1792 <lyxtabular version="3" rows="7" columns="2">
1794 <column alignment="center" valignment="top" width="0pt">
1795 <column alignment="center" valignment="top" width="0pt">
1797 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1800 \begin_layout Plain Layout
1806 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1809 \begin_layout Plain Layout
1817 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1820 \begin_layout Plain Layout
1826 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1829 \begin_layout Plain Layout
1830 one-sided, no chapters
1837 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1840 \begin_layout Plain Layout
1846 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1849 \begin_layout Plain Layout
1850 layout & environments for American Math Society
1857 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1860 \begin_layout Plain Layout
1866 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1869 \begin_layout Plain Layout
1870 longer than article, two-sided
1877 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1880 \begin_layout Plain Layout
1886 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1889 \begin_layout Plain Layout
1890 report + front and back matter
1897 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1900 \begin_layout Plain Layout
1906 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1909 \begin_layout Plain Layout
1917 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1920 \begin_layout Plain Layout
1926 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1929 \begin_layout Plain Layout
1930 lots of extra environments for address, signature\SpecialChar \ldots{}
1944 \begin_layout Section
1945 Templates: Writing a Letter
1948 \begin_layout Standard
1949 One way to write a letter would be to open a new file, and choose a
1955 Document\SpecialChar \menuseparator
1959 While this is the most obvious way to write a letter, it seems like extra
1961 Every time you write a business letter, you want to have your address,
1962 the address to which you are sending it, a body, a signature, etc.
1967 for letters, which contains a sample letter; once you have a template,
1968 you can just replace a couple of parts of the letter with your text each
1969 time you write a letter.
1972 \begin_layout Standard
1973 Open a new file with
1975 File\SpecialChar \menuseparator
1977 \begin_inset space ~
1981 \begin_inset space ~
1992 Save and print the file to see how the various environments are typeset.
1995 \begin_layout Standard
1996 When you look at the
2000 box, you will see several environments, like the
2003 \begin_inset space ~
2008 environment, which do not even exist in most other document classes.
2018 You can play around for a while to figure out how the various environments
2020 You will notice for example that the
2024 environment has the word
2025 \begin_inset Quotes eld
2029 \begin_inset Quotes eld
2032 in red before the actual text of the signature.
2033 This word does not show up in the actual letter, as you will see if you
2034 view/export the file.
2035 It is just there to let you know where the signature goes.
2036 Also, note that it does not matter where in the file the
2041 Remember, LyX is WYSIWYM; you can put the
2045 environment anywhere you want, but LyX knows that in the printout, the
2046 signature should be at the end.
2049 \begin_layout Standard
2050 A template is just a regular LyX file.
2051 This means you can fill in your address and signature and save the file
2053 From now on, any time you want to write a letter, you can use the new template
2055 We do not have to suggest an actual
2056 \begin_inset Quotes eld
2060 \begin_inset Quotes erd
2063 here; just write a letter to someone!
2067 \begin_layout Plain Layout
2068 One warning, if you are writing from a template.
2069 If you erase all of the text in an environment — for example, if you erase
2073 \begin_inset space ~
2078 field so that you can replace it with your own — and then you move the
2079 cursor without writing any text, the environment may disappear.
2080 This is because most environments cannot exist without any text in them.
2081 Just reselect the environment from the
2093 \begin_layout Standard
2094 Templates can be a huge time-saver, and we urge you to use them whenever
2096 In addition, they can help a person learn how to use some of the fancier
2098 Finally, they may be useful for a person who is configuring LyX for a bunch
2099 of less computer-aware users.
2100 When they are first learning LyX, it will be much less intimidating if
2101 they have a letter template customized for their company, for example.
2104 \begin_layout Section
2108 \begin_layout Standard
2109 LyX (like LaTeX) considers the title — which may contain the actual title,
2110 the author, the date, and even an abstract of a paper — to be a separate
2111 part of the document.
2114 \begin_layout Standard
2115 Go back to your LyX document and make sure it is using the
2123 \begin_layout Plain Layout
2124 You should not be using the letter any more, since the
2128 document class does not allow titles.
2133 Type a title on the first line, and change the line to the
2138 On the next line, type your name and change it to the
2143 On the next line, write the date in the
2148 Type a paragraph or two summarizing your document using the
2153 Notice how the title is presented when it is printed out.
2154 If you change the document format to Book, you will get a separate title
2155 page, like the first page of this tutorial.
2158 \begin_layout Standard
2163 : Fix the title, date, and author in
2168 \begin_layout Section
2169 Labels and Cross-References
2172 \begin_layout Standard
2173 You can label section headings, list items, formulas, footnotes, and floats
2177 \begin_layout Plain Layout
2178 Floats are explained in the
2192 Once you do so, you can refer to this section in other parts of the document,
2193 using cross-references.
2194 You can refer either to the section's number, or to the page that the section
2196 As with section numbering, LyX also takes care about cross-reference numbering
2198 Automatic labels and cross-references are among the most significant advantages
2199 of LyX (and LaTeX) over conventional word processors.
2203 \begin_layout Subsection
2207 \begin_layout Standard
2208 Go to our second section, whose title is
2209 \begin_inset Quotes eld
2213 \begin_inset Quotes erd
2217 Click at the end of the section title line, and select
2219 Insert\SpecialChar \menuseparator
2222 or the toolbar button
2223 \begin_inset Graphics
2224 filename ../images/label-insert.png
2231 A dialog asks you for a label name, and gives you a suggestion.
2236 , the label name will be placed in a box next to the section title.
2239 \begin_layout Standard
2240 So far you have not done anything — the DVI output will look exactly the
2241 same, since labels do not show up in the printed document.
2242 However, now that you have added a label, you can refer to that label with
2244 We will do that next.
2247 \begin_layout Subsection
2248 Your first cross-reference
2251 \begin_layout Standard
2252 Place the cursor somewhere in section
2253 \begin_inset space ~
2260 \begin_layout LyX-Code
2261 If you want to know more about this document, then see
2262 \begin_inset Newline newline
2265 section, which can be found on page.
2268 \begin_layout Standard
2269 Now — with the cursor after the word `Section' — choose
2271 Insert\SpecialChar \menuseparator
2273 \begin_inset space ~
2278 or the toolbar button
2279 \begin_inset Graphics
2280 filename ../images/dialog-show-new-inset_ref.png
2287 The Cross-reference dialog pops up.
2288 It shows a list of the possible labels you can reference.
2289 At the moment, there should be only one, `sec:About-This-Document'.
2290 First, select the drop-down menu labelled Format and select '<reference>
2291 on page <page>.' Then select `sec:About-This-Document' (it may be selected
2292 by default), and a reference marker will appear containing `Ref+Text: sec:About
2293 -This-Document' (To be really correct, you should put a
2296 \begin_inset space ~
2301 in between the word `Section' and the reference).
2302 Alternatively to that method, you can right-click on a label and use in
2303 the appearing context menu
2308 The cross-reference to this label is now in the clipboard and can be copied
2309 to the actual cursor position via the menu
2311 Edit\SpecialChar \menuseparator
2319 In the printed document, this reference marker will be replaced with the
2320 section number and then the page number.
2321 View your document as DVI, and you will see that LaTeX has been even cleverer
2323 It refers to `Section 2' and depending how much text you have between the
2324 start of Section 2 and this cross-reference you may see `on this page,'
2325 'on the previous page' or `on page n' (whereas n is the page number).
2328 \begin_layout Standard
2329 Conveniently, a cross-reference acts as a hyperlink when you are editing
2330 a document in LyX; clicking on it will pop up the
2337 \begin_inset space ~
2341 \begin_inset space ~
2346 will move the cursor to the referenced label.
2349 \begin_layout Subsection
2350 More fun with labels
2353 \begin_layout Standard
2354 We told you that LyX takes care about numbering cross-references; now you
2356 Add a new section before Section
2357 \begin_inset space ~
2361 Update the DVI view, and — voilà! — the section cross reference changed
2363 \begin_inset Quotes eld
2367 \begin_inset Quotes erd
2370 ! Change the section
2371 \begin_inset Quotes eld
2375 \begin_inset Quotes erd
2378 to a subsection, and the cross-reference will reference Subsection
2379 \begin_inset space ~
2382 2.1 instead of Section
2383 \begin_inset space ~
2387 The page reference will not change unless you add a whole page of text
2388 before the label, of course.
2392 \begin_layout Standard
2393 If you want some more practice with labels, then try putting a new label
2394 where your first cross-reference was, and refer to that label from elsewhere
2396 If you will be inserting cross-references often, it may be convenient to
2404 \begin_layout Standard
2405 If you want to make sure that the cross-referencing gets the pages right
2406 even for larger documents,
2410 a couple pages of text from the
2414 to the clipboard, and
2418 the stolen text into your document.
2422 \begin_layout Plain Layout
2423 By the way, copying a chapter title may cause an error, because chapters
2424 are not allowed in the article class, see section
2425 \begin_inset space ~
2429 \begin_inset CommandInset ref
2431 reference "sec:Document-Classes"
2436 If this happens, just delete the chapter title.
2444 \begin_layout Standard
2449 : Fix the references in
2454 \begin_layout Section
2455 Footnotes and Margin Notes
2458 \begin_layout Standard
2459 Footnotes can be added using the toolbar button
2460 \begin_inset Graphics
2461 filename ../images/footnote-insert.png
2469 Insert\SpecialChar \menuseparator
2473 Click at the end of the word
2474 \begin_inset Quotes eld
2478 \begin_inset Quotes erd
2481 somewhere in your document and click the
2482 \begin_inset Graphics
2483 filename ../images/footnote-insert.png
2490 A footnote box appears where you can enter the text of the footnote.
2491 LyX should place the cursor at the beginning of the footnote box.
2495 \begin_layout LyX-Code
2496 LyX is a typesetting word processor.
2499 \begin_layout Standard
2500 Now click on the button labelled
2501 \begin_inset Quotes eld
2505 \begin_inset Quotes erd
2509 The footnote box is closed, leaving the button showing where the footnote
2510 marker will be in the printed text; this is called
2511 \begin_inset Quotes eld
2515 \begin_inset Quotes erd
2519 You can unfold the footnote at any time and re-edit its text by clicking
2521 \begin_inset Quotes eld
2525 \begin_inset Quotes erd
2531 \begin_layout Standard
2532 A footnote can be cut and pasted like normal text.
2533 Go ahead; try it! All you need to do is select the footnote button
2537 \begin_layout Plain Layout
2538 It may be easier to select it using the keyboard.
2539 You might accidentally open the footnote if you are trying to select the
2540 marker itself with the mouse.
2554 In addition, you can change regular text to a footnote, by selecting it
2556 \begin_inset Graphics
2557 filename ../images/footnote-insert.png
2563 button; change a footnote to regular text by hitting the
2567 key when the cursor is in the first position of a footnote, or by hitting
2572 key when the cursor is in the very last position of the footnote, respectively.
2575 \begin_layout Standard
2576 Margin notes can be added using the menu
2578 Insert\SpecialChar \menuseparator
2580 \begin_inset space ~
2585 or the toolbar button
2586 \begin_inset Graphics
2587 filename ../images/marginalnote-insert.png
2594 Margin notes are like footnotes, except that:
2597 \begin_layout Itemize
2598 the on-screen boxes say
2599 \begin_inset Quotes eld
2603 \begin_inset Quotes erd
2607 \begin_inset Quotes eld
2611 \begin_inset Quotes erd
2617 \begin_layout Itemize
2618 the notes will be placed in the margin, instead of below the text
2621 \begin_layout Itemize
2622 margin notes are not numbered
2625 \begin_layout Standard
2626 Change your LyX footnote back to text, then select and change it to a margin
2628 Run LaTeX again to see what the margin note looks like.
2631 \begin_layout Standard
2636 : Fix the footnote in
2641 \begin_layout Section
2643 \begin_inset CommandInset label
2645 name "sec:bibliographies"
2652 \begin_layout Standard
2653 Bibliographies (at least in the exact sciences) are similar to cross references.
2654 The bibliography contains a list of references at the end of the document,
2655 and they can be referenced from within the document.
2656 Like section titles, LyX and LaTeX make your job easier by automatically
2657 numbering the bibliography items and changing citations when the item numbers
2661 \begin_layout Standard
2662 Go to the end of the document and switch to the
2667 Now, each paragraph you type will be a reference.
2669 \begin_inset Quotes eld
2674 The Lyx Tutorial, by the LyX Documentation Team
2677 \begin_inset Quotes erd
2680 as your first reference.
2681 Note that LyX automatically puts a number in a box before each reference.
2682 Click on the boxed reference number, and the
2685 \begin_inset space ~
2695 is to refer to this reference within the LyX document, the
2704 is set (default), you will see the number of the bibliography in the output.
2710 \begin_inset Quotes eld
2714 \begin_inset Quotes erd
2717 to make it easy to remember.
2720 \begin_layout Standard
2721 Now pick somewhere in your document that you would like to insert a reference.
2724 Insert\SpecialChar \menuseparator
2727 or the toolbar button
2728 \begin_inset Graphics
2729 filename ../images/dialog-show-new-inset_citation.png
2741 The right panel in this dialog lists all the bibliography entries, and
2742 this field allows you to choose which bibliography item you want to cite.
2744 \begin_inset Quotes eld
2748 \begin_inset Quotes erd
2751 (right now, that is the only item in the bibliography), then use the
2755 button in the center to insert it.
2756 (You can have multiple citations in the same place by transferring a number
2757 of keys this way.) Now view your file as DVI, and you will see that the
2758 citation appears in brackets in the text, referring to the bibliography
2759 at the end of the document.
2762 \begin_layout Standard
2766 \begin_inset space ~
2775 dialog will put a remark (such as a reference to a page or chapter within
2776 the referenced book or article) in the brackets after the reference.
2777 If you want the references to have labels instead of numbers in the printed
2778 output (for example, some journals would use
2779 \begin_inset Quotes eld
2783 \begin_inset Quotes erd
2786 to refer to a paper written by Smith in 1995), use the
2793 \begin_inset space ~
2806 \begin_layout Standard
2811 Fix the bibliography and citation in
2816 \begin_layout Section
2820 \begin_layout Standard
2821 You may want to put a table of contents at the beginning of your document.
2822 LyX makes this very easy to do.
2827 after your document title and before your first section title and choose
2830 Insert\SpecialChar \menuseparator
2832 \begin_inset space ~
2836 \begin_inset space ~
2839 TOC\SpecialChar \menuseparator
2841 \begin_inset space ~
2845 \begin_inset space ~
2852 \begin_inset Quotes eld
2856 \begin_inset Quotes erd
2859 will appear in a button on the first line of the document.
2863 \begin_layout Standard
2864 This may not appear to be very useful.
2865 However, if you look at your DVI file, you will see that a table of contents
2866 has been generated, listing the various sections and subsections in your
2868 As usual, if you reorder sections or create new ones, you will see those
2869 changes in the DVI file when you update it.
2873 \begin_layout Standard
2874 The table of contents is not printed in the on-screen version of the document.
2875 But you can display the table of contents in a separate window by clicking
2876 on the table of contents button, or by using
2878 Document\SpecialChar \menuseparator
2881 or the toolbar button
2882 \begin_inset Graphics
2883 filename ../images/dialog-toggle_toc.png
2890 This menu will work even if you do not have a table of contents inset in
2892 This is a very useful tool for moving around your document parts.
2893 Clicking on a (sub)section title in the
2897 window will highlight that line and move the display (in the LyX editing
2898 window) to that place in the document.
2899 You can also use the arrow keys to move up and down in the table of contents.
2900 You may therefore find it convenient to leave this window open throughout
2902 You can get similar functionality from the
2906 menu, though, where the table of contents appears automatically.
2909 \begin_layout Standard
2910 To get rid of the Table of Contents, you can delete the table of contents
2911 button just like any other text.
2914 \begin_layout Standard
2919 : Fix the table of contents in
2924 \begin_layout Chapter
2928 \begin_layout Standard
2929 LaTeX is used by many scientists because it outputs great looking equations,
2930 avoiding the control characters used by word processors and their equation
2932 Many of these scientists are frustrated, however, because writing equations
2933 in LaTeX is more like programming than writing.
2934 Happily, LyX has WYSIWYM support for equations.
2935 If you are used to LaTeX, you will find that all of the usual LaTeX math
2936 commands can be typed in normally, but they will show up in a WYSIWYM fashion.
2937 If, on the other hand, you have never written in LaTeX, then the
2940 \begin_inset space ~
2945 will allow you to write professional-looking math quickly and easily.
2948 \begin_layout Section
2952 \begin_layout Standard
2953 Somewhere in your LyX document, type:
2956 \begin_layout LyX-Code
2957 I like what Einstein said, E=mc^2, because it is so simple.
2961 \begin_layout Standard
2962 Now, that equation does not look very good in LyX and in the output; there
2963 is no space between the letters and the equals sign, and you would like
2964 to write an actual superscript for the
2965 \begin_inset Quotes eld
2969 \begin_inset Quotes erd
2973 That bad typesetting happened because we did not tell LyX that we were
2974 writing a mathematical expression, so it typeset the equation like regular
2978 \begin_layout Standard
2979 Instead, we create a formula that will get typeset properly.
2980 In order to create a formula, just click the toolbar button
2981 \begin_inset Graphics
2982 filename ../images/math-mode.png
2990 Insert\SpecialChar \menuseparator
2991 Math\SpecialChar \menuseparator
2993 \begin_inset space ~
2999 LyX will insert a little blue square, which is an empty math formula.
3005 The expression is typed in blue, and the blue square disappears as soon
3006 as the formula is not empty.
3011 to leave the equation The purple markers disappear, leaving the cursor
3012 to the right of the expression, and now if you type something, it will
3016 \begin_layout Standard
3017 Run LaTeX and look at the output.
3018 Notice that the expression was typeset nicely, with spaces between the
3019 letters and the equals sign, and a superscript
3020 \begin_inset Quotes eld
3024 \begin_inset Quotes erd
3028 Letters in math mode are assumed to be variables, and come out in italics.
3029 Numbers are just numbers.
3032 \begin_layout Standard
3033 This math editor is another example of the WYSIWYM philosophy.
3034 In LaTeX, you write a mathematical expression using text and commands like
3041 ; this can be frustrating, because you cannot see what an expression looks
3042 like until you LaTeX the file, and may have to spend time to find e.
3043 \begin_inset space \thinspace{}
3047 \begin_inset space \space{}
3051 LyX does not attempt to get the expression to look perfect (WYSIWYG), but
3052 it gives you an extremely good idea of what the expression will look like.
3053 LaTeX then takes care of the professional typesetting.
3056 \begin_layout Section
3057 Navigating an Equation
3060 \begin_layout Standard
3062 \begin_inset Formula $E=mc^{2}$
3066 \begin_inset Formula $E=1+mc^{2}$
3070 Use the arrow keys to move the cursor into the expression.
3071 Note that when you enter the expression, the purple markers appear to let
3072 you know you are editing math.
3081 to move the cursor past the equals sign, and just type
3082 \begin_inset Quotes eld
3086 \begin_inset Quotes erd
3090 Again, you can use the arrow keys or
3094 to leave the formula\SpecialChar \@.
3098 \begin_layout Standard
3099 Other than the special keys described below, typing in math mode is like
3100 editing regular text.
3110 Select text either with the arrow keys or with the mouse.
3113 Edit\SpecialChar \menuseparator
3116 works in math mode as well as cut and paste.
3117 One thing to be careful of: If you are left or right outside a formula
3126 , respectively, you delete the whole formula.
3127 Luckily, you can just use
3134 \begin_layout Standard
3135 What if you want to change
3136 \begin_inset Formula $E=mc^{2}$
3140 \begin_inset Formula $E=mc^{2.5}+1$
3143 ? Again, you can use the mouse to click in the right place.
3144 However, you can also use the arrow keys.
3145 If the cursor is just after the
3146 \begin_inset Quotes eld
3150 \begin_inset Quotes erd
3154 \begin_inset Quotes eld
3158 \begin_inset Quotes erd
3165 and the cursor is moved to the level of the superscript, just before the
3167 \begin_inset Quotes eld
3171 \begin_inset Quotes erd
3176 \begin_inset Quotes eld
3180 \begin_inset Quotes erd
3188 will move the cursor back to the regular level.
3197 , the cursor will be placed
3201 the superscript (so that you can then type the
3202 \begin_inset Quotes eld
3206 \begin_inset Quotes erd
3212 \begin_layout Section
3213 Exponents and Indices
3216 \begin_layout Standard
3217 An exponent can be entered from the
3220 \begin_inset space ~
3225 (see below), but it is actually simpler just to type the caret key,
3226 \begin_inset Quotes eld
3230 \begin_inset Quotes erd
3234 LyX will place another blue rectangle in the superscript, so that whatever
3235 you write next will be superscripted, and in a smaller font size.
3236 Everything you type until you hit a
3244 to exit the formula entirely) will be in the superscript.
3247 \begin_layout Standard
3248 Writing a subscript (index) is just as easy — start one by typing the underscore
3250 \begin_inset Quotes eld
3254 \begin_inset Quotes eld
3258 You can subscript and superscript both subscripts and superscripts like
3260 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3267 \begin_layout Standard
3279 \begin_layout Section
3283 \begin_layout Standard
3287 \begin_inset space ~
3292 is a convenient way to enter symbols or to perform complicated formula
3294 Many of these operations can be accomplished from the keyboard or the
3296 Edit\SpecialChar \menuseparator
3301 Insert\SpecialChar \menuseparator
3305 However, we are going to concentrate on using the
3308 \begin_inset space ~
3313 , just to let you know what is out there; you can learn keyboard shortcuts
3314 later, from other manuals.
3317 \begin_layout Standard
3322 is shown when the cursor is in a formula and can also be turned on manually
3325 View\SpecialChar \menuseparator
3329 When you click there on
3330 \begin_inset Quotes eld
3334 \begin_inset Quotes erd
3337 the toolbar will be shown permanently at the bottom; this state is visualized
3342 menu with a checkmark.
3343 When you click in this state again on
3344 \begin_inset Quotes eld
3348 \begin_inset Quotes erd
3359 is only shown when the cursor is within a formula; this state is visualized
3360 by the renaming of the menu entry from
3361 \begin_inset Quotes eld
3365 \begin_inset Quotes erd
3369 \begin_inset Quotes eld
3373 \begin_inset space ~
3377 \begin_inset Quotes erd
3383 \begin_layout Subsection
3387 \begin_layout Standard
3391 \begin_inset space ~
3396 which allow you to choose from a large array of symbols used in math: various
3397 arrows, relations, operators, and sums and integrals.
3398 Note that subscripting and superscripting allow you to put lower and upper
3399 limits on sums and integrals.
3403 \begin_layout Standard
3404 \begin_inset Quotes eld
3407 Nothing you can do that can not be done\SpecialChar \ldots{}
3409 \begin_inset Formula $\heartsuit$
3413 \begin_inset Quotes erd
3419 \begin_layout Subsection
3420 Square roots, accents, and delimiters
3423 \begin_layout Standard
3424 To type a square root, just click on the button
3425 \begin_inset Graphics
3426 filename ../images/math/sqrt.png
3433 The square root appears, and the cursor is in a new insertion point inside
3435 You can type variables, numbers, other square roots, fractions, whatever
3437 LyX will automatically resize the square root to fit what is inside.
3440 \begin_layout Standard
3441 Accenting a character (
3442 \begin_inset Formula $\overrightarrow{v}$
3445 ) or group of characters (
3446 \begin_inset Formula $\overrightarrow{a+b}$
3449 ) is done the same way.
3450 Decorations are available from the toolbar via the button
3451 \begin_inset Graphics
3452 filename ../images/math/hat.png
3459 Click on a decoration, and LyX will insert that decoration with an insertion
3460 point under (or over) it.
3461 Just type what you want in the insertion point.
3462 There are two sets of decorations: those that resize with the text you
3463 type, and those that have fixed size, and are most appropriate for a single
3468 \begin_layout Standard
3469 Delimiters such as parentheses, brackets, and braces work similarly, but
3470 are a bit more complicated.
3471 Hit the delimiter button
3472 \begin_inset Graphics
3473 filename ../images/dialog-show_mathdelimiter.png
3484 Your current selection of delimiters is displayed in a box.
3485 It is a pair of parentheses by default, but you can choose a pair of braces,
3486 a brace and a parenthesis, or choose the empty square to have something
3488 \begin_inset Quotes eld
3492 \begin_inset Formula $a=\left\langle 7\right.$
3496 \begin_inset Quotes erd
3499 (the empty delimiter is displayed as a broken line in LyX, but will not
3500 show up in the output).
3503 \begin_layout Standard
3504 If you are lazy, you can type actual parentheses in math mode, rather than
3510 However, those parentheses will be the same size as regular text, which
3511 will look bad if you have a big fraction or matrix inside the parentheses.
3512 So better use in this case one of the three delimiter buttons that insert
3514 \begin_inset space \thinspace{}
3518 \begin_inset space \space{}
3522 \begin_inset space \thinspace{}
3528 \begin_layout Standard
3529 You can also put delimiters or a square root sign or a decoration on already
3530 existing formula parts.
3531 Select the portion of the formula that you want to adjust, and then click
3532 on the button you want from the
3535 \begin_inset space ~
3541 Try using this to change Newton's second law from scalar to vector form
3543 \begin_inset Formula $f=ma$
3547 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3551 Once you have learned about matrices, this is how you will put parentheses
3552 or brackets around them.
3555 \begin_layout Subsection
3559 \begin_layout Standard
3560 To create a fraction, click on the fraction button
3561 \begin_inset Graphics
3562 filename ../images/math/frac.png
3572 \begin_inset space ~
3578 LyX writes two insertion points in a fraction.
3579 As you would expect, you can use arrow keys or the mouse to move around
3581 Click on the top square and type
3582 \begin_inset Quotes eld
3586 \begin_inset Quotes erd
3595 \begin_inset Quotes eld
3599 \begin_inset Quotes erd
3603 You have made a fraction! Of course you can type anything within each of
3604 the two boxes: variables with exponents, square roots, other fractions,
3609 \begin_layout Standard
3621 \begin_layout Subsection
3622 TeX mode: Limits, log, sin and others
3625 \begin_layout Standard
3626 Because letters in math mode are considered to be variables, if you type
3628 \begin_inset Quotes eld
3632 \begin_inset Quotes erd
3635 in math mode, LyX thinks you are typing the product of the three variables
3637 \begin_inset Formula $s$
3641 \begin_inset Formula $i$
3645 \begin_inset Formula $n$
3649 The three letters will be typeset in italics, when what you really wanted
3651 \begin_inset Quotes eld
3655 \begin_inset Quotes erd
3659 In addition, LyX will not put a space between the word
3660 \begin_inset Quotes eld
3664 \begin_inset Quotes erd
3668 \begin_inset Quotes eld
3672 \begin_inset Quotes erd
3679 will exit the formula).
3681 \begin_inset Quotes eld
3685 \begin_inset Formula $\sin(x)$
3689 \begin_inset Quotes erd
3693 \begin_inset Quotes eld
3697 \begin_inset Formula $sin(x)$
3701 \begin_inset Quotes erd
3707 \begin_layout Standard
3711 \begin_inset space ~
3717 \begin_inset Graphics
3718 filename ../images/math/functions.png
3725 \begin_inset Quotes eld
3729 \begin_inset Quotes erd
3732 in the appearing function list.
3734 \begin_inset Quotes eld
3738 \begin_inset Quotes erd
3741 is displayed in LyX in black, and set in upright roman type.
3742 The whole word is treated as one symbol, so if you type
3746 , it will delete the whole word.
3748 \begin_inset Quotes eld
3752 \begin_inset Quotes erd
3755 , which will be written in blue italics, like you expect in a formula.
3756 In the output, the expression will be correctly typeset.
3760 \begin_layout Standard
3761 The function list include other trigonometric functions and their inverses,
3762 hyperbolic functions, logarithms, limits, and quite a few others.
3763 These functions can take subscripts and superscripts, important for typing
3765 \begin_inset Quotes eld
3769 \begin_inset Formula $\cos^{2}\theta$
3773 \begin_inset Quotes erd
3777 \begin_inset Quotes eld
3781 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3785 \begin_inset Quotes erd
3791 \begin_layout Standard
3803 \begin_layout Subsection
3807 \begin_layout Standard
3808 Click on the matrix button
3809 \begin_inset Graphics
3810 filename ../images/dialog-show_mathmatrix.png
3819 \begin_inset space ~
3825 The appearing dialog allows you to choose how many rows and columns you
3826 want in your matrix.
3827 Choose 2 rows and 3 columns and hit
3832 LyX prints 6 insertion points in a
3833 \begin_inset Formula $2\times3$
3837 As usual, you can put any sort of formula expression (a square root, another
3838 matrix, etc.) in each insertion point.
3839 You can also leave some of the insertion points empty if you want.
3842 \begin_layout Standard
3847 can be used to move horizontally between the columns of a matrix.
3848 Alternatively, you can use the arrow keys to move around - hitting
3852 at the end of one box will move to the next box,
3856 will move to the next row, etc.
3859 \begin_layout Standard
3860 If you need to change the number of rows and columns, use the menu
3862 Edit\SpecialChar \menuseparator
3864 \begin_inset space \thinspace{}
3868 \begin_inset space \thinspace{}
3873 or the math toolbar buttons
3874 \begin_inset Graphics
3875 filename ../images/tabular-feature_append-row.png
3882 \begin_inset Graphics
3883 filename ../images/tabular-feature_delete-row.png
3890 \begin_inset Graphics
3891 filename ../images/tabular-feature_append-column.png
3898 \begin_inset Graphics
3899 filename ../images/tabular-feature_delete-column.png
3908 \begin_layout Standard
3913 for information on how to change the horizontal alignment of each column,
3914 and how to change the vertical position of the whole matrix.
3915 Note that if you want to write a table containing text, you should use
3916 LyX's wonderful table support, rather than trying to write text in a matrix.
3919 \begin_layout Subsection
3923 \begin_layout Standard
3924 All of the expressions we have written so far have been on the same line
3925 as the text that came before and after them, otherwise known as inline
3927 This is fine for short, simple expressions, but if you want to write larger
3928 ones, or if you want your expressions to stand out from the text, you need
3929 to write them in display mode.
3930 In addition, only displayed expressions can be labeled and numbered (see
3935 ), and multi-line equations must be in display mode.
3938 \begin_layout Standard
3939 Click on the display button
3940 \begin_inset Graphics
3941 filename ../images/math-display.png
3950 \begin_inset space ~
3955 , which represents a couple lines of text before and after a centered blue
3957 LyX inserts a formula, but the insertion point is on a new line, and it
3958 is centered within that line.
3959 Now type an expression and run LaTeX to see how it looks.
3960 The display button is actually a toggle; use it now to change a couple
3961 of your expressions to display mode and back.
3965 \begin_layout Standard
3966 Display mode has a couple differences from inline mode:
3969 \begin_layout Itemize
3970 The default font is larger for a few symbols, like
3971 \begin_inset Formula $\sum$
3975 \begin_inset Formula $\int$
3981 \begin_layout Itemize
3982 Subscripts and superscripts for limits and sums (but not integrals) are
3983 written under rather than next to the symbols
3986 \begin_layout Itemize
3990 \begin_layout Standard
3991 Other than these differences, though, displayed expressions and inline expressio
3992 ns are very similar.
3995 \begin_layout Standard
3996 One final note about the way displayed formulas are typeset: Be careful
3997 about whether you are putting your equation into a new paragraph or not.
3998 If your formula is in the middle of a sentence or paragraph, then do not
4004 Doing so will cause the text
4008 the formula to start a new paragraph.
4009 That text will therefore eventually be indented, depending on your document
4010 paragraph settings, which is probably not what you want.
4013 \begin_layout Standard
4018 : Put the various equations in
4022 into display mode, and see how they are typeset differently.
4025 \begin_layout Standard
4030 : Using various tools you have learned in this section, you should be able
4031 to write an equation like
4035 \begin_layout Plain Layout
4036 After you have done it the hard way, give
4038 Insert\SpecialChar \menuseparator
4039 Math\SpecialChar \menuseparator
4041 \begin_inset space ~
4052 \begin_inset Formula \[
4053 f(x)=\left\{ \begin{array}{cc}
4056 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0\end{array}\right.\]
4063 \begin_layout Section
4067 \begin_layout Standard
4068 LyX's math editor can do plenty more.
4069 By now, you are familiar with the basics, so we refer to the
4076 \begin_layout Itemize
4077 Labeling and numbering expressions
4080 \begin_layout Itemize
4081 Multi-line equations
4084 \begin_layout Itemize
4085 Change typefaces, e.
4086 \begin_inset space \thinspace{}
4090 \begin_inset space \space{}
4093 to write bold-face text in an expression.
4096 \begin_layout Itemize
4097 Fine-tune font sizes and spacing within an expression.
4098 (Do not worry about this until your final draft!)
4101 \begin_layout Itemize
4103 These are very powerful, because you just define them once at the top of
4104 the document, and then you can use them throughout the document.
4107 \begin_layout Itemize
4108 Do lots of other things that cannot be mentioned in this Tutorial.
4111 \begin_layout Chapter
4115 \begin_layout Section
4116 Other major LyX Features
4119 \begin_layout Standard
4120 We have not gone through all the possible commands in LyX, and we are not
4129 \begin_inset space ~
4134 manual for more information.
4135 We will just mention a couple more major things LyX can do:
4138 \begin_layout Itemize
4139 LyX has WYSIWYM support for tables.
4142 Insert\SpecialChar \menuseparator
4146 \begin_inset Graphics
4147 filename ../images/tabular-insert.png
4154 Click on the table with the
4161 \begin_inset space ~
4166 dialog box which allows extensive table editing.
4169 \begin_layout Itemize
4170 LyX also supports including pictures in any format within documents.
4173 Insert\SpecialChar \menuseparator
4177 \begin_inset Graphics
4178 filename ../images/dialog-show-new-inset_graphics.png
4185 Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4186 can have captions, and LyX will automatically generate lists of figures
4190 \begin_layout Itemize
4191 LyX is heavily configurable.
4192 Everything from how the LyX window looks to how the output comes out can
4193 be configured in a number of ways.
4194 Much configuration is done through
4196 Tools\SpecialChar \menuseparator
4200 For more information on this, check out
4202 Help\SpecialChar \menuseparator
4203 Customization\SpecialChar \@.
4207 \begin_layout Itemize
4208 LyX is being developed by a team of programmers on five continents.
4209 Therefore, LyX has better support for non-English languages (such as Dutch,
4210 German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4211 ) than many word processors.
4212 Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4213 languages Chinese Japanese, and Korean are supported.
4214 You can write documents in other languages and you can also configure LyX
4215 to show its menus and error messages in other languages.
4219 \begin_layout Itemize
4220 The LyX menus feature keybindings.
4221 This means that you can do
4223 File\SpecialChar \menuseparator
4234 or by using the binding which is shown next to it in the menu (Ctrl+O by
4236 Keybindings are also configurable.
4237 For information on this, check out
4239 Help\SpecialChar \menuseparator
4240 Customization\SpecialChar \@.
4244 \begin_layout Itemize
4245 LyX can read LaTeX documents.
4247 \begin_inset space ~
4251 \begin_inset CommandInset ref
4253 reference "sec:tex2lyx"
4260 \begin_layout Itemize
4261 Spellchecking, thesaurus, and word count facilities are available.
4264 \begin_layout Itemize
4265 Generation of indexes and nomenclatures/glossaries is supported.
4268 \begin_layout Section
4270 \begin_inset CommandInset label
4272 name "sec:latexusers"
4279 \begin_layout Standard
4280 If you do not know anything about LaTeX, you do not have to read this section.
4281 Actually, you might want to
4285 about LaTeX, and then read this chapter.
4286 However, some who begin to use LyX will be familiar with LaTeX.
4287 If you are such a person, you may be wondering if LyX can really do everything
4289 The short answer is that LyX can do pretty much everything LaTeX can do
4290 in one form or another, and it definitely simplifies most parts of writing
4294 \begin_layout Standard
4295 Because this is just a tutorial, we are only going to mention things that
4296 new LyX users will most likely be interested in.
4297 In the interests of keeping the Tutorial short, we will give only minimal
4302 \begin_inset space ~
4310 \begin_inset space ~
4315 manual have a great deal of information on differences between LyX and
4316 LaTeX, and how to do various LaTeX tricks in LyX.
4319 \begin_layout Subsection
4323 \begin_layout Standard
4324 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4325 will be displayed in red on the screen.
4326 You can use TeX commands in LyX by choosing
4328 Insert\SpecialChar \menuseparator
4330 \begin_inset space ~
4336 \begin_inset Graphics
4337 filename ../images/ert-insert.png
4344 This creates a box where everything within it is passed straight to LaTeX.
4347 \begin_layout Standard
4348 In a math formula, TeX mode is handled a bit differently.
4349 TeX mode is there entered by typing a backslash.
4350 The backslash is not written out, but anything you type afterwards will
4352 You exit TeX mode by typing
4356 or some other non-alphabetic character, like a number, underscore, caret,
4358 Once you exit TeX mode, if LyX knows the TeX command you have typed in,
4359 it will convert it to WYSIWYM\SpecialChar \@.
4361 \begin_inset Quotes eld
4371 \begin_inset Quotes erd
4374 in a formula and then press
4378 , LyX will change the red
4379 \begin_inset Quotes eld
4383 \begin_inset Quotes erd
4387 \begin_inset Quotes eld
4391 \begin_inset Formula $\gamma$
4395 \begin_inset Quotes erd
4399 This will work for almost all, non-complicated math macros.
4400 This may be faster than using the
4403 \begin_inset space ~
4408 , and will be especially convenient for experienced LaTeX users.
4411 \begin_layout Standard
4412 As a special case, if you type a brace in TeX mode, then the beginning
4416 ending braces will be inserted in red, then take you
4420 of TeX mode and place the cursor between the braces.
4421 This makes it more convenient to type commands that LyX does not know which
4425 \begin_layout Standard
4426 LyX cannot do absolutely everything that LaTeX can do.
4427 Some fancy functions are not supported at all, while some work but are
4429 TeX mode allows users to get the full flexibility of LaTeX, while having
4430 all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4431 LyX could never support every LaTeX package.
4438 in the preamble (see section
4439 \begin_inset space ~
4443 \begin_inset CommandInset ref
4445 reference "sec:preamble"
4449 ), you can use any package you want — although you will not have WYSIWYM
4450 support for that package's features.
4453 \begin_layout Subsection
4454 Importing LaTeX Documents —
4459 \begin_inset CommandInset label
4468 \begin_layout Standard
4469 You can import a LaTeX file into LyX by using the
4471 File\SpecialChar \menuseparator
4472 Import\SpecialChar \menuseparator
4474 \begin_inset space ~
4480 This will call the program
4484 which will create a file
4492 and then open that file.
4493 If the translation does not work, you can try calling
4497 from the command line, possibly using fancier options.
4500 \begin_layout Standard
4505 will translate most legal LaTeX, but not everything.
4506 It will leave things it does not understand in TeX mode, so after translating
4511 , you can look for red text and hand-edit it to look right.
4514 \begin_layout Standard
4519 has its own manpage.
4520 Read it to find out about which LaTeX commands and environments are not
4521 supported, bugs (and how to get around them), and how to use the various
4525 \begin_layout Subsection
4526 Converting LyX Documents to LaTeX
4529 \begin_layout Standard
4530 You might wish to convert a LyX Document to a LaTeX file.
4531 For example, a co-worker or co-author who does not have LyX might want
4535 File\SpecialChar \menuseparator
4536 Export\SpecialChar \menuseparator
4540 This will create a file
4548 file you are editing.
4549 LyX always creates temporary LaTeX files when viewing or printing files.
4552 \begin_layout Subsection
4556 \begin_layout Subsubsection
4560 \begin_layout Standard
4563 Document\SpecialChar \menuseparator
4566 dialog takes care of many of the options that you would input in a
4573 Change the class, default font size and paper size here.
4574 Put any extra options to the
4587 \begin_inset space ~
4595 \begin_layout Subsubsection
4596 Other Preamble Matter
4597 \begin_inset CommandInset label
4606 \begin_layout Standard
4607 If you have special commands to put in the preamble of a LaTeX file, you
4608 can use them in a LyX document as well.
4611 Document\SpecialChar \menuseparator
4612 Settings\SpecialChar \menuseparator
4614 \begin_inset space ~
4619 and type in the dialog window (or from the document settings dialog, depending
4621 Anything you type will (like with TeX mode) be sent directly to LaTeX.
4624 \begin_layout Subsection
4628 \begin_layout Standard
4629 LyX has support for BibTeX, which allows you to build databases of bibliographic
4630 al references to be used in multiple documents.
4633 Insert\SpecialChar \menuseparator
4635 \begin_inset space ~
4639 \begin_inset space ~
4642 TOC\SpecialChar \menuseparator
4644 \begin_inset space ~
4658 field you load BibTeX files, in the
4662 field you can load BibTeX style files.
4665 \begin_layout Standard
4666 After you have done this, you can use citations from any bibliographies
4667 you are including with
4669 Insert\SpecialChar \menuseparator
4673 \begin_inset space ~
4677 \begin_inset CommandInset ref
4679 reference "sec:bibliographies"
4684 LyX will take care of running BibTeX.
4689 dialog will show a list of all the references in your
4696 \begin_layout Section
4700 \begin_layout Standard
4701 Sometimes when you LaTeX a document, there will be errors, things that LyX
4702 or LaTeX cannot understand.
4703 When this happens, LyX will open a
4706 \begin_inset space ~
4712 Clicking on individual errors in this dialog will take you to the place
4713 in the LyX document where the error occurs and also display the detailed
4714 LaTeX error message.