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