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