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