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