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