]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
79ff898d6ae140fd8b7935165d9071e23d9602b3
[lyx.git] / lib / doc / Customization.lyx
1 #LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
2 \lyxformat 344
3 \begin_document
4 \begin_header
5 \textclass scrbook
6 \begin_preamble
7 % DO NOT ALTER THIS PREAMBLE!!!
8 %
9 % This preamble is designed to ensure that the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected.  If you
12 % have problems LaTeXing this file, please contact 
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
15
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
18
19  % set fonts for nicer pdf view
20  \IfFileExists{lmodern.sty}
21   {\usepackage{lmodern}}{}
22
23 \fi % end if pdflatex is used
24
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
29   \frontmatter
30   \pdfbookmark[1]{\contentsname}{}
31   \myTOC
32   \mainmatter }
33
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36   L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
37   {LyX }}
38
39 % used for multi-column text
40 \usepackage{multicol}
41 \usepackage{inputenc}
42 \end_preamble
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
45 \begin_modules
46 logicalmkup
47 \end_modules
48 \begin_local_layout
49 Format 7
50 InsetLayout CharStyle:MenuItem
51 LyxType               charstyle
52 LabelString           menu
53 LatexType             command
54 LatexName             menuitem
55 Font
56 Family              Sans
57 EndFont
58 Preamble
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
60 EndPreamble
61 End
62 \end_local_layout
63 \language english
64 \inputencoding auto
65 \font_roman default
66 \font_sans default
67 \font_typewriter default
68 \font_default_family default
69 \font_sc false
70 \font_osf false
71 \font_sf_scale 100
72 \font_tt_scale 100
73
74 \graphics default
75 \paperfontsize 12
76 \spacing single
77 \use_hyperref true
78 \pdf_title "LyX Configuration Manual"
79 \pdf_author "LyX Team"
80 \pdf_subject "LyX-documentation Customization"
81 \pdf_keywords "LyX, documentation, customization"
82 \pdf_bookmarks true
83 \pdf_bookmarksnumbered true
84 \pdf_bookmarksopen true
85 \pdf_bookmarksopenlevel 1
86 \pdf_breaklinks false
87 \pdf_pdfborder false
88 \pdf_colorlinks true
89 \pdf_backref false
90 \pdf_pdfusetitle false
91 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
92 \papersize default
93 \use_geometry false
94 \use_amsmath 0
95 \use_esint 0
96 \cite_engine basic
97 \use_bibtopic false
98 \paperorientation portrait
99 \branch OutDated
100 \selected 0
101 \color #f5fae7
102 \end_branch
103 \secnumdepth 3
104 \tocdepth 3
105 \paragraph_separation indent
106 \defskip medskip
107 \quotes_language english
108 \papercolumns 1
109 \papersides 2
110 \paperpagestyle headings
111 \tracking_changes false
112 \output_changes false
113 \author "" 
114 \author "" 
115 \end_header
116
117 \begin_body
118
119 \begin_layout Title
120 Customizing LyX: Features for the Advanced User
121 \end_layout
122
123 \begin_layout Author
124 by the LyX Team
125 \begin_inset Foot
126 status open
127
128 \begin_layout Plain Layout
129 \noindent
130 If you have comments or error corrections, please send them to the LyX Documenta
131 tion mailing list, 
132 \begin_inset CommandInset href
133 LatexCommand href
134 target "lyx-docs@lists.lyx.org"
135 type "mailto:"
136
137 \end_inset
138
139 .
140  Include 
141 \begin_inset Quotes eld
142 \end_inset
143
144 [Customization]
145 \begin_inset Quotes erd
146 \end_inset
147
148  in the subject header, and please cc the current maintainer of this file,
149  Richard Heck <rgheck@comcast.net>.
150 \end_layout
151
152 \end_inset
153
154  
155 \end_layout
156
157 \begin_layout Standard
158 \begin_inset CommandInset toc
159 LatexCommand tableofcontents
160
161 \end_inset
162
163
164 \end_layout
165
166 \begin_layout Chapter
167 Introduction
168 \end_layout
169
170 \begin_layout Standard
171 This manual covers the customization features present in LyX.
172  In it, we discuss issues like keyboard shortcuts, screen previewing options,
173  printer options, sending commands to LyX via the LyX Server, internationalizati
174 on, installing new LaTeX classes and LyX layouts, etc.
175  We can't possibly hope to touch on everything you can change---our developers
176  add new features faster than we can document them---but we will explain
177  the most common customizations and hopefully point you in the right direction
178  for some of the more obscure ones.
179 \end_layout
180
181 \begin_layout Standard
182 \begin_inset Branch OutDated
183 status collapsed
184
185 \begin_layout Standard
186 Information from previous versions of this document that now seems to be
187  outdated is contained in the OutDated branch of this document.
188  By default, this information will not appear in the LaTeX output.
189 \end_layout
190
191 \end_inset
192
193
194 \end_layout
195
196 \begin_layout Chapter
197 LyX configuration files
198 \end_layout
199
200 \begin_layout Standard
201 This chapter aims to help you to find your way through the LyX configuration
202  files.
203  Before continuing to read this chapter, you should find out where your
204  LyX library and user directories are by using 
205 \begin_inset Flex CharStyle:MenuItem
206 status collapsed
207
208 \begin_layout Plain Layout
209
210 \bar under
211 H
212 \bar default
213 elp\SpecialChar \menuseparator
214 About
215 \begin_inset space ~
216 \end_inset
217
218 Ly
219 \bar under
220 X
221 \end_layout
222
223 \end_inset
224
225 .
226  The library directory is the place where LyX places its system-wide configurati
227 on files; the user directory is where you can place your modified versions.
228  We will call the former 
229 \begin_inset Flex CharStyle:Code
230 status collapsed
231
232 \begin_layout Plain Layout
233 LyXDir
234 \end_layout
235
236 \end_inset
237
238  and the latter 
239 \begin_inset Flex CharStyle:MenuItem
240 status collapsed
241
242 \begin_layout Plain Layout
243 UserDir
244 \end_layout
245
246 \end_inset
247
248  in the remainder of this document.
249  
250 \end_layout
251
252 \begin_layout Section
253 What's in 
254 \begin_inset Flex CharStyle:Code
255 status collapsed
256
257 \begin_layout Plain Layout
258 LyXDir
259 \end_layout
260
261 \end_inset
262
263 ?
264 \end_layout
265
266 \begin_layout Standard
267 \begin_inset Flex CharStyle:Code
268 status collapsed
269
270 \begin_layout Plain Layout
271 LyXDir
272 \end_layout
273
274 \end_inset
275
276  and its sub-directories contain a number of files and that can be used
277  to customise LyX's behaviour.
278  You can change many of these files from within LyX itself through the 
279 \begin_inset Flex CharStyle:MenuItem
280 status collapsed
281
282 \begin_layout Plain Layout
283 Tools\SpecialChar \menuseparator
284 Preferences
285 \end_layout
286
287 \end_inset
288
289  dialog.
290  Most customization that you will want to do in LyX is possible through
291  this dialog.
292  However, many other inner aspects of LyX can be customized by modifying
293  the files in 
294 \begin_inset Flex CharStyle:Code
295 status collapsed
296
297 \begin_layout Plain Layout
298 LyXDir
299 \end_layout
300
301 \end_inset
302
303 .
304  These files fall in different categories, described in the following subsection
305 s.
306 \end_layout
307
308 \begin_layout Subsection
309 Automatically generated files
310 \end_layout
311
312 \begin_layout Standard
313 The files, which are to be found in 
314 \begin_inset Flex CharStyle:MenuItem
315 status collapsed
316
317 \begin_layout Plain Layout
318 UserDir
319 \end_layout
320
321 \end_inset
322
323 , are generated when you configure LyX.
324  They contain various default values that are guessed by inspection.
325  In general, it is not a good idea to modify them, since they might be overwritt
326 en at any time.
327 \end_layout
328
329 \begin_layout Labeling
330 \labelwidthstring 00.00.0000
331 \begin_inset Flex CharStyle:Code
332 status collapsed
333
334 \begin_layout Plain Layout
335 lyxrc.defaults
336 \end_layout
337
338 \end_inset
339
340  contains defaults for various commands.
341 \end_layout
342
343 \begin_layout Labeling
344 \labelwidthstring 00.00.0000
345 \begin_inset Flex CharStyle:Code
346 status collapsed
347
348 \begin_layout Plain Layout
349 packages.lst
350 \end_layout
351
352 \end_inset
353
354  contains the list of packages that have been recognized by LyX.
355  It is currently unused by the LyX program itself, but the information extracted
356 , and more, is made available with 
357 \begin_inset Flex CharStyle:MenuItem
358 status collapsed
359
360 \begin_layout Plain Layout
361
362 \bar under
363 H
364 \bar default
365 elp\SpecialChar \menuseparator
366 L
367 \bar under
368 a
369 \bar default
370 TeX
371 \begin_inset space ~
372 \end_inset
373
374 Configuration
375 \end_layout
376
377 \end_inset
378
379 .
380 \end_layout
381
382 \begin_layout Labeling
383 \labelwidthstring 00.00.0000
384 \begin_inset Flex CharStyle:Code
385 status collapsed
386
387 \begin_layout Plain Layout
388 textclass.lst
389 \end_layout
390
391 \end_inset
392
393  the list of text classes that have been found in your 
394 \begin_inset Flex CharStyle:Code
395 status collapsed
396
397 \begin_layout Plain Layout
398 layout/
399 \end_layout
400
401 \end_inset
402
403  directories, along with the associated LaTeX document class and their descripti
404 on.
405 \end_layout
406
407 \begin_layout Labeling
408 \labelwidthstring 00.00.0000
409 \begin_inset Flex CharStyle:Code
410 status collapsed
411
412 \begin_layout Plain Layout
413 lyxmodules.lst
414 \end_layout
415
416 \end_inset
417
418  the list of layout modules found in your 
419 \begin_inset Flex CharStyle:Code
420 status collapsed
421
422 \begin_layout Plain Layout
423 layout/
424 \end_layout
425
426 \end_inset
427
428  directories
429 \end_layout
430
431 \begin_layout Labeling
432 \labelwidthstring 00.00.0000
433 \begin_inset Flex CharStyle:Code
434 status collapsed
435
436 \begin_layout Plain Layout
437 *files.lst
438 \end_layout
439
440 \end_inset
441
442  lists of various sorts of LaTeX-related files found on your system
443 \end_layout
444
445 \begin_layout Labeling
446 \labelwidthstring 00.00.0000
447 \begin_inset Flex CharStyle:Code
448 status collapsed
449
450 \begin_layout Plain Layout
451 doc/LaTeXConfig.lyx
452 \end_layout
453
454 \end_inset
455
456  is automatically generated during configuration from the file 
457 \begin_inset Flex CharStyle:Code
458 status collapsed
459
460 \begin_layout Plain Layout
461 LaTeXConfig.lyx.in
462 \end_layout
463
464 \end_inset
465
466 .
467  It contains information on your LaTeX configuration.
468 \end_layout
469
470 \begin_layout Subsection
471 Directories
472 \end_layout
473
474 \begin_layout Standard
475 These directories are duplicated between 
476 \begin_inset Flex CharStyle:Code
477 status collapsed
478
479 \begin_layout Plain Layout
480 LyXDir
481 \end_layout
482
483 \end_inset
484
485  and 
486 \begin_inset Flex CharStyle:Code
487 status collapsed
488
489 \begin_layout Plain Layout
490 UserDir
491 \end_layout
492
493 \end_inset
494
495 .
496  If a particular files exists in both places, the one in 
497 \begin_inset Flex CharStyle:Code
498 status collapsed
499
500 \begin_layout Plain Layout
501 UserDir
502 \end_layout
503
504 \end_inset
505
506  will be used.
507 \end_layout
508
509 \begin_layout Labeling
510 \labelwidthstring 00.00.0000
511 \begin_inset Flex CharStyle:Code
512 status collapsed
513
514 \begin_layout Plain Layout
515 bind/
516 \end_layout
517
518 \end_inset
519
520  this directory contains files with the extension 
521 \begin_inset Flex CharStyle:Code
522 status collapsed
523
524 \begin_layout Plain Layout
525 .bind
526 \end_layout
527
528 \end_inset
529
530  that define the keybindings used in LyX.
531  If there exists an internationalized version of the bind file named 
532 \begin_inset Flex CharStyle:Code
533 status collapsed
534
535 \begin_layout Plain Layout
536 $LANG_xxx.bind
537 \end_layout
538
539 \end_inset
540
541 , that will be used first.
542 \end_layout
543
544 \begin_layout Labeling
545 \labelwidthstring 00.00.0000
546 \begin_inset Flex CharStyle:Code
547 status collapsed
548
549 \begin_layout Plain Layout
550 clipart/
551 \end_layout
552
553 \end_inset
554
555  contains graphics files that can be included in documents.
556  
557 \end_layout
558
559 \begin_layout Labeling
560 \labelwidthstring 00.00.0000
561 \begin_inset Flex CharStyle:Code
562 status collapsed
563
564 \begin_layout Plain Layout
565 doc/
566 \end_layout
567
568 \end_inset
569
570  contains LyX documentation files (including the one you are currently reading).
571  The file 
572 \begin_inset Flex CharStyle:Code
573 status collapsed
574
575 \begin_layout Plain Layout
576 LaTeXConfig.lyx
577 \end_layout
578
579 \end_inset
580
581  deserves special attention, as noted above.
582  If there exists an internationalized version of the help-document with
583  
584 \begin_inset Flex CharStyle:Code
585 status collapsed
586
587 \begin_layout Plain Layout
588 $LANG_
589 \end_layout
590
591 \end_inset
592
593  prepended to the name, that will be used first.
594  See Chapter
595 \begin_inset space ~
596 \end_inset
597
598
599 \begin_inset CommandInset ref
600 LatexCommand ref
601 reference "chap:i18n"
602
603 \end_inset
604
605  for details.
606 \end_layout
607
608 \begin_layout Labeling
609 \labelwidthstring 00.00.0000
610 \begin_inset Flex CharStyle:Code
611 status collapsed
612
613 \begin_layout Plain Layout
614 examples/
615 \end_layout
616
617 \end_inset
618
619  contains example files that explain how to use some features.
620  In the file browser, press the 
621 \begin_inset Flex CharStyle:MenuItem
622 status collapsed
623
624 \begin_layout Plain Layout
625 Examples
626 \end_layout
627
628 \end_inset
629
630  button to get there.
631 \end_layout
632
633 \begin_layout Labeling
634 \labelwidthstring 00.00.0000
635 \begin_inset Flex CharStyle:Code
636 status collapsed
637
638 \begin_layout Plain Layout
639 images/
640 \end_layout
641
642 \end_inset
643
644  contains image files that are used by the 
645 \begin_inset Flex CharStyle:MenuItem
646 status collapsed
647
648 \begin_layout Plain Layout
649 Document
650 \end_layout
651
652 \end_inset
653
654  dialog.
655  In addition, it also contains the individual icons used in the toolbar
656  and the banners that can be shown when LyX is launched.
657 \end_layout
658
659 \begin_layout Labeling
660 \labelwidthstring 00.00.0000
661 \begin_inset Flex CharStyle:Code
662 status collapsed
663
664 \begin_layout Plain Layout
665 kbd/
666 \end_layout
667
668 \end_inset
669
670  contains keyboard keymapping files.
671  See Chapter
672 \begin_inset space ~
673 \end_inset
674
675
676 \begin_inset CommandInset ref
677 LatexCommand ref
678 reference "sec:keymap"
679
680 \end_inset
681
682  for details.
683 \end_layout
684
685 \begin_layout Labeling
686 \labelwidthstring 00.00.0000
687 \begin_inset Flex CharStyle:Code
688 status collapsed
689
690 \begin_layout Plain Layout
691 layouts/
692 \end_layout
693
694 \end_inset
695
696  contains the text class and module files described in Chapter
697 \begin_inset space ~
698 \end_inset
699
700
701 \begin_inset CommandInset ref
702 LatexCommand ref
703 reference "chap:textclass"
704
705 \end_inset
706
707 .
708 \end_layout
709
710 \begin_layout Labeling
711 \labelwidthstring 00.00.0000
712 \begin_inset Flex CharStyle:Code
713 status collapsed
714
715 \begin_layout Plain Layout
716 lyx2lyx
717 \end_layout
718
719 \end_inset
720
721  contains the 
722 \begin_inset Flex CharStyle:Code
723 status collapsed
724
725 \begin_layout Plain Layout
726 lyx2lyx
727 \end_layout
728
729 \end_inset
730
731  Python scripts used to convert between LyX versions.
732  These can be run from the command line if, say, you want to batch-convert
733  files.
734 \end_layout
735
736 \begin_layout Labeling
737 \labelwidthstring 00.00.0000
738 \begin_inset Flex CharStyle:Code
739 status collapsed
740
741 \begin_layout Plain Layout
742 scripts/
743 \end_layout
744
745 \end_inset
746
747  contains some files that demonstrate the capabilities of the 
748 \begin_inset Flex CharStyle:MenuItem
749 status collapsed
750
751 \begin_layout Plain Layout
752 External
753 \begin_inset space ~
754 \end_inset
755
756 Template
757 \end_layout
758
759 \end_inset
760
761  feature.
762  Also contains some scripts used by LyX itself.
763 \end_layout
764
765 \begin_layout Labeling
766 \labelwidthstring 00.00.0000
767 \begin_inset Flex CharStyle:Code
768 status collapsed
769
770 \begin_layout Plain Layout
771 templates/
772 \end_layout
773
774 \end_inset
775
776  contains the standard LyX template files described in Chapter
777 \begin_inset space ~
778 \end_inset
779
780
781 \begin_inset CommandInset ref
782 LatexCommand ref
783 reference "sec:templates"
784
785 \end_inset
786
787 .
788 \end_layout
789
790 \begin_layout Labeling
791 \labelwidthstring 00.00.0000
792 \begin_inset Flex CharStyle:Code
793 status collapsed
794
795 \begin_layout Plain Layout
796 ui/
797 \end_layout
798
799 \end_inset
800
801  contains files with the extension 
802 \begin_inset Flex CharStyle:Code
803 status collapsed
804
805 \begin_layout Plain Layout
806 .ui
807 \end_layout
808
809 \end_inset
810
811  that define the user interface to LyX.
812  That is, the files define which items appear in which menus and the items
813  appearing on the toolbar.
814 \end_layout
815
816 \begin_layout Subsection
817 Files you don't want to modify
818 \end_layout
819
820 \begin_layout Standard
821 These files are used internally by LyX and you generally do not need to
822  modify them unless you are a developer.
823 \end_layout
824
825 \begin_layout Labeling
826 \labelwidthstring 00.00.0000
827 \begin_inset Flex CharStyle:Code
828 status collapsed
829
830 \begin_layout Plain Layout
831 CREDITS
832 \end_layout
833
834 \end_inset
835
836  this file contains the list of LyX developers.
837  The contents are displayed with the menu entry 
838 \begin_inset Flex CharStyle:MenuItem
839 status collapsed
840
841 \begin_layout Plain Layout
842
843 \bar under
844 H
845 \bar default
846 elp\SpecialChar \menuseparator
847 About
848 \begin_inset space ~
849 \end_inset
850
851 LyX
852 \end_layout
853
854 \end_inset
855
856 .
857 \end_layout
858
859 \begin_layout Labeling
860 \labelwidthstring 00.00.0000
861 \begin_inset Flex CharStyle:Code
862 status collapsed
863
864 \begin_layout Plain Layout
865 chkconfig.ltx
866 \end_layout
867
868 \end_inset
869
870  this is a LaTeX script used during the configuration process.
871  Do not run directly.
872 \end_layout
873
874 \begin_layout Labeling
875 \labelwidthstring 00.00.0000
876 \begin_inset Flex CharStyle:Code
877 status collapsed
878
879 \begin_layout Plain Layout
880 configure.py
881 \end_layout
882
883 \end_inset
884
885  this is the script that is used to re-configure LyX.
886  It creates configuration files in the directory it was run from.
887 \end_layout
888
889 \begin_layout Subsection
890 Other files needing a line or two...
891 \end_layout
892
893 \begin_layout Labeling
894 \labelwidthstring 00.00.0000
895 \begin_inset Flex CharStyle:Code
896 status collapsed
897
898 \begin_layout Plain Layout
899 encodings
900 \end_layout
901
902 \end_inset
903
904  this contains tables describing how different character encodings can be
905  mapped to unicode
906 \end_layout
907
908 \begin_layout Labeling
909 \labelwidthstring 00.00.0000
910 \begin_inset Flex CharStyle:Code
911 status collapsed
912
913 \begin_layout Plain Layout
914 external_templates
915 \end_layout
916
917 \end_inset
918
919  this file contains the templates available to the new 
920 \begin_inset Flex CharStyle:MenuItem
921 status collapsed
922
923 \begin_layout Plain Layout
924 External
925 \begin_inset space ~
926 \end_inset
927
928 Template
929 \end_layout
930
931 \end_inset
932
933  feature.
934 \end_layout
935
936 \begin_layout Labeling
937 \labelwidthstring 00.00.0000
938 \begin_inset Flex CharStyle:Code
939 status collapsed
940
941 \begin_layout Plain Layout
942 languages
943 \end_layout
944
945 \end_inset
946
947  this file contains a list of all the languages currently supported by LyX.
948 \end_layout
949
950 \begin_layout Section
951 Your local configuration directory
952 \end_layout
953
954 \begin_layout Standard
955 Even if you are using LyX as an unprivileged user, you might want to change
956  LyX configuration for your own use.
957  The 
958 \begin_inset Flex CharStyle:Code
959 status collapsed
960
961 \begin_layout Plain Layout
962 UserDir
963 \end_layout
964
965 \end_inset
966
967  directory contains all your personal configuration files.
968  This is the directory described as 
969 \begin_inset Quotes eld
970 \end_inset
971
972 user directory
973 \begin_inset Quotes erd
974 \end_inset
975
976  in 
977 \begin_inset Flex CharStyle:MenuItem
978 status collapsed
979
980 \begin_layout Plain Layout
981
982 \bar under
983 H
984 \bar default
985 elp\SpecialChar \menuseparator
986 About
987 \begin_inset space ~
988 \end_inset
989
990 LyX
991 \end_layout
992
993 \end_inset
994
995 .
996  This directory is used as a mirror of 
997 \begin_inset Flex CharStyle:Code
998 status collapsed
999
1000 \begin_layout Plain Layout
1001 LyXDir
1002 \end_layout
1003
1004 \end_inset
1005
1006 , which means that every file in 
1007 \begin_inset Flex CharStyle:Code
1008 status collapsed
1009
1010 \begin_layout Plain Layout
1011 UserDir
1012 \end_layout
1013
1014 \end_inset
1015
1016  is a replacement for the corresponding file in 
1017 \begin_inset Flex CharStyle:Code
1018 status collapsed
1019
1020 \begin_layout Plain Layout
1021 LyXDir
1022 \end_layout
1023
1024 \end_inset
1025
1026 .
1027  Any configuration file described in the above sections can be placed either
1028  in the system-wide directory, in which case it will affect all users, or
1029  in your local directory for your own use.
1030 \end_layout
1031
1032 \begin_layout Standard
1033 To make things clearer, let's provide a few examples:
1034 \end_layout
1035
1036 \begin_layout Itemize
1037 The preferences set in the 
1038 \begin_inset Flex CharStyle:MenuItem
1039 status collapsed
1040
1041 \begin_layout Plain Layout
1042
1043 \bar under
1044 T
1045 \bar default
1046 ools\SpecialChar \menuseparator
1047
1048 \bar under
1049 P
1050 \bar default
1051 references
1052 \end_layout
1053
1054 \end_inset
1055
1056  dialog are saved to a file 
1057 \begin_inset Flex CharStyle:Code
1058 status collapsed
1059
1060 \begin_layout Plain Layout
1061 preferences
1062 \end_layout
1063
1064 \end_inset
1065
1066  in 
1067 \begin_inset Flex CharStyle:Code
1068 status collapsed
1069
1070 \begin_layout Plain Layout
1071 UserDir
1072 \end_layout
1073
1074 \end_inset
1075
1076 .
1077 \end_layout
1078
1079 \begin_layout Itemize
1080 When you reconfigure using 
1081 \begin_inset Flex CharStyle:MenuItem
1082 status collapsed
1083
1084 \begin_layout Plain Layout
1085
1086 \bar under
1087 T
1088 \bar default
1089 ools\SpecialChar \menuseparator
1090
1091 \bar under
1092 R
1093 \bar default
1094 econfigure
1095 \end_layout
1096
1097 \end_inset
1098
1099 , LyX runs the 
1100 \begin_inset Flex CharStyle:Code
1101 status collapsed
1102
1103 \begin_layout Plain Layout
1104 configure.py
1105 \end_layout
1106
1107 \end_inset
1108
1109  script, and the resulting files are written in your local configuration
1110  directory.
1111  This means that any additional text class file that you might have added
1112  in 
1113 \begin_inset Flex CharStyle:Code
1114 status collapsed
1115
1116 \begin_layout Plain Layout
1117 UserDir/layouts
1118 \end_layout
1119
1120 \end_inset
1121
1122  will be added to the list of classes in the 
1123 \begin_inset Flex CharStyle:MenuItem
1124 status collapsed
1125
1126 \begin_layout Plain Layout
1127 Document\SpecialChar \menuseparator
1128 Settings
1129 \end_layout
1130
1131 \end_inset
1132
1133  dialog.
1134 \end_layout
1135
1136 \begin_layout Itemize
1137 If you get some updated documentation from LyX ftp site and cannot install
1138  it because you do not have sysadmin rights on your system, you can just
1139  copy the files in 
1140 \begin_inset Flex CharStyle:Code
1141 status collapsed
1142
1143 \begin_layout Plain Layout
1144 UserDir/doc/
1145 \end_layout
1146
1147 \end_inset
1148
1149  and the items in the 
1150 \begin_inset Flex CharStyle:MenuItem
1151 status collapsed
1152
1153 \begin_layout Plain Layout
1154
1155 \bar under
1156 H
1157 \bar default
1158 elp
1159 \end_layout
1160
1161 \end_inset
1162
1163  menu will open them!
1164 \end_layout
1165
1166 \begin_layout Section
1167 Running LyX with multiple configurations
1168 \end_layout
1169
1170 \begin_layout Standard
1171 The configuration freedom of the local configuration directory may not suffice
1172  if you want to have more than one configuration at your disposal.
1173  For example, you may want to be use different key bindings or printer settings
1174  at different times.
1175  You can achieve this by having several such directories.
1176  You then specify which directory to use at run-time.
1177 \end_layout
1178
1179 \begin_layout Standard
1180 Invoking LyX with the command line switch 
1181 \begin_inset Flex CharStyle:Code
1182 status collapsed
1183
1184 \begin_layout Plain Layout
1185 -userdir
1186 \end_layout
1187
1188 \end_inset
1189
1190  
1191 \emph on
1192 <some directory>
1193 \emph default
1194  instructs the program to read the configuration from that directory, and
1195  not from the default directory.
1196  (You can determine the default directory by running LyX without the 
1197 \begin_inset Flex CharStyle:Code
1198 status collapsed
1199
1200 \begin_layout Plain Layout
1201 -userdir
1202 \end_layout
1203
1204 \end_inset
1205
1206  switch.) If the specified directory does not exist, LyX offers to create
1207  it for you, just like it does for the default directory on the first time
1208  you run the program.
1209  You can modify the configuration options in this additional user directory
1210  exactly as you would for the default directory.
1211  These directories are completely independent (but read on).
1212  Note that setting the environment variable 
1213 \begin_inset Flex CharStyle:Code
1214 status collapsed
1215
1216 \begin_layout Plain Layout
1217 LYX_USERDIR_VER
1218 \end_layout
1219
1220 \end_inset
1221
1222  to some value has exactly the same effect.
1223 \end_layout
1224
1225 \begin_layout Standard
1226 Having several configurations also requires more maintenance: if you want
1227  to add a new layout to 
1228 \begin_inset Flex CharStyle:Code
1229 status collapsed
1230
1231 \begin_layout Plain Layout
1232 NewUserDir/layouts
1233 \end_layout
1234
1235 \end_inset
1236
1237  which you want available from all your configurations, you must add it
1238  to each directory separately.
1239  You can avoid this with the following trick: after LyX creates the additional
1240  directory, most of the subdirectories (see above) are empty.
1241  If you want the new configuration to mirror an existing one, replace the
1242  empty subdirectory with a symbolic link to the matching subdirectory in
1243  the existing configuration.
1244  Take care with the 
1245 \begin_inset Flex CharStyle:Code
1246 status collapsed
1247
1248 \begin_layout Plain Layout
1249 doc/
1250 \end_layout
1251
1252 \end_inset
1253
1254  subirectory, however, since it contains a file written by the configuration
1255  script (also accessible through 
1256 \begin_inset Flex CharStyle:MenuItem
1257 status collapsed
1258
1259 \begin_layout Plain Layout
1260
1261 \bar under
1262 T
1263 \bar default
1264 ools\SpecialChar \menuseparator
1265
1266 \bar under
1267 R
1268 \bar default
1269 econfigure
1270 \end_layout
1271
1272 \end_inset
1273
1274 ) which is configuration-specific.
1275 \end_layout
1276
1277 \begin_layout Chapter
1278 The Preferences dialog
1279 \end_layout
1280
1281 \begin_layout Standard
1282 All options of the preferences dialog are described in the Appendix 
1283 \emph on
1284 The Preferences Dialog
1285 \emph default
1286  in the 
1287 \emph on
1288 User's Guide
1289 \emph default
1290 .
1291  For some options you might find here more details.
1292 \end_layout
1293
1294 \begin_layout Section
1295 Using the dialog for the first time
1296 \end_layout
1297
1298 \begin_layout Standard
1299 The 
1300 \begin_inset Flex CharStyle:Code
1301 status collapsed
1302
1303 \begin_layout Plain Layout
1304 UserDir/preferences
1305 \end_layout
1306
1307 \end_inset
1308
1309  file will contain only changes that you have made to the default behavior,
1310  some of which is hard-coded into LyX and some of which is contained in
1311  the system file 
1312 \begin_inset Flex CharStyle:Code
1313 status collapsed
1314
1315 \begin_layout Plain Layout
1316 LyXDir/lyxrc.defaults
1317 \end_layout
1318
1319 \end_inset
1320
1321 .
1322  Note that in both files lines beginning with a 
1323 \begin_inset Quotes eld
1324 \end_inset
1325
1326 #
1327 \begin_inset Quotes erd
1328 \end_inset
1329
1330  are just comments and are not interpreted.
1331  However, only system administrators should edit 
1332 \begin_inset Flex CharStyle:Code
1333 status collapsed
1334
1335 \begin_layout Plain Layout
1336 LyXDir/lyxrc.defaults
1337 \end_layout
1338
1339 \end_inset
1340
1341 .
1342  Users should use the 
1343 \begin_inset Flex CharStyle:MenuItem
1344 status collapsed
1345
1346 \begin_layout Plain Layout
1347 Tools\SpecialChar \menuseparator
1348 Preferences
1349 \end_layout
1350
1351 \end_inset
1352
1353  dialog to create and modify their own 
1354 \begin_inset Flex CharStyle:Code
1355 status collapsed
1356
1357 \begin_layout Plain Layout
1358 UserDir/preferences
1359 \end_layout
1360
1361 \end_inset
1362
1363  file.
1364 \end_layout
1365
1366 \begin_layout Standard
1367 We hope that the 
1368 \begin_inset Flex CharStyle:MenuItem
1369 status collapsed
1370
1371 \begin_layout Plain Layout
1372 Tools\SpecialChar \menuseparator
1373 Preferences
1374 \end_layout
1375
1376 \end_inset
1377
1378  dialog will be largely self-explanatory.
1379  Most things in the dialog have associated `tool tips': hover your mouse
1380  pointer over something for more information.
1381  Before we highlight a few of the more important commands below, however,
1382  a word of warning: Applying some of your changes (e.g.
1383 \begin_inset space \space{}
1384 \end_inset
1385
1386 screen fonts) will have an instant effect.
1387  Others (e.g.
1388 \begin_inset space \space{}
1389 \end_inset
1390
1391 changing the bind file) will not.
1392  If nothing appears to have changed, just 
1393 \begin_inset Flex CharStyle:MenuItem
1394 status collapsed
1395
1396 \begin_layout Plain Layout
1397 Save
1398 \end_layout
1399
1400 \end_inset
1401
1402  the changes and restart LyX.
1403 \end_layout
1404
1405 \begin_layout Section
1406 File Handling
1407 \end_layout
1408
1409 \begin_layout Standard
1410 LyX has a powerful mechanism to convert to and from any file format using
1411  external programs.
1412  
1413 \end_layout
1414
1415 \begin_layout Subsection
1416 \begin_inset CommandInset label
1417 LatexCommand label
1418 name "sub:Formats"
1419
1420 \end_inset
1421
1422 Formats
1423 \end_layout
1424
1425 \begin_layout Standard
1426 The first step is to define your file formats if they are not already defined.
1427  To do so, open the 
1428 \begin_inset Flex CharStyle:MenuItem
1429 status collapsed
1430
1431 \begin_layout Plain Layout
1432 Tools\SpecialChar \menuseparator
1433 Preferences\SpecialChar \menuseparator
1434 File Handling\SpecialChar \menuseparator
1435 File Formats
1436 \end_layout
1437
1438 \end_inset
1439
1440  dialog.
1441  Press the 
1442 \begin_inset Flex CharStyle:MenuItem
1443 status collapsed
1444
1445 \begin_layout Plain Layout
1446 New\SpecialChar \ldots{}
1447
1448 \end_layout
1449
1450 \end_inset
1451
1452  button to define your new format.
1453  The 
1454 \begin_inset Flex CharStyle:MenuItem
1455 status collapsed
1456
1457 \begin_layout Plain Layout
1458 Format
1459 \end_layout
1460
1461 \end_inset
1462
1463  field contains the named used to identify the format in the GUI.
1464  The 
1465 \begin_inset Flex CharStyle:MenuItem
1466 status collapsed
1467
1468 \begin_layout Plain Layout
1469 Short Name
1470 \end_layout
1471
1472 \end_inset
1473
1474  is used to identify the format interally.
1475  You will also need to enter a file extension.
1476  These are all required.
1477  The optional 
1478 \begin_inset Flex CharStyle:MenuItem
1479 status collapsed
1480
1481 \begin_layout Plain Layout
1482 Shortcut
1483 \end_layout
1484
1485 \end_inset
1486
1487  field is used to provide a keyboard shortcut on the menus.
1488  (For example, pressing 
1489 \begin_inset Flex CharStyle:MenuItem
1490 status collapsed
1491
1492 \begin_layout Plain Layout
1493 Alt-V D
1494 \end_layout
1495
1496 \end_inset
1497
1498  will 
1499 \begin_inset Flex CharStyle:MenuItem
1500 status collapsed
1501
1502 \begin_layout Plain Layout
1503 View\SpecialChar \menuseparator
1504 DVI
1505 \end_layout
1506
1507 \end_inset
1508
1509 .) 
1510 \end_layout
1511
1512 \begin_layout Standard
1513 A Format can have a 
1514 \begin_inset Flex CharStyle:MenuItem
1515 status collapsed
1516
1517 \begin_layout Plain Layout
1518 Viewer
1519 \end_layout
1520
1521 \end_inset
1522
1523  and 
1524 \begin_inset Flex CharStyle:MenuItem
1525 status collapsed
1526
1527 \begin_layout Plain Layout
1528 Editor
1529 \end_layout
1530
1531 \end_inset
1532
1533  associated with it.
1534  For example, you might want to use 
1535 \begin_inset Flex CharStyle:MenuItem
1536 status collapsed
1537
1538 \begin_layout Plain Layout
1539 Ghostview
1540 \end_layout
1541
1542 \end_inset
1543
1544  to view PostScript files.
1545  You can enter the command needed to start the program in the corresponding
1546  fields.
1547  In defining this command, you can use the four variables listed in the
1548  next section.
1549  The viewer is launched when you view an image in LyX or use the 
1550 \begin_inset Flex CharStyle:MenuItem
1551 status collapsed
1552
1553 \begin_layout Plain Layout
1554 View
1555 \end_layout
1556
1557 \end_inset
1558
1559  menu.
1560  The editor is for example launched when you press the 
1561 \begin_inset Flex CharStyle:MenuItem
1562 status collapsed
1563
1564 \begin_layout Plain Layout
1565 Edit
1566 \end_layout
1567
1568 \end_inset
1569
1570  button in the 
1571 \begin_inset Flex CharStyle:MenuItem
1572 status collapsed
1573
1574 \begin_layout Plain Layout
1575 Graphics
1576 \end_layout
1577
1578 \end_inset
1579
1580  or the 
1581 \begin_inset Flex CharStyle:MenuItem
1582 status collapsed
1583
1584 \begin_layout Plain Layout
1585 External material
1586 \end_layout
1587
1588 \end_inset
1589
1590  dialog.
1591 \end_layout
1592
1593 \begin_layout Standard
1594 The 
1595 \begin_inset Flex CharStyle:MenuItem
1596 status collapsed
1597
1598 \begin_layout Plain Layout
1599 Document format
1600 \end_layout
1601
1602 \end_inset
1603
1604  option tells LyX that a format is suitable for document export.
1605  If this is is set and if a suitable conversion route exists (see 
1606 \begin_inset CommandInset ref
1607 LatexCommand ref
1608 reference "sub:Converters"
1609
1610 \end_inset
1611
1612 ), the format will appear in the 
1613 \begin_inset Flex CharStyle:MenuItem
1614 status collapsed
1615
1616 \begin_layout Plain Layout
1617 File\SpecialChar \menuseparator
1618 Export
1619 \end_layout
1620
1621 \end_inset
1622
1623  menu.
1624  The format will also appear in the 
1625 \begin_inset Flex CharStyle:MenuItem
1626 status collapsed
1627
1628 \begin_layout Plain Layout
1629 View
1630 \end_layout
1631
1632 \end_inset
1633
1634  menu if a viewer is specified for the format.
1635  Pure image formats, such as 
1636 \begin_inset Flex CharStyle:Code
1637 status collapsed
1638
1639 \begin_layout Plain Layout
1640 png
1641 \end_layout
1642
1643 \end_inset
1644
1645 , should not use this option.
1646  Formats that can both represent vector graphics and documents like 
1647 \begin_inset Flex CharStyle:Code
1648 status collapsed
1649
1650 \begin_layout Plain Layout
1651 pdf
1652 \end_layout
1653
1654 \end_inset
1655
1656  should use it.
1657 \end_layout
1658
1659 \begin_layout Standard
1660 The option 
1661 \begin_inset Flex CharStyle:MenuItem
1662 status collapsed
1663
1664 \begin_layout Plain Layout
1665 Vector graphics format
1666 \end_layout
1667
1668 \end_inset
1669
1670  tells LyX that a format can contain vector graphics.
1671  This information is used to determine the target format of included graphics
1672  for 
1673 \begin_inset Flex CharStyle:MenuItem
1674 status collapsed
1675
1676 \begin_layout Plain Layout
1677 pdflatex
1678 \end_layout
1679
1680 \end_inset
1681
1682  export.
1683  Included graphics may need to be converted to either 
1684 \begin_inset Flex CharStyle:MenuItem
1685 status collapsed
1686
1687 \begin_layout Plain Layout
1688 pdf
1689 \end_layout
1690
1691 \end_inset
1692
1693
1694 \begin_inset Flex CharStyle:MenuItem
1695 status collapsed
1696
1697 \begin_layout Plain Layout
1698 png
1699 \end_layout
1700
1701 \end_inset
1702
1703 , or 
1704 \begin_inset Flex CharStyle:MenuItem
1705 status collapsed
1706
1707 \begin_layout Plain Layout
1708 jpg
1709 \end_layout
1710
1711 \end_inset
1712
1713 , since 
1714 \begin_inset Flex CharStyle:MenuItem
1715 status collapsed
1716
1717 \begin_layout Plain Layout
1718 pdflatex
1719 \end_layout
1720
1721 \end_inset
1722
1723  cannot handle other image formats.
1724  If an included graphic is not already in 
1725 \begin_inset Flex CharStyle:MenuItem
1726 status collapsed
1727
1728 \begin_layout Plain Layout
1729 pdf
1730 \end_layout
1731
1732 \end_inset
1733
1734
1735 \begin_inset Flex CharStyle:MenuItem
1736 status collapsed
1737
1738 \begin_layout Plain Layout
1739 png
1740 \end_layout
1741
1742 \end_inset
1743
1744 , or 
1745 \begin_inset Flex CharStyle:MenuItem
1746 status collapsed
1747
1748 \begin_layout Plain Layout
1749 jpg
1750 \end_layout
1751
1752 \end_inset
1753
1754  format, it is converted to 
1755 \begin_inset Flex CharStyle:MenuItem
1756 status collapsed
1757
1758 \begin_layout Plain Layout
1759 pdf
1760 \end_layout
1761
1762 \end_inset
1763
1764  if the vector format option is set, and otherwise to 
1765 \begin_inset Flex CharStyle:MenuItem
1766 status collapsed
1767
1768 \begin_layout Plain Layout
1769 png
1770 \end_layout
1771
1772 \end_inset
1773
1774 .
1775 \end_layout
1776
1777 \begin_layout Subsection
1778 Copiers
1779 \end_layout
1780
1781 \begin_layout Standard
1782 Since all conversions from one format to another take place in LyX's temporary
1783  directory, it is sometimes necessary to modify a file before copying it
1784  to the temporary directory in order that the conversion may be performed.
1785 \begin_inset Foot
1786 status collapsed
1787
1788 \begin_layout Plain Layout
1789 For example, the file may refer to other files---images, for example---using
1790  relative file names, and these may become invalid when the file is copied
1791  to the temporary directory.
1792 \end_layout
1793
1794 \end_inset
1795
1796  This is done by a Copier: It copies a file to (or from) the temporary directory
1797  and may modify it in the process.
1798 \end_layout
1799
1800 \begin_layout Standard
1801 The definitions of the copiers may use four variables:
1802 \end_layout
1803
1804 \begin_layout Labeling
1805 \labelwidthstring 00.00.0000
1806 \begin_inset Flex CharStyle:Code
1807 status collapsed
1808
1809 \begin_layout Plain Layout
1810 $$s
1811 \end_layout
1812
1813 \end_inset
1814
1815  The LyX system directory (e.g.
1816 \begin_inset space \space{}
1817 \end_inset
1818
1819
1820 \begin_inset Flex CharStyle:MenuItem
1821 status collapsed
1822
1823 \begin_layout Plain Layout
1824 /usr/share/lyx
1825 \end_layout
1826
1827 \end_inset
1828
1829 ).
1830 \end_layout
1831
1832 \begin_layout Labeling
1833 \labelwidthstring 00.00.0000
1834 \begin_inset Flex CharStyle:Code
1835 status collapsed
1836
1837 \begin_layout Plain Layout
1838 $$i
1839 \end_layout
1840
1841 \end_inset
1842
1843  The input file
1844 \end_layout
1845
1846 \begin_layout Labeling
1847 \labelwidthstring 00.00.0000
1848 \begin_inset Flex CharStyle:Code
1849 status collapsed
1850
1851 \begin_layout Plain Layout
1852 $$o
1853 \end_layout
1854
1855 \end_inset
1856
1857  The output file
1858 \end_layout
1859
1860 \begin_layout Labeling
1861 \labelwidthstring 00.00.0000
1862 \begin_inset Flex CharStyle:Code
1863 status collapsed
1864
1865 \begin_layout Plain Layout
1866 $$l
1867 \end_layout
1868
1869 \end_inset
1870
1871  The `LaTeX name'
1872 \end_layout
1873
1874 \begin_layout Standard
1875 The latter should be the filename as it would be used in a LaTeX's 
1876 \series bold
1877
1878 \backslash
1879 include
1880 \series default
1881  command.
1882  It is relevant only when exporting files suitable for such inclusion.
1883 \end_layout
1884
1885 \begin_layout Standard
1886 Copiers can be used to do almost anything with output files.
1887  For example, suppose you want generated pdf files to be copied to a special
1888  directory, 
1889 \begin_inset Flex CharStyle:Code
1890 status collapsed
1891
1892 \begin_layout Plain Layout
1893 /home/you/pdf/
1894 \end_layout
1895
1896 \end_inset
1897
1898 .
1899  Then you could write a shell script such as this one:
1900 \end_layout
1901
1902 \begin_layout Standard
1903 \begin_inset listings
1904 inline false
1905 status open
1906
1907 \begin_layout Plain Layout
1908
1909 #!/bin/bash
1910 \end_layout
1911
1912 \begin_layout Plain Layout
1913
1914 FROMFILE=$1
1915 \end_layout
1916
1917 \begin_layout Plain Layout
1918
1919 TOFILE=`basename $2`
1920 \end_layout
1921
1922 \begin_layout Plain Layout
1923
1924 cp $FROMFILE /home/you/pdf/$TOFILE
1925 \end_layout
1926
1927 \end_inset
1928
1929 Save that in your local LyX directory---say, 
1930 \begin_inset Flex CharStyle:Code
1931 status collapsed
1932
1933 \begin_layout Plain Layout
1934 /home/you/.lyx/scripts/pdfcopier.sh
1935 \end_layout
1936
1937 \end_inset
1938
1939 ---and make it executable, if you need to do so on your platform.
1940  Then, in the 
1941 \begin_inset Flex CharStyle:MenuItem
1942 status collapsed
1943
1944 \begin_layout Plain Layout
1945 Tools\SpecialChar \menuseparator
1946 Preferences:Copiers
1947 \end_layout
1948
1949 \end_inset
1950
1951  dialog, select the 
1952 \begin_inset Flex CharStyle:MenuItem
1953 status collapsed
1954
1955 \begin_layout Plain Layout
1956 PDF(pdflatex)
1957 \end_layout
1958
1959 \end_inset
1960
1961  format---or one of the other pdf formats---and enter 
1962 \begin_inset Flex CharStyle:Code
1963 status collapsed
1964
1965 \begin_layout Plain Layout
1966 pdfcopier.sh $$i $$o
1967 \end_layout
1968
1969 \end_inset
1970
1971  into the 
1972 \begin_inset Flex CharStyle:MenuItem
1973 status collapsed
1974
1975 \begin_layout Plain Layout
1976 Copier
1977 \end_layout
1978
1979 \end_inset
1980
1981  field.
1982  
1983 \end_layout
1984
1985 \begin_layout Standard
1986 Copiers are used by LyX in various of its own conversions.
1987  For example, if appropriate programs are found, LyX will automatically
1988  install copiers for the 
1989 \begin_inset Flex CharStyle:MenuItem
1990 status collapsed
1991
1992 \begin_layout Plain Layout
1993 HTML
1994 \end_layout
1995
1996 \end_inset
1997
1998  and 
1999 \begin_inset Flex CharStyle:MenuItem
2000 status collapsed
2001
2002 \begin_layout Plain Layout
2003 HTML
2004 \begin_inset space ~
2005 \end_inset
2006
2007 (MS Word)
2008 \end_layout
2009
2010 \end_inset
2011
2012  formats.
2013  When these formats are exported, the copier sees that not just the main
2014  HTML file but various associated files (style files, images, etc.) are also
2015  copied.
2016  All these files are written to a subdirectory of the directory in which
2017  the original LyX file was found.
2018 \begin_inset Foot
2019 status collapsed
2020
2021 \begin_layout Plain Layout
2022 This copier can be customized.
2023  The optional 
2024 \begin_inset Quotes eld
2025 \end_inset
2026
2027 -e
2028 \begin_inset Quotes erd
2029 \end_inset
2030
2031  argument takes a comma-separated list of extensions to be copied; if it
2032  is omitted, all files will be copied.
2033  The 
2034 \begin_inset Quotes eld
2035 \end_inset
2036
2037 -t
2038 \begin_inset Quotes erd
2039 \end_inset
2040
2041  argument determines the extension added to the generated directory.
2042  By default, it is 
2043 \begin_inset Quotes eld
2044 \end_inset
2045
2046
2047 \begin_inset Flex CharStyle:MenuItem
2048 status collapsed
2049
2050 \begin_layout Plain Layout
2051 LyXconv
2052 \end_layout
2053
2054 \end_inset
2055
2056
2057 \begin_inset Quotes erd
2058 \end_inset
2059
2060 , so HTML generated from 
2061 \begin_inset Flex CharStyle:MenuItem
2062 status collapsed
2063
2064 \begin_layout Plain Layout
2065 /path/to/filename.lyx
2066 \end_layout
2067
2068 \end_inset
2069
2070  will end up in 
2071 \begin_inset Flex CharStyle:MenuItem
2072 status collapsed
2073
2074 \begin_layout Plain Layout
2075 /path/to/filename.html.LyXconv
2076 \end_layout
2077
2078 \end_inset
2079
2080 .
2081  
2082 \end_layout
2083
2084 \end_inset
2085
2086
2087 \end_layout
2088
2089 \begin_layout Subsection
2090 \begin_inset CommandInset label
2091 LatexCommand label
2092 name "sub:Converters"
2093
2094 \end_inset
2095
2096 Converters
2097 \end_layout
2098
2099 \begin_layout Standard
2100 You can define your own Converters to, uhh, convert files between different
2101  formats.
2102  This is done in the 
2103 \begin_inset Flex CharStyle:MenuItem
2104 status collapsed
2105
2106 \begin_layout Plain Layout
2107 Tools\SpecialChar \menuseparator
2108 Preferences\SpecialChar \menuseparator
2109 File Handling\SpecialChar \menuseparator
2110 Converters
2111 \end_layout
2112
2113 \end_inset
2114
2115  dialog.
2116 \end_layout
2117
2118 \begin_layout Standard
2119 To define a new converter, select the 
2120 \begin_inset Flex CharStyle:MenuItem
2121 status collapsed
2122
2123 \begin_layout Plain Layout
2124 From
2125 \begin_inset space ~
2126 \end_inset
2127
2128 format
2129 \end_layout
2130
2131 \end_inset
2132
2133  and 
2134 \begin_inset Flex CharStyle:MenuItem
2135 status collapsed
2136
2137 \begin_layout Plain Layout
2138 To
2139 \begin_inset space ~
2140 \end_inset
2141
2142 format
2143 \end_layout
2144
2145 \end_inset
2146
2147  from the drop-down lists, enter the command needed for the conversion,
2148  and then press the 
2149 \begin_inset Flex CharStyle:MenuItem
2150 status collapsed
2151
2152 \begin_layout Plain Layout
2153 Add
2154 \end_layout
2155
2156 \end_inset
2157
2158  button.
2159  Several variables can be used in the definition of converters:
2160 \end_layout
2161
2162 \begin_layout Labeling
2163 \labelwidthstring 00.00.0000
2164 \begin_inset Flex CharStyle:Code
2165 status collapsed
2166
2167 \begin_layout Plain Layout
2168 $$s
2169 \end_layout
2170
2171 \end_inset
2172
2173  The LyX system directory
2174 \end_layout
2175
2176 \begin_layout Labeling
2177 \labelwidthstring 00.00.0000
2178 \begin_inset Flex CharStyle:Code
2179 status collapsed
2180
2181 \begin_layout Plain Layout
2182 $$i
2183 \end_layout
2184
2185 \end_inset
2186
2187  The input file
2188 \end_layout
2189
2190 \begin_layout Labeling
2191 \labelwidthstring 00.00.0000
2192 \begin_inset Flex CharStyle:Code
2193 status collapsed
2194
2195 \begin_layout Plain Layout
2196 $$o
2197 \end_layout
2198
2199 \end_inset
2200
2201  The output file
2202 \end_layout
2203
2204 \begin_layout Labeling
2205 \labelwidthstring 00.00.0000
2206 \begin_inset Flex CharStyle:Code
2207 status collapsed
2208
2209 \begin_layout Plain Layout
2210 $$b
2211 \end_layout
2212
2213 \end_inset
2214
2215  The base filename of the input file (i.e., without the extension)
2216 \end_layout
2217
2218 \begin_layout Labeling
2219 \labelwidthstring 00.00.0000
2220 \begin_inset Flex CharStyle:Code
2221 status collapsed
2222
2223 \begin_layout Plain Layout
2224 $$p
2225 \end_layout
2226
2227 \end_inset
2228
2229  The path to the input file
2230 \end_layout
2231
2232 \begin_layout Standard
2233 In the 
2234 \begin_inset Flex CharStyle:MenuItem
2235 status collapsed
2236
2237 \begin_layout Plain Layout
2238 Extra
2239 \begin_inset space ~
2240 \end_inset
2241
2242 Flag
2243 \end_layout
2244
2245 \end_inset
2246
2247  field you can enter the following flags, separated by commas:
2248 \end_layout
2249
2250 \begin_layout Labeling
2251 \labelwidthstring 00.00.0000
2252 \begin_inset Flex CharStyle:Code
2253 status collapsed
2254
2255 \begin_layout Plain Layout
2256 latex
2257 \end_layout
2258
2259 \end_inset
2260
2261  This converter runs some form of LaTeX.
2262  This will make LyX's LaTeX error logs available.
2263 \end_layout
2264
2265 \begin_layout Labeling
2266 \labelwidthstring 00.00.0000
2267 \begin_inset Flex CharStyle:Code
2268 status collapsed
2269
2270 \begin_layout Plain Layout
2271 needaux
2272 \end_layout
2273
2274 \end_inset
2275
2276  Needs the LaTeX 
2277 \begin_inset Flex CharStyle:MenuItem
2278 status collapsed
2279
2280 \begin_layout Plain Layout
2281 .aux
2282 \end_layout
2283
2284 \end_inset
2285
2286  file for the conversion.
2287 \end_layout
2288
2289 \begin_layout Labeling
2290 \labelwidthstring 00.00.0000
2291 \begin_inset Flex CharStyle:Code
2292 status collapsed
2293
2294 \begin_layout Plain Layout
2295 xml
2296 \end_layout
2297
2298 \end_inset
2299
2300  Output is XML.
2301 \end_layout
2302
2303 \begin_layout Standard
2304 The following three flags are not really flags at all because they take
2305  an argument in the 
2306 \begin_inset Flex CharStyle:MenuItem
2307 status collapsed
2308
2309 \begin_layout Plain Layout
2310 key
2311 \begin_inset space ~
2312 \end_inset
2313
2314 =
2315 \begin_inset space ~
2316 \end_inset
2317
2318 value
2319 \end_layout
2320
2321 \end_inset
2322
2323  format:
2324 \end_layout
2325
2326 \begin_layout Labeling
2327 \labelwidthstring 00.00.0000
2328 \begin_inset Flex CharStyle:Code
2329 status collapsed
2330
2331 \begin_layout Plain Layout
2332 parselog
2333 \end_layout
2334
2335 \end_inset
2336
2337  If set, the converter's standard error will be redirected to a file 
2338 \begin_inset Flex CharStyle:Code
2339 status collapsed
2340
2341 \begin_layout Plain Layout
2342 infile.out
2343 \end_layout
2344
2345 \end_inset
2346
2347 , and the script given as argument will be run as: 
2348 \begin_inset Flex CharStyle:Code
2349 status collapsed
2350
2351 \begin_layout Plain Layout
2352 script <infile.out >infile.log
2353 \end_layout
2354
2355 \end_inset
2356
2357 .
2358  The argument may contain 
2359 \begin_inset Flex CharStyle:Code
2360 status collapsed
2361
2362 \begin_layout Plain Layout
2363 $$s
2364 \end_layout
2365
2366 \end_inset
2367
2368 .
2369 \end_layout
2370
2371 \begin_layout Labeling
2372 \labelwidthstring 00.00.0000
2373 \begin_inset Flex CharStyle:Code
2374 status collapsed
2375
2376 \begin_layout Plain Layout
2377 resultdir
2378 \end_layout
2379
2380 \end_inset
2381
2382  The name of the directory in which the converter will dump the generated
2383  files.
2384  LyX will not create this directory, and it does not copy anything into
2385  it, though it will copy this directory to the destination.
2386  The argument may contain 
2387 \begin_inset Flex CharStyle:Code
2388 status collapsed
2389
2390 \begin_layout Plain Layout
2391 $$b
2392 \end_layout
2393
2394 \end_inset
2395
2396 , which will be replaced by the base name of the input and output files,
2397  respectively, when the directory is copied.
2398 \begin_inset Newline newline
2399 \end_inset
2400
2401 Note that resultdir and usetempdir make no sense together.
2402  The latter will be ignored if the former is given.
2403 \end_layout
2404
2405 \begin_layout Labeling
2406 \labelwidthstring 00.00.0000
2407 \begin_inset Flex CharStyle:Code
2408 status collapsed
2409
2410 \begin_layout Plain Layout
2411 resultfile
2412 \end_layout
2413
2414 \end_inset
2415
2416  Determines the output file name and may, contain 
2417 \begin_inset Flex CharStyle:Code
2418 status collapsed
2419
2420 \begin_layout Plain Layout
2421 $$b
2422 \end_layout
2423
2424 \end_inset
2425
2426 .
2427  Sensible only with resultdir and optional even then; if not given, it defaults
2428  to `index'.
2429 \end_layout
2430
2431 \begin_layout Standard
2432 None of these last three are presently used in any of the converters that
2433  are installed with LyX.
2434  
2435 \end_layout
2436
2437 \begin_layout Standard
2438 You do not have to define converters between all the formats between which
2439  you want to convert.
2440  For example, you will note that there is no `LyX to PostScript®' converter,
2441  but LyX will export PostScript®.
2442  It does so by first creating a LaTeX file (no converter needs to be defined
2443  for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2444  and finally converting the resulting DVI file to PostScript®.
2445  LyX finds such `chains' of converters automatically, and it will always
2446  choose the shortest possible chain.
2447  You can, though, still define multiple conversion methods between file
2448  formats.
2449  For example, the standard LyX configuration provides three ways to convert
2450  LaTeX to PDF: Directly, using 
2451 \begin_inset Flex CharStyle:MenuItem
2452 status collapsed
2453
2454 \begin_layout Plain Layout
2455 pdflatex
2456 \end_layout
2457
2458 \end_inset
2459
2460 ; via (DVI and) PostScript®, using 
2461 \begin_inset Flex CharStyle:MenuItem
2462 status collapsed
2463
2464 \begin_layout Plain Layout
2465 ps2pdf
2466 \end_layout
2467
2468 \end_inset
2469
2470 ; or via DVI, using 
2471 \begin_inset Flex CharStyle:MenuItem
2472 status collapsed
2473
2474 \begin_layout Plain Layout
2475 dvipdfm
2476 \end_layout
2477
2478 \end_inset
2479
2480 .
2481  To define such alternate chains, you must define multiple target `file
2482  formats', as described in section 
2483 \begin_inset CommandInset ref
2484 LatexCommand ref
2485 reference "sub:Formats"
2486
2487 \end_inset
2488
2489 .
2490  For example, in the standard configuration, the formats named 
2491 \begin_inset Flex CharStyle:MenuItem
2492 status collapsed
2493
2494 \begin_layout Plain Layout
2495 pdf
2496 \end_layout
2497
2498 \end_inset
2499
2500
2501 \begin_inset Flex CharStyle:MenuItem
2502 status collapsed
2503
2504 \begin_layout Plain Layout
2505 pdf2
2506 \end_layout
2507
2508 \end_inset
2509
2510 , and 
2511 \begin_inset Flex CharStyle:MenuItem
2512 status collapsed
2513
2514 \begin_layout Plain Layout
2515 pdf3
2516 \end_layout
2517
2518 \end_inset
2519
2520  are defined, all of which share the extension 
2521 \begin_inset Flex CharStyle:MenuItem
2522 status collapsed
2523
2524 \begin_layout Plain Layout
2525 .pdf
2526 \end_layout
2527
2528 \end_inset
2529
2530 , and which correspond to the conversion methods just mentioned.
2531 \end_layout
2532
2533 \begin_layout Chapter
2534 Internationalizing LyX
2535 \begin_inset CommandInset label
2536 LatexCommand label
2537 name "chap:i18n"
2538
2539 \end_inset
2540
2541
2542 \end_layout
2543
2544 \begin_layout Standard
2545 LyX supports using a translated interface.
2546  Last time we checked, LyX provided text in thirty languages.
2547  The language of choice is called your 
2548 \emph on
2549 locale
2550 \emph default
2551 .
2552  (For further reading on locale settings, see also the documentation for
2553  locale that comes with your operating system.
2554  For Linux, the manual page for 
2555 \begin_inset Flex CharStyle:Code
2556 status collapsed
2557
2558 \begin_layout Plain Layout
2559 locale(5)
2560 \end_layout
2561
2562 \end_inset
2563
2564  could be a good place to start).
2565 \end_layout
2566
2567 \begin_layout Standard
2568 Notice that these translations will work, but do contain a few flaws.
2569  In particular, all dialogs have been designed with the English text in
2570  mind, which means that some of the translated text will be too large to
2571  fit within the space allocated.
2572  This is only a display problem and will not cause any harm.
2573  Also, you will find that some of the translations do not define shortcut
2574  keys for everything.
2575  Sometimes, there are simply not enough free letters to do it.
2576  Other times, the translator just hasn't got around to doing it yet.
2577  Our localization team, which you may wish to join,
2578 \begin_inset Foot
2579 status collapsed
2580
2581 \begin_layout Plain Layout
2582 If you are a fluent speaker of a language other than English, joining these
2583  teams is a great way to give back to the LyX community!
2584 \end_layout
2585
2586 \end_inset
2587
2588  will of course try to fix these shortcomings in future versions of LyX.
2589 \end_layout
2590
2591 \begin_layout Section
2592 Translating LyX
2593 \end_layout
2594
2595 \begin_layout Subsection
2596 Translating the graphical user interface (text messages).
2597 \end_layout
2598
2599 \begin_layout Standard
2600 LyX uses the GNU 
2601 \begin_inset Flex CharStyle:Code
2602 status collapsed
2603
2604 \begin_layout Plain Layout
2605 gettext
2606 \end_layout
2607
2608 \end_inset
2609
2610  library to handle the internationalization of the interface.
2611  To have LyX speak your favorite language in all menus and dialogs, you
2612  need a 
2613 \begin_inset Flex CharStyle:Code
2614 status collapsed
2615
2616 \begin_layout Plain Layout
2617 po
2618 \end_layout
2619
2620 \end_inset
2621
2622 -file for that language.
2623  When this is available, you'll have to generate a 
2624 \begin_inset Flex CharStyle:Code
2625 status collapsed
2626
2627 \begin_layout Plain Layout
2628 mo
2629 \end_layout
2630
2631 \end_inset
2632
2633 -file from it and install the 
2634 \begin_inset Flex CharStyle:Code
2635 status collapsed
2636
2637 \begin_layout Plain Layout
2638 mo
2639 \end_layout
2640
2641 \end_inset
2642
2643 -file.
2644  The process of doing all of this is explained in the documentation for
2645  GNU 
2646 \begin_inset Flex CharStyle:Code
2647 status collapsed
2648
2649 \begin_layout Plain Layout
2650 gettext
2651 \end_layout
2652
2653 \end_inset
2654
2655 .
2656  It is possible to do this just for yourself, but if you're going to do
2657  it, you might as well share the results of your labors with the rest of
2658  the LyX community.
2659  Send a message to the LyX developers' list for more information about how
2660  to proceed.
2661 \end_layout
2662
2663 \begin_layout Standard
2664 In short, this is what you should do (xx denotes the language code):
2665 \end_layout
2666
2667 \begin_layout Itemize
2668 Check out the LyX source code.
2669  (See the 
2670 \begin_inset CommandInset href
2671 LatexCommand href
2672 name "information on the web"
2673 target "http://www.lyx.org/devel/cvs.php"
2674
2675 \end_inset
2676
2677 .)
2678 \end_layout
2679
2680 \begin_layout Itemize
2681 Copy the file 
2682 \begin_inset Flex CharStyle:Code
2683 status collapsed
2684
2685 \begin_layout Plain Layout
2686 lyx.pot
2687 \end_layout
2688
2689 \end_inset
2690
2691  to the folder of the 
2692 \begin_inset Flex CharStyle:Code
2693 status collapsed
2694
2695 \begin_layout Plain Layout
2696 **.po
2697 \end_layout
2698
2699 \end_inset
2700
2701  files.
2702  Then rename it to 
2703 \begin_inset Flex CharStyle:Code
2704 status collapsed
2705
2706 \begin_layout Plain Layout
2707 xx.po
2708 \end_layout
2709
2710 \end_inset
2711
2712 .
2713  (If 
2714 \begin_inset Flex CharStyle:Code
2715 status collapsed
2716
2717 \begin_layout Plain Layout
2718 lyx.pot
2719 \end_layout
2720
2721 \end_inset
2722
2723  doesn't exist anywhere, it can be remade with the console command 
2724 \begin_inset Flex CharStyle:Code
2725 status collapsed
2726
2727 \begin_layout Plain Layout
2728 make lyx.pot
2729 \end_layout
2730
2731 \end_inset
2732
2733  in that directory, or you can use an existing po-file for some other language
2734  as a template).
2735 \end_layout
2736
2737 \begin_layout Itemize
2738 Edit 
2739 \begin_inset Flex CharStyle:Code
2740 status collapsed
2741
2742 \begin_layout Plain Layout
2743 xx.po
2744 \end_layout
2745
2746 \end_inset
2747
2748 .
2749 \begin_inset Foot
2750 status collapsed
2751
2752 \begin_layout Plain Layout
2753 This is just a text file, so it can be edited in any text editor.
2754  But there are also specialized programs that support such editing, such
2755  as 
2756 \family typewriter
2757 Poedit
2758 \family default
2759  (for all platforms) or 
2760 \family typewriter
2761 KBabel
2762 \family default
2763  (for KDE).
2764  
2765 \family typewriter
2766 Emacs
2767 \family default
2768  contains a `mode' for editing 
2769 \begin_inset Flex CharStyle:Code
2770 status collapsed
2771
2772 \begin_layout Plain Layout
2773 po
2774 \end_layout
2775
2776 \end_inset
2777
2778  files, as well.
2779 \end_layout
2780
2781 \end_inset
2782
2783  For some menu- and widget-labels, there are also shortcut keys that should
2784  be translated.
2785  Those keys are marked after a `|', and should be translated according to
2786  the words and phrases of the language.
2787  You should also fill also out the information at the beginning of the new
2788  
2789 \begin_inset Flex CharStyle:Code
2790 status collapsed
2791
2792 \begin_layout Plain Layout
2793 po
2794 \end_layout
2795
2796 \end_inset
2797
2798 -file with your email-address, etc., so people know where to reach you with
2799  suggestions and entertaining flames.
2800 \end_layout
2801
2802 \begin_layout Standard
2803 If you are just doing this on your own, then:
2804 \end_layout
2805
2806 \begin_layout Itemize
2807 Generate 
2808 \begin_inset Flex CharStyle:Code
2809 status collapsed
2810
2811 \begin_layout Plain Layout
2812 xx.mo
2813 \end_layout
2814
2815 \end_inset
2816
2817 .
2818  This can be done with 
2819 \begin_inset Flex CharStyle:Code
2820 status collapsed
2821
2822 \begin_layout Plain Layout
2823 msgfmt -o xx.mo < xx.po
2824 \end_layout
2825
2826 \end_inset
2827
2828 .
2829 \end_layout
2830
2831 \begin_layout Itemize
2832 Copy the 
2833 \begin_inset Flex CharStyle:Code
2834 status collapsed
2835
2836 \begin_layout Plain Layout
2837 mo
2838 \end_layout
2839
2840 \end_inset
2841
2842 -file to your locale-tree, at the correct directory for application messages
2843  for the language
2844 \series bold
2845  
2846 \series default
2847 xx, and under the name 
2848 \begin_inset Flex CharStyle:Code
2849 status collapsed
2850
2851 \begin_layout Plain Layout
2852 lyx.mo
2853 \end_layout
2854
2855 \end_inset
2856
2857  (e.g.
2858 \begin_inset space \space{}
2859 \end_inset
2860
2861
2862 \begin_inset Flex CharStyle:Code
2863 status collapsed
2864
2865 \begin_layout Plain Layout
2866 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2867 \end_layout
2868
2869 \end_inset
2870
2871
2872 \series bold
2873 .
2874 \end_layout
2875
2876 \begin_layout Standard
2877 As said, however, it would be best if the new 
2878 \begin_inset Flex CharStyle:Code
2879 status collapsed
2880
2881 \begin_layout Plain Layout
2882 po
2883 \end_layout
2884
2885 \end_inset
2886
2887 -file could be added to the LyX distribution, so others can use it.
2888  Adding it involves making additional changes to LyX.
2889  So send an email to the developers' mailing list if you're interested in
2890  doing that.
2891 \end_layout
2892
2893 \begin_layout Subsubsection
2894 Ambigous messages
2895 \end_layout
2896
2897 \begin_layout Standard
2898 Sometimes it turns out that one English message needs to be translated into
2899  different messages in the target language.
2900  One example is the message 
2901 \begin_inset Flex CharStyle:Code
2902 status collapsed
2903
2904 \begin_layout Plain Layout
2905 To
2906 \end_layout
2907
2908 \end_inset
2909
2910  which has the German translation 
2911 \lang german
2912 Nach
2913 \lang english
2914  or 
2915 \lang german
2916 Bis
2917 \lang english
2918 , depending upon exactly what the English 
2919 \begin_inset Quotes eld
2920 \end_inset
2921
2922 to
2923 \begin_inset Quotes erd
2924 \end_inset
2925
2926  means.
2927  GNU 
2928 \begin_inset Flex CharStyle:Code
2929 status collapsed
2930
2931 \begin_layout Plain Layout
2932 gettext
2933 \end_layout
2934
2935 \end_inset
2936
2937  does not handle such ambigous translations.
2938  Therefore you have to add some context information to the message: Instead
2939  of 
2940 \begin_inset Flex CharStyle:Code
2941 status collapsed
2942
2943 \begin_layout Plain Layout
2944 To
2945 \end_layout
2946
2947 \end_inset
2948
2949  it becomes 
2950 \begin_inset Flex CharStyle:Code
2951 status collapsed
2952
2953 \begin_layout Plain Layout
2954 To[[as in 'From format x to format y']]
2955 \end_layout
2956
2957 \end_inset
2958
2959  and 
2960 \begin_inset Flex CharStyle:Code
2961 status collapsed
2962
2963 \begin_layout Plain Layout
2964 To[[as in 'From page x to page y']].
2965 \end_layout
2966
2967 \end_inset
2968
2969  Now the two occurences of 
2970 \begin_inset Flex CharStyle:Code
2971 status collapsed
2972
2973 \begin_layout Plain Layout
2974 To
2975 \end_layout
2976
2977 \end_inset
2978
2979  are different for 
2980 \begin_inset Flex CharStyle:Code
2981 status collapsed
2982
2983 \begin_layout Plain Layout
2984 gettext
2985 \end_layout
2986
2987 \end_inset
2988
2989  and can be translated correctly to 
2990 \lang german
2991 Nach
2992 \lang english
2993  and 
2994 \lang german
2995 Bis
2996 \lang english
2997 , respectively.
2998 \end_layout
2999
3000 \begin_layout Standard
3001 Of course the context information needs to be stripped off the original
3002  message when no translation is used.
3003  Therefore you have to put it in double square brackets at the end of the
3004  message (see the example above).
3005  The translation mechanism of LyX ensures that everything in double square
3006  brackets at the end of messages is removed before displaying the message.
3007 \end_layout
3008
3009 \begin_layout Subsection
3010 Translating the documentation.
3011 \end_layout
3012
3013 \begin_layout Standard
3014 The online documentation (in the 
3015 \begin_inset Flex CharStyle:MenuItem
3016 status collapsed
3017
3018 \begin_layout Plain Layout
3019
3020 \bar under
3021 H
3022 \bar default
3023 elp
3024 \end_layout
3025
3026 \end_inset
3027
3028 -menu) can (and should!) be translated.
3029  If there are translated versions of the documentation available
3030 \begin_inset Foot
3031 status collapsed
3032
3033 \begin_layout Plain Layout
3034 As of March 2008, at least some of the documents have been translated into
3035  fourteen languages, with the Tutorial available in a few more.
3036 \end_layout
3037
3038 \end_inset
3039
3040  and the locale is set accordingly, these will be used automagically by
3041  LyX.
3042  LyX looks for translated versions as 
3043 \begin_inset Flex CharStyle:Code
3044 status collapsed
3045
3046 \begin_layout Plain Layout
3047 LyXDir/doc/xx_DocName.lyx
3048 \end_layout
3049
3050 \end_inset
3051
3052 , where 
3053 \begin_inset Flex CharStyle:Code
3054 status collapsed
3055
3056 \begin_layout Plain Layout
3057 xx
3058 \end_layout
3059
3060 \end_inset
3061
3062  is the code for the language currently in use.
3063  If there are no translated documents, the default English versions will
3064  be displayed.
3065  Note that the translated versions must have the same filenames (
3066 \begin_inset Flex CharStyle:Code
3067 status collapsed
3068
3069 \begin_layout Plain Layout
3070 DocName
3071 \end_layout
3072
3073 \end_inset
3074
3075  above) as the original.
3076  If you feel up to translating the documentation (an excellent way to proof-read
3077  the original documentation by the way!), there are a few things you should
3078  do right away:
3079 \end_layout
3080
3081 \begin_layout Itemize
3082 Read 
3083 \begin_inset Flex CharStyle:Code
3084 status collapsed
3085
3086 \begin_layout Plain Layout
3087 DocStyle.lyx
3088 \end_layout
3089
3090 \end_inset
3091
3092 , the guide to writing LyX documentation.
3093  Pay special attention to the translator's section.
3094 \end_layout
3095
3096 \begin_layout Itemize
3097 Check out the documentation translation web page at 
3098 \begin_inset CommandInset href
3099 LatexCommand href
3100 name "http://www.lyx.org/Translation"
3101 target "http://www.lyx.org/Translation"
3102
3103 \end_inset
3104
3105 .
3106  That way, you can find out which (if any) documents have already been translate
3107 d into your language.
3108  You can also find out who (if anyone) is organizing the effort to translate
3109  the documentation into your language.
3110  If no one is organizing the effort, please let us know that you're interested.
3111 \end_layout
3112
3113 \begin_layout Standard
3114 Once you get to actually translating, here's a few hints for you that may
3115  save you trouble:
3116 \end_layout
3117
3118 \begin_layout Itemize
3119 Join the documentation team! There is information on how to do that in 
3120 \begin_inset Flex CharStyle:Code
3121 status collapsed
3122
3123 \begin_layout Plain Layout
3124 Intro.lyx
3125 \end_layout
3126
3127 \end_inset
3128
3129  (
3130 \begin_inset Flex CharStyle:MenuItem
3131 status collapsed
3132
3133 \begin_layout Plain Layout
3134
3135 \bar under
3136 H
3137 \bar default
3138 elp\SpecialChar \menuseparator
3139
3140 \bar under
3141 I
3142 \bar default
3143 ntroduction
3144 \end_layout
3145
3146 \end_inset
3147
3148 ), which by the way is the first document you should translate.
3149 \end_layout
3150
3151 \begin_layout Itemize
3152 Learn the typographic conventions for the language you are translating to.
3153  Typography is an ancient art and over the centuries, a great variety of
3154  conventions have developed throughout different parts of the world.
3155  Also study the professional terminology amongst typographers in your country.
3156  Inventing your own terminology will only confuse the users.
3157  
3158 \emph on
3159 (Warning! Typography is addictive!)
3160 \end_layout
3161
3162 \begin_layout Itemize
3163 Make a copy of the document.
3164  This will be your working copy.
3165  You can use this as your personal translated help-file by placing it in
3166  your 
3167 \begin_inset Flex CharStyle:Code
3168 status collapsed
3169
3170 \begin_layout Plain Layout
3171 UserDir/doc/
3172 \end_layout
3173
3174 \end_inset
3175
3176  directory.
3177 \end_layout
3178
3179 \begin_layout Itemize
3180 Sometimes the original document (from the LyX-team) will be updated.
3181  Use the source viewer at 
3182 \begin_inset CommandInset href
3183 LatexCommand href
3184 name "http://www.lyx.org/trac/timeline"
3185 target "http://www.lyx.org/trac/timeline"
3186
3187 \end_inset
3188
3189  to see what has been changed.
3190  That way you can easily see which parts of the translated document need
3191  to be updated.
3192 \end_layout
3193
3194 \begin_layout Standard
3195 If you ever find an error in the original document, fix it and notify the
3196  rest of the documentation team of the changes! (You didn't forget to join
3197  the documentation team, did you?)
3198 \end_layout
3199
3200 \begin_layout Standard
3201 \begin_inset Branch OutDated
3202 status collapsed
3203
3204 \begin_layout Section
3205 International Keyboard Support
3206 \end_layout
3207
3208 \begin_layout Standard
3209
3210 \emph on
3211 [Editor's Note: The following section is by
3212 \emph default
3213  
3214 \shape smallcaps
3215 \emph on
3216 Ivan Schreter
3217 \shape default
3218 .
3219  It needs to be fixed to conform to the new Documentation Style sheet and
3220  to make use of the new v1.0 features.
3221  The whole thing also needs to be merged with the section following it.-jw
3222  It may also be badly out of date.-rh (2008)]
3223 \end_layout
3224
3225 \begin_layout Subsection
3226 Defining Own Keymaps: Keymap File Format
3227 \end_layout
3228
3229 \begin_layout Standard
3230 Let's look at a keyboard definition file a little closer.
3231  It is a plain text file defining
3232 \end_layout
3233
3234 \begin_layout Itemize
3235 key-to-key or key-to-string translations
3236 \end_layout
3237
3238 \begin_layout Itemize
3239 dead keys
3240 \end_layout
3241
3242 \begin_layout Itemize
3243 dead keys exceptions
3244 \end_layout
3245
3246 \begin_layout Standard
3247 To define key-to-key or key-to-string translation, use this command:
3248 \end_layout
3249
3250 \begin_layout Quotation
3251 \begin_inset Flex CharStyle:Code
3252 status collapsed
3253
3254 \begin_layout Plain Layout
3255
3256 \backslash
3257 kmap
3258 \end_layout
3259
3260 \end_inset
3261
3262  
3263 \begin_inset Flex CharStyle:Code
3264 status collapsed
3265
3266 \begin_layout Plain Layout
3267 key
3268 \end_layout
3269
3270 \end_inset
3271
3272  outstring 
3273 \end_layout
3274
3275 \begin_layout Standard
3276 where 
3277 \begin_inset Flex CharStyle:Code
3278 status collapsed
3279
3280 \begin_layout Plain Layout
3281 key
3282 \end_layout
3283
3284 \end_inset
3285
3286  is the key to be translated and 
3287 \begin_inset Flex CharStyle:Code
3288 status collapsed
3289
3290 \begin_layout Plain Layout
3291 outstring
3292 \end_layout
3293
3294 \end_inset
3295
3296  is the string to be inserted into the document.
3297  To define dead keys, use:
3298 \end_layout
3299
3300 \begin_layout Quotation
3301 \begin_inset Flex CharStyle:Code
3302 status collapsed
3303
3304 \begin_layout Plain Layout
3305
3306 \backslash
3307 kmod
3308 \end_layout
3309
3310 \end_inset
3311
3312  
3313 \begin_inset Flex CharStyle:Code
3314 status collapsed
3315
3316 \begin_layout Plain Layout
3317 key
3318 \end_layout
3319
3320 \end_inset
3321
3322  deadkey
3323 \end_layout
3324
3325 \begin_layout Standard
3326 where 
3327 \begin_inset Flex CharStyle:Code
3328 status collapsed
3329
3330 \begin_layout Plain Layout
3331 key
3332 \end_layout
3333
3334 \end_inset
3335
3336  is a keyboard key and 
3337 \begin_inset Flex CharStyle:Code
3338 status collapsed
3339
3340 \begin_layout Plain Layout
3341 deadkey
3342 \end_layout
3343
3344 \end_inset
3345
3346  is dead key name.
3347  The following dead keys are supported (shortcut name is in parentheses):
3348 \end_layout
3349
3350 \begin_layout Quotation
3351
3352 \emph on
3353 Name
3354 \begin_inset space \hfill{}
3355 \end_inset
3356
3357 Example
3358 \end_layout
3359
3360 \begin_layout Quotation
3361 acute (acu)
3362 \begin_inset space \hfill{}
3363 \end_inset
3364
3365 áéíóú
3366 \end_layout
3367
3368 \begin_layout Quotation
3369 grave (gra)
3370 \begin_inset space \hfill{}
3371 \end_inset
3372
3373 àèìòù
3374 \end_layout
3375
3376 \begin_layout Quotation
3377 macron (mac)
3378 \begin_inset space \hfill{}
3379 \end_inset
3380
3381  ō
3382 \end_layout
3383
3384 \begin_layout Quotation
3385 tilde (til)
3386 \begin_inset space \hfill{}
3387 \end_inset
3388
3389 ñÑ
3390 \end_layout
3391
3392 \begin_layout Quotation
3393 underbar (underb)
3394 \begin_inset space \hfill{}
3395 \end_inset
3396
3397
3398 \begin_inset ERT
3399 status open
3400
3401 \begin_layout Plain Layout
3402
3403
3404 \backslash
3405 b o
3406 \end_layout
3407
3408 \end_inset
3409
3410
3411 \end_layout
3412
3413 \begin_layout Quotation
3414 cedilla (ced)
3415 \begin_inset space \hfill{}
3416 \end_inset
3417
3418 çÇ
3419 \end_layout
3420
3421 \begin_layout Quotation
3422 underdot (underd)
3423 \begin_inset space \hfill{}
3424 \end_inset
3425
3426
3427 \begin_inset ERT
3428 status open
3429
3430 \begin_layout Plain Layout
3431
3432
3433 \backslash
3434 d o
3435 \end_layout
3436
3437 \end_inset
3438
3439
3440 \end_layout
3441
3442 \begin_layout Quotation
3443 circumflex (circu)
3444 \begin_inset space \hfill{}
3445 \end_inset
3446
3447 âêîôû
3448 \end_layout
3449
3450 \begin_layout Quotation
3451 circle (circl)
3452 \begin_inset space \hfill{}
3453 \end_inset
3454
3455 ÅůŮ
3456 \end_layout
3457
3458 \begin_layout Quotation
3459 tie (tie)
3460 \begin_inset space \hfill{}
3461 \end_inset
3462
3463
3464 \begin_inset ERT
3465 status open
3466
3467 \begin_layout Plain Layout
3468
3469
3470 \backslash
3471 t o
3472 \end_layout
3473
3474 \end_inset
3475
3476
3477 \end_layout
3478
3479 \begin_layout Quotation
3480 breve (bre)
3481 \begin_inset space \hfill{}
3482 \end_inset
3483
3484 ă
3485 \begin_inset ERT
3486 status open
3487
3488 \begin_layout Plain Layout
3489
3490
3491 \backslash
3492 u o
3493 \end_layout
3494
3495 \end_inset
3496
3497
3498 \end_layout
3499
3500 \begin_layout Quotation
3501 caron (car)
3502 \begin_inset space \hfill{}
3503 \end_inset
3504
3505 čšž
3506 \end_layout
3507
3508 \begin_layout Quotation
3509 hungarian umlaut (hug)
3510 \begin_inset space \hfill{}
3511 \end_inset
3512
3513 őű
3514 \end_layout
3515
3516 \begin_layout Quotation
3517 umlaut (uml)
3518 \begin_inset space \hfill{}
3519 \end_inset
3520
3521 äöü
3522 \end_layout
3523
3524 \begin_layout Quotation
3525 dot (dot)
3526 \begin_inset space \hfill{}
3527 \end_inset
3528
3529 ż
3530 \begin_inset ERT
3531 status open
3532
3533 \begin_layout Plain Layout
3534
3535
3536 \backslash
3537 .s
3538 \end_layout
3539
3540 \end_inset
3541
3542
3543 \end_layout
3544
3545 \begin_layout Standard
3546 Since in many international keyboards there are exceptions to what some
3547  dead keys should do, you can define them using
3548 \end_layout
3549
3550 \begin_layout Quotation
3551 \begin_inset Flex CharStyle:Code
3552 status collapsed
3553
3554 \begin_layout Plain Layout
3555
3556 \backslash
3557 kxmod
3558 \end_layout
3559
3560 \end_inset
3561
3562  deadkey key outstring
3563 \end_layout
3564
3565 \begin_layout Standard
3566 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3567 , so you put in
3568 \end_layout
3569
3570 \begin_layout Quotation
3571 \begin_inset Flex CharStyle:Code
3572 status collapsed
3573
3574 \begin_layout Plain Layout
3575
3576 \backslash
3577 kxmod
3578 \end_layout
3579
3580 \end_inset
3581
3582  caron o "
3583 \backslash
3584 ^o"
3585 \end_layout
3586
3587 \begin_layout Standard
3588 to make it work correctly.
3589  Also, you have to define as exceptions dead keys over i and j, to remove
3590  the dot from them before inserting an accent mark.
3591  I will change this when the time comes, but so far I haven't had time.
3592 \end_layout
3593
3594 \begin_layout Standard
3595 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3596  double backslash.
3597  Also, quotes and 
3598 \begin_inset Flex CharStyle:Code
3599 status collapsed
3600
3601 \begin_layout Plain Layout
3602 #
3603 \end_layout
3604
3605 \end_inset
3606
3607  have different meaning.
3608  
3609 \begin_inset Flex CharStyle:Code
3610 status collapsed
3611
3612 \begin_layout Plain Layout
3613 #
3614 \end_layout
3615
3616 \end_inset
3617
3618  marks comments, quotes start and end LaTeX-style commands.
3619  To enter quote, you'll need to use 
3620 \begin_inset Flex CharStyle:Code
3621 status collapsed
3622
3623 \begin_layout Plain Layout
3624
3625 \backslash
3626 "
3627 \end_layout
3628
3629 \end_inset
3630
3631 , to enter 
3632 \begin_inset Flex CharStyle:Code
3633 status collapsed
3634
3635 \begin_layout Plain Layout
3636 #
3637 \end_layout
3638
3639 \end_inset
3640
3641 , use 
3642 \begin_inset Flex CharStyle:Code
3643 status collapsed
3644
3645 \begin_layout Plain Layout
3646
3647 \backslash
3648 #
3649 \end_layout
3650
3651 \end_inset
3652
3653 .
3654 \end_layout
3655
3656 \begin_layout Standard
3657 If you make a keyboard description file that works for your language, please
3658  mail it to me, so I can include it in the next keymap distribution.
3659 \end_layout
3660
3661 \begin_layout Standard
3662 More keywords will be supported in keymap configuration file in future,
3663  like
3664 \end_layout
3665
3666 \begin_layout Itemize
3667 \begin_inset Flex CharStyle:Code
3668 status collapsed
3669
3670 \begin_layout Plain Layout
3671
3672 \backslash
3673 kinclude filename
3674 \end_layout
3675
3676 \end_inset
3677
3678
3679 \emph on
3680
3681 \begin_inset space \hfill{}
3682 \end_inset
3683
3684
3685 \begin_inset Flex CharStyle:Code
3686 status collapsed
3687
3688 \begin_layout Plain Layout
3689 include
3690 \end_layout
3691
3692 \end_inset
3693
3694  another file
3695 \end_layout
3696
3697 \begin_layout Itemize
3698 \begin_inset Flex CharStyle:Code
3699 status collapsed
3700
3701 \begin_layout Plain Layout
3702
3703 \backslash
3704 kprog program
3705 \end_layout
3706
3707 \end_inset
3708
3709
3710 \emph on
3711
3712 \begin_inset space \hfill{}
3713 \end_inset
3714
3715
3716 \begin_inset Flex CharStyle:Code
3717 status collapsed
3718
3719 \begin_layout Plain Layout
3720 define
3721 \end_layout
3722
3723 \end_inset
3724
3725  an external keymap translation program 
3726 \end_layout
3727
3728 \begin_layout Standard
3729 Also, it should look into 
3730 \begin_inset Flex CharStyle:Code
3731 status collapsed
3732
3733 \begin_layout Plain Layout
3734 lyxrc
3735 \end_layout
3736
3737 \end_inset
3738
3739  file for defaults, too (for example, a 
3740 \begin_inset Flex CharStyle:Code
3741 status collapsed
3742
3743 \begin_layout Plain Layout
3744
3745 \backslash
3746 kinclude
3747 \end_layout
3748
3749 \end_inset
3750
3751  option to include default keyboard).
3752 \end_layout
3753
3754 \end_inset
3755
3756
3757 \end_layout
3758
3759 \begin_layout Section
3760 \begin_inset CommandInset label
3761 LatexCommand label
3762 name "sec:keymap"
3763
3764 \end_inset
3765
3766 International Keymap Stuff
3767 \end_layout
3768
3769 \begin_layout Standard
3770 \begin_inset Note Note
3771 status open
3772
3773 \begin_layout Plain Layout
3774 In doing the revisions on this document in March 2008, I did not look over
3775  this stuff, as I do not understand it.
3776  It would be good if someone else could do so.
3777 \end_layout
3778
3779 \end_inset
3780
3781
3782 \end_layout
3783
3784 \begin_layout Standard
3785 The next two sections describe the 
3786 \begin_inset Flex CharStyle:Code
3787 status collapsed
3788
3789 \begin_layout Plain Layout
3790
3791 \shape up
3792 .kmap
3793 \end_layout
3794
3795 \end_inset
3796
3797  and 
3798 \begin_inset Flex CharStyle:Code
3799 status collapsed
3800
3801 \begin_layout Plain Layout
3802
3803 \shape up
3804 .cdef
3805 \end_layout
3806
3807 \end_inset
3808
3809  file syntax in detail.
3810  These sections should help you design your own key map if the ones provided
3811  do not meet your needs.
3812 \end_layout
3813
3814 \begin_layout Subsection
3815 The .kmap File
3816 \end_layout
3817
3818 \begin_layout Standard
3819
3820 \shape up
3821 .
3822 \begin_inset Flex CharStyle:Code
3823 status collapsed
3824
3825 \begin_layout Plain Layout
3826 kmap
3827 \end_layout
3828
3829 \end_inset
3830
3831  file maps keystrokes to characters or strings.
3832  As the name suggests, it sets a keyboard mapping.
3833  The 
3834 \begin_inset Flex CharStyle:Code
3835 status collapsed
3836
3837 \begin_layout Plain Layout
3838 .kmap
3839 \end_layout
3840
3841 \end_inset
3842
3843
3844 \shape default
3845  file keywords 
3846 \shape up
3847
3848 \begin_inset Flex CharStyle:Code
3849 status collapsed
3850
3851 \begin_layout Plain Layout
3852
3853 \shape up
3854 kmap
3855 \end_layout
3856
3857 \end_inset
3858
3859
3860 \shape default
3861 ,
3862 \shape up
3863  
3864 \shape default
3865
3866 \begin_inset Flex CharStyle:Code
3867 status collapsed
3868
3869 \begin_layout Plain Layout
3870
3871 \shape up
3872 kmod
3873 \end_layout
3874
3875 \end_inset
3876
3877 ,
3878 \shape up
3879  
3880 \shape default
3881
3882 \begin_inset Flex CharStyle:Code
3883 status collapsed
3884
3885 \begin_layout Plain Layout
3886
3887 \shape up
3888 ksmod
3889 \end_layout
3890
3891 \end_inset
3892
3893 , and 
3894 \begin_inset Flex CharStyle:Code
3895 status collapsed
3896
3897 \begin_layout Plain Layout
3898
3899 \shape up
3900 kcomb
3901 \end_layout
3902
3903 \end_inset
3904
3905  are described in this section.
3906 \end_layout
3907
3908 \begin_layout Labeling
3909 \labelwidthstring 00.00.0000
3910 \begin_inset Flex CharStyle:Code
3911 status collapsed
3912
3913 \begin_layout Plain Layout
3914
3915 \shape up
3916 kmap
3917 \end_layout
3918
3919 \end_inset
3920
3921  Map a character to a string
3922 \end_layout
3923
3924 \begin_layout LyX-Code
3925
3926 \backslash
3927 kmap 
3928 \family roman
3929 \emph on
3930 char
3931 \family default
3932 \emph default
3933  
3934 \family roman
3935 \emph on
3936 string
3937 \end_layout
3938
3939 \begin_layout Standard
3940 This will ma
3941 \family roman
3942 p
3943 \family default
3944  
3945 \family roman
3946 \emph on
3947 char
3948 \family default
3949 \emph default
3950  
3951 \family roman
3952 to
3953 \family default
3954  
3955 \family roman
3956 \emph on
3957 string
3958 \emph default
3959 .
3960  Note that in
3961 \family default
3962  
3963 \family roman
3964 \emph on
3965 string
3966 \emph default
3967 ,
3968 \family default
3969  
3970 \family roman
3971 \shape up
3972 the double-quote (")
3973 \family default
3974 \shape default
3975  
3976 \family roman
3977 and
3978 \family default
3979  
3980 \family roman
3981 \shape up
3982 the backslash (
3983 \backslash
3984 )
3985 \family default
3986 \shape default
3987  
3988 \family roman
3989 must be escaped with a preceding backslash (
3990 \shape up
3991
3992 \backslash
3993
3994 \shape default
3995 )
3996 \family default
3997 .
3998 \end_layout
3999
4000 \begin_layout Standard
4001 An example of a 
4002 \begin_inset Flex CharStyle:MenuItem
4003 status collapsed
4004
4005 \begin_layout Plain Layout
4006
4007 \shape up
4008 kmap
4009 \end_layout
4010
4011 \end_inset
4012
4013  statement to cause the symbol 
4014 \begin_inset Flex CharStyle:MenuItem
4015 status collapsed
4016
4017 \begin_layout Plain Layout
4018
4019 \shape up
4020 /
4021 \end_layout
4022
4023 \end_inset
4024
4025  to be output for the keystroke 
4026 \begin_inset Flex CharStyle:MenuItem
4027 status collapsed
4028
4029 \begin_layout Plain Layout
4030
4031 \shape up
4032 &
4033 \end_layout
4034
4035 \end_inset
4036
4037  is:
4038 \end_layout
4039
4040 \begin_layout LyX-Code
4041
4042 \backslash
4043 kmap & /
4044 \end_layout
4045
4046 \begin_layout Labeling
4047 \labelwidthstring 00.00.0000
4048 \begin_inset Flex CharStyle:Code
4049 status collapsed
4050
4051 \begin_layout Plain Layout
4052
4053 \shape up
4054 kmod
4055 \end_layout
4056
4057 \end_inset
4058
4059  Specify an accent character
4060 \end_layout
4061
4062 \begin_layout LyX-Code
4063
4064 \backslash
4065 kmod 
4066 \family roman
4067 \emph on
4068 char accent allowed
4069 \end_layout
4070
4071 \begin_layout Standard
4072 This will make the cha
4073 \family roman
4074 racter
4075 \family default
4076  
4077 \family roman
4078 \emph on
4079 char
4080 \family default
4081 \emph default
4082  
4083 \family roman
4084 \shape up
4085 \emph on
4086 be an accent
4087 \family default
4088 \shape default
4089 \emph default
4090  
4091 \family roman
4092 \shape up
4093 on the
4094 \family default
4095 \shape default
4096  
4097 \family roman
4098 \shape up
4099 \emph on
4100 allowed
4101 \family default
4102 \shape default
4103 \emph default
4104  
4105 \family roman
4106 \shape up
4107 cha
4108 \family default
4109 racter(s).
4110  This is the dead key
4111 \begin_inset Foot
4112 status collapsed
4113
4114 \begin_layout Plain Layout
4115 The term 
4116 \family roman
4117 \emph on
4118 dead key
4119 \family default
4120 \emph default
4121  refers to a key that does not produce a character by itself, but when followed
4122  with another key, produces the desired accent character.
4123  For example, a German characte
4124 \family roman
4125 r with an umlaut like
4126 \family default
4127  
4128 \family roman
4129 \emph on
4130 ä
4131 \family default
4132 \emph default
4133  
4134 \family roman
4135 can be produced in this manner.
4136 \end_layout
4137
4138 \end_inset
4139
4140  mechanism.
4141  
4142 \end_layout
4143
4144 \begin_layout Standard
4145 If you 
4146 \family roman
4147 hit
4148 \family default
4149  
4150 \family roman
4151 \emph on
4152 char
4153 \family default
4154 \emph default
4155  
4156 \family roman
4157 and then another key not in
4158 \family default
4159  
4160 \family roman
4161 \emph on
4162 allowed
4163 \emph default
4164 , you will get a
4165 \family default
4166  
4167 \family roman
4168 \emph on
4169 char
4170 \family default
4171 \emph default
4172  
4173 \family roman
4174 followed by the other, unallowed key, as output.
4175
4176 \family default
4177  Note that a 
4178 \begin_inset Flex CharStyle:MenuItem
4179 status collapsed
4180
4181 \begin_layout Plain Layout
4182
4183 \shape up
4184 Backspace
4185 \end_layout
4186
4187 \end_inset
4188
4189  cancels a dead key, so if 
4190 \family roman
4191 you hit
4192 \family default
4193  
4194 \family roman
4195 \emph on
4196 char
4197 \family default
4198 \emph default
4199  
4200 \begin_inset Flex CharStyle:MenuItem
4201 status collapsed
4202
4203 \begin_layout Plain Layout
4204
4205 \shape up
4206 \emph on
4207 Backspace
4208 \end_layout
4209
4210 \end_inset
4211
4212 , the cursor will not go one position backwards but will instead cancel
4213  the effect t
4214 \family roman
4215 hat
4216 \family default
4217  
4218 \family roman
4219 \shape up
4220 \emph on
4221 char
4222 \family default
4223 \shape default
4224 \emph default
4225  
4226 \family roman
4227 \shape up
4228 might have had on the next keystroke.
4229  
4230 \end_layout
4231
4232 \begin_layout Standard
4233 The following example specifies that the character ' is to be an acute accent,
4234  allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4235 \end_layout
4236
4237 \begin_layout LyX-Code
4238
4239 \backslash
4240 kmod ' acute aeiouAEIOU
4241 \end_layout
4242
4243 \begin_layout Labeling
4244 \labelwidthstring 00.00.0000
4245 \begin_inset Flex CharStyle:Code
4246 status collapsed
4247
4248 \begin_layout Plain Layout
4249 ksmod
4250 \end_layout
4251
4252 \end_inset
4253
4254  Specify an exception to the accent character
4255 \end_layout
4256
4257 \begin_layout LyX-Code
4258
4259 \backslash
4260 kxmod  
4261 \family roman
4262 \emph on
4263 accent char result
4264 \end_layout
4265
4266 \begin_layout Standard
4267 This defines an exce
4268 \family roman
4269 ption for
4270 \family default
4271  
4272 \family roman
4273 \emph on
4274 accent
4275 \family default
4276 \emph default
4277  
4278 \family roman
4279 on
4280 \family default
4281  
4282 \family roman
4283 \emph on
4284 char
4285 \emph default
4286 .
4287  T
4288 \shape up
4289 he
4290 \family default
4291 \shape default
4292  
4293 \family roman
4294 \shape up
4295 \emph on
4296 accent
4297 \family default
4298 \shape default
4299 \emph default
4300  
4301 \family roman
4302 \shape up
4303 must
4304 \family default
4305 \shape default
4306  
4307 \shape up
4308 have been assigned a keystroke with a previous
4309 \shape default
4310  
4311 \begin_inset Flex CharStyle:Code
4312 status collapsed
4313
4314 \begin_layout Plain Layout
4315
4316 \shape up
4317
4318 \backslash
4319 kmo
4320 \shape default
4321 d
4322 \end_layout
4323
4324 \end_inset
4325
4326  declar
4327 \family roman
4328 ation and
4329 \family default
4330  
4331 \family roman
4332 \emph on
4333 char
4334 \family default
4335 \emph default
4336  
4337 \family roman
4338 must not belong in the
4339 \family default
4340  
4341 \family roman
4342 \emph on
4343 allowed
4344 \family default
4345 \emph default
4346  
4347 \family roman
4348 set of
4349 \family default
4350  
4351 \family roman
4352 \emph on
4353 accent
4354 \emph default
4355 .
4356  When
4357 \family default
4358  
4359 \family roman
4360 \shape up
4361 you enter the
4362 \family default
4363 \shape default
4364  
4365 \family roman
4366 \shape up
4367 \emph on
4368 accent char
4369 \family default
4370 \shape default
4371 \emph default
4372  
4373 \family roman
4374 \shape up
4375 sequence,
4376 \family default
4377 \shape default
4378  
4379 \family roman
4380 \shape up
4381 \emph on
4382 result
4383 \emph default
4384  is produced.
4385  If such a declaration does not exist in
4386 \family default
4387 \shape default
4388  
4389 \shape up
4390 the
4391 \shape default
4392  
4393 \begin_inset Flex CharStyle:Code
4394 status collapsed
4395
4396 \begin_layout Plain Layout
4397
4398 \shape up
4399 .kmap
4400 \end_layout
4401
4402 \end_inset
4403
4404  file and yo
4405 \family roman
4406 u enter
4407 \family default
4408  
4409 \family roman
4410 \emph on
4411 accent char
4412 \emph default
4413 , you get
4414 \family default
4415  
4416 \family roman
4417 \emph on
4418 accent_key char
4419 \emph default
4420  where
4421 \family default
4422  
4423 \family roman
4424 \emph on
4425 accent_key
4426 \emph default
4427  is the first arg
4428 \family default
4429 ument of the 
4430 \begin_inset Flex CharStyle:Code
4431 status collapsed
4432
4433 \begin_layout Plain Layout
4434
4435 \shape up
4436
4437 \backslash
4438 kmod
4439 \end_layout
4440
4441 \end_inset
4442
4443  declaration.
4444  
4445 \end_layout
4446
4447 \begin_layout Standard
4448 The following command produces causes äi to be produced when you enter acute-i
4449  ('i):
4450 \end_layout
4451
4452 \begin_layout LyX-Code
4453
4454 \backslash
4455 kxmod acute i "
4456 \backslash
4457
4458 \backslash
4459 '{
4460 \backslash
4461
4462 \backslash
4463 i}"
4464 \end_layout
4465
4466 \begin_layout Labeling
4467 \labelwidthstring 00.00.0000
4468 \begin_inset Flex CharStyle:Code
4469 status collapsed
4470
4471 \begin_layout Plain Layout
4472 kcomb
4473 \end_layout
4474
4475 \end_inset
4476
4477  Combine two accent characters
4478 \end_layout
4479
4480 \begin_layout LyX-Code
4481
4482 \backslash
4483 kcomb 
4484 \family roman
4485 \emph on
4486 accent1 accent2 allowed
4487 \end_layout
4488
4489 \begin_layout Standard
4490 This one is getting pretty esoteric.
4491  It allows you to combine the effect 
4492 \family roman
4493 of
4494 \family default
4495  
4496 \family roman
4497 \emph on
4498 accent1
4499 \family default
4500 \emph default
4501  
4502 \family roman
4503 and
4504 \family default
4505  
4506 \family roman
4507 \emph on
4508 accent2
4509 \family default
4510 \emph default
4511  
4512 \family roman
4513 (in that order!) on
4514 \family default
4515  
4516 \family roman
4517 \emph on
4518 allowed
4519 \family default
4520 \emph default
4521  
4522 \family roman
4523 chars.
4524  The keystrokes for
4525 \family default
4526  
4527 \family roman
4528 \emph on
4529 accent1
4530 \family default
4531 \emph default
4532  
4533 \family roman
4534 and
4535 \family default
4536  
4537 \family roman
4538 \emph on
4539 accent2
4540 \family default
4541 \emph default
4542  
4543 \family roman
4544 must have be
4545 \family default
4546 en set with a 
4547 \begin_inset Flex CharStyle:Code
4548 status collapsed
4549
4550 \begin_layout Plain Layout
4551
4552 \shape up
4553
4554 \backslash
4555 kmod
4556 \end_layout
4557
4558 \end_inset
4559
4560  command at 
4561 \family roman
4562 a
4563 \family default
4564  
4565 \family roman
4566 \emph on
4567 previous
4568 \family default
4569 \emph default
4570  
4571 \family roman
4572 point in the
4573 \family default
4574  file.
4575  
4576 \end_layout
4577
4578 \begin_layout Standard
4579 Consider this example from the 
4580 \begin_inset Flex CharStyle:Code
4581 status collapsed
4582
4583 \begin_layout Plain Layout
4584
4585 \shape up
4586 greek.kmap
4587 \end_layout
4588
4589 \end_inset
4590
4591  file:
4592 \end_layout
4593
4594 \begin_layout LyX-Code
4595
4596 \backslash
4597 kmod ; acute aeioyvhAEIOYVH 
4598 \backslash
4599 kmod : umlaut iyIY 
4600 \backslash
4601 kcomb acute umlaut iyIY
4602 \end_layout
4603
4604 \begin_layout Standard
4605 This allows you to press 
4606 \begin_inset Flex CharStyle:MenuItem
4607 status collapsed
4608
4609 \begin_layout Plain Layout
4610
4611 \shape up
4612 ;:i
4613 \end_layout
4614
4615 \end_inset
4616
4617  and get the effect of 
4618 \begin_inset Flex CharStyle:Code
4619 status collapsed
4620
4621 \begin_layout Plain Layout
4622
4623 \shape up
4624
4625 \backslash
4626 '{
4627 \backslash
4628 "{i}}
4629 \end_layout
4630
4631 \end_inset
4632
4633 .
4634  
4635 \family roman
4636 \shape up
4637 A backspace
4638 \family default
4639 \shape default
4640  in this case cancels the last dead key, so if you press 
4641 \begin_inset Flex CharStyle:MenuItem
4642 status collapsed
4643
4644 \begin_layout Plain Layout
4645
4646 \shape up
4647 ;: Backspace i
4648 \end_layout
4649
4650 \end_inset
4651
4652  you get 
4653 \begin_inset Flex CharStyle:Code
4654 status collapsed
4655
4656 \begin_layout Plain Layout
4657
4658 \shape up
4659
4660 \backslash
4661 '{i}
4662 \end_layout
4663
4664 \end_inset
4665
4666 .
4667 \end_layout
4668
4669 \begin_layout Subsection
4670 The .cdef File
4671 \end_layout
4672
4673 \begin_layout Standard
4674 After the 
4675 \begin_inset Flex CharStyle:Code
4676 status collapsed
4677
4678 \begin_layout Plain Layout
4679
4680 \shape up
4681 .kmap
4682 \end_layout
4683
4684 \end_inset
4685
4686  mapping is performed, a 
4687 \begin_inset Flex CharStyle:Code
4688 status collapsed
4689
4690 \begin_layout Plain Layout
4691
4692 \shape up
4693 .cde
4694 \shape default
4695 f
4696 \end_layout
4697
4698 \end_inset
4699
4700  file maps the strings that the symbols generate to characters in the current
4701  font.
4702  The LyX distribution currently includes at least the 
4703 \begin_inset Flex CharStyle:Code
4704 status collapsed
4705
4706 \begin_layout Plain Layout
4707
4708 \shape up
4709 iso8859-1.cdef
4710 \end_layout
4711
4712 \end_inset
4713
4714  and 
4715 \begin_inset Flex CharStyle:Code
4716 status collapsed
4717
4718 \begin_layout Plain Layout
4719
4720 \shape up
4721 iso8859-2.cdef
4722 \end_layout
4723
4724 \end_inset
4725
4726  files.
4727 \end_layout
4728
4729 \begin_layout Standard
4730 In general the 
4731 \begin_inset Flex CharStyle:Code
4732 status collapsed
4733
4734 \begin_layout Plain Layout
4735
4736 \shape up
4737 .cdef
4738 \end_layout
4739
4740 \end_inset
4741
4742  file is a sequence of declarations of the form
4743 \end_layout
4744
4745 \begin_layout LyX-Code
4746
4747 \family roman
4748 \emph on
4749 char_index_in_set
4750 \family default
4751 \emph default
4752  
4753 \family roman
4754 \emph on
4755  string
4756 \end_layout
4757
4758 \begin_layout Standard
4759 For example, in order to map 
4760 \begin_inset Flex CharStyle:MenuItem
4761 status collapsed
4762
4763 \begin_layout Plain Layout
4764
4765 \shape up
4766
4767 \backslash
4768 '{e}
4769 \end_layout
4770
4771 \end_inset
4772
4773  to the corresponding character in the iso-8859-1 set (233), the following
4774  declaration is used
4775 \end_layout
4776
4777 \begin_layout LyX-Code
4778 233 "
4779 \backslash
4780
4781 \backslash
4782 '{e}"
4783 \end_layout
4784
4785 \begin_layout Standard
4786 with 
4787 \begin_inset Flex CharStyle:Code
4788 status collapsed
4789
4790 \begin_layout Plain Layout
4791
4792 \backslash
4793
4794 \end_layout
4795
4796 \end_inset
4797
4798  and 
4799 \begin_inset Flex CharStyle:Code
4800 status collapsed
4801
4802 \begin_layout Plain Layout
4803 "
4804 \end_layout
4805
4806 \end_inset
4807
4808  being escap
4809 \family roman
4810 ed in
4811 \family default
4812  
4813 \family roman
4814 \emph on
4815 string
4816 \emph default
4817 .
4818  Note that
4819 \family default
4820  the same character can apply to more than one string.
4821  In the 
4822 \begin_inset Flex CharStyle:Code
4823 status collapsed
4824
4825 \begin_layout Plain Layout
4826 i
4827 \shape up
4828 so-8859-7.cdef
4829 \end_layout
4830
4831 \end_inset
4832
4833  file you have
4834 \end_layout
4835
4836 \begin_layout LyX-Code
4837 192 "
4838 \backslash
4839
4840 \backslash
4841 '{
4842 \backslash
4843
4844 \backslash
4845
4846 \backslash
4847 "{i}}"
4848 \begin_inset Newline newline
4849 \end_inset
4850
4851 192 "
4852 \backslash
4853
4854 \backslash
4855
4856 \backslash
4857 "{
4858 \backslash
4859
4860 \backslash
4861 '{i}}"
4862 \end_layout
4863
4864 \begin_layout Standard
4865 If LyX cannot find a mapping for the string produced by the keystroke or
4866  a deadkey sequence, it will check if it looks like an accented char and
4867  try to draw an accent over the character on screen.
4868 \end_layout
4869
4870 \begin_layout Subsection
4871 Dead Keys
4872 \end_layout
4873
4874 \begin_layout Standard
4875 There is a second way to add support for international characters through
4876  so-called dead-keys.
4877  A dead-key works in combination with a letter to produce an accented character.
4878  Here, we'll explain how to create a really simple dead-key to illustrate
4879  how they work.
4880 \end_layout
4881
4882 \begin_layout Standard
4883 Suppose you happen to need the circumflex character, 
4884 \begin_inset Quotes eld
4885 \end_inset
4886
4887  ̂
4888 \begin_inset Quotes erd
4889 \end_inset
4890
4891 .
4892  You could bind the 
4893 \begin_inset Flex CharStyle:MenuItem
4894 status collapsed
4895
4896 \begin_layout Plain Layout
4897 ^
4898 \end_layout
4899
4900 \end_inset
4901
4902 -key [a.k.a.
4903 \begin_inset space ~
4904 \end_inset
4905
4906
4907 \begin_inset Flex CharStyle:MenuItem
4908 status collapsed
4909
4910 \begin_layout Plain Layout
4911 Shift-6
4912 \end_layout
4913
4914 \end_inset
4915
4916 ] to the LyX command 
4917 \begin_inset Flex CharStyle:Code
4918 status collapsed
4919
4920 \begin_layout Plain Layout
4921 accent-circumflex
4922 \end_layout
4923
4924 \end_inset
4925
4926  in your 
4927 \begin_inset Flex CharStyle:Code
4928 status collapsed
4929
4930 \begin_layout Plain Layout
4931 lyxrc
4932 \end_layout
4933
4934 \end_inset
4935
4936  file.
4937  Now, whenever you type the 
4938 \begin_inset Flex CharStyle:MenuItem
4939 status collapsed
4940
4941 \begin_layout Plain Layout
4942 ^
4943 \end_layout
4944
4945 \end_inset
4946
4947 -key followed by a letter, that letter will have a circumflex accent on
4948  it.
4949  For example, the sequence 
4950 \begin_inset Quotes eld
4951 \end_inset
4952
4953
4954 \begin_inset Flex CharStyle:MenuItem
4955 status collapsed
4956
4957 \begin_layout Plain Layout
4958 ^e
4959 \end_layout
4960
4961 \end_inset
4962
4963
4964 \begin_inset Quotes erd
4965 \end_inset
4966
4967  produces the letter: 
4968 \begin_inset Quotes eld
4969 \end_inset
4970
4971 ê
4972 \begin_inset Quotes erd
4973 \end_inset
4974
4975 .
4976  If you tried to type 
4977 \begin_inset Quotes eld
4978 \end_inset
4979
4980
4981 \begin_inset Flex CharStyle:MenuItem
4982 status collapsed
4983
4984 \begin_layout Plain Layout
4985 ^t
4986 \end_layout
4987
4988 \end_inset
4989
4990
4991 \begin_inset Quotes erd
4992 \end_inset
4993
4994 , however, LyX will complain with a beep, since a 
4995 \begin_inset Quotes eld
4996 \end_inset
4997
4998
4999 \begin_inset Flex CharStyle:MenuItem
5000 status collapsed
5001
5002 \begin_layout Plain Layout
5003 t
5004 \end_layout
5005
5006 \end_inset
5007
5008
5009 \begin_inset Quotes erd
5010 \end_inset
5011
5012  never takes a circumflex accent.
5013  Hitting 
5014 \begin_inset Flex CharStyle:MenuItem
5015 status collapsed
5016
5017 \begin_layout Plain Layout
5018 Space
5019 \end_layout
5020
5021 \end_inset
5022
5023  after a dead-key produces the bare-accent.
5024  Please note this last point! If you bind a key to a dead-key, you'll need
5025  to rebind the character on that key to yet another key.
5026  Binding the 
5027 \begin_inset Flex CharStyle:MenuItem
5028 status collapsed
5029
5030 \begin_layout Plain Layout
5031 ,-key
5032 \end_layout
5033
5034 \end_inset
5035
5036  to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5037 \end_layout
5038
5039 \begin_layout Standard
5040 One common way to bind dead-keys is to use 
5041 \begin_inset Flex CharStyle:MenuItem
5042 status collapsed
5043
5044 \begin_layout Plain Layout
5045 Meta-
5046 \end_layout
5047
5048 \end_inset
5049
5050
5051 \begin_inset Flex CharStyle:MenuItem
5052 status collapsed
5053
5054 \begin_layout Plain Layout
5055 Ctrl-
5056 \end_layout
5057
5058 \end_inset
5059
5060 , and 
5061 \begin_inset Flex CharStyle:MenuItem
5062 status collapsed
5063
5064 \begin_layout Plain Layout
5065 Shift-
5066 \end_layout
5067
5068 \end_inset
5069
5070  in combination with an accent, like 
5071 \begin_inset Quotes eld
5072 \end_inset
5073
5074
5075 \begin_inset Flex CharStyle:MenuItem
5076 status collapsed
5077
5078 \begin_layout Plain Layout
5079 ~
5080 \end_layout
5081
5082 \end_inset
5083
5084
5085 \begin_inset Quotes erd
5086 \end_inset
5087
5088  or 
5089 \begin_inset Quotes eld
5090 \end_inset
5091
5092
5093 \begin_inset Flex CharStyle:MenuItem
5094 status collapsed
5095
5096 \begin_layout Plain Layout
5097 ,
5098 \end_layout
5099
5100 \end_inset
5101
5102
5103 \begin_inset Quotes erd
5104 \end_inset
5105
5106  or 
5107 \begin_inset Quotes eld
5108 \end_inset
5109
5110
5111 \begin_inset Flex CharStyle:MenuItem
5112 status collapsed
5113
5114 \begin_layout Plain Layout
5115 ^
5116 \end_layout
5117
5118 \end_inset
5119
5120
5121 \begin_inset Quotes erd
5122 \end_inset
5123
5124 .
5125  Another way involves using 
5126 \begin_inset Flex CharStyle:Code
5127 status collapsed
5128
5129 \begin_layout Plain Layout
5130 xmodmap
5131 \end_layout
5132
5133 \end_inset
5134
5135  and 
5136 \begin_inset Flex CharStyle:Code
5137 status collapsed
5138
5139 \begin_layout Plain Layout
5140 xkeycaps
5141 \end_layout
5142
5143 \end_inset
5144
5145  to set up the special 
5146 \begin_inset Flex CharStyle:Code
5147 status collapsed
5148
5149 \begin_layout Plain Layout
5150 Mode_Switch
5151 \end_layout
5152
5153 \end_inset
5154
5155  key.
5156  The 
5157 \begin_inset Flex CharStyle:Code
5158 status collapsed
5159
5160 \begin_layout Plain Layout
5161 Mode_Switch
5162 \end_layout
5163
5164 \end_inset
5165
5166  acts in some ways just like 
5167 \begin_inset Flex CharStyle:MenuItem
5168 status collapsed
5169
5170 \begin_layout Plain Layout
5171 Shift
5172 \end_layout
5173
5174 \end_inset
5175
5176  and permits you to bind keys to accented characters.
5177  You can also turn keys into dead-keys by binding them to something like
5178  
5179 \begin_inset Flex CharStyle:Code
5180 status collapsed
5181
5182 \begin_layout Plain Layout
5183 usldead_cedilla
5184 \end_layout
5185
5186 \end_inset
5187
5188  and then binding this symbolic key to the corresponding LyX command.
5189 \begin_inset Foot
5190 status collapsed
5191
5192 \begin_layout Plain Layout
5193 Note from 
5194 \noun on
5195 John Weiss
5196 \noun default
5197 : This is exactly what I do in my 
5198 \begin_inset Flex CharStyle:Code
5199 status collapsed
5200
5201 \begin_layout Plain Layout
5202 ~/.lyx/lyxrc
5203 \end_layout
5204
5205 \end_inset
5206
5207  and my 
5208 \begin_inset Flex CharStyle:Code
5209 status collapsed
5210
5211 \begin_layout Plain Layout
5212 ~/.xmodmap
5213 \end_layout
5214
5215 \end_inset
5216
5217  files.
5218  I have my 
5219 \begin_inset Flex CharStyle:MenuItem
5220 status collapsed
5221
5222 \begin_layout Plain Layout
5223 Scroll
5224 \begin_inset space ~
5225 \end_inset
5226
5227 Lock
5228 \end_layout
5229
5230 \end_inset
5231
5232  key set up as 
5233 \begin_inset Flex CharStyle:Code
5234 status collapsed
5235
5236 \begin_layout Plain Layout
5237 Mode_Shift
5238 \end_layout
5239
5240 \end_inset
5241
5242  and a bunch of these 
5243 \begin_inset Quotes eld
5244 \end_inset
5245
5246
5247 \begin_inset Flex CharStyle:Code
5248 status collapsed
5249
5250 \begin_layout Plain Layout
5251 usldead_*
5252 \end_layout
5253
5254 \end_inset
5255
5256
5257 \begin_inset Quotes erd
5258 \end_inset
5259
5260  symbolic keys bound such things as 
5261 \begin_inset Flex CharStyle:MenuItem
5262 status collapsed
5263
5264 \begin_layout Plain Layout
5265 Scroll
5266 \begin_inset space ~
5267 \end_inset
5268
5269 Lock-^
5270 \end_layout
5271
5272 \end_inset
5273
5274  and 
5275 \begin_inset Flex CharStyle:MenuItem
5276 status collapsed
5277
5278 \begin_layout Plain Layout
5279 Scroll
5280 \begin_inset space ~
5281 \end_inset
5282
5283 Lock-~
5284 \end_layout
5285
5286 \end_inset
5287
5288 .
5289  This is how I produce my accented characters.
5290 \end_layout
5291
5292 \end_inset
5293
5294  You can make just about anything into the 
5295 \begin_inset Flex CharStyle:Code
5296 status collapsed
5297
5298 \begin_layout Plain Layout
5299 Mode_Switch
5300 \end_layout
5301
5302 \end_inset
5303
5304  key: One of the 
5305 \begin_inset Flex CharStyle:MenuItem
5306 status collapsed
5307
5308 \begin_layout Plain Layout
5309 Ctrl-
5310 \end_layout
5311
5312 \end_inset
5313
5314  keys, a spare function key, etc.
5315  As for the LyX commands that produce accents, check the entry for 
5316 \begin_inset Flex CharStyle:Code
5317 status collapsed
5318
5319 \begin_layout Plain Layout
5320 accent-acute
5321 \end_layout
5322
5323 \end_inset
5324
5325  in the 
5326 \emph on
5327 Reference Manual
5328 \emph default
5329 .
5330  You'll find the complete list there.
5331 \end_layout
5332
5333 \begin_layout Subsection
5334 Saving your Language Configuration
5335 \end_layout
5336
5337 \begin_layout Standard
5338 You can edit your preferences so that your desired language environment
5339  is automatically configured when LyX starts up, via the 
5340 \begin_inset Flex CharStyle:MenuItem
5341 status collapsed
5342
5343 \begin_layout Plain Layout
5344 Edit\SpecialChar \menuseparator
5345 Preferences
5346 \end_layout
5347
5348 \end_inset
5349
5350  dialog.
5351 \end_layout
5352
5353 \begin_layout Chapter
5354 Installing New Document Classes, Layouts, and Templates 
5355 \begin_inset CommandInset label
5356 LatexCommand label
5357 name "chap:textclass"
5358
5359 \end_inset
5360
5361
5362 \begin_inset OptArg
5363 status collapsed
5364
5365 \begin_layout Plain Layout
5366 Installing New Document Classes
5367 \end_layout
5368
5369 \end_inset
5370
5371
5372 \end_layout
5373
5374 \begin_layout Standard
5375 In this chapter, we describe the procedures for creating and installing
5376  new LyX layout and template files, as well as offer a refresher on correctly
5377  installing new LaTeX document classes.
5378  Some definitions: a document class is a LaTeX file (usually ending in 
5379 \begin_inset Flex CharStyle:Code
5380 status collapsed
5381
5382 \begin_layout Plain Layout
5383 .cls
5384 \end_layout
5385
5386 \end_inset
5387
5388  or 
5389 \begin_inset Flex CharStyle:Code
5390 status collapsed
5391
5392 \begin_layout Plain Layout
5393 .sty
5394 \end_layout
5395
5396 \end_inset
5397
5398 ) that describes the format of a document such as an article, report, journal
5399  preprint, etc, and all the commands needed to realize that format.
5400  A layout file is a LyX file that corresponds to a LaTeX document class
5401  and that tells LyX how to 
5402 \begin_inset Quotes eld
5403 \end_inset
5404
5405 draw
5406 \begin_inset Quotes erd
5407 \end_inset
5408
5409  things on the screen to make the display look something like the final
5410  printed page.
5411  More precisely, a layout file describes a 
5412 \begin_inset Quotes eld
5413 \end_inset
5414
5415 text class
5416 \begin_inset Quotes erd
5417 \end_inset
5418
5419  which is the internal construct LyX uses to render the screen display.
5420  
5421 \begin_inset Quotes eld
5422 \end_inset
5423
5424 Layout
5425 \begin_inset Quotes erd
5426 \end_inset
5427
5428  and 
5429 \begin_inset Quotes eld
5430 \end_inset
5431
5432 text class
5433 \begin_inset Quotes erd
5434 \end_inset
5435
5436  can be used somewhat interchangeably, but it is better to refer to the
5437  file as the layout, and the thing living in LyX's memory as the text class.
5438  A template file is simply a LyX document that contains a set of predefined
5439  entries for a given document class---entries that are generally required
5440  for that class.
5441  Templates are especially useful for things like journal manuscripts that
5442  are to be submitted electronically.
5443 \end_layout
5444
5445 \begin_layout Section
5446 Installing a new LaTeX package
5447 \end_layout
5448
5449 \begin_layout Standard
5450 Some installations may not include a LaTeX package that you would like to
5451  use within LyX.
5452  For example, you might need FoilTeX, a package for preparing slides or
5453  viewgraphs for overhead projectors.
5454  Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5455  a user interface for that.
5456  For example on MiKTeX you start its program 
5457 \begin_inset Quotes eld
5458 \end_inset
5459
5460 Browse Packages
5461 \begin_inset Quotes erd
5462 \end_inset
5463
5464  to get a list of available packages.
5465  To install one, right click on it or use the installing toolbar button.
5466  When the package you want to install is not in the list, but you have it
5467  in form of a 
5468 \begin_inset Flex CharStyle:Code
5469 status collapsed
5470
5471 \begin_layout Plain Layout
5472 .cls
5473 \end_layout
5474
5475 \end_inset
5476
5477  or 
5478 \begin_inset Flex CharStyle:Code
5479 status collapsed
5480
5481 \begin_layout Plain Layout
5482 .sty
5483 \end_layout
5484
5485 \end_inset
5486
5487 -file, then copy these files to a subfolder of your LaTeX distribution,
5488  for example to the folder 
5489 \family sans
5490 ~
5491 \backslash
5492 tex
5493 \backslash
5494 latex
5495 \family default
5496 .
5497  Then update the file name database of your LaTeX-distribution.
5498  For example on MiKTeX this is done by pressing the button 
5499 \family sans
5500 Refresh
5501 \begin_inset space ~
5502 \end_inset
5503
5504 FNDB
5505 \family default
5506  that you find in MiKTeX's 
5507 \begin_inset Quotes eld
5508 \end_inset
5509
5510 Settings
5511 \begin_inset Quotes erd
5512 \end_inset
5513
5514  program.
5515  In both cases you need afterwards to reconfigure LyX using the menu 
5516 \begin_inset Flex CharStyle:MenuItem
5517 status collapsed
5518
5519 \begin_layout Plain Layout
5520 Tools\SpecialChar \menuseparator
5521 Reconfigure
5522 \end_layout
5523
5524 \end_inset
5525
5526  and then to restart LyX.
5527 \end_layout
5528
5529 \begin_layout Standard
5530 If your LaTeX distribution doesn't provide a user interface, then you can
5531  follow these steps by using a UNIX/Linux console.
5532 \end_layout
5533
5534 \begin_layout Enumerate
5535 Get the package from 
5536 \begin_inset CommandInset href
5537 LatexCommand href
5538 name "CTAN"
5539 target "http://www.ctan.org/"
5540
5541 \end_inset
5542
5543  or wherever.
5544 \end_layout
5545
5546 \begin_layout Enumerate
5547 You can install this package in several different places.
5548  If you want it to be available for all users on your system, then you should
5549  install it in your `local' TeX tree; if you want (or need) it to be available
5550  just for you, then you can install it in your own `user' TeX tree.
5551  Where these should be created, if they do not already exist, depends upon
5552  the details of your system.
5553  To find out, look in the file 
5554 \begin_inset Flex CharStyle:Code
5555 status collapsed
5556
5557 \begin_layout Plain Layout
5558 texmf.cnf
5559 \end_layout
5560
5561 \end_inset
5562
5563 .
5564 \begin_inset Foot
5565 status collapsed
5566
5567 \begin_layout Plain Layout
5568 This usually lives in the directory 
5569 \begin_inset Flex CharStyle:Code
5570 status collapsed
5571
5572 \begin_layout Plain Layout
5573 $TEXMF/web2c
5574 \end_layout
5575
5576 \end_inset
5577
5578 , though you can run 
5579 \begin_inset Flex CharStyle:Code
5580 status collapsed
5581
5582 \begin_layout Plain Layout
5583 kpsewhich texmf.cnf
5584 \end_layout
5585
5586 \end_inset
5587
5588  to locate it.
5589 \end_layout
5590
5591 \end_inset
5592
5593  The location of the `local' TeX tree is defined by 
5594 \begin_inset Flex CharStyle:Code
5595 status collapsed
5596
5597 \begin_layout Plain Layout
5598 TEXMFLOCAL
5599 \end_layout
5600
5601 \end_inset
5602
5603 ; this is usually somewhere like 
5604 \begin_inset Flex CharStyle:Code
5605 status collapsed
5606
5607 \begin_layout Plain Layout
5608 /usr/local/share/texmf/
5609 \end_layout
5610
5611 \end_inset
5612
5613 .
5614  The `user' TeX tree is defined by 
5615 \begin_inset Flex CharStyle:Code
5616 status collapsed
5617
5618 \begin_layout Plain Layout
5619 TEXMFHOME
5620 \end_layout
5621
5622 \end_inset
5623
5624  and is commonly at 
5625 \begin_inset Flex CharStyle:Code
5626 status collapsed
5627
5628 \begin_layout Plain Layout
5629 $HOME/texmf/
5630 \end_layout
5631
5632 \end_inset
5633
5634 .
5635  (If these variables are not predefined, you can define them.) You'll probably
5636  need root permissions to create or modify the `local' tree; but your `user'
5637  tree shouldn't have such limitations.
5638 \end_layout
5639
5640 \begin_layout Enumerate
5641 Make sure 
5642 \begin_inset Flex CharStyle:Code
5643 status collapsed
5644
5645 \begin_layout Plain Layout
5646 TEXMF
5647 \end_layout
5648
5649 \end_inset
5650
5651  includes the 
5652 \begin_inset Flex CharStyle:Code
5653 status collapsed
5654
5655 \begin_layout Plain Layout
5656 TEXMFLOCAL
5657 \end_layout
5658
5659 \end_inset
5660
5661  and 
5662 \begin_inset Flex CharStyle:Code
5663 status collapsed
5664
5665 \begin_layout Plain Layout
5666 TEXMFHOME
5667 \end_layout
5668
5669 \end_inset
5670
5671  variables; e.g.
5672 \begin_inset Newline newline
5673 \end_inset
5674
5675
5676 \begin_inset Flex CharStyle:Code
5677 status collapsed
5678
5679 \begin_layout Plain Layout
5680 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5681 \end_layout
5682
5683 \end_inset
5684
5685
5686 \begin_inset Newline newline
5687 \end_inset
5688
5689 But, again, most of this will 
5690 \begin_inset Quotes eld
5691 \end_inset
5692
5693 just work
5694 \begin_inset Quotes erd
5695 \end_inset
5696
5697 .
5698 \end_layout
5699
5700 \begin_layout Enumerate
5701 Create your local
5702 \begin_inset Foot
5703 status collapsed
5704
5705 \begin_layout Plain Layout
5706 We'll assume henceforth that you're defining `local' TeX tree.
5707  If you're defining a user tree, just adjust as necessary.
5708 \end_layout
5709
5710 \end_inset
5711
5712  TeX tree.
5713  You must follow the directory structure of your existing 
5714 \begin_inset Flex CharStyle:Code
5715 status collapsed
5716
5717 \begin_layout Plain Layout
5718 texmf
5719 \end_layout
5720
5721 \end_inset
5722
5723  directory, which will be found at 
5724 \begin_inset Flex CharStyle:Code
5725 status collapsed
5726
5727 \begin_layout Plain Layout
5728 TEXMFMAIN
5729 \end_layout
5730
5731 \end_inset
5732
5733 .
5734  For example, latex packages should go under 
5735 \begin_inset Flex CharStyle:Code
5736 status collapsed
5737
5738 \begin_layout Plain Layout
5739 $TEXMFLOCAL/tex/latex/
5740 \end_layout
5741
5742 \end_inset
5743
5744 .
5745 \end_layout
5746
5747 \begin_layout Enumerate
5748 Install the package.
5749  For example, you would unpack the FoilTeX tarball and copy it to 
5750 \begin_inset Flex CharStyle:Code
5751 status collapsed
5752
5753 \begin_layout Plain Layout
5754 $TEXMFLOCAL/tex/latex/foiltex
5755 \end_layout
5756
5757 \end_inset
5758
5759 .
5760  The 
5761 \begin_inset Flex CharStyle:Code
5762 status collapsed
5763
5764 \begin_layout Plain Layout
5765 foiltex
5766 \end_layout
5767
5768 \end_inset
5769
5770  directory contains various files.
5771 \end_layout
5772
5773 \begin_layout Enumerate
5774 Run: 
5775 \begin_inset Flex CharStyle:Code
5776 status collapsed
5777
5778 \begin_layout Plain Layout
5779 texhash
5780 \end_layout
5781
5782 \end_inset
5783
5784 .
5785  This should create 
5786 \begin_inset Flex CharStyle:Code
5787 status collapsed
5788
5789 \begin_layout Plain Layout
5790 $TEXMFLOCAL/ls-R
5791 \end_layout
5792
5793 \end_inset
5794
5795  amongst others.
5796 \end_layout
5797
5798 \begin_layout Standard
5799 Your package is now installed and available to LaTeX.
5800  To make it available to LyX, you need to create a Layout file, if one is
5801  not already available.
5802  (See the next section.) Once you have a layout file, you need only reconfigure
5803  (
5804 \begin_inset Flex CharStyle:MenuItem
5805 status collapsed
5806
5807 \begin_layout Plain Layout
5808 Tools\SpecialChar \menuseparator
5809 Reconfigure
5810 \end_layout
5811
5812 \end_inset
5813
5814 ) and then restart LyX.
5815  You should then see your new package---for example 
5816 \begin_inset Flex CharStyle:MenuItem
5817 status collapsed
5818
5819 \begin_layout Plain Layout
5820 slides (FoilTeX)
5821 \end_layout
5822
5823 \end_inset
5824
5825 ---under 
5826 \begin_inset Flex CharStyle:MenuItem
5827 status collapsed
5828
5829 \begin_layout Plain Layout
5830 Document\SpecialChar \menuseparator
5831 Settings
5832 \end_layout
5833
5834 \end_inset
5835
5836  in the 
5837 \begin_inset Flex CharStyle:MenuItem
5838 status collapsed
5839
5840 \begin_layout Plain Layout
5841 Document Class
5842 \end_layout
5843
5844 \end_inset
5845
5846  drop box.
5847  
5848 \end_layout
5849
5850 \begin_layout Section
5851 Layouts
5852 \end_layout
5853
5854 \begin_layout Standard
5855 This section describes how to write and install your own LyX layout files
5856  and walks through the 
5857 \begin_inset Flex CharStyle:Code
5858 status collapsed
5859
5860 \begin_layout Plain Layout
5861 article
5862 \end_layout
5863
5864 \end_inset
5865
5866  text class format as an example.
5867  The 
5868 \begin_inset Flex CharStyle:Code
5869 status collapsed
5870
5871 \begin_layout Plain Layout
5872 .layout
5873 \end_layout
5874
5875 \end_inset
5876
5877  files describe what paragraph and character styles are available for a
5878  given document class and how LyX should display them.
5879  We try to provide a thorough description of the process here; however,
5880  there are so many different types of documents supported by LaTeX classes
5881  that we can't hope to cover every different possibility or problem you
5882  might encounter.
5883  (The LyX users' list is frequented by people with lots of experience with
5884  layout design who are willing to share what they've learned.)
5885 \end_layout
5886
5887 \begin_layout Standard
5888 As you prepare to write a new layout, it is extremely helpful to look at
5889  the example layouts distributed with LyX.
5890  If you use a nice LaTeX document class that might be of interest for others,
5891  too, and have a nice corresponding LyX layout, feel free to contribute
5892  the stuff to us, so we may put it into the distribution.
5893  There is also a 
5894 \begin_inset CommandInset href
5895 LatexCommand href
5896 name "section on the LyX wiki"
5897 target "http://wiki.lyx.org/Layouts/Layouts"
5898
5899 \end_inset
5900
5901  for this kind of material.
5902 \end_layout
5903
5904 \begin_layout Standard
5905 All the tags described in this chapter are case-insensitive; this means
5906  that 
5907 \begin_inset Flex CharStyle:Code
5908 status collapsed
5909
5910 \begin_layout Plain Layout
5911 Style
5912 \end_layout
5913
5914 \end_inset
5915
5916
5917 \begin_inset Flex CharStyle:Code
5918 status collapsed
5919
5920 \begin_layout Plain Layout
5921 style
5922 \end_layout
5923
5924 \end_inset
5925
5926  and 
5927 \begin_inset Flex CharStyle:Code
5928 status collapsed
5929
5930 \begin_layout Plain Layout
5931 StYlE
5932 \end_layout
5933
5934 \end_inset
5935
5936  are really the same command.
5937  The possible values are printed in brackets after the feature's name.
5938  The default value if a feature isn't specified inside a text class-description
5939  is typeset 
5940 \begin_inset Flex CharStyle:Code
5941 status collapsed
5942
5943 \begin_layout Plain Layout
5944
5945 \emph on
5946 emphasized
5947 \end_layout
5948
5949 \end_inset
5950
5951 .
5952  If the argument has a datatype like 
5953 \begin_inset Quotes eld
5954 \end_inset
5955
5956 string
5957 \begin_inset Quotes erd
5958 \end_inset
5959
5960  or 
5961 \begin_inset Quotes eld
5962 \end_inset
5963
5964 float
5965 \begin_inset Quotes erd
5966 \end_inset
5967
5968 , the default is shown like this: 
5969 \begin_inset Flex CharStyle:Code
5970 status collapsed
5971
5972 \begin_layout Plain Layout
5973 float=
5974 \emph on
5975 default
5976 \end_layout
5977
5978 \end_inset
5979
5980 .
5981 \end_layout
5982
5983 \begin_layout Subsection
5984 \begin_inset CommandInset label
5985 LatexCommand label
5986 name "sub:Layout-modules"
5987
5988 \end_inset
5989
5990 Layout modules
5991 \end_layout
5992
5993 \begin_layout Standard
5994 Similar to layout files, and new with LyX 1.6, are layout 
5995 \emph on
5996 modules
5997 \emph default
5998 .
5999  Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6000  some modules---such as the Endnotes module---provide support for just such
6001  a package.
6002  In a sense, layout modules are similar to included files---files like 
6003 \begin_inset Flex CharStyle:Code
6004 status collapsed
6005
6006 \begin_layout Plain Layout
6007 stdsections.inc
6008 \end_layout
6009
6010 \end_inset
6011
6012 ---in that modules are not specific to a given document layout but may be
6013  used with many different layouts.
6014  The difference is that using a layout module does not require editing the
6015  layout file.
6016  Rather, modules are selected in the 
6017 \begin_inset Flex CharStyle:MenuItem
6018 status collapsed
6019
6020 \begin_layout Plain Layout
6021 Document\SpecialChar \menuseparator
6022 Settings
6023 \end_layout
6024
6025 \end_inset
6026
6027  dialog.
6028 \end_layout
6029
6030 \begin_layout Standard
6031 Building modules is the easiest way to get started with layout editing,
6032  since it can be as simple as adding a single new paragraph or flex inset.
6033  But modules may, in principle, contain anything a layout file can contain.
6034 \end_layout
6035
6036 \begin_layout Standard
6037 A module must begin with a line like the following:
6038 \end_layout
6039
6040 \begin_layout LyX-Code
6041 #
6042 \backslash
6043 DeclareLyXModule[endnotes.sty]{Endnotes} 
6044 \end_layout
6045
6046 \begin_layout Standard
6047 The argument in square brackets is optional: It declares any LaTeX packages
6048  on which the module depends.
6049  The mandatory argument, in curly brackets, is the name of the module, as
6050  it should appear in 
6051 \begin_inset Flex CharStyle:MenuItem
6052 status collapsed
6053
6054 \begin_layout Plain Layout
6055 Document\SpecialChar \menuseparator
6056 Settings
6057 \end_layout
6058
6059 \end_inset
6060
6061 .
6062  
6063 \end_layout
6064
6065 \begin_layout Standard
6066 The module declaration should then be followed by lines like the following:
6067 \end_layout
6068
6069 \begin_layout LyX-Code
6070 #DescriptionBegin 
6071 \end_layout
6072
6073 \begin_layout LyX-Code
6074 #Adds an endnote command, in addition to footnotes.
6075  
6076 \end_layout
6077
6078 \begin_layout LyX-Code
6079 #You will need to add  
6080 \backslash
6081 theendnotes in ERT where you 
6082 \end_layout
6083
6084 \begin_layout LyX-Code
6085 #want the endnotes to appear.
6086  
6087 \end_layout
6088
6089 \begin_layout LyX-Code
6090 #DescriptionEnd 
6091 \end_layout
6092
6093 \begin_layout LyX-Code
6094 #Requires: somemodule | othermodule
6095 \end_layout
6096
6097 \begin_layout LyX-Code
6098 #Excludes: badmodule
6099 \end_layout
6100
6101 \begin_layout Standard
6102 The description is used in 
6103 \begin_inset Flex CharStyle:MenuItem
6104 status collapsed
6105
6106 \begin_layout Plain Layout
6107 Document\SpecialChar \menuseparator
6108 Settings
6109 \end_layout
6110
6111 \end_inset
6112
6113  to provide the user with information about what the module does.
6114  The 
6115 \begin_inset Flex CharStyle:Code
6116 status collapsed
6117
6118 \begin_layout Plain Layout
6119 Requires
6120 \end_layout
6121
6122 \end_inset
6123
6124  line is used to identify other modules with which this one must be used;
6125  the 
6126 \begin_inset Flex CharStyle:Code
6127 status collapsed
6128
6129 \begin_layout Plain Layout
6130 Excludes
6131 \end_layout
6132
6133 \end_inset
6134
6135  line is used to identify modules with which this one may not be used.
6136  Both are optional, and, as shown, multiple modules should be separated
6137  with the pipe symbol: |.
6138  Note that the required modules are treated disjunctively: 
6139 \emph on
6140 at least one
6141 \emph default
6142  of the required modules must be used.
6143  Similarly, 
6144 \emph on
6145 no
6146 \emph default
6147  excluded module may be used.
6148  Note that modules are identified here by their 
6149 \emph on
6150 filenames
6151 \emph default
6152  without the .module extension.
6153  So 
6154 \begin_inset Flex CharStyle:Code
6155 status collapsed
6156
6157 \begin_layout Plain Layout
6158 somemodule
6159 \end_layout
6160
6161 \end_inset
6162
6163  is really 
6164 \begin_inset Flex CharStyle:Code
6165 status collapsed
6166
6167 \begin_layout Plain Layout
6168 somemodule.module
6169 \end_layout
6170
6171 \end_inset
6172
6173 .
6174 \end_layout
6175
6176 \begin_layout Standard
6177 After creating a new module, you will need to reconfigure and then restart
6178  LyX for the module to appear in the menu.
6179  However, changes you make to the module will be seen immediately, if you
6180  open 
6181 \begin_inset Flex CharStyle:MenuItem
6182 status collapsed
6183
6184 \begin_layout Plain Layout
6185 Document\SpecialChar \menuseparator
6186 Settings
6187 \end_layout
6188
6189 \end_inset
6190
6191 , highlight something, and then hit 
6192 \begin_inset Quotes eld
6193 \end_inset
6194
6195 OK
6196 \begin_inset Quotes erd
6197 \end_inset
6198
6199 .
6200  
6201 \emph on
6202 It is strongly recommended that you save your work before doing so
6203 \emph default
6204 .
6205  In fact, 
6206 \emph on
6207 it is strongly recommended that you not attempt to edit modules while simultaneo
6208 usly working on documents
6209 \emph default
6210 .
6211  Though of course the developers strive to keep LyX stable in such situations,
6212  syntax errors and the like in your module file could cause strange behavior.
6213 \end_layout
6214
6215 \begin_layout Subsection
6216 Supporting new document classes
6217 \end_layout
6218
6219 \begin_layout Standard
6220 There are two situations you are likely to encounter when wanting to support
6221  a new LaTeX document class, involving LaTeX2e class (
6222 \begin_inset Flex CharStyle:Code
6223 status collapsed
6224
6225 \begin_layout Plain Layout
6226 .cls
6227 \end_layout
6228
6229 \end_inset
6230
6231 ) and style (
6232 \begin_inset Flex CharStyle:Code
6233 status collapsed
6234
6235 \begin_layout Plain Layout
6236 .sty
6237 \end_layout
6238
6239 \end_inset
6240
6241 ) files.
6242  Supporting a style file is usually fairly easy.
6243  Supporting a new document class is a bit harder.
6244 \end_layout
6245
6246 \begin_layout Subsection
6247 A layout for a 
6248 \begin_inset Flex CharStyle:MenuItem
6249 status collapsed
6250
6251 \begin_layout Plain Layout
6252 sty
6253 \end_layout
6254
6255 \end_inset
6256
6257  file
6258 \end_layout
6259
6260 \begin_layout Standard
6261 If your new document class is provided as a style file that is used in conjuncti
6262 on with an existing, supported document class---for the sake of the example,
6263  we'll assume that the style file is called 
6264 \begin_inset Flex CharStyle:MenuItem
6265 status collapsed
6266
6267 \begin_layout Plain Layout
6268 myclass.sty
6269 \end_layout
6270
6271 \end_inset
6272
6273  and it is meant to be used with 
6274 \begin_inset Flex CharStyle:MenuItem
6275 status collapsed
6276
6277 \begin_layout Plain Layout
6278 report.cls
6279 \end_layout
6280
6281 \end_inset
6282
6283 , which is a standard class---start by copying the existing class's layout
6284  file into your local directory:
6285 \end_layout
6286
6287 \begin_layout LyX-Code
6288 cp report.layout ~/.lyx/layouts/myclass.layout
6289 \end_layout
6290
6291 \begin_layout Standard
6292 Then edit 
6293 \begin_inset Flex CharStyle:Code
6294 status collapsed
6295
6296 \begin_layout Plain Layout
6297 myclass.layout
6298 \end_layout
6299
6300 \end_inset
6301
6302  and change the line: 
6303 \end_layout
6304
6305 \begin_layout LyX-Code
6306
6307 \backslash
6308 DeclareLaTeXClass{report}
6309 \end_layout
6310
6311 \begin_layout Standard
6312 to read
6313 \end_layout
6314
6315 \begin_layout LyX-Code
6316
6317 \backslash
6318 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6319 \end_layout
6320
6321 \begin_layout Standard
6322 Then add:
6323 \end_layout
6324
6325 \begin_layout LyX-Code
6326 Preamble 
6327 \begin_inset Newline newline
6328 \end_inset
6329
6330     
6331 \backslash
6332 usepackage{myclass}
6333 \begin_inset Newline newline
6334 \end_inset
6335
6336 EndPreamble
6337 \end_layout
6338
6339 \begin_layout Standard
6340 near the top of the file.
6341 \end_layout
6342
6343 \begin_layout Standard
6344 Start LyX and select 
6345 \begin_inset Flex CharStyle:MenuItem
6346 status collapsed
6347
6348 \begin_layout Plain Layout
6349 Tools\SpecialChar \menuseparator
6350 Reconfigure
6351 \end_layout
6352
6353 \end_inset
6354
6355 .
6356  Then restart LyX and try creating a new document.
6357  You should see "
6358 \begin_inset Flex CharStyle:MenuItem
6359 status collapsed
6360
6361 \begin_layout Plain Layout
6362 report (myclass)
6363 \end_layout
6364
6365 \end_inset
6366
6367 " as a document class option in the 
6368 \begin_inset Flex CharStyle:MenuItem
6369 status collapsed
6370
6371 \begin_layout Plain Layout
6372 Document\SpecialChar \menuseparator
6373 Settings
6374 \end_layout
6375
6376 \end_inset
6377
6378  dialog.
6379  It is likely that some of the sectioning commands and such in your new
6380  class will work differently from how they worked in the base class---
6381 \begin_inset Flex CharStyle:Code
6382 status collapsed
6383
6384 \begin_layout Plain Layout
6385 report
6386 \end_layout
6387
6388 \end_inset
6389
6390  in this example---so you can fiddle around with the settings for the different
6391  sections if you wish.
6392 \end_layout
6393
6394 \begin_layout Subsection
6395 Layout for a 
6396 \begin_inset Flex CharStyle:MenuItem
6397 status collapsed
6398
6399 \begin_layout Plain Layout
6400 cls
6401 \end_layout
6402
6403 \end_inset
6404
6405  file
6406 \end_layout
6407
6408 \begin_layout Standard
6409 There are two possibilities here.
6410  One is that the class file is itself based upon an existing document class.
6411  For example, many thesis classes are based upon 
6412 \begin_inset Flex CharStyle:MenuItem
6413 status collapsed
6414
6415 \begin_layout Plain Layout
6416 book.cls
6417 \end_layout
6418
6419 \end_inset
6420
6421 .
6422  To see whether yours is, look for a line like
6423 \end_layout
6424
6425 \begin_layout LyX-Code
6426
6427 \backslash
6428 LoadClass{book}
6429 \end_layout
6430
6431 \begin_layout Standard
6432 in the file.
6433  If so, then you may proceed largely as in the previous section, though
6434  the DeclareLaTeXClass line will be different.
6435  If your new class is thesis, and it is based upon book, then the line should
6436  read:
6437 \begin_inset Foot
6438 status collapsed
6439
6440 \begin_layout Plain Layout
6441 And it will be easiest if you save the file to 
6442 \begin_inset Flex CharStyle:Code
6443 status collapsed
6444
6445 \begin_layout Plain Layout
6446 thesis.layout
6447 \end_layout
6448
6449 \end_inset
6450
6451 : LyX assumes that the document class has the same name as the layout file.
6452  
6453 \end_layout
6454
6455 \end_inset
6456
6457
6458 \end_layout
6459
6460 \begin_layout LyX-Code
6461
6462 \backslash
6463 DeclareLaTeXClass[thesis,book]{thesis}
6464 \end_layout
6465
6466 \begin_layout Standard
6467 If, on the other hand, the new class is not based upon an existing class,
6468  you will probably have to 
6469 \begin_inset Quotes eld
6470 \end_inset
6471
6472 roll your own
6473 \begin_inset Quotes erd
6474 \end_inset
6475
6476  layout.
6477  We strongly suggest copying an existing layout file which uses a similar
6478  LaTeX class and then modifying it, if you can do so.
6479  At least use an existing file as a starting point so you can find out what
6480  items you need to worry about.
6481  Again, the specifics are covered below.
6482 \end_layout
6483
6484 \begin_layout Section
6485 Declaring a new text class
6486 \end_layout
6487
6488 \begin_layout Standard
6489 When it's finally time to get your hands dirty and create or edit your own
6490  layout file, the following sections describe what you're up against.
6491  Our advice is to go slowly, save and test often, listen to soothing music,
6492  and enjoy one or two of your favorite adult beverages; more if you are
6493  getting particularly stuck.
6494  It's really not that hard, except that the multitude of options can become
6495  overwhelming if you try to do to much in one sitting.
6496  Go have another adult beverage, just for good measure.
6497 \end_layout
6498
6499 \begin_layout Standard
6500 Here we go!
6501 \end_layout
6502
6503 \begin_layout Standard
6504 Lines in a layout file which begin with a 
6505 \begin_inset Flex CharStyle:Code
6506 status collapsed
6507
6508 \begin_layout Plain Layout
6509 #
6510 \end_layout
6511
6512 \end_inset
6513
6514  are comments.
6515  There is one exception to this rule: all layouts should begin with lines
6516  like:
6517 \end_layout
6518
6519 \begin_layout LyX-Code
6520
6521 \size small
6522 #% Do not delete the line below; configure depends on this 
6523 \end_layout
6524
6525 \begin_layout LyX-Code
6526
6527 \size small
6528 #  
6529 \backslash
6530 DeclareLaTeXClass{article}
6531 \end_layout
6532
6533 \begin_layout Standard
6534 The second line is used when you configure LyX.
6535  The layout file is read by the LaTeX script 
6536 \begin_inset Flex CharStyle:Code
6537 status collapsed
6538
6539 \begin_layout Plain Layout
6540 chkconfig.ltx
6541 \end_layout
6542
6543 \end_inset
6544
6545 , in a special mode where 
6546 \begin_inset Flex CharStyle:Code
6547 status collapsed
6548
6549 \begin_layout Plain Layout
6550 #
6551 \end_layout
6552
6553 \end_inset
6554
6555  is ignored.
6556  The first line is just a LaTeX comment, and the second one contains the
6557  declaration of the text class.
6558  If these lines appear in a file named 
6559 \begin_inset Flex CharStyle:Code
6560 status collapsed
6561
6562 \begin_layout Plain Layout
6563 article.layout
6564 \end_layout
6565
6566 \end_inset
6567
6568 , then they define a text class of name 
6569 \begin_inset Flex CharStyle:Code
6570 status collapsed
6571
6572 \begin_layout Plain Layout
6573 article
6574 \end_layout
6575
6576 \end_inset
6577
6578  (the name of the layout file) which uses the LaTeX document class 
6579 \begin_inset Flex CharStyle:Code
6580 status collapsed
6581
6582 \begin_layout Plain Layout
6583 article.cls
6584 \end_layout
6585
6586 \end_inset
6587
6588  (the default is to use the same name as the layout).
6589  The string 
6590 \begin_inset Quotes eld
6591 \end_inset
6592
6593 article
6594 \begin_inset Quotes erd
6595 \end_inset
6596
6597  that appears above is used as a description of the text class in the 
6598 \begin_inset Flex CharStyle:MenuItem
6599 status collapsed
6600
6601 \begin_layout Plain Layout
6602 Document\SpecialChar \menuseparator
6603 Settings
6604 \end_layout
6605
6606 \end_inset
6607
6608  dialog.
6609 \end_layout
6610
6611 \begin_layout Standard
6612 Let's assume that you wrote your own text class that uses the 
6613 \begin_inset Flex CharStyle:Code
6614 status collapsed
6615
6616 \begin_layout Plain Layout
6617 article.cls
6618 \end_layout
6619
6620 \end_inset
6621
6622  document class, but where you changed the appearance of the section headings.
6623  If you put it in a file 
6624 \begin_inset Flex CharStyle:Code
6625 status collapsed
6626
6627 \begin_layout Plain Layout
6628 myarticle.layout
6629 \end_layout
6630
6631 \end_inset
6632
6633 , the header of this file should be:
6634 \end_layout
6635
6636 \begin_layout LyX-Code
6637
6638 \size small
6639 #% Do not delete the line below; configure depends on this 
6640 \end_layout
6641
6642 \begin_layout LyX-Code
6643
6644 \size small
6645 #  
6646 \backslash
6647 DeclareLaTeXClass[article]{article (with my own headings)}
6648 \end_layout
6649
6650 \begin_layout Standard
6651 This declares a text class 
6652 \begin_inset Flex CharStyle:Code
6653 status collapsed
6654
6655 \begin_layout Plain Layout
6656 myarticle
6657 \end_layout
6658
6659 \end_inset
6660
6661 , associated with the LaTeX document class 
6662 \begin_inset Flex CharStyle:Code
6663 status collapsed
6664
6665 \begin_layout Plain Layout
6666 article.cls
6667 \end_layout
6668
6669 \end_inset
6670
6671  and described as 
6672 \begin_inset Quotes eld
6673 \end_inset
6674
6675 article (with my own headings)
6676 \begin_inset Quotes erd
6677 \end_inset
6678
6679 .
6680  If your text class depends on several packages, you can declare it as:
6681 \end_layout
6682
6683 \begin_layout LyX-Code
6684
6685 \size small
6686 #% Do not delete the line below; configure depends on this 
6687 \end_layout
6688
6689 \begin_layout LyX-Code
6690
6691 \size small
6692 #  
6693 \backslash
6694 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6695 \end_layout
6696
6697 \begin_layout Standard
6698 This indicates that your text class uses the foo.sty package.
6699  Finally, it is also possible to declare classes for DocBook code.
6700  Typical declarations will look like
6701 \end_layout
6702
6703 \begin_layout LyX-Code
6704
6705 \size small
6706 #% Do not delete the line below; configure depends on this 
6707 \end_layout
6708
6709 \begin_layout LyX-Code
6710
6711 \size small
6712
6713 \backslash
6714 DeclareDocBookClass[article]{SGML (DocBook article)}
6715 \end_layout
6716
6717 \begin_layout Standard
6718 Note that these declarations can also be given an optional parameter declaring
6719  the name of the document class (but not a list).
6720 \end_layout
6721
6722 \begin_layout Standard
6723 So, to be as explicit as possible, the form of the layout declaration is:
6724 \end_layout
6725
6726 \begin_layout LyX-Code
6727
6728 \size small
6729 #  
6730 \backslash
6731 DeclareLaTeXClass[class,package.sty]{layout description}
6732 \end_layout
6733
6734 \begin_layout Standard
6735 The class need only be specified if the name of the LaTeX class file and
6736  the name of the layout file are different; if the name of the classfile
6737  is not specified, then LyX will simply assume that it is the same as the
6738  name of the layout file.
6739 \end_layout
6740
6741 \begin_layout Standard
6742 When the text class has been modified to your taste, all you have to do
6743  is to copy it either to 
6744 \begin_inset Flex CharStyle:Code
6745 status collapsed
6746
6747 \begin_layout Plain Layout
6748 LyXDir/layouts/
6749 \end_layout
6750
6751 \end_inset
6752
6753  or to 
6754 \begin_inset Flex CharStyle:Code
6755 status collapsed
6756
6757 \begin_layout Plain Layout
6758 UserDir/layouts
6759 \end_layout
6760
6761 \end_inset
6762
6763 , run 
6764 \begin_inset Flex CharStyle:MenuItem
6765 status collapsed
6766
6767 \begin_layout Plain Layout
6768
6769 \bar under
6770 T
6771 \bar default
6772 ools\SpecialChar \menuseparator
6773
6774 \bar under
6775 R
6776 \bar default
6777 econfigure
6778 \end_layout
6779
6780 \end_inset
6781
6782 , exit LyX and restart it.
6783  Then your new text class should be available along with the others.
6784 \end_layout
6785
6786 \begin_layout Standard
6787 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6788  you made to your layout files.
6789  As a result, editing layout files could be very time consuming.
6790  Beginning with 1.6, however, you can force a reload of the layout currently
6791  in use by using the LyX function 
6792 \begin_inset Flex CharStyle:MenuItem
6793 status collapsed
6794
6795 \begin_layout Plain Layout
6796 layout-reload
6797 \end_layout
6798
6799 \end_inset
6800
6801 .
6802  There is no default binding for this function---though, of course, you
6803  can bind it to a key yourself.
6804  If you want to use this function, then, you should simply enter it in the
6805  mini-buffer.
6806  
6807 \emph on
6808 Warning
6809 \emph default
6810 : This is very much an `advanced feature'.
6811  It is 
6812 \emph on
6813 strongly
6814 \emph default
6815  recommended that you save your work before using this function.
6816  In fact, it is 
6817 \emph on
6818 strongly
6819 \emph default
6820  recommended that you not attempt to edit your layout while simultaneously
6821  working on a document that you care about.
6822  Use a test document.
6823  Syntax errors and the like in your layout file could cause peculiar behavior.
6824  In particular, such errors could cause LyX to regard the current layout
6825  as invalid and to attempt to switch to some other layout.
6826  The LyX team strives to keep LyX stable in such situations, but safe is
6827  better than sorry.
6828 \end_layout
6829
6830 \begin_layout Subsection
6831 File format
6832 \end_layout
6833
6834 \begin_layout Standard
6835 The first non-comment line must contain the file format number:
6836 \end_layout
6837
6838 \begin_layout Description
6839 \begin_inset Flex CharStyle:Code
6840 status collapsed
6841
6842 \begin_layout Plain Layout
6843 Format
6844 \end_layout
6845
6846 \end_inset
6847
6848  [
6849 \begin_inset Flex CharStyle:Code
6850 status collapsed
6851
6852 \begin_layout Plain Layout
6853 int
6854 \end_layout
6855
6856 \end_inset
6857
6858 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6859  don't have an explicit file format).
6860  The file format that is documented here is format 8.
6861 \end_layout
6862
6863 \begin_layout Subsection
6864 General text class parameters
6865 \end_layout
6866
6867 \begin_layout Standard
6868 These are the general parameters which describe the form of the entire document:
6869 \end_layout
6870
6871 \begin_layout Description
6872 \begin_inset Flex CharStyle:Code
6873 status collapsed
6874
6875 \begin_layout Plain Layout
6876 AddToPreamble
6877 \end_layout
6878
6879 \end_inset
6880
6881  Adds information to the document preamble.
6882  Must end with 
6883 \begin_inset Quotes eld
6884 \end_inset
6885
6886
6887 \begin_inset Flex CharStyle:Code
6888 status collapsed
6889
6890 \begin_layout Plain Layout
6891 EndPreamble
6892 \end_layout
6893
6894 \end_inset
6895
6896
6897 \begin_inset Quotes erd
6898 \end_inset
6899
6900 .
6901 \end_layout
6902
6903 \begin_layout Description
6904 \begin_inset Flex CharStyle:Code
6905 status collapsed
6906
6907 \begin_layout Plain Layout
6908 ClassOptions
6909 \end_layout
6910
6911 \end_inset
6912
6913  Describes various global options supported by the document class.
6914  See Section
6915 \begin_inset space ~
6916 \end_inset
6917
6918
6919 \begin_inset CommandInset ref
6920 LatexCommand ref
6921 reference "sec:classoptions"
6922
6923 \end_inset
6924
6925  for a description.
6926  Must end with 
6927 \begin_inset Quotes eld
6928 \end_inset
6929
6930
6931 \begin_inset Flex CharStyle:Code
6932 status collapsed
6933
6934 \begin_layout Plain Layout
6935 End
6936 \end_layout
6937
6938 \end_inset
6939
6940
6941 \begin_inset Quotes erd
6942 \end_inset
6943
6944 .
6945 \end_layout
6946
6947 \begin_layout Description
6948 \begin_inset Flex CharStyle:Code
6949 status collapsed
6950
6951 \begin_layout Plain Layout
6952 Columns
6953 \end_layout
6954
6955 \end_inset
6956
6957  [
6958 \begin_inset Flex CharStyle:Code
6959 status collapsed
6960
6961 \begin_layout Plain Layout
6962
6963 \emph on
6964 1
6965 \end_layout
6966
6967 \end_inset
6968
6969
6970 \begin_inset Flex CharStyle:Code
6971 status collapsed
6972
6973 \begin_layout Plain Layout
6974 2
6975 \end_layout
6976
6977 \end_inset
6978
6979 ] Whether the class should default to having one or two columns.
6980  Can be changed in the 
6981 \begin_inset Flex CharStyle:MenuItem
6982 status collapsed
6983
6984 \begin_layout Plain Layout
6985 Document\SpecialChar \menuseparator
6986 Settings
6987 \end_layout
6988
6989 \end_inset
6990
6991  dialog.
6992 \end_layout
6993
6994 \begin_layout Description
6995 \begin_inset Flex CharStyle:Code
6996 status collapsed
6997
6998 \begin_layout Plain Layout
6999 Counter
7000 \end_layout
7001
7002 \end_inset
7003
7004  This sequence defines a new counter.
7005  See Section
7006 \begin_inset space ~
7007 \end_inset
7008
7009
7010 \begin_inset CommandInset ref
7011 LatexCommand ref
7012 reference "sec:counter"
7013
7014 \end_inset
7015
7016  for details.
7017  Must end with 
7018 \begin_inset Quotes eld
7019 \end_inset
7020
7021
7022 \begin_inset Flex CharStyle:Code
7023 status collapsed
7024
7025 \begin_layout Plain Layout
7026 End
7027 \end_layout
7028
7029 \end_inset
7030
7031
7032 \begin_inset Quotes erd
7033 \end_inset
7034
7035 .
7036 \end_layout
7037
7038 \begin_layout Description
7039 \begin_inset Flex CharStyle:Code
7040 status collapsed
7041
7042 \begin_layout Plain Layout
7043 DefaultFont
7044 \end_layout
7045
7046 \end_inset
7047
7048  Sets the default font used to display the document.
7049  See Section
7050 \begin_inset space ~
7051 \end_inset
7052
7053
7054 \begin_inset CommandInset ref
7055 LatexCommand ref
7056 reference "sec:fonts"
7057
7058 \end_inset
7059
7060  for how to declare fonts.
7061  Must end with 
7062 \begin_inset Quotes eld
7063 \end_inset
7064
7065
7066 \begin_inset Flex CharStyle:Code
7067 status collapsed
7068
7069 \begin_layout Plain Layout
7070 EndFont
7071 \end_layout
7072
7073 \end_inset
7074
7075
7076 \begin_inset Quotes erd
7077 \end_inset
7078
7079 .
7080 \end_layout
7081
7082 \begin_layout Description
7083 \begin_inset Flex CharStyle:Code
7084 status collapsed
7085
7086 \begin_layout Plain Layout
7087 DefaultModule
7088 \end_layout
7089
7090 \end_inset
7091
7092  [
7093 \begin_inset Flex CharStyle:Code
7094 status collapsed
7095
7096 \begin_layout Plain Layout
7097 string]
7098 \end_layout
7099
7100 \end_inset
7101
7102  Specifies a module to be included by default with this document class,
7103  which should be specified by filename without the 
7104 \begin_inset Flex CharStyle:Code
7105 status collapsed
7106
7107 \begin_layout Plain Layout
7108 .module
7109 \end_layout
7110
7111 \end_inset
7112
7113  extension.
7114  The user can still remove the module, but it will be active at the outset.
7115  (This applies only when new files are created, or when this class is chosen
7116  for an existing document.)
7117 \end_layout
7118
7119 \begin_layout Description
7120 \begin_inset Flex CharStyle:Code
7121 status collapsed
7122
7123 \begin_layout Plain Layout
7124 DefaultStyle
7125 \end_layout
7126
7127 \end_inset
7128
7129  [
7130 \begin_inset Flex CharStyle:Code
7131 status collapsed
7132
7133 \begin_layout Plain Layout
7134 string
7135 \end_layout
7136
7137 \end_inset
7138
7139 ] This is the style that will be assigned to new paragraphs, usually 
7140 \begin_inset Flex CharStyle:MenuItem
7141 status collapsed
7142
7143 \begin_layout Plain Layout
7144 Standard
7145 \end_layout
7146
7147 \end_inset
7148
7149 .
7150  This will default to the first defined style if not given, but you are
7151  highly encouraged to use this directive.
7152 \end_layout
7153
7154 \begin_layout Description
7155 \begin_inset Flex CharStyle:Code
7156 status collapsed
7157
7158 \begin_layout Plain Layout
7159 ExcludesModule
7160 \end_layout
7161
7162 \end_inset
7163
7164  [
7165 \begin_inset Flex CharStyle:Code
7166 status collapsed
7167
7168 \begin_layout Plain Layout
7169 string
7170 \end_layout
7171
7172 \end_inset
7173
7174 ] Indicates that the module in question---which should be specified by filename
7175  without the 
7176 \begin_inset Flex CharStyle:Code
7177 status collapsed
7178
7179 \begin_layout Plain Layout
7180 .module
7181 \end_layout
7182
7183 \end_inset
7184
7185  extension---cannot be used with this document class.
7186  This might be used in a journal-specific layout file to prevent, say, the
7187  use of the 
7188 \begin_inset Flex CharStyle:Code
7189 status collapsed
7190
7191 \begin_layout Plain Layout
7192 theorems-sec
7193 \end_layout
7194
7195 \end_inset
7196
7197  module that numbers theorems by section.
7198  This tag may 
7199 \emph on
7200 not
7201 \emph default
7202  be used in a module.
7203  Modules have their own way of excluding other modules (see 
7204 \begin_inset CommandInset ref
7205 LatexCommand ref
7206 reference "sub:Layout-modules"
7207
7208 \end_inset
7209
7210 ).
7211 \end_layout
7212
7213 \begin_layout Description
7214 \begin_inset Flex CharStyle:Code
7215 status collapsed
7216
7217 \begin_layout Plain Layout
7218 Float
7219 \end_layout
7220
7221 \end_inset
7222
7223  Defines a new float.
7224  See Section
7225 \begin_inset space ~
7226 \end_inset
7227
7228
7229 \begin_inset CommandInset ref
7230 LatexCommand ref
7231 reference "sec:floats"
7232
7233 \end_inset
7234
7235  for details.
7236  Must end with 
7237 \begin_inset Quotes eld
7238 \end_inset
7239
7240
7241 \begin_inset Flex CharStyle:Code
7242 status collapsed
7243
7244 \begin_layout Plain Layout
7245 End
7246 \end_layout
7247
7248 \end_inset
7249
7250
7251 \begin_inset Quotes erd
7252 \end_inset
7253
7254 .
7255 \end_layout
7256
7257 \begin_layout Description
7258 \begin_inset Flex CharStyle:Code
7259 status collapsed
7260
7261 \begin_layout Plain Layout
7262 Input
7263 \end_layout
7264
7265 \end_inset
7266
7267  As its name implies, this command allows you to include another layout
7268  definition file within yours to avoid duplicating commands.
7269  Common examples are the standard layout files, for example, 
7270 \begin_inset Flex CharStyle:Code
7271 status collapsed
7272
7273 \begin_layout Plain Layout
7274 stdclass.inc
7275 \end_layout
7276
7277 \end_inset
7278
7279 , which contains most of the basic layouts.
7280 \end_layout
7281
7282 \begin_layout Description
7283 \begin_inset Flex CharStyle:Code
7284 status collapsed
7285
7286 \begin_layout Plain Layout
7287 InsetLayout
7288 \end_layout
7289
7290 \end_inset
7291
7292  This section (re-)defines the layout of an inset.
7293  It can be applied to an existing inset of to a new, user-defined inset,
7294  e.g.
7295 \begin_inset space \space{}
7296 \end_inset
7297
7298 a new character style.
7299  See Section
7300 \begin_inset space ~
7301 \end_inset
7302
7303
7304 \begin_inset CommandInset ref
7305 LatexCommand ref
7306 reference "sec:charstyle"
7307
7308 \end_inset
7309
7310  for more information.
7311  Must end with 
7312 \begin_inset Quotes eld
7313 \end_inset
7314
7315
7316 \begin_inset Flex CharStyle:Code
7317 status collapsed
7318
7319 \begin_layout Plain Layout
7320 End
7321 \end_layout
7322
7323 \end_inset
7324
7325
7326 \begin_inset Quotes erd
7327 \end_inset
7328
7329 .
7330 \end_layout
7331
7332 \begin_layout Description
7333 \begin_inset Flex CharStyle:Code
7334 status collapsed
7335
7336 \begin_layout Plain Layout
7337 LeftMargin
7338 \end_layout
7339
7340 \end_inset
7341
7342  A string that indicates the width of the left margin on the screen, for
7343  example, 
7344 \begin_inset Quotes eld
7345 \end_inset
7346
7347 MMMMM
7348 \begin_inset Quotes erd
7349 \end_inset
7350
7351 .
7352 \end_layout
7353
7354 \begin_layout Description
7355 \begin_inset Flex CharStyle:Code
7356 status collapsed
7357
7358 \begin_layout Plain Layout
7359 NoFloat
7360 \end_layout
7361
7362 \end_inset
7363
7364  This command deletes an existing float.
7365  This is particularly useful when you want to suppress a float that has
7366  be defined in an input file.
7367 \end_layout
7368
7369 \begin_layout Description
7370 \begin_inset Flex CharStyle:Code
7371 status collapsed
7372
7373 \begin_layout Plain Layout
7374 NoStyle
7375 \end_layout
7376
7377 \end_inset
7378
7379  This command deletes an existing style.
7380  This is particularly useful when you want to suppress a style that has
7381  be defined in an input file.
7382 \end_layout
7383
7384 \begin_layout Description
7385 \begin_inset Flex CharStyle:Code
7386 status collapsed
7387
7388 \begin_layout Plain Layout
7389 OutputType
7390 \end_layout
7391
7392 \end_inset
7393
7394  A string indicating what sort of output documents using this class will
7395  produce.
7396  At present, the options are: `docbook', `latex', and `literate'.
7397 \end_layout
7398
7399 \begin_layout Description
7400 \begin_inset Flex CharStyle:Code
7401 status collapsed
7402
7403 \begin_layout Plain Layout
7404
7405 \series medium
7406 PageStyle
7407 \end_layout
7408
7409 \end_inset
7410
7411  [
7412 \emph on
7413
7414 \begin_inset Flex CharStyle:Code
7415 status collapsed
7416
7417 \begin_layout Plain Layout
7418
7419 \emph on
7420 plain
7421 \end_layout
7422
7423 \end_inset
7424
7425
7426 \emph default
7427
7428 \begin_inset Flex CharStyle:Code
7429 status collapsed
7430
7431 \begin_layout Plain Layout
7432 empty
7433 \end_layout
7434
7435 \end_inset
7436
7437
7438 \begin_inset Flex CharStyle:Code
7439 status collapsed
7440
7441 \begin_layout Plain Layout
7442 headings
7443 \end_layout
7444
7445 \end_inset
7446
7447 ] The class default pagestyle.
7448  Can be changed in the 
7449 \begin_inset Flex CharStyle:MenuItem
7450 status collapsed
7451
7452 \begin_layout Plain Layout
7453 Document\SpecialChar \menuseparator
7454 Settings
7455 \end_layout
7456
7457 \end_inset
7458
7459  dialog.
7460 \end_layout
7461
7462 \begin_layout Description
7463 \begin_inset Flex CharStyle:Code
7464 status collapsed
7465
7466 \begin_layout Plain Layout
7467 Preamble
7468 \end_layout
7469
7470 \end_inset
7471
7472  Sets the preamble for the LaTeX document.
7473  Note that this will completely override any prior 
7474 \begin_inset Flex CharStyle:Code
7475 status collapsed
7476
7477 \begin_layout Plain Layout
7478 Premable
7479 \end_layout
7480
7481 \end_inset
7482
7483  or 
7484 \begin_inset Flex CharStyle:Code
7485 status collapsed
7486
7487 \begin_layout Plain Layout
7488 AddToPreamble
7489 \end_layout
7490
7491 \end_inset
7492
7493  declarations.
7494  Must end with 
7495 \begin_inset Quotes eld
7496 \end_inset
7497
7498
7499 \begin_inset Flex CharStyle:Code
7500 status collapsed
7501
7502 \begin_layout Plain Layout
7503 EndPreamble
7504 \end_layout
7505
7506 \end_inset
7507
7508
7509 \begin_inset Quotes erd
7510 \end_inset
7511
7512 .
7513 \end_layout
7514
7515 \begin_layout Description
7516 \begin_inset Flex CharStyle:Code
7517 status collapsed
7518
7519 \begin_layout Plain Layout
7520 Provides
7521 \end_layout
7522
7523 \end_inset
7524
7525  [
7526 \begin_inset Flex CharStyle:Code
7527 status collapsed
7528
7529 \begin_layout Plain Layout
7530 string
7531 \end_layout
7532
7533 \end_inset
7534
7535 ] [
7536 \begin_inset Flex CharStyle:Code
7537 status collapsed
7538
7539 \begin_layout Plain Layout
7540
7541 \emph on
7542 0
7543 \end_layout
7544
7545 \end_inset
7546
7547
7548 \begin_inset Flex CharStyle:Code
7549 status collapsed
7550
7551 \begin_layout Plain Layout
7552 1
7553 \end_layout
7554
7555 \end_inset
7556
7557 ] Whether the class already provides the feature 
7558 \begin_inset Flex CharStyle:Code
7559 status collapsed
7560
7561 \begin_layout Plain Layout
7562 string
7563 \end_layout
7564
7565 \end_inset
7566
7567 .
7568  A feature is in general the name of a package (
7569 \begin_inset Flex CharStyle:Code
7570 status collapsed
7571
7572 \begin_layout Plain Layout
7573 amsmath
7574 \end_layout
7575
7576 \end_inset
7577
7578
7579 \begin_inset Flex CharStyle:Code
7580 status collapsed
7581
7582 \begin_layout Plain Layout
7583 makeidx
7584 \end_layout
7585
7586 \end_inset
7587
7588 , \SpecialChar \ldots{}
7589 ) or a macro (
7590 \begin_inset Flex CharStyle:Code
7591 status collapsed
7592
7593 \begin_layout Plain Layout
7594 url
7595 \end_layout
7596
7597 \end_inset
7598
7599
7600 \begin_inset Flex CharStyle:Code
7601 status collapsed
7602
7603 \begin_layout Plain Layout
7604 boldsymbol
7605 \end_layout
7606
7607 \end_inset
7608
7609 ,\SpecialChar \ldots{}
7610 ); the complete list of supported features is unfortunately not documented
7611  outside the LyX source code---but see 
7612 \begin_inset Flex CharStyle:Code
7613 status collapsed
7614
7615 \begin_layout Plain Layout
7616 LaTeXFeatures.cpp
7617 \end_layout
7618
7619 \end_inset
7620
7621  if you're interested.
7622  
7623 \begin_inset Flex CharStyle:MenuItem
7624 status collapsed
7625
7626 \begin_layout Plain Layout
7627
7628 \bar under
7629 H
7630 \bar default
7631 elp\SpecialChar \menuseparator
7632
7633 \bar under
7634 L
7635 \bar default
7636 aTeX Configuration
7637 \end_layout
7638
7639 \end_inset
7640
7641  also gives an overview of the supported packages.
7642 \end_layout
7643
7644 \begin_layout Description
7645 \begin_inset Flex CharStyle:Code
7646 status collapsed
7647
7648 \begin_layout Plain Layout
7649 ProvidesModule
7650 \end_layout
7651
7652 \end_inset
7653
7654  [
7655 \begin_inset Flex CharStyle:Code
7656 status collapsed
7657
7658 \begin_layout Plain Layout
7659 string
7660 \end_layout
7661
7662 \end_inset
7663
7664 ] Indicates that this layout provides the functionality of the module mentioned,
7665  which should be specified by filename, which should be specified by filename
7666  without the 
7667 \begin_inset Flex CharStyle:Code
7668 status collapsed
7669
7670 \begin_layout Plain Layout
7671 .module
7672 \end_layout
7673
7674 \end_inset
7675
7676  extension.
7677  This will typically be used if the layout includes the module directly,
7678  rather than using the 
7679 \begin_inset Flex CharStyle:Code
7680 status collapsed
7681
7682 \begin_layout Plain Layout
7683 DefaultModule
7684 \end_layout
7685
7686 \end_inset
7687
7688  tag to indicate that it ought to be used.
7689  It could be used in a module that that provided an alternate implementation
7690  of the same functionality.
7691 \end_layout
7692
7693 \begin_layout Description
7694 \begin_inset Flex CharStyle:Code
7695 status collapsed
7696
7697 \begin_layout Plain Layout
7698 Requires
7699 \end_layout
7700
7701 \end_inset
7702
7703  [
7704 \begin_inset Flex CharStyle:Code
7705 status collapsed
7706
7707 \begin_layout Plain Layout
7708 string
7709 \end_layout
7710
7711 \end_inset
7712
7713 ] Whether the class requires the feature
7714 \begin_inset Flex CharStyle:Code
7715 status collapsed
7716
7717 \begin_layout Plain Layout
7718  string
7719 \end_layout
7720
7721 \end_inset
7722
7723 .
7724  Multiple features must be separated by commas.
7725  Note that you can only request supported features.
7726 \end_layout
7727
7728 \begin_layout Description
7729 \begin_inset Flex CharStyle:Code
7730 status collapsed
7731
7732 \begin_layout Plain Layout
7733 RightMargin
7734 \end_layout
7735
7736 \end_inset
7737
7738  A string that indicates the width of the right margin on the screen, for
7739  example, 
7740 \begin_inset Quotes eld
7741 \end_inset
7742
7743 MMMMM
7744 \begin_inset Quotes erd
7745 \end_inset
7746
7747 .
7748 \end_layout
7749
7750 \begin_layout Description
7751 \begin_inset Flex CharStyle:Code
7752 status collapsed
7753
7754 \begin_layout Plain Layout
7755 SecNumDepth
7756 \end_layout
7757
7758 \end_inset
7759
7760  Sets which divisions get numbered.
7761  Corresponds to the 
7762 \begin_inset Flex CharStyle:Code
7763 status collapsed
7764
7765 \begin_layout Plain Layout
7766 secnumdepth
7767 \end_layout
7768
7769 \end_inset
7770
7771  counter in LaTeX.
7772 \end_layout
7773
7774 \begin_layout Description
7775 \begin_inset Flex CharStyle:Code
7776 status collapsed
7777
7778 \begin_layout Plain Layout
7779 Sides
7780 \end_layout
7781
7782 \end_inset
7783
7784  [
7785 \emph on
7786
7787 \begin_inset Flex CharStyle:Code
7788 status collapsed
7789
7790 \begin_layout Plain Layout
7791
7792 \emph on
7793 1
7794 \end_layout
7795
7796 \end_inset
7797
7798
7799 \emph default
7800
7801 \begin_inset Flex CharStyle:Code
7802 status collapsed
7803
7804 \begin_layout Plain Layout
7805 2
7806 \end_layout
7807
7808 \end_inset
7809
7810 ] Whether the class-default should be printing on one or both sides of the
7811  paper.
7812  Can be changed in the 
7813 \begin_inset Flex CharStyle:MenuItem
7814 status collapsed
7815
7816 \begin_layout Plain Layout
7817 Document\SpecialChar \menuseparator
7818 Settings
7819 \end_layout
7820
7821 \end_inset
7822
7823  dialog.
7824 \end_layout
7825
7826 \begin_layout Description
7827 \begin_inset Flex CharStyle:Code
7828 status collapsed
7829
7830 \begin_layout Plain Layout
7831 Style
7832 \end_layout
7833
7834 \end_inset
7835
7836  This sequence defines a new paragraph style.
7837  If the style already exists, it will redefine some of its parameters instead.
7838  See Section
7839 \begin_inset space ~
7840 \end_inset
7841
7842
7843 \begin_inset CommandInset ref
7844 LatexCommand ref
7845 reference "sec:style"
7846
7847 \end_inset
7848
7849  for details.
7850  Must end with 
7851 \begin_inset Quotes eld
7852 \end_inset
7853
7854
7855 \begin_inset Flex CharStyle:Code
7856 status collapsed
7857
7858 \begin_layout Plain Layout
7859 End
7860 \end_layout
7861
7862 \end_inset
7863
7864
7865 \begin_inset Quotes erd
7866 \end_inset
7867
7868 .
7869 \end_layout
7870
7871 \begin_layout Description
7872 \begin_inset Flex CharStyle:Code
7873 status collapsed
7874
7875 \begin_layout Plain Layout
7876 TitleLatexName
7877 \end_layout
7878
7879 \end_inset
7880
7881  [
7882 \begin_inset Flex CharStyle:Code
7883 status collapsed
7884
7885 \begin_layout Plain Layout
7886 string="maketitle"
7887 \end_layout
7888
7889 \end_inset
7890
7891 ] The name of the command or environment to be used with 
7892 \begin_inset Flex CharStyle:Code
7893 status collapsed
7894
7895 \begin_layout Plain Layout
7896 TitleLatexType
7897 \end_layout
7898
7899 \end_inset
7900
7901 .
7902 \end_layout
7903
7904 \begin_layout Description
7905 \begin_inset Flex CharStyle:Code
7906 status collapsed
7907
7908 \begin_layout Plain Layout
7909 TitleLatexType
7910 \end_layout
7911
7912 \end_inset
7913
7914  [
7915 \begin_inset Flex CharStyle:Code
7916 status collapsed
7917
7918 \begin_layout Plain Layout
7919
7920 \emph on
7921 CommandAfter
7922 \end_layout
7923
7924 \end_inset
7925
7926
7927 \begin_inset Flex CharStyle:Code
7928 status collapsed
7929
7930 \begin_layout Plain Layout
7931 Environment
7932 \end_layout
7933
7934 \end_inset
7935
7936 ] Indicates what kind of markup is used to define the title of a document.
7937  
7938 \begin_inset Flex CharStyle:Code
7939 status collapsed
7940
7941 \begin_layout Plain Layout
7942 CommandAfter
7943 \end_layout
7944
7945 \end_inset
7946
7947  means that the macro with name 
7948 \begin_inset Flex CharStyle:Code
7949 status collapsed
7950
7951 \begin_layout Plain Layout
7952 TitleLatexName
7953 \end_layout
7954
7955 \end_inset
7956
7957  will be inserted after the last layout which has 
7958 \begin_inset Quotes eld
7959 \end_inset
7960
7961
7962 \begin_inset Flex CharStyle:Code
7963 status collapsed
7964
7965 \begin_layout Plain Layout
7966 InTitle 1
7967 \end_layout
7968
7969 \end_inset
7970
7971
7972 \begin_inset Quotes erd
7973 \end_inset
7974
7975 .
7976  
7977 \begin_inset Flex CharStyle:Code
7978 status collapsed
7979
7980 \begin_layout Plain Layout
7981 Environment
7982 \end_layout
7983
7984 \end_inset
7985
7986  corresponds to the case where the block of paragraphs which have 
7987 \begin_inset Quotes eld
7988 \end_inset
7989
7990
7991 \begin_inset Flex CharStyle:Code
7992 status collapsed
7993
7994 \begin_layout Plain Layout
7995 InTitle 1
7996 \end_layout
7997
7998 \end_inset
7999
8000
8001 \begin_inset Quotes erd
8002 \end_inset
8003
8004  should be enclosed into the 
8005 \begin_inset Flex CharStyle:Code
8006 status collapsed
8007
8008 \begin_layout Plain Layout
8009 TitleLatexName
8010 \end_layout
8011
8012 \end_inset
8013
8014  environment.
8015 \end_layout
8016
8017 \begin_layout Description
8018 \begin_inset Flex CharStyle:Code
8019 status open
8020
8021 \begin_layout Plain Layout
8022 TocDepth
8023 \end_layout
8024
8025 \end_inset
8026
8027  Sets which divisions are included in the table of contents.
8028  Corresponds to the 
8029 \begin_inset Flex CharStyle:Code
8030 status collapsed
8031
8032 \begin_layout Plain Layout
8033 tocdepth
8034 \end_layout
8035
8036 \end_inset
8037
8038  counter in LaTeX.
8039 \end_layout
8040
8041 \begin_layout Subsection
8042 \begin_inset Flex CharStyle:Code
8043 status collapsed
8044
8045 \begin_layout Plain Layout
8046 ClassOptions
8047 \end_layout
8048
8049 \end_inset
8050
8051  section
8052 \end_layout
8053
8054 \begin_layout Standard
8055 \begin_inset CommandInset label
8056 LatexCommand label
8057 name "sec:classoptions"
8058
8059 \end_inset
8060
8061 The 
8062 \begin_inset Flex CharStyle:Code
8063 status collapsed
8064
8065 \begin_layout Plain Layout
8066 ClassOptions
8067 \end_layout
8068
8069 \end_inset
8070
8071  section can contain the following entries:
8072 \end_layout
8073
8074 \begin_layout Description
8075 \begin_inset Flex CharStyle:Code
8076 status collapsed
8077
8078 \begin_layout Plain Layout
8079 FontSize
8080 \end_layout
8081
8082 \end_inset
8083
8084  [
8085 \begin_inset Flex CharStyle:Code
8086 status collapsed
8087
8088 \begin_layout Plain Layout
8089 string="10|11|12"
8090 \end_layout
8091
8092 \end_inset
8093
8094 ] The list of available font sizes for the document's main font, separated
8095  by 
8096 \begin_inset Quotes eld
8097 \end_inset
8098
8099
8100 \begin_inset Flex CharStyle:Code
8101 status collapsed
8102
8103 \begin_layout Plain Layout
8104 |
8105 \end_layout
8106
8107 \end_inset
8108
8109
8110 \begin_inset Quotes erd
8111 \end_inset
8112
8113 .
8114 \end_layout
8115
8116 \begin_layout Description
8117 \begin_inset Flex CharStyle:Code
8118 status collapsed
8119
8120 \begin_layout Plain Layout
8121 Header
8122 \end_layout
8123
8124 \end_inset
8125
8126  Used to set the DTD line with XML-based output classes.
8127  E.g.: PUBLIC 
8128 \begin_inset Quotes eld
8129 \end_inset
8130
8131 -//OASIS//DTD DocBook V4.2//EN
8132 \begin_inset Quotes erd
8133 \end_inset
8134
8135 .
8136 \end_layout
8137
8138 \begin_layout Description
8139 \begin_inset Flex CharStyle:Code
8140 status collapsed
8141
8142 \begin_layout Plain Layout
8143 PageStyle
8144 \end_layout
8145
8146 \end_inset
8147
8148  [
8149 \begin_inset Flex CharStyle:Code
8150 status collapsed
8151
8152 \begin_layout Plain Layout
8153 string="empty|plain|headings|fancy"
8154 \end_layout
8155
8156 \end_inset
8157
8158 ] The list of available page styles, separated by 
8159 \begin_inset Quotes eld
8160 \end_inset
8161
8162
8163 \begin_inset Flex CharStyle:Code
8164 status collapsed
8165
8166 \begin_layout Plain Layout
8167 |
8168 \end_layout
8169
8170 \end_inset
8171
8172
8173 \begin_inset Quotes erd
8174 \end_inset
8175
8176 .
8177 \end_layout
8178
8179 \begin_layout Description
8180 \begin_inset Flex CharStyle:Code
8181 status collapsed
8182
8183 \begin_layout Plain Layout
8184 Other
8185 \end_layout
8186
8187 \end_inset
8188
8189  [
8190 \begin_inset Flex CharStyle:Code
8191 status collapsed
8192
8193 \begin_layout Plain Layout
8194 string=""
8195 \end_layout
8196
8197 \end_inset
8198
8199 ] Some document class options, separated by a comma, that will be added
8200  to the optional part of the 
8201 \begin_inset Flex CharStyle:Code
8202 status collapsed
8203
8204 \begin_layout Plain Layout
8205
8206 \backslash
8207 documentclass
8208 \end_layout
8209
8210 \end_inset
8211
8212  command.
8213 \end_layout
8214
8215 \begin_layout Standard
8216 The 
8217 \begin_inset Flex CharStyle:Code
8218 status collapsed
8219
8220 \begin_layout Plain Layout
8221 ClassOptions
8222 \end_layout
8223
8224 \end_inset
8225
8226  section must end with 
8227 \begin_inset Quotes eld
8228 \end_inset
8229
8230
8231 \begin_inset Flex CharStyle:Code
8232 status collapsed
8233
8234 \begin_layout Plain Layout
8235 End
8236 \end_layout
8237
8238 \end_inset
8239
8240
8241 \begin_inset Quotes erd
8242 \end_inset
8243
8244 .
8245 \end_layout
8246
8247 \begin_layout Subsection
8248 Paragraph Styles
8249 \end_layout
8250
8251 \begin_layout Standard
8252 \begin_inset CommandInset label
8253 LatexCommand label
8254 name "sec:style"
8255
8256 \end_inset
8257
8258 A paragraph style description looks like this:
8259 \begin_inset Foot
8260 status collapsed
8261
8262 \begin_layout Plain Layout
8263 Note that this will either define a new layout or modify an existing one.
8264 \end_layout
8265
8266 \end_inset
8267
8268
8269 \end_layout
8270
8271 \begin_layout LyX-Code
8272 Style 
8273 \family roman
8274 \emph on
8275 name
8276 \end_layout
8277
8278 \begin_layout LyX-Code
8279  ...
8280 \end_layout
8281
8282 \begin_layout LyX-Code
8283 End
8284 \end_layout
8285
8286 \begin_layout Standard
8287 where the following commands are allowed:
8288 \end_layout
8289
8290 \begin_layout Description
8291 \begin_inset Flex CharStyle:Code
8292 status collapsed
8293
8294 \begin_layout Plain Layout
8295 Align
8296 \end_layout
8297
8298 \end_inset
8299
8300  [
8301 \begin_inset Flex CharStyle:Code
8302 status collapsed
8303
8304 \begin_layout Plain Layout
8305
8306 \emph on
8307 block
8308 \emph default
8309 , left, right, center
8310 \end_layout
8311
8312 \end_inset
8313
8314 ] Paragraph alignment.
8315 \end_layout
8316
8317 \begin_layout Description
8318 \begin_inset Flex CharStyle:Code
8319 status collapsed
8320
8321 \begin_layout Plain Layout
8322 AlignPossible
8323 \end_layout
8324
8325 \end_inset
8326
8327  [
8328 \begin_inset Flex CharStyle:Code
8329 status collapsed
8330
8331 \begin_layout Plain Layout
8332
8333 \emph on
8334 block
8335 \emph default
8336 , left, right, center
8337 \end_layout
8338
8339 \end_inset
8340
8341 ] A comma separated list of permitted alignments.
8342  (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8343  sense.
8344  For example a right-aligned or centered enumeration isn't possible.)
8345 \end_layout
8346
8347 \begin_layout Description
8348 \begin_inset Flex CharStyle:Code
8349 status collapsed
8350
8351 \begin_layout Plain Layout
8352 BottomSep
8353 \end_layout
8354
8355 \end_inset
8356
8357  [
8358 \begin_inset Flex CharStyle:Code
8359 status collapsed
8360
8361 \begin_layout Plain Layout
8362 float=0
8363 \end_layout
8364
8365 \end_inset
8366
8367 ]
8368 \begin_inset Foot
8369 status collapsed
8370
8371 \begin_layout Plain Layout
8372 Note that a `float' here is a real number, such as: 1.5.
8373 \end_layout
8374
8375 \end_inset
8376
8377  The vertical space with which the last of a chain of paragraphs with this
8378  layout is separated from the following paragraph.
8379  If the next paragraph has another layout, the separations are not simply
8380  added, but the maximum is taken.
8381 \end_layout
8382
8383 \begin_layout Description
8384 \begin_inset Flex CharStyle:Code
8385 status collapsed
8386
8387 \begin_layout Plain Layout
8388 Category
8389 \end_layout
8390
8391 \end_inset
8392
8393  
8394 \begin_inset Flex CharStyle:Code
8395 status collapsed
8396
8397 \begin_layout Plain Layout
8398 [string]
8399 \end_layout
8400
8401 \end_inset
8402
8403  The category for this style.
8404  This is used to group related styles in the Layout combobox on the toolbar.
8405  Any string can be used, but you may want to use existing categories with
8406  your own styles.
8407  
8408 \end_layout
8409
8410 \begin_layout Description
8411 \begin_inset Flex CharStyle:Code
8412 status collapsed
8413
8414 \begin_layout Plain Layout
8415 CommandDepth
8416 \end_layout
8417
8418 \end_inset
8419
8420  Depth of XML command.
8421  Used only with XML-type formats.
8422 \end_layout
8423
8424 \begin_layout Description
8425 \begin_inset Flex CharStyle:Code
8426 status collapsed
8427
8428 \begin_layout Plain Layout
8429 CopyStyle
8430 \end_layout
8431
8432 \end_inset
8433
8434  
8435 \begin_inset CommandInset label
8436 LatexCommand label
8437 name "des:CopyStyle"
8438
8439 \end_inset
8440
8441
8442 \begin_inset Flex CharStyle:Code
8443 status collapsed
8444
8445 \begin_layout Plain Layout
8446 [string]
8447 \end_layout
8448
8449 \end_inset
8450
8451  Copies all the features of an existing style into the current one.
8452  
8453 \end_layout
8454
8455 \begin_layout Description
8456 \begin_inset Flex CharStyle:Code
8457 status collapsed
8458
8459 \begin_layout Plain Layout
8460 DependsOn
8461 \end_layout
8462
8463 \end_inset
8464
8465  The name of a style whose preamble should be output 
8466 \emph on
8467 before
8468 \emph default
8469  this one.
8470  This allows to ensure some ordering of the preamble snippets when macros
8471  definitions depend on one another.
8472 \begin_inset Foot
8473 status collapsed
8474
8475 \begin_layout Plain Layout
8476 Note that, besides that functionality, there is no way to ensure any ordering
8477  of preambles.
8478  The ordering that you see in a given version of LyX may change without
8479  warning in later versions.
8480 \end_layout
8481
8482 \end_inset
8483
8484
8485 \end_layout
8486
8487 \begin_layout Description
8488 \begin_inset Flex CharStyle:Code
8489 status collapsed
8490
8491 \begin_layout Plain Layout
8492 EndLabeltype
8493 \end_layout
8494
8495 \end_inset
8496
8497  [
8498 \begin_inset Flex CharStyle:Code
8499 status collapsed
8500
8501 \begin_layout Plain Layout
8502
8503 \emph on
8504 No_Label
8505 \emph default
8506 , Box, Filled_Box, Static
8507 \end_layout
8508
8509 \end_inset
8510
8511 ] The type of label that stands at the end of the paragraph (or sequence
8512  of paragraphs if 
8513 \begin_inset Flex CharStyle:Code
8514 status collapsed
8515
8516 \begin_layout Plain Layout
8517 LatexType
8518 \end_layout
8519
8520 \end_inset
8521
8522  is 
8523 \begin_inset Flex CharStyle:Code
8524 status collapsed
8525
8526 \begin_layout Plain Layout
8527 Environment
8528 \end_layout
8529
8530 \end_inset
8531
8532
8533 \begin_inset Flex CharStyle:Code
8534 status collapsed
8535
8536 \begin_layout Plain Layout
8537 Item_Environment
8538 \end_layout
8539
8540 \end_inset
8541
8542  or 
8543 \begin_inset Flex CharStyle:Code
8544 status collapsed
8545
8546 \begin_layout Plain Layout
8547 List_Environment
8548 \end_layout
8549
8550 \end_inset
8551
8552 ).
8553  
8554 \begin_inset Flex CharStyle:Code
8555 status collapsed
8556
8557 \begin_layout Plain Layout
8558 No_Label
8559 \end_layout
8560
8561 \end_inset
8562
8563  means 
8564 \begin_inset Quotes eld
8565 \end_inset
8566
8567 nothing
8568 \begin_inset Quotes erd
8569 \end_inset
8570
8571
8572 \begin_inset Flex CharStyle:Code
8573 status collapsed
8574
8575 \begin_layout Plain Layout
8576 Box
8577 \end_layout
8578
8579 \end_inset
8580
8581  (resp.
8582 \begin_inset Flex CharStyle:Code
8583 status collapsed
8584
8585 \begin_layout Plain Layout
8586 \begin_inset space ~
8587 \end_inset
8588
8589 Filled_Box
8590 \end_layout
8591
8592 \end_inset
8593
8594 ) is a white (resp.
8595 \begin_inset space ~
8596 \end_inset
8597
8598 black) square suitable for end of proof markers, 
8599 \begin_inset Flex CharStyle:Code
8600 status collapsed
8601
8602 \begin_layout Plain Layout
8603 Static
8604 \end_layout
8605
8606 \end_inset
8607
8608  is an explicit text string.
8609 \end_layout
8610
8611 \begin_layout Description
8612 \begin_inset Flex CharStyle:Code
8613 status collapsed
8614
8615 \begin_layout Plain Layout
8616 EndLabelString
8617 \end_layout
8618
8619 \end_inset
8620
8621  [
8622 \begin_inset Flex CharStyle:Code
8623 status collapsed
8624
8625 \begin_layout Plain Layout
8626 string=""
8627 \end_layout
8628
8629 \end_inset
8630
8631 ] The string used for a label with a 
8632 \begin_inset Flex CharStyle:Code
8633 status collapsed
8634
8635 \begin_layout Plain Layout
8636 Static
8637 \end_layout
8638
8639 \end_inset
8640
8641  
8642 \begin_inset Flex CharStyle:Code
8643 status collapsed
8644
8645 \begin_layout Plain Layout
8646 EndLabelType
8647 \end_layout
8648
8649 \end_inset
8650
8651 .
8652  
8653 \end_layout
8654
8655 \begin_layout Description
8656 \begin_inset Flex CharStyle:Code
8657 status collapsed
8658
8659 \begin_layout Plain Layout
8660 Fill_Bottom
8661 \end_layout
8662
8663 \end_inset
8664
8665  [
8666 \begin_inset Flex CharStyle:Code
8667 status collapsed
8668
8669 \begin_layout Plain Layout
8670
8671 \emph on
8672 0
8673 \emph default
8674 ,1
8675 \end_layout
8676
8677 \end_inset
8678
8679 ] Similar to 
8680 \begin_inset Flex CharStyle:Code
8681 status collapsed
8682
8683 \begin_layout Plain Layout
8684 Fill_Top
8685 \end_layout
8686
8687 \end_inset
8688
8689 .
8690 \end_layout
8691
8692 \begin_layout Description
8693 \begin_inset Flex CharStyle:Code
8694 status collapsed
8695
8696 \begin_layout Plain Layout
8697 Fill_Top
8698 \end_layout
8699
8700 \end_inset
8701
8702  [
8703 \begin_inset Flex CharStyle:Code
8704 status collapsed
8705
8706 \begin_layout Plain Layout
8707
8708 \emph on
8709 0
8710 \emph default
8711 ,1
8712 \end_layout
8713
8714 \end_inset
8715
8716 ] With this parameter the 
8717 \begin_inset Flex CharStyle:MenuItem
8718 status collapsed
8719
8720 \begin_layout Plain Layout
8721 Fill
8722 \end_layout
8723
8724 \end_inset
8725
8726  value of the 
8727 \begin_inset Quotes eld
8728 \end_inset
8729
8730 Vertical space above
8731 \begin_inset Quotes erd
8732 \end_inset
8733
8734  list of the 
8735 \begin_inset Flex CharStyle:MenuItem
8736 status collapsed
8737
8738 \begin_layout Plain Layout
8739 Edit\SpecialChar \menuseparator
8740 Paragraph
8741 \begin_inset space ~
8742 \end_inset
8743
8744 Settings
8745 \end_layout
8746
8747 \end_inset
8748
8749  dialog can be set when initializing a paragraph with this style.
8750 \begin_inset Foot
8751 status collapsed
8752
8753 \begin_layout Plain Layout
8754
8755 \emph on
8756 Note from Jean-Marc:
8757 \emph default
8758  I'm not sure that this setting has much use, and it should probably be
8759  removed in later versions.
8760 \end_layout
8761
8762 \end_inset
8763
8764  
8765 \end_layout
8766
8767 \begin_layout Description
8768 \begin_inset Flex CharStyle:Code
8769 status collapsed
8770
8771 \begin_layout Plain Layout
8772 Font
8773 \end_layout
8774
8775 \end_inset
8776
8777  The font used for both the text body 
8778 \emph on
8779 and
8780 \emph default
8781  the label.
8782  See section
8783 \begin_inset space ~
8784 \end_inset
8785
8786
8787 \begin_inset CommandInset ref
8788 LatexCommand ref
8789 reference "sec:fonts"
8790
8791 \end_inset
8792
8793 .
8794  Note that defining this font automatically defines the 
8795 \begin_inset Flex CharStyle:Code
8796 status collapsed
8797
8798 \begin_layout Plain Layout
8799 LabelFont
8800 \end_layout
8801
8802 \end_inset
8803
8804  to the same value.
8805  So you should define this one first if you also want to define 
8806 \begin_inset Flex CharStyle:Code
8807 status collapsed
8808
8809 \begin_layout Plain Layout
8810 LabelFont
8811 \end_layout
8812
8813 \end_inset
8814
8815 .
8816 \end_layout
8817
8818 \begin_layout Description
8819 \begin_inset Flex CharStyle:Code
8820 status collapsed
8821
8822 \begin_layout Plain Layout
8823 FreeSpacing
8824 \end_layout
8825
8826 \end_inset
8827
8828  
8829 \begin_inset CommandInset label
8830 LatexCommand label
8831 name "des:FreeSpacing"
8832
8833 \end_inset
8834
8835 [
8836 \emph on
8837
8838 \begin_inset Flex CharStyle:Code
8839 status collapsed
8840
8841 \begin_layout Plain Layout
8842
8843 \emph on
8844 0
8845 \end_layout
8846
8847 \end_inset
8848
8849
8850 \emph default
8851
8852 \begin_inset Flex CharStyle:Code
8853 status collapsed
8854
8855 \begin_layout Plain Layout
8856 1
8857 \end_layout
8858
8859 \end_inset
8860
8861 ] Usually LyX doesn't allow you to insert more than one space between words,
8862  since a space is considered as the separation between two words, not a
8863  character or symbol of its own.
8864  This is a very fine thing but sometimes annoying, for example, when typing
8865  program code or plain LaTeX code.
8866  For this reason, 
8867 \begin_inset Flex CharStyle:Code
8868 status collapsed
8869
8870 \begin_layout Plain Layout
8871 FreeSpacing
8872 \end_layout
8873
8874 \end_inset
8875
8876  can be enabled.
8877  Note that LyX will create protected blanks for the additional blanks when
8878  in another mode than LaTeX-mode.
8879 \end_layout
8880
8881 \begin_layout Description
8882 \begin_inset Flex CharStyle:Code
8883 status collapsed
8884
8885 \begin_layout Plain Layout
8886 InnerTag
8887 \end_layout
8888
8889 \end_inset
8890
8891  [[FIXME]] (Used only with XML-type formats.)
8892 \end_layout
8893
8894 \begin_layout Description
8895 \begin_inset Flex CharStyle:Code
8896 status collapsed
8897
8898 \begin_layout Plain Layout
8899 InTitle
8900 \end_layout
8901
8902 \end_inset
8903
8904  
8905 \begin_inset Flex CharStyle:Code
8906 status collapsed
8907
8908 \begin_layout Plain Layout
8909 [1, 0]
8910 \end_layout
8911
8912 \end_inset
8913
8914  If 1, marks the layout as being part of a title block (see also the 
8915 \begin_inset Flex CharStyle:Code
8916 status collapsed
8917
8918 \begin_layout Plain Layout
8919 TitleLatexType
8920 \end_layout
8921
8922 \end_inset
8923
8924  and 
8925 \begin_inset Flex CharStyle:Code
8926 status collapsed
8927
8928 \begin_layout Plain Layout
8929 TitleLatexName
8930 \end_layout
8931
8932 \end_inset
8933
8934  global entries).
8935 \end_layout
8936
8937 \begin_layout Description
8938 \begin_inset Flex CharStyle:Code
8939 status collapsed
8940
8941 \begin_layout Plain Layout
8942 ItemSep
8943 \end_layout
8944
8945 \end_inset
8946
8947  [
8948 \begin_inset Flex CharStyle:Code
8949 status collapsed
8950
8951 \begin_layout Plain Layout
8952 float=0
8953 \end_layout
8954
8955 \end_inset
8956
8957 ] This provides extra space between paragraphs that have the same layout.
8958  If you put other layouts into an environment, each is separated with the
8959  environment's 
8960 \begin_inset Flex CharStyle:Code
8961 status collapsed
8962
8963 \begin_layout Plain Layout
8964 Parsep
8965 \end_layout
8966
8967 \end_inset
8968
8969 .
8970  But the whole items of the environment are additionally separated with
8971  this 
8972 \begin_inset Flex CharStyle:Code
8973 status collapsed
8974
8975 \begin_layout Plain Layout
8976 Itemsep
8977 \end_layout
8978
8979 \end_inset
8980
8981 .
8982  Note that this is a
8983 \emph on
8984  multiplier.
8985 \end_layout
8986
8987 \begin_layout Description
8988 \begin_inset Flex CharStyle:Code
8989 status collapsed
8990
8991 \begin_layout Plain Layout
8992 ItemTag
8993 \end_layout
8994
8995 \end_inset
8996
8997  [[FIXME]] (Used only with XML-type formats.)
8998 \end_layout
8999
9000 \begin_layout Description
9001 \begin_inset Flex CharStyle:Code
9002 status collapsed
9003
9004 \begin_layout Plain Layout
9005 KeepEmpty
9006 \end_layout
9007
9008 \end_inset
9009
9010  
9011 \begin_inset CommandInset label
9012 LatexCommand label
9013 name "des:KeepEmpty"
9014
9015 \end_inset
9016
9017 [
9018 \emph on
9019
9020 \begin_inset Flex CharStyle:Code
9021 status collapsed
9022
9023 \begin_layout Plain Layout
9024
9025 \emph on
9026 0
9027 \end_layout
9028
9029 \end_inset
9030
9031
9032 \emph default
9033
9034 \begin_inset Flex CharStyle:Code
9035 status collapsed
9036
9037 \begin_layout Plain Layout
9038 1
9039 \end_layout
9040
9041 \end_inset
9042
9043 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9044  lead to empty LaTeX output.
9045  There are some cases where this could be desirable however: in a letter
9046  template, the required fields can be provided as empty fields, so that
9047  people do not forget them; in some special classes, a layout can be used
9048  as some kind of break, which does not contain actual text.
9049 \end_layout
9050
9051 \begin_layout Description
9052 \begin_inset Flex CharStyle:Code
9053 status collapsed
9054
9055 \begin_layout Plain Layout
9056 LabelBottomsep
9057 \end_layout
9058
9059 \end_inset
9060
9061  [float=0] The vertical space between the label and the text body.
9062  Only used for labels that are above the text body (
9063 \begin_inset Flex CharStyle:Code
9064 status collapsed
9065
9066 \begin_layout Plain Layout
9067 Top_Environment
9068 \end_layout
9069
9070 \end_inset
9071
9072
9073 \begin_inset Flex CharStyle:Code
9074 status collapsed
9075
9076 \begin_layout Plain Layout
9077 Centered_Top_Environment
9078 \end_layout
9079
9080 \end_inset
9081
9082 ).
9083 \end_layout
9084
9085 \begin_layout Description
9086 \begin_inset Flex CharStyle:Code
9087 status collapsed
9088
9089 \begin_layout Plain Layout
9090 LabelCounter
9091 \end_layout
9092
9093 \end_inset
9094
9095  [
9096 \begin_inset Flex CharStyle:Code
9097 status collapsed
9098
9099 \begin_layout Plain Layout
9100 string=""
9101 \end_layout
9102
9103 \end_inset
9104
9105 ]
9106 \begin_inset Newline newline
9107 \end_inset
9108
9109 The name of the counter for automatic numbering (see Section 
9110 \begin_inset CommandInset ref
9111 LatexCommand ref
9112 reference "sec:counter"
9113
9114 \end_inset
9115
9116  for details).
9117  This must be given if 
9118 \begin_inset Flex CharStyle:Code
9119 status collapsed
9120
9121 \begin_layout Plain Layout
9122 Labeltype
9123 \end_layout
9124
9125 \end_inset
9126
9127  is 
9128 \begin_inset Flex CharStyle:Code
9129 status collapsed
9130
9131 \begin_layout Plain Layout
9132 Counter
9133 \end_layout
9134
9135 \end_inset
9136
9137 .
9138 \end_layout
9139
9140 \begin_layout Description
9141 \begin_inset Flex CharStyle:Code
9142 status collapsed
9143
9144 \begin_layout Plain Layout
9145 LabelFont
9146 \end_layout
9147
9148 \end_inset
9149
9150  The font used for the label.
9151  See section
9152 \begin_inset space ~
9153 \end_inset
9154
9155
9156 \begin_inset CommandInset ref
9157 LatexCommand ref
9158 reference "sec:fonts"
9159
9160 \end_inset
9161
9162 .
9163 \end_layout
9164
9165 \begin_layout Description
9166 \begin_inset Flex CharStyle:Code
9167 status collapsed
9168
9169 \begin_layout Plain Layout
9170 LabelIndent
9171 \end_layout
9172
9173 \end_inset
9174
9175  Text that indicates how far a label should be indented.
9176 \end_layout
9177
9178 \begin_layout Description
9179 \begin_inset Flex CharStyle:Code
9180 status collapsed
9181
9182 \begin_layout Plain Layout
9183 Labelsep
9184 \end_layout
9185
9186 \end_inset
9187
9188  [
9189 \begin_inset Flex CharStyle:Code
9190 status collapsed
9191
9192 \begin_layout Plain Layout
9193 string=""
9194 \end_layout
9195
9196 \end_inset
9197
9198 ] The horizontal space between the label and the text body.
9199  Only used for labels that are not above the text body.
9200 \end_layout
9201
9202 \begin_layout Description
9203 \begin_inset Flex CharStyle:Code
9204 status collapsed
9205
9206 \begin_layout Plain Layout
9207 LabelString
9208 \end_layout
9209
9210 \end_inset
9211
9212  [
9213 \begin_inset Flex CharStyle:Code
9214 status collapsed
9215
9216 \begin_layout Plain Layout
9217 string=""
9218 \end_layout
9219
9220 \end_inset
9221
9222 ] The string used for a label with a 
9223 \begin_inset Flex CharStyle:Code
9224 status collapsed
9225
9226 \begin_layout Plain Layout
9227 Static
9228 \end_layout
9229
9230 \end_inset
9231
9232  labeltype.
9233  When 
9234 \begin_inset Flex CharStyle:Code
9235 status collapsed
9236
9237 \begin_layout Plain Layout
9238 LabelCounter
9239 \end_layout
9240
9241 \end_inset
9242
9243  is set, this string can be contain the special formatting commands described
9244  in Section 
9245 \begin_inset CommandInset ref
9246 LatexCommand ref
9247 reference "sec:counter"
9248
9249 \end_inset
9250
9251 .
9252 \begin_inset Foot
9253 status collapsed
9254
9255 \begin_layout Plain Layout
9256 For the sake of backwards compatibility, the string 
9257 \begin_inset Flex CharStyle:Code
9258 status collapsed
9259
9260 \begin_layout Plain Layout
9261 @
9262 \emph on
9263 style-name
9264 \emph default
9265 @
9266 \end_layout
9267
9268 \end_inset
9269
9270  will be replaced by the expanded 
9271 \begin_inset Flex CharStyle:Code
9272 status collapsed
9273
9274 \begin_layout Plain Layout
9275 LabelString
9276 \end_layout
9277
9278 \end_inset
9279
9280  of style 
9281 \begin_inset Flex CharStyle:Code
9282 status collapsed
9283
9284 \begin_layout Plain Layout
9285
9286 \emph on
9287 style-name
9288 \end_layout
9289
9290 \end_inset
9291
9292 .
9293  This feature is now obsolete and should be replaced by the mechanisms of
9294  Section 
9295 \begin_inset CommandInset ref
9296 LatexCommand ref
9297 reference "sec:counter"
9298
9299 \end_inset
9300
9301 .
9302 \end_layout
9303
9304 \end_inset
9305
9306
9307 \end_layout
9308
9309 \begin_layout Description
9310 \begin_inset Flex CharStyle:Code
9311 status collapsed
9312
9313 \begin_layout Plain Layout
9314 LabelStringAppendix
9315 \end_layout
9316
9317 \end_inset
9318
9319  [
9320 \begin_inset Flex CharStyle:Code
9321 status collapsed
9322
9323 \begin_layout Plain Layout
9324 string=""
9325 \end_layout
9326
9327 \end_inset
9328
9329 ] This is used inside the appendix instead of 
9330 \begin_inset Flex CharStyle:Code
9331 status collapsed
9332
9333 \begin_layout Plain Layout
9334 LabelString
9335 \end_layout
9336
9337 \end_inset
9338
9339 .
9340  Note that every 
9341 \begin_inset Flex CharStyle:Code
9342 status collapsed
9343
9344 \begin_layout Plain Layout
9345 LabelString
9346 \end_layout
9347
9348 \end_inset
9349
9350  statement resets 
9351 \begin_inset Flex CharStyle:Code
9352 status collapsed
9353
9354 \begin_layout Plain Layout
9355 LabelStringAppendix
9356 \end_layout
9357
9358 \end_inset
9359
9360  too.
9361 \end_layout
9362
9363 \begin_layout Description
9364 \begin_inset Flex CharStyle:Code
9365 status collapsed
9366
9367 \begin_layout Plain Layout
9368 LabelTag
9369 \end_layout
9370
9371 \end_inset
9372
9373  [FIXME] (Used only with XML-type formats.)
9374 \end_layout
9375
9376 \begin_layout Description
9377 \begin_inset Flex CharStyle:Code
9378 status collapsed
9379
9380 \begin_layout Plain Layout
9381 Labeltype
9382 \end_layout
9383
9384 \end_inset
9385
9386  [
9387 \begin_inset Flex CharStyle:Code
9388 status collapsed
9389
9390 \begin_layout Plain Layout
9391
9392 \emph on
9393 No_Label
9394 \emph default
9395 , Manual, Static, Top_Environment, 
9396 \begin_inset Newline newline
9397 \end_inset
9398
9399 Centered_Top_Environment, Sensitive, Counter
9400 \end_layout
9401
9402 \end_inset
9403
9404
9405 \begin_inset Newline newline
9406 \end_inset
9407
9408
9409 \begin_inset Flex CharStyle:Code
9410 status collapsed
9411
9412 \begin_layout Plain Layout
9413 Manual
9414 \end_layout
9415
9416 \end_inset
9417
9418  means the label is the very first word (up to the first real blank).
9419 \begin_inset Foot
9420 status collapsed
9421
9422 \begin_layout Plain Layout
9423 Use protected spaces if you want more than one word as the label.
9424 \end_layout
9425
9426 \end_inset
9427
9428  
9429 \begin_inset Flex CharStyle:Code
9430 status collapsed
9431
9432 \begin_layout Plain Layout
9433 Static
9434 \end_layout
9435
9436 \end_inset
9437
9438  means it is defined in the layout (see 
9439 \begin_inset Flex CharStyle:Code
9440 status collapsed
9441
9442 \begin_layout Plain Layout
9443 LabelString
9444 \end_layout
9445
9446 \end_inset
9447
9448 ).
9449  
9450 \begin_inset Flex CharStyle:Code
9451 status collapsed
9452
9453 \begin_layout Plain Layout
9454 Top_Environment
9455 \end_layout
9456
9457 \end_inset
9458
9459  and 
9460 \begin_inset Flex CharStyle:Code
9461 status collapsed
9462
9463 \begin_layout Plain Layout
9464 Centered_Top_Environment
9465 \end_layout
9466
9467 \end_inset
9468
9469  are special cases of 
9470 \begin_inset Flex CharStyle:Code
9471 status collapsed
9472
9473 \begin_layout Plain Layout
9474 Static
9475 \end_layout
9476
9477 \end_inset
9478
9479 .
9480  The label will be printed above the paragraph, but only at the top of an
9481  environment or the top of a chain of paragraphs with this layout.
9482  Usage is for example the 
9483 \begin_inset Flex CharStyle:MenuItem
9484 status collapsed
9485
9486 \begin_layout Plain Layout
9487 Abstract
9488 \end_layout
9489
9490 \end_inset
9491
9492  layout or the 
9493 \begin_inset Flex CharStyle:MenuItem
9494 status collapsed
9495
9496 \begin_layout Plain Layout
9497 Bibliography
9498 \end_layout
9499
9500 \end_inset
9501
9502  layout.
9503  This is also the case for 
9504 \begin_inset Flex CharStyle:Code
9505 status collapsed
9506
9507 \begin_layout Plain Layout
9508 Manual
9509 \end_layout
9510
9511 \end_inset
9512
9513  labels with latex type 
9514 \begin_inset Flex CharStyle:Code
9515 status collapsed
9516
9517 \begin_layout Plain Layout
9518 Environment
9519 \end_layout
9520
9521 \end_inset
9522
9523 , in order to make layouts for theorems work correctly.
9524  
9525 \begin_inset Flex CharStyle:Code
9526 status collapsed
9527
9528 \begin_layout Plain Layout
9529 Sensitive
9530 \end_layout
9531
9532 \end_inset
9533
9534  is a special case for the caption-labels 
9535 \begin_inset Quotes eld
9536 \end_inset
9537
9538 Figure
9539 \begin_inset Quotes erd
9540 \end_inset
9541
9542  and 
9543 \begin_inset Quotes eld
9544 \end_inset
9545
9546 Table
9547 \begin_inset Quotes erd
9548 \end_inset
9549
9550 .
9551  
9552 \begin_inset Flex CharStyle:Code
9553 status collapsed
9554
9555 \begin_layout Plain Layout
9556 Sensitive
9557 \end_layout
9558
9559 \end_inset
9560
9561  means the (hardcoded) label string depends on the kind of float.
9562  The 
9563 \begin_inset Flex CharStyle:Code
9564 status collapsed
9565
9566 \begin_layout Plain Layout
9567 Counter
9568 \end_layout
9569
9570 \end_inset
9571
9572  label type defines automatically numbered labels.
9573  See Section 
9574 \begin_inset CommandInset ref
9575 LatexCommand ref
9576 reference "sec:counter"
9577
9578 \end_inset
9579
9580 .
9581 \end_layout
9582
9583 \begin_layout Description
9584 \begin_inset Flex CharStyle:Code
9585 status collapsed
9586
9587 \begin_layout Plain Layout
9588 LatexName
9589 \end_layout
9590
9591 \end_inset
9592
9593  The name of the corresponding LaTeX stuff.
9594  Either the environment or command name.
9595 \end_layout
9596
9597 \begin_layout Description
9598 \begin_inset Flex CharStyle:Code
9599 status collapsed
9600
9601 \begin_layout Plain Layout
9602 LatexParam
9603 \end_layout
9604
9605 \end_inset
9606
9607  An optional parameter for the corresponding 
9608 \begin_inset Flex CharStyle:Code
9609 status collapsed
9610
9611 \begin_layout Plain Layout
9612 LatexName
9613 \end_layout
9614
9615 \end_inset
9616
9617  stuff.
9618  This parameter cannot be changed from within LyX.
9619 \end_layout
9620
9621 \begin_layout Description
9622 \begin_inset Flex CharStyle:Code
9623 status collapsed
9624
9625 \begin_layout Plain Layout
9626 LatexType
9627 \end_layout
9628
9629 \end_inset
9630
9631  
9632 \begin_inset CommandInset label
9633 LatexCommand label
9634 name "des:LatexType"
9635
9636 \end_inset
9637
9638 [
9639 \begin_inset Flex CharStyle:Code
9640 status collapsed
9641
9642 \begin_layout Plain Layout
9643
9644 \emph on
9645 Paragraph
9646 \emph default
9647 , Command, Environment, Item_Environment,
9648 \end_layout
9649
9650 \end_inset
9651
9652  
9653 \begin_inset Flex CharStyle:Code
9654 status collapsed
9655
9656 \begin_layout Plain Layout
9657 List_Environment
9658 \end_layout
9659
9660 \end_inset
9661
9662 ] How the layout should be translated into LaTeX.
9663  
9664 \begin_inset Flex CharStyle:Code
9665 status collapsed
9666
9667 \begin_layout Plain Layout
9668 Paragraph
9669 \end_layout
9670
9671 \end_inset
9672
9673  means nothing special.
9674  
9675 \begin_inset Flex CharStyle:Code
9676 status collapsed
9677
9678 \begin_layout Plain Layout
9679 Command
9680 \end_layout
9681
9682 \end_inset
9683
9684  means 
9685 \begin_inset Flex CharStyle:Code
9686 status collapsed
9687
9688 \begin_layout Plain Layout
9689
9690 \backslash
9691
9692 \emph on
9693 LatexName
9694 \emph default
9695 {\SpecialChar \ldots{}
9696 }
9697 \end_layout
9698
9699 \end_inset
9700
9701  and 
9702 \begin_inset Flex CharStyle:Code
9703 status collapsed
9704
9705 \begin_layout Plain Layout
9706 Environment
9707 \end_layout
9708
9709 \end_inset
9710
9711  means 
9712 \begin_inset Flex CharStyle:Code
9713 status collapsed
9714
9715 \begin_layout Plain Layout
9716
9717 \backslash
9718 begin{
9719 \emph on
9720 LatexName
9721 \emph default
9722 }\SpecialChar \ldots{}
9723
9724 \backslash
9725 end{
9726 \emph on
9727 LatexName
9728 \emph default
9729 }
9730 \end_layout
9731
9732 \end_inset
9733
9734 .
9735  
9736 \begin_inset Flex CharStyle:Code
9737 status collapsed
9738
9739 \begin_layout Plain Layout
9740 Item_Environment
9741 \end_layout
9742
9743 \end_inset
9744
9745  is the same as 
9746 \begin_inset Flex CharStyle:Code
9747 status collapsed
9748
9749 \begin_layout Plain Layout
9750 Environment
9751 \end_layout
9752
9753 \end_inset
9754
9755 , except that a 
9756 \begin_inset Flex CharStyle:Code
9757 status collapsed
9758
9759 \begin_layout Plain Layout
9760
9761 \backslash
9762 item
9763 \end_layout
9764
9765 \end_inset
9766
9767  is generated for each paragraph of this environment.
9768  
9769 \begin_inset Flex CharStyle:Code
9770 status collapsed
9771
9772 \begin_layout Plain Layout
9773 List_Environment
9774 \end_layout
9775
9776 \end_inset
9777
9778  is the same as 
9779 \begin_inset Flex CharStyle:Code
9780 status collapsed
9781
9782 \begin_layout Plain Layout
9783 Item_Environment
9784 \end_layout
9785
9786 \end_inset
9787
9788 , except that 
9789 \begin_inset Flex CharStyle:Code
9790 status collapsed
9791
9792 \begin_layout Plain Layout
9793 LabelWidthString
9794 \end_layout
9795
9796 \end_inset
9797
9798  is passed as an argument to the environment.
9799  
9800 \begin_inset Flex CharStyle:Code
9801 status collapsed
9802
9803 \begin_layout Plain Layout
9804 LabelWidthString
9805 \end_layout
9806
9807 \end_inset
9808
9809  can be defined in the 
9810 \begin_inset Flex CharStyle:MenuItem
9811 status collapsed
9812
9813 \begin_layout Plain Layout
9814
9815 \bar under
9816 L
9817 \bar default
9818 ayout\SpecialChar \menuseparator
9819
9820 \bar under
9821 P
9822 \bar default
9823 aragraph
9824 \end_layout
9825
9826 \end_inset
9827
9828  dialog.
9829  
9830 \begin_inset Flex CharStyle:Code
9831 status collapsed
9832
9833 \begin_layout Plain Layout
9834
9835 \emph on
9836 LatexType
9837 \end_layout
9838
9839 \end_inset
9840
9841  is perhaps a bit misleading, since these rules apply to SGML classes, too.
9842  Visit the SGML class files for specific examples.
9843 \end_layout
9844
9845 \begin_layout Standard
9846 Putting the last few things together, the LaTeX output will be either: 
9847 \end_layout
9848
9849 \begin_layout LyX-Code
9850
9851 \backslash
9852 latexname[latexparam]{\SpecialChar \ldots{}
9853 }
9854 \end_layout
9855
9856 \begin_layout Standard
9857 or: 
9858 \end_layout
9859
9860 \begin_layout LyX-Code
9861
9862 \backslash
9863 begin{latexname}[latexparam] \SpecialChar \ldots{}
9864  
9865 \backslash
9866 end{latexname}.
9867 \end_layout
9868
9869 \begin_layout Standard
9870 depending upon the LaTex type.
9871 \end_layout
9872
9873 \begin_layout Description
9874 \begin_inset Flex CharStyle:Code
9875 status collapsed
9876
9877 \begin_layout Plain Layout
9878 LeftMargin
9879 \end_layout
9880
9881 \end_inset
9882
9883  [
9884 \begin_inset Flex CharStyle:Code
9885 status collapsed
9886
9887 \begin_layout Plain Layout
9888 string=""
9889 \end_layout
9890
9891 \end_inset
9892
9893 ] If you put layouts into environments, the leftmargins are not simply added,
9894  but added with a factor 
9895 \begin_inset Formula $\frac{4}{depth+4}$
9896 \end_inset
9897
9898 .
9899  Note that this parameter is also used when the margin is defined as 
9900 \begin_inset Flex CharStyle:Code
9901 status collapsed
9902
9903 \begin_layout Plain Layout
9904 Manual
9905 \end_layout
9906
9907 \end_inset
9908
9909  or 
9910 \begin_inset Flex CharStyle:Code
9911 status collapsed
9912
9913 \begin_layout Plain Layout
9914 Dynamic
9915 \end_layout
9916
9917 \end_inset
9918
9919 .
9920  Then it is added to the manual or dynamic margin.
9921  
9922 \begin_inset Newline newline
9923 \end_inset
9924
9925 The argument is passed as a string.
9926  For example 
9927 \begin_inset Quotes eld
9928 \end_inset
9929
9930
9931 \begin_inset Flex CharStyle:Code
9932 status collapsed
9933
9934 \begin_layout Plain Layout
9935 MM
9936 \end_layout
9937
9938 \end_inset
9939
9940
9941 \begin_inset Quotes erd
9942 \end_inset
9943
9944  means that the paragraph is indented with the width of 
9945 \begin_inset Quotes eld
9946 \end_inset
9947
9948
9949 \begin_inset Flex CharStyle:Code
9950 status collapsed
9951
9952 \begin_layout Plain Layout
9953 MM
9954 \end_layout
9955
9956 \end_inset
9957
9958
9959 \begin_inset Quotes erd
9960 \end_inset
9961
9962  in the normal font.
9963  You can get a negative width by prefixing the string with 
9964 \begin_inset Quotes eld
9965 \end_inset
9966
9967
9968 \begin_inset Flex CharStyle:Code
9969 status collapsed
9970
9971 \begin_layout Plain Layout
9972 -
9973 \end_layout
9974
9975 \end_inset
9976
9977
9978 \begin_inset Quotes erd
9979 \end_inset
9980
9981 .
9982  This way was chosen so that the look is the same with each used screen
9983  font.
9984  
9985 \end_layout
9986
9987 \begin_layout Description
9988 \begin_inset Flex CharStyle:Code
9989 status collapsed
9990
9991 \begin_layout Plain Layout
9992 Margin
9993 \end_layout
9994
9995 \end_inset
9996
9997  [
9998 \begin_inset Flex CharStyle:Code
9999 status collapsed
10000
10001 \begin_layout Plain Layout
10002
10003 \emph on
10004 Static
10005 \emph default
10006 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10007 \end_layout
10008
10009 \end_inset
10010
10011
10012 \begin_inset Newline newline
10013 \end_inset
10014
10015 The kind of margin that the layout has on the left side.
10016  
10017 \begin_inset Flex CharStyle:Code
10018 status collapsed
10019
10020 \begin_layout Plain Layout
10021 Static
10022 \end_layout
10023
10024 \end_inset
10025
10026  just means a fixed margin.
10027  
10028 \begin_inset Flex CharStyle:Code
10029 status collapsed
10030
10031 \begin_layout Plain Layout
10032 Manual
10033 \end_layout
10034
10035 \end_inset
10036
10037  means that the left margin depends on the string entered in the 
10038 \begin_inset Flex CharStyle:MenuItem
10039 status collapsed
10040
10041 \begin_layout Plain Layout
10042 Edit\SpecialChar \menuseparator
10043 Paragraph
10044 \begin_inset space ~
10045 \end_inset
10046
10047 Settings
10048 \end_layout
10049
10050 \end_inset
10051
10052  dialog.
10053  This is used to typeset nice lists without tabulators.
10054  
10055 \begin_inset Flex CharStyle:Code
10056 status collapsed
10057
10058 \begin_layout Plain Layout
10059 Dynamic
10060 \end_layout
10061
10062 \end_inset
10063
10064  means that the margin depends on the size of the label.
10065  This is used for automatic enumerated headlines.
10066  It is obvious that the headline 
10067 \begin_inset Quotes eld
10068 \end_inset
10069
10070 5.4.3.2.1 Very long headline
10071 \begin_inset Quotes erd
10072 \end_inset
10073
10074  must have a wider left margin (as wide as 
10075 \begin_inset Quotes eld
10076 \end_inset
10077
10078 5.4.3.2.1
10079 \begin_inset Quotes erd
10080 \end_inset
10081
10082  plus the space) than 
10083 \begin_inset Quotes eld
10084 \end_inset
10085
10086 3.2 Very long headline
10087 \begin_inset Quotes erd
10088 \end_inset
10089
10090 , even if standard 
10091 \begin_inset Quotes eld
10092 \end_inset
10093
10094 word processors
10095 \begin_inset Quotes erd
10096 \end_inset
10097
10098  are not able to do this.
10099  
10100 \begin_inset Flex CharStyle:Code
10101 status collapsed
10102
10103 \begin_layout Plain Layout
10104 First_Dynamic
10105 \end_layout
10106
10107 \end_inset
10108
10109  is similar, but only the very first row of the paragraph is dynamic, while
10110  the others are static; this is used, for example, for descriptions.
10111  
10112 \begin_inset Flex CharStyle:Code
10113 status collapsed
10114
10115 \begin_layout Plain Layout
10116 Right_Address_Box
10117 \end_layout
10118
10119 \end_inset
10120
10121  means the margin is chosen in a way that the longest row of this paragraph
10122  fits to the right margin.
10123  This is used to typeset an address on the right edge of the page.
10124 \end_layout
10125
10126 \begin_layout Description
10127 \begin_inset Flex CharStyle:Code
10128 status collapsed
10129
10130 \begin_layout Plain Layout
10131 NeedProtect
10132 \end_layout
10133
10134 \end_inset
10135
10136  [
10137 \begin_inset Flex CharStyle:Code
10138 status collapsed
10139
10140 \begin_layout Plain Layout
10141
10142 \emph on
10143 0
10144 \end_layout
10145
10146 \end_inset
10147
10148 ,
10149 \begin_inset Flex CharStyle:Code
10150 status collapsed
10151
10152 \begin_layout Plain Layout
10153 1
10154 \end_layout
10155
10156 \end_inset
10157
10158 ] Whether fragile commands in this layout should be 
10159 \begin_inset Flex CharStyle:Code
10160 status collapsed
10161
10162 \begin_layout Plain Layout
10163
10164 \backslash
10165 protect
10166 \end_layout
10167
10168 \end_inset
10169
10170 'ed.
10171  (Note: This is 
10172 \emph on
10173 not
10174 \emph default
10175  whether this command should itself be protected.)
10176 \end_layout
10177
10178 \begin_layout Description
10179 \begin_inset Flex CharStyle:Code
10180 status collapsed
10181
10182 \begin_layout Plain Layout
10183 Newline
10184 \end_layout
10185
10186 \end_inset
10187
10188  [
10189 \begin_inset Flex CharStyle:Code
10190 status collapsed
10191
10192 \begin_layout Plain Layout
10193 0
10194 \end_layout
10195
10196 \end_inset
10197
10198
10199 \begin_inset Flex CharStyle:Code
10200 status collapsed
10201
10202 \begin_layout Plain Layout
10203
10204 \emph on
10205 1
10206 \end_layout
10207
10208 \end_inset
10209
10210 ] Whether newlines are translated into LaTeX newlines (
10211 \begin_inset Flex CharStyle:Code
10212 status collapsed
10213
10214 \begin_layout Plain Layout
10215
10216 \backslash
10217
10218 \backslash
10219
10220 \end_layout
10221
10222 \end_inset
10223
10224 ) or not.
10225  The translation can be switched off to allow more comfortable LaTeX editing
10226  inside LyX.
10227 \end_layout
10228
10229 \begin_layout Description
10230 \begin_inset Flex CharStyle:Code
10231 status collapsed
10232
10233 \begin_layout Plain Layout
10234 NextNoIndent
10235 \end_layout
10236
10237 \end_inset
10238
10239  [
10240 \begin_inset Flex CharStyle:Code
10241 status collapsed
10242
10243 \begin_layout Plain Layout
10244 1
10245 \end_layout
10246
10247 \end_inset
10248
10249
10250 \begin_inset Flex CharStyle:Code
10251 status collapsed
10252
10253 \begin_layout Plain Layout
10254
10255 \emph on
10256 0
10257 \end_layout
10258
10259 \end_inset
10260
10261 ] Whether the following Paragraph is allowed to indent its very first row.
10262  
10263 \begin_inset Flex CharStyle:Code
10264 status collapsed
10265
10266 \begin_layout Plain Layout
10267 1
10268 \end_layout
10269
10270 \end_inset
10271
10272  means that it is not allowed to do so; 
10273 \begin_inset Flex CharStyle:Code
10274 status collapsed
10275
10276 \begin_layout Plain Layout
10277 0
10278 \end_layout
10279
10280 \end_inset
10281
10282  means it could do so if it wants to.
10283 \end_layout
10284
10285 \begin_layout Description
10286 \begin_inset Flex CharStyle:Code
10287 status collapsed
10288
10289 \begin_layout Plain Layout
10290 ObsoletedBy
10291 \end_layout
10292
10293 \end_inset
10294
10295  Name of a layout that has replaced this layout.
10296  This is used to rename a layout, while keeping backward compatibility.
10297 \end_layout
10298
10299 \begin_layout Description
10300 \begin_inset Flex CharStyle:Code
10301 status collapsed
10302
10303 \begin_layout Plain Layout
10304 OptionalArgs
10305 \end_layout
10306
10307 \end_inset
10308
10309  [
10310 \begin_inset Flex CharStyle:Code
10311 status collapsed
10312
10313 \begin_layout Plain Layout
10314 int=0
10315 \end_layout
10316
10317 \end_inset
10318
10319 ] The number of optional arguments that can be used with this layout.
10320  This is useful for things like section headings, and only makes sense with
10321  LaTeX.
10322 \end_layout
10323
10324 \begin_layout Description
10325 \begin_inset Flex CharStyle:Code
10326 status collapsed
10327
10328 \begin_layout Plain Layout
10329 ParIndent
10330 \end_layout
10331
10332 \end_inset
10333
10334  [
10335 \begin_inset Flex CharStyle:Code
10336 status collapsed
10337
10338 \begin_layout Plain Layout
10339 string=""
10340 \end_layout
10341
10342 \end_inset
10343
10344 ] The indent of the very first line of a paragraph.
10345  The 
10346 \begin_inset Flex CharStyle:Code
10347 status collapsed
10348
10349 \begin_layout Plain Layout
10350 Parindent
10351 \end_layout
10352
10353 \end_inset
10354
10355  will be fixed for a certain layout.
10356  The exception is Standard layout, since the indentation of a Standard layout
10357  paragraph can be prohibited with 
10358 \begin_inset Flex CharStyle:Code
10359 status collapsed
10360
10361 \begin_layout Plain Layout
10362 NextNoIndent
10363 \end_layout
10364
10365 \end_inset
10366
10367 .
10368  Also, Standard layout paragraphs inside environments use the 
10369 \begin_inset Flex CharStyle:Code
10370 status collapsed
10371
10372 \begin_layout Plain Layout
10373 Parindent
10374 \end_layout
10375
10376 \end_inset
10377
10378  of the environment, not their native one.
10379  For example, Standard paragraphs inside an enumeration are not indented.
10380 \end_layout
10381
10382 \begin_layout Description
10383 \begin_inset Flex CharStyle:Code
10384 status collapsed
10385
10386 \begin_layout Plain Layout
10387 Parsep
10388 \end_layout
10389
10390 \end_inset
10391
10392  [
10393 \begin_inset Flex CharStyle:Code
10394 status collapsed
10395
10396 \begin_layout Plain Layout
10397 float=0
10398 \end_layout
10399
10400 \end_inset
10401
10402 ] The vertical space between two paragraphs of this layout.
10403 \end_layout
10404
10405 \begin_layout Description
10406 \begin_inset Flex CharStyle:Code
10407 status collapsed
10408
10409 \begin_layout Plain Layout
10410 Parskip
10411 \end_layout
10412
10413 \end_inset
10414
10415  [
10416 \begin_inset Flex CharStyle:Code
10417 status collapsed
10418
10419 \begin_layout Plain Layout
10420 float=0
10421 \end_layout
10422
10423 \end_inset
10424
10425 ] LyX allows the user to choose either 
10426 \begin_inset Quotes eld
10427 \end_inset
10428
10429 indent
10430 \begin_inset Quotes erd
10431 \end_inset
10432
10433  or 
10434 \begin_inset Quotes eld
10435 \end_inset
10436
10437 skip
10438 \begin_inset Quotes erd
10439 \end_inset
10440
10441  to typeset a document.
10442  When 
10443 \begin_inset Quotes eld
10444 \end_inset
10445
10446 indent
10447 \begin_inset Quotes erd
10448 \end_inset
10449
10450  is chosen, this value is completely ignored.
10451  When 
10452 \begin_inset Quotes eld
10453 \end_inset
10454
10455 skip
10456 \begin_inset Quotes erd
10457 \end_inset
10458
10459  is chosen, the parindent of a LaTeXtype 
10460 \begin_inset Quotes eld
10461 \end_inset
10462
10463 Paragraph
10464 \begin_inset Quotes erd
10465 \end_inset
10466
10467  layout is ignored and all paragraphs are separated by this parskip argument.
10468  The vertical space is calculated with 
10469 \begin_inset Flex CharStyle:Code
10470 status collapsed
10471
10472 \begin_layout Plain Layout
10473 value
10474 \begin_inset space ~
10475 \end_inset
10476
10477 * DefaultHeight
10478 \end_layout
10479
10480 \end_inset
10481
10482  where 
10483 \begin_inset Flex CharStyle:Code
10484 status collapsed
10485
10486 \begin_layout Plain Layout
10487 DefaultHeight
10488 \end_layout
10489
10490 \end_inset
10491
10492  is the height of a row with the normal font.
10493  This way, the look stays the same with different screen fonts.
10494 \end_layout
10495
10496 \begin_layout Description
10497 \begin_inset Flex CharStyle:Code
10498 status collapsed
10499
10500 \begin_layout Plain Layout
10501 PassThru
10502 \end_layout
10503
10504 \end_inset
10505
10506  
10507 \begin_inset CommandInset label
10508 LatexCommand label
10509 name "des:PathThru"
10510
10511 \end_inset
10512
10513 [
10514 \emph on
10515
10516 \begin_inset Flex CharStyle:Code
10517 status collapsed
10518
10519 \begin_layout Plain Layout
10520
10521 \emph on
10522 0
10523 \end_layout
10524
10525 \end_inset
10526
10527
10528 \emph default
10529
10530 \begin_inset Flex CharStyle:Code
10531 status collapsed
10532
10533 \begin_layout Plain Layout
10534 1
10535 \end_layout
10536
10537 \end_inset
10538
10539 ] Whether the contents of this paragraph should be output in raw form, meaning
10540  without special translations that LaTeX would require.
10541 \end_layout
10542
10543 \begin_layout Description
10544 \begin_inset Flex CharStyle:Code
10545 status collapsed
10546
10547 \begin_layout Plain Layout
10548 Preamble
10549 \end_layout
10550
10551 \end_inset
10552
10553  
10554 \begin_inset CommandInset label
10555 LatexCommand label
10556 name "des:Preamble"
10557
10558 \end_inset
10559
10560 Information to be included in the LaTeX preamable when this style is used.
10561  Used to define macros, load packages, etc., required by this particular
10562  style.
10563  Must end with 
10564 \begin_inset Quotes eld
10565 \end_inset
10566
10567
10568 \begin_inset Flex CharStyle:Code
10569 status collapsed
10570
10571 \begin_layout Plain Layout
10572 EndPreamble
10573 \end_layout
10574
10575 \end_inset
10576
10577
10578 \begin_inset Quotes erd
10579 \end_inset
10580
10581 .
10582 \end_layout
10583
10584 \begin_layout Description
10585 \begin_inset Flex CharStyle:Code
10586 status collapsed
10587
10588 \begin_layout Plain Layout
10589 Requires 
10590 \end_layout
10591
10592 \end_inset
10593
10594 [
10595 \begin_inset Flex CharStyle:Code
10596 status collapsed
10597
10598 \begin_layout Plain Layout
10599 string
10600 \end_layout
10601
10602 \end_inset
10603
10604
10605 \begin_inset CommandInset label
10606 LatexCommand label
10607 name "des:Requires"
10608
10609 \end_inset
10610
10611 Whether the layout requires the feature 
10612 \begin_inset Flex CharStyle:Code
10613 status collapsed
10614
10615 \begin_layout Plain Layout
10616 string
10617 \end_layout
10618
10619 \end_inset
10620
10621 .
10622  See the description of 
10623 \begin_inset Flex CharStyle:Code
10624 status collapsed
10625
10626 \begin_layout Plain Layout
10627 Provides
10628 \end_layout
10629
10630 \end_inset
10631
10632  above (page 
10633 \begin_inset CommandInset ref
10634 LatexCommand pageref
10635 reference "des:FreeSpacing"
10636
10637 \end_inset
10638
10639 ) for information on `features'.
10640  
10641 \end_layout
10642
10643 \begin_layout Description
10644 \begin_inset Flex CharStyle:Code
10645 status collapsed
10646
10647 \begin_layout Plain Layout
10648 RightMargin
10649 \end_layout
10650
10651 \end_inset
10652
10653  [
10654 \begin_inset Flex CharStyle:Code
10655 status collapsed
10656
10657 \begin_layout Plain Layout
10658 string=""
10659 \end_layout
10660
10661 \end_inset
10662
10663 ] Similar to 
10664 \begin_inset Flex CharStyle:Code
10665 status collapsed
10666
10667 \begin_layout Plain Layout
10668 LeftMargin
10669 \end_layout
10670
10671 \end_inset
10672
10673 .
10674 \end_layout
10675
10676 \begin_layout Description
10677 \begin_inset Flex CharStyle:Code
10678 status collapsed
10679
10680 \begin_layout Plain Layout
10681 Spacing
10682 \end_layout
10683
10684 \end_inset
10685
10686  [
10687 \begin_inset Flex CharStyle:Code
10688 status collapsed
10689
10690 \begin_layout Plain Layout
10691
10692 \emph on
10693 single
10694 \emph default
10695 , onehalf, double, other
10696 \end_layout
10697
10698 \end_inset
10699
10700  
10701 \emph on
10702 value
10703 \emph default
10704 ] This defines what the default spacing should be in the layout.
10705  The arguments 
10706 \begin_inset Flex CharStyle:Code
10707 status collapsed
10708
10709 \begin_layout Plain Layout
10710 single
10711 \end_layout
10712
10713 \end_inset
10714
10715
10716 \begin_inset Flex CharStyle:Code
10717 status collapsed
10718
10719 \begin_layout Plain Layout
10720 onehalf
10721 \end_layout
10722
10723 \end_inset
10724
10725  and 
10726 \begin_inset Flex CharStyle:Code
10727 status collapsed
10728
10729 \begin_layout Plain Layout
10730 double
10731 \end_layout
10732
10733 \end_inset
10734
10735  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10736  If you specify the argument 
10737 \begin_inset Flex CharStyle:Code
10738 status collapsed
10739
10740 \begin_layout Plain Layout
10741 other
10742 \end_layout
10743
10744 \end_inset
10745
10746 , then you should also provide a numerical argument which will be the actual
10747  multiplier value.
10748  Note that, contrary to other parameters, 
10749 \begin_inset Flex CharStyle:Code
10750 status collapsed
10751
10752 \begin_layout Plain Layout
10753 Spacing
10754 \end_layout
10755
10756 \end_inset
10757
10758  implies the generation of specific LaTeX code, using the package 
10759 \family roman
10760
10761 \begin_inset Flex CharStyle:Code
10762 status collapsed
10763
10764 \begin_layout Plain Layout
10765 setspace.sty
10766 \end_layout
10767
10768 \end_inset
10769
10770 .
10771 \end_layout
10772
10773 \begin_layout Description
10774 \begin_inset Flex CharStyle:Code
10775 status collapsed
10776
10777 \begin_layout Plain Layout
10778 TextFont
10779 \end_layout
10780
10781 \end_inset
10782
10783  The font used for the text body .
10784  See section 
10785 \begin_inset CommandInset ref
10786 LatexCommand ref
10787 reference "sec:fonts"
10788
10789 \end_inset
10790
10791 .
10792 \end_layout
10793
10794 \begin_layout Description
10795 \begin_inset Flex CharStyle:Code
10796 status collapsed
10797
10798 \begin_layout Plain Layout
10799
10800 \series medium
10801 TocLevel [int]
10802 \end_layout
10803
10804 \end_inset
10805
10806  The level of the style in the table of contents.
10807  This is used for automatic numbering of section headings.
10808 \end_layout
10809
10810 \begin_layout Description
10811 \begin_inset Flex CharStyle:Code
10812 status collapsed
10813
10814 \begin_layout Plain Layout
10815 TopSep
10816 \end_layout
10817
10818 \end_inset
10819
10820  [
10821 \begin_inset Flex CharStyle:Code
10822 status collapsed
10823
10824 \begin_layout Plain Layout
10825 float=0
10826 \end_layout
10827
10828 \end_inset
10829
10830 ] The vertical space with which the very first of a chain of paragraphs
10831  with this layout is separated from the previous paragraph.
10832  If the previous paragraph has another layout, the separations are not simply
10833  added, but the maximum is taken.
10834 \end_layout
10835
10836 \begin_layout Subsection
10837 Floats
10838 \end_layout
10839
10840 \begin_layout Standard
10841 \begin_inset CommandInset label
10842 LatexCommand label
10843 name "sec:floats"
10844
10845 \end_inset
10846
10847 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10848  define the floats (
10849 \begin_inset Flex CharStyle:MenuItem
10850 status collapsed
10851
10852 \begin_layout Plain Layout
10853 figure
10854 \end_layout
10855
10856 \end_inset
10857
10858
10859 \begin_inset Flex CharStyle:MenuItem
10860 status collapsed
10861
10862 \begin_layout Plain Layout
10863 table
10864 \end_layout
10865
10866 \end_inset
10867
10868 , \SpecialChar \ldots{}
10869 ) in the text class itself.
10870  Standard floats are included in the file 
10871 \begin_inset Flex CharStyle:Code
10872 status collapsed
10873
10874 \begin_layout Plain Layout
10875 stdfloats.inc
10876 \end_layout
10877
10878 \end_inset
10879
10880 , so you may have to do no more than add
10881 \end_layout
10882
10883 \begin_layout LyX-Code
10884 Input stdfloats.inc
10885 \end_layout
10886
10887 \begin_layout Standard
10888 to your layout file.
10889  If you want to implement a text class that proposes some other float types
10890  (like the AGU class bundled with LyX), the information below will hopefully
10891  help you:
10892 \end_layout
10893
10894 \begin_layout Description
10895 \begin_inset Flex CharStyle:Code
10896 status collapsed
10897
10898 \begin_layout Plain Layout
10899 Extension
10900 \end_layout
10901
10902 \end_inset
10903
10904  [
10905 \begin_inset Flex CharStyle:Code
10906 status collapsed
10907
10908 \begin_layout Plain Layout
10909 string
10910 \end_layout
10911
10912 \end_inset
10913
10914 =
10915 \begin_inset Quotes erd
10916 \end_inset
10917
10918
10919 \begin_inset Quotes erd
10920 \end_inset
10921
10922 ] The file name extension of an auxiliary file for the list of figures (or
10923  whatever).
10924  LaTeX writes the captions to this file.
10925 \end_layout
10926
10927 \begin_layout Description
10928 \begin_inset Flex CharStyle:Code
10929 status collapsed
10930
10931 \begin_layout Plain Layout
10932 GuiName
10933 \end_layout
10934
10935 \end_inset
10936
10937  [
10938 \begin_inset Flex CharStyle:Code
10939 status collapsed
10940
10941 \begin_layout Plain Layout
10942 string
10943 \end_layout
10944
10945 \end_inset
10946
10947 =
10948 \begin_inset Quotes erd
10949 \end_inset
10950
10951
10952 \begin_inset Quotes erd
10953 \end_inset
10954
10955 ] The string that will be used in the menus and also for the caption.
10956 \end_layout
10957
10958 \begin_layout Description
10959 \begin_inset Flex CharStyle:Code
10960 status collapsed
10961
10962 \begin_layout Plain Layout
10963 LaTeXBuiltin
10964 \end_layout
10965
10966 \end_inset
10967
10968  [
10969 \begin_inset Flex CharStyle:Code
10970 status collapsed
10971
10972 \begin_layout Plain Layout
10973
10974 \emph on
10975 0
10976 \end_layout
10977
10978 \end_inset
10979
10980
10981 \begin_inset Flex CharStyle:Code
10982 status collapsed
10983
10984 \begin_layout Plain Layout
10985 1
10986 \end_layout
10987
10988 \end_inset
10989
10990 ] Set to 
10991 \begin_inset Flex CharStyle:Code
10992 status collapsed
10993
10994 \begin_layout Plain Layout
10995 1
10996 \end_layout
10997
10998 \end_inset
10999
11000  if the float is already defined by the LaTeX document class.
11001  If this is set to 
11002 \begin_inset Flex CharStyle:Code
11003 status collapsed
11004
11005 \begin_layout Plain Layout
11006 0
11007 \end_layout
11008
11009 \end_inset
11010
11011 , the float will be defined using the LaTeX package 
11012 \begin_inset Flex CharStyle:Code
11013 status collapsed
11014
11015 \begin_layout Plain Layout
11016 float
11017 \end_layout
11018
11019 \end_inset
11020
11021 .
11022 \end_layout
11023
11024 \begin_layout Description
11025 \begin_inset Flex CharStyle:Code
11026 status collapsed
11027
11028 \begin_layout Plain Layout
11029 ListName
11030 \end_layout
11031
11032 \end_inset
11033
11034  [
11035 \begin_inset Flex CharStyle:Code
11036 status collapsed
11037
11038 \begin_layout Plain Layout
11039 string
11040 \end_layout
11041
11042 \end_inset
11043
11044 =
11045 \begin_inset Quotes erd
11046 \end_inset
11047
11048
11049 \begin_inset Quotes erd
11050 \end_inset
11051
11052 ] The heading used for the list of floats.
11053 \end_layout
11054
11055 \begin_layout Description
11056 \begin_inset Flex CharStyle:Code
11057 status collapsed
11058
11059 \begin_layout Plain Layout
11060 NumberWithin
11061 \end_layout
11062
11063 \end_inset
11064
11065  [
11066 \begin_inset Flex CharStyle:Code
11067 status collapsed
11068
11069 \begin_layout Plain Layout
11070 string
11071 \end_layout
11072
11073 \end_inset
11074
11075 =
11076 \begin_inset Quotes erd
11077 \end_inset
11078
11079
11080 \begin_inset Quotes erd
11081 \end_inset
11082
11083 ] This (optional) argument determines whether floats of this class will
11084  be numbered within some sectional unit of the document.
11085  For example, if within is equal to 
11086 \begin_inset Flex CharStyle:Code
11087 status collapsed
11088
11089 \begin_layout Plain Layout
11090 chapter
11091 \end_layout
11092
11093 \end_inset
11094
11095 , the floats will be numbered within chapters.
11096  
11097 \end_layout
11098
11099 \begin_layout Description
11100 \begin_inset Flex CharStyle:Code
11101 status collapsed
11102
11103 \begin_layout Plain Layout
11104 Placement
11105 \end_layout
11106
11107 \end_inset
11108
11109  [
11110 \begin_inset Flex CharStyle:Code
11111 status collapsed
11112
11113 \begin_layout Plain Layout
11114 string
11115 \end_layout
11116
11117 \end_inset
11118
11119 =
11120 \begin_inset Quotes erd
11121 \end_inset
11122
11123
11124 \begin_inset Quotes erd
11125 \end_inset
11126
11127 ] The default placement for the given class of floats.
11128  The string should be as in standard LaTeX: 
11129 \begin_inset Flex CharStyle:Code
11130 status collapsed
11131
11132 \begin_layout Plain Layout
11133 t
11134 \end_layout
11135
11136 \end_inset
11137
11138
11139 \begin_inset Flex CharStyle:Code
11140 status collapsed
11141
11142 \begin_layout Plain Layout
11143 b
11144 \end_layout
11145
11146 \end_inset
11147
11148
11149 \begin_inset Flex CharStyle:Code
11150 status collapsed
11151
11152 \begin_layout Plain Layout
11153 p
11154 \end_layout
11155
11156 \end_inset
11157
11158  and 
11159 \begin_inset Flex CharStyle:Code
11160 status collapsed
11161
11162 \begin_layout Plain Layout
11163 h
11164 \end_layout
11165
11166 \end_inset
11167
11168  for top, bottom, page, and here, respectively.
11169 \begin_inset Foot
11170 status collapsed
11171
11172 \begin_layout Plain Layout
11173 Note that the order of these letters in the string is irrelevant, like in
11174  LaTeX.
11175 \end_layout
11176
11177 \end_inset
11178
11179  On top of that there is a new type, 
11180 \begin_inset Flex CharStyle:Code
11181 status collapsed
11182
11183 \begin_layout Plain Layout
11184 H
11185 \end_layout
11186
11187 \end_inset
11188
11189 , which does not really correspond to a float, since it means: put it 
11190 \begin_inset Quotes eld
11191 \end_inset
11192
11193 here
11194 \begin_inset Quotes erd
11195 \end_inset
11196
11197  and nowhere else.
11198  Note however that the 
11199 \begin_inset Flex CharStyle:Code
11200 status collapsed
11201
11202 \begin_layout Plain Layout
11203 H
11204 \end_layout
11205
11206 \end_inset
11207
11208  specifier is special and, because of implementation details, cannot be
11209  used in non-builtin float types.
11210  If you do not understand what this means, just use 
11211 \begin_inset Quotes eld
11212 \end_inset
11213
11214
11215 \begin_inset Flex CharStyle:Code
11216 status collapsed
11217
11218 \begin_layout Plain Layout
11219 tbp
11220 \end_layout
11221
11222 \end_inset
11223
11224
11225 \begin_inset Quotes erd
11226 \end_inset
11227
11228 .
11229 \end_layout
11230
11231 \begin_layout Description
11232 \begin_inset Flex CharStyle:Code
11233 status collapsed
11234
11235 \begin_layout Plain Layout
11236 Style
11237 \end_layout
11238
11239 \end_inset
11240
11241  [
11242 \begin_inset Flex CharStyle:Code
11243 status collapsed
11244
11245 \begin_layout Plain Layout
11246 string
11247 \end_layout
11248
11249 \end_inset
11250
11251 =
11252 \begin_inset Quotes erd
11253 \end_inset
11254
11255
11256 \begin_inset Quotes erd
11257 \end_inset
11258
11259 ] The style used when defining the float using 
11260 \begin_inset Flex CharStyle:Code
11261 status collapsed
11262
11263 \begin_layout Plain Layout
11264
11265 \backslash
11266 newfloat
11267 \end_layout
11268
11269 \end_inset
11270
11271 .
11272 \end_layout
11273
11274 \begin_layout Description
11275 \begin_inset Flex CharStyle:Code
11276 status collapsed
11277
11278 \begin_layout Plain Layout
11279 Type
11280 \end_layout
11281
11282 \end_inset
11283
11284  [
11285 \begin_inset Flex CharStyle:Code
11286 status collapsed
11287
11288 \begin_layout Plain Layout
11289 string
11290 \end_layout
11291
11292 \end_inset
11293
11294 =
11295 \begin_inset Quotes erd
11296 \end_inset
11297
11298
11299 \begin_inset Quotes erd
11300 \end_inset
11301
11302 ] The 
11303 \begin_inset Quotes eld
11304 \end_inset
11305
11306 type
11307 \begin_inset Quotes erd
11308 \end_inset
11309
11310  of the new class of floats, like program or algorithm.
11311  After the appropriate 
11312 \begin_inset Flex CharStyle:Code
11313 status collapsed
11314
11315 \begin_layout Plain Layout
11316
11317 \backslash
11318 newfloat
11319 \end_layout
11320
11321 \end_inset
11322
11323 , commands such as 
11324 \begin_inset Flex CharStyle:Code
11325 status collapsed
11326
11327 \begin_layout Plain Layout
11328
11329 \backslash
11330 begin{program}
11331 \end_layout
11332
11333 \end_inset
11334
11335  or 
11336 \begin_inset Flex CharStyle:Code
11337 status collapsed
11338
11339 \begin_layout Plain Layout
11340
11341 \backslash
11342 end{algorithm*}
11343 \end_layout
11344
11345 \end_inset
11346
11347  will be available.
11348 \end_layout
11349
11350 \begin_layout Standard
11351 Note that defining a float with type 
11352 \begin_inset Flex CharStyle:Code
11353 status collapsed
11354
11355 \begin_layout Plain Layout
11356
11357 \emph on
11358 type
11359 \end_layout
11360
11361 \end_inset
11362
11363  automatically defines the corresponding counter with name 
11364 \begin_inset Flex CharStyle:Code
11365 status collapsed
11366
11367 \begin_layout Plain Layout
11368
11369 \emph on
11370 type
11371 \end_layout
11372
11373 \end_inset
11374
11375 .
11376 \end_layout
11377
11378 \begin_layout Subsection
11379 Flex insets and InsetLayout
11380 \end_layout
11381
11382 \begin_layout Standard
11383 \begin_inset CommandInset label
11384 LatexCommand label
11385 name "sec:charstyle"
11386
11387 \end_inset
11388
11389 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11390  these are called Flex insets.
11391  
11392 \end_layout
11393
11394 \begin_layout Standard
11395 Flex insets come in three different kinds: 
11396 \end_layout
11397
11398 \begin_layout Itemize
11399 character style (
11400 \begin_inset Flex CharStyle:Code
11401 status collapsed
11402
11403 \begin_layout Plain Layout
11404 CharStyle
11405 \end_layout
11406
11407 \end_inset
11408
11409 ): These define semantic markup corresponding to such LaTeX commands as
11410  
11411 \begin_inset Flex CharStyle:Code
11412 status collapsed
11413
11414 \begin_layout Plain Layout
11415
11416 \backslash
11417 noun
11418 \end_layout
11419
11420 \end_inset
11421
11422  and 
11423 \begin_inset Flex CharStyle:Code
11424 status collapsed
11425
11426 \begin_layout Plain Layout
11427
11428 \backslash
11429 code
11430 \end_layout
11431
11432 \end_inset
11433
11434 .
11435 \end_layout
11436
11437 \begin_layout Itemize
11438 user custom (
11439 \begin_inset Flex CharStyle:Code
11440 status collapsed
11441
11442 \begin_layout Plain Layout
11443 Custom
11444 \end_layout
11445
11446 \end_inset
11447
11448 ): These can be used to define custom collapsable insets, similar to ERT,
11449  footnote, and the like.
11450  An obvious example is an endnote inset, which is defined in the 
11451 \begin_inset Flex CharStyle:Code
11452 status collapsed
11453
11454 \begin_layout Plain Layout
11455 endnote
11456 \end_layout
11457
11458 \end_inset
11459
11460  module.
11461 \end_layout
11462
11463 \begin_layout Itemize
11464 XML elements (
11465 \begin_inset Flex CharStyle:Code
11466 status collapsed
11467
11468 \begin_layout Plain Layout
11469 Element
11470 \end_layout
11471
11472 \end_inset
11473
11474 ): For use with DocBook classes.
11475 \end_layout
11476
11477 \begin_layout Standard
11478 Flex insets are defined using the 
11479 \begin_inset Flex CharStyle:Code
11480 status collapsed
11481
11482 \begin_layout Plain Layout
11483 InsetLayout
11484 \end_layout
11485
11486 \end_inset
11487
11488  tag, which shall be explained in a moment.
11489 \end_layout
11490
11491 \begin_layout Standard
11492 The 
11493 \begin_inset Flex CharStyle:Code
11494 status collapsed
11495
11496 \begin_layout Plain Layout
11497 InsetLayout
11498 \end_layout
11499
11500 \end_inset
11501
11502  tag also serves another function: It can be used to customize the general
11503  layout of many different types of insets.
11504  Currently, 
11505 \begin_inset Flex CharStyle:Code
11506 status collapsed
11507
11508 \begin_layout Plain Layout
11509 InsetLayout
11510 \end_layout
11511
11512 \end_inset
11513
11514  can be used to customize the layout parameters for footnotes, marginal
11515  notes, note insets, ERT insets, branches, listings, indexes, boxes, tables,
11516  algorithms, URLs, and optional arguments, as well as to define Flex insets.
11517 \end_layout
11518
11519 \begin_layout Standard
11520 The 
11521 \begin_inset Flex CharStyle:Code
11522 status collapsed
11523
11524 \begin_layout Plain Layout
11525 InsetLayout
11526 \end_layout
11527
11528 \end_inset
11529
11530  definition must begin with a line of the form:
11531 \end_layout
11532
11533 \begin_layout LyX-Code
11534 InsetLayout <Type>
11535 \end_layout
11536
11537 \begin_layout Standard
11538 Here 
11539 \begin_inset Flex CharStyle:Code
11540 status collapsed
11541
11542 \begin_layout Plain Layout
11543 <Type>
11544 \end_layout
11545
11546 \end_inset
11547
11548  indicates the inset whose layout is being defined, and here there are two
11549  cases.
11550 \end_layout
11551
11552 \begin_layout Enumerate
11553 The layout for a pre-existing inset is being modified.
11554  In this case, can be 
11555 \begin_inset Flex CharStyle:Code
11556 status collapsed
11557
11558 \begin_layout Plain Layout
11559 <Type>
11560 \end_layout
11561
11562 \end_inset
11563
11564  any one of the following: 
11565 \begin_inset Flex CharStyle:Code
11566 status collapsed
11567
11568 \begin_layout Plain Layout
11569 Algorithm
11570 \end_layout
11571
11572 \end_inset
11573
11574
11575 \begin_inset Flex CharStyle:Code
11576 status collapsed
11577
11578 \begin_layout Plain Layout
11579 Branch
11580 \end_layout
11581
11582 \end_inset
11583
11584
11585 \begin_inset Flex CharStyle:Code
11586 status collapsed
11587
11588 \begin_layout Plain Layout
11589 Box
11590 \end_layout
11591
11592 \end_inset
11593
11594
11595 \begin_inset Flex CharStyle:Code
11596 status collapsed
11597
11598 \begin_layout Plain Layout
11599 Box:shaded
11600 \end_layout
11601
11602 \end_inset
11603
11604
11605 \begin_inset Flex CharStyle:Code
11606 status collapsed
11607
11608 \begin_layout Plain Layout
11609 ERT
11610 \end_layout
11611
11612 \end_inset
11613
11614
11615 \begin_inset Flex CharStyle:Code
11616 status collapsed
11617
11618 \begin_layout Plain Layout
11619 Figure
11620 \end_layout
11621
11622 \end_inset
11623
11624
11625 \begin_inset Flex CharStyle:Code
11626 status collapsed
11627
11628 \begin_layout Plain Layout
11629 Foot
11630 \end_layout
11631
11632 \end_inset
11633
11634
11635 \begin_inset Flex CharStyle:Code
11636 status collapsed
11637
11638 \begin_layout Plain Layout
11639 Index
11640 \end_layout
11641
11642 \end_inset
11643
11644
11645 \begin_inset Flex CharStyle:Code
11646 status collapsed
11647
11648 \begin_layout Plain Layout
11649 Info
11650 \end_layout
11651
11652 \end_inset
11653
11654
11655 \begin_inset Flex CharStyle:Code
11656 status collapsed
11657
11658 \begin_layout Plain Layout
11659 Info:menu
11660 \end_layout
11661
11662 \end_inset
11663
11664
11665 \begin_inset Flex CharStyle:Code
11666 status collapsed
11667
11668 \begin_layout Plain Layout
11669 Info:shortcut
11670 \end_layout
11671
11672 \end_inset
11673
11674
11675 \begin_inset Flex CharStyle:Code
11676 status collapsed
11677
11678 \begin_layout Plain Layout
11679 Info:shortcuts
11680 \end_layout
11681
11682 \end_inset
11683
11684
11685 \begin_inset Flex CharStyle:Code
11686 status collapsed
11687
11688 \begin_layout Plain Layout
11689 Listings
11690 \end_layout
11691
11692 \end_inset
11693
11694
11695 \begin_inset Flex CharStyle:Code
11696 status collapsed
11697
11698 \begin_layout Plain Layout
11699 Marginal
11700 \end_layout
11701
11702 \end_inset
11703
11704
11705 \begin_inset Flex CharStyle:Code
11706 status collapsed
11707
11708 \begin_layout Plain Layout
11709 Note:Comment
11710 \end_layout
11711
11712 \end_inset
11713
11714
11715 \begin_inset Flex CharStyle:Code
11716 status collapsed
11717
11718 \begin_layout Plain Layout
11719 Note:Note
11720 \end_layout
11721
11722 \end_inset
11723
11724
11725 \begin_inset Flex CharStyle:Code
11726 status collapsed
11727
11728 \begin_layout Plain Layout
11729 Note:GreyedOut
11730 \end_layout
11731
11732 \end_inset
11733
11734
11735 \begin_inset Flex CharStyle:Code
11736 status collapsed
11737
11738 \begin_layout Plain Layout
11739 OptArg
11740 \end_layout
11741
11742 \end_inset
11743
11744
11745 \begin_inset Flex CharStyle:Code
11746 status collapsed
11747
11748 \begin_layout Plain Layout
11749 Table
11750 \end_layout
11751
11752 \end_inset
11753
11754 , or 
11755 \begin_inset Flex CharStyle:Code
11756 status collapsed
11757
11758 \begin_layout Plain Layout
11759 URL
11760 \end_layout
11761
11762 \end_inset
11763
11764 .
11765  
11766 \end_layout
11767
11768 \begin_layout Enumerate
11769 The layout for a Flex inset is being defined.
11770  In this case, 
11771 \begin_inset Flex CharStyle:Code
11772 status collapsed
11773
11774 \begin_layout Plain Layout
11775 <Type>
11776 \end_layout
11777
11778 \end_inset
11779
11780  can be any valid identifier not used by a pre-existing inset.
11781  Note that the definition of a flex inset must
11782 \emph on
11783  als
11784 \emph default
11785 o include a 
11786 \begin_inset Flex CharStyle:Code
11787 status collapsed
11788
11789 \begin_layout Plain Layout
11790 LyXType
11791 \end_layout
11792
11793 \end_inset
11794
11795  entry.
11796 \end_layout
11797
11798 \begin_layout Standard
11799 The 
11800 \begin_inset Flex CharStyle:Code
11801 status collapsed
11802
11803 \begin_layout Plain Layout
11804 InsetLayout
11805 \end_layout
11806
11807 \end_inset
11808
11809  definition can contain the following entries:
11810 \end_layout
11811
11812 \begin_layout Description
11813 \begin_inset Flex CharStyle:Code
11814 status collapsed
11815
11816 \begin_layout Plain Layout
11817 BgColor
11818 \end_layout
11819
11820 \end_inset
11821
11822  The color for the inset's background.
11823  The valid colors are defined in 
11824 \begin_inset Flex CharStyle:Code
11825 status collapsed
11826
11827 \begin_layout Plain Layout
11828 src/ColorCode.h
11829 \end_layout
11830
11831 \end_inset
11832
11833 .
11834 \end_layout
11835
11836 \begin_layout Description
11837 \begin_inset Flex CharStyle:Code
11838 status collapsed
11839
11840 \begin_layout Plain Layout
11841 CopyStyle
11842 \end_layout
11843
11844 \end_inset
11845
11846  As with paragraph styles (see page 
11847 \begin_inset CommandInset ref
11848 LatexCommand ref
11849 reference "des:CopyStyle"
11850
11851 \end_inset
11852
11853 ).
11854 \end_layout
11855
11856 \begin_layout Description
11857 \begin_inset Flex CharStyle:Code
11858 status collapsed
11859
11860 \begin_layout Plain Layout
11861 CustomPars
11862 \end_layout
11863
11864 \end_inset
11865
11866  [
11867 \begin_inset Flex CharStyle:Code
11868 status collapsed
11869
11870 \begin_layout Plain Layout
11871
11872 \emph on
11873 0
11874 \end_layout
11875
11876 \end_inset
11877
11878 ,
11879 \begin_inset Flex CharStyle:Code
11880 status collapsed
11881
11882 \begin_layout Plain Layout
11883 1
11884 \end_layout
11885
11886 \end_inset
11887
11888 ] Indicates whether the user may employ the Paragraph Settings dialog to
11889  customize the paragraph.
11890 \end_layout
11891
11892 \begin_layout Description
11893 \begin_inset Flex CharStyle:Code
11894 status collapsed
11895
11896 \begin_layout Plain Layout
11897 Decoration
11898 \end_layout
11899
11900 \end_inset
11901
11902  can be 
11903 \begin_inset Flex CharStyle:Code
11904 status collapsed
11905
11906 \begin_layout Plain Layout
11907 Classic
11908 \end_layout
11909
11910 \end_inset
11911
11912
11913 \begin_inset Flex CharStyle:Code
11914 status collapsed
11915
11916 \begin_layout Plain Layout
11917 Minimalistic
11918 \end_layout
11919
11920 \end_inset
11921
11922 , or 
11923 \begin_inset Flex CharStyle:Code
11924 status collapsed
11925
11926 \begin_layout Plain Layout
11927 Conglomerate
11928 \end_layout
11929
11930 \end_inset
11931
11932 , describing the rendering style used for the inset's frame and buttons.
11933  Footnotes generally use 
11934 \begin_inset Flex CharStyle:Code
11935 status collapsed
11936
11937 \begin_layout Plain Layout
11938 Classic
11939 \end_layout
11940
11941 \end_inset
11942
11943 , ERT insets generally 
11944 \begin_inset Flex CharStyle:Code
11945 status collapsed
11946
11947 \begin_layout Plain Layout
11948 Minimalistic
11949 \end_layout
11950
11951 \end_inset
11952
11953 , and character styles 
11954 \begin_inset Flex CharStyle:Code
11955 status collapsed
11956
11957 \begin_layout Plain Layout
11958 Conglomerate
11959 \end_layout
11960
11961 \end_inset
11962
11963 .
11964 \end_layout
11965
11966 \begin_layout Description
11967 \begin_inset Flex CharStyle:Code
11968 status collapsed
11969
11970 \begin_layout Plain Layout
11971 End
11972 \end_layout
11973
11974 \end_inset
11975
11976  Required at the end of the InsetLayout declarations.
11977 \end_layout
11978
11979 \begin_layout Description
11980 \begin_inset Flex CharStyle:Code
11981 status collapsed
11982
11983 \begin_layout Plain Layout
11984 Font
11985 \end_layout
11986
11987 \end_inset
11988
11989  The font used for both the text body 
11990 \emph on
11991 and
11992 \emph default
11993  the label.
11994  See section
11995 \begin_inset space ~
11996 \end_inset
11997
11998
11999 \begin_inset CommandInset ref
12000 LatexCommand ref
12001 reference "sec:fonts"
12002
12003 \end_inset
12004
12005 .
12006  Note that defining this font automatically defines the 
12007 \begin_inset Flex CharStyle:Code
12008 status collapsed
12009
12010 \begin_layout Plain Layout
12011 LabelFont
12012 \end_layout
12013
12014 \end_inset
12015
12016  to the same value, so define this first and define 
12017 \begin_inset Flex CharStyle:Code
12018 status collapsed
12019
12020 \begin_layout Plain Layout
12021 LabelFont
12022 \end_layout
12023
12024 \end_inset
12025
12026  later if you want them to be different.
12027 \end_layout
12028
12029 \begin_layout Description
12030 \begin_inset Flex CharStyle:Code
12031 status collapsed
12032
12033 \begin_layout Plain Layout
12034 ForceLTR
12035 \end_layout
12036
12037 \end_inset
12038
12039  Force the 
12040 \begin_inset Quotes eld
12041 \end_inset
12042
12043 latex
12044 \begin_inset Quotes erd
12045 \end_inset
12046
12047  language, leading to Left-to-Right (latin) output, e.g.
12048 \begin_inset space \space{}
12049 \end_inset
12050
12051 in ERT or URL.
12052  A kludge.
12053 \end_layout
12054
12055 \begin_layout Description
12056 \begin_inset Flex CharStyle:Code
12057 status collapsed
12058
12059 \begin_layout Plain Layout
12060 ForcePlain
12061 \end_layout
12062
12063 \end_inset
12064
12065  [
12066 \begin_inset Flex CharStyle:Code
12067 status collapsed
12068
12069 \begin_layout Plain Layout
12070
12071 \emph on
12072 0
12073 \end_layout
12074
12075 \end_inset
12076
12077 ,
12078 \begin_inset Flex CharStyle:Code
12079 status collapsed
12080
12081 \begin_layout Plain Layout
12082 1
12083 \end_layout
12084
12085 \end_inset
12086
12087 ] Indicates whether the PlainLayout should be used or, instead, the user
12088  can change the paragraph style used in the inset.
12089 \end_layout
12090
12091 \begin_layout Description
12092 \begin_inset Flex CharStyle:Code
12093 status collapsed
12094
12095 \begin_layout Plain Layout
12096 FreeSpacing
12097 \end_layout
12098
12099 \end_inset
12100
12101  As with paragraph styles (see page 
12102 \begin_inset CommandInset ref
12103 LatexCommand pageref
12104 reference "des:FreeSpacing"
12105
12106 \end_inset
12107
12108 ).
12109 \end_layout
12110
12111 \begin_layout Description
12112 \begin_inset Flex CharStyle:Code
12113 status collapsed
12114
12115 \begin_layout Plain Layout
12116 KeepEmpty
12117 \end_layout
12118
12119 \end_inset
12120
12121  As with paragraph styles (see page 
12122 \begin_inset CommandInset ref
12123 LatexCommand pageref
12124 reference "des:KeepEmpty"
12125
12126 \end_inset
12127
12128 ).
12129 \end_layout
12130
12131 \begin_layout Description
12132 \begin_inset Flex CharStyle:Code
12133 status collapsed
12134
12135 \begin_layout Plain Layout
12136 LabelFont
12137 \end_layout
12138
12139 \end_inset
12140
12141  The font used for the label.
12142  See section
12143 \begin_inset space ~
12144 \end_inset
12145
12146
12147 \begin_inset CommandInset ref
12148 LatexCommand ref
12149 reference "sec:fonts"
12150
12151 \end_inset
12152
12153 .
12154  Note that this definition can never appear before 
12155 \begin_inset Flex CharStyle:Code
12156 status collapsed
12157
12158 \begin_layout Plain Layout
12159 Font
12160 \end_layout
12161
12162 \end_inset
12163
12164 , lest it be ineffective.
12165 \end_layout
12166
12167 \begin_layout Description
12168 \begin_inset Flex CharStyle:Code
12169 status collapsed
12170
12171 \begin_layout Plain Layout
12172 LabelString
12173 \end_layout
12174
12175 \end_inset
12176
12177  What will be displayed on the button or elsewhere as the inset label.
12178  Some inset types (ERT and Branch) modify this label on the fly.
12179 \end_layout
12180
12181 \begin_layout Description
12182 \begin_inset Flex CharStyle:Code
12183 status collapsed
12184
12185 \begin_layout Plain Layout
12186 LatexName
12187 \end_layout
12188
12189 \end_inset
12190
12191  The name of the corresponding LaTeX stuff.
12192  Either the environment or command name.
12193 \end_layout
12194
12195 \begin_layout Description
12196 \begin_inset Flex CharStyle:Code
12197 status collapsed
12198
12199 \begin_layout Plain Layout
12200 LatexParam
12201 \end_layout
12202
12203 \end_inset
12204
12205  The optional parameter for the corresponding 
12206 \begin_inset Flex CharStyle:Code
12207 status collapsed
12208
12209 \begin_layout Plain Layout
12210 LatexName
12211 \end_layout
12212
12213 \end_inset
12214
12215  stuff, including possible bracket pairs like 
12216 \begin_inset Flex CharStyle:Code
12217 status collapsed
12218
12219 \begin_layout Plain Layout
12220 []
12221 \end_layout
12222
12223 \end_inset
12224
12225 .
12226  This parameter cannot be changed from within LyX.
12227 \end_layout
12228
12229 \begin_layout Description
12230 \begin_inset Flex CharStyle:Code
12231 status collapsed
12232
12233 \begin_layout Plain Layout
12234 LatexType
12235 \end_layout
12236
12237 \end_inset
12238
12239  As with paragraph styles (see page 
12240 \begin_inset CommandInset ref
12241 LatexCommand pageref
12242 reference "des:LatexType"
12243
12244 \end_inset
12245
12246 ).
12247 \end_layout
12248
12249 \begin_layout Description
12250 \begin_inset Flex CharStyle:Code
12251 status collapsed
12252
12253 \begin_layout Plain Layout
12254 LyxType 
12255 \end_layout
12256
12257 \end_inset
12258
12259  Can be 
12260 \begin_inset Flex CharStyle:Code
12261 status collapsed
12262
12263 \begin_layout Plain Layout
12264 charstyle
12265 \end_layout
12266
12267 \end_inset
12268
12269
12270 \begin_inset Flex CharStyle:Code
12271 status collapsed
12272
12273 \begin_layout Plain Layout
12274 custom
12275 \end_layout
12276
12277 \end_inset
12278
12279
12280 \begin_inset Flex CharStyle:Code
12281 status collapsed
12282
12283 \begin_layout Plain Layout
12284 element
12285 \end_layout
12286
12287 \end_inset
12288
12289 , or 
12290 \begin_inset Flex CharStyle:Code
12291 status collapsed
12292
12293 \begin_layout Plain Layout
12294 end
12295 \end_layout
12296
12297 \end_inset
12298
12299  (indicating a dummy definition ending definitions of charstyles, etc).
12300  This entry is required in and is only meaningful for Flex insets.
12301  Among other things, it determines on which menu this inset will appear.
12302 \end_layout
12303
12304 \begin_layout Description
12305 \begin_inset Flex CharStyle:Code
12306 status collapsed
12307
12308 \begin_layout Plain Layout
12309 MultiPar
12310 \end_layout
12311
12312 \end_inset
12313
12314  [
12315 \begin_inset Flex CharStyle:Code
12316 status collapsed
12317
12318 \begin_layout Plain Layout
12319
12320 \emph on
12321 0
12322 \end_layout
12323
12324 \end_inset
12325
12326 ,
12327 \begin_inset Flex CharStyle:Code
12328 status collapsed
12329
12330 \begin_layout Plain Layout
12331 1
12332 \end_layout
12333
12334 \end_inset
12335
12336 ] Whether multiple paragraphs are permitted in this inset.
12337  This will also set CustomPars to the same value and ForcePlain to the opposite
12338  value.
12339  These can be reset to other values, if they are used 
12340 \emph on
12341 after
12342 \emph default
12343  MultiPar.
12344 \end_layout
12345
12346 \begin_layout Description
12347 \begin_inset Flex CharStyle:Code
12348 status collapsed
12349
12350 \begin_layout Plain Layout
12351 NeedProtect
12352 \end_layout
12353
12354 \end_inset
12355
12356  [
12357 \begin_inset Flex CharStyle:Code
12358 status collapsed
12359
12360 \begin_layout Plain Layout
12361
12362 \emph on
12363 0
12364 \end_layout
12365
12366 \end_inset
12367
12368 ,
12369 \begin_inset Flex CharStyle:Code
12370 status collapsed
12371
12372 \begin_layout Plain Layout
12373 1
12374 \end_layout
12375
12376 \end_inset
12377
12378 ] Whether fragile commands in this layout should be 
12379 \begin_inset Flex CharStyle:Code
12380 status collapsed
12381
12382 \begin_layout Plain Layout
12383
12384 \backslash
12385 protect
12386 \end_layout
12387
12388 \end_inset
12389
12390 'ed.
12391  (Note: This is 
12392 \emph on
12393 not
12394 \emph default
12395  whether the command should itself be protected.)
12396 \end_layout
12397
12398 \begin_layout Description
12399 \begin_inset Flex CharStyle:Code
12400 status collapsed
12401
12402 \begin_layout Plain Layout
12403 PassThru
12404 \end_layout
12405
12406 \end_inset
12407
12408  [
12409 \begin_inset Flex CharStyle:Code
12410 status collapsed
12411
12412 \begin_layout Plain Layout
12413
12414 \emph on
12415 0
12416 \end_layout
12417
12418 \end_inset
12419
12420 ,
12421 \begin_inset Flex CharStyle:Code
12422 status collapsed
12423
12424 \begin_layout Plain Layout
12425 1
12426 \end_layout
12427
12428 \end_inset
12429
12430 ] As with paragraph styles (see page 
12431 \begin_inset CommandInset ref
12432 LatexCommand ref
12433 reference "des:PathThru"
12434
12435 \end_inset
12436
12437 ).
12438 \end_layout
12439
12440 \begin_layout Description
12441 \begin_inset Flex CharStyle:Code
12442 status collapsed
12443
12444 \begin_layout Plain Layout
12445 Preamble
12446 \end_layout
12447
12448 \end_inset
12449
12450  As with paragraph styles (see page 
12451 \begin_inset CommandInset ref
12452 LatexCommand pageref
12453 reference "des:Preamble"
12454
12455 \end_inset
12456
12457 ).
12458 \end_layout
12459
12460 \begin_layout Description
12461 \begin_inset Flex CharStyle:Code
12462 status collapsed
12463
12464 \begin_layout Plain Layout
12465 Requires 
12466 \end_layout
12467
12468 \end_inset
12469
12470  [
12471 \begin_inset Flex CharStyle:Code
12472 status collapsed
12473
12474 \begin_layout Plain Layout
12475 string
12476 \end_layout
12477
12478 \end_inset
12479
12480 ] As with paragraph styles (see page 
12481 \begin_inset CommandInset ref
12482 LatexCommand pageref
12483 reference "des:Requires"
12484
12485 \end_inset
12486
12487 ).
12488 \end_layout
12489
12490 \begin_layout Subsection
12491 Counters
12492 \end_layout
12493
12494 \begin_layout Standard
12495 \begin_inset CommandInset label
12496 LatexCommand label
12497 name "sec:counter"
12498
12499 \end_inset
12500
12501 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12502  counters (
12503 \begin_inset Flex CharStyle:MenuItem
12504 status collapsed
12505
12506 \begin_layout Plain Layout
12507 chapter
12508 \end_layout
12509
12510 \end_inset
12511
12512
12513 \begin_inset Flex CharStyle:MenuItem
12514 status collapsed
12515
12516 \begin_layout Plain Layout
12517 figure
12518 \end_layout
12519
12520 \end_inset
12521
12522 , \SpecialChar \ldots{}
12523 ) in the text class itself.
12524  The standard counters are defined in the file 
12525 \begin_inset Flex CharStyle:Code
12526 status collapsed
12527
12528 \begin_layout Plain Layout
12529 stdcounters.inc
12530 \end_layout
12531
12532 \end_inset
12533
12534 , so you may have to do no more than add
12535 \end_layout
12536
12537 \begin_layout LyX-Code
12538 Input stdcounters.inc
12539 \end_layout
12540
12541 \begin_layout Standard
12542 to your layout file to get them to work.
12543  But if you want to define custom counters, then you can do so.
12544  The counter declaration must begin with:
12545 \end_layout
12546
12547 \begin_layout LyX-Code
12548 Counter name
12549 \end_layout
12550
12551 \begin_layout Standard
12552 where of course `name' is replaced by the name of the counter.
12553  And it must end with 
12554 \begin_inset Quotes eld
12555 \end_inset
12556
12557
12558 \begin_inset Flex CharStyle:Code
12559 status collapsed
12560
12561 \begin_layout Plain Layout
12562 End
12563 \end_layout
12564
12565 \end_inset
12566
12567
12568 \begin_inset Quotes erd
12569 \end_inset
12570
12571 .
12572  The following parameters can also be used:
12573 \end_layout
12574
12575 \begin_layout Description
12576 \begin_inset Flex CharStyle:Code
12577 status collapsed
12578
12579 \begin_layout Plain Layout
12580 LabelString [string=""]
12581 \end_layout
12582
12583 \end_inset
12584
12585  when this is defined, this string defines how the counter is displayed.
12586  Setting this value sets 
12587 \begin_inset Flex CharStyle:Code
12588 status collapsed
12589
12590 \begin_layout Plain Layout
12591 LabelStringAppendix
12592 \end_layout
12593
12594 \end_inset
12595
12596  to the same value.
12597  The following special constructs can be used in the string:
12598 \end_layout
12599
12600 \begin_deeper
12601 \begin_layout Itemize
12602 \begin_inset Flex CharStyle:Code
12603 status collapsed
12604
12605 \begin_layout Plain Layout
12606
12607 \backslash
12608 thecounter
12609 \end_layout
12610
12611 \end_inset
12612
12613  will be replaced by the expansion of the 
12614 \begin_inset Flex CharStyle:Code
12615 status collapsed
12616
12617 \begin_layout Plain Layout
12618 LabelString
12619 \end_layout
12620
12621 \end_inset
12622
12623  (or 
12624 \begin_inset Flex CharStyle:Code
12625 status collapsed
12626
12627 \begin_layout Plain Layout
12628 LabelStringAppendix
12629 \end_layout
12630
12631 \end_inset
12632
12633 ) of the counter 
12634 \begin_inset Flex CharStyle:Code
12635 status collapsed
12636
12637 \begin_layout Plain Layout
12638 counter
12639 \end_layout
12640
12641 \end_inset
12642
12643 .
12644  
12645 \end_layout
12646
12647 \begin_layout Itemize
12648 counter values can be expressed using LaTeX-like macros 
12649 \begin_inset Flex CharStyle:Code
12650 status collapsed
12651
12652 \begin_layout Plain Layout
12653
12654 \backslash
12655
12656 \emph on
12657 numbertype
12658 \emph default
12659 {
12660 \emph on
12661 counter
12662 \emph default
12663 }
12664 \end_layout
12665
12666 \end_inset
12667
12668 , where 
12669 \begin_inset Flex CharStyle:Code
12670 status collapsed
12671
12672 \begin_layout Plain Layout
12673
12674 \emph on
12675 numbertype
12676 \end_layout
12677
12678 \end_inset
12679
12680  can be:
12681 \begin_inset Foot
12682 status collapsed
12683
12684 \begin_layout Plain Layout
12685
12686 \family roman
12687 \series medium
12688 \shape up
12689 \size normal
12690 \emph off
12691 \bar no
12692 \noun off
12693 \color none
12694 Actually, the situation is a bit more complicated: any
12695 \family default
12696 \series default
12697 \shape default
12698 \emph default
12699 \bar default
12700  
12701 \size default
12702 \emph on
12703 \noun default
12704 \color inherit
12705 numbertype
12706 \family roman
12707 \series medium
12708 \shape up
12709 \size normal
12710 \emph off
12711 \bar no
12712 \noun off
12713  other than those descibed below will produce arabic numerals.
12714  It would not be surprising to see this change in the future.
12715 \end_layout
12716
12717 \end_inset
12718
12719  
12720 \begin_inset Flex CharStyle:Code
12721 status collapsed
12722
12723 \begin_layout Plain Layout
12724 arabic
12725 \end_layout
12726
12727 \end_inset
12728
12729 : 1, 2, 3,\SpecialChar \ldots{}
12730
12731 \begin_inset Flex CharStyle:Code
12732 status collapsed
12733
12734 \begin_layout Plain Layout
12735 alph
12736 \end_layout
12737
12738 \end_inset
12739
12740  for lower-case letters: a, b, c, \SpecialChar \ldots{}
12741
12742 \begin_inset Flex CharStyle:Code
12743 status collapsed
12744
12745 \begin_layout Plain Layout
12746 Alph
12747 \end_layout
12748
12749 \end_inset
12750
12751  for upper-case letters: A, B, C, \SpecialChar \ldots{}
12752
12753 \begin_inset Flex CharStyle:Code
12754 status collapsed
12755
12756 \begin_layout Plain Layout
12757 roman
12758 \end_layout
12759
12760 \end_inset
12761
12762  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12763
12764 \begin_inset Flex CharStyle:Code
12765 status collapsed
12766
12767 \begin_layout Plain Layout
12768 Roman
12769 \end_layout
12770
12771 \end_inset
12772
12773  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12774
12775 \begin_inset Flex CharStyle:Code
12776 status collapsed
12777
12778 \begin_layout Plain Layout
12779 hebrew
12780 \end_layout
12781
12782 \end_inset
12783
12784  for hebrew numerals.
12785 \end_layout
12786
12787 \end_deeper
12788 \begin_layout Standard
12789 If LabelString is not defined, a default value is constructed as follows:
12790  if the counter has a master counter 
12791 \begin_inset Flex CharStyle:Code
12792 status collapsed
12793
12794 \begin_layout Plain Layout
12795 master
12796 \end_layout
12797
12798 \end_inset
12799
12800  (defined via 
12801 \begin_inset Flex CharStyle:Code
12802 status collapsed
12803
12804 \begin_layout Plain Layout
12805 Within
12806 \end_layout
12807
12808 \end_inset
12809
12810 ), the string 
12811 \begin_inset Flex CharStyle:Code
12812 status collapsed
12813
12814 \begin_layout Plain Layout
12815
12816 \backslash
12817 themaster.
12818 \backslash
12819 arabic{counter}
12820 \end_layout
12821
12822 \end_inset
12823
12824  is used; otherwise the string 
12825 \begin_inset Flex CharStyle:Code
12826 status collapsed
12827
12828 \begin_layout Plain Layout
12829
12830 \backslash
12831 arabic{counter}
12832 \end_layout
12833
12834 \end_inset
12835
12836  is used.
12837 \end_layout
12838
12839 \begin_layout Description
12840 \begin_inset Flex CharStyle:Code
12841 status collapsed
12842
12843 \begin_layout Plain Layout
12844 LabelStringAppendix [string=""]
12845 \end_layout
12846
12847 \end_inset
12848
12849  Same as 
12850 \begin_inset Flex CharStyle:Code
12851 status collapsed
12852
12853 \begin_layout Plain Layout
12854 LabelString
12855 \end_layout
12856
12857 \end_inset
12858
12859 , but for use in the Appendix.
12860 \end_layout
12861
12862 \begin_layout Description
12863 \begin_inset Flex CharStyle:Code
12864 status collapsed
12865
12866 \begin_layout Plain Layout
12867 Within
12868 \end_layout
12869
12870 \end_inset
12871
12872  [
12873 \begin_inset Flex CharStyle:Code
12874 status collapsed
12875
12876 \begin_layout Plain Layout
12877 string
12878 \end_layout
12879
12880 \end_inset
12881
12882 =
12883 \begin_inset Quotes erd
12884 \end_inset
12885
12886
12887 \begin_inset Quotes erd
12888 \end_inset
12889
12890 ] If this is set to the name of another counter, the present counter will
12891  be reset everytime the other one is increased.
12892  For example, 
12893 \begin_inset Flex CharStyle:Code
12894 status collapsed
12895
12896 \begin_layout Plain Layout
12897 subsection
12898 \end_layout
12899
12900 \end_inset
12901
12902  is numbered inside 
12903 \begin_inset Flex CharStyle:Code
12904 status collapsed
12905
12906 \begin_layout Plain Layout
12907 section
12908 \end_layout
12909
12910 \end_inset
12911
12912 .
12913 \end_layout
12914
12915 \begin_layout Subsection
12916 Font description
12917 \end_layout
12918
12919 \begin_layout Standard
12920 \begin_inset CommandInset label
12921 LatexCommand label
12922 name "sec:fonts"
12923
12924 \end_inset
12925
12926 A font description looks like this:
12927 \end_layout
12928
12929 \begin_layout LyX-Code
12930 Font 
12931 \family roman
12932 \emph on
12933 or
12934 \family default
12935 \emph default
12936  LabelFont
12937 \end_layout
12938
12939 \begin_layout LyX-Code
12940  ...
12941 \end_layout
12942
12943 \begin_layout LyX-Code
12944 EndFont
12945 \end_layout
12946
12947 \begin_layout Standard
12948 The following commands are available:
12949 \end_layout
12950
12951 \begin_layout Description
12952 \begin_inset Flex CharStyle:Code
12953 status collapsed
12954
12955 \begin_layout Plain Layout
12956 Color
12957 \end_layout
12958
12959 \end_inset
12960
12961  [
12962 \begin_inset Flex CharStyle:Code
12963 status collapsed
12964
12965 \begin_layout Plain Layout
12966
12967 \emph on
12968 none
12969 \end_layout
12970
12971 \end_inset
12972
12973
12974 \begin_inset Flex CharStyle:Code
12975 status collapsed
12976
12977 \begin_layout Plain Layout
12978 black
12979 \end_layout
12980
12981 \end_inset
12982
12983
12984 \begin_inset Flex CharStyle:Code
12985 status collapsed
12986
12987 \begin_layout Plain Layout
12988 white
12989 \end_layout
12990
12991 \end_inset
12992
12993
12994 \begin_inset Flex CharStyle:Code
12995 status collapsed
12996
12997 \begin_layout Plain Layout
12998 red
12999 \end_layout
13000
13001 \end_inset
13002
13003
13004 \begin_inset Flex CharStyle:Code
13005 status collapsed
13006
13007 \begin_layout Plain Layout
13008 green
13009 \end_layout
13010
13011 \end_inset
13012
13013
13014 \begin_inset Flex CharStyle:Code
13015 status collapsed
13016
13017 \begin_layout Plain Layout
13018 blue
13019 \end_layout
13020
13021 \end_inset
13022
13023
13024 \begin_inset Flex CharStyle:Code
13025 status collapsed
13026
13027 \begin_layout Plain Layout
13028 cyan
13029 \end_layout
13030
13031 \end_inset
13032
13033
13034 \begin_inset Flex CharStyle:Code
13035 status collapsed
13036
13037 \begin_layout Plain Layout
13038 magenta
13039 \end_layout
13040
13041 \end_inset
13042
13043
13044 \begin_inset Flex CharStyle:Code
13045 status collapsed
13046
13047 \begin_layout Plain Layout
13048 yellow
13049 \end_layout
13050
13051 \end_inset
13052
13053 ]
13054 \end_layout
13055
13056 \begin_layout Description
13057 \begin_inset Flex CharStyle:Code
13058 status collapsed
13059
13060 \begin_layout Plain Layout
13061 Family
13062 \end_layout
13063
13064 \end_inset
13065
13066  [
13067 \emph on
13068
13069 \begin_inset Flex CharStyle:Code
13070 status collapsed
13071
13072 \begin_layout Plain Layout
13073
13074 \emph on
13075 Roman
13076 \end_layout
13077
13078 \end_inset
13079
13080
13081 \emph default
13082
13083 \begin_inset Flex CharStyle:Code
13084 status collapsed
13085
13086 \begin_layout Plain Layout
13087 Sans
13088 \end_layout
13089
13090 \end_inset
13091
13092
13093 \begin_inset Flex CharStyle:Code
13094 status collapsed
13095
13096 \begin_layout Plain Layout
13097 Typewriter
13098 \end_layout
13099
13100 \end_inset
13101
13102
13103 \end_layout
13104
13105 \begin_layout Description
13106 \begin_inset Flex CharStyle:Code
13107 status collapsed
13108
13109 \begin_layout Plain Layout
13110 Misc
13111 \end_layout
13112
13113 \end_inset
13114
13115  [
13116 \begin_inset Flex CharStyle:Code
13117 status collapsed
13118
13119 \begin_layout Plain Layout
13120 string
13121 \end_layout
13122
13123 \end_inset
13124
13125 ] Valid argument sare: 
13126 \begin_inset Flex CharStyle:Code
13127 status collapsed
13128
13129 \begin_layout Plain Layout
13130 emph
13131 \end_layout
13132
13133 \end_inset
13134
13135
13136 \begin_inset Flex CharStyle:Code
13137 status collapsed
13138
13139 \begin_layout Plain Layout
13140 noun
13141 \end_layout
13142
13143 \end_inset
13144
13145
13146 \begin_inset Flex CharStyle:Code
13147 status collapsed
13148
13149 \begin_layout Plain Layout
13150 underbar
13151 \end_layout
13152
13153 \end_inset
13154
13155
13156 \begin_inset Flex CharStyle:Code
13157 status collapsed
13158
13159 \begin_layout Plain Layout
13160 no_emph
13161 \end_layout
13162
13163 \end_inset
13164
13165
13166 \begin_inset Flex CharStyle:Code
13167 status collapsed
13168
13169 \begin_layout Plain Layout
13170 no_noun
13171 \end_layout
13172
13173 \end_inset
13174
13175  and 
13176 \begin_inset Flex CharStyle:Code
13177 status collapsed
13178
13179 \begin_layout Plain Layout
13180 no_bar
13181 \end_layout
13182
13183 \end_inset
13184
13185 .
13186  Each of these turns on or off the corresponding attribute.
13187 \end_layout
13188
13189 \begin_layout Description
13190 \begin_inset Flex CharStyle:Code
13191 status collapsed
13192
13193 \begin_layout Plain Layout
13194 Series
13195 \end_layout
13196
13197 \end_inset
13198
13199  [
13200 \emph on
13201
13202 \begin_inset Flex CharStyle:Code
13203 status collapsed
13204
13205 \begin_layout Plain Layout
13206
13207 \emph on
13208 Medium
13209 \end_layout
13210
13211 \end_inset
13212
13213
13214 \emph default
13215
13216 \begin_inset Flex CharStyle:Code
13217 status collapsed
13218
13219 \begin_layout Plain Layout
13220 Bold
13221 \end_layout
13222
13223 \end_inset
13224
13225
13226 \end_layout
13227
13228 \begin_layout Description
13229 \begin_inset Flex CharStyle:Code
13230 status collapsed
13231
13232 \begin_layout Plain Layout
13233 Shape
13234 \end_layout
13235
13236 \end_inset
13237
13238  [
13239 \emph on
13240
13241 \begin_inset Flex CharStyle:Code
13242 status collapsed
13243
13244 \begin_layout Plain Layout
13245
13246 \emph on
13247 Up
13248 \end_layout
13249
13250 \end_inset
13251
13252
13253 \emph default
13254
13255 \begin_inset Flex CharStyle:Code
13256 status collapsed
13257
13258 \begin_layout Plain Layout
13259 Italic
13260 \end_layout
13261
13262 \end_inset
13263
13264
13265 \begin_inset Flex CharStyle:Code
13266 status collapsed
13267
13268 \begin_layout Plain Layout
13269 SmallCaps
13270 \end_layout
13271
13272 \end_inset
13273
13274
13275 \begin_inset Flex CharStyle:Code
13276 status collapsed
13277
13278 \begin_layout Plain Layout
13279 Slanted
13280 \end_layout
13281
13282 \end_inset
13283
13284
13285 \end_layout
13286
13287 \begin_layout Description
13288 \begin_inset Flex CharStyle:Code
13289 status collapsed
13290
13291 \begin_layout Plain Layout
13292 Size
13293 \end_layout
13294
13295 \end_inset
13296
13297  [
13298 \begin_inset Flex CharStyle:Code
13299 status collapsed
13300
13301 \begin_layout Plain Layout
13302 tiny
13303 \end_layout
13304
13305 \end_inset
13306
13307
13308 \begin_inset Flex CharStyle:Code
13309 status collapsed
13310
13311 \begin_layout Plain Layout
13312 small
13313 \end_layout
13314
13315 \end_inset
13316
13317
13318 \begin_inset Flex CharStyle:Code
13319 status collapsed
13320
13321 \begin_layout Plain Layout
13322
13323 \emph on
13324 normal
13325 \end_layout
13326
13327 \end_inset
13328
13329
13330 \begin_inset Flex CharStyle:Code
13331 status collapsed
13332
13333 \begin_layout Plain Layout
13334 large
13335 \end_layout
13336
13337 \end_inset
13338
13339
13340 \begin_inset Flex CharStyle:Code
13341 status collapsed
13342
13343 \begin_layout Plain Layout
13344 larger
13345 \end_layout
13346
13347 \end_inset
13348
13349
13350 \begin_inset Flex CharStyle:Code
13351 status collapsed
13352
13353 \begin_layout Plain Layout
13354 largest
13355 \end_layout
13356
13357 \end_inset
13358
13359
13360 \begin_inset Flex CharStyle:Code
13361 status collapsed
13362
13363 \begin_layout Plain Layout
13364 huge
13365 \end_layout
13366
13367 \end_inset
13368
13369
13370 \begin_inset Flex CharStyle:Code
13371 status collapsed
13372
13373 \begin_layout Plain Layout
13374 giant
13375 \end_layout
13376
13377 \end_inset
13378
13379 ]
13380 \end_layout
13381
13382 \begin_layout Subsection
13383 Upgrading old layout files
13384 \end_layout
13385
13386 \begin_layout Standard
13387 The file format of layout files changes from time to time, so old layout
13388  files need to be converted.
13389  This process has been automated since LyX 1.4.0: If LyX reads an old format
13390  layout file it will call the conversion tool 
13391 \begin_inset Flex CharStyle:Code
13392 status collapsed
13393
13394 \begin_layout Plain Layout
13395 LyXDir/scripts/layout2layout.py
13396 \end_layout
13397
13398 \end_inset
13399
13400  and convert it to a temporary file in current format.
13401  The original file is left untouched.
13402  If you want to convert the layout file permanently, just call the converter
13403  by hand:
13404 \end_layout
13405
13406 \begin_layout LyX-Code
13407 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13408 \end_layout
13409
13410 \begin_layout Standard
13411 (You need to replace 
13412 \begin_inset Flex CharStyle:Code
13413 status collapsed
13414
13415 \begin_layout Plain Layout
13416 $LyXDir
13417 \end_layout
13418
13419 \end_inset
13420
13421  with the name of your LyX system directory, unless you happen to have defined
13422  such an environment variable.) Then copy 
13423 \begin_inset Flex CharStyle:Code
13424 status collapsed
13425
13426 \begin_layout Plain Layout
13427 myclassnew.layout
13428 \end_layout
13429
13430 \end_inset
13431
13432  to 
13433 \begin_inset Flex CharStyle:Code
13434 status collapsed
13435
13436 \begin_layout Plain Layout
13437 UserDir/layouts/
13438 \end_layout
13439
13440 \end_inset
13441
13442 .
13443 \end_layout
13444
13445 \begin_layout Standard
13446 The automatic conversion only handles syntax changes.
13447  It cannot handle the case where the contents of included files was changed,
13448  so these will have to be converted separately.
13449 \end_layout
13450
13451 \begin_layout Section
13452 Creating Templates
13453 \begin_inset CommandInset label
13454 LatexCommand label
13455 name "sec:templates"
13456
13457 \end_inset
13458
13459
13460 \end_layout
13461
13462 \begin_layout Standard
13463 Templates are created just like usual documents.
13464  The only difference is that usual documents contain all possible settings,
13465  including the font scheme and the paper size.
13466  Usually a user doesn't want a template to overwrite his defaults in these
13467  cases.
13468  For that reason, the designer of a template should remove the corresponding
13469  commands like 
13470 \begin_inset Flex CharStyle:Code
13471 status collapsed
13472
13473 \begin_layout Plain Layout
13474
13475 \backslash
13476 fontscheme
13477 \end_layout
13478
13479 \end_inset
13480
13481  or 
13482 \begin_inset Flex CharStyle:Code
13483 status collapsed
13484
13485 \begin_layout Plain Layout
13486
13487 \backslash
13488 papersize
13489 \end_layout
13490
13491 \end_inset
13492
13493  from the template LyX file.
13494  This can be done with any simple text-editor, for example 
13495 \begin_inset Flex CharStyle:Code
13496 status collapsed
13497
13498 \begin_layout Plain Layout
13499 vi
13500 \end_layout
13501
13502 \end_inset
13503
13504  or 
13505 \begin_inset Flex CharStyle:Code
13506 status collapsed
13507
13508 \begin_layout Plain Layout
13509 xedit
13510 \end_layout
13511
13512 \end_inset
13513
13514 .
13515  
13516 \end_layout
13517
13518 \begin_layout Standard
13519 Put the edited template files you create in 
13520 \begin_inset Flex CharStyle:Code
13521 status collapsed
13522
13523 \begin_layout Plain Layout
13524 UserDir/templates/
13525 \end_layout
13526
13527 \end_inset
13528
13529 , copy the ones you use from the global template directory in 
13530 \begin_inset Flex CharStyle:Code
13531 status collapsed
13532
13533 \begin_layout Plain Layout
13534 LyXDir/templates/
13535 \end_layout
13536
13537 \end_inset
13538
13539  to the same place, and redefine the template path in the 
13540 \begin_inset Flex CharStyle:MenuItem
13541 status collapsed
13542
13543 \begin_layout Plain Layout
13544 Tools\SpecialChar \menuseparator
13545 Preferences\SpecialChar \menuseparator
13546 Paths
13547 \end_layout
13548
13549 \end_inset
13550
13551  dialog.
13552 \end_layout
13553
13554 \begin_layout Standard
13555 Note that there is a template which has a particular meaning: 
13556 \begin_inset Flex CharStyle:Code
13557 status collapsed
13558
13559 \begin_layout Plain Layout
13560 defaults.lyx
13561 \end_layout
13562
13563 \end_inset
13564
13565 .
13566  This template is loaded everytime you create a new document with 
13567 \begin_inset Flex CharStyle:MenuItem
13568 status collapsed
13569
13570 \begin_layout Plain Layout
13571 File\SpecialChar \menuseparator
13572 New
13573 \end_layout
13574
13575 \end_inset
13576
13577  in order to provide useful defaults.
13578  To create this template from inside LyX, all you have to do is to open
13579  a document with the correct settings, and use the 
13580 \begin_inset Flex CharStyle:MenuItem
13581 status collapsed
13582
13583 \begin_layout Plain Layout
13584 Save as Document Defaults
13585 \end_layout
13586
13587 \end_inset
13588
13589  button.
13590 \end_layout
13591
13592 \begin_layout Chapter
13593 Including External Material
13594 \end_layout
13595
13596 \begin_layout Standard
13597 \begin_inset Box Shadowbox
13598 position "t"
13599 hor_pos "c"
13600 has_inner_box 1
13601 inner_pos "t"
13602 use_parbox 0
13603 width "100col%"
13604 special "none"
13605 height "1in"
13606 height_special "totalheight"
13607 status open
13608
13609 \begin_layout Plain Layout
13610 WARNING: This portion of the documentation has not been updated for some
13611  time.
13612  We certainly hope that it is still accurate, but there are no guarantees.
13613 \end_layout
13614
13615 \end_inset
13616
13617
13618 \end_layout
13619
13620 \begin_layout Standard
13621 The use of material from sources external to LyX is covered in detail in
13622  the 
13623 \emph on
13624 Embedded Objects
13625 \emph default
13626  manual.
13627  This part of the manual covers what needs to happen behind the scenes for
13628  new sorts of material to be included.
13629 \end_layout
13630
13631 \begin_layout Section
13632 How does it work?
13633 \end_layout
13634
13635 \begin_layout Standard
13636 The external material feature is based on the concept of a 
13637 \emph on
13638 template
13639 \emph default
13640 .
13641  A template is a specification of how LyX should interface with a certain
13642  kind of material.
13643  As bundled, LyX comes with predefined templates for Xfig figures, various
13644  raster format images, chess diagrams, and LilyPond music notation.
13645  You can check the actual list by using the menu 
13646 \begin_inset Flex CharStyle:MenuItem
13647 status collapsed
13648
13649 \begin_layout Plain Layout
13650 Insert\SpecialChar \menuseparator
13651 File\SpecialChar \menuseparator
13652 External Material
13653 \end_layout
13654
13655 \end_inset
13656
13657 .
13658  Furthermore, it is possible to roll your own template to support a specific
13659  kind of material.
13660  Later we'll describe in more detail what is involved, and hopefully you
13661  will submit all the templates you create so we can include them in a later
13662  LyX version.
13663 \end_layout
13664
13665 \begin_layout Standard
13666 Another basic idea of the external material feature is to distinguish between
13667  the original file that serves as a base for final material and the produced
13668  file that is included in your exported or printed document.
13669  For example, consider the case of a figure produced with 
13670 \begin_inset Flex CharStyle:Code
13671 status collapsed
13672
13673 \begin_layout Plain Layout
13674 Xfig
13675 \end_layout
13676
13677 \end_inset
13678
13679 .
13680  The Xfig application itself works on an original file with the 
13681 \begin_inset Flex CharStyle:Code
13682 status collapsed
13683
13684 \begin_layout Plain Layout
13685 .fig
13686 \end_layout
13687
13688 \end_inset
13689
13690  extension.
13691  Within XFig, you create and change your figure, and when you are done,
13692  you save the 
13693 \begin_inset Flex CharStyle:Code
13694 status collapsed
13695
13696 \begin_layout Plain Layout
13697 fig
13698 \end_layout
13699
13700 \end_inset
13701
13702 -file.
13703  When you want to include the figure in your document, you invoke 
13704 \begin_inset Flex CharStyle:Code
13705 status collapsed
13706
13707 \begin_layout Plain Layout
13708 transfig
13709 \end_layout
13710
13711 \end_inset
13712
13713  in order to create a PostScript file that can readily be included in your
13714  LaTeX file.
13715  In this case, the 
13716 \begin_inset Flex CharStyle:Code
13717 status collapsed
13718
13719 \begin_layout Plain Layout
13720 .fig
13721 \end_layout
13722
13723 \end_inset
13724
13725  file is the original file, and the PostScript file is the produced file.
13726 \end_layout
13727
13728 \begin_layout Standard
13729 This distinction is important in order to allow updating of the material
13730  while you are in the process of writing the document.
13731  Furthermore, it provides us with the flexibility that is needed to support
13732  multiple export formats.
13733  For instance, in the case of a plain text file, it is not exactly an award-winn
13734 ing idea to include the figure as raw PostScript®.
13735  Instead, you'd either prefer to just include a reference to the figure
13736  or try to invoke some graphics to Ascii converter to make the final result
13737  look similar to the real graphics.
13738  The external material management allows you to do this, because it is parameter
13739 ized on the different export formats that LyX supports.
13740 \end_layout
13741
13742 \begin_layout Standard
13743 Besides supporting the production of different products according to the
13744  exported format, it supports tight integration with editing and viewing
13745  applications.
13746  In the case of an XFig figure, you are able to invoke Xfig on the original
13747  file with a single click from within the external material dialog in LyX,
13748  and also preview the produced PostScript file with ghostview with another
13749  click.
13750  No more fiddling around with the command line and/or file browsers to locate
13751  and manipulate the original or produced files.
13752  In this way, you are finally able to take full advantage of the many different
13753  applications that are relevant to use when you write your documents, and
13754  ultimately be more productive.
13755 \end_layout
13756
13757 \begin_layout Section
13758 The external template configuration file
13759 \end_layout
13760
13761 \begin_layout Standard
13762 It is relatively easy to add custom external template definitions to LyX.
13763  However, be aware that doing this in an careless manner most probably 
13764 \emph on
13765 will
13766 \emph default
13767  introduce an easily exploitable security hole.
13768  So before you do this, please read the discussion about security in section
13769  
13770 \begin_inset CommandInset ref
13771 LatexCommand ref
13772 reference "sec:Security-discussion"
13773
13774 \end_inset
13775
13776 .
13777 \end_layout
13778
13779 \begin_layout Standard
13780 Having said that, we encourage you to submit any interesting templates that
13781  you create.
13782  
13783 \end_layout
13784
13785 \begin_layout Standard
13786 The external templates are defined in the 
13787 \begin_inset Flex CharStyle:Code
13788 status collapsed
13789
13790 \begin_layout Plain Layout
13791 LyXDir/lib/external_templates
13792 \end_layout
13793
13794 \end_inset
13795
13796  file.
13797  You can place your own version in 
13798 \begin_inset Flex CharStyle:Code
13799 status collapsed
13800
13801 \begin_layout Plain Layout
13802 UserDir/external_templates
13803 \end_layout
13804
13805 \end_inset
13806
13807 .
13808 \end_layout
13809
13810 \begin_layout Standard
13811 A typical template looks like this:
13812 \end_layout
13813
13814 \begin_layout LyX-Code
13815 Template XFig
13816 \end_layout
13817
13818 \begin_layout LyX-Code
13819 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13820 \end_layout
13821
13822 \begin_layout LyX-Code
13823 HelpText
13824 \end_layout
13825
13826 \begin_layout LyX-Code
13827 An XFig figure.
13828 \end_layout
13829
13830 \begin_layout LyX-Code
13831 HelpTextEnd
13832 \end_layout
13833
13834 \begin_layout LyX-Code
13835 InputFormat fig
13836 \end_layout
13837
13838 \begin_layout LyX-Code
13839 FileFilter "*.fig"
13840 \end_layout
13841
13842 \begin_layout LyX-Code
13843 AutomaticProduction true
13844 \end_layout
13845
13846 \begin_layout LyX-Code
13847 Transform Rotate
13848 \end_layout
13849
13850 \begin_layout LyX-Code
13851 Transform Resize
13852 \end_layout
13853
13854 \begin_layout LyX-Code
13855 Format LaTeX
13856 \end_layout
13857
13858 \begin_layout LyX-Code
13859 TransformCommand Rotate RotationLatexCommand
13860 \end_layout
13861
13862 \begin_layout LyX-Code
13863 TransformCommand Resize ResizeLatexCommand
13864 \end_layout
13865
13866 \begin_layout LyX-Code
13867 Product "$$RotateFront$$ResizeFront
13868 \end_layout
13869
13870 \begin_layout LyX-Code
13871          
13872 \backslash
13873
13874 \backslash
13875 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13876 \end_layout
13877
13878 \begin_layout LyX-Code
13879          $$ResizeBack$$RotateBack"
13880 \end_layout
13881
13882 \begin_layout LyX-Code
13883 UpdateFormat pstex
13884 \end_layout
13885
13886 \begin_layout LyX-Code
13887 UpdateResult "$$AbsPath$$Basename.pstex_t"
13888 \end_layout
13889
13890 \begin_layout LyX-Code
13891 Requirement "graphicx"
13892 \end_layout
13893
13894 \begin_layout LyX-Code
13895 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13896 \end_layout
13897
13898 \begin_layout LyX-Code
13899 ReferencedFile latex "$$AbsPath$$Basename.eps"
13900 \end_layout
13901
13902 \begin_layout LyX-Code
13903 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13904 \end_layout
13905
13906 \begin_layout LyX-Code
13907 FormatEnd
13908 \end_layout
13909
13910 \begin_layout LyX-Code
13911 Format PDFLaTeX
13912 \end_layout
13913
13914 \begin_layout LyX-Code
13915 TransformCommand Rotate RotationLatexCommand
13916 \end_layout
13917
13918 \begin_layout LyX-Code
13919 TransformCommand Resize ResizeLatexCommand
13920 \end_layout
13921
13922 \begin_layout LyX-Code
13923 Product "$$RotateFront$$ResizeFront
13924 \end_layout
13925
13926 \begin_layout LyX-Code
13927          
13928 \backslash
13929
13930 \backslash
13931 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13932 \end_layout
13933
13934 \begin_layout LyX-Code
13935          $$ResizeBack$$RotateBack"
13936 \end_layout
13937
13938 \begin_layout LyX-Code
13939 UpdateFormat pdftex
13940 \end_layout
13941
13942 \begin_layout LyX-Code
13943 UpdateResult "$$AbsPath$$Basename.pdftex_t"
13944 \end_layout
13945
13946 \begin_layout LyX-Code
13947 Requirement "graphicx"
13948 \end_layout
13949
13950 \begin_layout LyX-Code
13951 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
13952 \end_layout
13953
13954 \begin_layout LyX-Code
13955 ReferencedFile latex "$$AbsPath$$Basename.pdf"
13956 \end_layout
13957
13958 \begin_layout LyX-Code
13959 FormatEnd
13960 \end_layout
13961
13962 \begin_layout LyX-Code
13963 Format Ascii
13964 \end_layout
13965
13966 \begin_layout LyX-Code
13967 Product "$$Contents(
13968 \backslash
13969 "$$AbsPath$$Basename.asc
13970 \backslash
13971 ")"
13972 \end_layout
13973
13974 \begin_layout LyX-Code
13975 UpdateFormat asciixfig
13976 \end_layout
13977
13978 \begin_layout LyX-Code
13979 UpdateResult "$$AbsPath$$Basename.asc"
13980 \end_layout
13981
13982 \begin_layout LyX-Code
13983 FormatEnd
13984 \end_layout
13985
13986 \begin_layout LyX-Code
13987 Format DocBook
13988 \end_layout
13989
13990 \begin_layout LyX-Code
13991 Product "<graphic fileref=
13992 \backslash
13993 "$$AbsOrRelPathMaster$$Basename.eps
13994 \backslash
13995 ">
13996 \end_layout
13997
13998 \begin_layout LyX-Code
13999          </graphic>"
14000 \end_layout
14001
14002 \begin_layout LyX-Code
14003 UpdateFormat eps
14004 \end_layout
14005
14006 \begin_layout LyX-Code
14007 UpdateResult "$$AbsPath$$Basename.eps"
14008 \end_layout
14009
14010 \begin_layout LyX-Code
14011 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14012 \end_layout
14013
14014 \begin_layout LyX-Code
14015 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14016 \end_layout
14017
14018 \begin_layout LyX-Code
14019 FormatEnd
14020 \end_layout
14021
14022 \begin_layout LyX-Code
14023 Product "[XFig: $$FName]"
14024 \end_layout
14025
14026 \begin_layout LyX-Code
14027 FormatEnd
14028 \end_layout
14029
14030 \begin_layout LyX-Code
14031 TemplateEnd
14032 \end_layout
14033
14034 \begin_layout Standard
14035 As you can see, the template is enclosed in 
14036 \begin_inset Flex CharStyle:Code
14037 status collapsed
14038
14039 \begin_layout Plain Layout
14040 Template
14041 \end_layout
14042
14043 \end_inset
14044
14045  \SpecialChar \ldots{}
14046  
14047 \begin_inset Flex CharStyle:Code
14048 status collapsed
14049
14050 \begin_layout Plain Layout
14051 TemplateEnd
14052 \end_layout
14053
14054 \end_inset
14055
14056 .
14057  It contains a header specifying some general settings and, for each supported
14058  primary document file format, a section 
14059 \begin_inset Flex CharStyle:Code
14060 status collapsed
14061
14062 \begin_layout Plain Layout
14063 Format
14064 \end_layout
14065
14066 \end_inset
14067
14068  \SpecialChar \ldots{}
14069  
14070 \begin_inset Flex CharStyle:Code
14071 status collapsed
14072
14073 \begin_layout Plain Layout
14074 FormatEnd
14075 \end_layout
14076
14077 \end_inset
14078
14079 .
14080 \end_layout
14081
14082 \begin_layout Subsection
14083 The template header
14084 \end_layout
14085
14086 \begin_layout Description
14087 \begin_inset Flex CharStyle:Code
14088 status collapsed
14089
14090 \begin_layout Plain Layout
14091 AutomaticProduction
14092 \begin_inset space ~
14093 \end_inset
14094
14095 true|false
14096 \end_layout
14097
14098 \end_inset
14099
14100  Whether the file represented by the template must be generated by LyX.
14101  This command must occur exactly once.
14102 \end_layout
14103
14104 \begin_layout Description
14105 \begin_inset Flex CharStyle:Code
14106 status collapsed
14107
14108 \begin_layout Plain Layout
14109 FileFilter
14110 \begin_inset space ~
14111 \end_inset
14112
14113 <pattern>
14114 \end_layout
14115
14116 \end_inset
14117
14118  A glob pattern that is used in the file dialog to filter out the desired
14119  files.
14120  If there is more than one possible file extension (e.g.
14121 \begin_inset space \space{}
14122 \end_inset
14123
14124 tgif has 
14125 \begin_inset Flex CharStyle:Code
14126 status collapsed
14127
14128 \begin_layout Plain Layout
14129 .obj
14130 \end_layout
14131
14132 \end_inset
14133
14134  and 
14135 \begin_inset Flex CharStyle:Code
14136 status collapsed
14137
14138 \begin_layout Plain Layout
14139 .tgo
14140 \end_layout
14141
14142 \end_inset
14143
14144 ), use something like 
14145 \begin_inset Flex CharStyle:Code
14146 status collapsed
14147
14148 \begin_layout Plain Layout
14149 "*.{obj,tgo}"
14150 \end_layout
14151
14152 \end_inset
14153
14154 .
14155  This command must occur exactly once.
14156 \end_layout
14157
14158 \begin_layout Description
14159 \begin_inset Flex CharStyle:Code
14160 status collapsed
14161
14162 \begin_layout Plain Layout
14163 GuiName
14164 \begin_inset space ~
14165 \end_inset
14166
14167 <guiname>
14168 \end_layout
14169
14170 \end_inset
14171
14172  The text that is displayed on the button.
14173  This command must occur exactly once.
14174 \end_layout
14175
14176 \begin_layout Description
14177 \begin_inset Flex CharStyle:Code
14178 status collapsed
14179
14180 \begin_layout Plain Layout
14181 HelpText
14182 \begin_inset space ~
14183 \end_inset
14184
14185 <text>
14186 \begin_inset space ~
14187 \end_inset
14188
14189 HelpTextEnd
14190 \end_layout
14191
14192 \end_inset
14193
14194  The help text that is used in the External dialog.
14195  Provide enough information to explain to the user just what the template
14196  can provide him with.
14197  This command must occur exactly once.
14198 \end_layout
14199
14200 \begin_layout Description
14201 \begin_inset Flex CharStyle:Code
14202 status collapsed
14203
14204 \begin_layout Plain Layout
14205 InputFormat
14206 \begin_inset space ~
14207 \end_inset
14208
14209 <format>
14210 \end_layout
14211
14212 \end_inset
14213
14214  The file format of the original file.
14215  This must be the name of a format that is known to LyX (see section 
14216 \begin_inset CommandInset ref
14217 LatexCommand ref
14218 reference "sub:Formats"
14219
14220 \end_inset
14221
14222 ).
14223  Use 
14224 \begin_inset Quotes eld
14225 \end_inset
14226
14227
14228 \begin_inset Flex CharStyle:Code
14229 status collapsed
14230
14231 \begin_layout Plain Layout
14232 *
14233 \end_layout
14234
14235 \end_inset
14236
14237
14238 \begin_inset Quotes erd
14239 \end_inset
14240
14241  if the template can handle original files of more than one format.
14242  LyX will attempt to interrogate the file itself in order to deduce its
14243  format in this case.
14244  This command must occur exactly once.
14245 \end_layout
14246
14247 \begin_layout Description
14248 \begin_inset Flex CharStyle:Code
14249 status collapsed
14250
14251 \begin_layout Plain Layout
14252 Template
14253 \begin_inset space ~
14254 \end_inset
14255
14256 <id>
14257 \end_layout
14258
14259 \end_inset
14260
14261  A unique name for the template.
14262  It must not contain substitution macros (see below).
14263 \end_layout
14264
14265 \begin_layout Description
14266 \begin_inset Flex CharStyle:Code
14267 status collapsed
14268
14269 \begin_layout Plain Layout
14270 Transform
14271 \begin_inset space ~
14272 \end_inset
14273
14274 Rotate|Resize|Clip|Extra
14275 \end_layout
14276
14277 \end_inset
14278
14279  This command specifies which transformations are supported by this template.
14280  It may occur zero or more times.
14281  This command enables the corresponding tabs in the external dialog.
14282  Each 
14283 \begin_inset Flex CharStyle:Code
14284 status collapsed
14285
14286 \begin_layout Plain Layout
14287 Transform
14288 \end_layout
14289
14290 \end_inset
14291
14292  command must have either a corresponding 
14293 \begin_inset Flex CharStyle:Code
14294 status collapsed
14295
14296 \begin_layout Plain Layout
14297 TransformCommand
14298 \end_layout
14299
14300 \end_inset
14301
14302  or a 
14303 \begin_inset Flex CharStyle:Code
14304 status collapsed
14305
14306 \begin_layout Plain Layout
14307 TransformOption
14308 \end_layout
14309
14310 \end_inset
14311
14312  command in the 
14313 \begin_inset Flex CharStyle:Code
14314 status collapsed
14315
14316 \begin_layout Plain Layout
14317 Format
14318 \end_layout
14319
14320 \end_inset
14321
14322  section.
14323  Otherwise the transformation will not be supported by that format.
14324 \end_layout
14325
14326 \begin_layout Subsection
14327 The Format section
14328 \end_layout
14329
14330 \begin_layout Description
14331 \begin_inset Flex CharStyle:Code
14332 status collapsed
14333
14334 \begin_layout Plain Layout
14335 Format
14336 \begin_inset space ~
14337 \end_inset
14338
14339 LaTeX|PDFLaTeX|PlainText|DocBook
14340 \end_layout
14341
14342 \end_inset
14343
14344  The primary document file format that this format definition is for.
14345  Not every template has a sensible representation in all document file formats.
14346  Please define nevertheless a 
14347 \begin_inset Flex CharStyle:Code
14348 status collapsed
14349
14350 \begin_layout Plain Layout
14351 Format
14352 \end_layout
14353
14354 \end_inset
14355
14356  section for all formats.
14357  Use a dummy text when no representation is available.
14358  Then you can at least see a reference to the external material in the exported
14359  document.
14360 \end_layout
14361
14362 \begin_layout Description
14363 \begin_inset Flex CharStyle:Code
14364 status collapsed
14365
14366 \begin_layout Plain Layout
14367 Option
14368 \begin_inset space ~
14369 \end_inset
14370
14371 <name>
14372 \begin_inset space ~
14373 \end_inset
14374
14375 <value>
14376 \end_layout
14377
14378 \end_inset
14379
14380  This command defines an additional macro 
14381 \begin_inset Flex CharStyle:Code
14382 status collapsed
14383
14384 \begin_layout Plain Layout
14385 $$<name>
14386 \end_layout
14387
14388 \end_inset
14389
14390  for substitution in 
14391 \begin_inset Flex CharStyle:Code
14392 status collapsed
14393
14394 \begin_layout Plain Layout
14395 Product
14396 \end_layout
14397
14398 \end_inset
14399
14400 .
14401  
14402 \begin_inset Flex CharStyle:Code
14403 status collapsed
14404
14405 \begin_layout Plain Layout
14406 <value>
14407 \end_layout
14408
14409 \end_inset
14410
14411  itself may contain substitution macros.
14412  The advantage over using 
14413 \begin_inset Flex CharStyle:Code
14414 status collapsed
14415
14416 \begin_layout Plain Layout
14417 <value>
14418 \end_layout
14419
14420 \end_inset
14421
14422  directly in 
14423 \begin_inset Flex CharStyle:Code
14424 status collapsed
14425
14426 \begin_layout Plain Layout
14427 Product
14428 \end_layout
14429
14430 \end_inset
14431
14432  is that the substituted value of 
14433 \begin_inset Flex CharStyle:Code
14434 status collapsed
14435
14436 \begin_layout Plain Layout
14437 $$<name>
14438 \end_layout
14439
14440 \end_inset
14441
14442  is sanitized so that it is a valid optional argument in the document format.
14443  This command may occur zero or more times.
14444 \end_layout
14445
14446 \begin_layout Description
14447 \begin_inset Flex CharStyle:Code
14448 status collapsed
14449
14450 \begin_layout Plain Layout
14451 Product
14452 \begin_inset space ~
14453 \end_inset
14454
14455 <text>
14456 \end_layout
14457
14458 \end_inset
14459
14460  The text that is inserted in the exported document.
14461  This is actually the most important command and can be quite complex.
14462  This command must occur exactly once.
14463 \end_layout
14464
14465 \begin_layout Description
14466 \begin_inset Flex CharStyle:Code
14467 status collapsed
14468
14469 \begin_layout Plain Layout
14470 Preamble
14471 \begin_inset space ~
14472 \end_inset
14473
14474 <name>
14475 \end_layout
14476
14477 \end_inset
14478
14479  This command specifies a preamble snippet that will be included in the
14480  LaTeX preamble.
14481  It has to be defined using 
14482 \begin_inset Flex CharStyle:Code
14483 status collapsed
14484
14485 \begin_layout Plain Layout
14486 PreambleDef
14487 \end_layout
14488
14489 \end_inset
14490
14491  \SpecialChar \ldots{}
14492  
14493 \begin_inset Flex CharStyle:Code
14494 status collapsed
14495
14496 \begin_layout Plain Layout
14497 PreambleDefEnd
14498 \end_layout
14499
14500 \end_inset
14501
14502 .
14503  This command may occur zero or more times.
14504 \end_layout
14505
14506 \begin_layout Description
14507 \begin_inset Flex CharStyle:Code
14508 status collapsed
14509
14510 \begin_layout Plain Layout
14511 ReferencedFile
14512 \begin_inset space ~
14513 \end_inset
14514
14515 <format>
14516 \begin_inset space ~
14517 \end_inset
14518
14519 <filename>
14520 \end_layout
14521
14522 \end_inset
14523
14524  This command denotes files that are created by the conversion process and
14525  are needed for a particular export format.
14526  If the filename is relative, it is interpreted relative to the master document.
14527  This command may be given zero or more times.
14528 \end_layout
14529
14530 \begin_layout Description
14531 \begin_inset Flex CharStyle:Code
14532 status collapsed
14533
14534 \begin_layout Plain Layout
14535 Requirement
14536 \begin_inset space ~
14537 \end_inset
14538
14539 <package>
14540 \end_layout
14541
14542 \end_inset
14543
14544  The name of a required LaTeX package.
14545  The package is included via 
14546 \begin_inset Flex CharStyle:Code
14547 status collapsed
14548
14549 \begin_layout Plain Layout
14550
14551 \backslash
14552 usepackage{}
14553 \end_layout
14554
14555 \end_inset
14556
14557  in the LaTeX preamble.
14558  This command may occur zero or more times.
14559 \end_layout
14560
14561 \begin_layout Description
14562 \begin_inset Flex CharStyle:Code
14563 status collapsed
14564
14565 \begin_layout Plain Layout
14566 TransformCommand
14567 \begin_inset space ~
14568 \end_inset
14569
14570 Rotate
14571 \begin_inset space ~
14572 \end_inset
14573
14574 RotationLatexCommand
14575 \end_layout
14576
14577 \end_inset
14578
14579  This command specifies that the built in LaTeX command should be used for
14580  rotation.
14581  This command may occur once or not at all.
14582 \end_layout
14583
14584 \begin_layout Description
14585 \begin_inset Flex CharStyle:Code
14586 status collapsed
14587
14588 \begin_layout Plain Layout
14589 TransformCommand
14590 \begin_inset space ~
14591 \end_inset
14592
14593 Resize
14594 \begin_inset space ~
14595 \end_inset
14596
14597 ResizeLatexCommand
14598 \end_layout
14599
14600 \end_inset
14601
14602  This command specifies that the built in LaTeX command should be used for
14603  resizing.
14604  This command may occur once or not at all.
14605 \end_layout
14606
14607 \begin_layout Description
14608 \begin_inset Flex CharStyle:Code
14609 status collapsed
14610
14611 \begin_layout Plain Layout
14612 TransformOption
14613 \begin_inset space ~
14614 \end_inset
14615
14616 Rotate
14617 \begin_inset space ~
14618 \end_inset
14619
14620 RotationLatexOption
14621 \end_layout
14622
14623 \end_inset
14624
14625  This command specifies that rotation is done via an optional argument.
14626  This command may occur once or not at all.
14627 \end_layout
14628
14629 \begin_layout Description
14630 \begin_inset Flex CharStyle:Code
14631 status collapsed
14632
14633 \begin_layout Plain Layout
14634 TransformOption
14635 \begin_inset space ~
14636 \end_inset
14637
14638 Resize
14639 \begin_inset space ~
14640 \end_inset
14641
14642 ResizeLatexOption
14643 \end_layout
14644
14645 \end_inset
14646
14647  This command specifies that resizing is done via an optional argument.
14648  This command may occur once or not at all.
14649 \end_layout
14650
14651 \begin_layout Description
14652 \begin_inset Flex CharStyle:Code
14653 status collapsed
14654
14655 \begin_layout Plain Layout
14656 TransformOption
14657 \begin_inset space ~
14658 \end_inset
14659
14660 Clip
14661 \begin_inset space ~
14662 \end_inset
14663
14664 ClipLatexOption
14665 \end_layout
14666
14667 \end_inset
14668
14669  This command specifies that clipping is done via an optional argument.
14670  This command may occur once or not at all.
14671 \end_layout
14672
14673 \begin_layout Description
14674 \begin_inset Flex CharStyle:Code
14675 status collapsed
14676
14677 \begin_layout Plain Layout
14678 TransformOption
14679 \begin_inset space ~
14680 \end_inset
14681
14682 Extra
14683 \begin_inset space ~
14684 \end_inset
14685
14686 ExtraLatexOption
14687 \end_layout
14688
14689 \end_inset
14690
14691  This command specifies that an extra optional argument is used.
14692  This command may occur once or not at all.
14693 \end_layout
14694
14695 \begin_layout Description
14696 \begin_inset Flex CharStyle:Code
14697 status collapsed
14698
14699 \begin_layout Plain Layout
14700 UpdateFormat
14701 \begin_inset space ~
14702 \end_inset
14703
14704 <format>
14705 \end_layout
14706
14707 \end_inset
14708
14709  The file format of the converted file.
14710  This must be the name of a format that is known to LyX (see the 
14711 \begin_inset Flex CharStyle:MenuItem
14712 status collapsed
14713
14714 \begin_layout Plain Layout
14715
14716 \bar under
14717 T
14718 \bar default
14719 ools\SpecialChar \menuseparator
14720
14721 \bar under
14722 P
14723 \bar default
14724 references:Conversion
14725 \end_layout
14726
14727 \end_inset
14728
14729  dialog).
14730  This command must occur exactly once.
14731 \end_layout
14732
14733 \begin_layout Description
14734 \begin_inset Flex CharStyle:Code
14735 status collapsed
14736
14737 \begin_layout Plain Layout
14738 UpdateResult
14739 \begin_inset space ~
14740 \end_inset
14741
14742 <filename>
14743 \end_layout
14744
14745 \end_inset
14746
14747  The file name of the converted file.
14748  The file name must be absolute.
14749  This command must occur exactly once.
14750 \end_layout
14751
14752 \begin_layout Subsection
14753 Preamble definitions
14754 \end_layout
14755
14756 \begin_layout Standard
14757 The external template configuration file may contain additional preamble
14758  definitions enclosed by 
14759 \begin_inset Flex CharStyle:Code
14760 status collapsed
14761
14762 \begin_layout Plain Layout
14763 PreambleDef
14764 \end_layout
14765
14766 \end_inset
14767
14768  \SpecialChar \ldots{}
14769  
14770 \begin_inset Flex CharStyle:Code
14771 status collapsed
14772
14773 \begin_layout Plain Layout
14774 PreambleDefEnd
14775 \end_layout
14776
14777 \end_inset
14778
14779 .
14780  They can be used by the templates in the 
14781 \begin_inset Flex CharStyle:Code
14782 status collapsed
14783
14784 \begin_layout Plain Layout
14785 Format
14786 \end_layout
14787
14788 \end_inset
14789
14790  section.
14791 \end_layout
14792
14793 \begin_layout Section
14794 The substitution mechanism
14795 \end_layout
14796
14797 \begin_layout Standard
14798 When the external material facility invokes an external program, it is done
14799  on the basis of a command defined in the template configuration file.
14800  These commands can contain various macros that are expanded before execution.
14801  Execution always take place in the directory of the containing document.
14802 \end_layout
14803
14804 \begin_layout Standard
14805 Also, whenever external material is to be displayed, the name will be produced
14806  by the substitution mechanism, and most other commands in the template
14807  definition support substitution as well.
14808 \end_layout
14809
14810 \begin_layout Standard
14811 The available macros are the following:
14812 \end_layout
14813
14814 \begin_layout Description
14815 \begin_inset Flex CharStyle:Code
14816 status collapsed
14817
14818 \begin_layout Plain Layout
14819 $$AbsOrRelPathMaster
14820 \end_layout
14821
14822 \end_inset
14823
14824  The file path, absolute or relative to the master LyX document.
14825 \end_layout
14826
14827 \begin_layout Description
14828 \begin_inset Flex CharStyle:Code
14829 status collapsed
14830
14831 \begin_layout Plain Layout
14832 $$AbsOrRelPathParent
14833 \end_layout
14834
14835 \end_inset
14836
14837  The file path, absolute or relative to the LyX document.
14838 \end_layout
14839
14840 \begin_layout Description
14841 \begin_inset Flex CharStyle:Code
14842 status collapsed
14843
14844 \begin_layout Plain Layout
14845 $$AbsPath
14846 \end_layout
14847
14848 \end_inset
14849
14850  The absolute file path.
14851 \end_layout
14852
14853 \begin_layout Description
14854 \begin_inset Flex CharStyle:Code
14855 status collapsed
14856
14857 \begin_layout Plain Layout
14858 $$Basename
14859 \end_layout
14860
14861 \end_inset
14862
14863  The filename without path and without the extension.
14864 \end_layout
14865
14866 \begin_layout Description
14867 \begin_inset Flex CharStyle:Code
14868 status collapsed
14869
14870 \begin_layout Plain Layout
14871 $$Contents(
14872 \begin_inset Quotes eld
14873 \end_inset
14874
14875 filename.ext
14876 \begin_inset Quotes erd
14877 \end_inset
14878
14879 )
14880 \end_layout
14881
14882 \end_inset
14883
14884  This macro will expand to the contents of the file with the name 
14885 \begin_inset Flex CharStyle:Code
14886 status collapsed
14887
14888 \begin_layout Plain Layout
14889 filename.ext
14890 \end_layout
14891
14892 \end_inset
14893
14894 .
14895 \end_layout
14896
14897 \begin_layout Description
14898 \begin_inset Flex CharStyle:Code
14899 status collapsed
14900
14901 \begin_layout Plain Layout
14902 $$Extension
14903 \end_layout
14904
14905 \end_inset
14906
14907  The file extension (including the dot).
14908 \end_layout
14909
14910 \begin_layout Description
14911 \begin_inset Flex CharStyle:Code
14912 status collapsed
14913
14914 \begin_layout Plain Layout
14915 $$FName
14916 \end_layout
14917
14918 \end_inset
14919
14920  The filename of the file specified in the external material dialog.
14921  This is either an absolute name, or it is relative to the LyX document.
14922 \end_layout
14923
14924 \begin_layout Description
14925 \begin_inset Flex CharStyle:Code
14926 status collapsed
14927
14928 \begin_layout Plain Layout
14929 $$FPath
14930 \end_layout
14931
14932 \end_inset
14933
14934  The path part of 
14935 \begin_inset Flex CharStyle:Code
14936 status collapsed
14937
14938 \begin_layout Plain Layout
14939 $$FName
14940 \end_layout
14941
14942 \end_inset
14943
14944  (absolute name or relative to the LyX document).
14945 \end_layout
14946
14947 \begin_layout Description
14948 \begin_inset Flex CharStyle:Code
14949 status collapsed
14950
14951 \begin_layout Plain Layout
14952 $$RelPathMaster
14953 \end_layout
14954
14955 \end_inset
14956
14957  The file path, relative to the master LyX document.
14958 \end_layout
14959
14960 \begin_layout Description
14961 \begin_inset Flex CharStyle:Code
14962 status collapsed
14963
14964 \begin_layout Plain Layout
14965 $$RelPathParent
14966 \end_layout
14967
14968 \end_inset
14969
14970  The file path, relative to the LyX document.
14971 \end_layout
14972
14973 \begin_layout Description
14974 \begin_inset Flex CharStyle:Code
14975 status collapsed
14976
14977 \begin_layout Plain Layout
14978 $$Sysdir
14979 \end_layout
14980
14981 \end_inset
14982
14983  This macro will expand to the absolute path of the system directory.
14984  This is typically used to point to the various helper scripts that are
14985  bundled with LyX.
14986 \end_layout
14987
14988 \begin_layout Description
14989 \begin_inset Flex CharStyle:Code
14990 status collapsed
14991
14992 \begin_layout Plain Layout
14993 $$Tempname
14994 \end_layout
14995
14996 \end_inset
14997
14998  A name and full path to a temporary file which will be automatically deleted
14999  whenever the containing document is closed, or the external material insertion
15000  deleted.
15001 \end_layout
15002
15003 \begin_layout Standard
15004 All path macros contain a trailing directory separator, so you can construct
15005  e.g.
15006 \begin_inset space \space{}
15007 \end_inset
15008
15009 the absolute filename with 
15010 \begin_inset Flex CharStyle:Code
15011 status collapsed
15012
15013 \begin_layout Plain Layout
15014 $$AbsPath$$Basename$$Extension
15015 \end_layout
15016
15017 \end_inset
15018
15019 .
15020 \end_layout
15021
15022 \begin_layout Standard
15023 The macros above are substituted in all commands unless otherwise noted.
15024  The command 
15025 \begin_inset Flex CharStyle:Code
15026 status collapsed
15027
15028 \begin_layout Plain Layout
15029 Product
15030 \end_layout
15031
15032 \end_inset
15033
15034  supports additionally the following substitutions if they are enabled by
15035  the 
15036 \begin_inset Flex CharStyle:Code
15037 status collapsed
15038
15039 \begin_layout Plain Layout
15040 Transform
15041 \end_layout
15042
15043 \end_inset
15044
15045  and 
15046 \begin_inset Flex CharStyle:Code
15047 status collapsed
15048
15049 \begin_layout Plain Layout
15050 TransformCommand
15051 \end_layout
15052
15053 \end_inset
15054
15055  commands:
15056 \end_layout
15057
15058 \begin_layout Description
15059 \begin_inset Flex CharStyle:Code
15060 status collapsed
15061
15062 \begin_layout Plain Layout
15063 $$ResizeFront
15064 \end_layout
15065
15066 \end_inset
15067
15068  The front part of the resize command.
15069 \end_layout
15070
15071 \begin_layout Description
15072 \begin_inset Flex CharStyle:Code
15073 status collapsed
15074
15075 \begin_layout Plain Layout
15076 $$ResizeBack
15077 \end_layout
15078
15079 \end_inset
15080
15081  The back part of the resize command.
15082 \end_layout
15083
15084 \begin_layout Description
15085 \begin_inset Flex CharStyle:Code
15086 status collapsed
15087
15088 \begin_layout Plain Layout
15089 $$RotateFront
15090 \end_layout
15091
15092 \end_inset
15093
15094  The front part of the rotation command.
15095 \end_layout
15096
15097 \begin_layout Description
15098 \begin_inset Flex CharStyle:Code
15099 status collapsed
15100
15101 \begin_layout Plain Layout
15102 $$RotateBack
15103 \end_layout
15104
15105 \end_inset
15106
15107  The back part of the rotation command.
15108 \end_layout
15109
15110 \begin_layout Standard
15111 The value string of the 
15112 \begin_inset Flex CharStyle:Code
15113 status collapsed
15114
15115 \begin_layout Plain Layout
15116 Option
15117 \end_layout
15118
15119 \end_inset
15120
15121  command supports additionally the following substitutions if they are enabled
15122  by the 
15123 \begin_inset Flex CharStyle:Code
15124 status collapsed
15125
15126 \begin_layout Plain Layout
15127 Transform
15128 \end_layout
15129
15130 \end_inset
15131
15132  and 
15133 \begin_inset Flex CharStyle:Code
15134 status collapsed
15135
15136 \begin_layout Plain Layout
15137 TransformOption
15138 \end_layout
15139
15140 \end_inset
15141
15142  commands:
15143 \end_layout
15144
15145 \begin_layout Description
15146 \begin_inset Flex CharStyle:Code
15147 status collapsed
15148
15149 \begin_layout Plain Layout
15150 $$Clip
15151 \end_layout
15152
15153 \end_inset
15154
15155  The clip option.
15156 \end_layout
15157
15158 \begin_layout Description
15159 \begin_inset Flex CharStyle:Code
15160 status collapsed
15161
15162 \begin_layout Plain Layout
15163 $$Extra
15164 \end_layout
15165
15166 \end_inset
15167
15168  The extra option.
15169 \end_layout
15170
15171 \begin_layout Description
15172 \begin_inset Flex CharStyle:Code
15173 status collapsed
15174
15175 \begin_layout Plain Layout
15176 $$Resize
15177 \end_layout
15178
15179 \end_inset
15180
15181  The resize option.
15182 \end_layout
15183
15184 \begin_layout Description
15185 \begin_inset Flex CharStyle:Code
15186 status collapsed
15187
15188 \begin_layout Plain Layout
15189 $$Rotate
15190 \end_layout
15191
15192 \end_inset
15193
15194  The rotation option.
15195 \end_layout
15196
15197 \begin_layout Standard
15198 You may ask why there are so many path macros.
15199  There are mainly two reasons:
15200 \end_layout
15201
15202 \begin_layout Enumerate
15203 Relative and absolute file names should remain relative or absolute, respectivel
15204 y.
15205  Users may have reasons to prefer either form.
15206  Relative names are useful for portable documents that should work on different
15207  machines, for example.
15208  Absolute names may be required by some programs.
15209 \end_layout
15210
15211 \begin_layout Enumerate
15212 LaTeX treats relative file names differently than LyX and other programs
15213  in nested included files.
15214  For LyX, a relative file name is always relative to the document that contains
15215  the file name.
15216  For LaTeX, it is always relative to the master document.
15217  These two definitions are identical if you have only one document, but
15218  differ if you have a master document that includes part documents.
15219  That means that relative filenames must be transformed when presented to
15220  LaTeX.
15221  Fortunately LyX does this automatically for you if you choose the right
15222  macros.
15223 \end_layout
15224
15225 \begin_layout Standard
15226 So which path macro should be used in new template definitions? The rule
15227  is not difficult:
15228 \end_layout
15229
15230 \begin_layout Itemize
15231 Use 
15232 \begin_inset Flex CharStyle:Code
15233 status collapsed
15234
15235 \begin_layout Plain Layout
15236 $$AbsPath
15237 \end_layout
15238
15239 \end_inset
15240
15241  if an absolute path is required.
15242 \end_layout
15243
15244 \begin_layout Itemize
15245 Use 
15246 \begin_inset Flex CharStyle:Code
15247 status collapsed
15248
15249 \begin_layout Plain Layout
15250 $$AbsOrRelPathMaster
15251 \end_layout
15252
15253 \end_inset
15254
15255  if the substituted string is some kind of LaTeX input.
15256 \end_layout
15257
15258 \begin_layout Itemize
15259 Else use 
15260 \begin_inset Flex CharStyle:Code
15261 status collapsed
15262
15263 \begin_layout Plain Layout
15264 $$AbsOrRelPathParent
15265 \end_layout
15266
15267 \end_inset
15268
15269  in order to preserve the user's choice.
15270 \end_layout
15271
15272 \begin_layout Standard
15273 There are special cases where this rule does not work and e.g.
15274 \begin_inset space \space{}
15275 \end_inset
15276
15277 relative names are needed, but normally it will work just fine.
15278  One example for such a case is the command 
15279 \begin_inset Flex CharStyle:Code
15280 status collapsed
15281
15282 \begin_layout Plain Layout
15283 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15284 \end_layout
15285
15286 \end_inset
15287
15288  in the XFig template above: We can't use the absolute name because the
15289  copier for 
15290 \begin_inset Flex CharStyle:Code
15291 status collapsed
15292
15293 \begin_layout Plain Layout
15294 .pstex_t
15295 \end_layout
15296
15297 \end_inset
15298
15299  files needs the relative name in order to rewrite the file content.
15300 \end_layout
15301
15302 \begin_layout Section
15303 \begin_inset CommandInset label
15304 LatexCommand label
15305 name "sec:Security-discussion"
15306
15307 \end_inset
15308
15309 Security discussion
15310 \end_layout
15311
15312 \begin_layout Standard
15313 \begin_inset Box Shadowbox
15314 position "t"
15315 hor_pos "c"
15316 has_inner_box 1
15317 inner_pos "t"
15318 use_parbox 0
15319 width "100col%"
15320 special "none"
15321 height "1in"
15322 height_special "totalheight"
15323 status open
15324
15325 \begin_layout Plain Layout
15326 WARNING: This section is definitely outdated.
15327 \end_layout
15328
15329 \end_inset
15330
15331
15332 \end_layout
15333
15334 \begin_layout Standard
15335 The external material feature interfaces with a lot of external programs
15336  and does so automatically, so we have to consider the security implications
15337  of this.
15338  In particular, since you have the option of including your own filenames
15339  and/or parameter strings and those are expanded into a command, it seems
15340  that it would be possible to create a malicious document which executes
15341  arbitrary commands when a user views or prints the document.
15342  This is something we definately want to avoid.
15343 \end_layout
15344
15345 \begin_layout Standard
15346 However, since the external program commands are specified in the template
15347  configuration file only, there are no security issues if LyX is properly
15348  configured with safe templates only.
15349  This is so because the external programs are invoked with the 
15350 \begin_inset Flex CharStyle:Code
15351 status collapsed
15352
15353 \begin_layout Plain Layout
15354 execvp
15355 \end_layout
15356
15357 \end_inset
15358
15359 -system call rather than the 
15360 \begin_inset Flex CharStyle:Code
15361 status collapsed
15362
15363 \begin_layout Plain Layout
15364 system
15365 \end_layout
15366
15367 \end_inset
15368
15369  system-call, so it's not possible to execute arbitrary commands from the
15370  filename or parameter section via the shell.
15371 \end_layout
15372
15373 \begin_layout Standard
15374 This also implies that you are restricted in what command strings you can
15375  use in the external material templates.
15376  In particular, pipes and redirection are not readily available.
15377  This has to be so if LyX should remain safe.
15378  If you want to use some of the shell features, you should write a safe
15379  script to do this in a controlled manner, and then invoke the script from
15380  the command string.
15381  In the 
15382 \begin_inset Flex CharStyle:Code
15383 status collapsed
15384
15385 \begin_layout Plain Layout
15386 lib/scripts
15387 \end_layout
15388
15389 \end_inset
15390
15391  directory of the LyX installation, you can find a safe wrapper script 
15392 \begin_inset Flex CharStyle:Code
15393 status collapsed
15394
15395 \begin_layout Plain Layout
15396 general_command_wrapper.py
15397 \end_layout
15398
15399 \end_inset
15400
15401  that supports redirection of input and output.
15402  That can serve as an example for how to write safe template scripts.
15403  For a more advanced example that uses 
15404 \begin_inset Flex CharStyle:Code
15405 status collapsed
15406
15407 \begin_layout Plain Layout
15408 fork
15409 \end_layout
15410
15411 \end_inset
15412
15413  and friends, take a look at the 
15414 \begin_inset Flex CharStyle:Code
15415 status collapsed
15416
15417 \begin_layout Plain Layout
15418 pic2ascii.py
15419 \end_layout
15420
15421 \end_inset
15422
15423  converter script.
15424 \end_layout
15425
15426 \begin_layout Standard
15427 It is possible to design a template that interacts directly with the shell,
15428  but since this would allow a malicious user to execute arbitrary commands
15429  by writing clever filenames and/or parameters, we generally recommend that
15430  you only use safe scripts that work with the 
15431 \begin_inset Flex CharStyle:Code
15432 status collapsed
15433
15434 \begin_layout Plain Layout
15435 execvp
15436 \end_layout
15437
15438 \end_inset
15439
15440  system call in a controlled manner.
15441  Of course, for use in a controlled environment, it can be tempting to just
15442  fall back to use ordinary shell scripts.
15443  If you do so, be aware that you 
15444 \emph on
15445 will
15446 \emph default
15447  provide an easily exploitable security hole in your system.
15448  Of course it stands to reason that such unsafe templates will never be
15449  included in the standard LyX distribution, although we do encourage people
15450  to submit new templates in the open source tradition.
15451  But LyX as shipped from the official distribution channels will never have
15452  unsafe templates.
15453 \end_layout
15454
15455 \begin_layout Standard
15456 Including external material provides a lot of power, and you have to be
15457  careful not to introduce security hazards with this power.
15458  A subtle error in a single line in an innocent looking script can open
15459  the door to huge security problems.
15460  So if you do not fully understand the issues, we recommend that you consult
15461  a knowledgable security professional or the LyX development team if you
15462  have any questions about whether a given template is safe or not.
15463  And do this before you use it in an uncontrolled environment.
15464 \end_layout
15465
15466 \end_body
15467 \end_document