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