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