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