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