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