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