]> git.lyx.org Git - lyx.git/blob - lib/doc/Tutorial.lyx
4a3216c245fcc21b352bc844eb4ce4a944f74b3c
[lyx.git] / lib / doc / Tutorial.lyx
1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
2 \lyxformat 413
3 \begin_document
4 \begin_header
5 \textclass book
6 \begin_preamble
7 % DO NOT ALTER THIS PREAMBLE!!!
8 %
9 %This preamble is designed to ensure that the document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the document may not print out as expected.  If you
12 % have problems LaTeXing this file, please contact 
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
15
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
18
19  % set fonts for nicer pdf view
20  \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}
21
22 \fi % end if pdflatex is used
23
24 % the pages of the TOC is numbered roman
25 % and a pdf-bookmark for the TOC is added
26 \let\myTOC\tableofcontents
27 \renewcommand\tableofcontents{%
28   \frontmatter
29   \pdfbookmark[1]{\contentsname}{}
30   \myTOC
31   \mainmatter }
32
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
2388 \begin_inset space ~
2389 \end_inset
2390
2391 2 and this cross-reference you may see 
2392 \begin_inset Quotes eld
2393 \end_inset
2394
2395 on this page
2396 \begin_inset Quotes erd
2397 \end_inset
2398
2399
2400 \begin_inset Quotes eld
2401 \end_inset
2402
2403 on the previous page
2404 \begin_inset Quotes erd
2405 \end_inset
2406
2407  or 
2408 \begin_inset Quotes eld
2409 \end_inset
2410
2411 on page n
2412 \begin_inset Quotes erd
2413 \end_inset
2414
2415  (whereas 
2416 \emph on
2417 n
2418 \emph default
2419  is the page number).
2420 \end_layout
2421
2422 \begin_layout Standard
2423 Conveniently, a cross-reference acts as a hyperlink when you are editing
2424  a document in LyX; clicking on it will pop up the 
2425 \family sans
2426 Cross-reference
2427 \family default
2428  dialog, clicking 
2429 \family sans
2430 Go
2431 \begin_inset space ~
2432 \end_inset
2433
2434 to
2435 \begin_inset space ~
2436 \end_inset
2437
2438 Label
2439 \family default
2440  will move the cursor to the referenced label.
2441 \end_layout
2442
2443 \begin_layout Subsection
2444 More fun with labels
2445 \end_layout
2446
2447 \begin_layout Standard
2448 We told you that LyX takes care about numbering cross-references; now you
2449  can test that.
2450  Add a new section before Section
2451 \begin_inset space ~
2452 \end_inset
2453
2454 2.
2455  Update the DVI view, and â€” voilà! â€” the section cross reference changed
2456  to 
2457 \begin_inset Quotes eld
2458 \end_inset
2459
2460 3
2461 \begin_inset Quotes erd
2462 \end_inset
2463
2464 ! Change the section 
2465 \begin_inset Quotes eld
2466 \end_inset
2467
2468 About this Document
2469 \begin_inset Quotes erd
2470 \end_inset
2471
2472  to a subsection, and the cross-reference will reference Subsection
2473 \begin_inset space ~
2474 \end_inset
2475
2476 2.1 instead of Section
2477 \begin_inset space ~
2478 \end_inset
2479
2480 3.
2481  The page reference will not change unless you add a whole page of text
2482  before the label, of course.
2483  
2484 \end_layout
2485
2486 \begin_layout Standard
2487 If you want some more practice with labels, then try putting a new label
2488  where your first cross-reference was, and refer to that label from elsewhere
2489  in the document.
2490  If you will be inserting cross-references often, it may be convenient to
2491  leave the 
2492 \family sans
2493 Cross-reference
2494 \family default
2495  dialog open.
2496 \end_layout
2497
2498 \begin_layout Standard
2499 If you want to make sure that the cross-referencing gets the pages right
2500  even for larger documents, 
2501 \family sans
2502 Copy
2503 \family default
2504  a couple pages of text from the 
2505 \emph on
2506 User's Guide
2507 \emph default
2508  to the clipboard, and 
2509 \family sans
2510 Paste
2511 \family default
2512  the stolen text into your document.
2513 \begin_inset Foot
2514 status collapsed
2515
2516 \begin_layout Plain Layout
2517 By the way, copying a chapter title may cause an error, because chapters
2518  are not allowed in the article class, see Section
2519 \begin_inset space ~
2520 \end_inset
2521
2522
2523 \begin_inset CommandInset ref
2524 LatexCommand ref
2525 reference "sec:Document-Classes"
2526
2527 \end_inset
2528
2529 .
2530  If this happens, just delete the chapter title.
2531 \end_layout
2532
2533 \end_inset
2534
2535
2536 \end_layout
2537
2538 \begin_layout Standard
2539
2540 \series bold
2541 Exercise
2542 \series default
2543 : Fix the references in 
2544 \family typewriter
2545 example_raw.lyx
2546 \end_layout
2547
2548 \begin_layout Section
2549 Footnotes and Margin Notes
2550 \end_layout
2551
2552 \begin_layout Standard
2553 Footnotes can be added using the toolbar button 
2554 \begin_inset Graphics
2555         filename ../images/footnote-insert.png
2556         scale 75
2557         scaleBeforeRotation
2558
2559 \end_inset
2560
2561  or the menu 
2562 \family sans
2563 Insert\SpecialChar \menuseparator
2564 Footnote
2565 \family default
2566 .
2567  Click at the end of the word 
2568 \begin_inset Quotes eld
2569 \end_inset
2570
2571 LyX
2572 \begin_inset Quotes erd
2573 \end_inset
2574
2575  somewhere in your document and click the 
2576 \begin_inset Graphics
2577         filename ../images/footnote-insert.png
2578         scale 75
2579         scaleBeforeRotation
2580
2581 \end_inset
2582
2583  button.
2584  A footnote box appears where you can enter the text of the footnote.
2585  LyX should place the cursor at the beginning of the footnote box.
2586  Type
2587 \end_layout
2588
2589 \begin_layout LyX-Code
2590 LyX is a typesetting word processor.
2591 \end_layout
2592
2593 \begin_layout Standard
2594 Now click on the button labeled 
2595 \begin_inset Quotes eld
2596 \end_inset
2597
2598 foot
2599 \begin_inset Quotes erd
2600 \end_inset
2601
2602 .
2603  The footnote box is closed, leaving the button showing where the footnote
2604  marker will be in the printed text; this is called 
2605 \begin_inset Quotes eld
2606 \end_inset
2607
2608 folding
2609 \begin_inset Quotes erd
2610 \end_inset
2611
2612  the footnote.
2613  You can unfold the footnote at any time and re-edit its text by clicking
2614  again on the 
2615 \begin_inset Quotes eld
2616 \end_inset
2617
2618 foot
2619 \begin_inset Quotes erd
2620 \end_inset
2621
2622  button.
2623 \end_layout
2624
2625 \begin_layout Standard
2626 A footnote can be cut and pasted like normal text.
2627  Go ahead; try it! All you need to do is select the footnote button
2628 \begin_inset Foot
2629 status collapsed
2630
2631 \begin_layout Plain Layout
2632 It may be easier to select it using the keyboard.
2633  You might accidentally open the footnote if you are trying to select the
2634  marker itself with the mouse.
2635 \end_layout
2636
2637 \end_inset
2638
2639  and 
2640 \family sans
2641 Cut
2642 \family default
2643  and 
2644 \family sans
2645 Paste
2646 \family default
2647  it.
2648  In addition, you can change regular text to a footnote, by selecting it
2649  and hitting the 
2650 \begin_inset Graphics
2651         filename ../images/footnote-insert.png
2652         scale 75
2653         scaleBeforeRotation
2654
2655 \end_inset
2656
2657  button; change a footnote to regular text by hitting the 
2658 \family sans
2659 Backspace
2660 \family default
2661  key when the cursor is in the first position of a footnote, or by hitting
2662  the 
2663 \family sans
2664 Delete
2665 \family default
2666  key when the cursor is in the very last position of the footnote, respectively.
2667 \end_layout
2668
2669 \begin_layout Standard
2670 Margin notes can be added using the menu 
2671 \family sans
2672 Insert\SpecialChar \menuseparator
2673 Marginal
2674 \begin_inset space ~
2675 \end_inset
2676
2677 Note
2678 \family default
2679  or the toolbar button 
2680 \begin_inset Graphics
2681         filename ../images/marginalnote-insert.png
2682         scale 75
2683         scaleBeforeRotation
2684
2685 \end_inset
2686
2687 \SpecialChar \@.
2688  Margin notes are like footnotes, except that: 
2689 \end_layout
2690
2691 \begin_layout Itemize
2692 the on-screen boxes say 
2693 \begin_inset Quotes eld
2694 \end_inset
2695
2696 margin
2697 \begin_inset Quotes erd
2698 \end_inset
2699
2700  instead of 
2701 \begin_inset Quotes eld
2702 \end_inset
2703
2704 foot
2705 \begin_inset Quotes erd
2706 \end_inset
2707
2708
2709 \end_layout
2710
2711 \begin_layout Itemize
2712 the notes will be placed in the margin, instead of below the text 
2713 \end_layout
2714
2715 \begin_layout Itemize
2716 margin notes are not numbered
2717 \end_layout
2718
2719 \begin_layout Standard
2720 Change your LyX footnote back to text, then select and change it to a margin
2721  note.
2722  Run LaTeX again to see what the margin note looks like.
2723 \end_layout
2724
2725 \begin_layout Standard
2726
2727 \series bold
2728 Exercise
2729 \series default
2730 : Fix the footnote in 
2731 \family typewriter
2732 example_raw.lyx
2733 \end_layout
2734
2735 \begin_layout Section
2736 Bibliographies
2737 \begin_inset CommandInset label
2738 LatexCommand label
2739 name "sec:bibliographies"
2740
2741 \end_inset
2742
2743
2744 \end_layout
2745
2746 \begin_layout Standard
2747 Bibliographies (at least in the exact sciences) are similar to cross references.
2748  The bibliography contains a list of references at the end of the document,
2749  and they can be referenced from within the document.
2750  Like section titles, LyX and LaTeX make your job easier by automatically
2751  numbering the bibliography items and changing citations when the item numbers
2752  change.
2753 \end_layout
2754
2755 \begin_layout Standard
2756 Go to the end of the document and switch to the 
2757 \family sans
2758 Bibliography
2759 \family default
2760  environment.
2761  Now, each paragraph you type will be a reference.
2762  Type 
2763 \begin_inset Quotes eld
2764 \end_inset
2765
2766
2767 \family typewriter
2768 The Lyx Tutorial, by the LyX Documentation Team
2769 \family default
2770
2771 \begin_inset Quotes erd
2772 \end_inset
2773
2774  as your first reference.
2775  Note that LyX automatically puts a number in a box before each reference.
2776  Click on the boxed reference number, and the 
2777 \family sans
2778 Bibliography
2779 \begin_inset space ~
2780 \end_inset
2781
2782 item
2783 \family default
2784  dialog box appears.
2785  The 
2786 \family sans
2787 Key
2788 \family default
2789  is to refer to this reference within the LyX document, the 
2790 \family sans
2791 Label
2792 \family default
2793  appears in output.
2794  When no 
2795 \family sans
2796 Label
2797 \family default
2798  is set (default), you will see the number of the bibliography in the output.
2799  Change now the 
2800 \family sans
2801 Key
2802 \family default
2803  field to 
2804 \begin_inset Quotes eld
2805 \end_inset
2806
2807 lyxtutorial
2808 \begin_inset Quotes erd
2809 \end_inset
2810
2811  to make it easy to remember.
2812 \end_layout
2813
2814 \begin_layout Standard
2815 Now pick somewhere in your document that you would like to insert a reference.
2816  Do so with 
2817 \family sans
2818 Insert\SpecialChar \menuseparator
2819 Citation
2820 \family default
2821  or the toolbar button 
2822 \begin_inset Graphics
2823         filename ../images/dialog-show-new-inset_citation.png
2824         scale 75
2825         scaleBeforeRotation
2826
2827 \end_inset
2828
2829 .
2830  A 
2831 \family sans
2832 Citation
2833 \family default
2834  dialog appears.
2835  The right panel in this dialog lists all the bibliography entries, and
2836  this field allows you to choose which bibliography item you want to cite.
2837  Select 
2838 \begin_inset Quotes eld
2839 \end_inset
2840
2841 lyxtutorial
2842 \begin_inset Quotes erd
2843 \end_inset
2844
2845  (right now, that is the only item in the bibliography), then use the 
2846 \family sans
2847 Add
2848 \family default
2849  button in the center to insert it.
2850  (You can have multiple citations in the same place by transferring a number
2851  of keys this way.) Now view your file as DVI, and you will see that the
2852  citation appears in brackets in the text, referring to the bibliography
2853  at the end of the document.
2854 \end_layout
2855
2856 \begin_layout Standard
2857 The 
2858 \family sans
2859 Text
2860 \begin_inset space ~
2861 \end_inset
2862
2863 after
2864 \family default
2865  field in the 
2866 \family sans
2867 Citation
2868 \family default
2869  dialog will put a remark (such as a reference to a page or chapter within
2870  the referenced book or article) in the brackets after the reference.
2871  If you want the references to have labels instead of numbers in the printed
2872  output (for example, some journals would use 
2873 \begin_inset Quotes eld
2874 \end_inset
2875
2876 [Smi95]
2877 \begin_inset Quotes erd
2878 \end_inset
2879
2880  to refer to a paper written by Smith in 1995), use the 
2881 \family sans
2882 Label
2883 \family default
2884  field in the 
2885 \family sans
2886 Bibliography
2887 \begin_inset space ~
2888 \end_inset
2889
2890 item
2891 \family default
2892  dialog.
2893  As usual, see the 
2894 \emph on
2895 User's Guide
2896 \emph default
2897  for details.
2898 \end_layout
2899
2900 \begin_layout Standard
2901
2902 \series bold
2903 Exercise:
2904 \series default
2905  Fix the bibliography and citation in 
2906 \family typewriter
2907 example_raw.lyx
2908 \end_layout
2909
2910 \begin_layout Section
2911 Table of Contents
2912 \end_layout
2913
2914 \begin_layout Standard
2915 You may want to put a table of contents at the beginning of your document.
2916  LyX makes this very easy to do.
2917  Just hit 
2918 \family sans
2919 Return
2920 \family default
2921  after your document title and before your first section title and choose
2922  
2923 \family sans
2924 Insert\SpecialChar \menuseparator
2925 List
2926 \begin_inset space ~
2927 \end_inset
2928
2929 /
2930 \begin_inset space ~
2931 \end_inset
2932
2933 TOC\SpecialChar \menuseparator
2934 Table
2935 \begin_inset space ~
2936 \end_inset
2937
2938 of
2939 \begin_inset space ~
2940 \end_inset
2941
2942 Contents
2943 \family default
2944 .
2945  The words 
2946 \begin_inset Quotes eld
2947 \end_inset
2948
2949 Table of Contents
2950 \begin_inset Quotes erd
2951 \end_inset
2952
2953  will appear in a button on the first line of the document.
2954  
2955 \end_layout
2956
2957 \begin_layout Standard
2958 This may not appear to be very useful.
2959  However, if you look at your DVI file, you will see that a table of contents
2960  has been generated, listing the various sections and subsections in your
2961  document.
2962  As usual, if you reorder sections or create new ones, you will see those
2963  changes in the DVI file when you update it.
2964  
2965 \end_layout
2966
2967 \begin_layout Standard
2968 The table of contents is not printed in the on-screen version of the document.
2969  But you can display the table of contents in a separate window by clicking
2970  on the table of contents button, or by using 
2971 \family sans
2972 Document\SpecialChar \menuseparator
2973 Outline
2974 \family default
2975  or the toolbar button 
2976 \begin_inset Graphics
2977         filename ../images/dialog-toggle_toc.png
2978         scale 75
2979         scaleBeforeRotation
2980
2981 \end_inset
2982
2983 .
2984  This menu will work even if you do not have a table of contents inset in
2985  your document.
2986  This is a very useful tool for moving around your document parts.
2987  Clicking on a (sub)section title in the 
2988 \family sans
2989 Outline
2990 \family default
2991  window will highlight that line and move the display (in the LyX editing
2992  window) to that place in the document.
2993  You can also use the arrow keys to move up and down in the table of contents.
2994  You may therefore find it convenient to leave this window open throughout
2995  editing sessions.
2996  You can get similar functionality from the 
2997 \family sans
2998 Navigate
2999 \family default
3000  menu, though, where the table of contents appears automatically.
3001 \end_layout
3002
3003 \begin_layout Standard
3004 To get rid of the Table of Contents, you can delete the table of contents
3005  button just like any other text.
3006 \end_layout
3007
3008 \begin_layout Standard
3009
3010 \series bold
3011 Exercise
3012 \series default
3013 : Fix the table of contents in 
3014 \family typewriter
3015 example_raw.lyx
3016 \end_layout
3017
3018 \begin_layout Chapter
3019 Using Math
3020 \end_layout
3021
3022 \begin_layout Standard
3023 LaTeX is used by many scientists because it outputs great looking equations,
3024  avoiding the control characters used by word processors and their equation
3025  editors.
3026  Many of these scientists are frustrated, however, because writing equations
3027  in LaTeX is more like programming than writing.
3028  Happily, LyX has WYSIWYM support for equations.
3029  If you are used to LaTeX, you will find that all of the usual LaTeX math
3030  commands can be typed in normally, but they will show up in a WYSIWYM fashion.
3031  If, on the other hand, you have  never written in LaTeX, then the 
3032 \family sans
3033 Math
3034 \begin_inset space ~
3035 \end_inset
3036
3037 Panel
3038 \family default
3039  will allow you to write professional-looking math quickly and easily.
3040 \end_layout
3041
3042 \begin_layout Section
3043 Math Mode
3044 \end_layout
3045
3046 \begin_layout Standard
3047 Somewhere in your LyX document, type: 
3048 \end_layout
3049
3050 \begin_layout LyX-Code
3051 I like what Einstein said, E=mc^2, because it is so simple.
3052  
3053 \end_layout
3054
3055 \begin_layout Standard
3056 Now, that equation does not look very good in LyX and in the output; there
3057  is no space between the letters and the equals sign, and you would like
3058  to write an actual superscript for the 
3059 \begin_inset Quotes eld
3060 \end_inset
3061
3062 2
3063 \begin_inset Quotes erd
3064 \end_inset
3065
3066 .
3067  That bad typesetting happened because we did not tell LyX that we were
3068  writing a mathematical expression, so it typeset the equation like regular
3069  old text.
3070 \end_layout
3071
3072 \begin_layout Standard
3073 Instead, we create a formula that will get typeset properly.
3074  In order to create a formula, just click the toolbar button 
3075 \begin_inset Graphics
3076         filename ../images/math-mode.png
3077         scale 75
3078         scaleBeforeRotation
3079
3080 \end_inset
3081
3082  or use the menu 
3083 \family sans
3084 Insert\SpecialChar \menuseparator
3085 Math\SpecialChar \menuseparator
3086 Inline
3087 \begin_inset space ~
3088 \end_inset
3089
3090 Formula
3091 \family default
3092 .
3093  LyX will insert a little blue square, which is an empty math formula.
3094  Now just type 
3095 \family typewriter
3096 E=mc^2
3097 \family default
3098  again.
3099  The expression is typed in blue, and the blue square disappears as soon
3100  as the formula is not empty.
3101  Now type 
3102 \family sans
3103 Esc
3104 \family default
3105  to leave the equation The purple markers disappear, leaving the cursor
3106  to the right of the expression, and now if you type something, it will
3107  be regular text.
3108 \end_layout
3109
3110 \begin_layout Standard
3111 Looking at the output you will notice that the expression was typeset nicely,
3112  with spaces between the letters and the equals sign, and a superscript
3113  
3114 \begin_inset Quotes eld
3115 \end_inset
3116
3117 2
3118 \begin_inset Quotes erd
3119 \end_inset
3120
3121 .
3122  Letters in math mode are assumed to be variables, and come out in italics.
3123  Numbers are just numbers.
3124 \end_layout
3125
3126 \begin_layout Standard
3127 This math editor is another example of the WYSIWYM philosophy.
3128  In LaTeX, you write a mathematical expression using text and commands like
3129  
3130 \family typewriter
3131
3132 \backslash
3133 sqrt
3134 \family default
3135 ; this can be frustrating, because you cannot see what an expression looks
3136  like until you run the file under LaTeX and you may have to spend time
3137  finding e.
3138 \begin_inset space \thinspace{}
3139 \end_inset
3140
3141 g.
3142 \begin_inset space \space{}
3143 \end_inset
3144
3145 missing brackets.
3146  LyX does not attempt to get the expression to look perfect (WYSIWYG), but
3147  it gives you an extremely good idea of what the expression will look like.
3148  LaTeX then takes care of the professional typesetting.
3149 \end_layout
3150
3151 \begin_layout Section
3152 Navigating an Equation
3153 \end_layout
3154
3155 \begin_layout Standard
3156 Now let us change 
3157 \begin_inset Formula $E=mc^{2}$
3158 \end_inset
3159
3160  to 
3161 \begin_inset Formula $E=1+mc^{2}$
3162 \end_inset
3163
3164 .
3165  Use the arrow keys to move the cursor into the expression.
3166  Note that when you enter the expression, the purple markers appear to let
3167  you know you are editing math.
3168  Now you can use 
3169 \family sans
3170 Left
3171 \family default
3172  and 
3173 \family sans
3174 Right
3175 \family default
3176  to move the cursor past the equals sign, and just type 
3177 \begin_inset Quotes eld
3178 \end_inset
3179
3180 1+
3181 \begin_inset Quotes erd
3182 \end_inset
3183
3184 .
3185  Again, you can use the arrow keys or 
3186 \family sans
3187 Esc
3188 \family default
3189  to leave the formula\SpecialChar \@.
3190
3191 \end_layout
3192
3193 \begin_layout Standard
3194 Other than the special keys described below, typing in math mode is like
3195  editing regular text.
3196  Use 
3197 \family sans
3198 Delete
3199 \family default
3200  (or 
3201 \family sans
3202 Backspace
3203 \family default
3204 ) to delete things.
3205  Select text either with the arrow keys or with the mouse.
3206  
3207 \family sans
3208 Edit\SpecialChar \menuseparator
3209 Undo
3210 \family default
3211  works in math mode as well as cut and paste.
3212  One thing to be careful of: if you are left or right outside a formula
3213  and you press 
3214 \family sans
3215 Delete
3216 \family default
3217  or 
3218 \family sans
3219 Backspace
3220 \family default
3221  respectively, you delete the whole formula.
3222  Luckily, you can just use 
3223 \family sans
3224 Undo
3225 \family default
3226  to get it back.
3227 \end_layout
3228
3229 \begin_layout Standard
3230 What if you want to change 
3231 \begin_inset Formula $E=mc^{2}$
3232 \end_inset
3233
3234  to 
3235 \begin_inset Formula $E=mc^{2.5}+1$
3236 \end_inset
3237
3238 ? Again, you can use the mouse to click in the right place.
3239  However, you can also use the arrow keys.
3240  If the cursor is just after the 
3241 \begin_inset Quotes eld
3242 \end_inset
3243
3244 c
3245 \begin_inset Quotes erd
3246 \end_inset
3247
3248  but before the 
3249 \begin_inset Quotes eld
3250 \end_inset
3251
3252 2
3253 \begin_inset Quotes erd
3254 \end_inset
3255
3256 , then press 
3257 \family sans
3258 Up
3259 \family default
3260  and the cursor is moved to the level of the superscript, just before the
3261  
3262 \begin_inset Quotes eld
3263 \end_inset
3264
3265 2
3266 \begin_inset Quotes erd
3267 \end_inset
3268
3269 .
3270  Add the 
3271 \begin_inset Quotes eld
3272 \end_inset
3273
3274 .5
3275 \begin_inset Quotes erd
3276 \end_inset
3277
3278 .
3279  Now, hitting 
3280 \family sans
3281 Down
3282 \family default
3283  will move the cursor back to the regular level.
3284  If you hit 
3285 \family sans
3286 Space
3287 \family default
3288  instead of 
3289 \family sans
3290 Down
3291 \family default
3292 , the cursor will be placed 
3293 \emph on
3294 after
3295 \emph default
3296  the superscript (so that you can then type the 
3297 \begin_inset Quotes eld
3298 \end_inset
3299
3300 +1
3301 \begin_inset Quotes erd
3302 \end_inset
3303
3304 ).
3305 \end_layout
3306
3307 \begin_layout Section
3308 Exponents and Indices
3309 \end_layout
3310
3311 \begin_layout Standard
3312 An exponent can be entered from the 
3313 \family sans
3314 Math
3315 \begin_inset space ~
3316 \end_inset
3317
3318 Toolbar
3319 \family default
3320  (see below), but it is actually simpler just to type the caret key, 
3321 \begin_inset Quotes eld
3322 \end_inset
3323
3324 ^
3325 \begin_inset Quotes erd
3326 \end_inset
3327
3328 .
3329  LyX will place another blue rectangle in the superscript, so that whatever
3330  you write next will be superscripted, and in a smaller font size.
3331  Everything you type until you hit a 
3332 \family sans
3333 Space
3334 \family default
3335  (or 
3336 \family sans
3337 Esc
3338 \family default
3339  to exit the formula entirely) will be in the superscript.
3340 \end_layout
3341
3342 \begin_layout Standard
3343 Writing a subscript (index) is just easy; start one by typing the underscore
3344  key 
3345 \begin_inset Quotes eld
3346 \end_inset
3347
3348 _
3349 \begin_inset Quotes erd
3350 \end_inset
3351
3352  .
3353  You can subscript and superscript both subscripts and superscripts like
3354  this: 
3355 \begin_inset Formula $A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}}$
3356 \end_inset
3357
3358 .
3359  
3360 \end_layout
3361
3362 \begin_layout Standard
3363
3364 \series bold
3365 Exercise
3366 \series default
3367 : Put equation 1 of 
3368 \family typewriter
3369 example_raw.lyx
3370 \family default
3371  into math mode.
3372 \end_layout
3373
3374 \begin_layout Section
3375 The Math toolbar
3376 \end_layout
3377
3378 \begin_layout Standard
3379 The 
3380 \family sans
3381 Math
3382 \begin_inset space ~
3383 \end_inset
3384
3385 toolbar
3386 \family default
3387  is a convenient way to enter symbols or to perform complicated formula
3388  operations.
3389  Many of these operations can be accomplished from the keyboard or the 
3390 \family sans
3391 Edit\SpecialChar \menuseparator
3392 Math
3393 \family default
3394  or 
3395 \family sans
3396 Insert\SpecialChar \menuseparator
3397 Math
3398 \family default
3399  menus.
3400  However, we are going to concentrate on using the 
3401 \family sans
3402 Math
3403 \begin_inset space ~
3404 \end_inset
3405
3406 toolbar
3407 \family default
3408 , just to let you know what is out there; you can learn keyboard shortcuts
3409  and commands later from the 
3410 \emph on
3411 Math
3412 \emph default
3413  manual.
3414 \end_layout
3415
3416 \begin_layout Standard
3417 The 
3418 \family sans
3419 Math
3420 \begin_inset space ~
3421 \end_inset
3422
3423 toolbar
3424 \family default
3425  is shown when the cursor is in a formula and can also be turned on manually
3426  in the menu 
3427 \family sans
3428 View\SpecialChar \menuseparator
3429 Toolbars
3430 \family default
3431 .
3432  When you click there on 
3433 \begin_inset Quotes eld
3434 \end_inset
3435
3436 Math
3437 \begin_inset Quotes erd
3438 \end_inset
3439
3440  the toolbar will be shown permanently at the bottom; this state is visualized
3441  in the 
3442 \family sans
3443 Toolbars
3444 \family default
3445  menu with a checkmark.
3446  When you click in this state again on 
3447 \begin_inset Quotes eld
3448 \end_inset
3449
3450 Math
3451 \begin_inset Quotes erd
3452 \end_inset
3453
3454  in the 
3455 \family sans
3456 Toolbars
3457 \family default
3458  menu, the 
3459 \family sans
3460 math toolbar
3461 \family default
3462  is only shown when the cursor is within a formula; this state is visualized
3463  by the renaming of the menu entry from 
3464 \begin_inset Quotes eld
3465 \end_inset
3466
3467 Math
3468 \begin_inset Quotes erd
3469 \end_inset
3470
3471  to 
3472 \begin_inset Quotes eld
3473 \end_inset
3474
3475 Math
3476 \begin_inset space ~
3477 \end_inset
3478
3479 (auto)
3480 \begin_inset Quotes erd
3481 \end_inset
3482
3483 .
3484 \end_layout
3485
3486 \begin_layout Subsection
3487 Greek and symbols
3488 \end_layout
3489
3490 \begin_layout Standard
3491 The 
3492 \family sans
3493 Math
3494 \begin_inset space ~
3495 \end_inset
3496
3497 toolbar
3498 \family default
3499  allows you to choose from a large array of symbols used in math: operators,
3500  arrows, relationships, delimiters, special characters, sums and integrals.
3501  Note that subscripting and superscripting allow you to put lower and upper
3502  limits on sums and integrals.
3503  
3504 \end_layout
3505
3506 \begin_layout Subsection
3507 Square roots, accents, and delimiters
3508 \end_layout
3509
3510 \begin_layout Standard
3511 To type a square root, just click on the button 
3512 \begin_inset Graphics
3513         filename ../images/math/sqrt.png
3514         scale 75
3515         scaleBeforeRotation
3516
3517 \end_inset
3518
3519 .
3520  The square root appears, and the cursor is in a new insertion point inside
3521  the square root.
3522  You can type variables, numbers, other square roots, fractions, whatever
3523  you want.
3524  LyX will automatically resize the square root to fit what is inside.
3525 \end_layout
3526
3527 \begin_layout Standard
3528 Accenting a character (
3529 \begin_inset Formula $\overrightarrow{v}$
3530 \end_inset
3531
3532 ) or group of characters (
3533 \begin_inset Formula $\overrightarrow{a+b}$
3534 \end_inset
3535
3536 ) is done the same way.
3537  Decorations are available from the toolbar via the button 
3538 \begin_inset Graphics
3539         filename ../images/math/hat.png
3540         scale 75
3541         scaleBeforeRotation
3542
3543 \end_inset
3544
3545 .
3546  Click on a decoration, and LyX will insert that decoration with an insertion
3547  point under (or over) it.
3548  Just type what you want in the insertion point.
3549  There are two sets of decorations: those that resize with the text you
3550  type, and those that have a fixed size, and are most appropriate for a
3551  single letter.
3552  
3553 \end_layout
3554
3555 \begin_layout Standard
3556 Delimiters such as parentheses, brackets, and braces work similarly, but
3557  are a bit more complicated.
3558  Hit the delimiter button 
3559 \begin_inset Graphics
3560         filename ../images/dialog-show_mathdelimiter.png
3561         scale 75
3562         scaleBeforeRotation
3563
3564 \end_inset
3565
3566  to pop up the 
3567 \family sans
3568 Delimiter
3569 \family default
3570  dialog.
3571  Your current selection of delimiters is displayed in a box.
3572  It is a pair of parentheses by default, but you can choose a pair of braces,
3573  a brace and a parenthesis, or choose the empty square to have something
3574  like 
3575 \begin_inset Quotes eld
3576 \end_inset
3577
3578
3579 \begin_inset Formula $a=\left\langle 7\right.$
3580 \end_inset
3581
3582
3583 \begin_inset Quotes erd
3584 \end_inset
3585
3586  (the empty delimiter is displayed as a broken line in LyX, but will not
3587  show up in the output).
3588 \end_layout
3589
3590 \begin_layout Standard
3591 If you are lazy, you can type actual parentheses in math mode, rather than
3592  using the 
3593 \family sans
3594 Delimiter
3595 \family default
3596  dialog.
3597  However, those parentheses will be the same size as regular text, which
3598  will look bad if you have a big fraction or matrix inside the parentheses.
3599  So it is better in this case to use one of the three delimiter buttons
3600  that insert directly e.
3601 \begin_inset space \thinspace{}
3602 \end_inset
3603
3604 g.
3605 \begin_inset space \space{}
3606 \end_inset
3607
3608 a (
3609 \begin_inset space \thinspace{}
3610 \end_inset
3611
3612 ) pair.
3613 \end_layout
3614
3615 \begin_layout Standard
3616 You can also put delimiters or a square root sign or a decoration on already
3617  existing formula parts.
3618  Select the portion of the formula that you want to adjust, and then click
3619  on the button you want from the 
3620 \family sans
3621 Math
3622 \begin_inset space ~
3623 \end_inset
3624
3625 Toolbar
3626 \family default
3627 .
3628  Try using this to change Newton's second law from scalar to vector form
3629  (
3630 \begin_inset Formula $f=ma$
3631 \end_inset
3632
3633  to 
3634 \begin_inset Formula $\overrightarrow{f}=m\overrightarrow{a}$
3635 \end_inset
3636
3637 ).
3638  Once you have  learned about matrices, this is how you will put parentheses
3639  or brackets around them.
3640 \end_layout
3641
3642 \begin_layout Subsection
3643 Fractions
3644 \end_layout
3645
3646 \begin_layout Standard
3647 To create a fraction, click on the fraction button 
3648 \begin_inset Graphics
3649         filename ../images/math/frac.png
3650         lyxscale 75
3651         scale 60
3652         scaleBeforeRotation
3653
3654 \end_inset
3655
3656  in the 
3657 \family sans
3658 Math
3659 \begin_inset space ~
3660 \end_inset
3661
3662 Toolbar
3663 \family default
3664 .
3665  LyX writes two insertion points in a fraction.
3666  As you would expect, you can use arrow keys or the mouse to move around
3667  a fraction.
3668  Click on the top square and type 
3669 \begin_inset Quotes eld
3670 \end_inset
3671
3672 1
3673 \begin_inset Quotes erd
3674 \end_inset
3675
3676 .
3677  Now hit 
3678 \family sans
3679 Down
3680 \family default
3681  and type 
3682 \begin_inset Quotes eld
3683 \end_inset
3684
3685 2
3686 \begin_inset Quotes erd
3687 \end_inset
3688
3689 .
3690  You have made a fraction! Of course you can type anything within each of
3691  the two boxes: variables with exponents, square roots, other fractions,
3692  whatever.
3693  
3694 \end_layout
3695
3696 \begin_layout Standard
3697
3698 \series bold
3699 Exercise
3700 \series default
3701 : Put equation 2 of 
3702 \family typewriter
3703 example_raw.lyx
3704 \family default
3705  into math mode.
3706 \end_layout
3707
3708 \begin_layout Subsection
3709 Functions: lim, log, sin and others
3710 \end_layout
3711
3712 \begin_layout Standard
3713 Because letters in math mode are considered to be variables, if you type
3714  
3715 \begin_inset Quotes eld
3716 \end_inset
3717
3718 sin
3719 \begin_inset Quotes erd
3720 \end_inset
3721
3722  in math mode, LyX thinks you are typing the product of the three variables
3723  
3724 \begin_inset Formula $s$
3725 \end_inset
3726
3727
3728 \begin_inset Formula $i$
3729 \end_inset
3730
3731 , and 
3732 \begin_inset Formula $n$
3733 \end_inset
3734
3735 .
3736  The three letters will be typeset in italics, when what you really wanted
3737  was the word 
3738 \begin_inset Quotes eld
3739 \end_inset
3740
3741 sin
3742 \begin_inset Quotes erd
3743 \end_inset
3744
3745  typeset in Roman.
3746  In addition, LyX will not put a space between the word 
3747 \begin_inset Quotes eld
3748 \end_inset
3749
3750 sin
3751 \begin_inset Quotes erd
3752 \end_inset
3753
3754  and the 
3755 \begin_inset Quotes eld
3756 \end_inset
3757
3758 x
3759 \begin_inset Quotes erd
3760 \end_inset
3761
3762  (pressing 
3763 \family sans
3764 Space
3765 \family default
3766  will exit the formula).
3767  So how do you get 
3768 \begin_inset Quotes eld
3769 \end_inset
3770
3771
3772 \begin_inset Formula $\sin(x)$
3773 \end_inset
3774
3775
3776 \begin_inset Quotes erd
3777 \end_inset
3778
3779  instead of 
3780 \begin_inset Quotes eld
3781 \end_inset
3782
3783
3784 \begin_inset Formula $sin(x)$
3785 \end_inset
3786
3787
3788 \begin_inset Quotes erd
3789 \end_inset
3790
3791 ?
3792 \end_layout
3793
3794 \begin_layout Standard
3795 Click on the 
3796 \family sans
3797 Math
3798 \begin_inset space ~
3799 \end_inset
3800
3801 Toolbar
3802 \family default
3803  button 
3804 \begin_inset Graphics
3805         filename ../images/math/functions.png
3806         scale 75
3807         scaleBeforeRotation
3808
3809 \end_inset
3810
3811  and then on 
3812 \begin_inset Quotes eld
3813 \end_inset
3814
3815 sin
3816 \begin_inset Quotes erd
3817 \end_inset
3818
3819  in the appearing function list.
3820  The word 
3821 \begin_inset Quotes eld
3822 \end_inset
3823
3824 sin
3825 \begin_inset Quotes erd
3826 \end_inset
3827
3828  is displayed in LyX in black, and set in upright roman type.
3829  The whole word is treated as one symbol, so if you type 
3830 \family sans
3831 Backspace
3832 \family default
3833 , it will delete the whole word.
3834  Now type 
3835 \begin_inset Quotes eld
3836 \end_inset
3837
3838 (x)
3839 \begin_inset Quotes erd
3840 \end_inset
3841
3842 , which will be written in blue italics, like you expect in a formula.
3843  In the output, the expression will be correctly typeset.
3844  Try it out.
3845 \end_layout
3846
3847 \begin_layout Standard
3848 The function list includes other trigonometric functions and their inverses,
3849  hyperbolic functions, logarithms, limits, and quite a few others.
3850  These functions can take subscripts and superscripts, important for typing
3851  
3852 \begin_inset Quotes eld
3853 \end_inset
3854
3855
3856 \begin_inset Formula $\cos^{2}\theta$
3857 \end_inset
3858
3859
3860 \begin_inset Quotes erd
3861 \end_inset
3862
3863  or 
3864 \begin_inset Quotes eld
3865 \end_inset
3866
3867
3868 \begin_inset Formula $\lim_{n\rightarrow\infty}$
3869 \end_inset
3870
3871
3872 \begin_inset Quotes erd
3873 \end_inset
3874
3875 .
3876 \end_layout
3877
3878 \begin_layout Standard
3879
3880 \series bold
3881 Exercise
3882 \series default
3883 : Put equation 3 of 
3884 \family typewriter
3885 example_raw.lyx
3886 \family default
3887  into math mode.
3888 \end_layout
3889
3890 \begin_layout Subsection
3891 Matrices
3892 \end_layout
3893
3894 \begin_layout Standard
3895 Click on the matrix button 
3896 \begin_inset Graphics
3897         filename ../images/dialog-show_mathmatrix.png
3898         scale 75
3899         scaleBeforeRotation
3900
3901 \end_inset
3902
3903  in the 
3904 \family sans
3905 Math
3906 \begin_inset space ~
3907 \end_inset
3908
3909 Toolbar
3910 \family default
3911 .
3912  The appearing dialog allows you to choose how many rows and columns you
3913  want in your matrix.
3914  Choose 2 rows and 3 columns and hit 
3915 \family sans
3916 OK
3917 \family default
3918 .
3919  LyX prints 6 insertion points in a 
3920 \begin_inset Formula $2\times3$
3921 \end_inset
3922
3923  matrix.
3924  As usual, you can put any sort of formula expression (a square root, another
3925  matrix, etc.) in each insertion point.
3926  You can also leave some of the insertion points empty if you want.
3927 \end_layout
3928
3929 \begin_layout Standard
3930
3931 \family sans
3932 Tab
3933 \family default
3934  can be used to move horizontally between the columns of a matrix.
3935  Alternatively, you can use the arrow keys to move around - hitting 
3936 \family sans
3937 Right
3938 \family default
3939  at the end of one box will move to the next box, 
3940 \family sans
3941 Down
3942 \family default
3943  will move to the next row, etc.
3944 \end_layout
3945
3946 \begin_layout Standard
3947 If you need to change the number of rows and columns, use the menu 
3948 \family sans
3949 Edit\SpecialChar \menuseparator
3950 Rows
3951 \begin_inset space \thinspace{}
3952 \end_inset
3953
3954 &
3955 \begin_inset space \thinspace{}
3956 \end_inset
3957
3958 Columns
3959 \family default
3960  or the math toolbar buttons 
3961 \begin_inset Graphics
3962         filename ../images/tabular-feature_append-row.png
3963         scale 75
3964         scaleBeforeRotation
3965
3966 \end_inset
3967
3968
3969 \begin_inset Graphics
3970         filename ../images/tabular-feature_delete-row.png
3971         scale 75
3972         scaleBeforeRotation
3973
3974 \end_inset
3975
3976
3977 \begin_inset Graphics
3978         filename ../images/tabular-feature_append-column.png
3979         scale 75
3980         scaleBeforeRotation
3981
3982 \end_inset
3983
3984
3985 \begin_inset Graphics
3986         filename ../images/tabular-feature_delete-column.png
3987         scale 75
3988         scaleBeforeRotation
3989
3990 \end_inset
3991
3992 .
3993 \end_layout
3994
3995 \begin_layout Standard
3996 See the 
3997 \emph on
3998 User's Guide
3999 \emph default
4000  for information on how to change the horizontal alignment of each column,
4001  and how to change the vertical position of the whole matrix.
4002  Note that if you want to write a table containing text, you should use
4003  LyX's wonderful table support, rather than trying to write text in a matrix.
4004 \end_layout
4005
4006 \begin_layout Subsection
4007 Display mode
4008 \end_layout
4009
4010 \begin_layout Standard
4011 All of the expressions we have written so far have been on the same line
4012  as the text that came before and after them, otherwise known as inline
4013  expressions.
4014  This is fine for short, simple expressions, but if you want to write larger
4015  ones, or if you want your expressions to stand out from the text, you need
4016  to write them in display mode.
4017  In addition, only displayed expressions can be labeled and numbered (see
4018  the 
4019 \emph on
4020 User's Guide
4021 \emph default
4022 ), and multi-line equations must be in display mode.
4023 \end_layout
4024
4025 \begin_layout Standard
4026 While being in a formula, click on the display button 
4027 \begin_inset Graphics
4028         filename ../images/math-display.png
4029         scale 75
4030         scaleBeforeRotation
4031
4032 \end_inset
4033
4034  in the 
4035 \family sans
4036 Math
4037 \begin_inset space ~
4038 \end_inset
4039
4040 Toolbar
4041 \family default
4042 .
4043  This centers the formula and adds a blank line before and after it.
4044  Now type in an expression and compile your file to see how it looks.
4045  The display button is actually a toggle; use it now to change a couple
4046  of your expressions to display mode and back.
4047  
4048 \end_layout
4049
4050 \begin_layout Standard
4051 Display mode has a couple differences from inline mode:
4052 \end_layout
4053
4054 \begin_layout Itemize
4055 The default font is larger for a few symbols, like 
4056 \begin_inset Formula $\sum$
4057 \end_inset
4058
4059  and 
4060 \begin_inset Formula $\int$
4061 \end_inset
4062
4063
4064 \end_layout
4065
4066 \begin_layout Itemize
4067 Subscripts and superscripts for limits and sums (but not integrals) are
4068  written under and over rather than next to the symbols
4069 \end_layout
4070
4071 \begin_layout Itemize
4072 Text is centered
4073 \end_layout
4074
4075 \begin_layout Standard
4076 Other than these differences, though, displayed expressions and inline expressio
4077 ns are very similar.
4078 \end_layout
4079
4080 \begin_layout Standard
4081 One final note about the way displayed formulas are typeset: Be careful
4082  about whether you are putting your equation into a new paragraph or not.
4083  If your formula is in the middle of a sentence or paragraph, then do not
4084  press 
4085 \family sans
4086 Return
4087 \family default
4088 .
4089  Doing so will cause the text 
4090 \emph on
4091 after
4092 \emph default
4093  the formula to start a new paragraph.
4094  That text will be indented or follow a blank line, depending on your document
4095  paragraph settings, which is probably not what you want.
4096 \end_layout
4097
4098 \begin_layout Standard
4099
4100 \series bold
4101 Exercise
4102 \series default
4103 : Put the various equations in 
4104 \family typewriter
4105 example_raw.lyx
4106 \family default
4107  into display mode, and see how they are typeset differently.
4108 \end_layout
4109
4110 \begin_layout Standard
4111
4112 \series bold
4113 Exercise
4114 \series default
4115 : Using various tools you have  learned in this section, you should be able
4116  to write an equation like:
4117 \begin_inset Foot
4118 status collapsed
4119
4120 \begin_layout Plain Layout
4121 After you have  done it the hard way, give 
4122 \family sans
4123 Insert\SpecialChar \menuseparator
4124 Math\SpecialChar \menuseparator
4125 Cases
4126 \begin_inset space ~
4127 \end_inset
4128
4129 Environment
4130 \family default
4131  a try.
4132 \end_layout
4133
4134 \end_inset
4135
4136  
4137 \begin_inset Formula 
4138 \[
4139 f(x)=\left\{ \begin{array}{cc}
4140 \log_{8}x & x>0\\
4141 0 & x=0\\
4142 \sum_{i=1}^{5}\alpha_{i}+\sqrt{-\frac{1}{x}} & x<0
4143 \end{array}\right.
4144 \]
4145
4146 \end_inset
4147
4148
4149 \end_layout
4150
4151 \begin_layout Section
4152 More Math Stuff
4153 \end_layout
4154
4155 \begin_layout Standard
4156 LyX's math editor can do a lot more.
4157  Now you are familiar with the basics, you can refer to the 
4158 \emph on
4159 User's Guide
4160 \emph default
4161  for tips on how to:
4162 \end_layout
4163
4164 \begin_layout Itemize
4165 Label and number expressions
4166 \end_layout
4167
4168 \begin_layout Itemize
4169 Create multi-line equations
4170 \end_layout
4171
4172 \begin_layout Itemize
4173 Change typefaces, e.
4174 \begin_inset space \thinspace{}
4175 \end_inset
4176
4177 g.
4178 \begin_inset space \space{}
4179 \end_inset
4180
4181 to write bold-face text in an expression.
4182 \end_layout
4183
4184 \begin_layout Itemize
4185 Fine-tune font sizes and spacing within an expression.
4186  (Do not worry about this until your final draft!)
4187 \end_layout
4188
4189 \begin_layout Itemize
4190 Write macros.
4191  These are very powerful, because you just define them once at the top of
4192  the document, and then you can use them throughout the document.
4193 \end_layout
4194
4195 \begin_layout Itemize
4196 Do lots of other things that we have no space for in this Tutorial.
4197 \end_layout
4198
4199 \begin_layout Chapter
4200 Miscellaneous
4201 \end_layout
4202
4203 \begin_layout Section
4204 Other major LyX Features
4205 \end_layout
4206
4207 \begin_layout Standard
4208 We have not gone through all the possible commands in LyX, and we are not
4209  planning on it.
4210  As usual, see the 
4211 \emph on
4212 User's Guide
4213 \emph default
4214  and the 
4215 \emph on
4216 Embedded
4217 \begin_inset space ~
4218 \end_inset
4219
4220 Objects
4221 \emph default
4222  manual for more information.
4223  We will just mention a couple more major things LyX can do:
4224 \end_layout
4225
4226 \begin_layout Itemize
4227 LyX has WYSIWYM support for tables.
4228  Use the 
4229 \family sans
4230 Insert\SpecialChar \menuseparator
4231 Table
4232 \family default
4233  (toolbar button 
4234 \begin_inset Graphics
4235         filename ../images/tabular-insert.png
4236         scale 75
4237         scaleBeforeRotation
4238
4239 \end_inset
4240
4241 ) to get a table.
4242  Click on the table with the 
4243 \emph on
4244 right button
4245 \emph default
4246  to get a 
4247 \family sans
4248 Table
4249 \begin_inset space ~
4250 \end_inset
4251
4252 Settings
4253 \family default
4254  dialog box which allows extensive table editing.
4255 \end_layout
4256
4257 \begin_layout Itemize
4258 LyX also supports including pictures in any format within documents.
4259  (You guessed it: 
4260 \family sans
4261 Insert\SpecialChar \menuseparator
4262 Graphics
4263 \family default
4264  (toolbar button 
4265 \begin_inset Graphics
4266         filename ../images/dialog-show-new-inset_graphics.png
4267         scale 75
4268         scaleBeforeRotation
4269
4270 \end_inset
4271
4272 ).
4273  Then browse for the figure file, rotate or scale it, etc.) Tables and figures
4274  can have captions, and LyX will automatically generate lists of figures
4275  and/or tables.
4276 \end_layout
4277
4278 \begin_layout Itemize
4279 LyX is heavily configurable.
4280  Everything from how the LyX window looks to how the output comes out can
4281  be configured in a number of ways.
4282  Much configuration is done through 
4283 \family sans
4284 Tools\SpecialChar \menuseparator
4285 Preferences
4286 \family default
4287 .
4288  For more information on this, check out 
4289 \family sans
4290 Help\SpecialChar \menuseparator
4291 Customization\SpecialChar \@.
4292
4293 \end_layout
4294
4295 \begin_layout Itemize
4296 LyX is being developed by a team of programmers on five continents.
4297  Therefore, LyX has better support for non-English languages (such as Dutch,
4298  German, French, Greek, Czech, Turkish, \SpecialChar \ldots{}
4299 ) than many word processors.
4300  Even the right-to-left languages Arabic, Farsi, and Hebrew and the Asian
4301  languages Chinese Japanese, and Korean are supported.
4302  You can write documents in other languages and you can also configure LyX
4303  to show its menus and error messages in other languages.
4304  
4305 \end_layout
4306
4307 \begin_layout Itemize
4308 The LyX menus feature keybindings.
4309  This means that you can do 
4310 \family sans
4311 File\SpecialChar \menuseparator
4312 Open
4313 \family default
4314  by pressing 
4315 \family sans
4316 Alt+F
4317 \family default
4318  followed by 
4319 \family sans
4320 O
4321 \family default
4322  or by using the binding which is shown next to it in the menu (Ctrl+O by
4323  default).
4324  Keybindings are also configurable.
4325  For information on this, check out 
4326 \family sans
4327 Help\SpecialChar \menuseparator
4328 Customization\SpecialChar \@.
4329
4330 \end_layout
4331
4332 \begin_layout Itemize
4333 LyX can read LaTeX documents.
4334  See section
4335 \begin_inset space ~
4336 \end_inset
4337
4338
4339 \begin_inset CommandInset ref
4340 LatexCommand ref
4341 reference "sec:tex2lyx"
4342
4343 \end_inset
4344
4345 .
4346 \end_layout
4347
4348 \begin_layout Itemize
4349 Spell-checking, thesaurus, and word count facilities are available.
4350 \end_layout
4351
4352 \begin_layout Itemize
4353 Generation of indexes and nomenclatures/glossaries is supported.
4354 \end_layout
4355
4356 \begin_layout Section
4357 LyX for LaTeX Users
4358 \begin_inset CommandInset label
4359 LatexCommand label
4360 name "sec:latexusers"
4361
4362 \end_inset
4363
4364
4365 \end_layout
4366
4367 \begin_layout Standard
4368 If you do not know anything about LaTeX, you do not have to read this section.
4369  Actually, you might want to 
4370 \emph on
4371 learn
4372 \emph default
4373  about LaTeX, and then read this chapter.
4374  However, some who begin to use LyX will be familiar with LaTeX.
4375  If you are such a person, you may be wondering if LyX can really do everything
4376  LaTeX can do.
4377  The short answer is that LyX can do pretty much everything LaTeX can do
4378  in one form or another, and it definitely simplifies most parts of writing
4379  a LaTeX document.
4380 \end_layout
4381
4382 \begin_layout Standard
4383 Because this is just a tutorial, we are only going to mention things that
4384  new LyX users will most likely be interested in.
4385  In the interests of keeping the Tutorial short, we will give only minimal
4386  information here.
4387  The 
4388 \emph on
4389 Additional
4390 \begin_inset space ~
4391 \end_inset
4392
4393 Features
4394 \emph default
4395  and the 
4396 \emph on
4397 Embedded
4398 \begin_inset space ~
4399 \end_inset
4400
4401 Objects
4402 \emph default
4403  manual have a great deal of information on differences between LyX and
4404  LaTeX, and how to do various LaTeX tricks in LyX.
4405 \end_layout
4406
4407 \begin_layout Subsection
4408 TeX Mode 
4409 \end_layout
4410
4411 \begin_layout Standard
4412 Anything that you enter in TeX mode will be passed straight to LaTeX, and
4413  will be displayed in red on the screen.
4414  You can use TeX commands in LyX by choosing 
4415 \family sans
4416 Insert\SpecialChar \menuseparator
4417 TeX
4418 \begin_inset space ~
4419 \end_inset
4420
4421 Code
4422 \family default
4423  (toolbar button 
4424 \begin_inset Graphics
4425         filename ../images/ert-insert.png
4426         scale 75
4427         scaleBeforeRotation
4428
4429 \end_inset
4430
4431 ).
4432  This creates a box where everything within it is passed straight to LaTeX.
4433 \end_layout
4434
4435 \begin_layout Standard
4436 In a math formula, TeX mode is handled a bit differently.
4437  TeX mode is there entered by typing a backslash.
4438  The backslash is not written out, but anything you type afterwards will
4439  be in red.
4440  You exit TeX mode by typing 
4441 \family sans
4442 Space
4443 \family default
4444  or some other non-alphabetic character, like a number, underscore, caret,
4445  or parenthesis.
4446  Once you exit TeX mode, if LyX knows the TeX command you have  typed in,
4447  it will convert it to WYSIWYM\SpecialChar \@.
4448  So if you type 
4449 \begin_inset Quotes eld
4450 \end_inset
4451
4452
4453 \family typewriter
4454
4455 \backslash
4456 gamma
4457 \family default
4458
4459 \begin_inset Quotes erd
4460 \end_inset
4461
4462  in a formula and then press 
4463 \family sans
4464 Space
4465 \family default
4466 , LyX will change the red 
4467 \begin_inset Quotes eld
4468 \end_inset
4469
4470 gamma
4471 \begin_inset Quotes erd
4472 \end_inset
4473
4474  to a blue 
4475 \begin_inset Quotes eld
4476 \end_inset
4477
4478
4479 \begin_inset Formula $\gamma$
4480 \end_inset
4481
4482
4483 \begin_inset Quotes erd
4484 \end_inset
4485
4486 .
4487  This will work for almost all, non-complicated math macros.
4488  This may be faster than using the 
4489 \family sans
4490 Math
4491 \begin_inset space ~
4492 \end_inset
4493
4494 Toolbar
4495 \family default
4496 , and will be especially convenient for experienced LaTeX users.
4497 \end_layout
4498
4499 \begin_layout Standard
4500 As a special case, if you type 
4501 \begin_inset Quotes eld
4502 \end_inset
4503
4504
4505 \family typewriter
4506
4507 \backslash
4508 {
4509 \family default
4510
4511 \begin_inset Quotes erd
4512 \end_inset
4513
4514  in a formula, the beginning 
4515 \emph on
4516 and
4517 \emph default
4518  ending braces will be inserted in red while the cursor is placed between
4519  the braces.
4520  This makes it more convenient to type those commands which take an argument.
4521 \end_layout
4522
4523 \begin_layout Standard
4524 LyX cannot do absolutely everything that LaTeX can do.
4525  Some fancy functions are not supported at all, while some work but are
4526  not WYSIWYM.
4527  TeX mode allows users to get the full flexibility of LaTeX, while having
4528  all the convenient features of LyX, like WYSIWYM math, tables, and editing.
4529  LyX could never support every LaTeX package.
4530  However, by typing 
4531 \family typewriter
4532
4533 \backslash
4534 usepackage{foo}
4535 \family default
4536  in the preamble (see Section
4537 \begin_inset space ~
4538 \end_inset
4539
4540
4541 \begin_inset CommandInset ref
4542 LatexCommand ref
4543 reference "sec:preamble"
4544
4545 \end_inset
4546
4547 ), you can use any package you want â€” although you will not have WYSIWYM
4548  support for that package's features.
4549 \end_layout
4550
4551 \begin_layout Subsection
4552 Importing LaTeX Documents â€” 
4553 \family typewriter
4554 tex2lyx
4555 \family default
4556
4557 \begin_inset CommandInset label
4558 LatexCommand label
4559 name "sec:tex2lyx"
4560
4561 \end_inset
4562
4563
4564 \end_layout
4565
4566 \begin_layout Standard
4567 You can import a LaTeX file into LyX by using the 
4568 \family sans
4569 File\SpecialChar \menuseparator
4570 Import\SpecialChar \menuseparator
4571 LaTeX
4572 \begin_inset space ~
4573 \end_inset
4574
4575 (plain)
4576 \family default
4577  menu in LyX.
4578  This will call the program 
4579 \family typewriter
4580 tex2lyx
4581 \family default
4582  which will create a file foo.lyx from the file foo.tex.
4583  LyX will then open that file.
4584  If the translation does not work, you can try calling 
4585 \family typewriter
4586 tex2lyx
4587 \family default
4588  from the command line, possibly using fancier options.
4589 \end_layout
4590
4591 \begin_layout Standard
4592 Even when the translation does work, 
4593 \family typewriter
4594 tex2lyx
4595 \family default
4596  may not translate everything, though it does handle most legal LaTeX.
4597  It will leave things it does not understand in TeX mode; so, after translating
4598  a file with 
4599 \family typewriter
4600 tex2lyx
4601 \family default
4602 , you can look for the red text and manually edit it to get it right.
4603 \end_layout
4604
4605 \begin_layout Standard
4606
4607 \family typewriter
4608 tex2lyx
4609 \family default
4610  has its own documentation (manpage), which Unix/Linux users can access
4611  via the console command 
4612 \family typewriter
4613 man
4614 \begin_inset space ~
4615 \end_inset
4616
4617 tex2lyx
4618 \family default
4619 .
4620  The manpage describes which LaTeX commands and environments are not supported,
4621  what bugs you might run into (and how to get around them), and how to use
4622  the various options.
4623 \end_layout
4624
4625 \begin_layout Standard
4626 It is important to understand that 
4627 \family typewriter
4628 tex2lyx
4629 \family default
4630  can only translate files whose document class is 
4631 \begin_inset Quotes eld
4632 \end_inset
4633
4634 known
4635 \begin_inset Quotes erd
4636 \end_inset
4637
4638  to LyX, that is, for which there is a corresponding LyX 
4639 \family sans
4640 layout file
4641 \family default
4642 .
4643  If there is no layout file, then you will get an error saying that the
4644  conversion could not be performed.
4645  So, unless you have a layout for the document class of your LaTeX file,
4646  
4647 \family typewriter
4648 tex2lyx
4649 \family default
4650  simply will not know how to translate the LaTeX that it finds there into
4651  things LyX understands.
4652  More about layout files and how they are created is explained in detail
4653  in Chapter 5 of the 
4654 \emph on
4655 Customization
4656 \emph default
4657  manual.
4658 \end_layout
4659
4660 \begin_layout Subsection
4661 Converting LyX Documents to LaTeX
4662 \end_layout
4663
4664 \begin_layout Standard
4665 You might wish to convert a LyX Document to a LaTeX file.
4666  For example, a co-worker or co-author who does not have LyX might want
4667  to read it.
4668  Select 
4669 \family sans
4670 File\SpecialChar \menuseparator
4671 Export\SpecialChar \menuseparator
4672 LaTeX
4673 \family default
4674 .
4675  This will create a file 
4676 \family typewriter
4677 whatever.tex
4678 \family default
4679  from the 
4680 \family typewriter
4681 whatever.lyx
4682 \family default
4683  file you are editing.
4684  LyX always creates temporary LaTeX files when viewing or printing files.
4685 \end_layout
4686
4687 \begin_layout Subsection
4688 LaTeX Preamble
4689 \end_layout
4690
4691 \begin_layout Subsubsection
4692 Document Class
4693 \end_layout
4694
4695 \begin_layout Standard
4696 The 
4697 \family sans
4698 Document\SpecialChar \menuseparator
4699 Settings
4700 \family default
4701  dialog takes care of the document-wide options.
4702  You can change there the document class, default font size and paper size.
4703  Document class options but also options for LaTeX packages can be entered
4704  there in the 
4705 \family sans
4706 Class
4707 \begin_inset space ~
4708 \end_inset
4709
4710 options
4711 \family default
4712  area.
4713 \end_layout
4714
4715 \begin_layout Subsubsection
4716 Other Preamble Matter
4717 \begin_inset CommandInset label
4718 LatexCommand label
4719 name "sec:preamble"
4720
4721 \end_inset
4722
4723
4724 \end_layout
4725
4726 \begin_layout Standard
4727 If you have special commands to put in the preamble of a LaTeX file, you
4728  can use them in a LyX document as well.
4729  Select 
4730 \family sans
4731 Document\SpecialChar \menuseparator
4732 Settings\SpecialChar \menuseparator
4733 LaTeX
4734 \begin_inset space ~
4735 \end_inset
4736
4737 Preamble
4738 \family default
4739  and type in the dialog window (or from the document settings dialog, depending
4740  on the frontend).
4741  Anything you type will (as with TeX mode) be sent directly to LaTeX.
4742 \end_layout
4743
4744 \begin_layout Subsection
4745 BibTeX
4746 \end_layout
4747
4748 \begin_layout Standard
4749 LyX has support for BibTeX, which allows you to build databases of bibliographic
4750 al references to be used in multiple documents.
4751  Select 
4752 \family sans
4753 Insert\SpecialChar \menuseparator
4754 List
4755 \begin_inset space \thinspace{}
4756 \end_inset
4757
4758 /
4759 \begin_inset space \thinspace{}
4760 \end_inset
4761
4762 TOC\SpecialChar \menuseparator
4763 BibTeX
4764 \begin_inset space ~
4765 \end_inset
4766
4767 Bibliography
4768 \family default
4769  to include a 
4770 \family typewriter
4771 BibTeX
4772 \family default
4773  file.
4774  In the 
4775 \family sans
4776 Database
4777 \family default
4778  field you load BibTeX files, in the 
4779 \family sans
4780 Style
4781 \family default
4782  field you can load BibTeX style files.
4783 \end_layout
4784
4785 \begin_layout Standard
4786 After you have done this, you can use citations from any bibliographies
4787  you are including with 
4788 \family sans
4789 Insert\SpecialChar \menuseparator
4790 Citation
4791 \family default
4792  (see Section
4793 \begin_inset space ~
4794 \end_inset
4795
4796
4797 \begin_inset CommandInset ref
4798 LatexCommand ref
4799 reference "sec:bibliographies"
4800
4801 \end_inset
4802
4803 ).
4804  LyX will take care of running BibTeX.
4805  The box in the 
4806 \family sans
4807 Citation
4808 \family default
4809  dialog will show a list of all the references in your 
4810 \family typewriter
4811 BibTeX
4812 \family default
4813  file.
4814 \end_layout
4815
4816 \begin_layout Section
4817 Errors!
4818 \end_layout
4819
4820 \begin_layout Standard
4821 Sometimes when you try to view a document, there will be errors, things
4822  that LyX or LaTeX cannot understand.
4823  When this happens, LyX will open a 
4824 \family sans
4825 LaTeX
4826 \begin_inset space ~
4827 \end_inset
4828
4829 Errors
4830 \family default
4831  dialog.
4832  Clicking on individual errors in this dialog will take you to the place
4833  in the LyX document where the error occurs and also display the detailed
4834  LaTeX error message.
4835 \end_layout
4836
4837 \end_body
4838 \end_document