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