]> git.lyx.org Git - lyx.git/blob - lib/doc/Tutorial.lyx
A couple minor changes in the User's Guide.
[lyx.git] / lib / doc / Tutorial.lyx
1 #LyX 1.6.5svn created this file. For more info see http://www.lyx.org/
2 \lyxformat 345
3 \begin_document
4 \begin_header
5 \textclass book
6 \begin_preamble
7 % DO NOT ALTER THIS PREAMBLE!!!
8 %
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
15
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
18
19  % set fonts for nicer pdf view
20  \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}
21
22 \fi % end if pdflatex is used
23
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{%
28   \frontmatter
29   \pdfbookmark[1]{\contentsname}{}
30   \myTOC
31   \mainmatter }
32
33 % redefine the \LyX macro for PDF bookmarks
34 \def\LyX{\texorpdfstring{%
35   L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
36   {LyX}}
37 \end_preamble
38 \use_default_options false
39 \language english
40 \inputencoding auto
41 \font_roman default
42 \font_sans default
43 \font_typewriter default
44 \font_default_family default
45 \font_sc false
46 \font_osf false
47 \font_sf_scale 100
48 \font_tt_scale 100
49
50 \graphics default
51 \paperfontsize 12
52 \spacing single
53 \use_hyperref true
54 \pdf_title "The LyX Tutorial"
55 \pdf_author "LyX Team"
56 \pdf_subject "LyX-documentation Tutorial"
57 \pdf_keywords "LyX, documentation"
58 \pdf_bookmarks true
59 \pdf_bookmarksnumbered true
60 \pdf_bookmarksopen true
61 \pdf_bookmarksopenlevel 1
62 \pdf_breaklinks false
63 \pdf_pdfborder false
64 \pdf_colorlinks true
65 \pdf_backref false
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"
68 \papersize default
69 \use_geometry false
70 \use_amsmath 0
71 \use_esint 0
72 \cite_engine basic
73 \use_bibtopic false
74 \paperorientation portrait
75 \secnumdepth 3
76 \tocdepth 2
77 \paragraph_separation indent
78 \defskip medskip
79 \quotes_language english
80 \papercolumns 1
81 \papersides 2
82 \paperpagestyle headings
83 \tracking_changes false
84 \output_changes false
85 \author "" 
86 \author "" 
87 \end_header
88
89 \begin_body
90
91 \begin_layout Title
92 The LyX Tutorial
93 \end_layout
94
95 \begin_layout Author
96 by the LyX Team
97 \begin_inset Foot
98 status collapsed
99
100 \begin_layout Plain Layout
101 If you have comments or error corrections, please send them to the LyX Documenta
102 tion mailing list, 
103 \family typewriter
104
105 \begin_inset CommandInset href
106 LatexCommand href
107 target "lyx-docs@lists.lyx.org"
108 type "mailto:"
109
110 \end_inset
111
112
113 \family default
114 .
115 \end_layout
116
117 \end_inset
118
119
120 \end_layout
121
122 \begin_layout Standard
123 \begin_inset CommandInset toc
124 LatexCommand tableofcontents
125
126 \end_inset
127
128
129 \end_layout
130
131 \begin_layout Chapter
132 Introduction
133 \end_layout
134
135 \begin_layout Section
136 Welcome to LyX!
137 \end_layout
138
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
144  interface to LaTeX.
145  There are some things you will need to learn, however, in order to use
146  LyX effectively.
147 \end_layout
148
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
153 \end_inset
154
155 .
156 \begin_inset Quotes erd
157 \end_inset
158
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
162  not work in LyX.
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.
168 \end_layout
169
170 \begin_layout Standard
171 So read on to learn more about LyX.
172  Reading this tutorial is definitely worth the time.
173 \end_layout
174
175 \begin_layout Section
176 What the Tutorial 
177 \emph on
178 is
179 \emph default
180  and what it 
181 \emph on
182 is not
183 \end_layout
184
185 \begin_layout Standard
186 Before we get started with this section, we want to make a quick note of
187  something.
188  The 
189 \emph on
190 Tutorial
191 \emph default
192  uses the notation outlined in the 
193 \emph on
194 Introduction
195 \emph default
196  manual.
197  If you came to this manual first, please read the 
198 \emph on
199 Introduction
200 \emph default
201  before you continue with the 
202 \emph on
203 Tutorial
204 \emph default
205 .
206 \end_layout
207
208 \begin_layout Standard
209 Now that you know which fonts mean what, we want to talk a bit about what
210  this 
211 \emph on
212 Tutorial
213 \emph default
214  is for.
215 \end_layout
216
217 \begin_layout Subsection
218 Getting the most out of the Tutorial
219 \end_layout
220
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.
227 \end_layout
228
229 \begin_layout Standard
230 If you are familiar with LaTeX, you will probably be able to read the 
231 \emph on
232 Tutorial
233 \emph default
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 
237 \emph on
238 Tutorial
239 \emph default
240 , you should definitely check out Section
241 \begin_inset space ~
242 \end_inset
243
244
245 \begin_inset CommandInset ref
246 LatexCommand ref
247 reference "sec:latexusers"
248
249 \end_inset
250
251 , which is specifically written for experienced LaTeX users.
252 \end_layout
253
254 \begin_layout Subsection
255 What you 
256 \emph on
257 will not
258 \emph default
259  find
260 \end_layout
261
262 \begin_layout Itemize
263 Detailed explanations of all of LyX's features.
264 \end_layout
265
266 \begin_deeper
267 \begin_layout Standard
268 Look in the 
269 \emph on
270 User's Guide
271 \emph default
272  when you need this.
273 \end_layout
274
275 \end_deeper
276 \begin_layout Itemize
277 Detailed explanations of LaTeX.
278 \end_layout
279
280 \begin_deeper
281 \begin_layout Standard
282 Unnecessary.
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 
285 \emph on
286 Embedded
287 \begin_inset space ~
288 \end_inset
289
290 Objects
291 \emph default
292  manual.
293 \end_layout
294
295 \end_deeper
296 \begin_layout Standard
297 It is time to move onwards, time for your first document \SpecialChar \ldots{}
298
299 \end_layout
300
301 \begin_layout Chapter
302 Getting started with LyX
303 \end_layout
304
305 \begin_layout Section
306 Your first LyX document
307 \end_layout
308
309 \begin_layout Standard
310 OK\SpecialChar \@.
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.
314  
315 \end_layout
316
317 \begin_layout Standard
318 Because there is information we cannot give you in the Tutorial, the 
319 \emph on
320 first
321 \emph default
322  
323 \series medium
324 thing that you need to do is find the
325 \series default
326  other 
327 \series medium
328 help files.
329  This is very simple:
330 \series default
331  Start up LyX, Choose the 
332 \emph on
333 User's Guide
334 \emph default
335  from the 
336 \family sans
337 Help
338 \family default
339  menu.
340  You may want to load the 
341 \emph on
342 Tutorial
343 \emph default
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.
346 \begin_inset Foot
347 status collapsed
348
349 \begin_layout Plain Layout
350 They can also serve as good examples of how to use the many features of
351  LyX.
352 \end_layout
353
354 \end_inset
355
356  Note that once you have got more than one document open, you can use the
357  
358 \family sans
359 View
360 \family default
361  menu or the document tabs to switch between them.
362 \end_layout
363
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.
369 \end_layout
370
371 \begin_layout Standard
372 Finally, we have written a file called 
373 \family typewriter
374 example_raw.lyx
375 \family default
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
378  great features.
379  As you learn new LyX functions, we will suggest that you fix those parts
380  of 
381 \family typewriter
382 example_raw.lyx
383 \family default
384 .
385  It also contains `subtle' hints about how to fix things.
386 \begin_inset Foot
387 status collapsed
388
389 \begin_layout Plain Layout
390 The hints are located in yellow 
391 \begin_inset Quotes eld
392 \end_inset
393
394 Notes
395 \begin_inset Quotes erd
396 \end_inset
397
398 .
399  Access the text in a note by clicking on it.
400 \end_layout
401
402 \end_inset
403
404  If you want to cheat, or check what you have done, there is also a file
405  called 
406 \family typewriter
407 example_lyxified.lyx
408 \family default
409  which contains the same text written and typeset by a LyX master.
410 \end_layout
411
412 \begin_layout Standard
413 The example files can be found in the 
414 \family typewriter
415 examples
416 \family default
417  directory of LyX's installation folder.
418  Open the raw document, and use 
419 \family sans
420 File\SpecialChar \menuseparator
421 Save
422 \begin_inset space ~
423 \end_inset
424
425 As
426 \family default
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
429  the DVI output.
430 \end_layout
431
432 \begin_layout Standard
433 By the way, the 
434 \family typewriter
435 examples
436 \family default
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.
441 \end_layout
442
443 \begin_layout Subsection
444 Typing, Viewing, and Exporting
445 \end_layout
446
447 \begin_layout Itemize
448 Open a new file with 
449 \family sans
450 File\SpecialChar \menuseparator
451 New
452 \end_layout
453
454 \begin_layout Itemize
455 Type a sentence like: 
456 \family typewriter
457 This is my first LyX document!
458 \end_layout
459
460 \begin_layout Itemize
461 Save your document with 
462 \family sans
463 File\SpecialChar \menuseparator
464 Save
465 \begin_inset space ~
466 \end_inset
467
468 As\SpecialChar \@.
469
470 \end_layout
471
472 \begin_layout Itemize
473 Run LaTeX to create a DVI file, with 
474 \family sans
475 View\SpecialChar \menuseparator
476 DVI
477 \family default
478  or the toolbar button 
479 \begin_inset Graphics
480         filename ../images/buffer-view_dvi.png
481         scale 75
482
483 \end_inset
484
485 .
486  LyX will open a DVI-viewer program displaying your document as it will
487  look when printed.
488 \begin_inset Foot
489 status collapsed
490
491 \begin_layout Plain Layout
492 You can save time by leaving the DVI-viewer running in the background.
493  Then, you can use 
494 \family sans
495 View\SpecialChar \menuseparator
496 Update\SpecialChar \menuseparator
497 DVI
498 \family default
499  or the toolbar button 
500 \begin_inset Graphics
501         filename ../images/buffer-update_dvi.png
502         scale 75
503
504 \end_inset
505
506  and just click on the DVI-viewer window (or unminimize it) after LaTeX
507  finishes running.
508 \end_layout
509
510 \end_inset
511
512
513 \end_layout
514
515 \begin_layout Itemize
516 Export the ready to print document with 
517 \family sans
518 File\SpecialChar \menuseparator
519 Export
520 \family default
521  to a format you want
522 \family sans
523 .
524 \end_layout
525
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.
529 \end_layout
530
531 \begin_layout Subsection
532 Simple Operations
533 \end_layout
534
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.
539 \end_layout
540
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
544  
545 \family sans
546 Edit\SpecialChar \menuseparator
547 Undo
548 \family default
549  (toolbar button 
550 \begin_inset Graphics
551         filename ../images/undo.png
552         scale 75
553
554 \end_inset
555
556 ) over and over again.
557  If you undo too much, just select 
558 \family sans
559 Edit\SpecialChar \menuseparator
560 Redo
561 \family default
562  (toolbar button 
563 \begin_inset Graphics
564         filename ../images/redo.png
565         scale 75
566
567 \end_inset
568
569 ) to get it back.
570  
571 \end_layout
572
573 \begin_deeper
574 \begin_layout Standard
575 Currently, undo is limited to 100 steps.
576 \end_layout
577
578 \end_deeper
579 \begin_layout Description
580 Cut/Paste/Copy Use 
581 \family sans
582 Edit\SpecialChar \menuseparator
583 Cut
584 \family default
585  (toolbar button 
586 \begin_inset Graphics
587         filename ../images/cut.png
588         scale 75
589
590 \end_inset
591
592 ), 
593 \family sans
594 Edit\SpecialChar \menuseparator
595 Copy
596 \family default
597  (toolbar button 
598 \begin_inset Graphics
599         filename ../images/copy.png
600         scale 75
601
602 \end_inset
603
604 ), and 
605 \family sans
606 Edit\SpecialChar \menuseparator
607 Paste
608 \family default
609  (toolbar button 
610 \begin_inset Graphics
611         filename ../images/paste.png
612         scale 75
613
614 \end_inset
615
616 ) to cut, copy, and paste.
617  Or automatically paste selected text (including selections from other programs)
618  with the 
619 \emph on
620 middle mouse button
621 \emph default
622 .
623 \end_layout
624
625 \begin_layout Description
626 Find/Replace Use 
627 \family sans
628 Edit\SpecialChar \menuseparator
629 Find
630 \begin_inset space ~
631 \end_inset
632
633 &
634 \begin_inset space ~
635 \end_inset
636
637 Replace
638 \family default
639  (toolbar button 
640 \begin_inset Graphics
641         filename ../images/dialog-show_findreplace.png
642         scale 75
643
644 \end_inset
645
646 ) to search.
647  In the dialog, search with the 
648 \family sans
649 Find
650 \begin_inset space ~
651 \end_inset
652
653 Next
654 \family default
655  button, and use the 
656 \family sans
657 Replace
658 \family default
659  button to replace a word you have  found.
660 \begin_inset Foot
661 status collapsed
662
663 \begin_layout Plain Layout
664 Close the window when you are done or leave it open if you find it more
665  convenient.
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.
669 \end_layout
670
671 \end_inset
672
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
675  the document.
676 \end_layout
677
678 \begin_layout Description
679 Character
680 \begin_inset space ~
681 \end_inset
682
683 Formatting You can 
684 \emph on
685 emphasize
686 \emph default
687  text (which will by default print characters in italics), set it in 
688 \series bold
689 bold face
690 \series default
691 , in 
692 \noun on
693 Noun Style
694 \noun default
695  (usually small caps, used for people's names), or use your own formatting
696  by using the 
697 \family sans
698 Edit\SpecialChar \menuseparator
699 Text
700 \begin_inset space ~
701 \end_inset
702
703 Style
704 \family default
705  dialog (toolbar button 
706 \begin_inset Graphics
707         filename ../images/dialog-show_character.png
708         scale 75
709
710 \end_inset
711
712 ).
713 \end_layout
714
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 
718 \family sans
719 Paste
720 \family default
721  and 
722 \family sans
723 Print
724 \family default
725 .
726 \end_layout
727
728 \begin_layout Standard
729 Of course, you have not yet written enough to make most of these functions
730  useful.
731  As you write more, though, try undoing, pasting, etc.
732 \end_layout
733
734 \begin_layout Subsection
735 WYSIWYM: Whitespace in LyX
736 \end_layout
737
738 \begin_layout Standard
739 One of the hardest things for new users to get used to is the way that LyX
740  handles whitespace.
741  As many times as you hit 
742 \family sans
743 Return
744 \family default
745 , you will only get one blank line.
746  As many times as you hit 
747 \family sans
748 Space
749 \family default
750 , you will only get one space.
751  On a blank line, LyX will not let you type even one space.
752  The 
753 \family sans
754 Tab
755 \family default
756  key will not move you forward one tab stop; in fact there 
757 \emph on
758 are
759 \emph default
760  no tab stops! There is no ruler at the top of the page to let you set tabs
761  or margins, either.
762 \end_layout
763
764 \begin_layout Standard
765 Many word processors are based on the WYSIWYG principle: 
766 \begin_inset Quotes eld
767 \end_inset
768
769 What You See Is What You Get.
770 \begin_inset Quotes erd
771 \end_inset
772
773  LyX, on the other hand, is based on the principle that 
774 \begin_inset Quotes eld
775 \end_inset
776
777 What You See Is What You 
778 \emph on
779 Mean
780 \emph default
781 .
782 \begin_inset Quotes erd
783 \end_inset
784
785  You type what you mean, and LyX will take care of typesetting it for you,
786  so that the output looks nice.
787  A 
788 \family sans
789 Return
790 \family default
791  grammatically separates paragraphs, and a 
792 \family sans
793 Space
794 \family default
795  grammatically separates words, so there is no reason to have several of
796  them in a row; a 
797 \family sans
798 Tab
799 \family default
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 
802 \emph on
803 content
804 \emph default
805  of your document, and less time worrying about the 
806 \emph on
807 format.
808
809 \emph default
810  See the 
811 \emph on
812 Introduction
813 \emph default
814  for more information on the WYSIWYM concept.
815 \end_layout
816
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 
820 \emph on
821 exactly
822 \emph default
823  what you mean.
824  The 
825 \emph on
826 User's Guide
827 \emph default
828  has information about all that.
829  It includes horizontal fills and vertical space — which are more powerful
830  and versatile than multiple spaces or blank lines — and ways to change
831  font sizes, character styles, and paragraph alignments by hand.
832  The idea, though, is that you can write your whole document, focusing on
833  content, and just worry about that fine-tuning at the end.
834  With standard word processors, you will be distracted by document formatting
835  throughout the writing process.
836 \end_layout
837
838 \begin_layout Section
839 Environments
840 \end_layout
841
842 \begin_layout Standard
843 Different parts of a document have different purposes; we call these parts
844  
845 \emph on
846 environments
847 \emph default
848 .
849  Most of a document is made up of regular text.
850  Section titles (chapter, subsection, etc.) let the reader know that a new
851  topic or subtopic will be discussed.
852  Certain types of documents have special environments.
853  A journal article will have an abstract and a title.
854  A letter will have neither of these, but will probably have an environment
855  that gives the writer's address.
856 \end_layout
857
858 \begin_layout Standard
859 Environments are a major part of the 
860 \begin_inset Quotes eld
861 \end_inset
862
863 What You See Is What You Mean
864 \begin_inset Quotes erd
865 \end_inset
866
867  philosophy of LyX.
868  A given environment may require a certain font style, font size, indenting,
869  line spacing, and more.
870  This problem is aggravated, because the exact formatting for a given environmen
871 t may change: one journal may use boldface, 18 point, centered type for
872  section titles while another uses italicized, 15 point, left justified
873  type; different languages may have different standards for indenting; and
874  bibliography formats can vary widely.
875  LyX lets you avoid learning all the different formatting styles.
876 \end_layout
877
878 \begin_layout Standard
879 The 
880 \family sans
881 Environment
882 \family default
883  choice box is located on the left end of the toolbar and looks like this:
884  
885 \begin_inset Graphics
886         filename clipart/ToolbarEnvBox.png
887         scale 75
888         clip
889
890 \end_inset
891
892 .
893  It indicates in which environment you are currently writing.
894  While you were writing your first document, it said 
895 \begin_inset Quotes eld
896 \end_inset
897
898 Standard,
899 \begin_inset Quotes erd
900 \end_inset
901
902  which is the default environment for text.
903  Now you will put a number of environments in your new document so that
904  you can see how they work.
905 \end_layout
906
907 \begin_layout Subsection
908 Sections and Subsections
909 \end_layout
910
911 \begin_layout Standard
912 Type the word 
913 \family typewriter
914 Introduction
915 \family default
916  on the first line of your LyX file, and select 
917 \family sans
918 Section
919 \family default
920  in the 
921 \family sans
922 Environment
923 \family default
924  box.
925 \begin_inset Foot
926 status collapsed
927
928 \begin_layout Plain Layout
929 You do not have to 
930 \emph on
931 select
932 \emph default
933  the line.
934  If nothing is selected, LyX changes the paragraph you are currently in
935  to the selected environment.
936  Alternatively, you can change several paragraphs to a different environment
937  by selecting them before picking an environment.
938 \end_layout
939
940 \end_inset
941
942  Be sure to use 
943 \family sans
944 Section
945 \family default
946  and 
947 \emph on
948 not
949 \emph default
950  
951 \family sans
952 Section*
953 \family default
954 , which will be covered below.
955  LyX numbers the section 
956 \begin_inset Quotes eld
957 \end_inset
958
959 1
960 \begin_inset Quotes erd
961 \end_inset
962
963  and typesets the section heading (title) in a larger font.
964  Now hit 
965 \family sans
966 Return
967 \family default
968 \SpecialChar \@.
969  Note that the 
970 \family sans
971 Environment
972 \family default
973  box changes from 
974 \begin_inset Quotes eld
975 \end_inset
976
977 Section
978 \begin_inset Quotes erd
979 \end_inset
980
981  back to 
982 \begin_inset Quotes eld
983 \end_inset
984
985 Standard
986 \begin_inset Quotes erd
987 \end_inset
988
989 .
990  Section headings, like most environments, are assumed to end when you type
991  
992 \family sans
993 Return
994 \family default
995 \SpecialChar \@.
996  Type the document introduction: 
997 \end_layout
998
999 \begin_layout LyX-Code
1000 This is an introduction to my first LyX document.
1001 \end_layout
1002
1003 \begin_layout Standard
1004 Hit 
1005 \family sans
1006 Return
1007 \family default
1008  again, and select 
1009 \family sans
1010 Section
1011 \family default
1012  from the 
1013 \family sans
1014 Environment
1015 \family default
1016  box again.
1017  LyX writes a 
1018 \begin_inset Quotes eld
1019 \end_inset
1020
1021 2
1022 \begin_inset Quotes erd
1023 \end_inset
1024
1025  and waits for you to type a title.
1026  Type 
1027 \begin_inset Quotes eld
1028 \end_inset
1029
1030
1031 \family typewriter
1032 More
1033 \begin_inset space ~
1034 \end_inset
1035
1036 Stuff
1037 \family default
1038
1039 \begin_inset Quotes erd
1040 \end_inset
1041
1042 , and you will see that LyX again sets it as a section title.
1043 \end_layout
1044
1045 \begin_layout Standard
1046 It gets better.
1047  Go to the end of Section
1048 \begin_inset space ~
1049 \end_inset
1050
1051 1 again (after 
1052 \begin_inset Quotes eld
1053 \end_inset
1054
1055 my first LyX document
1056 \begin_inset Quotes erd
1057 \end_inset
1058
1059 ) and hit 
1060 \family sans
1061 Return
1062 \family default
1063  again, and select 
1064 \family sans
1065 Section
1066 \family default
1067  from the 
1068 \family sans
1069 Environment
1070 \family default
1071  box again.
1072  Again, LyX writes 
1073 \begin_inset Quotes eld
1074 \end_inset
1075
1076 2
1077 \begin_inset Quotes erd
1078 \end_inset
1079
1080  and waits for you to type a title.
1081  Type 
1082 \family typewriter
1083 About This Document
1084 \family default
1085 .
1086  Section
1087 \begin_inset space ~
1088 \end_inset
1089
1090
1091 \begin_inset Quotes eld
1092 \end_inset
1093
1094 More Stuff
1095 \begin_inset Quotes erd
1096 \end_inset
1097
1098 , which was Section
1099 \begin_inset space ~
1100 \end_inset
1101
1102 2, has been automatically renumbered to Section
1103 \begin_inset space ~
1104 \end_inset
1105
1106 3! In true WYSIWYM fashion, you just need to identify the text that makes
1107  up the section titles, and LyX takes care of numbering the sections and
1108  typesetting them.
1109 \end_layout
1110
1111 \begin_layout Standard
1112 Hit 
1113 \family sans
1114 Return
1115 \family default
1116  to get back to the 
1117 \family sans
1118 Standard
1119 \family default
1120  environment, and type the following five lines:
1121 \end_layout
1122
1123 \begin_layout LyX-Code
1124 Sections and subsections are described below.
1125 \end_layout
1126
1127 \begin_layout LyX-Code
1128 Section Description
1129 \end_layout
1130
1131 \begin_layout LyX-Code
1132 Sections are bigger than subsections.
1133 \end_layout
1134
1135 \begin_layout LyX-Code
1136 Subsection description
1137 \end_layout
1138
1139 \begin_layout LyX-Code
1140 Subsections are smaller than sections.
1141 \end_layout
1142
1143 \begin_layout Standard
1144 Click on the second line and select 
1145 \family sans
1146 Subsection
1147 \family default
1148  from the 
1149 \family sans
1150 Environment
1151 \family default
1152  box.
1153  LyX numbers the subsection 
1154 \begin_inset Quotes eld
1155 \end_inset
1156
1157 2.1
1158 \begin_inset Quotes erd
1159 \end_inset
1160
1161 , and typesets it in a font which is bigger than regular text but smaller
1162  than the section title.
1163  Change the fourth line 
1164 \family sans
1165 Subsection
1166 \family default
1167  environment as well.
1168  As you probably expected, LyX automatically numbered the section 
1169 \begin_inset Quotes eld
1170 \end_inset
1171
1172 2.2
1173 \begin_inset Quotes erd
1174 \end_inset
1175
1176 .
1177  If you put yet another section before Section
1178 \begin_inset space ~
1179 \end_inset
1180
1181 2, Section
1182 \begin_inset space ~
1183 \end_inset
1184
1185 2 will be renumbered as Section 3, and the subsections will be renumbered
1186  to 
1187 \begin_inset Quotes eld
1188 \end_inset
1189
1190 3.1
1191 \begin_inset Quotes erd
1192 \end_inset
1193
1194  and 
1195 \begin_inset Quotes eld
1196 \end_inset
1197
1198 3.2
1199 \begin_inset Quotes erd
1200 \end_inset
1201
1202 .
1203  
1204 \end_layout
1205
1206 \begin_layout Standard
1207 Further levels of sectioning include 
1208 \family sans
1209 Subsubsection
1210 \family default
1211
1212 \family sans
1213 Paragraph
1214 \family default
1215 , and 
1216 \family sans
1217 Subparagraph
1218 \family default
1219 .
1220  We will let you play with these on your own.
1221  You may notice that paragraph and subparagraph headings are not numbered
1222  by default, and that subparagraphs are indented; see the 
1223 \emph on
1224 User's Guide
1225 \emph default
1226  for an explanation and how to change this.
1227  
1228 \family sans
1229 Chapter
1230 \family default
1231  headings are actually the highest level of sectioning, above 
1232 \family sans
1233 Section
1234 \family default
1235 s, but you are only allowed to use them in certain types (text classes)
1236  of LyX documents (see Section
1237 \begin_inset space ~
1238 \end_inset
1239
1240
1241 \begin_inset CommandInset ref
1242 LatexCommand ref
1243 reference "sec:Document-Classes"
1244
1245 \end_inset
1246
1247 ).
1248  
1249 \end_layout
1250
1251 \begin_layout Standard
1252 Finally, you may want to have sections or subsections that are not numbered.
1253  There are environments for this as well.
1254  If you change one of your section headings to the 
1255 \family sans
1256 Section*
1257 \family default
1258  environment (you may have to scroll down in the 
1259 \family sans
1260 Environment
1261 \family default
1262  box to find it), LyX will use the same font size for the heading as it
1263  uses for a regular section, but it will not number that section.
1264  There are corresponding 
1265 \begin_inset Quotes eld
1266 \end_inset
1267
1268 starred
1269 \begin_inset Quotes erd
1270 \end_inset
1271
1272  heading environments for 
1273 \family sans
1274 Subsection
1275 \family default
1276  and 
1277 \family sans
1278 Subsubsection
1279 \family default
1280 .
1281  Try changing some of your sections or subsections to the starred environments,
1282  and note how the other section numbers are updated.
1283 \end_layout
1284
1285 \begin_layout Standard
1286
1287 \series bold
1288 Exercise
1289 \series default
1290 : Fix the section and subsection headings in 
1291 \family typewriter
1292 example_raw.lyx
1293 \family default
1294 .
1295  
1296 \end_layout
1297
1298 \begin_layout Subsection
1299 Lists and sublists
1300 \end_layout
1301
1302 \begin_layout Standard
1303 LyX has several different environments for typesetting lists.
1304  The various list environments free you from hitting 
1305 \family sans
1306 Tab
1307 \family default
1308  a million times when writing an outline, or from renumbering a whole list
1309  when you want to add a point in the middle of the list.
1310  Different types of documents logically require different list environments:
1311 \end_layout
1312
1313 \begin_layout Itemize
1314 A slide presentation might use the 
1315 \family sans
1316 Itemize
1317 \family default
1318  environment's bulleted lists to describe different points.
1319  
1320 \end_layout
1321
1322 \begin_layout Itemize
1323 An outline would use the 
1324 \family sans
1325 Enumerate
1326 \family default
1327  environment's numbered lists (and lettered sublists).
1328  
1329 \end_layout
1330
1331 \begin_layout Itemize
1332 A document describing several software packages could use the 
1333 \family sans
1334 Description
1335 \family default
1336  environment, where each item in the list begins with a bold-faced word.
1337  
1338 \end_layout
1339
1340 \begin_layout Itemize
1341 The 
1342 \family sans
1343 List
1344 \family default
1345  environment is a variation on the 
1346 \family sans
1347 Description
1348 \family default
1349  environment.
1350 \end_layout
1351
1352 \begin_layout Standard
1353 Let us write a list of reasons why LyX is better than other word processors.
1354  Somewhere in your document, type:
1355 \end_layout
1356
1357 \begin_layout Standard
1358
1359 \family typewriter
1360 LyX is better than other word processors because: 
1361 \end_layout
1362
1363 \begin_layout Standard
1364 and hit 
1365 \family sans
1366 Return
1367 \family default
1368 .
1369  Now select 
1370 \family sans
1371 Itemize
1372 \family default
1373  from the 
1374 \family sans
1375 Environment
1376 \family default
1377  box.
1378  LyX writes a 
1379 \begin_inset Quotes eld
1380 \end_inset
1381
1382 bullet
1383 \begin_inset Quotes erd
1384 \end_inset
1385
1386  on the line.
1387  Type in your reasons: 
1388 \end_layout
1389
1390 \begin_layout LyX-Code
1391 Typesetting is done for you.
1392 \end_layout
1393
1394 \begin_layout LyX-Code
1395 Math is WYSIWYG
1396 \end_layout
1397
1398 \begin_layout LyX-Code
1399 Lists are very easy to create!
1400 \end_layout
1401
1402 \begin_layout Standard
1403 List environments, unlike headings, do not end when you type 
1404 \family sans
1405 Return
1406 \family default
1407 .
1408  Instead, LyX assumes you are going on to the next item in the list.
1409  The above will therefore result in a three-item list.
1410  If you want more than one paragraph within one list 
1411 \emph on
1412 item
1413 \emph default
1414 , one way is to use the 
1415 \family sans
1416 Protected
1417 \begin_inset space ~
1418 \end_inset
1419
1420 Break
1421 \family default
1422 , which you get by typing 
1423 \family sans
1424 Ctrl+Return
1425 \family default
1426 .
1427  In order to get out of the list, you need to reselect the 
1428 \family sans
1429 Standard
1430 \family default
1431  environment (or just use the key binding, 
1432 \family sans
1433 Alt+P
1434 \begin_inset space ~
1435 \end_inset
1436
1437 S
1438 \family default
1439 ).
1440 \end_layout
1441
1442 \begin_layout Standard
1443 You have got a beautiful itemized list.
1444  You might want to run LaTeX to see how the list looks when printed out.
1445  But what if you wanted to number the reasons? Well, just select the whole
1446  list
1447 \begin_inset Foot
1448 status collapsed
1449
1450 \begin_layout Plain Layout
1451 LyX will not let you select the first bullet unless you also select the
1452  paragraph 
1453 \emph on
1454 before
1455 \emph default
1456  the list, which you probably do not want to do.
1457  Similarly, you cannot select the actual number in a numbered section title.
1458  This is on purpose because the bullet or number depends on the document
1459  settings or text position, respectively.
1460 \end_layout
1461
1462 \end_inset
1463
1464  and choose 
1465 \family sans
1466 Enumerate
1467 \family default
1468  from the 
1469 \family sans
1470 Environment
1471 \family default
1472  box.
1473  Pow! As we mentioned, if you add or delete a list item, LyX will fix the
1474  numbering.
1475 \end_layout
1476
1477 \begin_layout Standard
1478 While the list is still selected, you can change to the other two list environme
1479 nts, 
1480 \family sans
1481 Description
1482 \family default
1483  and 
1484 \family sans
1485 List
1486 \family default
1487 , in order to see what they look like.
1488  For those two environments, each list item is made up of a term, which
1489  is the item's first word, followed by a definition, which is the rest of
1490  the paragraph (until you hit 
1491 \family sans
1492 Return
1493 \family default
1494 .) The term is either typeset in boldface (
1495 \family sans
1496 Description
1497 \family default
1498 ) or separated by a 
1499 \begin_inset Quotes eld
1500 \end_inset
1501
1502 Tab
1503 \begin_inset Quotes erd
1504 \end_inset
1505
1506
1507 \begin_inset Foot
1508 status collapsed
1509
1510 \begin_layout Plain Layout
1511 But a typesetter's tab, which will change to fit the size of the largest
1512  term, not a pathetic, rigid, unchangeable typewriter 
1513 \family sans
1514 Tab
1515 \family default
1516 .
1517 \end_layout
1518
1519 \end_inset
1520
1521  (
1522 \family sans
1523 List
1524 \family default
1525 ) from the rest of the paragraph.
1526  If you want to have more than one word in the definition, then separate
1527  the words with 
1528 \family sans
1529 Protected
1530 \begin_inset space ~
1531 \end_inset
1532
1533 Space
1534 \family default
1535 s.
1536 \end_layout
1537
1538 \begin_layout Standard
1539
1540 \series bold
1541 Exercise
1542 \series default
1543 : Typeset the list in 
1544 \family typewriter
1545 example_raw.lyx
1546 \end_layout
1547
1548 \begin_layout Standard
1549 You can nest lists within each other in all sorts of interesting ways.
1550  An obvious example would be writing outlines.
1551  Numbered and bulleted lists will have different numbering and bulleting
1552  schemes for sublists.
1553  See the 
1554 \emph on
1555 User's Guide
1556 \emph default
1557  for details on the different sorts of lists and for examples of nestings.
1558 \end_layout
1559
1560 \begin_layout Subsection
1561 Other environments: Verses, Quotations, and more
1562 \end_layout
1563
1564 \begin_layout Standard
1565 There are two environments for setting quotations apart from surrounding
1566  text: 
1567 \family sans
1568 Quote
1569 \family default
1570  for short quotes and 
1571 \family sans
1572 Quotation
1573 \family default
1574  for longer ones.
1575  Computer code (the 
1576 \family sans
1577 LyX-Code
1578 \family default
1579  environment 
1580 \begin_inset Foot
1581 status collapsed
1582
1583 \begin_layout Plain Layout
1584 used in this Tutorial for the long typing examples
1585 \end_layout
1586
1587 \end_inset
1588
1589 ) is written in a 
1590 \family typewriter
1591 typewriter
1592 \family default
1593  font; this environment is the only place in LyX where you are allowed to
1594  use multiple spaces to allow code indenting.
1595  You can even write poetry using the 
1596 \family sans
1597 Verse
1598 \family default
1599  style, using 
1600 \family sans
1601 Return
1602 \family default
1603  to separate stanzas, and 
1604 \family sans
1605 Ctrl+Return
1606 \family default
1607  to separate lines within a stanza.
1608  See the 
1609 \emph on
1610 User's Guide
1611 \emph default
1612  for more complete descriptions of all of the available LyX environments.
1613 \end_layout
1614
1615 \begin_layout Standard
1616
1617 \series bold
1618 Exercise
1619 \series default
1620 : Correctly typeset the 
1621 \family sans
1622 Quote, LyX-Code,
1623 \family default
1624  and 
1625 \family sans
1626 Verse
1627 \family default
1628  in
1629 \begin_inset Newline newline
1630 \end_inset
1631
1632
1633 \family typewriter
1634 example_raw.lyx
1635 \end_layout
1636
1637 \begin_layout Chapter
1638 Writing Documents
1639 \end_layout
1640
1641 \begin_layout Standard
1642 The previous chapter hopefully allowed you to get used to writing in LyX.
1643  It introduced you to the basic editing operations in LyX, as well as the
1644  powerful method of writing with environments.
1645  Most people who use LyX, though, will want to write documents: papers,
1646  articles, books, manuals, or letters.
1647  This chapter is meant to take you from simply writing text with LyX to
1648  writing a complete document.
1649  It will introduce you to text classes, which allow you to write different
1650  sorts of documents.
1651  It will then describe many of the additions that turn text into a document,
1652  such as titles, footnotes, cross references, bibliographies, and tables
1653  of contents.
1654 \end_layout
1655
1656 \begin_layout Section
1657 Document Classes
1658 \begin_inset CommandInset label
1659 LatexCommand label
1660 name "sec:Document-Classes"
1661
1662 \end_inset
1663
1664
1665 \end_layout
1666
1667 \begin_layout Standard
1668 Different sorts of documents should be typeset differently.
1669  For example, books are generally printed double-sided, while articles are
1670  single-sided.
1671  In addition, many documents contain special environments: letters contain
1672  some environments — such as the sender's address and the signature — which
1673  do not make sense in a book or article.
1674  The LyX 
1675 \emph on
1676 document class
1677 \emph default
1678
1679 \begin_inset Foot
1680 status collapsed
1681
1682 \begin_layout Plain Layout
1683 for LaTeX users: this is equivalent to the LaTeX document class
1684 \end_layout
1685
1686 \end_inset
1687
1688  takes care of these large scale differences between different sorts of
1689  documents.
1690  This Tutorial, for example, was written in the 
1691 \family sans
1692 Book
1693 \family default
1694  document class.
1695  Document classes are another major part of the WYSIWYM philosophy; they
1696  tell LyX how to typeset the document, so you do not need to know how.
1697 \end_layout
1698
1699 \begin_layout Standard
1700 Your document is probably being written in the 
1701 \family sans
1702 Article
1703 \family default
1704  document class.
1705 \begin_inset Foot
1706 status collapsed
1707
1708 \begin_layout Plain Layout
1709 That is usually the default document class
1710 \end_layout
1711
1712 \end_inset
1713
1714  Try changing to other document classes (using the 
1715 \family sans
1716 Document\SpecialChar \menuseparator
1717 Settings
1718 \family default
1719  dialog) to see how they are typeset differently.
1720  If you change your document to the 
1721 \family sans
1722 Book
1723 \family default
1724  document class and look at the 
1725 \family sans
1726 Environment
1727 \family default
1728  box, you will see that most of the allowed environments are the same.
1729  However, you can now use the 
1730 \family sans
1731 Chapter
1732 \family default
1733  environment.
1734  If you are ever unsure about which environments you can use in a given
1735  document class, just consult the 
1736 \family sans
1737 Environment
1738 \family default
1739  box.
1740 \end_layout
1741
1742 \begin_layout Standard
1743 Font sizes, one- or two-column printing, and page headings are just some
1744  of the ways journals typesettings differ from one another.
1745  As the Computer Age continues to mature, journals have begun accepting
1746  electronic submissions, creating LaTeX 
1747 \begin_inset Quotes eld
1748 \end_inset
1749
1750 style files
1751 \begin_inset Quotes erd
1752 \end_inset
1753
1754  so that authors can submit correctly typeset articles.
1755  LyX is set up to support this as well.
1756  For example, LyX supports typesetting (and extra environments) for the
1757  American Mathematics Society journals using the 
1758 \family sans
1759 Article
1760 \begin_inset space ~
1761 \end_inset
1762
1763 (AMS)
1764 \family default
1765  document class.
1766 \end_layout
1767
1768 \begin_layout Standard
1769 Here is a very quick reference to some of the document classes.
1770  See the 
1771 \emph on
1772 Special Document Classes
1773 \emph default
1774  section of the 
1775 \emph on
1776 Additional Features
1777 \emph default
1778  manual for many more details.
1779 \end_layout
1780
1781 \begin_layout Standard
1782 \align center
1783 \begin_inset Tabular
1784 <lyxtabular version="3" rows="7" columns="2">
1785 <features>
1786 <column alignment="center" valignment="top" width="0pt">
1787 <column alignment="center" valignment="top" width="0pt">
1788 <row>
1789 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1790 \begin_inset Text
1791
1792 \begin_layout Plain Layout
1793 Name
1794 \end_layout
1795
1796 \end_inset
1797 </cell>
1798 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1799 \begin_inset Text
1800
1801 \begin_layout Plain Layout
1802 Notes
1803 \end_layout
1804
1805 \end_inset
1806 </cell>
1807 </row>
1808 <row>
1809 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1810 \begin_inset Text
1811
1812 \begin_layout Plain Layout
1813 article
1814 \end_layout
1815
1816 \end_inset
1817 </cell>
1818 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1819 \begin_inset Text
1820
1821 \begin_layout Plain Layout
1822 one-sided, no chapters
1823 \end_layout
1824
1825 \end_inset
1826 </cell>
1827 </row>
1828 <row>
1829 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1830 \begin_inset Text
1831
1832 \begin_layout Plain Layout
1833 article (AMS)
1834 \end_layout
1835
1836 \end_inset
1837 </cell>
1838 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1839 \begin_inset Text
1840
1841 \begin_layout Plain Layout
1842 layout & environments for American Math Society
1843 \end_layout
1844
1845 \end_inset
1846 </cell>
1847 </row>
1848 <row>
1849 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
1850 \begin_inset Text
1851
1852 \begin_layout Plain Layout
1853 report
1854 \end_layout
1855
1856 \end_inset
1857 </cell>
1858 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
1859 \begin_inset Text
1860
1861 \begin_layout Plain Layout
1862 longer than article, two-sided
1863 \end_layout
1864
1865 \end_inset
1866 </cell>
1867 </row>
1868 <row>
1869 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
1870 \begin_inset Text
1871
1872 \begin_layout Plain Layout
1873 book
1874 \end_layout
1875
1876 \end_inset
1877 </cell>
1878 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
1879 \begin_inset Text
1880
1881 \begin_layout Plain Layout
1882 report + front and back matter
1883 \end_layout
1884
1885 \end_inset
1886 </cell>
1887 </row>
1888 <row>
1889 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1890 \begin_inset Text
1891
1892 \begin_layout Plain Layout
1893 presentation
1894 \end_layout
1895
1896 \end_inset
1897 </cell>
1898 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1899 \begin_inset Text
1900
1901 \begin_layout Plain Layout
1902 transparencies
1903 \end_layout
1904
1905 \end_inset
1906 </cell>
1907 </row>
1908 <row>
1909 <cell alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
1910 \begin_inset Text
1911
1912 \begin_layout Plain Layout
1913 letter
1914 \end_layout
1915
1916 \end_inset
1917 </cell>
1918 <cell alignment="center" valignment="top" bottomline="true" leftline="true" rightline="true" usebox="none">
1919 \begin_inset Text
1920
1921 \begin_layout Plain Layout
1922 lots of extra environments for address, signature\SpecialChar \ldots{}
1923
1924 \end_layout
1925
1926 \end_inset
1927 </cell>
1928 </row>
1929 </lyxtabular>
1930
1931 \end_inset
1932
1933
1934 \end_layout
1935
1936 \begin_layout Section
1937 Templates: Writing a Letter
1938 \end_layout
1939
1940 \begin_layout Standard
1941 One way to write a letter would be to open a new file, and choose a 
1942 \family sans
1943 Letter
1944 \family default
1945  class in the 
1946 \family sans
1947 Document\SpecialChar \menuseparator
1948 Settings
1949 \family default
1950  dialog.
1951  While this is the most obvious way to write a letter, it seems like extra
1952  work.
1953  Every time you write a business letter, you want to have your address,
1954  the address to which you are sending it, a body, a signature, etc.
1955  LyX therefore has a 
1956 \emph on
1957 template
1958 \emph default
1959  for letters, which contains a sample letter; once you have a template,
1960  you can just replace a couple of parts of the letter with your text each
1961  time you write a letter.
1962 \end_layout
1963
1964 \begin_layout Standard
1965 Open a new file with 
1966 \family sans
1967 File\SpecialChar \menuseparator
1968 New
1969 \begin_inset space ~
1970 \end_inset
1971
1972 from
1973 \begin_inset space ~
1974 \end_inset
1975
1976 Template
1977 \family default
1978 .
1979  Select 
1980 \family typewriter
1981 letter.lyx
1982 \family default
1983  as the template.
1984  Save and print the file to see how the various environments are typeset.
1985 \end_layout
1986
1987 \begin_layout Standard
1988 When you look at the 
1989 \family sans
1990 Environment
1991 \family default
1992  box, you will see several environments, like the 
1993 \family sans
1994 My
1995 \begin_inset space ~
1996 \end_inset
1997
1998 Address
1999 \family default
2000  environment, which do not even exist in most other document classes.
2001  Others, like 
2002 \family sans
2003 Quote
2004 \family default
2005  and 
2006 \family sans
2007 Description
2008 \family default
2009 , are familiar.
2010  You can play around for a while to figure out how the various environments
2011  work.
2012  You will notice for example that the 
2013 \family sans
2014 Signature
2015 \family default
2016  environment has the word 
2017 \begin_inset Quotes eld
2018 \end_inset
2019
2020 Signature:
2021 \begin_inset Quotes eld
2022 \end_inset
2023
2024  in red before the actual text of the signature.
2025  This word does not show up in the actual letter, as you will see if you
2026  view/export the file.
2027  It is just there to let you know where the signature goes.
2028  Also, note that it does not matter where in the file the 
2029 \family sans
2030 Signature
2031 \family default
2032  line is placed.
2033  Remember, LyX is WYSIWYM; you can put the 
2034 \family sans
2035 Signature
2036 \family default
2037  environment anywhere you want, but LyX knows that in the printout, the
2038  signature should be at the end.
2039 \end_layout
2040
2041 \begin_layout Standard
2042 A template is just a regular LyX file.
2043  This means you can fill in your address and signature and save the file
2044  as a new template.
2045  From now on, any time you want to write a letter, you can use the new template
2046  to save time.
2047  We do not have to suggest an actual 
2048 \begin_inset Quotes eld
2049 \end_inset
2050
2051 exercise
2052 \begin_inset Quotes erd
2053 \end_inset
2054
2055  here; just write a letter to someone!
2056 \begin_inset Foot
2057 status collapsed
2058
2059 \begin_layout Plain Layout
2060 One warning, if you are writing from a template.
2061  If you erase all of the text in an environment — for example, if you erase
2062  the whole 
2063 \family sans
2064 My
2065 \begin_inset space ~
2066 \end_inset
2067
2068 Address
2069 \family default
2070  field so that you can replace it with your own — and then you move the
2071  cursor without writing any text, the environment may disappear.
2072  This is because most environments cannot exist without any text in them.
2073  Just reselect the environment from the 
2074 \family sans
2075 Environment
2076 \family default
2077  box to get it back.
2078 \end_layout
2079
2080 \end_inset
2081
2082
2083 \end_layout
2084
2085 \begin_layout Standard
2086 Templates can be a huge time-saver, and we urge you to use them whenever
2087  possible.
2088  In addition, they can help a person learn how to use some of the fancier
2089  document classes.
2090  Finally, they may be useful for a person who is configuring LyX for a bunch
2091  of less computer-aware users.
2092  When they are first learning LyX, it will be much less intimidating if
2093  they have a letter template customized for their company, for example.
2094 \end_layout
2095
2096 \begin_layout Section
2097 Document Titles
2098 \end_layout
2099
2100 \begin_layout Standard
2101 LyX (like LaTeX) considers the title — which may contain the actual title,
2102  the author, the date, and even an abstract of a paper — to be a separate
2103  part of the document.
2104 \end_layout
2105
2106 \begin_layout Standard
2107 Go back to your LyX document and make sure it is using the 
2108 \family sans
2109 Article
2110 \family default
2111  document class.
2112 \begin_inset Foot
2113 status collapsed
2114
2115 \begin_layout Plain Layout
2116 You should not be using the letter any more, since the 
2117 \family sans
2118 Letter
2119 \family default
2120  document class does not allow titles.
2121 \end_layout
2122
2123 \end_inset
2124
2125  Type a title on the first line, and change the line to the 
2126 \family sans
2127 Title
2128 \family default
2129  environment.
2130  On the next line, type your name and change it to the 
2131 \family sans
2132 Author
2133 \family default
2134  environment.
2135  On the next line, write the date in the 
2136 \family sans
2137 Date
2138 \family default
2139  environment.
2140  Type a paragraph or two summarizing your document using the 
2141 \family sans
2142 Abstract
2143 \family default
2144  environment.
2145  Notice how the title is presented when it is printed out.
2146  If you change the document format to Book, you will get a separate title
2147  page, like the first page of this tutorial.
2148 \end_layout
2149
2150 \begin_layout Standard
2151
2152 \series bold
2153 Exercise
2154 \series default
2155 : Fix the title, date, and author in 
2156 \family typewriter
2157 example_raw.lyx
2158 \end_layout
2159
2160 \begin_layout Section
2161 Labels and Cross-References
2162 \end_layout
2163
2164 \begin_layout Standard
2165 You can label section headings, list items, formulas, footnotes, and floats
2166 \begin_inset Foot
2167 status collapsed
2168
2169 \begin_layout Plain Layout
2170 Floats are explained in the 
2171 \emph on
2172 User's Guide
2173 \emph default
2174  and the 
2175 \emph on
2176 Embedded Objects
2177 \emph default
2178  manual.
2179 \end_layout
2180
2181 \end_inset
2182
2183  in your document.
2184  Once you do so, you can refer to this section in other parts of the document,
2185  using cross-references.
2186  You can refer either to the section's number, or to the page that the section
2187  appears on.
2188  As with section numbering, LyX also takes care about cross-reference numbering
2189  for you.
2190  Automatic labels and cross-references are among the most significant advantages
2191  of LyX (and LaTeX) over conventional word processors.
2192  
2193 \end_layout
2194
2195 \begin_layout Subsection
2196 Your first label
2197 \end_layout
2198
2199 \begin_layout Standard
2200 Go to our second section, whose title is 
2201 \begin_inset Quotes eld
2202 \end_inset
2203
2204 About This Document
2205 \begin_inset Quotes erd
2206 \end_inset
2207
2208 .
2209  Click at the end of the section title line, and select 
2210 \family sans
2211 Insert\SpecialChar \menuseparator
2212 Label
2213 \family default
2214  or the toolbar button 
2215 \begin_inset Graphics
2216         filename ../images/label-insert.png
2217         scale 75
2218         scaleBeforeRotation
2219
2220 \end_inset
2221
2222 .
2223  A dialog asks you for a label name, and gives you a suggestion.
2224  When you click on 
2225 \family sans
2226 OK
2227 \family default
2228 , the label name will be placed in a box next to the section title.
2229 \end_layout
2230
2231 \begin_layout Standard
2232 So far you have not done anything — the DVI output will look exactly the
2233  same, since labels do not show up in the printed document.
2234  However, now that you have added a label, you can refer to that label with
2235  cross-references.
2236  We will do that next.
2237 \end_layout
2238
2239 \begin_layout Subsection
2240 Your first cross-reference
2241 \end_layout
2242
2243 \begin_layout Standard
2244 Place the cursor somewhere in section
2245 \begin_inset space ~
2246 \end_inset
2247
2248 2 of your document.
2249  Type 
2250 \end_layout
2251
2252 \begin_layout LyX-Code
2253 If you want to know more about this document, then see 
2254 \begin_inset Newline newline
2255 \end_inset
2256
2257 section, which can be found on page.
2258 \end_layout
2259
2260 \begin_layout Standard
2261 Now — with the cursor after the word `Section' — choose 
2262 \family sans
2263 Insert\SpecialChar \menuseparator
2264 Cross
2265 \begin_inset space ~
2266 \end_inset
2267
2268 Reference
2269 \family default
2270  or the toolbar button 
2271 \begin_inset Graphics
2272         filename ../images/dialog-show-new-inset_ref.png
2273         scale 75
2274         scaleBeforeRotation
2275
2276 \end_inset
2277
2278 .
2279  The Cross-reference dialog pops up.
2280  It shows a list of the possible labels you can reference.
2281  At the moment, there should be only one, `sec:About-This-Document'.
2282  First, select the drop-down menu labeled Format and select '<reference>
2283  on page <page>.' Then select `sec:About-This-Document' (it may be selected
2284  by default), and a reference marker will appear containing `Ref+Text: sec:About
2285 -This-Document' (To be really correct, you should put a 
2286 \family sans
2287 Protected
2288 \begin_inset space ~
2289 \end_inset
2290
2291 Space
2292 \family default
2293  in between the word `Section' and the reference).
2294  Alternatively to that method, you can right-click on a label and use in
2295  the appearing context menu 
2296 \family sans
2297 Copy as Reference
2298 \family default
2299 .
2300  The cross-reference to this label is now in the clipboard and can be copied
2301  to the actual cursor position via the menu 
2302 \family sans
2303 Edit\SpecialChar \menuseparator
2304 Paste
2305 \family default
2306  (shortcut 
2307 \family sans
2308 Ctrl+V
2309 \family default
2310 ).
2311  In the printed document, this reference marker will be replaced with the
2312  section number and then the page number.
2313  View your document as DVI, and you will see that LaTeX has been even cleverer
2314  than that.
2315  It refers to `Section 2' and depending how much text you have between the
2316  start of Section 2 and this cross-reference you may see `on this page,'
2317  'on the previous page' or `on page n' (whereas 
2318 \emph on
2319 n
2320 \emph default
2321  is the page number).
2322 \end_layout
2323
2324 \begin_layout Standard
2325 Conveniently, a cross-reference acts as a hyperlink when you are editing
2326  a document in LyX; clicking on it will pop up the 
2327 \family sans
2328 Cross-reference
2329 \family default
2330  dialog, clicking 
2331 \family sans
2332 Go
2333 \begin_inset space ~
2334 \end_inset
2335
2336 to
2337 \begin_inset space ~
2338 \end_inset
2339
2340 Label
2341 \family default
2342  will move the cursor to the referenced label.
2343 \end_layout
2344
2345 \begin_layout Subsection
2346 More fun with labels
2347 \end_layout
2348
2349 \begin_layout Standard
2350 We told you that LyX takes care about numbering cross-references; now you
2351  can test that.
2352  Add a new section before Section
2353 \begin_inset space ~
2354 \end_inset
2355
2356 2.
2357  Update the DVI view, and — voilà! — the section cross reference changed
2358  to 
2359 \begin_inset Quotes eld
2360 \end_inset
2361
2362 3
2363 \begin_inset Quotes erd
2364 \end_inset
2365
2366 ! Change the section 
2367 \begin_inset Quotes eld
2368 \end_inset
2369
2370 About this Document
2371 \begin_inset Quotes erd
2372 \end_inset
2373
2374  to a subsection, and the cross-reference will reference Subsection
2375 \begin_inset space ~
2376 \end_inset
2377
2378 2.1 instead of Section
2379 \begin_inset space ~
2380 \end_inset
2381
2382 3.
2383  The page reference will not change unless you add a whole page of text
2384  before the label, of course.
2385  
2386 \end_layout
2387
2388 \begin_layout Standard
2389 If you want some more practice with labels, then try putting a new label
2390  where your first cross-reference was, and refer to that label from elsewhere
2391  in the document.
2392  If you will be inserting cross-references often, it may be convenient to
2393  leave the 
2394 \family sans
2395 Cross-reference
2396 \family default
2397  dialog open.
2398 \end_layout
2399
2400 \begin_layout Standard
2401 If you want to make sure that the cross-referencing gets the pages right
2402  even for larger documents, 
2403 \family sans
2404 Copy
2405 \family default
2406  a couple pages of text from the 
2407 \emph on
2408 User's Guide
2409 \emph default
2410  to the clipboard, and 
2411 \family sans
2412 Paste
2413 \family default
2414  the stolen text into your document.
2415 \begin_inset Foot
2416 status collapsed
2417
2418 \begin_layout Plain Layout
2419 By the way, copying a chapter title may cause an error, because chapters
2420  are not allowed in the article class, see section
2421 \begin_inset space ~
2422 \end_inset
2423
2424
2425 \begin_inset CommandInset ref
2426 LatexCommand ref
2427 reference "sec:Document-Classes"
2428
2429 \end_inset
2430
2431 .
2432  If this happens, just delete the chapter title.
2433 \end_layout
2434
2435 \end_inset
2436
2437
2438 \end_layout
2439
2440 \begin_layout Standard
2441
2442 \series bold
2443 Exercise
2444 \series default
2445 : Fix the references in 
2446 \family typewriter
2447 example_raw.lyx
2448 \end_layout
2449
2450 \begin_layout Section
2451 Footnotes and Margin Notes
2452 \end_layout
2453
2454 \begin_layout Standard
2455 Footnotes can be added using the toolbar button 
2456 \begin_inset Graphics
2457         filename ../images/footnote-insert.png
2458         scale 75
2459         scaleBeforeRotation
2460
2461 \end_inset
2462
2463  or the menu 
2464 \family sans
2465 Insert\SpecialChar \menuseparator
2466 Footnote
2467 \family default
2468 .
2469  Click at the end of the word 
2470 \begin_inset Quotes eld
2471 \end_inset
2472
2473 LyX
2474 \begin_inset Quotes erd
2475 \end_inset
2476
2477  somewhere in your document and click the 
2478 \begin_inset Graphics
2479         filename ../images/footnote-insert.png
2480         scale 75
2481         scaleBeforeRotation
2482
2483 \end_inset
2484
2485  button.
2486  A footnote box appears where you can enter the text of the footnote.
2487  LyX should place the cursor at the beginning of the footnote box.
2488  Type
2489 \end_layout
2490
2491 \begin_layout LyX-Code
2492 LyX is a typesetting word processor.
2493 \end_layout
2494
2495 \begin_layout Standard
2496 Now click on the button labeled 
2497 \begin_inset Quotes eld
2498 \end_inset
2499
2500 foot
2501 \begin_inset Quotes erd
2502 \end_inset
2503
2504 .
2505  The footnote box is closed, leaving the button showing where the footnote
2506  marker will be in the printed text; this is called 
2507 \begin_inset Quotes eld
2508 \end_inset
2509
2510 folding
2511 \begin_inset Quotes erd
2512 \end_inset
2513
2514  the footnote.
2515  You can unfold the footnote at any time and re-edit its text by clicking
2516  again on the 
2517 \begin_inset Quotes eld
2518 \end_inset
2519
2520 foot
2521 \begin_inset Quotes erd
2522 \end_inset
2523
2524  button.
2525 \end_layout
2526
2527 \begin_layout Standard
2528 A footnote can be cut and pasted like normal text.
2529  Go ahead; try it! All you need to do is select the footnote button
2530 \begin_inset Foot
2531 status collapsed
2532
2533 \begin_layout Plain Layout
2534 It may be easier to select it using the keyboard.
2535  You might accidentally open the footnote if you are trying to select the
2536  marker itself with the mouse.
2537 \end_layout
2538
2539 \end_inset
2540
2541  and 
2542 \family sans
2543 Cut
2544 \family default
2545  and 
2546 \family sans
2547 Paste
2548 \family default
2549  it.
2550  In addition, you can change regular text to a footnote, by selecting it
2551  and hitting the 
2552 \begin_inset Graphics
2553         filename ../images/footnote-insert.png
2554         scale 75
2555         scaleBeforeRotation
2556
2557 \end_inset
2558
2559  button; change a footnote to regular text by hitting the 
2560 \family sans
2561 Backspace
2562 \family default
2563  key when the cursor is in the first position of a footnote, or by hitting
2564  the 
2565 \family sans
2566 Delete
2567 \family default
2568  key when the cursor is in the very last position of the footnote, respectively.
2569 \end_layout
2570
2571 \begin_layout Standard
2572 Margin notes can be added using the menu 
2573 \family sans
2574 Insert\SpecialChar \menuseparator
2575 Marginal
2576 \begin_inset space ~
2577 \end_inset
2578
2579 Note
2580 \family default
2581  or the toolbar button 
2582 \begin_inset Graphics
2583         filename ../images/marginalnote-insert.png
2584         scale 75
2585         scaleBeforeRotation
2586
2587 \end_inset
2588
2589 \SpecialChar \@.
2590  Margin notes are like footnotes, except that: 
2591 \end_layout
2592
2593 \begin_layout Itemize
2594 the on-screen boxes say 
2595 \begin_inset Quotes eld
2596 \end_inset
2597
2598 margin
2599 \begin_inset Quotes erd
2600 \end_inset
2601
2602  instead of 
2603 \begin_inset Quotes eld
2604 \end_inset
2605
2606 foot
2607 \begin_inset Quotes erd
2608 \end_inset
2609
2610
2611 \end_layout
2612
2613 \begin_layout Itemize
2614 the notes will be placed in the margin, instead of below the text 
2615 \end_layout
2616
2617 \begin_layout Itemize
2618 margin notes are not numbered
2619 \end_layout
2620
2621 \begin_layout Standard
2622 Change your LyX footnote back to text, then select and change it to a margin
2623  note.
2624  Run LaTeX again to see what the margin note looks like.
2625 \end_layout
2626
2627 \begin_layout Standard
2628
2629 \series bold
2630 Exercise
2631 \series default
2632 : Fix the footnote in 
2633 \family typewriter
2634 example_raw.lyx
2635 \end_layout
2636
2637 \begin_layout Section
2638 Bibliographies
2639 \begin_inset CommandInset label
2640 LatexCommand label
2641 name "sec:bibliographies"
2642
2643 \end_inset
2644
2645
2646 \end_layout
2647
2648 \begin_layout Standard
2649 Bibliographies (at least in the exact sciences) are similar to cross references.
2650  The bibliography contains a list of references at the end of the document,
2651  and they can be referenced from within the document.
2652  Like section titles, LyX and LaTeX make your job easier by automatically
2653  numbering the bibliography items and changing citations when the item numbers
2654  change.
2655 \end_layout
2656
2657 \begin_layout Standard
2658 Go to the end of the document and switch to the 
2659 \family sans
2660 Bibliography
2661 \family default
2662  environment.
2663  Now, each paragraph you type will be a reference.
2664  Type 
2665 \begin_inset Quotes eld
2666 \end_inset
2667
2668
2669 \family typewriter
2670 The Lyx Tutorial, by the LyX Documentation Team
2671 \family default
2672
2673 \begin_inset Quotes erd
2674 \end_inset
2675
2676  as your first reference.
2677  Note that LyX automatically puts a number in a box before each reference.
2678  Click on the boxed reference number, and the 
2679 \family sans
2680 Bibliography
2681 \begin_inset space ~
2682 \end_inset
2683
2684 item
2685 \family default
2686  dialog box appears.
2687  The 
2688 \family sans
2689 Key
2690 \family default
2691  is to refer to this reference within the LyX document, the 
2692 \family sans
2693 Label
2694 \family default
2695  appears in output.
2696  When no 
2697 \family sans
2698 Label
2699 \family default
2700  is set (default), you will see the number of the bibliography in the output.
2701  Change now the 
2702 \family sans
2703 Key
2704 \family default
2705  field to 
2706 \begin_inset Quotes eld
2707 \end_inset
2708
2709 lyxtutorial
2710 \begin_inset Quotes erd
2711 \end_inset
2712
2713  to make it easy to remember.
2714 \end_layout
2715
2716 \begin_layout Standard
2717 Now pick somewhere in your document that you would like to insert a reference.
2718  Do so with 
2719 \family sans
2720 Insert\SpecialChar \menuseparator
2721 Citation
2722 \family default
2723  or the toolbar button 
2724 \begin_inset Graphics
2725         filename ../images/dialog-show-new-inset_citation.png
2726         scale 75
2727         scaleBeforeRotation
2728
2729 \end_inset
2730
2731 .
2732  A 
2733 \family sans
2734 Citation
2735 \family default
2736  dialog appears.
2737  The right panel in this dialog lists all the bibliography entries, and
2738  this field allows you to choose which bibliography item you want to cite.
2739  Select 
2740 \begin_inset Quotes eld
2741 \end_inset
2742
2743 lyxtutorial
2744 \begin_inset Quotes erd
2745 \end_inset
2746
2747  (right now, that is the only item in the bibliography), then use the 
2748 \family sans
2749 Add
2750 \family default
2751  button in the center to insert it.
2752  (You can have multiple citations in the same place by transferring a number
2753  of keys this way.) Now view your file as DVI, and you will see that the
2754  citation appears in brackets in the text, referring to the bibliography
2755  at the end of the document.
2756 \end_layout
2757
2758 \begin_layout Standard
2759 The 
2760 \family sans
2761 Text
2762 \begin_inset space ~
2763 \end_inset
2764
2765 after
2766 \family default
2767  field in the 
2768 \family sans
2769 Citation
2770 \family default
2771  dialog will put a remark (such as a reference to a page or chapter within
2772  the referenced book or article) in the brackets after the reference.
2773  If you want the references to have labels instead of numbers in the printed
2774  output (for example, some journals would use 
2775 \begin_inset Quotes eld
2776 \end_inset
2777
2778 [Smi95]
2779 \begin_inset Quotes erd
2780 \end_inset
2781
2782  to refer to a paper written by Smith in 1995), use the 
2783 \family sans
2784 Label
2785 \family default
2786  field in the 
2787 \family sans
2788 Bibliography
2789 \begin_inset space ~
2790 \end_inset
2791
2792 item
2793 \family default
2794  dialog.
2795  As usual, see the 
2796 \emph on
2797 User's Guide
2798 \emph default
2799  for details.
2800 \end_layout
2801
2802 \begin_layout Standard
2803
2804 \series bold
2805 Exercise:
2806 \series default
2807  Fix the bibliography and citation in 
2808 \family typewriter
2809 example_raw.lyx
2810 \end_layout
2811
2812 \begin_layout Section
2813 Table of Contents
2814 \end_layout
2815
2816 \begin_layout Standard
2817 You may want to put a table of contents at the beginning of your document.
2818  LyX makes this very easy to do.
2819  Just hit 
2820 \family sans
2821 Return
2822 \family default
2823  after your document title and before your first section title and choose
2824  
2825 \family sans
2826 Insert\SpecialChar \menuseparator
2827 List
2828 \begin_inset space ~
2829 \end_inset
2830
2831 /
2832 \begin_inset space ~
2833 \end_inset
2834
2835 TOC\SpecialChar \menuseparator
2836 Table
2837 \begin_inset space ~
2838 \end_inset
2839
2840 of
2841 \begin_inset space ~
2842 \end_inset
2843
2844 Contents
2845 \family default
2846 .
2847  The words 
2848 \begin_inset Quotes eld
2849 \end_inset
2850
2851 Table of Contents
2852 \begin_inset Quotes erd
2853 \end_inset
2854
2855  will appear in a button on the first line of the document.
2856  
2857 \end_layout
2858
2859 \begin_layout Standard
2860 This may not appear to be very useful.
2861  However, if you look at your DVI file, you will see that a table of contents
2862  has been generated, listing the various sections and subsections in your
2863  document.
2864  As usual, if you reorder sections or create new ones, you will see those
2865  changes in the DVI file when you update it.
2866  
2867 \end_layout
2868
2869 \begin_layout Standard
2870 The table of contents is not printed in the on-screen version of the document.
2871  But you can display the table of contents in a separate window by clicking
2872  on the table of contents button, or by using 
2873 \family sans
2874 Document\SpecialChar \menuseparator
2875 Outline
2876 \family default
2877  or the toolbar button 
2878 \begin_inset Graphics
2879         filename ../images/dialog-toggle_toc.png
2880         scale 75
2881         scaleBeforeRotation
2882
2883 \end_inset
2884
2885 .
2886  This menu will work even if you do not have a table of contents inset in
2887  your document.
2888  This is a very useful tool for moving around your document parts.
2889  Clicking on a (sub)section title in the 
2890 \family sans
2891 Outline
2892 \family default
2893  window will highlight that line and move the display (in the LyX editing
2894  window) to that place in the document.
2895  You can also use the arrow keys to move up and down in the table of contents.
2896  You may therefore find it convenient to leave this window open throughout
2897  editing sessions.
2898  You can get similar functionality from the 
2899 \family sans
2900 Navigate
2901 \family default
2902  menu, though, where the table of contents appears automatically.
2903 \end_layout
2904
2905 \begin_layout Standard
2906 To get rid of the Table of Contents, you can delete the table of contents
2907  button just like any other text.
2908 \end_layout
2909
2910 \begin_layout Standard
2911
2912 \series bold
2913 Exercise
2914 \series default
2915 : Fix the table of contents in 
2916 \family typewriter
2917 example_raw.lyx
2918 \end_layout
2919
2920 \begin_layout Chapter
2921 Using Math
2922 \end_layout
2923
2924 \begin_layout Standard
2925 LaTeX is used by many scientists because it outputs great looking equations,
2926  avoiding the control characters used by word processors and their equation
2927  editors.
2928  Many of these scientists are frustrated, however, because writing equations
2929  in LaTeX is more like programming than writing.
2930  Happily, LyX has WYSIWYM support for equations.
2931  If you are used to LaTeX, you will find that all of the usual LaTeX math
2932  commands can be typed in normally, but they will show up in a WYSIWYM fashion.
2933  If, on the other hand, you have  never written in LaTeX, then the 
2934 \family sans
2935 Math
2936 \begin_inset space ~
2937 \end_inset
2938
2939 Panel
2940 \family default
2941  will allow you to write professional-looking math quickly and easily.
2942 \end_layout
2943
2944 \begin_layout Section
2945 Math Mode
2946 \end_layout
2947
2948 \begin_layout Standard
2949 Somewhere in your LyX document, type: 
2950 \end_layout
2951
2952 \begin_layout LyX-Code
2953 I like what Einstein said, E=mc^2, because it is so simple.
2954  
2955 \end_layout
2956
2957 \begin_layout Standard
2958 Now, that equation does not look very good in LyX and in the output; there
2959  is no space between the letters and the equals sign, and you would like
2960  to write an actual superscript for the 
2961 \begin_inset Quotes eld
2962 \end_inset
2963
2964 2
2965 \begin_inset Quotes erd
2966 \end_inset
2967
2968 .
2969  That bad typesetting happened because we did not tell LyX that we were
2970  writing a mathematical expression, so it typeset the equation like regular
2971  old text.
2972 \end_layout
2973
2974 \begin_layout Standard
2975 Instead, we create a formula that will get typeset properly.
2976  In order to create a formula, just click the toolbar button 
2977 \begin_inset Graphics
2978         filename ../images/math-mode.png
2979         scale 75
2980         scaleBeforeRotation
2981
2982 \end_inset
2983
2984  or use the menu 
2985 \family sans
2986 Insert\SpecialChar \menuseparator
2987 Math\SpecialChar \menuseparator
2988 Inline
2989 \begin_inset space ~
2990 \end_inset
2991
2992 Formula
2993 \family default
2994 .
2995  LyX will insert a little blue square, which is an empty math formula.
2996  Now just type 
2997 \family typewriter
2998 E=mc^2
2999 \family default
3000  again.
3001  The expression is typed in blue, and the blue square disappears as soon
3002  as the formula is not empty.
3003  Now type 
3004 \family sans
3005 Esc
3006 \family default
3007  to leave the equation The purple markers disappear, leaving the cursor
3008  to the right of the expression, and now if you type something, it will
3009  be regular text.
3010 \end_layout
3011
3012 \begin_layout Standard
3013 Looking at the output you will notice that the expression was typeset nicely,
3014  with spaces between the letters and the equals sign, and a superscript
3015  
3016 \begin_inset Quotes eld
3017 \end_inset
3018
3019 2
3020 \begin_inset Quotes erd
3021 \end_inset
3022
3023 .
3024  Letters in math mode are assumed to be variables, and come out in italics.
3025  Numbers are just numbers.
3026 \end_layout
3027
3028 \begin_layout Standard
3029 This math editor is another example of the WYSIWYM philosophy.
3030  In LaTeX, you write a mathematical expression using text and commands like
3031  
3032 \family typewriter
3033
3034 \backslash
3035 sqrt
3036 \family default
3037 ; this can be frustrating, because you cannot see what an expression looks
3038  like until you run the file under LaTeX and you may have to spend time
3039  finding e.
3040 \begin_inset space \thinspace{}
3041 \end_inset
3042
3043 g.
3044 \begin_inset space \space{}
3045 \end_inset
3046
3047 missing brackets.
3048  LyX does not attempt to get the expression to look perfect (WYSIWYG), but
3049  it gives you an extremely good idea of what the expression will look like.
3050  LaTeX then takes care of the professional typesetting.
3051 \end_layout
3052
3053 \begin_layout Section
3054 Navigating an Equation
3055 \end_layout
3056
3057 \begin_layout Standard
3058 Now let us change 
3059 \begin_inset Formula $E=mc^{2}$
3060 \end_inset
3061
3062  to 
3063 \begin_inset Formula $E=1+mc^{2}$
3064 \end_inset
3065
3066 .
3067  Use the arrow keys to move the cursor into the expression.
3068  Note that when you enter the expression, the purple markers appear to let
3069  you know you are editing math.
3070  Now you can use 
3071 \family sans
3072 Left
3073 \family default
3074  and 
3075 \family sans
3076 Right
3077 \family default
3078  to move the cursor past the equals sign, and just type 
3079 \begin_inset Quotes eld
3080 \end_inset
3081
3082 1+
3083 \begin_inset Quotes erd
3084 \end_inset
3085
3086 .
3087  Again, you can use the arrow keys or 
3088 \family sans
3089 Esc
3090 \family default
3091  to leave the formula\SpecialChar \@.
3092
3093 \end_layout
3094
3095 \begin_layout Standard
3096 Other than the special keys described below, typing in math mode is like
3097  editing regular text.
3098  Use 
3099 \family sans
3100 Delete
3101 \family default
3102  (or 
3103 \family sans
3104 Backspace
3105 \family default
3106 ) to delete things.
3107  Select text either with the arrow keys or with the mouse.
3108  
3109 \family sans
3110 Edit\SpecialChar \menuseparator
3111 Undo
3112 \family default
3113  works in math mode as well as cut and paste.
3114  One thing to be careful of: if you are left or right outside a formula
3115  and you press 
3116 \family sans
3117 Delete
3118 \family default
3119  or 
3120 \family sans
3121 Backspace
3122 \family default
3123  respectively, you delete the whole formula.
3124  Luckily, you can just use 
3125 \family sans
3126 Undo
3127 \family default
3128  to get it back.
3129 \end_layout
3130
3131 \begin_layout Standard
3132 What if you want to change 
3133 \begin_inset Formula $E=mc^{2}$
3134 \end_inset
3135
3136  to 
3137 \begin_inset Formula $E=mc^{2.5}+1$
3138 \end_inset
3139
3140 ? Again, you can use the mouse to click in the right place.
3141  However, you can also use the arrow keys.
3142  If the cursor is just after the 
3143 \begin_inset Quotes eld
3144 \end_inset
3145
3146 c
3147 \begin_inset Quotes erd
3148 \end_inset
3149
3150  but before the 
3151 \begin_inset Quotes eld
3152 \end_inset
3153
3154 2
3155 \begin_inset Quotes erd
3156 \end_inset
3157
3158 , then press 
3159 \family sans
3160 Up
3161 \family default
3162  and the cursor is moved to the level of the superscript, just before the
3163  
3164 \begin_inset Quotes eld
3165 \end_inset
3166
3167 2
3168 \begin_inset Quotes erd
3169 \end_inset
3170
3171 .
3172  Add the 
3173 \begin_inset Quotes eld
3174 \end_inset
3175
3176 .5
3177 \begin_inset Quotes erd
3178 \end_inset
3179
3180 .
3181  Now, hitting 
3182 \family sans
3183 Down
3184 \family default
3185  will move the cursor back to the regular level.
3186  If you hit 
3187 \family sans
3188 Space
3189 \family default
3190  instead of 
3191 \family sans
3192 Down
3193 \family default
3194 , the cursor will be placed 
3195 \emph on
3196 after
3197 \emph default
3198  the superscript (so that you can then type the 
3199 \begin_inset Quotes eld
3200 \end_inset
3201
3202 +1
3203 \begin_inset Quotes erd
3204 \end_inset
3205
3206 ).
3207 \end_layout
3208
3209 \begin_layout Section
3210 Exponents and Indices
3211 \end_layout
3212
3213 \begin_layout Standard
3214 An exponent can be entered from the 
3215 \family sans
3216 Math
3217 \begin_inset space ~
3218 \end_inset
3219
3220 Toolbar
3221 \family default
3222  (see below), but it is actually simpler just to type the caret key, 
3223 \begin_inset Quotes eld
3224 \end_inset
3225
3226 ^
3227 \begin_inset Quotes erd
3228 \end_inset
3229
3230 .
3231  LyX will place another blue rectangle in the superscript, so that whatever
3232  you write next will be superscripted, and in a smaller font size.
3233  Everything you type until you hit a 
3234 \family sans
3235 Space
3236 \family default
3237  (or 
3238 \family sans
3239 Esc
3240 \family default
3241  to exit the formula entirely) will be in the superscript.
3242 \end_layout
3243
3244 \begin_layout Standard
3245 Writing a subscript (index) is just easy; start one by typing the underscore
3246  key 
3247 \begin_inset Quotes eld
3248 \end_inset
3249
3250 _
3251 \begin_inset Quotes erd
3252 \end_inset
3253
3254  .
3255  You can subscript and superscript both subscripts and superscripts like
3256  this: 
3257 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3258 \end_inset
3259
3260 .
3261  
3262 \end_layout
3263
3264 \begin_layout Standard
3265
3266 \series bold
3267 Exercise
3268 \series default
3269 : Put equation 1 of 
3270 \family typewriter
3271 example_raw.lyx
3272 \family default
3273  into math mode.
3274 \end_layout
3275
3276 \begin_layout Section
3277 The Math toolbar
3278 \end_layout
3279
3280 \begin_layout Standard
3281 The 
3282 \family sans
3283 Math
3284 \begin_inset space ~
3285 \end_inset
3286
3287 toolbar
3288 \family default
3289  is a convenient way to enter symbols or to perform complicated formula
3290  operations.
3291  Many of these operations can be accomplished from the keyboard or the 
3292 \family sans
3293 Edit\SpecialChar \menuseparator
3294 Math
3295 \family default
3296  or 
3297 \family sans
3298 Insert\SpecialChar \menuseparator
3299 Math
3300 \family default
3301  menus.
3302  However, we are going to concentrate on using the 
3303 \family sans
3304 Math
3305 \begin_inset space ~
3306 \end_inset
3307
3308 toolbar
3309 \family default
3310 , just to let you know what is out there; you can learn keyboard shortcuts
3311  and commands later from the 
3312 \emph on
3313 Math
3314 \emph default
3315  manual.
3316 \end_layout
3317
3318 \begin_layout Standard
3319 The 
3320 \family sans
3321 Math
3322 \begin_inset space ~
3323 \end_inset
3324
3325 toolbar
3326 \family default
3327  is shown when the cursor is in a formula and can also be turned on manually
3328  in the menu 
3329 \family sans
3330 View\SpecialChar \menuseparator
3331 Toolbars
3332 \family default
3333 .
3334  When you click there on 
3335 \begin_inset Quotes eld
3336 \end_inset
3337
3338 Math
3339 \begin_inset Quotes erd
3340 \end_inset
3341
3342  the toolbar will be shown permanently at the bottom; this state is visualized
3343  in the 
3344 \family sans
3345 Toolbars
3346 \family default
3347  menu with a checkmark.
3348  When you click in this state again on 
3349 \begin_inset Quotes eld
3350 \end_inset
3351
3352 Math
3353 \begin_inset Quotes erd
3354 \end_inset
3355
3356  in the 
3357 \family sans
3358 Toolbars
3359 \family default
3360  menu, the 
3361 \family sans
3362 math toolbar
3363 \family default
3364  is only shown when the cursor is within a formula; this state is visualized
3365  by the renaming of the menu entry from 
3366 \begin_inset Quotes eld
3367 \end_inset
3368
3369 Math
3370 \begin_inset Quotes erd
3371 \end_inset
3372
3373  to 
3374 \begin_inset Quotes eld
3375 \end_inset
3376
3377 Math
3378 \begin_inset space ~
3379 \end_inset
3380
3381 (auto)
3382 \begin_inset Quotes erd
3383 \end_inset
3384
3385 .
3386 \end_layout
3387
3388 \begin_layout Subsection
3389 Greek and symbols
3390 \end_layout
3391
3392 \begin_layout Standard
3393 The 
3394 \family sans
3395 Math
3396 \begin_inset space ~
3397 \end_inset
3398
3399 toolbar
3400 \family default
3401  allows you to choose from a large array of symbols used in math: operators,
3402  arrows, relationships, delimiters, special characters, sums and integrals.
3403  Note that subscripting and superscripting allow you to put lower and upper
3404  limits on sums and integrals.
3405  
3406 \end_layout
3407
3408 \begin_layout Subsection
3409 Square roots, accents, and delimiters
3410 \end_layout
3411
3412 \begin_layout Standard
3413 To type a square root, just click on the button 
3414 \begin_inset Graphics
3415         filename ../images/math/sqrt.png
3416         scale 75
3417         scaleBeforeRotation
3418
3419 \end_inset
3420
3421 .
3422  The square root appears, and the cursor is in a new insertion point inside
3423  the square root.
3424  You can type variables, numbers, other square roots, fractions, whatever
3425  you want.
3426  LyX will automatically resize the square root to fit what is inside.
3427 \end_layout
3428
3429 \begin_layout Standard
3430 Accenting a character (
3431 \begin_inset Formula $\overrightarrow{v}$
3432 \end_inset
3433
3434 ) or group of characters (
3435 \begin_inset Formula $\overrightarrow{a+b}$
3436 \end_inset
3437
3438 ) is done the same way.
3439  Decorations are available from the toolbar via the button 
3440 \begin_inset Graphics
3441         filename ../images/math/hat.png
3442         scale 75
3443         scaleBeforeRotation
3444
3445 \end_inset
3446
3447 .
3448  Click on a decoration, and LyX will insert that decoration with an insertion
3449  point under (or over) it.
3450  Just type what you want in the insertion point.
3451  There are two sets of decorations: those that resize with the text you
3452  type, and those that have a fixed size, and are most appropriate for a
3453  single letter.
3454  
3455 \end_layout
3456
3457 \begin_layout Standard
3458 Delimiters such as parentheses, brackets, and braces work similarly, but
3459  are a bit more complicated.
3460  Hit the delimiter button 
3461 \begin_inset Graphics
3462         filename ../images/dialog-show_mathdelimiter.png
3463         scale 75
3464         scaleBeforeRotation
3465
3466 \end_inset
3467
3468  to pop up the 
3469 \family sans
3470 Delimiter
3471 \family default
3472  dialog.
3473  Your current selection of delimiters is displayed in a box.
3474  It is a pair of parentheses by default, but you can choose a pair of braces,
3475  a brace and a parenthesis, or choose the empty square to have something
3476  like 
3477 \begin_inset Quotes eld
3478 \end_inset
3479
3480
3481 \begin_inset Formula $a=\left\langle 7\right.$
3482 \end_inset
3483
3484
3485 \begin_inset Quotes erd
3486 \end_inset
3487
3488  (the empty delimiter is displayed as a broken line in LyX, but will not
3489  show up in the output).
3490 \end_layout
3491
3492 \begin_layout Standard
3493 If you are lazy, you can type actual parentheses in math mode, rather than
3494  using the 
3495 \family sans
3496 Delimiter
3497 \family default
3498  dialog.
3499  However, those parentheses will be the same size as regular text, which
3500  will look bad if you have a big fraction or matrix inside the parentheses.
3501  So it is better in this case to use one of the three delimiter buttons
3502  that insert directly e.
3503 \begin_inset space \thinspace{}
3504 \end_inset
3505
3506 g.
3507 \begin_inset space \space{}
3508 \end_inset
3509
3510 a (
3511 \begin_inset space \thinspace{}
3512 \end_inset
3513
3514 ) pair.
3515 \end_layout
3516
3517 \begin_layout Standard
3518 You can also put delimiters or a square root sign or a decoration on already
3519  existing formula parts.
3520  Select the portion of the formula that you want to adjust, and then click
3521  on the button you want from the 
3522 \family sans
3523 Math
3524 \begin_inset space ~
3525 \end_inset
3526
3527 Toolbar
3528 \family default
3529 .
3530  Try using this to change Newton's second law from scalar to vector form
3531  (
3532 \begin_inset Formula $f=ma$
3533 \end_inset
3534
3535  to 
3536 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3537 \end_inset
3538
3539 ).
3540  Once you have  learned about matrices, this is how you will put parentheses
3541  or brackets around them.
3542 \end_layout
3543
3544 \begin_layout Subsection
3545 Fractions
3546 \end_layout
3547
3548 \begin_layout Standard
3549 To create a fraction, click on the fraction button 
3550 \begin_inset Graphics
3551         filename ../images/math/frac.png
3552         lyxscale 75
3553         scale 60
3554         scaleBeforeRotation
3555
3556 \end_inset
3557
3558  in the 
3559 \family sans
3560 Math
3561 \begin_inset space ~
3562 \end_inset
3563
3564 Toolbar
3565 \family default
3566 .
3567  LyX writes two insertion points in a fraction.
3568  As you would expect, you can use arrow keys or the mouse to move around
3569  a fraction.
3570  Click on the top square and type 
3571 \begin_inset Quotes eld
3572 \end_inset
3573
3574 1
3575 \begin_inset Quotes erd
3576 \end_inset
3577
3578 .
3579  Now hit 
3580 \family sans
3581 Down
3582 \family default
3583  and type 
3584 \begin_inset Quotes eld
3585 \end_inset
3586
3587 2
3588 \begin_inset Quotes erd
3589 \end_inset
3590
3591 .
3592  You have made a fraction! Of course you can type anything within each of
3593  the two boxes: variables with exponents, square roots, other fractions,
3594  whatever.
3595  
3596 \end_layout
3597
3598 \begin_layout Standard
3599
3600 \series bold
3601 Exercise
3602 \series default
3603 : Put equation 2 of 
3604 \family typewriter
3605 example_raw.lyx
3606 \family default
3607  into math mode.
3608 \end_layout
3609
3610 \begin_layout Subsection
3611 Functions: lim, log, sin and others
3612 \end_layout
3613
3614 \begin_layout Standard
3615 Because letters in math mode are considered to be variables, if you type
3616  
3617 \begin_inset Quotes eld
3618 \end_inset
3619
3620 sin
3621 \begin_inset Quotes erd
3622 \end_inset
3623
3624  in math mode, LyX thinks you are typing the product of the three variables
3625  
3626 \begin_inset Formula $s$
3627 \end_inset
3628
3629
3630 \begin_inset Formula $i$
3631 \end_inset
3632
3633 , and 
3634 \begin_inset Formula $n$
3635 \end_inset
3636
3637 .
3638  The three letters will be typeset in italics, when what you really wanted
3639  was the word 
3640 \begin_inset Quotes eld
3641 \end_inset
3642
3643 sin
3644 \begin_inset Quotes erd
3645 \end_inset
3646
3647  typeset in Roman.
3648  In addition, LyX will not put a space between the word 
3649 \begin_inset Quotes eld
3650 \end_inset
3651
3652 sin
3653 \begin_inset Quotes erd
3654 \end_inset
3655
3656  and the 
3657 \begin_inset Quotes eld
3658 \end_inset
3659
3660 x
3661 \begin_inset Quotes erd
3662 \end_inset
3663
3664  (pressing 
3665 \family sans
3666 Space
3667 \family default
3668  will exit the formula).
3669  So how do you get 
3670 \begin_inset Quotes eld
3671 \end_inset
3672
3673
3674 \begin_inset Formula $\sin(x)$
3675 \end_inset
3676
3677
3678 \begin_inset Quotes erd
3679 \end_inset
3680
3681  instead of 
3682 \begin_inset Quotes eld
3683 \end_inset
3684
3685
3686 \begin_inset Formula $sin(x)$
3687 \end_inset
3688
3689
3690 \begin_inset Quotes erd
3691 \end_inset
3692
3693 ?
3694 \end_layout
3695
3696 \begin_layout Standard
3697 Click on the 
3698 \family sans
3699 Math
3700 \begin_inset space ~
3701 \end_inset
3702
3703 Toolbar
3704 \family default
3705  button 
3706 \begin_inset Graphics
3707         filename ../images/math/functions.png
3708         scale 75
3709         scaleBeforeRotation
3710
3711 \end_inset
3712
3713  and then on 
3714 \begin_inset Quotes eld
3715 \end_inset
3716
3717 sin
3718 \begin_inset Quotes erd
3719 \end_inset
3720
3721  in the appearing function list.
3722  The word 
3723 \begin_inset Quotes eld
3724 \end_inset
3725
3726 sin
3727 \begin_inset Quotes erd
3728 \end_inset
3729
3730  is displayed in LyX in black, and set in upright roman type.
3731  The whole word is treated as one symbol, so if you type 
3732 \family sans
3733 Backspace
3734 \family default
3735 , it will delete the whole word.
3736  Now type 
3737 \begin_inset Quotes eld
3738 \end_inset
3739
3740 (x)
3741 \begin_inset Quotes erd
3742 \end_inset
3743
3744 , which will be written in blue italics, like you expect in a formula.
3745  In the output, the expression will be correctly typeset.
3746  Try it out.
3747 \end_layout
3748
3749 \begin_layout Standard
3750 The function list includes other trigonometric functions and their inverses,
3751  hyperbolic functions, logarithms, limits, and quite a few others.
3752  These functions can take subscripts and superscripts, important for typing
3753  
3754 \begin_inset Quotes eld
3755 \end_inset
3756
3757
3758 \begin_inset Formula $\cos^{2}\theta$
3759 \end_inset
3760
3761
3762 \begin_inset Quotes erd
3763 \end_inset
3764
3765  or 
3766 \begin_inset Quotes eld
3767 \end_inset
3768
3769
3770 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3771 \end_inset
3772
3773
3774 \begin_inset Quotes erd
3775 \end_inset
3776
3777 .
3778 \end_layout
3779
3780 \begin_layout Standard
3781
3782 \series bold
3783 Exercise
3784 \series default
3785 : Put equation 3 of 
3786 \family typewriter
3787 example_raw.lyx
3788 \family default
3789  into math mode.
3790 \end_layout
3791
3792 \begin_layout Subsection
3793 Matrices
3794 \end_layout
3795
3796 \begin_layout Standard
3797 Click on the matrix button 
3798 \begin_inset Graphics
3799         filename ../images/dialog-show_mathmatrix.png
3800         scale 75
3801         scaleBeforeRotation
3802
3803 \end_inset
3804
3805  in the 
3806 \family sans
3807 Math
3808 \begin_inset space ~
3809 \end_inset
3810
3811 Toolbar
3812 \family default
3813 .
3814  The appearing dialog allows you to choose how many rows and columns you
3815  want in your matrix.
3816  Choose 2 rows and 3 columns and hit 
3817 \family sans
3818 OK
3819 \family default
3820 .
3821  LyX prints 6 insertion points in a 
3822 \begin_inset Formula $2\times3$
3823 \end_inset
3824
3825  matrix.
3826  As usual, you can put any sort of formula expression (a square root, another
3827  matrix, etc.) in each insertion point.
3828  You can also leave some of the insertion points empty if you want.
3829 \end_layout
3830
3831 \begin_layout Standard
3832
3833 \family sans
3834 Tab
3835 \family default
3836  can be used to move horizontally between the columns of a matrix.
3837  Alternatively, you can use the arrow keys to move around - hitting 
3838 \family sans
3839 Right
3840 \family default
3841  at the end of one box will move to the next box, 
3842 \family sans
3843 Down
3844 \family default
3845  will move to the next row, etc.
3846 \end_layout
3847
3848 \begin_layout Standard
3849 If you need to change the number of rows and columns, use the menu 
3850 \family sans
3851 Edit\SpecialChar \menuseparator
3852 Rows
3853 \begin_inset space \thinspace{}
3854 \end_inset
3855
3856 &
3857 \begin_inset space \thinspace{}
3858 \end_inset
3859
3860 Columns
3861 \family default
3862  or the math toolbar buttons 
3863 \begin_inset Graphics
3864         filename ../images/tabular-feature_append-row.png
3865         scale 75
3866         scaleBeforeRotation
3867
3868 \end_inset
3869
3870
3871 \begin_inset Graphics
3872         filename ../images/tabular-feature_delete-row.png
3873         scale 75
3874         scaleBeforeRotation
3875
3876 \end_inset
3877
3878
3879 \begin_inset Graphics
3880         filename ../images/tabular-feature_append-column.png
3881         scale 75
3882         scaleBeforeRotation
3883
3884 \end_inset
3885
3886
3887 \begin_inset Graphics
3888         filename ../images/tabular-feature_delete-column.png
3889         scale 75
3890         scaleBeforeRotation
3891
3892 \end_inset
3893
3894 .
3895 \end_layout
3896
3897 \begin_layout Standard
3898 See the 
3899 \emph on
3900 User's Guide
3901 \emph default
3902  for information on how to change the horizontal alignment of each column,
3903  and how to change the vertical position of the whole matrix.
3904  Note that if you want to write a table containing text, you should use
3905  LyX's wonderful table support, rather than trying to write text in a matrix.
3906 \end_layout
3907
3908 \begin_layout Subsection
3909 Display mode
3910 \end_layout
3911
3912 \begin_layout Standard
3913 All of the expressions we have written so far have been on the same line
3914  as the text that came before and after them, otherwise known as inline
3915  expressions.
3916  This is fine for short, simple expressions, but if you want to write larger
3917  ones, or if you want your expressions to stand out from the text, you need
3918  to write them in display mode.
3919  In addition, only displayed expressions can be labeled and numbered (see
3920  the 
3921 \emph on
3922 User's Guide
3923 \emph default
3924 ), and multi-line equations must be in display mode.
3925 \end_layout
3926
3927 \begin_layout Standard
3928 While being in a formula, click on the display button 
3929 \begin_inset Graphics
3930         filename ../images/math-display.png
3931         scale 75
3932         scaleBeforeRotation
3933
3934 \end_inset
3935
3936  in the 
3937 \family sans
3938 Math
3939 \begin_inset space ~
3940 \end_inset
3941
3942 Toolbar
3943 \family default
3944 .
3945  This centers the formula and adds a blank line before and after it.
3946  Now type in an expression and compile your file to see how it looks.
3947  The display button is actually a toggle; use it now to change a couple
3948  of your expressions to display mode and back.
3949  
3950 \end_layout
3951
3952 \begin_layout Standard
3953 Display mode has a couple differences from inline mode:
3954 \end_layout
3955
3956 \begin_layout Itemize
3957 The default font is larger for a few symbols, like 
3958 \begin_inset Formula $\sum$
3959 \end_inset
3960
3961  and 
3962 \begin_inset Formula $\int$
3963 \end_inset
3964
3965
3966 \end_layout
3967
3968 \begin_layout Itemize
3969 Subscripts and superscripts for limits and sums (but not integrals) are
3970  written under and over rather than next to the symbols
3971 \end_layout
3972
3973 \begin_layout Itemize
3974 Text is centered
3975 \end_layout
3976
3977 \begin_layout Standard
3978 Other than these differences, though, displayed expressions and inline expressio
3979 ns are very similar.
3980 \end_layout
3981
3982 \begin_layout Standard
3983 One final note about the way displayed formulas are typeset: Be careful
3984  about whether you are putting your equation into a new paragraph or not.
3985  If your formula is in the middle of a sentence or paragraph, then do not
3986  press 
3987 \family sans
3988 Return
3989 \family default
3990 .
3991  Doing so will cause the text 
3992 \emph on
3993 after
3994 \emph default
3995  the formula to start a new paragraph.
3996  That text will be indented or follow a blank line, depending on your document
3997  paragraph settings, which is probably not what you want.
3998 \end_layout
3999
4000 \begin_layout Standard
4001
4002 \series bold
4003 Exercise
4004 \series default
4005 : Put the various equations in 
4006 \family typewriter
4007 example_raw.lyx
4008 \family default
4009  into display mode, and see how they are typeset differently.
4010 \end_layout
4011
4012 \begin_layout Standard
4013
4014 \series bold
4015 Exercise
4016 \series default
4017 : Using various tools you have  learned in this section, you should be able
4018  to write an equation like:
4019 \begin_inset Foot
4020 status collapsed
4021
4022 \begin_layout Plain Layout
4023 After you have  done it the hard way, give 
4024 \family sans
4025 Insert\SpecialChar \menuseparator
4026 Math\SpecialChar \menuseparator
4027 Cases
4028 \begin_inset space ~
4029 \end_inset
4030
4031 Environment
4032 \family default
4033  a try.
4034 \end_layout
4035
4036 \end_inset
4037
4038  
4039 \begin_inset Formula \[
4040 f(x)=\left\{ \begin{array}{cc}
4041 \log_{8}x & x>0\\
4042 0 & x=0\\
4043 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0\end{array}\right.\]
4044
4045 \end_inset
4046
4047
4048 \end_layout
4049
4050 \begin_layout Section
4051 More Math Stuff
4052 \end_layout
4053
4054 \begin_layout Standard
4055 LyX's math editor can do a lot more.
4056  Now you are familiar with the basics, you can refer to the 
4057 \emph on
4058 User's Guide
4059 \emph default
4060  for tips on how to:
4061 \end_layout
4062
4063 \begin_layout Itemize
4064 Label and number expressions
4065 \end_layout
4066
4067 \begin_layout Itemize
4068 Create multi-line equations
4069 \end_layout
4070
4071 \begin_layout Itemize
4072 Change typefaces, e.
4073 \begin_inset space \thinspace{}
4074 \end_inset
4075
4076 g.
4077 \begin_inset space \space{}
4078 \end_inset
4079
4080 to write bold-face text in an expression.
4081 \end_layout
4082
4083 \begin_layout Itemize
4084 Fine-tune font sizes and spacing within an expression.
4085  (Do not worry about this until your final draft!)
4086 \end_layout
4087
4088 \begin_layout Itemize
4089 Write macros.
4090  These are very powerful, because you just define them once at the top of
4091  the document, and then you can use them throughout the document.
4092 \end_layout
4093
4094 \begin_layout Itemize
4095 Do lots of other things that we have no space for in this Tutorial.
4096 \end_layout
4097
4098 \begin_layout Chapter
4099 Miscellaneous
4100 \end_layout
4101
4102 \begin_layout Section
4103 Other major LyX Features
4104 \end_layout
4105
4106 \begin_layout Standard
4107 We have not gone through all the possible commands in LyX, and we are not
4108  planning on it.
4109  As usual, see the 
4110 \emph on
4111 User's Guide
4112 \emph default
4113  and the 
4114 \emph on
4115 Embedded
4116 \begin_inset space ~
4117 \end_inset
4118
4119 Objects
4120 \emph default
4121  manual for more information.
4122  We will just mention a couple more major things LyX can do:
4123 \end_layout
4124
4125 \begin_layout Itemize
4126 LyX has WYSIWYM support for tables.
4127  Use the 
4128 \family sans
4129 Insert\SpecialChar \menuseparator
4130 Table
4131 \family default
4132  (toolbar button 
4133 \begin_inset Graphics
4134         filename ../images/tabular-insert.png
4135         scale 75
4136         scaleBeforeRotation
4137
4138 \end_inset
4139
4140 ) to get a table.
4141  Click on the table with the 
4142 \emph on
4143 right button
4144 \emph default
4145  to get a 
4146 \family sans
4147 Table
4148 \begin_inset space ~
4149 \end_inset
4150
4151 Settings
4152 \family default
4153  dialog box which allows extensive table editing.
4154 \end_layout
4155
4156 \begin_layout Itemize
4157 LyX also supports including pictures in any format within documents.
4158  (You guessed it: 
4159 \family sans
4160 Insert\SpecialChar \menuseparator
4161 Graphics
4162 \family default
4163  (toolbar button 
4164 \begin_inset Graphics
4165         filename ../images/dialog-show-new-inset_graphics.png
4166         scale 75
4167         scaleBeforeRotation
4168
4169 \end_inset
4170
4171 ).
4172  Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4173  can have captions, and LyX will automatically generate lists of figures
4174  and/or tables.
4175 \end_layout
4176
4177 \begin_layout Itemize
4178 LyX is heavily configurable.
4179  Everything from how the LyX window looks to how the output comes out can
4180  be configured in a number of ways.
4181  Much configuration is done through 
4182 \family sans
4183 Tools\SpecialChar \menuseparator
4184 Preferences
4185 \family default
4186 .
4187  For more information on this, check out 
4188 \family sans
4189 Help\SpecialChar \menuseparator
4190 Customization\SpecialChar \@.
4191
4192 \end_layout
4193
4194 \begin_layout Itemize
4195 LyX is being developed by a team of programmers on five continents.
4196  Therefore, LyX has better support for non-English languages (such as Dutch,
4197  German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4198 ) than many word processors.
4199  Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4200  languages Chinese Japanese, and Korean are supported.
4201  You can write documents in other languages and you can also configure LyX
4202  to show its menus and error messages in other languages.
4203  
4204 \end_layout
4205
4206 \begin_layout Itemize
4207 The LyX menus feature keybindings.
4208  This means that you can do 
4209 \family sans
4210 File\SpecialChar \menuseparator
4211 Open
4212 \family default
4213  by pressing 
4214 \family sans
4215 Alt+F
4216 \family default
4217  followed by 
4218 \family sans
4219 O
4220 \family default
4221  or by using the binding which is shown next to it in the menu (Ctrl+O by
4222  default).
4223  Keybindings are also configurable.
4224  For information on this, check out 
4225 \family sans
4226 Help\SpecialChar \menuseparator
4227 Customization\SpecialChar \@.
4228
4229 \end_layout
4230
4231 \begin_layout Itemize
4232 LyX can read LaTeX documents.
4233  See section
4234 \begin_inset space ~
4235 \end_inset
4236
4237
4238 \begin_inset CommandInset ref
4239 LatexCommand ref
4240 reference "sec:tex2lyx"
4241
4242 \end_inset
4243
4244 .
4245 \end_layout
4246
4247 \begin_layout Itemize
4248 Spell-checking, thesaurus, and word count facilities are available.
4249 \end_layout
4250
4251 \begin_layout Itemize
4252 Generation of indexes and nomenclatures/glossaries is supported.
4253 \end_layout
4254
4255 \begin_layout Section
4256 LyX for LaTeX Users
4257 \begin_inset CommandInset label
4258 LatexCommand label
4259 name "sec:latexusers"
4260
4261 \end_inset
4262
4263
4264 \end_layout
4265
4266 \begin_layout Standard
4267 If you do not know anything about LaTeX, you do not have to read this section.
4268  Actually, you might want to 
4269 \emph on
4270 learn
4271 \emph default
4272  about LaTeX, and then read this chapter.
4273  However, some who begin to use LyX will be familiar with LaTeX.
4274  If you are such a person, you may be wondering if LyX can really do everything
4275  LaTeX can do.
4276  The short answer is that LyX can do pretty much everything LaTeX can do
4277  in one form or another, and it definitely simplifies most parts of writing
4278  a LaTeX document.
4279 \end_layout
4280
4281 \begin_layout Standard
4282 Because this is just a tutorial, we are only going to mention things that
4283  new LyX users will most likely be interested in.
4284  In the interests of keeping the Tutorial short, we will give only minimal
4285  information here.
4286  The 
4287 \emph on
4288 Additional
4289 \begin_inset space ~
4290 \end_inset
4291
4292 Features
4293 \emph default
4294  and the 
4295 \emph on
4296 Embedded
4297 \begin_inset space ~
4298 \end_inset
4299
4300 Objects
4301 \emph default
4302  manual have a great deal of information on differences between LyX and
4303  LaTeX, and how to do various LaTeX tricks in LyX.
4304 \end_layout
4305
4306 \begin_layout Subsection
4307 TeX Mode 
4308 \end_layout
4309
4310 \begin_layout Standard
4311 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4312  will be displayed in red on the screen.
4313  You can use TeX commands in LyX by choosing 
4314 \family sans
4315 Insert\SpecialChar \menuseparator
4316 TeX
4317 \begin_inset space ~
4318 \end_inset
4319
4320 Code
4321 \family default
4322  (toolbar button 
4323 \begin_inset Graphics
4324         filename ../images/ert-insert.png
4325         scale 75
4326         scaleBeforeRotation
4327
4328 \end_inset
4329
4330 ).
4331  This creates a box where everything within it is passed straight to LaTeX.
4332 \end_layout
4333
4334 \begin_layout Standard
4335 In a math formula, TeX mode is handled a bit differently.
4336  TeX mode is there entered by typing a backslash.
4337  The backslash is not written out, but anything you type afterwards will
4338  be in red.
4339  You exit TeX mode by typing 
4340 \family sans
4341 Space
4342 \family default
4343  or some other non-alphabetic character, like a number, underscore, caret,
4344  or parenthesis.
4345  Once you exit TeX mode, if LyX knows the TeX command you have  typed in,
4346  it will convert it to WYSIWYM\SpecialChar \@.
4347  So if you type 
4348 \begin_inset Quotes eld
4349 \end_inset
4350
4351
4352 \family typewriter
4353
4354 \backslash
4355 gamma
4356 \family default
4357
4358 \begin_inset Quotes erd
4359 \end_inset
4360
4361  in a formula and then press 
4362 \family sans
4363 Space
4364 \family default
4365 , LyX will change the red 
4366 \begin_inset Quotes eld
4367 \end_inset
4368
4369 gamma
4370 \begin_inset Quotes erd
4371 \end_inset
4372
4373  to a blue 
4374 \begin_inset Quotes eld
4375 \end_inset
4376
4377
4378 \begin_inset Formula $\gamma$
4379 \end_inset
4380
4381
4382 \begin_inset Quotes erd
4383 \end_inset
4384
4385 .
4386  This will work for almost all, non-complicated math macros.
4387  This may be faster than using the 
4388 \family sans
4389 Math
4390 \begin_inset space ~
4391 \end_inset
4392
4393 Toolbar
4394 \family default
4395 , and will be especially convenient for experienced LaTeX users.
4396 \end_layout
4397
4398 \begin_layout Standard
4399 As a special case, if you type 
4400 \begin_inset Quotes eld
4401 \end_inset
4402
4403
4404 \family typewriter
4405
4406 \backslash
4407 {
4408 \family default
4409
4410 \begin_inset Quotes erd
4411 \end_inset
4412
4413  in a formula, the beginning 
4414 \emph on
4415 and
4416 \emph default
4417  ending braces will be inserted in red while the cursor is placed between
4418  the braces.
4419  This makes it more convenient to type those commands which take an argument.
4420 \end_layout
4421
4422 \begin_layout Standard
4423 LyX cannot do absolutely everything that LaTeX can do.
4424  Some fancy functions are not supported at all, while some work but are
4425  not WYSIWYM.
4426  TeX mode allows users to get the full flexibility of LaTeX, while having
4427  all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4428  LyX could never support every LaTeX package.
4429  However, by typing 
4430 \family typewriter
4431
4432 \backslash
4433 usepackage{foo}
4434 \family default
4435  in the preamble (see section
4436 \begin_inset space ~
4437 \end_inset
4438
4439
4440 \begin_inset CommandInset ref
4441 LatexCommand ref
4442 reference "sec:preamble"
4443
4444 \end_inset
4445
4446 ), you can use any package you want — although you will not have WYSIWYM
4447  support for that package's features.
4448 \end_layout
4449
4450 \begin_layout Subsection
4451 Importing LaTeX Documents — 
4452 \family typewriter
4453 tex2lyx
4454 \family default
4455
4456 \begin_inset CommandInset label
4457 LatexCommand label
4458 name "sec:tex2lyx"
4459
4460 \end_inset
4461
4462
4463 \end_layout
4464
4465 \begin_layout Standard
4466 You can import a LaTeX file into LyX by using the 
4467 \family sans
4468 File\SpecialChar \menuseparator
4469 Import\SpecialChar \menuseparator
4470 LaTeX
4471 \begin_inset space ~
4472 \end_inset
4473
4474 (plain)
4475 \family default
4476  menu in LyX.
4477  This will call the program 
4478 \family typewriter
4479 tex2lyx
4480 \family default
4481  which will create a file 
4482 \family typewriter
4483 foo.lyx
4484 \family default
4485  from the file 
4486 \family typewriter
4487 foo.tex
4488 \family default
4489  and then open that file.
4490  If the translation does not work, you can try calling 
4491 \family typewriter
4492 tex2lyx
4493 \family default
4494  from the command line, possibly using fancier options.
4495 \end_layout
4496
4497 \begin_layout Standard
4498
4499 \family typewriter
4500 tex2lyx
4501 \family default
4502  will translate most legal LaTeX, but not everything.
4503  It will leave things it does not understand in TeX mode; so, after translating
4504  a file with 
4505 \family typewriter
4506 tex2lyx
4507 \family default
4508 , you can look for the red text and manually edit it to get it right.
4509 \end_layout
4510
4511 \begin_layout Standard
4512
4513 \family typewriter
4514 tex2lyx
4515 \family default
4516  has its own manpage.
4517  Read it to find out which LaTeX commands and environments are not supported,
4518  bugs (and how to get around them), and how to use the various options.
4519 \end_layout
4520
4521 \begin_layout Subsection
4522 Converting LyX Documents to LaTeX
4523 \end_layout
4524
4525 \begin_layout Standard
4526 You might wish to convert a LyX Document to a LaTeX file.
4527  For example, a co-worker or co-author who does not have LyX might want
4528  to read it.
4529  Select 
4530 \family sans
4531 File\SpecialChar \menuseparator
4532 Export\SpecialChar \menuseparator
4533 LaTeX
4534 \family default
4535 .
4536  This will create a file 
4537 \family typewriter
4538 whatever.tex
4539 \family default
4540  from the 
4541 \family typewriter
4542 whatever.lyx
4543 \family default
4544  file you are editing.
4545  LyX always creates temporary LaTeX files when viewing or printing files.
4546 \end_layout
4547
4548 \begin_layout Subsection
4549 LaTeX Preamble
4550 \end_layout
4551
4552 \begin_layout Subsubsection
4553 Document Class
4554 \end_layout
4555
4556 \begin_layout Standard
4557 The 
4558 \family sans
4559 Document\SpecialChar \menuseparator
4560 Settings
4561 \family default
4562  dialog takes care of the document-wide options.
4563  You can change there the document class, default font size and paper size.
4564  Document class options but also options for LaTeX packages can be entered
4565  there in the 
4566 \family sans
4567 Class
4568 \begin_inset space ~
4569 \end_inset
4570
4571 options
4572 \family default
4573  area.
4574 \end_layout
4575
4576 \begin_layout Subsubsection
4577 Other Preamble Matter
4578 \begin_inset CommandInset label
4579 LatexCommand label
4580 name "sec:preamble"
4581
4582 \end_inset
4583
4584
4585 \end_layout
4586
4587 \begin_layout Standard
4588 If you have special commands to put in the preamble of a LaTeX file, you
4589  can use them in a LyX document as well.
4590  Select 
4591 \family sans
4592 Document\SpecialChar \menuseparator
4593 Settings\SpecialChar \menuseparator
4594 LaTeX
4595 \begin_inset space ~
4596 \end_inset
4597
4598 Preamble
4599 \family default
4600  and type in the dialog window (or from the document settings dialog, depending
4601  on the frontend).
4602  Anything you type will (as with TeX mode) be sent directly to LaTeX.
4603 \end_layout
4604
4605 \begin_layout Subsection
4606 BibTeX
4607 \end_layout
4608
4609 \begin_layout Standard
4610 LyX has support for BibTeX, which allows you to build databases of bibliographic
4611 al references to be used in multiple documents.
4612  Select 
4613 \family sans
4614 Insert\SpecialChar \menuseparator
4615 List
4616 \begin_inset space \thinspace{}
4617 \end_inset
4618
4619 /
4620 \begin_inset space \thinspace{}
4621 \end_inset
4622
4623 TOC\SpecialChar \menuseparator
4624 BibTeX
4625 \begin_inset space ~
4626 \end_inset
4627
4628 Bibliography
4629 \family default
4630  to include a 
4631 \family typewriter
4632 BibTeX
4633 \family default
4634  file.
4635  In the 
4636 \family sans
4637 Database
4638 \family default
4639  field you load BibTeX files, in the 
4640 \family sans
4641 Style
4642 \family default
4643  field you can load BibTeX style files.
4644 \end_layout
4645
4646 \begin_layout Standard
4647 After you have done this, you can use citations from any bibliographies
4648  you are including with 
4649 \family sans
4650 Insert\SpecialChar \menuseparator
4651 Citation
4652 \family default
4653  (see section
4654 \begin_inset space ~
4655 \end_inset
4656
4657
4658 \begin_inset CommandInset ref
4659 LatexCommand ref
4660 reference "sec:bibliographies"
4661
4662 \end_inset
4663
4664 ).
4665  LyX will take care of running BibTeX.
4666  The box in the 
4667 \family sans
4668 Citation
4669 \family default
4670  dialog will show a list of all the references in your 
4671 \family typewriter
4672 BibTeX
4673 \family default
4674  file.
4675 \end_layout
4676
4677 \begin_layout Section
4678 Errors!
4679 \end_layout
4680
4681 \begin_layout Standard
4682 Sometimes when you try to view a document, there will be errors, things
4683  that LyX or LaTeX cannot understand.
4684  When this happens, LyX will open a 
4685 \family sans
4686 LaTeX
4687 \begin_inset space ~
4688 \end_inset
4689
4690 Errors
4691 \family default
4692  dialog.
4693  Clicking on individual errors in this dialog will take you to the place
4694  in the LyX document where the error occurs and also display the detailed
4695  LaTeX error message.
4696 \end_layout
4697
4698 \end_body
4699 \end_document