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