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