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