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