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