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