]> git.lyx.org Git - features.git/blob - lib/doc/Tutorial.lyx
Tutorial.lyx: fix typos and other issues spotted by John Hudson
[features.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 in this case to use one of the three delimiter buttons
3641  that insert them directly, for example, as a pair of parentheses 
3642 \begin_inset Formula $\left(\,\right)$
3643 \end_inset
3644
3645 .
3646 \end_layout
3647
3648 \begin_layout Standard
3649 You can also put delimiters or a square root sign or a decoration on already
3650  existing formula parts.
3651  Select the portion of the formula that you want to adjust, and then click
3652  on the button you want from the 
3653 \family sans
3654 Math
3655 \begin_inset space ~
3656 \end_inset
3657
3658 Toolbar
3659 \family default
3660 .
3661  Try using this to change Newton's second law from scalar to vector form
3662  (
3663 \begin_inset Formula $f=ma$
3664 \end_inset
3665
3666  to 
3667 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3668 \end_inset
3669
3670 ).
3671  Once you have  learned about matrices, this is how you will put parentheses
3672  or brackets around them.
3673 \end_layout
3674
3675 \begin_layout Subsection
3676 Fractions
3677 \end_layout
3678
3679 \begin_layout Standard
3680 To create a fraction, click on the fraction button 
3681 \begin_inset Info
3682 type  "icon"
3683 arg   "math-insert \\frac-square"
3684 \end_inset
3685
3686  in the 
3687 \family sans
3688 Math
3689 \begin_inset space ~
3690 \end_inset
3691
3692 Toolbar
3693 \family default
3694 .
3695  LyX writes two insertion points in a fraction.
3696  As you would expect, you can use arrow keys or the mouse to move around
3697  a fraction.
3698  Click on the top square and type 
3699 \begin_inset Quotes eld
3700 \end_inset
3701
3702 1
3703 \begin_inset Quotes erd
3704 \end_inset
3705
3706 .
3707  Now hit 
3708 \family sans
3709 Down
3710 \family default
3711  and type 
3712 \begin_inset Quotes eld
3713 \end_inset
3714
3715 2
3716 \begin_inset Quotes erd
3717 \end_inset
3718
3719 .
3720  You have made a fraction! Of course you can type anything within each of
3721  the two boxes: variables with exponents, square roots, other fractions,
3722  whatever.
3723  
3724 \end_layout
3725
3726 \begin_layout Standard
3727
3728 \series bold
3729 Exercise
3730 \series default
3731 : Put equation 2 of 
3732 \family typewriter
3733 example_raw.lyx
3734 \family default
3735  into math mode.
3736 \end_layout
3737
3738 \begin_layout Subsection
3739 Functions: lim, log, sin and others
3740 \end_layout
3741
3742 \begin_layout Standard
3743 Because letters in math mode are considered to be variables, if you type
3744  
3745 \begin_inset Quotes eld
3746 \end_inset
3747
3748 sin
3749 \begin_inset Quotes erd
3750 \end_inset
3751
3752  in math mode, LyX thinks you are typing the product of the three variables
3753  
3754 \begin_inset Formula $s$
3755 \end_inset
3756
3757
3758 \begin_inset Formula $i$
3759 \end_inset
3760
3761 , and 
3762 \begin_inset Formula $n$
3763 \end_inset
3764
3765 .
3766  The three letters will be typeset in italics, when what you really wanted
3767  was the word 
3768 \begin_inset Quotes eld
3769 \end_inset
3770
3771 sin
3772 \begin_inset Quotes erd
3773 \end_inset
3774
3775  typeset in Roman.
3776  In addition, LyX will not put a space between the word 
3777 \begin_inset Quotes eld
3778 \end_inset
3779
3780 sin
3781 \begin_inset Quotes erd
3782 \end_inset
3783
3784  and the 
3785 \begin_inset Quotes eld
3786 \end_inset
3787
3788 x
3789 \begin_inset Quotes erd
3790 \end_inset
3791
3792  (pressing 
3793 \family sans
3794 Space
3795 \family default
3796  will exit the formula).
3797  So how do you get 
3798 \begin_inset Quotes eld
3799 \end_inset
3800
3801
3802 \begin_inset Formula $\sin(x)$
3803 \end_inset
3804
3805
3806 \begin_inset Quotes erd
3807 \end_inset
3808
3809  instead of 
3810 \begin_inset Quotes eld
3811 \end_inset
3812
3813
3814 \begin_inset Formula $sin(x)$
3815 \end_inset
3816
3817
3818 \begin_inset Quotes erd
3819 \end_inset
3820
3821 ?
3822 \end_layout
3823
3824 \begin_layout Standard
3825 Click on the 
3826 \family sans
3827 Math
3828 \begin_inset space ~
3829 \end_inset
3830
3831 Toolbar
3832 \family default
3833  button 
3834 \begin_inset Info
3835 type  "icon"
3836 arg   "math-insert \\functions"
3837 \end_inset
3838
3839  and then on 
3840 \begin_inset Quotes eld
3841 \end_inset
3842
3843 sin
3844 \begin_inset Quotes erd
3845 \end_inset
3846
3847  in the pop-up function list.
3848  The word 
3849 \begin_inset Quotes eld
3850 \end_inset
3851
3852 sin
3853 \begin_inset Quotes erd
3854 \end_inset
3855
3856  is displayed in LyX in black, and set in upright roman type.
3857  The whole word is treated as one symbol, so if you type 
3858 \family sans
3859 Backspace
3860 \family default
3861 , it will delete the whole word.
3862  Now type 
3863 \begin_inset Quotes eld
3864 \end_inset
3865
3866 (x)
3867 \begin_inset Quotes erd
3868 \end_inset
3869
3870 , which will be written in blue italics, like you expect in a formula.
3871  In the output, the expression will be correctly typeset.
3872  Try it out.
3873 \end_layout
3874
3875 \begin_layout Standard
3876 The function list includes other trigonometric functions and their inverses,
3877  hyperbolic functions, logarithms, limits, and quite a few others.
3878  These functions can take subscripts and superscripts, important for typing
3879  
3880 \begin_inset Quotes eld
3881 \end_inset
3882
3883
3884 \begin_inset Formula $\cos^{2}\theta$
3885 \end_inset
3886
3887
3888 \begin_inset Quotes erd
3889 \end_inset
3890
3891  or 
3892 \begin_inset Quotes eld
3893 \end_inset
3894
3895
3896 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3897 \end_inset
3898
3899
3900 \begin_inset Quotes erd
3901 \end_inset
3902
3903 .
3904 \end_layout
3905
3906 \begin_layout Standard
3907
3908 \series bold
3909 Exercise
3910 \series default
3911 : Put equation 3 of 
3912 \family typewriter
3913 example_raw.lyx
3914 \family default
3915  into math mode.
3916 \end_layout
3917
3918 \begin_layout Subsection
3919 Matrices
3920 \end_layout
3921
3922 \begin_layout Standard
3923 Click on the matrix button 
3924 \begin_inset Info
3925 type  "icon"
3926 arg   "dialog-show mathmatrix"
3927 \end_inset
3928
3929  in the 
3930 \family sans
3931 Math
3932 \begin_inset space ~
3933 \end_inset
3934
3935 Toolbar
3936 \family default
3937 .
3938  A pop-up dialog allows you to choose how many rows and columns you want
3939  in your matrix.
3940  Choose 2 rows and 3 columns and hit 
3941 \family sans
3942 OK
3943 \family default
3944 .
3945  LyX prints 6 insertion points in a 
3946 \begin_inset Formula $2\times3$
3947 \end_inset
3948
3949  matrix.
3950  As usual, you can put any sort of formula expression (a square root, another
3951  matrix, etc.) in each insertion point.
3952  You can also leave some of the insertion points empty if you want.
3953 \end_layout
3954
3955 \begin_layout Standard
3956
3957 \family sans
3958 Tab
3959 \family default
3960  can be used to move horizontally between the columns of a matrix.
3961  Alternatively, you can use the arrow keys to move around - hitting 
3962 \family sans
3963 Right
3964 \family default
3965  at the end of one box will move to the next box, 
3966 \family sans
3967 Down
3968 \family default
3969  will move to the next row, etc.
3970 \end_layout
3971
3972 \begin_layout Standard
3973 If you need to change the number of rows and columns, use the menu 
3974 \family sans
3975 Edit\SpecialChar \menuseparator
3976 Rows
3977 \begin_inset space \thinspace{}
3978 \end_inset
3979
3980 &
3981 \begin_inset space \thinspace{}
3982 \end_inset
3983
3984 Columns
3985 \family default
3986  or the math toolbar buttons 
3987 \begin_inset Info
3988 type  "icon"
3989 arg   "inset-modify tabular append-row"
3990 \end_inset
3991
3992
3993 \begin_inset Info
3994 type  "icon"
3995 arg   "inset-modify tabular delete-row"
3996 \end_inset
3997
3998
3999 \begin_inset Info
4000 type  "icon"
4001 arg   "inset-modify tabular append-column"
4002 \end_inset
4003
4004
4005 \begin_inset Info
4006 type  "icon"
4007 arg   "inset-modify tabular delete-column"
4008 \end_inset
4009
4010 .
4011 \end_layout
4012
4013 \begin_layout Standard
4014 See the 
4015 \emph on
4016 User's Guide
4017 \emph default
4018  for information on how to change the horizontal alignment of each column,
4019  and how to change the vertical position of the whole matrix.
4020  Note that if you want to write a table containing text, you should use
4021  LyX's wonderful table support, rather than trying to write text in a matrix.
4022 \end_layout
4023
4024 \begin_layout Subsection
4025 Display mode
4026 \end_layout
4027
4028 \begin_layout Standard
4029 All of the expressions we have written so far have been on the same line
4030  as the text that came before and after them, otherwise known as inline
4031  expressions.
4032  This is fine for short, simple expressions, but if you want to write larger
4033  ones, or if you want your expressions to stand out from the text, you need
4034  to write them in display mode.
4035  In addition, only displayed expressions can be labeled and numbered (see
4036  the 
4037 \emph on
4038 User's Guide
4039 \emph default
4040 ), and multi-line equations must be in display mode.
4041 \end_layout
4042
4043 \begin_layout Standard
4044 While being in a formula, click on the display button 
4045 \begin_inset Info
4046 type  "icon"
4047 arg   "math-display"
4048 \end_inset
4049
4050  in the 
4051 \family sans
4052 Math
4053 \begin_inset space ~
4054 \end_inset
4055
4056 Toolbar
4057 \family default
4058 .
4059  This centers the formula and adds a blank line before and after it.
4060  Now type in an expression and compile your file to see how it looks.
4061  The display button is actually a toggle; use it now to change a couple
4062  of your expressions to display mode and back.
4063  
4064 \end_layout
4065
4066 \begin_layout Standard
4067 Display mode has a couple differences from inline mode:
4068 \end_layout
4069
4070 \begin_layout Itemize
4071 The default font is larger for a few symbols, like 
4072 \begin_inset Formula $\sum$
4073 \end_inset
4074
4075  and 
4076 \begin_inset Formula $\int$
4077 \end_inset
4078
4079
4080 \end_layout
4081
4082 \begin_layout Itemize
4083 Subscripts and superscripts for limits and sums (but not integrals) are
4084  written under and over rather than next to the symbols
4085 \end_layout
4086
4087 \begin_layout Itemize
4088 Text is centered
4089 \end_layout
4090
4091 \begin_layout Standard
4092 Other than these differences, though, displayed expressions and inline expressio
4093 ns are very similar.
4094 \end_layout
4095
4096 \begin_layout Standard
4097 One final note about the way displayed formulas are typeset: be careful
4098  about whether you are putting your equation into a new paragraph or not.
4099  If your formula is in the middle of a sentence or paragraph, then do not
4100  press 
4101 \family sans
4102 Return
4103 \family default
4104 .
4105  Doing so will cause the text 
4106 \emph on
4107 after
4108 \emph default
4109  the formula to start a new paragraph.
4110  That text will be indented or follow a blank line, depending on your document
4111  paragraph settings, which is probably not what you want.
4112 \end_layout
4113
4114 \begin_layout Standard
4115
4116 \series bold
4117 Exercise
4118 \series default
4119 : Put the various equations in 
4120 \family typewriter
4121 example_raw.lyx
4122 \family default
4123  into display mode, and see how they are typeset differently.
4124 \end_layout
4125
4126 \begin_layout Standard
4127
4128 \series bold
4129 Exercise
4130 \series default
4131 : Using various tools you have learned in this section, you should be able
4132  to write an equation like:
4133 \begin_inset Foot
4134 status collapsed
4135
4136 \begin_layout Plain Layout
4137 After you have  done it the hard way, give 
4138 \family sans
4139 Insert\SpecialChar \menuseparator
4140 Math\SpecialChar \menuseparator
4141 Cases
4142 \begin_inset space ~
4143 \end_inset
4144
4145 Environment
4146 \family default
4147  a try.
4148 \end_layout
4149
4150 \end_inset
4151
4152  
4153 \begin_inset Formula 
4154 \[
4155 f(x)=\left\{ \begin{array}{cc}
4156 \log_{8}x & x>0\\
4157 0 & x=0\\
4158 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0
4159 \end{array}\right.
4160 \]
4161
4162 \end_inset
4163
4164
4165 \end_layout
4166
4167 \begin_layout Section
4168 More Math Stuff
4169 \end_layout
4170
4171 \begin_layout Standard
4172 Now you are familiar with the basics.
4173  LyX's math editor can do a lot more.
4174  You can refer to the 
4175 \emph on
4176 Math
4177 \emph default
4178  manual for tips on how to:
4179 \end_layout
4180
4181 \begin_layout Itemize
4182 Label and number expressions.
4183 \end_layout
4184
4185 \begin_layout Itemize
4186 Create multi-line equations.
4187 \end_layout
4188
4189 \begin_layout Itemize
4190 Change typefaces, e.
4191 \begin_inset space \thinspace{}
4192 \end_inset
4193
4194 g.
4195 \begin_inset space \space{}
4196 \end_inset
4197
4198 to write bold-face text in an expression.
4199 \end_layout
4200
4201 \begin_layout Itemize
4202 Fine-tune font sizes and spacing within an expression.
4203  (Do not worry about this until your final draft!)
4204 \end_layout
4205
4206 \begin_layout Itemize
4207 Write macros.
4208  These are very powerful, because you just define them once at the top of
4209  the document, and then you can use them throughout the document.
4210 \end_layout
4211
4212 \begin_layout Itemize
4213 Do almost all you can do with math.
4214 \end_layout
4215
4216 \begin_layout Chapter
4217 Miscellaneous
4218 \end_layout
4219
4220 \begin_layout Section
4221 Other major LyX Features
4222 \end_layout
4223
4224 \begin_layout Standard
4225 We have not gone through all the possible commands in LyX, and we are not
4226  planning on it.
4227  As usual, see the 
4228 \emph on
4229 User's Guide
4230 \emph default
4231  and the 
4232 \emph on
4233 Embedded
4234 \begin_inset space ~
4235 \end_inset
4236
4237 Objects
4238 \emph default
4239  manual for more information.
4240  We will just mention a couple more major things LyX can do:
4241 \end_layout
4242
4243 \begin_layout Itemize
4244 LyX has WYSIWYM support for tables.
4245  Use the 
4246 \family sans
4247 Insert\SpecialChar \menuseparator
4248 Table
4249 \family default
4250  (toolbar button 
4251 \begin_inset Info
4252 type  "icon"
4253 arg   "tabular-insert"
4254 \end_inset
4255
4256 ) to get a table.
4257  Click on the table with the 
4258 \emph on
4259 right button
4260 \emph default
4261  to get a 
4262 \family sans
4263 Table
4264 \begin_inset space ~
4265 \end_inset
4266
4267 Settings
4268 \family default
4269  dialog box which allows extensive table editing.
4270  By pressing 
4271 \begin_inset Info
4272 type  "icon"
4273 arg   "toolbar-toggle table"
4274 \end_inset
4275
4276  the table toolbar will appear permanently.
4277 \end_layout
4278
4279 \begin_layout Itemize
4280 LyX also supports including pictures in any format within documents.
4281  (You guessed it: 
4282 \family sans
4283 Insert\SpecialChar \menuseparator
4284 Graphics
4285 \family default
4286  (toolbar button 
4287 \begin_inset Info
4288 type  "icon"
4289 arg   "dialog-show-new-inset graphics"
4290 \end_inset
4291
4292 ).
4293  Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4294  can have captions, and LyX will automatically generate lists of figures
4295  and/or tables.
4296 \end_layout
4297
4298 \begin_layout Itemize
4299 LyX is heavily configurable.
4300  Everything from how the LyX window looks to how the output comes out can
4301  be configured in a number of ways.
4302  Much configuration is done through 
4303 \family sans
4304 Tools\SpecialChar \menuseparator
4305 Preferences
4306 \family default
4307 .
4308  For more information on this, check out 
4309 \family sans
4310 Help\SpecialChar \menuseparator
4311 Customization\SpecialChar \@.
4312
4313 \end_layout
4314
4315 \begin_layout Itemize
4316 LyX is being developed by a team of programmers on five continents.
4317  Therefore, LyX has better support for non-English languages (such as Dutch,
4318  German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4319 ) than many word processors.
4320  Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4321  languages Chinese Japanese, and Korean are supported.
4322  You can write documents in other languages and you can also configure LyX
4323  to show its menus and error messages in other languages.
4324  
4325 \end_layout
4326
4327 \begin_layout Itemize
4328 The LyX menus feature keybindings.
4329  This means that you can do 
4330 \family sans
4331 File\SpecialChar \menuseparator
4332 Open
4333 \family default
4334  by pressing 
4335 \family sans
4336 Alt+F
4337 \family default
4338  followed by 
4339 \family sans
4340 O
4341 \family default
4342  or by using the binding which is shown next to it in the menu (
4343 \begin_inset Info
4344 type  "shortcut"
4345 arg   "file-open"
4346 \end_inset
4347
4348  by default).
4349  Keybindings are also configurable.
4350  For information on this, check out 
4351 \family sans
4352 Help\SpecialChar \menuseparator
4353 Customization\SpecialChar \@.
4354
4355 \end_layout
4356
4357 \begin_layout Itemize
4358 LyX can read LaTeX documents.
4359  See section
4360 \begin_inset space ~
4361 \end_inset
4362
4363
4364 \begin_inset CommandInset ref
4365 LatexCommand ref
4366 reference "sec:tex2lyx"
4367
4368 \end_inset
4369
4370 .
4371 \end_layout
4372
4373 \begin_layout Itemize
4374 Spell-checking, thesaurus, and word count facilities are available.
4375 \end_layout
4376
4377 \begin_layout Itemize
4378 Generation of indexes and nomenclatures/glossaries is supported.
4379 \end_layout
4380
4381 \begin_layout Section
4382 LyX for LaTeX Users
4383 \begin_inset CommandInset label
4384 LatexCommand label
4385 name "sec:latexusers"
4386
4387 \end_inset
4388
4389
4390 \end_layout
4391
4392 \begin_layout Standard
4393 If you do not know anything about LaTeX, you do not have to read this section.
4394  Actually, you might want to 
4395 \emph on
4396 learn
4397 \emph default
4398  about LaTeX, and then read this chapter.
4399  However, some of those who begin to use LyX will be familiar with LaTeX.
4400  If you are such a person, you may be wondering if LyX can really do everything
4401  LaTeX can do.
4402  The short answer is that LyX can do pretty much everything LaTeX can do
4403  in one form or another, and it definitely simplifies most parts of writing
4404  a LaTeX document.
4405 \end_layout
4406
4407 \begin_layout Standard
4408 Because this is just a tutorial, we are only going to mention things that
4409  new LyX users will most likely be interested in.
4410  In the interests of keeping the Tutorial short, we will give only minimal
4411  information here.
4412  The 
4413 \emph on
4414 Additional
4415 \begin_inset space ~
4416 \end_inset
4417
4418 Features
4419 \emph default
4420  and the 
4421 \emph on
4422 Embedded
4423 \begin_inset space ~
4424 \end_inset
4425
4426 Objects
4427 \emph default
4428  manuals have a great deal of information on differences between LyX and
4429  LaTeX, and how to do various LaTeX tricks in LyX.
4430 \end_layout
4431
4432 \begin_layout Subsection
4433 TeX Mode 
4434 \end_layout
4435
4436 \begin_layout Standard
4437 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4438  will be displayed in red on the screen.
4439  You can use TeX commands in LyX by choosing 
4440 \family sans
4441 Insert\SpecialChar \menuseparator
4442 TeX
4443 \begin_inset space ~
4444 \end_inset
4445
4446 Code
4447 \family default
4448  (toolbar button 
4449 \begin_inset Info
4450 type  "icon"
4451 arg   "ert-insert"
4452 \end_inset
4453
4454 ).
4455  This creates a box where everything within it is passed straight to LaTeX.
4456 \end_layout
4457
4458 \begin_layout Standard
4459 In a math formula, TeX mode is handled a bit differently.
4460  TeX mode is entered there by typing a backslash.
4461  The backslash is not written out, but anything you type afterwards will
4462  be in red.
4463  You exit TeX mode by typing 
4464 \family sans
4465 Space
4466 \family default
4467  or some other non-alphabetic character, like a number, underscore, caret
4468  or parenthesis.
4469  Once you exit TeX mode, if LyX knows the TeX command you have typed in,
4470  it will convert it to WYSIWYM\SpecialChar \@.
4471  So if you type 
4472 \begin_inset Quotes eld
4473 \end_inset
4474
4475
4476 \family typewriter
4477
4478 \backslash
4479 gamma
4480 \family default
4481
4482 \begin_inset Quotes erd
4483 \end_inset
4484
4485  in a formula and then press 
4486 \family sans
4487 Space
4488 \family default
4489 , LyX will change the red 
4490 \begin_inset Quotes eld
4491 \end_inset
4492
4493 gamma
4494 \begin_inset Quotes erd
4495 \end_inset
4496
4497  to a blue 
4498 \begin_inset Quotes eld
4499 \end_inset
4500
4501
4502 \begin_inset Formula $\gamma$
4503 \end_inset
4504
4505
4506 \begin_inset Quotes erd
4507 \end_inset
4508
4509 .
4510  This will work for almost all, non-complicated math macros.
4511  This may be faster than using the 
4512 \family sans
4513 Math
4514 \begin_inset space ~
4515 \end_inset
4516
4517 Toolbar
4518 \family default
4519 , and will be especially convenient for experienced LaTeX users.
4520 \end_layout
4521
4522 \begin_layout Standard
4523 As a special case, if you type 
4524 \begin_inset Quotes eld
4525 \end_inset
4526
4527
4528 \family typewriter
4529
4530 \backslash
4531 {
4532 \family default
4533
4534 \begin_inset Quotes erd
4535 \end_inset
4536
4537  in a formula, the beginning 
4538 \emph on
4539 and
4540 \emph default
4541  ending braces will be inserted in red while the cursor is placed between
4542  the braces.
4543  This makes it more convenient to type those commands that take an argument.
4544 \end_layout
4545
4546 \begin_layout Standard
4547 LyX cannot do absolutely everything that LaTeX can do.
4548  Some fancy functions are not supported at all, while some work but are
4549  not WYSIWYM.
4550  TeX mode allows users to get the full flexibility of LaTeX, while having
4551  all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4552  LyX could never support every LaTeX package.
4553  However, by typing 
4554 \family typewriter
4555
4556 \backslash
4557 usepackage{foo}
4558 \family default
4559  in the preamble (see Section
4560 \begin_inset space ~
4561 \end_inset
4562
4563
4564 \begin_inset CommandInset ref
4565 LatexCommand ref
4566 reference "sec:preamble"
4567
4568 \end_inset
4569
4570 ), you can use any package you want — although you will not have WYSIWYM
4571  support for that package's features.
4572 \end_layout
4573
4574 \begin_layout Subsection
4575 Importing LaTeX Documents — 
4576 \family typewriter
4577 tex2lyx
4578 \family default
4579
4580 \begin_inset CommandInset label
4581 LatexCommand label
4582 name "sec:tex2lyx"
4583
4584 \end_inset
4585
4586
4587 \end_layout
4588
4589 \begin_layout Standard
4590 You can import a LaTeX file into LyX by using the 
4591 \family sans
4592 File\SpecialChar \menuseparator
4593 Import\SpecialChar \menuseparator
4594 LaTeX
4595 \begin_inset space ~
4596 \end_inset
4597
4598 (plain)
4599 \family default
4600  menu in LyX.
4601  This will call the program 
4602 \family typewriter
4603 tex2lyx
4604 \family default
4605  which will create a file foo.lyx from the file foo.tex.
4606  LyX will then open that file.
4607  If the translation does not work, you can try calling 
4608 \family typewriter
4609 tex2lyx
4610 \family default
4611  from the command line, possibly using fancier options.
4612 \end_layout
4613
4614 \begin_layout Standard
4615 Even when the translation does work, 
4616 \family typewriter
4617 tex2lyx
4618 \family default
4619  may not translate everything, though it does handle most legal LaTeX.
4620  It will leave things it does not understand in TeX mode; so, after translating
4621  a file with 
4622 \family typewriter
4623 tex2lyx
4624 \family default
4625 , you can look for the red text and manually edit it to get it right.
4626 \end_layout
4627
4628 \begin_layout Standard
4629
4630 \family typewriter
4631 tex2lyx
4632 \family default
4633  has its own documentation (manpage), which Unix/Linux users can access
4634  via the console command 
4635 \family typewriter
4636 man
4637 \begin_inset space ~
4638 \end_inset
4639
4640 tex2lyx
4641 \family default
4642 .
4643  The manpage describes which LaTeX commands and environments are not supported,
4644  what bugs you might run into (and how to get around them), and how to use
4645  the various options.
4646 \end_layout
4647
4648 \begin_layout Standard
4649 It is important to understand that 
4650 \family typewriter
4651 tex2lyx
4652 \family default
4653  can only translate files whose document class is 
4654 \begin_inset Quotes eld
4655 \end_inset
4656
4657 known
4658 \begin_inset Quotes erd
4659 \end_inset
4660
4661  to LyX, that is, for which there is a corresponding LyX 
4662 \family sans
4663 layout file
4664 \family default
4665 .
4666  If there is no layout file, then you will get an error saying that the
4667  conversion could not be performed.
4668  So, unless you have a layout for the document class of your LaTeX file,
4669  
4670 \family typewriter
4671 tex2lyx
4672 \family default
4673  simply will not know how to translate the LaTeX that it finds there into
4674  things LyX understands.
4675  More about layout files and how they are created is explained in detail
4676  in Chapter 5 of the 
4677 \emph on
4678 Customization
4679 \emph default
4680  manual.
4681 \end_layout
4682
4683 \begin_layout Subsection
4684 Converting LyX Documents to LaTeX
4685 \end_layout
4686
4687 \begin_layout Standard
4688 You might wish to convert a LyX Document to a LaTeX file.
4689  For example, a co-worker or co-author who does not have LyX might want
4690  to read it.
4691  Select 
4692 \family sans
4693 File\SpecialChar \menuseparator
4694 Export\SpecialChar \menuseparator
4695 LaTeX
4696 \family default
4697 .
4698  This will create a file 
4699 \family typewriter
4700 whatever.tex
4701 \family default
4702  from the 
4703 \family typewriter
4704 whatever.lyx
4705 \family default
4706  file you are editing.
4707 \end_layout
4708
4709 \begin_layout Subsection
4710 LaTeX Preamble
4711 \end_layout
4712
4713 \begin_layout Subsubsection
4714 Document Class
4715 \end_layout
4716
4717 \begin_layout Standard
4718 The 
4719 \family sans
4720 Document\SpecialChar \menuseparator
4721 Settings
4722 \family default
4723  dialog takes care of the document-wide options, such as changing the document
4724  class, default font size and paper size.
4725  Document class options and also options for LaTeX packages can be entered
4726  there in the 
4727 \family sans
4728 Class
4729 \begin_inset space ~
4730 \end_inset
4731
4732 options
4733 \family default
4734  area.
4735 \end_layout
4736
4737 \begin_layout Subsubsection
4738 Other Preamble Matter
4739 \begin_inset CommandInset label
4740 LatexCommand label
4741 name "sec:preamble"
4742
4743 \end_inset
4744
4745
4746 \end_layout
4747
4748 \begin_layout Standard
4749 If you have special commands to put in the preamble of a LaTeX file, you
4750  can use them in a LyX document as well.
4751  Select 
4752 \family sans
4753 Document\SpecialChar \menuseparator
4754 Settings\SpecialChar \menuseparator
4755 LaTeX
4756 \begin_inset space ~
4757 \end_inset
4758
4759 Preamble
4760 \family default
4761  and type in the dialog window (or from the document settings dialog, depending
4762  on the frontend).
4763  Anything you type will (as with TeX mode) be sent directly to LaTeX.
4764 \end_layout
4765
4766 \begin_layout Subsection
4767 BibTeX
4768 \end_layout
4769
4770 \begin_layout Standard
4771 LyX has support for BibTeX, which allows you to build databases of bibliographic
4772 al references to be used in multiple documents.
4773  Select 
4774 \family sans
4775 Insert\SpecialChar \menuseparator
4776 List
4777 \begin_inset space \thinspace{}
4778 \end_inset
4779
4780 /
4781 \begin_inset space \thinspace{}
4782 \end_inset
4783
4784 TOC\SpecialChar \menuseparator
4785 BibTeX
4786 \begin_inset space ~
4787 \end_inset
4788
4789 Bibliography
4790 \family default
4791  to include a 
4792 \family typewriter
4793 BibTeX
4794 \family default
4795  file.
4796  In the 
4797 \family sans
4798 Database
4799 \family default
4800  field you load BibTeX files, in the 
4801 \family sans
4802 Style
4803 \family default
4804  field you can load BibTeX style files.
4805 \end_layout
4806
4807 \begin_layout Standard
4808 After you have done this, you can use citations from any bibliographies
4809  you have included with 
4810 \family sans
4811 Insert\SpecialChar \menuseparator
4812 Citation
4813 \family default
4814  (see Section
4815 \begin_inset space ~
4816 \end_inset
4817
4818
4819 \begin_inset CommandInset ref
4820 LatexCommand ref
4821 reference "sec:bibliographies"
4822
4823 \end_inset
4824
4825 ).
4826  The box in the 
4827 \family sans
4828 Citation
4829 \family default
4830  dialog will show a list of all the references in your 
4831 \family typewriter
4832 BibTeX
4833 \family default
4834  file.
4835 \end_layout
4836
4837 \begin_layout Section
4838 Errors!
4839 \end_layout
4840
4841 \begin_layout Standard
4842 Sometimes when you try to view a document, there will be errors, things
4843  that LyX or LaTeX cannot understand.
4844  When this happens, LyX will open a 
4845 \family sans
4846 LaTeX
4847 \begin_inset space ~
4848 \end_inset
4849
4850 Errors
4851 \family default
4852  dialog.
4853  Clicking on individual errors in this dialog will take you to the place
4854  in the LyX document where the error occurs and also display the detailed
4855  LaTeX error message.
4856 \end_layout
4857
4858 \end_body
4859 \end_document