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