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