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