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