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