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