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