]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
Update the Customization manual.
[lyx.git] / lib / doc / Customization.lyx
1 #LyX 1.6.0alpha1 created this file. For more info see http://www.lyx.org/
2 \lyxformat 322
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]{Contents}{}
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 \graphics none
64 \paperfontsize default
65 \spacing single
66 \use_hyperref true
67 \pdf_title "LyX Configuration Manual"
68 \pdf_author "The LyX Team"
69 \pdf_bookmarks true
70 \pdf_bookmarksnumbered false
71 \pdf_bookmarksopen false
72 \pdf_bookmarksopenlevel 1
73 \pdf_breaklinks true
74 \pdf_pdfborder true
75 \pdf_colorlinks true
76 \pdf_backref false
77 \pdf_pagebackref false
78 \pdf_pdfusetitle true
79 \papersize default
80 \use_geometry false
81 \use_amsmath 0
82 \use_esint 0
83 \cite_engine basic
84 \use_bibtopic false
85 \paperorientation portrait
86 \branch OutDated
87 \selected 0
88 \color #f5fae7
89 \end_branch
90 \secnumdepth 3
91 \tocdepth 3
92 \paragraph_separation indent
93 \defskip medskip
94 \quotes_language english
95 \papercolumns 1
96 \papersides 2
97 \paperpagestyle headings
98 \tracking_changes false
99 \output_changes false
100 \author "" 
101 \author "" 
102 \extra_embedded_files ""
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 PlainLayout
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 open
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
2119 Menubar
2120 \end_layout
2121
2122 \end_inset
2123
2124
2125 \begin_inset Flex CharStyle:Code
2126 status collapsed
2127
2128 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
2805 pdf
2806 \end_layout
2807
2808 \end_inset
2809
2810
2811 \begin_inset Flex CharStyle:MenuItem
2812 status collapsed
2813
2814 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
2846 pdf
2847 \end_layout
2848
2849 \end_inset
2850
2851
2852 \begin_inset Flex CharStyle:MenuItem
2853 status collapsed
2854
2855 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
3029 #!/bin/bash
3030 \end_layout
3031
3032 \begin_layout PlainLayout
3033 FROMFILE=$1
3034 \end_layout
3035
3036 \begin_layout PlainLayout
3037 TOFILE=`basename $2`
3038 \end_layout
3039
3040 \begin_layout PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 PlainLayout
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 \newline
3520 Note that resultdir and usetempdir
3521  make no sense together.
3522  The latter will be ignored if the former is given.
3523 \end_layout
3524
3525 \begin_layout List
3526 \labelwidthstring 00.00.0000
3527 \begin_inset Flex CharStyle:Code
3528 status collapsed
3529
3530 \begin_layout PlainLayout
3531 resultfile
3532 \end_layout
3533
3534 \end_inset
3535
3536  Determines the output filename and may, contain 
3537 \begin_inset Flex CharStyle:Code
3538 status collapsed
3539
3540 \begin_layout PlainLayout
3541 $$b
3542 \end_layout
3543
3544 \end_inset
3545
3546 .
3547  Sensible only with resultdir and optional even then; if not given, it defaults
3548  to `index'.
3549 \end_layout
3550
3551 \begin_layout Standard
3552 None of these last three are presently used in any of the converters that
3553  are installed with LyX.
3554  
3555 \end_layout
3556
3557 \begin_layout Standard
3558 You do not have to define converters between all the formats between which
3559  you want to convert.
3560  For example, you will note that there is no `LyX to PostScript®' converter,
3561  but LyX will export PostScript®.
3562  It does so by first creating a LaTeX file (no converter needs to be defined
3563  for this) which is then converted to DVI using the `LaTeX to DVI' converter,
3564  and finally converting the resulting DVI file to PostScript®.
3565  LyX finds such `chains' of converters automatically, and it will always
3566  choose the shortest possible chain.
3567  You can, though, still define multiple conversion methods between file
3568  formats.
3569  For example, the standard LyX configuration provides three ways to convert
3570  LaTeX to PDF: Directly, using 
3571 \begin_inset Flex CharStyle:MenuItem
3572 status collapsed
3573
3574 \begin_layout PlainLayout
3575 pdflatex
3576 \end_layout
3577
3578 \end_inset
3579
3580 ; via (DVI and) PostScript®, using 
3581 \begin_inset Flex CharStyle:MenuItem
3582 status collapsed
3583
3584 \begin_layout PlainLayout
3585 ps2pdf
3586 \end_layout
3587
3588 \end_inset
3589
3590 ; or via DVI, using 
3591 \begin_inset Flex CharStyle:MenuItem
3592 status collapsed
3593
3594 \begin_layout PlainLayout
3595 dvipdfm
3596 \end_layout
3597
3598 \end_inset
3599
3600 .
3601  To define such alternate chains, you must define multiple target `file
3602  formats', as described in section 
3603 \begin_inset CommandInset ref
3604 LatexCommand ref
3605 reference "sub:Formats"
3606
3607 \end_inset
3608
3609 .
3610  For example, in the standard configuration, the formats named 
3611 \begin_inset Flex CharStyle:MenuItem
3612 status collapsed
3613
3614 \begin_layout PlainLayout
3615 pdf
3616 \end_layout
3617
3618 \end_inset
3619
3620
3621 \begin_inset Flex CharStyle:MenuItem
3622 status collapsed
3623
3624 \begin_layout PlainLayout
3625 pdf2
3626 \end_layout
3627
3628 \end_inset
3629
3630 , and 
3631 \begin_inset Flex CharStyle:MenuItem
3632 status collapsed
3633
3634 \begin_layout PlainLayout
3635 pdf3
3636 \end_layout
3637
3638 \end_inset
3639
3640  are defined, all of which share the extension 
3641 \begin_inset Flex CharStyle:MenuItem
3642 status collapsed
3643
3644 \begin_layout PlainLayout
3645 .pdf
3646 \end_layout
3647
3648 \end_inset
3649
3650 , and which correspond to the conversion methods just mentioned.
3651 \end_layout
3652
3653 \begin_layout Section
3654 Output 
3655 \end_layout
3656
3657 \begin_layout Standard
3658 The settings in this section affect the output LyX produces.
3659 \end_layout
3660
3661 \begin_layout Subsection
3662 Plain text export options
3663 \end_layout
3664
3665 \begin_layout Standard
3666 \noindent
3667 There are a couple of commands that can be used to 
3668 \begin_inset Quotes eld
3669 \end_inset
3670
3671 clean up
3672 \begin_inset Quotes erd
3673 \end_inset
3674
3675  exported plain text files.
3676  Note that LyX automatically detects and tries to use the best settings
3677  for your system at installation time, but you can modify them in the 
3678 \begin_inset Flex CharStyle:MenuItem
3679 status collapsed
3680
3681 \begin_layout PlainLayout
3682 Output\SpecialChar \menuseparator
3683 Plain Text
3684 \end_layout
3685
3686 \end_inset
3687
3688  dialog if you disagree with its interpretation.
3689 \end_layout
3690
3691 \begin_layout Description
3692 \begin_inset Flex CharStyle:Code
3693 status collapsed
3694
3695 \begin_layout PlainLayout
3696 roff command
3697 \end_layout
3698
3699 \end_inset
3700
3701  This option defines the command used to produce better plain text tables
3702  with the 
3703 \begin_inset Flex CharStyle:Code
3704 status collapsed
3705
3706 \begin_layout PlainLayout
3707 groff/troff/nroff
3708 \end_layout
3709
3710 \end_inset
3711
3712  UNIX-commands (refer to their manpages for more information about them).
3713  Setting this as empty tells LyX to use the internal (inferior) formatter.
3714 \end_layout
3715
3716 \begin_layout Description
3717 \begin_inset Flex CharStyle:Code
3718 status collapsed
3719
3720 \begin_layout PlainLayout
3721 Output line length
3722 \end_layout
3723
3724 \end_inset
3725
3726  With this command you can set the default line length of the plain text
3727  output file.
3728  Setting it to 0 means that no line breaks will be inserted except between
3729  paragraphs and the like.
3730 \end_layout
3731
3732 \begin_layout Section
3733 The rest
3734 \end_layout
3735
3736 \begin_layout Standard
3737 There are many other configuration options that can be used to customize
3738  LyX behavior.
3739  Most of them are sufficiently self-explanatory that we have not felt it
3740  necessary to document them here.
3741  Please ask on the 
3742 \begin_inset CommandInset href
3743 LatexCommand href
3744 name "mailing lists"
3745 target "http://www.lyx.org/mailing.php"
3746
3747 \end_inset
3748
3749  if you need some more information.
3750 \end_layout
3751
3752 \begin_layout Chapter
3753 Internationalizing LyX
3754 \begin_inset CommandInset label
3755 LatexCommand label
3756 name "chap:i18n"
3757
3758 \end_inset
3759
3760
3761 \end_layout
3762
3763 \begin_layout Standard
3764 LyX supports using a translated interface.
3765  Last time we checked, LyX provided text in thirty languages.
3766  The language of choice is called your 
3767 \emph on
3768 locale
3769 \emph default
3770 .
3771  (For further reading on locale settings, see also the documentation for
3772  locale that comes with your operating system.
3773  For Linux, the manual page for 
3774 \begin_inset Flex CharStyle:Code
3775 status collapsed
3776
3777 \begin_layout PlainLayout
3778 locale(5)
3779 \end_layout
3780
3781 \end_inset
3782
3783  could be a good place to start).
3784 \end_layout
3785
3786 \begin_layout Standard
3787 Notice that these translations will work, but do contain a few flaws.
3788  In particular, all dialogs have been designed with the English text in
3789  mind, which means that some of the translated text will be too large to
3790  fit within the space allocated.
3791  This is only a display problem and will not cause any harm.
3792  Also, you will find that some of the translations do not define shortcut
3793  keys for everything.
3794  Sometimes, there are simply not enough free letters to do it.
3795  Other times, the translator just hasn't got around to doing it yet.
3796  Our localization team, which you may wish to join,
3797 \begin_inset Foot
3798 status collapsed
3799
3800 \begin_layout PlainLayout
3801 If you are a fluent speaker of a language other than English, joining these
3802  teams is a great way to give back to the LyX community!
3803 \end_layout
3804
3805 \end_inset
3806
3807  will of course try to fix these shortcomings in future versions of LyX.
3808 \end_layout
3809
3810 \begin_layout Section
3811 Translating LyX
3812 \end_layout
3813
3814 \begin_layout Subsection
3815 Translating the graphical user interface (text messages).
3816 \end_layout
3817
3818 \begin_layout Standard
3819 LyX uses the GNU 
3820 \begin_inset Flex CharStyle:Code
3821 status collapsed
3822
3823 \begin_layout PlainLayout
3824 gettext
3825 \end_layout
3826
3827 \end_inset
3828
3829  library to handle the internationalization of the interface.
3830  To have LyX speak your favorite language in all menus and dialogs, you
3831  need a 
3832 \begin_inset Flex CharStyle:Code
3833 status collapsed
3834
3835 \begin_layout PlainLayout
3836 po
3837 \end_layout
3838
3839 \end_inset
3840
3841 -file for that language.
3842  When this is available, you'll have to generate a 
3843 \begin_inset Flex CharStyle:Code
3844 status open
3845
3846 \begin_layout PlainLayout
3847 mo
3848 \end_layout
3849
3850 \end_inset
3851
3852 -file from it and install the 
3853 \begin_inset Flex CharStyle:Code
3854 status collapsed
3855
3856 \begin_layout PlainLayout
3857 mo
3858 \end_layout
3859
3860 \end_inset
3861
3862 -file.
3863  The process of doing all of this is explained in the documentation for
3864  GNU 
3865 \begin_inset Flex CharStyle:Code
3866 status collapsed
3867
3868 \begin_layout PlainLayout
3869 gettext
3870 \end_layout
3871
3872 \end_inset
3873
3874 .
3875  It is possible to do this just for yourself, but if you're going to do
3876  it, you might as well share the results of your labors with the rest of
3877  the LyX community.
3878  Send a message to the LyX developers' list for more information about how
3879  to proceed.
3880 \end_layout
3881
3882 \begin_layout Standard
3883 In short, this is what you should do (xx denotes the language code):
3884 \end_layout
3885
3886 \begin_layout Itemize
3887 Check out the LyX source code.
3888  (See the 
3889 \begin_inset CommandInset href
3890 LatexCommand href
3891 name "information on the web"
3892 target "http://www.lyx.org/devel/cvs.php"
3893
3894 \end_inset
3895
3896 .)
3897 \end_layout
3898
3899 \begin_layout Itemize
3900 Copy 
3901 \begin_inset Flex CharStyle:Code
3902 status collapsed
3903
3904 \begin_layout PlainLayout
3905 po/lyx.pot
3906 \end_layout
3907
3908 \end_inset
3909
3910  to
3911 \series bold
3912  
3913 \series default
3914
3915 \begin_inset Flex CharStyle:Code
3916 status collapsed
3917
3918 \begin_layout PlainLayout
3919 xx.po
3920 \end_layout
3921
3922 \end_inset
3923
3924  (if 
3925 \begin_inset Flex CharStyle:Code
3926 status collapsed
3927
3928 \begin_layout PlainLayout
3929 lyx.pot
3930 \end_layout
3931
3932 \end_inset
3933
3934  doesn't exist, it can be remade with 
3935 \begin_inset Flex CharStyle:Code
3936 status collapsed
3937
3938 \begin_layout PlainLayout
3939 make lyx.pot
3940 \end_layout
3941
3942 \end_inset
3943
3944  in that directory, or you can use an existing po-file for some other language
3945  as a template).
3946 \end_layout
3947
3948 \begin_layout Itemize
3949 Edit 
3950 \begin_inset Flex CharStyle:Code
3951 status collapsed
3952
3953 \begin_layout PlainLayout
3954 xx.po
3955 \end_layout
3956
3957 \end_inset
3958
3959 .
3960 \begin_inset Foot
3961 status collapsed
3962
3963 \begin_layout PlainLayout
3964 This is just a text file, so it can be edited in any text editor.
3965  But there are also specialized programs that support such editing, such
3966  as KBabel (for KDE).
3967  Emacs contains a `mode' for editing 
3968 \begin_inset Flex CharStyle:Code
3969 status collapsed
3970
3971 \begin_layout PlainLayout
3972 po
3973 \end_layout
3974
3975 \end_inset
3976
3977  files, as well.
3978 \end_layout
3979
3980 \end_inset
3981
3982  For some menu- and widget-labels, there are also shortcut keys that should
3983  be translated.
3984  Those keys are marked after a `|', and should be translated according to
3985  the words and phrases of the language.
3986  You should also fill also out the information at the beginning of the new
3987  
3988 \begin_inset Flex CharStyle:Code
3989 status collapsed
3990
3991 \begin_layout PlainLayout
3992 po
3993 \end_layout
3994
3995 \end_inset
3996
3997 -file with your email-address, etc., so people know where to reach you with
3998  suggestions and entertaining flames.
3999 \end_layout
4000
4001 \begin_layout Standard
4002 If you are just doing this on your own, then:
4003 \end_layout
4004
4005 \begin_layout Itemize
4006 Generate 
4007 \begin_inset Flex CharStyle:Code
4008 status collapsed
4009
4010 \begin_layout PlainLayout
4011 xx.mo
4012 \end_layout
4013
4014 \end_inset
4015
4016 .
4017  This can be done with 
4018 \begin_inset Flex CharStyle:Code
4019 status collapsed
4020
4021 \begin_layout PlainLayout
4022 msgfmt -o xx.mo < xx.po
4023 \end_layout
4024
4025 \end_inset
4026
4027 .
4028 \end_layout
4029
4030 \begin_layout Itemize
4031 Copy the 
4032 \begin_inset Flex CharStyle:Code
4033 status collapsed
4034
4035 \begin_layout PlainLayout
4036 mo
4037 \end_layout
4038
4039 \end_inset
4040
4041 -file to your locale-tree, at the correct directory for application messages
4042  for the language
4043 \series bold
4044  
4045 \series default
4046 xx, and under the name 
4047 \begin_inset Flex CharStyle:Code
4048 status collapsed
4049
4050 \begin_layout PlainLayout
4051 lyx.mo
4052 \end_layout
4053
4054 \end_inset
4055
4056  (e.g.
4057  
4058 \begin_inset Flex CharStyle:Code
4059 status collapsed
4060
4061 \begin_layout PlainLayout
4062 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
4063 \end_layout
4064
4065 \end_inset
4066
4067
4068 \series bold
4069 .
4070 \end_layout
4071
4072 \begin_layout Standard
4073 As said, however, it would be best if the new 
4074 \begin_inset Flex CharStyle:Code
4075 status collapsed
4076
4077 \begin_layout PlainLayout
4078 po
4079 \end_layout
4080
4081 \end_inset
4082
4083 -file could be added to the LyX distribution, so others can use it.
4084  Adding it involves making additional changes to LyX.
4085  So send an email to the developers' mailing list if you're interested in
4086  doing that.
4087 \end_layout
4088
4089 \begin_layout Subsubsection
4090 Ambigous messages
4091 \end_layout
4092
4093 \begin_layout Standard
4094 Sometimes it turns out that one English message needs to be translated into
4095  different messages in the target language.
4096  One example is the message 
4097 \begin_inset Flex CharStyle:Code
4098 status collapsed
4099
4100 \begin_layout PlainLayout
4101 To
4102 \end_layout
4103
4104 \end_inset
4105
4106  which has the German translation 
4107 \lang german
4108 Nach
4109 \lang english
4110  or 
4111 \lang german
4112 Bis
4113 \lang english
4114 , depending upon exactly what the English 
4115 \begin_inset Quotes eld
4116 \end_inset
4117
4118 to
4119 \begin_inset Quotes erd
4120 \end_inset
4121
4122  means.
4123  GNU 
4124 \begin_inset Flex CharStyle:Code
4125 status collapsed
4126
4127 \begin_layout PlainLayout
4128 gettext
4129 \end_layout
4130
4131 \end_inset
4132
4133  does not handle such ambigous translations.
4134  Therefore you have to add some context information to the message: Instead
4135  of 
4136 \begin_inset Flex CharStyle:Code
4137 status collapsed
4138
4139 \begin_layout PlainLayout
4140 To
4141 \end_layout
4142
4143 \end_inset
4144
4145  it becomes 
4146 \begin_inset Flex CharStyle:Code
4147 status collapsed
4148
4149 \begin_layout PlainLayout
4150 To[[as in 'From format x to format y']]
4151 \end_layout
4152
4153 \end_inset
4154
4155  and 
4156 \begin_inset Flex CharStyle:Code
4157 status collapsed
4158
4159 \begin_layout PlainLayout
4160 To[[as in 'From page x to page y']].
4161 \end_layout
4162
4163 \end_inset
4164
4165  Now the two occurences of 
4166 \begin_inset Flex CharStyle:Code
4167 status collapsed
4168
4169 \begin_layout PlainLayout
4170 To
4171 \end_layout
4172
4173 \end_inset
4174
4175  are different for 
4176 \begin_inset Flex CharStyle:Code
4177 status collapsed
4178
4179 \begin_layout PlainLayout
4180 gettext
4181 \end_layout
4182
4183 \end_inset
4184
4185  and can be translated correctly to 
4186 \lang german
4187 Nach
4188 \lang english
4189  and 
4190 \lang german
4191 Bis
4192 \lang english
4193 , respectively.
4194 \end_layout
4195
4196 \begin_layout Standard
4197 Of course the context information needs to be stripped off the original
4198  message when no translation is used.
4199  Therefore you have to put it in double square brackets at the end of the
4200  message (see the example above).
4201  The translation mechanism of LyX ensures that everything in double square
4202  brackets at the end of messages is removed before displaying the message.
4203 \end_layout
4204
4205 \begin_layout Subsection
4206 Translating the documentation.
4207 \end_layout
4208
4209 \begin_layout Standard
4210 The online documentation (in the 
4211 \begin_inset Flex CharStyle:MenuItem
4212 status collapsed
4213
4214 \begin_layout PlainLayout
4215
4216 \bar under
4217 H
4218 \bar default
4219 elp
4220 \end_layout
4221
4222 \end_inset
4223
4224 -menu) can (and should!) be translated.
4225  If there are translated versions of the documentation available
4226 \begin_inset Foot
4227 status collapsed
4228
4229 \begin_layout PlainLayout
4230 As of March 2008, at least some of the documents have been translated into
4231  fourteen languages, with the Tutorial available in a few more.
4232 \end_layout
4233
4234 \end_inset
4235
4236  and the locale is set accordingly, these will be used automagically by
4237  LyX.
4238  LyX looks for translated versions as 
4239 \begin_inset Flex CharStyle:Code
4240 status collapsed
4241
4242 \begin_layout PlainLayout
4243 LyXDir/doc/xx_DocName.lyx
4244 \end_layout
4245
4246 \end_inset
4247
4248 , where 
4249 \begin_inset Flex CharStyle:Code
4250 status collapsed
4251
4252 \begin_layout PlainLayout
4253 xx
4254 \end_layout
4255
4256 \end_inset
4257
4258  is the code for the language currently in use.
4259  If there are no translated documents, the default English versions will
4260  be displayed.
4261  Note that the translated versions must have the same filenames (
4262 \begin_inset Flex CharStyle:Code
4263 status collapsed
4264
4265 \begin_layout PlainLayout
4266 DocName
4267 \end_layout
4268
4269 \end_inset
4270
4271  above) as the original.
4272  If you feel up to translating the documentation (an excellent way to proof-read
4273  the original documentation by the way!), there are a few things you should
4274  do right away:
4275 \end_layout
4276
4277 \begin_layout Itemize
4278 Read 
4279 \begin_inset Flex CharStyle:Code
4280 status collapsed
4281
4282 \begin_layout PlainLayout
4283 DocStyle.lyx
4284 \end_layout
4285
4286 \end_inset
4287
4288 , the guide to writing LyX documentation.
4289  Pay special attention to the translator's section.
4290 \end_layout
4291
4292 \begin_layout Itemize
4293 Check out the documentation translation web page at 
4294 \begin_inset CommandInset href
4295 LatexCommand href
4296 name "http://www.devel.lyx.org"
4297 target "http://www.devel.lyx.org"
4298
4299 \end_inset
4300
4301 .
4302  That way, you can find out which (if any) documents have already been translate
4303 d into your language.
4304  You can also find out who (if anyone) is organizing the effort to translate
4305  the documentation into your language.
4306  If no one is organizing the effort, please let us know that you're interested.
4307 \end_layout
4308
4309 \begin_layout Standard
4310 Once you get to actually translating, here's a few hints for you that may
4311  save you trouble:
4312 \end_layout
4313
4314 \begin_layout Itemize
4315 Join the documentation team! There is information on how to do that in 
4316 \begin_inset Flex CharStyle:Code
4317 status collapsed
4318
4319 \begin_layout PlainLayout
4320 Intro.lyx
4321 \end_layout
4322
4323 \end_inset
4324
4325  (
4326 \begin_inset Flex CharStyle:MenuItem
4327 status collapsed
4328
4329 \begin_layout PlainLayout
4330
4331 \bar under
4332 H
4333 \bar default
4334 elp\SpecialChar \menuseparator
4335
4336 \bar under
4337 I
4338 \bar default
4339 ntroduction
4340 \end_layout
4341
4342 \end_inset
4343
4344 ), which by the way is the first document you should translate.
4345 \end_layout
4346
4347 \begin_layout Itemize
4348 Learn the typographic conventions for the language you are translating to.
4349  Typography is an ancient art and over the centuries, a great variety of
4350  conventions have developed throughout different parts of the world.
4351  Also study the professional terminology amongst typographers in your country.
4352  Inventing your own terminology will only confuse the users.
4353  
4354 \emph on
4355 (Warning! Typography is addictive!)
4356 \end_layout
4357
4358 \begin_layout Itemize
4359 Make a copy of the document.
4360  This will be your working copy.
4361  You can use this as your personal translated help-file by placing it in
4362  your 
4363 \begin_inset Flex CharStyle:Code
4364 status collapsed
4365
4366 \begin_layout PlainLayout
4367 UserDir/doc/
4368 \end_layout
4369
4370 \end_inset
4371
4372  directory.
4373 \end_layout
4374
4375 \begin_layout Itemize
4376 Sometimes the original document (from the LyX-team) will be updated.
4377  Use the source viewer at 
4378 \begin_inset CommandInset href
4379 LatexCommand href
4380 name "http://www.lyx.org/trac/timeline"
4381 target "http://www.lyx.org/trac/timeline"
4382
4383 \end_inset
4384
4385  to see what has been changed.
4386  That way you can easily see which parts of the translated document need
4387  to be updated.
4388 \end_layout
4389
4390 \begin_layout Standard
4391 If you ever find an error in the original document, fix it and notify the
4392  rest of the documentation team of the changes! (You didn't forget to join
4393  the documentation team, did you?)
4394 \end_layout
4395
4396 \begin_layout Standard
4397 \begin_inset Branch OutDated
4398 status open
4399
4400 \begin_layout Section
4401 International Keyboard Support
4402 \end_layout
4403
4404 \begin_layout Standard
4405
4406 \emph on
4407 [Editor's Note: The following section is by
4408 \emph default
4409  
4410 \shape smallcaps
4411 \emph on
4412 Ivan Schreter
4413 \shape default
4414 .
4415  It needs to be fixed to conform to the new Documentation Style sheet and
4416  to make use of the new v1.0 features.
4417  The whole thing also needs to be merged with the section following it.-jw
4418  It may also be badly out of date.-rh (2008)]
4419 \end_layout
4420
4421 \begin_layout Subsection
4422 Defining Own Keymaps: Keymap File Format
4423 \end_layout
4424
4425 \begin_layout Standard
4426 Let's look at a keyboard definition file a little closer.
4427  It is a plain text file defining
4428 \end_layout
4429
4430 \begin_layout Itemize
4431 key-to-key or key-to-string translations
4432 \end_layout
4433
4434 \begin_layout Itemize
4435 dead keys
4436 \end_layout
4437
4438 \begin_layout Itemize
4439 dead keys exceptions
4440 \end_layout
4441
4442 \begin_layout Standard
4443 To define key-to-key or key-to-string translation, use this command:
4444 \end_layout
4445
4446 \begin_layout Quotation
4447 \begin_inset Flex CharStyle:Code
4448 status collapsed
4449
4450 \begin_layout PlainLayout
4451
4452 \backslash
4453 kmap
4454 \end_layout
4455
4456 \end_inset
4457
4458  
4459 \begin_inset Flex CharStyle:Code
4460 status collapsed
4461
4462 \begin_layout PlainLayout
4463 key
4464 \end_layout
4465
4466 \end_inset
4467
4468  outstring 
4469 \end_layout
4470
4471 \begin_layout Standard
4472 where 
4473 \begin_inset Flex CharStyle:Code
4474 status collapsed
4475
4476 \begin_layout PlainLayout
4477 key
4478 \end_layout
4479
4480 \end_inset
4481
4482  is the key to be translated and 
4483 \begin_inset Flex CharStyle:Code
4484 status collapsed
4485
4486 \begin_layout PlainLayout
4487 outstring
4488 \end_layout
4489
4490 \end_inset
4491
4492  is the string to be inserted into the document.
4493  To define dead keys, use:
4494 \end_layout
4495
4496 \begin_layout Quotation
4497 \begin_inset Flex CharStyle:Code
4498 status collapsed
4499
4500 \begin_layout PlainLayout
4501
4502 \backslash
4503 kmod
4504 \end_layout
4505
4506 \end_inset
4507
4508  
4509 \begin_inset Flex CharStyle:Code
4510 status collapsed
4511
4512 \begin_layout PlainLayout
4513 key
4514 \end_layout
4515
4516 \end_inset
4517
4518  deadkey
4519 \end_layout
4520
4521 \begin_layout Standard
4522 where 
4523 \begin_inset Flex CharStyle:Code
4524 status collapsed
4525
4526 \begin_layout PlainLayout
4527 key
4528 \end_layout
4529
4530 \end_inset
4531
4532  is a keyboard key and 
4533 \begin_inset Flex CharStyle:Code
4534 status collapsed
4535
4536 \begin_layout PlainLayout
4537 deadkey
4538 \end_layout
4539
4540 \end_inset
4541
4542  is dead key name.
4543  The following dead keys are supported (shortcut name is in parentheses):
4544 \end_layout
4545
4546 \begin_layout Quotation
4547
4548 \emph on
4549 Name
4550 \begin_inset Space \hfill{}
4551 \end_inset
4552
4553 Example
4554 \end_layout
4555
4556 \begin_layout Quotation
4557 acute (acu)
4558 \begin_inset Space \hfill{}
4559 \end_inset
4560
4561 áéíóú
4562 \end_layout
4563
4564 \begin_layout Quotation
4565 grave (gra)
4566 \begin_inset Space \hfill{}
4567 \end_inset
4568
4569 àèìòù
4570 \end_layout
4571
4572 \begin_layout Quotation
4573 macron (mac)
4574 \begin_inset Space \hfill{}
4575 \end_inset
4576
4577  ō
4578 \end_layout
4579
4580 \begin_layout Quotation
4581 tilde (til)
4582 \begin_inset Space \hfill{}
4583 \end_inset
4584
4585 ñÑ
4586 \end_layout
4587
4588 \begin_layout Quotation
4589 underbar (underb)
4590 \begin_inset Space \hfill{}
4591 \end_inset
4592
4593
4594 \begin_inset ERT
4595 status open
4596
4597 \begin_layout PlainLayout
4598
4599
4600 \backslash
4601 b o
4602 \end_layout
4603
4604 \end_inset
4605
4606
4607 \end_layout
4608
4609 \begin_layout Quotation
4610 cedilla (ced)
4611 \begin_inset Space \hfill{}
4612 \end_inset
4613
4614 çÇ
4615 \end_layout
4616
4617 \begin_layout Quotation
4618 underdot (underd)
4619 \begin_inset Space \hfill{}
4620 \end_inset
4621
4622
4623 \begin_inset ERT
4624 status open
4625
4626 \begin_layout PlainLayout
4627
4628
4629 \backslash
4630 d o
4631 \end_layout
4632
4633 \end_inset
4634
4635
4636 \end_layout
4637
4638 \begin_layout Quotation
4639 circumflex (circu)
4640 \begin_inset Space \hfill{}
4641 \end_inset
4642
4643 âêîôû
4644 \end_layout
4645
4646 \begin_layout Quotation
4647 circle (circl)
4648 \begin_inset Space \hfill{}
4649 \end_inset
4650
4651 ÅůŮ
4652 \end_layout
4653
4654 \begin_layout Quotation
4655 tie (tie)
4656 \begin_inset Space \hfill{}
4657 \end_inset
4658
4659
4660 \begin_inset ERT
4661 status open
4662
4663 \begin_layout PlainLayout
4664
4665
4666 \backslash
4667 t o
4668 \end_layout
4669
4670 \end_inset
4671
4672
4673 \end_layout
4674
4675 \begin_layout Quotation
4676 breve (bre)
4677 \begin_inset Space \hfill{}
4678 \end_inset
4679
4680 ă
4681 \begin_inset ERT
4682 status open
4683
4684 \begin_layout PlainLayout
4685
4686
4687 \backslash
4688 u o
4689 \end_layout
4690
4691 \end_inset
4692
4693
4694 \end_layout
4695
4696 \begin_layout Quotation
4697 caron (car)
4698 \begin_inset Space \hfill{}
4699 \end_inset
4700
4701 čšž
4702 \end_layout
4703
4704 \begin_layout Quotation
4705 hungarian umlaut (hug)
4706 \begin_inset Space \hfill{}
4707 \end_inset
4708
4709 őű
4710 \end_layout
4711
4712 \begin_layout Quotation
4713 umlaut (uml)
4714 \begin_inset Space \hfill{}
4715 \end_inset
4716
4717 äöü
4718 \end_layout
4719
4720 \begin_layout Quotation
4721 dot (dot)
4722 \begin_inset Space \hfill{}
4723 \end_inset
4724
4725 ż
4726 \begin_inset ERT
4727 status open
4728
4729 \begin_layout PlainLayout
4730
4731
4732 \backslash
4733 .s
4734 \end_layout
4735
4736 \end_inset
4737
4738
4739 \end_layout
4740
4741 \begin_layout Standard
4742 Since in many international keyboards there are exceptions to what some
4743  dead keys should do, you can define them using
4744 \end_layout
4745
4746 \begin_layout Quotation
4747 \begin_inset Flex CharStyle:Code
4748 status collapsed
4749
4750 \begin_layout PlainLayout
4751
4752 \backslash
4753 kxmod
4754 \end_layout
4755
4756 \end_inset
4757
4758  deadkey key outstring
4759 \end_layout
4760
4761 \begin_layout Standard
4762 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
4763 , so you put in
4764 \end_layout
4765
4766 \begin_layout Quotation
4767 \begin_inset Flex CharStyle:Code
4768 status collapsed
4769
4770 \begin_layout PlainLayout
4771
4772 \backslash
4773 kxmod
4774 \end_layout
4775
4776 \end_inset
4777
4778  caron o "
4779 \backslash
4780 ^o"
4781 \end_layout
4782
4783 \begin_layout Standard
4784 to make it work correctly.
4785  Also, you have to define as exceptions dead keys over i and j, to remove
4786  the dot from them before inserting an accent mark.
4787  I will change this when the time comes, but so far I haven't had time.
4788 \end_layout
4789
4790 \begin_layout Standard
4791 Oh, and about characters: backslash is escaped, so to enter it, you'll need
4792  double backslash.
4793  Also, quotes and 
4794 \begin_inset Flex CharStyle:Code
4795 status collapsed
4796
4797 \begin_layout PlainLayout
4798 #
4799 \end_layout
4800
4801 \end_inset
4802
4803  have different meaning.
4804  
4805 \begin_inset Flex CharStyle:Code
4806 status collapsed
4807
4808 \begin_layout PlainLayout
4809 #
4810 \end_layout
4811
4812 \end_inset
4813
4814  marks comments, quotes start and end LaTeX-style commands.
4815  To enter quote, you'll need to use 
4816 \begin_inset Flex CharStyle:Code
4817 status collapsed
4818
4819 \begin_layout PlainLayout
4820
4821 \backslash
4822 "
4823 \end_layout
4824
4825 \end_inset
4826
4827 , to enter 
4828 \begin_inset Flex CharStyle:Code
4829 status collapsed
4830
4831 \begin_layout PlainLayout
4832 #
4833 \end_layout
4834
4835 \end_inset
4836
4837 , use 
4838 \begin_inset Flex CharStyle:Code
4839 status collapsed
4840
4841 \begin_layout PlainLayout
4842
4843 \backslash
4844 #
4845 \end_layout
4846
4847 \end_inset
4848
4849 .
4850 \end_layout
4851
4852 \begin_layout Standard
4853 If you make a keyboard description file that works for your language, please
4854  mail it to me, so I can include it in the next keymap distribution.
4855 \end_layout
4856
4857 \begin_layout Standard
4858 More keywords will be supported in keymap configuration file in future,
4859  like
4860 \end_layout
4861
4862 \begin_layout Itemize
4863 \begin_inset Flex CharStyle:Code
4864 status collapsed
4865
4866 \begin_layout PlainLayout
4867
4868 \backslash
4869 kinclude filename
4870 \end_layout
4871
4872 \end_inset
4873
4874
4875 \emph on
4876
4877 \begin_inset Space \hfill{}
4878 \end_inset
4879
4880
4881 \begin_inset Flex CharStyle:Code
4882 status collapsed
4883
4884 \begin_layout PlainLayout
4885 include
4886 \end_layout
4887
4888 \end_inset
4889
4890  another file
4891 \end_layout
4892
4893 \begin_layout Itemize
4894 \begin_inset Flex CharStyle:Code
4895 status collapsed
4896
4897 \begin_layout PlainLayout
4898
4899 \backslash
4900 kprog program
4901 \end_layout
4902
4903 \end_inset
4904
4905
4906 \emph on
4907
4908 \begin_inset Space \hfill{}
4909 \end_inset
4910
4911
4912 \begin_inset Flex CharStyle:Code
4913 status collapsed
4914
4915 \begin_layout PlainLayout
4916 define
4917 \end_layout
4918
4919 \end_inset
4920
4921  an external keymap translation program 
4922 \end_layout
4923
4924 \begin_layout Standard
4925 Also, it should look into 
4926 \begin_inset Flex CharStyle:Code
4927 status collapsed
4928
4929 \begin_layout PlainLayout
4930 lyxrc
4931 \end_layout
4932
4933 \end_inset
4934
4935  file for defaults, too (for example, a 
4936 \begin_inset Flex CharStyle:Code
4937 status collapsed
4938
4939 \begin_layout PlainLayout
4940
4941 \backslash
4942 kinclude
4943 \end_layout
4944
4945 \end_inset
4946
4947  option to include default keyboard).
4948 \end_layout
4949
4950 \end_inset
4951
4952
4953 \end_layout
4954
4955 \begin_layout Section
4956 \begin_inset CommandInset label
4957 LatexCommand label
4958 name "sec:keymap"
4959
4960 \end_inset
4961
4962 International Keymap Stuff
4963 \end_layout
4964
4965 \begin_layout Standard
4966 \begin_inset Note Note
4967 status open
4968
4969 \begin_layout PlainLayout
4970 In doing the revisions on this document in March 2008, I did not look over
4971  this stuff, as I do not understand it.
4972  It would be good if someone else could do so.
4973 \end_layout
4974
4975 \end_inset
4976
4977
4978 \end_layout
4979
4980 \begin_layout Standard
4981 The next two sections describe the 
4982 \begin_inset Flex CharStyle:Code
4983 status collapsed
4984
4985 \begin_layout PlainLayout
4986
4987 \shape up
4988 .kmap
4989 \end_layout
4990
4991 \end_inset
4992
4993  and 
4994 \begin_inset Flex CharStyle:Code
4995 status collapsed
4996
4997 \begin_layout PlainLayout
4998
4999 \shape up
5000 .cdef
5001 \end_layout
5002
5003 \end_inset
5004
5005  file syntax in detail.
5006  These sections should help you design your own key map if the ones provided
5007  do not meet your needs.
5008 \end_layout
5009
5010 \begin_layout Subsection
5011 The .kmap File
5012 \end_layout
5013
5014 \begin_layout Standard
5015
5016 \shape up
5017 .
5018 \begin_inset Flex CharStyle:Code
5019 status collapsed
5020
5021 \begin_layout PlainLayout
5022 kmap
5023 \end_layout
5024
5025 \end_inset
5026
5027  file maps keystrokes to characters or strings.
5028  As the name suggests, it sets a keyboard mapping.
5029  The 
5030 \begin_inset Flex CharStyle:Code
5031 status collapsed
5032
5033 \begin_layout PlainLayout
5034 .kmap
5035 \end_layout
5036
5037 \end_inset
5038
5039
5040 \shape default
5041  file keywords 
5042 \shape up
5043
5044 \begin_inset Flex CharStyle:Code
5045 status collapsed
5046
5047 \begin_layout PlainLayout
5048
5049 \shape up
5050 kmap
5051 \end_layout
5052
5053 \end_inset
5054
5055
5056 \shape default
5057 ,
5058 \shape up
5059  
5060 \shape default
5061
5062 \begin_inset Flex CharStyle:Code
5063 status collapsed
5064
5065 \begin_layout PlainLayout
5066
5067 \shape up
5068 kmod
5069 \end_layout
5070
5071 \end_inset
5072
5073 ,
5074 \shape up
5075  
5076 \shape default
5077
5078 \begin_inset Flex CharStyle:Code
5079 status collapsed
5080
5081 \begin_layout PlainLayout
5082
5083 \shape up
5084 ksmod
5085 \end_layout
5086
5087 \end_inset
5088
5089 , and 
5090 \begin_inset Flex CharStyle:Code
5091 status collapsed
5092
5093 \begin_layout PlainLayout
5094
5095 \shape up
5096 kcomb
5097 \end_layout
5098
5099 \end_inset
5100
5101  are described in this section.
5102 \end_layout
5103
5104 \begin_layout List
5105 \labelwidthstring 00.00.0000
5106 \begin_inset Flex CharStyle:Code
5107 status collapsed
5108
5109 \begin_layout PlainLayout
5110
5111 \shape up
5112 kmap
5113 \end_layout
5114
5115 \end_inset
5116
5117  Map a character to a string
5118 \end_layout
5119
5120 \begin_layout LyX-Code
5121
5122 \backslash
5123 kmap 
5124 \family roman
5125 \emph on
5126 char
5127 \family default
5128 \emph default
5129  
5130 \family roman
5131 \emph on
5132 string
5133 \end_layout
5134
5135 \begin_layout Standard
5136 This will ma
5137 \family roman
5138 p
5139 \family default
5140  
5141 \family roman
5142 \emph on
5143 char
5144 \family default
5145 \emph default
5146  
5147 \family roman
5148 to
5149 \family default
5150  
5151 \family roman
5152 \emph on
5153 string
5154 \emph default
5155 .
5156  Note that in
5157 \family default
5158  
5159 \family roman
5160 \emph on
5161 string
5162 \emph default
5163 ,
5164 \family default
5165  
5166 \family roman
5167 \shape up
5168 the double-quote (")
5169 \family default
5170 \shape default
5171  
5172 \family roman
5173 and
5174 \family default
5175  
5176 \family roman
5177 \shape up
5178 the backslash (
5179 \backslash
5180 )
5181 \family default
5182 \shape default
5183  
5184 \family roman
5185 must be escaped with a preceding backslash (
5186 \shape up
5187
5188 \backslash
5189
5190 \shape default
5191 )
5192 \family default
5193 .
5194 \end_layout
5195
5196 \begin_layout Standard
5197 An example of a 
5198 \begin_inset Flex CharStyle:MenuItem
5199 status collapsed
5200
5201 \begin_layout PlainLayout
5202
5203 \shape up
5204 kmap
5205 \end_layout
5206
5207 \end_inset
5208
5209  statement to cause the symbol 
5210 \begin_inset Flex CharStyle:MenuItem
5211 status collapsed
5212
5213 \begin_layout PlainLayout
5214
5215 \shape up
5216 /
5217 \end_layout
5218
5219 \end_inset
5220
5221  to be output for the keystroke 
5222 \begin_inset Flex CharStyle:MenuItem
5223 status collapsed
5224
5225 \begin_layout PlainLayout
5226
5227 \shape up
5228 &
5229 \end_layout
5230
5231 \end_inset
5232
5233  is:
5234 \end_layout
5235
5236 \begin_layout LyX-Code
5237
5238 \backslash
5239 kmap & /
5240 \end_layout
5241
5242 \begin_layout List
5243 \labelwidthstring 00.00.0000
5244 \begin_inset Flex CharStyle:Code
5245 status collapsed
5246
5247 \begin_layout PlainLayout
5248
5249 \shape up
5250 kmod
5251 \end_layout
5252
5253 \end_inset
5254
5255  Specify an accent character
5256 \end_layout
5257
5258 \begin_layout LyX-Code
5259
5260 \backslash
5261 kmod 
5262 \family roman
5263 \emph on
5264 char accent allowed
5265 \end_layout
5266
5267 \begin_layout Standard
5268 This will make the cha
5269 \family roman
5270 racter
5271 \family default
5272  
5273 \family roman
5274 \emph on
5275 char
5276 \family default
5277 \emph default
5278  
5279 \family roman
5280 \shape up
5281 \emph on
5282 be an accent
5283 \family default
5284 \shape default
5285 \emph default
5286  
5287 \family roman
5288 \shape up
5289 on the
5290 \family default
5291 \shape default
5292  
5293 \family roman
5294 \shape up
5295 \emph on
5296 allowed
5297 \family default
5298 \shape default
5299 \emph default
5300  
5301 \family roman
5302 \shape up
5303 cha
5304 \family default
5305 racter(s).
5306  This is the dead key
5307 \begin_inset Foot
5308 status collapsed
5309
5310 \begin_layout PlainLayout
5311 The term 
5312 \family roman
5313 \emph on
5314 dead key
5315 \family default
5316 \emph default
5317  refers to a key that does not produce a character by itself, but when followed
5318  with another key, produces the desired accent character.
5319  For example, a German characte
5320 \family roman
5321 r with an umlaut like
5322 \family default
5323  
5324 \family roman
5325 \emph on
5326 ä
5327 \family default
5328 \emph default
5329  
5330 \family roman
5331 can be produced in this manner.
5332 \end_layout
5333
5334 \end_inset
5335
5336  mechanism.
5337  
5338 \end_layout
5339
5340 \begin_layout Standard
5341 If you 
5342 \family roman
5343 hit
5344 \family default
5345  
5346 \family roman
5347 \emph on
5348 char
5349 \family default
5350 \emph default
5351  
5352 \family roman
5353 and then another key not in
5354 \family default
5355  
5356 \family roman
5357 \emph on
5358 allowed
5359 \emph default
5360 , you will get a
5361 \family default
5362  
5363 \family roman
5364 \emph on
5365 char
5366 \family default
5367 \emph default
5368  
5369 \family roman
5370 followed by the other, unallowed key, as output.
5371
5372 \family default
5373  Note that a 
5374 \begin_inset Flex CharStyle:MenuItem
5375 status collapsed
5376
5377 \begin_layout PlainLayout
5378
5379 \shape up
5380 Backspace
5381 \end_layout
5382
5383 \end_inset
5384
5385  cancels a dead key, so if 
5386 \family roman
5387 you hit
5388 \family default
5389  
5390 \family roman
5391 \emph on
5392 char
5393 \family default
5394 \emph default
5395  
5396 \begin_inset Flex CharStyle:MenuItem
5397 status collapsed
5398
5399 \begin_layout PlainLayout
5400
5401 \shape up
5402 \emph on
5403 Backspace
5404 \end_layout
5405
5406 \end_inset
5407
5408 , the cursor will not go one position backwards but will instead cancel
5409  the effect t
5410 \family roman
5411 hat
5412 \family default
5413  
5414 \family roman
5415 \shape up
5416 \emph on
5417 char
5418 \family default
5419 \shape default
5420 \emph default
5421  
5422 \family roman
5423 \shape up
5424 might have had on the next keystroke.
5425  
5426 \end_layout
5427
5428 \begin_layout Standard
5429 The following example specifies that the character ' is to be an acute accent,
5430  allowed on the characters a, e, i, o, u, A, E, I, O, and U:
5431 \end_layout
5432
5433 \begin_layout LyX-Code
5434
5435 \backslash
5436 kmod ' acute aeiouAEIOU
5437 \end_layout
5438
5439 \begin_layout List
5440 \labelwidthstring 00.00.0000
5441 \begin_inset Flex CharStyle:Code
5442 status collapsed
5443
5444 \begin_layout PlainLayout
5445 ksmod
5446 \end_layout
5447
5448 \end_inset
5449
5450  Specify an exception to the accent character
5451 \end_layout
5452
5453 \begin_layout LyX-Code
5454
5455 \backslash
5456 kxmod  
5457 \family roman
5458 \emph on
5459 accent char result
5460 \end_layout
5461
5462 \begin_layout Standard
5463 This defines an exce
5464 \family roman
5465 ption for
5466 \family default
5467  
5468 \family roman
5469 \emph on
5470 accent
5471 \family default
5472 \emph default
5473  
5474 \family roman
5475 on
5476 \family default
5477  
5478 \family roman
5479 \emph on
5480 char
5481 \emph default
5482 .
5483  T
5484 \shape up
5485 he
5486 \family default
5487 \shape default
5488  
5489 \family roman
5490 \shape up
5491 \emph on
5492 accent
5493 \family default
5494 \shape default
5495 \emph default
5496  
5497 \family roman
5498 \shape up
5499 must
5500 \family default
5501 \shape default
5502  
5503 \shape up
5504 have been assigned a keystroke with a previous
5505 \shape default
5506  
5507 \begin_inset Flex CharStyle:Code
5508 status collapsed
5509
5510 \begin_layout PlainLayout
5511
5512 \shape up
5513
5514 \backslash
5515 kmo
5516 \shape default
5517 d
5518 \end_layout
5519
5520 \end_inset
5521
5522  declar
5523 \family roman
5524 ation and
5525 \family default
5526  
5527 \family roman
5528 \emph on
5529 char
5530 \family default
5531 \emph default
5532  
5533 \family roman
5534 must not belong in the
5535 \family default
5536  
5537 \family roman
5538 \emph on
5539 allowed
5540 \family default
5541 \emph default
5542  
5543 \family roman
5544 set of
5545 \family default
5546  
5547 \family roman
5548 \emph on
5549 accent
5550 \emph default
5551 .
5552  When
5553 \family default
5554  
5555 \family roman
5556 \shape up
5557 you enter the
5558 \family default
5559 \shape default
5560  
5561 \family roman
5562 \shape up
5563 \emph on
5564 accent char
5565 \family default
5566 \shape default
5567 \emph default
5568  
5569 \family roman
5570 \shape up
5571 sequence,
5572 \family default
5573 \shape default
5574  
5575 \family roman
5576 \shape up
5577 \emph on
5578 result
5579 \family default
5580 \shape default
5581 \emph default
5582  
5583 \family roman
5584 \shape up
5585  is produced.
5586  If such a declaration does not exist in
5587 \family default
5588 \shape default
5589  
5590 \shape up
5591 the
5592 \shape default
5593  
5594 \begin_inset Flex CharStyle:Code
5595 status collapsed
5596
5597 \begin_layout PlainLayout
5598
5599 \shape up
5600 .kmap
5601 \end_layout
5602
5603 \end_inset
5604
5605  file and yo
5606 \family roman
5607 u enter
5608 \family default
5609  
5610 \family roman
5611 \emph on
5612 accent  char
5613 \emph default
5614 , you get
5615 \family default
5616  
5617 \family roman
5618 \emph on
5619 accent_key char
5620 \family default
5621 \emph default
5622  
5623 \family roman
5624  where
5625 \family default
5626  
5627 \family roman
5628 \emph on
5629 accent_key
5630 \family default
5631 \emph default
5632  
5633 \family roman
5634  is the first arg
5635 \family default
5636 ument of the 
5637 \begin_inset Flex CharStyle:Code
5638 status collapsed
5639
5640 \begin_layout PlainLayout
5641
5642 \shape up
5643
5644 \backslash
5645 kmod
5646 \end_layout
5647
5648 \end_inset
5649
5650  declaration.
5651  
5652 \end_layout
5653
5654 \begin_layout Standard
5655 The following command produces causes äi to be produced when you enter acute-i
5656  ('i):
5657 \end_layout
5658
5659 \begin_layout LyX-Code
5660
5661 \backslash
5662 kxmod acute i "
5663 \backslash
5664
5665 \backslash
5666 '{
5667 \backslash
5668
5669 \backslash
5670 i}"
5671 \end_layout
5672
5673 \begin_layout List
5674 \labelwidthstring 00.00.0000
5675 \begin_inset Flex CharStyle:Code
5676 status collapsed
5677
5678 \begin_layout PlainLayout
5679 kcomb
5680 \end_layout
5681
5682 \end_inset
5683
5684  Combine two accent characters
5685 \end_layout
5686
5687 \begin_layout LyX-Code
5688
5689 \backslash
5690 kcomb 
5691 \family roman
5692 \emph on
5693 accent1 accent2 allowed
5694 \end_layout
5695
5696 \begin_layout Standard
5697 This one is getting pretty esoteric.
5698  It allows you to combine the effect 
5699 \family roman
5700 of
5701 \family default
5702  
5703 \family roman
5704 \emph on
5705 accent1
5706 \family default
5707 \emph default
5708  
5709 \family roman
5710 and
5711 \family default
5712  
5713 \family roman
5714 \emph on
5715 accent2
5716 \family default
5717 \emph default
5718  
5719 \family roman
5720 (in that order!) on
5721 \family default
5722  
5723 \family roman
5724 \emph on
5725 allowed
5726 \family default
5727 \emph default
5728  
5729 \family roman
5730 chars.
5731  The keystrokes for
5732 \family default
5733  
5734 \family roman
5735 \emph on
5736 accent1
5737 \family default
5738 \emph default
5739  
5740 \family roman
5741 and
5742 \family default
5743  
5744 \family roman
5745 \emph on
5746 accent2
5747 \family default
5748 \emph default
5749  
5750 \family roman
5751 must have be
5752 \family default
5753 en set with a 
5754 \begin_inset Flex CharStyle:Code
5755 status collapsed
5756
5757 \begin_layout PlainLayout
5758
5759 \shape up
5760
5761 \backslash
5762 kmod
5763 \end_layout
5764
5765 \end_inset
5766
5767  command at 
5768 \family roman
5769 a
5770 \family default
5771  
5772 \family roman
5773 \emph on
5774 previous
5775 \family default
5776 \emph default
5777  
5778 \family roman
5779 point in the
5780 \family default
5781  file.
5782  
5783 \end_layout
5784
5785 \begin_layout Standard
5786 Consider this example from the 
5787 \begin_inset Flex CharStyle:Code
5788 status collapsed
5789
5790 \begin_layout PlainLayout
5791
5792 \shape up
5793 greek.kmap
5794 \end_layout
5795
5796 \end_inset
5797
5798  file:
5799 \end_layout
5800
5801 \begin_layout LyX-Code
5802
5803 \backslash
5804 kmod ; acute aeioyvhAEIOYVH 
5805 \backslash
5806 kmod : umlaut iyIY 
5807 \backslash
5808 kcomb acute umlaut iyIY
5809 \end_layout
5810
5811 \begin_layout Standard
5812 This allows you to press 
5813 \begin_inset Flex CharStyle:MenuItem
5814 status collapsed
5815
5816 \begin_layout PlainLayout
5817
5818 \shape up
5819 ;:i
5820 \end_layout
5821
5822 \end_inset
5823
5824  and get the effect of 
5825 \begin_inset Flex CharStyle:Code
5826 status collapsed
5827
5828 \begin_layout PlainLayout
5829
5830 \shape up
5831
5832 \backslash
5833 '{
5834 \backslash
5835 "{i}}
5836 \end_layout
5837
5838 \end_inset
5839
5840 .
5841  
5842 \family roman
5843 \shape up
5844 A backspace
5845 \family default
5846 \shape default
5847  in this case cancels the last dead key, so if you press 
5848 \begin_inset Flex CharStyle:MenuItem
5849 status collapsed
5850
5851 \begin_layout PlainLayout
5852
5853 \shape up
5854 ;: Backspace i
5855 \end_layout
5856
5857 \end_inset
5858
5859  you get 
5860 \begin_inset Flex CharStyle:Code
5861 status collapsed
5862
5863 \begin_layout PlainLayout
5864
5865 \shape up
5866
5867 \backslash
5868 '{i}
5869 \end_layout
5870
5871 \end_inset
5872
5873 .
5874 \end_layout
5875
5876 \begin_layout Subsection
5877 The .cdef File
5878 \end_layout
5879
5880 \begin_layout Standard
5881 After the 
5882 \begin_inset Flex CharStyle:Code
5883 status collapsed
5884
5885 \begin_layout PlainLayout
5886
5887 \shape up
5888 .kmap
5889 \end_layout
5890
5891 \end_inset
5892
5893  mapping is performed, a 
5894 \begin_inset Flex CharStyle:Code
5895 status collapsed
5896
5897 \begin_layout PlainLayout
5898
5899 \shape up
5900 .cde
5901 \shape default
5902 f
5903 \end_layout
5904
5905 \end_inset
5906
5907  file maps the strings that the symbols generate to characters in the current
5908  font.
5909  The LyX distribution currently includes at least the 
5910 \begin_inset Flex CharStyle:Code
5911 status collapsed
5912
5913 \begin_layout PlainLayout
5914
5915 \shape up
5916 iso8859-1.cdef
5917 \end_layout
5918
5919 \end_inset
5920
5921  and 
5922 \begin_inset Flex CharStyle:Code
5923 status collapsed
5924
5925 \begin_layout PlainLayout
5926
5927 \shape up
5928 iso8859-2.cdef
5929 \end_layout
5930
5931 \end_inset
5932
5933  files.
5934 \end_layout
5935
5936 \begin_layout Standard
5937 In general the 
5938 \begin_inset Flex CharStyle:Code
5939 status collapsed
5940
5941 \begin_layout PlainLayout
5942
5943 \shape up
5944 .cdef
5945 \end_layout
5946
5947 \end_inset
5948
5949  file is a sequence of declarations of the form
5950 \end_layout
5951
5952 \begin_layout LyX-Code
5953
5954 \family roman
5955 \emph on
5956 char_index_in_set
5957 \family default
5958 \emph default
5959  
5960 \family roman
5961 \emph on
5962  string
5963 \end_layout
5964
5965 \begin_layout Standard
5966 For example, in order to map 
5967 \begin_inset Flex CharStyle:MenuItem
5968 status collapsed
5969
5970 \begin_layout PlainLayout
5971
5972 \shape up
5973
5974 \backslash
5975 '{e}
5976 \end_layout
5977
5978 \end_inset
5979
5980  to the corresponding character in the iso-8859-1 set (233), the following
5981  declaration is used
5982 \end_layout
5983
5984 \begin_layout LyX-Code
5985 233 "
5986 \backslash
5987
5988 \backslash
5989 '{e}"
5990 \end_layout
5991
5992 \begin_layout Standard
5993 with 
5994 \begin_inset Flex CharStyle:Code
5995 status collapsed
5996
5997 \begin_layout PlainLayout
5998
5999 \backslash
6000
6001 \end_layout
6002
6003 \end_inset
6004
6005  and 
6006 \begin_inset Flex CharStyle:Code
6007 status collapsed
6008
6009 \begin_layout PlainLayout
6010 "
6011 \end_layout
6012
6013 \end_inset
6014
6015  being escap
6016 \family roman
6017 ed in
6018 \family default
6019  
6020 \family roman
6021 \emph on
6022 string
6023 \emph default
6024 .
6025  Note that
6026 \family default
6027  the same character can apply to more than one string.
6028  In the 
6029 \begin_inset Flex CharStyle:Code
6030 status collapsed
6031
6032 \begin_layout PlainLayout
6033 i
6034 \shape up
6035 so-8859-7.cdef
6036 \end_layout
6037
6038 \end_inset
6039
6040  file you have
6041 \end_layout
6042
6043 \begin_layout LyX-Code
6044 192 "
6045 \backslash
6046
6047 \backslash
6048 '{
6049 \backslash
6050
6051 \backslash
6052
6053 \backslash
6054 "{i}}"
6055 \newline
6056 192 "
6057 \backslash
6058
6059 \backslash
6060
6061 \backslash
6062 "{
6063 \backslash
6064
6065 \backslash
6066 '{i}}"
6067 \end_layout
6068
6069 \begin_layout Standard
6070 If LyX cannot find a mapping for the string produced by the keystroke or
6071  a deadkey sequence, it will check if it looks like an accented char and
6072  try to draw an accent over the character on screen.
6073 \end_layout
6074
6075 \begin_layout Subsection
6076 Dead Keys
6077 \end_layout
6078
6079 \begin_layout Standard
6080 There is a second way to add support for international characters through
6081  so-called dead-keys.
6082  A dead-key works in combination with a letter to produce an accented character.
6083  Here, we'll explain how to create a really simple dead-key to illustrate
6084  how they work.
6085 \end_layout
6086
6087 \begin_layout Standard
6088 Suppose you happen to need the circumflex character, 
6089 \begin_inset Quotes eld
6090 \end_inset
6091
6092  ̂
6093 \begin_inset Quotes erd
6094 \end_inset
6095
6096 .
6097  You could bind the 
6098 \begin_inset Flex CharStyle:MenuItem
6099 status collapsed
6100
6101 \begin_layout PlainLayout
6102 ^
6103 \end_layout
6104
6105 \end_inset
6106
6107 -key [a.k.a.
6108 \begin_inset Space ~
6109 \end_inset
6110
6111
6112 \begin_inset Flex CharStyle:MenuItem
6113 status collapsed
6114
6115 \begin_layout PlainLayout
6116 Shift-6
6117 \end_layout
6118
6119 \end_inset
6120
6121 ] to the LyX command 
6122 \begin_inset Flex CharStyle:Code
6123 status collapsed
6124
6125 \begin_layout PlainLayout
6126 accent-circumflex
6127 \end_layout
6128
6129 \end_inset
6130
6131  in your 
6132 \begin_inset Flex CharStyle:Code
6133 status collapsed
6134
6135 \begin_layout PlainLayout
6136 lyxrc
6137 \end_layout
6138
6139 \end_inset
6140
6141  file.
6142  Now, whenever you type the 
6143 \begin_inset Flex CharStyle:MenuItem
6144 status collapsed
6145
6146 \begin_layout PlainLayout
6147 ^
6148 \end_layout
6149
6150 \end_inset
6151
6152 -key followed by a letter, that letter will have a circumflex accent on
6153  it.
6154  For example, the sequence 
6155 \begin_inset Quotes eld
6156 \end_inset
6157
6158
6159 \begin_inset Flex CharStyle:MenuItem
6160 status collapsed
6161
6162 \begin_layout PlainLayout
6163 ^e
6164 \end_layout
6165
6166 \end_inset
6167
6168
6169 \begin_inset Quotes erd
6170 \end_inset
6171
6172  produces the letter: 
6173 \begin_inset Quotes eld
6174 \end_inset
6175
6176 ê
6177 \begin_inset Quotes erd
6178 \end_inset
6179
6180 .
6181  If you tried to type 
6182 \begin_inset Quotes eld
6183 \end_inset
6184
6185
6186 \begin_inset Flex CharStyle:MenuItem
6187 status collapsed
6188
6189 \begin_layout PlainLayout
6190 ^t
6191 \end_layout
6192
6193 \end_inset
6194
6195
6196 \begin_inset Quotes erd
6197 \end_inset
6198
6199 , however, LyX will complain with a beep, since a 
6200 \begin_inset Quotes eld
6201 \end_inset
6202
6203
6204 \begin_inset Flex CharStyle:MenuItem
6205 status collapsed
6206
6207 \begin_layout PlainLayout
6208 t
6209 \end_layout
6210
6211 \end_inset
6212
6213
6214 \begin_inset Quotes erd
6215 \end_inset
6216
6217  never takes a circumflex accent.
6218  Hitting 
6219 \begin_inset Flex CharStyle:MenuItem
6220 status collapsed
6221
6222 \begin_layout PlainLayout
6223 Space
6224 \end_layout
6225
6226 \end_inset
6227
6228  after a dead-key produces the bare-accent.
6229  Please note this last point! If you bind a key to a dead-key, you'll need
6230  to rebind the character on that key to yet another key.
6231  Binding the 
6232 \begin_inset Flex CharStyle:MenuItem
6233 status collapsed
6234
6235 \begin_layout PlainLayout
6236 ,-key
6237 \end_layout
6238
6239 \end_inset
6240
6241  to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
6242 \end_layout
6243
6244 \begin_layout Standard
6245 One common way to bind dead-keys is to use 
6246 \begin_inset Flex CharStyle:MenuItem
6247 status collapsed
6248
6249 \begin_layout PlainLayout
6250 Meta-
6251 \end_layout
6252
6253 \end_inset
6254
6255
6256 \begin_inset Flex CharStyle:MenuItem
6257 status collapsed
6258
6259 \begin_layout PlainLayout
6260 Ctrl-
6261 \end_layout
6262
6263 \end_inset
6264
6265 , and 
6266 \begin_inset Flex CharStyle:MenuItem
6267 status collapsed
6268
6269 \begin_layout PlainLayout
6270 Shift-
6271 \end_layout
6272
6273 \end_inset
6274
6275  in combination with an accent, like 
6276 \begin_inset Quotes eld
6277 \end_inset
6278
6279
6280 \begin_inset Flex CharStyle:MenuItem
6281 status collapsed
6282
6283 \begin_layout PlainLayout
6284 ~
6285 \end_layout
6286
6287 \end_inset
6288
6289
6290 \begin_inset Quotes erd
6291 \end_inset
6292
6293  or 
6294 \begin_inset Quotes eld
6295 \end_inset
6296
6297
6298 \begin_inset Flex CharStyle:MenuItem
6299 status collapsed
6300
6301 \begin_layout PlainLayout
6302 ,
6303 \end_layout
6304
6305 \end_inset
6306
6307
6308 \begin_inset Quotes erd
6309 \end_inset
6310
6311  or 
6312 \begin_inset Quotes eld
6313 \end_inset
6314
6315
6316 \begin_inset Flex CharStyle:MenuItem
6317 status collapsed
6318
6319 \begin_layout PlainLayout
6320 ^
6321 \end_layout
6322
6323 \end_inset
6324
6325
6326 \begin_inset Quotes erd
6327 \end_inset
6328
6329 .
6330  Another way involves using 
6331 \begin_inset Flex CharStyle:Code
6332 status collapsed
6333
6334 \begin_layout PlainLayout
6335 xmodmap
6336 \end_layout
6337
6338 \end_inset
6339
6340  and 
6341 \begin_inset Flex CharStyle:Code
6342 status collapsed
6343
6344 \begin_layout PlainLayout
6345 xkeycaps
6346 \end_layout
6347
6348 \end_inset
6349
6350   to set up the special 
6351 \begin_inset Flex CharStyle:Code
6352 status collapsed
6353
6354 \begin_layout PlainLayout
6355 Mode_Switch
6356 \end_layout
6357
6358 \end_inset
6359
6360  key.
6361  The 
6362 \begin_inset Flex CharStyle:Code
6363 status collapsed
6364
6365 \begin_layout PlainLayout
6366 Mode_Switch
6367 \end_layout
6368
6369 \end_inset
6370
6371  acts in some ways just like 
6372 \begin_inset Flex CharStyle:MenuItem
6373 status collapsed
6374
6375 \begin_layout PlainLayout
6376 Shift
6377 \end_layout
6378
6379 \end_inset
6380
6381  and permits you to bind keys to accented characters.
6382  You can also turn keys into dead-keys by binding them to something like
6383  
6384 \begin_inset Flex CharStyle:Code
6385 status collapsed
6386
6387 \begin_layout PlainLayout
6388 usldead_cedilla
6389 \end_layout
6390
6391 \end_inset
6392
6393  and then binding this symbolic key to the corresponding LyX command.
6394 \begin_inset Foot
6395 status collapsed
6396
6397 \begin_layout PlainLayout
6398 Note from 
6399 \noun on
6400 John Weiss
6401 \noun default
6402 : This is exactly what I do in my 
6403 \begin_inset Flex CharStyle:Code
6404 status collapsed
6405
6406 \begin_layout PlainLayout
6407 ~/.lyx/lyxrc
6408 \end_layout
6409
6410 \end_inset
6411
6412  and my 
6413 \begin_inset Flex CharStyle:Code
6414 status collapsed
6415
6416 \begin_layout PlainLayout
6417 ~/.xmodmap
6418 \end_layout
6419
6420 \end_inset
6421
6422  files.
6423  I have my 
6424 \begin_inset Flex CharStyle:MenuItem
6425 status collapsed
6426
6427 \begin_layout PlainLayout
6428 Scroll
6429 \begin_inset Space ~
6430 \end_inset
6431
6432 Lock
6433 \end_layout
6434
6435 \end_inset
6436
6437  key set up as 
6438 \begin_inset Flex CharStyle:Code
6439 status collapsed
6440
6441 \begin_layout PlainLayout
6442 Mode_Shift
6443 \end_layout
6444
6445 \end_inset
6446
6447  and a bunch of these 
6448 \begin_inset Quotes eld
6449 \end_inset
6450
6451
6452 \begin_inset Flex CharStyle:Code
6453 status collapsed
6454
6455 \begin_layout PlainLayout
6456 usldead_*
6457 \end_layout
6458
6459 \end_inset
6460
6461
6462 \begin_inset Quotes erd
6463 \end_inset
6464
6465  symbolic keys bound such things as 
6466 \begin_inset Flex CharStyle:MenuItem
6467 status collapsed
6468
6469 \begin_layout PlainLayout
6470 Scroll
6471 \begin_inset Space ~
6472 \end_inset
6473
6474 Lock-^
6475 \end_layout
6476
6477 \end_inset
6478
6479  and 
6480 \begin_inset Flex CharStyle:MenuItem
6481 status collapsed
6482
6483 \begin_layout PlainLayout
6484 Scroll
6485 \begin_inset Space ~
6486 \end_inset
6487
6488 Lock-~
6489 \end_layout
6490
6491 \end_inset
6492
6493 .
6494  This is how I produce my accented characters.
6495 \end_layout
6496
6497 \end_inset
6498
6499  You can make just about anything into the 
6500 \begin_inset Flex CharStyle:Code
6501 status collapsed
6502
6503 \begin_layout PlainLayout
6504 Mode_Switch
6505 \end_layout
6506
6507 \end_inset
6508
6509  key: One of the 
6510 \begin_inset Flex CharStyle:MenuItem
6511 status collapsed
6512
6513 \begin_layout PlainLayout
6514 Ctrl-
6515 \end_layout
6516
6517 \end_inset
6518
6519  keys, a spare function key, etc.
6520  As for the LyX commands that produce accents, check the entry for 
6521 \begin_inset Flex CharStyle:Code
6522 status collapsed
6523
6524 \begin_layout PlainLayout
6525 accent-acute
6526 \end_layout
6527
6528 \end_inset
6529
6530  in the 
6531 \emph on
6532 Reference Manual
6533 \emph default
6534 .
6535  You'll find the complete list there.
6536 \end_layout
6537
6538 \begin_layout Subsection
6539 Saving your Language Configuration
6540 \end_layout
6541
6542 \begin_layout Standard
6543 \begin_inset CommandInset label
6544 LatexCommand label
6545 name "sec:savlang"
6546
6547 \end_inset
6548
6549 You can edit your preferences so that your desired language environment
6550  is automatically configured when LyX starts up, via the 
6551 \begin_inset Flex CharStyle:MenuItem
6552 status collapsed
6553
6554 \begin_layout PlainLayout
6555
6556 \bar under
6557 E
6558 \bar default
6559 dit\SpecialChar \menuseparator
6560
6561 \bar under
6562 P
6563 \bar default
6564 references
6565 \end_layout
6566
6567 \end_inset
6568
6569  dialog.
6570 \end_layout
6571
6572 \begin_layout Chapter
6573 Installing New Document Classes, Layouts, and Templates 
6574 \begin_inset CommandInset label
6575 LatexCommand label
6576 name "chap:textclass"
6577
6578 \end_inset
6579
6580
6581 \begin_inset OptArg
6582 status collapsed
6583
6584 \begin_layout PlainLayout
6585 Installing New Document Classes
6586 \end_layout
6587
6588 \end_inset
6589
6590
6591 \end_layout
6592
6593 \begin_layout Standard
6594 In this chapter, we describe the procedures for creating and installing
6595  new LyX layout and template files, as well as offer a refresher on correctly
6596  installing new LaTeX document classes.
6597  Some definitions: a document class is a LaTeX file (usually ending in 
6598 \begin_inset Flex CharStyle:Code
6599 status collapsed
6600
6601 \begin_layout PlainLayout
6602 .cls
6603 \end_layout
6604
6605 \end_inset
6606
6607  or 
6608 \begin_inset Flex CharStyle:Code
6609 status collapsed
6610
6611 \begin_layout PlainLayout
6612 .sty
6613 \end_layout
6614
6615 \end_inset
6616
6617 ) that describes the format of a document such as an article, report, journal
6618  preprint, etc, and all the commands needed to realize that format.
6619  A layout file is a LyX file that corresponds to a LaTeX document class
6620  and that tells LyX how to 
6621 \begin_inset Quotes eld
6622 \end_inset
6623
6624 draw
6625 \begin_inset Quotes erd
6626 \end_inset
6627
6628  things on the screen to make the display look something like the final
6629  printed page.
6630  More precisely, a layout file describes a 
6631 \begin_inset Quotes eld
6632 \end_inset
6633
6634 text class
6635 \begin_inset Quotes erd
6636 \end_inset
6637
6638  which is the internal construct LyX uses to render the screen display.
6639  
6640 \begin_inset Quotes eld
6641 \end_inset
6642
6643 Layout
6644 \begin_inset Quotes erd
6645 \end_inset
6646
6647  and 
6648 \begin_inset Quotes eld
6649 \end_inset
6650
6651 text class
6652 \begin_inset Quotes erd
6653 \end_inset
6654
6655  can be used somewhat interchangeably, but it is better to refer to the
6656  file as the layout, and the thing living in LyX's memory as the text class.
6657  A template file is simply a LyX document that contains a set of predefined
6658  entries for a given document class---entries that are generally required
6659  for that class.
6660  Templates are especially useful for things like journal manuscripts that
6661  are to be submitted electronically.
6662 \end_layout
6663
6664 \begin_layout Section
6665 Installing a new LaTeX package
6666 \end_layout
6667
6668 \begin_layout Standard
6669 Some installations may not include a LaTeX package that you would like to
6670  use within LyX.
6671  For example, you might need FoilTeX, a common (and very powerful) package
6672  for preparing slides or viewgraphs for overhead projectors.
6673  On some systems, you may have a GUI for installing such packages: MikTeX
6674  on Windows®, for example.
6675 \end_layout
6676
6677 \begin_layout Standard
6678 If you don't have such a GUI, then you can follow these steps.
6679 \end_layout
6680
6681 \begin_layout Enumerate
6682 Get the package from 
6683 \begin_inset CommandInset href
6684 LatexCommand href
6685 name "CTAN"
6686 target "http://www.ctan.org/"
6687
6688 \end_inset
6689
6690  or wherever.
6691 \end_layout
6692
6693 \begin_layout Enumerate
6694 You can install this package in several different places.
6695  If you want it to be available for all users on your system, then you should
6696  install it in your `local' TeX tree; if you want (or need) it to be available
6697  just for you, then you can install it in your own `user' TeX tree.
6698  Where these should be created, if they do not already exist, depends upon
6699  the details of your system.
6700  To find out, look in the file 
6701 \begin_inset Flex CharStyle:Code
6702 status collapsed
6703
6704 \begin_layout PlainLayout
6705 texmf.cnf
6706 \end_layout
6707
6708 \end_inset
6709
6710 .
6711 \begin_inset Foot
6712 status collapsed
6713
6714 \begin_layout PlainLayout
6715 This usually lives in the directory 
6716 \begin_inset Flex CharStyle:Code
6717 status collapsed
6718
6719 \begin_layout PlainLayout
6720 $TEXMF/web2c
6721 \end_layout
6722
6723 \end_inset
6724
6725 , though you can run 
6726 \begin_inset Flex CharStyle:Code
6727 status collapsed
6728
6729 \begin_layout PlainLayout
6730 kpsewhich texmf.cnf
6731 \end_layout
6732
6733 \end_inset
6734
6735  to locate it.
6736 \end_layout
6737
6738 \end_inset
6739
6740  The location of the `local' TeX tree is defined by 
6741 \begin_inset Flex CharStyle:Code
6742 status collapsed
6743
6744 \begin_layout PlainLayout
6745 TEXMFLOCAL
6746 \end_layout
6747
6748 \end_inset
6749
6750 ; this is usually somewhere like 
6751 \begin_inset Flex CharStyle:Code
6752 status collapsed
6753
6754 \begin_layout PlainLayout
6755 /usr/local/share/texmf/
6756 \end_layout
6757
6758 \end_inset
6759
6760 .
6761  The `user' TeX tree is defined by 
6762 \begin_inset Flex CharStyle:Code
6763 status collapsed
6764
6765 \begin_layout PlainLayout
6766 TEXMFHOME
6767 \end_layout
6768
6769 \end_inset
6770
6771  and is commonly at 
6772 \begin_inset Flex CharStyle:Code
6773 status collapsed
6774
6775 \begin_layout PlainLayout
6776 $HOME/texmf/
6777 \end_layout
6778
6779 \end_inset
6780
6781 .
6782  (If these variables are not predefined, you can define them.) You'll probably
6783  need root permissions to create or modify the `local' tree; but your `user'
6784  tree shouldn't have such limitations.
6785 \end_layout
6786
6787 \begin_layout Enumerate
6788 Make sure 
6789 \begin_inset Flex CharStyle:Code
6790 status collapsed
6791
6792 \begin_layout PlainLayout
6793 TEXMF
6794 \end_layout
6795
6796 \end_inset
6797
6798  includes the 
6799 \begin_inset Flex CharStyle:Code
6800 status collapsed
6801
6802 \begin_layout PlainLayout
6803 TEXMFLOCAL
6804 \end_layout
6805
6806 \end_inset
6807
6808  and 
6809 \begin_inset Flex CharStyle:Code
6810 status collapsed
6811
6812 \begin_layout PlainLayout
6813 TEXMFHOME
6814 \end_layout
6815
6816 \end_inset
6817
6818  variables; e.g.
6819  
6820 \newline
6821
6822 \begin_inset Flex CharStyle:Code
6823 status collapsed
6824
6825 \begin_layout PlainLayout
6826 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
6827 \end_layout
6828
6829 \end_inset
6830
6831
6832 \newline
6833 But, again, most of this will 
6834 \begin_inset Quotes eld
6835 \end_inset
6836
6837 just work
6838 \begin_inset Quotes erd
6839 \end_inset
6840
6841 .
6842 \end_layout
6843
6844 \begin_layout Enumerate
6845 Create your local
6846 \begin_inset Foot
6847 status collapsed
6848
6849 \begin_layout PlainLayout
6850 We'll assume henceforth that you're defining `local' TeX tree.
6851  If you're defining a user tree, just adjust as necessary.
6852 \end_layout
6853
6854 \end_inset
6855
6856  TeX tree.
6857  You must follow the directory structure of your existing 
6858 \begin_inset Flex CharStyle:Code
6859 status collapsed
6860
6861 \begin_layout PlainLayout
6862 texmf
6863 \end_layout
6864
6865 \end_inset
6866
6867  directory, which will be found at 
6868 \begin_inset Flex CharStyle:Code
6869 status collapsed
6870
6871 \begin_layout PlainLayout
6872 TEXMFMAIN
6873 \end_layout
6874
6875 \end_inset
6876
6877 .
6878  For example, latex packages should go under 
6879 \begin_inset Flex CharStyle:Code
6880 status collapsed
6881
6882 \begin_layout PlainLayout
6883 $TEXMFLOCAL/tex/latex/
6884 \end_layout
6885
6886 \end_inset
6887
6888 .
6889 \end_layout
6890
6891 \begin_layout Enumerate
6892 Install the package.
6893  For example, you would unpack the FoilTeX tarball and copy it to 
6894 \begin_inset Flex CharStyle:Code
6895 status collapsed
6896
6897 \begin_layout PlainLayout
6898 $TEXMFLOCAL/tex/latex/foiltex
6899 \end_layout
6900
6901 \end_inset
6902
6903 .
6904  The 
6905 \begin_inset Flex CharStyle:Code
6906 status collapsed
6907
6908 \begin_layout PlainLayout
6909 foiltex
6910 \end_layout
6911
6912 \end_inset
6913
6914  directory contains various files.
6915 \end_layout
6916
6917 \begin_layout Enumerate
6918 Run: 
6919 \begin_inset Flex CharStyle:Code
6920 status collapsed
6921
6922 \begin_layout PlainLayout
6923 texhash
6924 \end_layout
6925
6926 \end_inset
6927
6928 .
6929  This should create 
6930 \begin_inset Flex CharStyle:Code
6931 status collapsed
6932
6933 \begin_layout PlainLayout
6934 $TEXMFLOCAL/ls-R
6935 \end_layout
6936
6937 \end_inset
6938
6939  amongst others.
6940 \end_layout
6941
6942 \begin_layout Standard
6943 Your package is now installed and available to LaTeX.
6944  To make it available to LyX, you need to create a Layout file, if one is
6945  not already available.
6946  (See the next section.) Once you have a layout file, you need only reconfigure
6947  (
6948 \begin_inset Flex CharStyle:MenuItem
6949 status collapsed
6950
6951 \begin_layout PlainLayout
6952
6953 \bar under
6954 T
6955 \bar default
6956 ools\SpecialChar \menuseparator
6957
6958 \bar under
6959 R
6960 \bar default
6961 econfigure
6962 \end_layout
6963
6964 \end_inset
6965
6966 ) and then restart LyX.
6967  You should then see your new package---for example 
6968 \begin_inset Flex CharStyle:MenuItem
6969 status collapsed
6970
6971 \begin_layout PlainLayout
6972 slides (FoilTeX)
6973 \end_layout
6974
6975 \end_inset
6976
6977 ---under 
6978 \begin_inset Flex CharStyle:MenuItem
6979 status collapsed
6980
6981 \begin_layout PlainLayout
6982
6983 \bar under
6984 D
6985 \bar default
6986 ocument\SpecialChar \menuseparator
6987
6988 \bar under
6989 S
6990 \bar default
6991 ettings
6992 \end_layout
6993
6994 \end_inset
6995
6996  in the 
6997 \begin_inset Flex CharStyle:MenuItem
6998 status collapsed
6999
7000 \begin_layout PlainLayout
7001 Document Class
7002 \end_layout
7003
7004 \end_inset
7005
7006  drop box.
7007  
7008 \end_layout
7009
7010 \begin_layout Section
7011 \begin_inset CommandInset label
7012 LatexCommand label
7013 name "sec:Layouts"
7014
7015 \end_inset
7016
7017 Layouts
7018 \end_layout
7019
7020 \begin_layout Standard
7021 This section describes how to write and install your own LyX layout files
7022  and walks through the 
7023 \begin_inset Flex CharStyle:Code
7024 status collapsed
7025
7026 \begin_layout PlainLayout
7027 article
7028 \end_layout
7029
7030 \end_inset
7031
7032  text class format as an example.
7033  The 
7034 \begin_inset Flex CharStyle:Code
7035 status collapsed
7036
7037 \begin_layout PlainLayout
7038 .layout
7039 \end_layout
7040
7041 \end_inset
7042
7043  files describe what paragraph and character styles are available for a
7044  given document class and how LyX should display them.
7045  We try to provide a thorough description of the process here; however,
7046  there are so many different types of documents supported by LaTeX classes
7047  that we can't hope to cover every different possibility or problem you
7048  might encounter.
7049  (The LyX users' list is frequented by people with lots of experience with
7050  layout design who are willing to share what they've learned.)
7051 \end_layout
7052
7053 \begin_layout Standard
7054 As you prepare to write a new layout, it is extremely helpful to look at
7055  the example layouts distributed with LyX.
7056  If you use a nice LaTeX document class that might be of interest for others,
7057  too, and have a nice corresponding LyX layout, feel free to contribute
7058  the stuff to us, so we may put it into the distribution.
7059  There is also a 
7060 \begin_inset CommandInset href
7061 LatexCommand href
7062 name "section on the LyX wiki"
7063 target "http://wiki.lyx.org/Layouts/Layouts"
7064
7065 \end_inset
7066
7067  for this kind of material.
7068 \end_layout
7069
7070 \begin_layout Standard
7071 All the tags described in this chapter are case-insensitive; this means
7072  that 
7073 \begin_inset Flex CharStyle:Code
7074 status collapsed
7075
7076 \begin_layout PlainLayout
7077 Style
7078 \end_layout
7079
7080 \end_inset
7081
7082
7083 \begin_inset Flex CharStyle:Code
7084 status collapsed
7085
7086 \begin_layout PlainLayout
7087 style
7088 \end_layout
7089
7090 \end_inset
7091
7092  and 
7093 \begin_inset Flex CharStyle:Code
7094 status collapsed
7095
7096 \begin_layout PlainLayout
7097 StYlE
7098 \end_layout
7099
7100 \end_inset
7101
7102  are really the same command.
7103  The possible values are printed in brackets after the feature's name.
7104  The default value if a feature isn't specified inside a text class-description
7105  is typeset 
7106 \begin_inset Flex CharStyle:Code
7107 status collapsed
7108
7109 \begin_layout PlainLayout
7110
7111 \emph on
7112 emphasized
7113 \end_layout
7114
7115 \end_inset
7116
7117 .
7118  If the argument has a datatype like 
7119 \begin_inset Quotes eld
7120 \end_inset
7121
7122 string
7123 \begin_inset Quotes erd
7124 \end_inset
7125
7126  or 
7127 \begin_inset Quotes eld
7128 \end_inset
7129
7130 float
7131 \begin_inset Quotes erd
7132 \end_inset
7133
7134 , the default is shown like this: 
7135 \begin_inset Flex CharStyle:Code
7136 status collapsed
7137
7138 \begin_layout PlainLayout
7139 float=
7140 \emph on
7141 default
7142 \end_layout
7143
7144 \end_inset
7145
7146 .
7147 \end_layout
7148
7149 \begin_layout Subsection
7150 \begin_inset CommandInset label
7151 LatexCommand label
7152 name "sub:Layout-modules"
7153
7154 \end_inset
7155
7156 Layout modules
7157 \end_layout
7158
7159 \begin_layout Standard
7160 Similar to layout files, and new with LyX 1.6, are layout 
7161 \emph on
7162 modules
7163 \emph default
7164 .
7165  Modules are to LaTeX packages much as layouts are to LaTeX classes, and
7166  some modules---such as the Endnotes module---provide support for just such
7167  a package.
7168  In a sense, layout modules are similar to included files---files like 
7169 \begin_inset Flex CharStyle:Code
7170 status collapsed
7171
7172 \begin_layout PlainLayout
7173 stdsections.inc
7174 \end_layout
7175
7176 \end_inset
7177
7178 ---in that modules are not specific to a given document layout but may be
7179  used with many different layouts.
7180  The difference is that using a layout module does not require editing the
7181  layout file.
7182  Rather, modules are selected in the 
7183 \begin_inset Flex CharStyle:MenuItem
7184 status collapsed
7185
7186 \begin_layout PlainLayout
7187
7188 \bar under
7189 D
7190 \bar default
7191 ocument\SpecialChar \menuseparator
7192
7193 \bar under
7194 S
7195 \bar default
7196 ettings
7197 \end_layout
7198
7199 \end_inset
7200
7201  dialog.
7202 \end_layout
7203
7204 \begin_layout Standard
7205 Building modules is the easiest way to get started with layout editing,
7206  since it can be as simple as adding a single new paragraph or flex inset.
7207  But modules may, in principle, contain anything a layout file can contain.
7208 \end_layout
7209
7210 \begin_layout Standard
7211 A module must begin with a line like the following:
7212 \end_layout
7213
7214 \begin_layout LyX-Code
7215 #
7216 \backslash
7217 DeclareLyXModule[endnotes.sty]{Endnotes} 
7218 \end_layout
7219
7220 \begin_layout Standard
7221 The argument in square brackets is optional: It declares any LaTeX packages
7222  on which the module depends.
7223  The mandatory argument, in curly brackets, is the name of the module, as
7224  it should appear in 
7225 \begin_inset Flex CharStyle:MenuItem
7226 status collapsed
7227
7228 \begin_layout PlainLayout
7229 Document\SpecialChar \menuseparator
7230 Settings
7231 \end_layout
7232
7233 \end_inset
7234
7235 .
7236  
7237 \end_layout
7238
7239 \begin_layout Standard
7240 The module declaration should then be followed by lines like the following:
7241 \end_layout
7242
7243 \begin_layout LyX-Code
7244 #DescriptionBegin 
7245 \end_layout
7246
7247 \begin_layout LyX-Code
7248 #Adds an endnote command, in addition to footnotes.
7249  
7250 \end_layout
7251
7252 \begin_layout LyX-Code
7253 #You will need to add  
7254 \backslash
7255 theendnotes in ERT where you 
7256 \end_layout
7257
7258 \begin_layout LyX-Code
7259 #want the endnotes to appear.
7260  
7261 \end_layout
7262
7263 \begin_layout LyX-Code
7264 #DescriptionEnd 
7265 \end_layout
7266
7267 \begin_layout LyX-Code
7268 #Requires: somemodule | othermodule
7269 \end_layout
7270
7271 \begin_layout LyX-Code
7272 #Excludes: badmodule
7273 \end_layout
7274
7275 \begin_layout Standard
7276 The description is used in 
7277 \begin_inset Flex CharStyle:MenuItem
7278 status collapsed
7279
7280 \begin_layout PlainLayout
7281 Document\SpecialChar \menuseparator
7282 Settings
7283 \end_layout
7284
7285 \end_inset
7286
7287  to provide the user with information about what the module does.
7288  The 
7289 \begin_inset Flex CharStyle:Code
7290 status collapsed
7291
7292 \begin_layout PlainLayout
7293 Requires
7294 \end_layout
7295
7296 \end_inset
7297
7298  line is used to identify other modules with which this one must be used;
7299  the 
7300 \begin_inset Flex CharStyle:Code
7301 status collapsed
7302
7303 \begin_layout PlainLayout
7304 Excludes
7305 \end_layout
7306
7307 \end_inset
7308
7309  line is used to identify modules with which this one may not be used.
7310  Both are optional, and, as shown, multiple modules should be separated
7311  with the pipe symbol: |.
7312  Note that the required modules are treated disjunctively: 
7313 \emph on
7314 at least one
7315 \emph default
7316  of the required modules must be used.
7317  Similarly, 
7318 \emph on
7319 no
7320 \emph default
7321  excluded module may be used.
7322  Note that modules are identified here by their 
7323 \emph on
7324 filenames
7325 \emph default
7326  without the .module extension.
7327  So 
7328 \begin_inset Flex CharStyle:Code
7329 status collapsed
7330
7331 \begin_layout PlainLayout
7332 somemodule
7333 \end_layout
7334
7335 \end_inset
7336
7337  is really 
7338 \begin_inset Flex CharStyle:Code
7339 status collapsed
7340
7341 \begin_layout PlainLayout
7342 somemodule.module
7343 \end_layout
7344
7345 \end_inset
7346
7347 .
7348 \end_layout
7349
7350 \begin_layout Standard
7351 After creating a new module, you will need to reconfigure and then restart
7352  LyX for the module to appear in the menu.
7353  However, changes you make to the module will be seen immediately, if you
7354  open 
7355 \begin_inset Flex CharStyle:MenuItem
7356 status collapsed
7357
7358 \begin_layout PlainLayout
7359 Document\SpecialChar \menuseparator
7360 Settings
7361 \end_layout
7362
7363 \end_inset
7364
7365 , highlight something, and then hit 
7366 \begin_inset Quotes eld
7367 \end_inset
7368
7369 OK
7370 \begin_inset Quotes erd
7371 \end_inset
7372
7373 .
7374  
7375 \emph on
7376 It is strongly recommended that you save your work before doing so
7377 \emph default
7378 .
7379  In fact, 
7380 \emph on
7381 it is strongly recommended that you not attempt to edit modules while simultaneo
7382 usly working on documents
7383 \emph default
7384 .
7385  Though of course the developers strive to keep LyX stable in such situations,
7386  syntax errors and the like in your module file could cause strange behavior.
7387 \end_layout
7388
7389 \begin_layout Subsection
7390 Supporting new document classes
7391 \end_layout
7392
7393 \begin_layout Standard
7394 There are two situations you are likely to encounter when wanting to support
7395  a new LaTeX document class, involving LaTeX2e class (
7396 \begin_inset Flex CharStyle:Code
7397 status collapsed
7398
7399 \begin_layout PlainLayout
7400 .cls
7401 \end_layout
7402
7403 \end_inset
7404
7405 ) and style (
7406 \begin_inset Flex CharStyle:Code
7407 status collapsed
7408
7409 \begin_layout PlainLayout
7410 .sty
7411 \end_layout
7412
7413 \end_inset
7414
7415 ) files.
7416  Supporting a style file is usually fairly easy.
7417  Supporting a new document class is a bit harder.
7418 \end_layout
7419
7420 \begin_layout Subsection
7421 A layout for a 
7422 \begin_inset Flex CharStyle:MenuItem
7423 status collapsed
7424
7425 \begin_layout PlainLayout
7426 sty
7427 \end_layout
7428
7429 \end_inset
7430
7431  file
7432 \end_layout
7433
7434 \begin_layout Standard
7435 If your new document class is provided as a style file that is used in conjuncti
7436 on with an existing, supported document class---for the sake of the example,
7437  we'll assume that the style file is called 
7438 \begin_inset Flex CharStyle:MenuItem
7439 status collapsed
7440
7441 \begin_layout PlainLayout
7442 myclass.sty
7443 \end_layout
7444
7445 \end_inset
7446
7447  and it is meant to be used with 
7448 \begin_inset Flex CharStyle:MenuItem
7449 status collapsed
7450
7451 \begin_layout PlainLayout
7452 report.cls
7453 \end_layout
7454
7455 \end_inset
7456
7457 , which is a standard class---start by copying the existing class's layout
7458  file into your local directory:
7459 \end_layout
7460
7461 \begin_layout LyX-Code
7462 cp report.layout ~/.lyx/layouts/myclass.layout
7463 \end_layout
7464
7465 \begin_layout Standard
7466 Then edit 
7467 \begin_inset Flex CharStyle:Code
7468 status collapsed
7469
7470 \begin_layout PlainLayout
7471 myclass.layout
7472 \end_layout
7473
7474 \end_inset
7475
7476  and change the line: 
7477 \end_layout
7478
7479 \begin_layout LyX-Code
7480
7481 \backslash
7482 DeclareLaTeXClass{report}
7483 \end_layout
7484
7485 \begin_layout Standard
7486 to read
7487 \end_layout
7488
7489 \begin_layout LyX-Code
7490
7491 \backslash
7492 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
7493 \end_layout
7494
7495 \begin_layout Standard
7496 Then add:
7497 \end_layout
7498
7499 \begin_layout LyX-Code
7500 Preamble 
7501 \newline
7502     
7503 \backslash
7504 usepackage{myclass}
7505 \newline
7506 EndPreamble
7507 \end_layout
7508
7509 \begin_layout Standard
7510 near the top of the file.
7511 \end_layout
7512
7513 \begin_layout Standard
7514 Start LyX and select 
7515 \begin_inset Flex CharStyle:MenuItem
7516 status collapsed
7517
7518 \begin_layout PlainLayout
7519
7520 \bar under
7521 T
7522 \bar default
7523 ools\SpecialChar \menuseparator
7524
7525 \bar under
7526 R
7527 \bar default
7528 econfigure
7529 \end_layout
7530
7531 \end_inset
7532
7533 .
7534  Then restart LyX and try creating a new document.
7535  You should see "
7536 \begin_inset Flex CharStyle:MenuItem
7537 status collapsed
7538
7539 \begin_layout PlainLayout
7540 report (myclass)
7541 \end_layout
7542
7543 \end_inset
7544
7545 " as a document class option in the 
7546 \begin_inset Flex CharStyle:MenuItem
7547 status collapsed
7548
7549 \begin_layout PlainLayout
7550
7551 \bar under
7552 D
7553 \bar default
7554 ocument\SpecialChar \menuseparator
7555
7556 \bar under
7557 S
7558 \bar default
7559 ettings
7560 \end_layout
7561
7562 \end_inset
7563
7564  dialog.
7565  It is likely that some of the sectioning commands and such in your new
7566  class will work differently from how they worked in the base class---
7567 \begin_inset Flex CharStyle:Code
7568 status collapsed
7569
7570 \begin_layout PlainLayout
7571 report
7572 \end_layout
7573
7574 \end_inset
7575
7576  in this example---so you can fiddle around with the settings for the different
7577  sections if you wish.
7578 \end_layout
7579
7580 \begin_layout Subsection
7581 Layout for a 
7582 \begin_inset Flex CharStyle:MenuItem
7583 status collapsed
7584
7585 \begin_layout PlainLayout
7586 cls
7587 \end_layout
7588
7589 \end_inset
7590
7591  file
7592 \end_layout
7593
7594 \begin_layout Standard
7595 There are two possibilities here.
7596  One is that the class file is itself based upon an existing document class.
7597  For example, many thesis classes are based upon 
7598 \begin_inset Flex CharStyle:MenuItem
7599 status collapsed
7600
7601 \begin_layout PlainLayout
7602 book.cls
7603 \end_layout
7604
7605 \end_inset
7606
7607 .
7608  To see whether yours is, look for a line like
7609 \end_layout
7610
7611 \begin_layout LyX-Code
7612
7613 \backslash
7614 LoadClass{book}
7615 \end_layout
7616
7617 \begin_layout Standard
7618 in the file.
7619  If so, then you may proceed largely as in the previous section, though
7620  the DeclareLaTeXClass line will be different.
7621  If your new class is thesis, and it is based upon book, then the line should
7622  read:
7623 \begin_inset Foot
7624 status collapsed
7625
7626 \begin_layout PlainLayout
7627 And it will be easiest if you save the file to 
7628 \begin_inset Flex CharStyle:Code
7629 status collapsed
7630
7631 \begin_layout PlainLayout
7632 thesis.layout
7633 \end_layout
7634
7635 \end_inset
7636
7637 : LyX assumes that the document class has the same name as the layout file.
7638  
7639 \end_layout
7640
7641 \end_inset
7642
7643
7644 \end_layout
7645
7646 \begin_layout LyX-Code
7647
7648 \backslash
7649 DeclareLaTeXClass[thesis,book]{thesis}
7650 \end_layout
7651
7652 \begin_layout Standard
7653 If, on the other hand, the new class is not based upon an existing class,
7654  you will probably have to 
7655 \begin_inset Quotes eld
7656 \end_inset
7657
7658 roll your own
7659 \begin_inset Quotes erd
7660 \end_inset
7661
7662  layout.
7663  We strongly suggest copying an existing layout file which uses a similar
7664  LaTeX class and then modifying it, if you can do so.
7665  At least use an existing file as a starting point so you can find out what
7666  items you need to worry about.
7667  Again, the specifics are covered below.
7668 \end_layout
7669
7670 \begin_layout Section
7671 Declaring a new text class
7672 \end_layout
7673
7674 \begin_layout Standard
7675 When it's finally time to get your hands dirty and create or edit your own
7676  layout file, the following sections describe what you're up against.
7677  Our advice is to go slowly, save and test often, listen to soothing music,
7678  and enjoy one or two of your favorite adult beverages; more if you are
7679  getting particularly stuck.
7680  It's really not that hard, except that the multitude of options can become
7681  overwhelming if you try to do to much in one sitting.
7682  Go have another adult beverage, just for good measure.
7683 \end_layout
7684
7685 \begin_layout Standard
7686 Here we go!
7687 \end_layout
7688
7689 \begin_layout Standard
7690 Lines in a layout file which begin with a 
7691 \begin_inset Flex CharStyle:Code
7692 status collapsed
7693
7694 \begin_layout PlainLayout
7695 #
7696 \end_layout
7697
7698 \end_inset
7699
7700  are comments.
7701  There is one exception to this rule: all layouts should begin with lines
7702  like:
7703 \end_layout
7704
7705 \begin_layout LyX-Code
7706
7707 \size small
7708 #% Do not delete the line below; configure depends on this 
7709 \end_layout
7710
7711 \begin_layout LyX-Code
7712
7713 \size small
7714 #  
7715 \backslash
7716 DeclareLaTeXClass{article}
7717 \end_layout
7718
7719 \begin_layout Standard
7720 The second line is used when you configure LyX.
7721  The layout file is read by the LaTeX script 
7722 \begin_inset Flex CharStyle:Code
7723 status collapsed
7724
7725 \begin_layout PlainLayout
7726 chkconfig.ltx
7727 \end_layout
7728
7729 \end_inset
7730
7731 , in a special mode where 
7732 \begin_inset Flex CharStyle:Code
7733 status collapsed
7734
7735 \begin_layout PlainLayout
7736 #
7737 \end_layout
7738
7739 \end_inset
7740
7741  is ignored.
7742  The first line is just a LaTeX comment, and the second one contains the
7743  declaration of the text class.
7744  If these lines appear in a file named 
7745 \begin_inset Flex CharStyle:Code
7746 status collapsed
7747
7748 \begin_layout PlainLayout
7749 article.layout
7750 \end_layout
7751
7752 \end_inset
7753
7754 , then they define a text class of name 
7755 \begin_inset Flex CharStyle:Code
7756 status collapsed
7757
7758 \begin_layout PlainLayout
7759 article
7760 \end_layout
7761
7762 \end_inset
7763
7764  (the name of the layout file) which uses the LaTeX document class 
7765 \begin_inset Flex CharStyle:Code
7766 status collapsed
7767
7768 \begin_layout PlainLayout
7769 article.cls
7770 \end_layout
7771
7772 \end_inset
7773
7774  (the default is to use the same name as the layout).
7775  The string 
7776 \begin_inset Quotes eld
7777 \end_inset
7778
7779 article
7780 \begin_inset Quotes erd
7781 \end_inset
7782
7783  that appears above is used as a description of the text class in the 
7784 \begin_inset Flex CharStyle:MenuItem
7785 status collapsed
7786
7787 \begin_layout PlainLayout
7788
7789 \bar under
7790 D
7791 \bar default
7792 ocument\SpecialChar \menuseparator
7793
7794 \bar under
7795 S
7796 \bar default
7797 ettings
7798 \end_layout
7799
7800 \end_inset
7801
7802  dialog.
7803 \end_layout
7804
7805 \begin_layout Standard
7806 Let's assume that you wrote your own text class that uses the 
7807 \begin_inset Flex CharStyle:Code
7808 status collapsed
7809
7810 \begin_layout PlainLayout
7811 article.cls
7812 \end_layout
7813
7814 \end_inset
7815
7816  document class, but where you changed the appearance of the section headings.
7817  If you put it in a file 
7818 \begin_inset Flex CharStyle:Code
7819 status collapsed
7820
7821 \begin_layout PlainLayout
7822 myarticle.layout
7823 \end_layout
7824
7825 \end_inset
7826
7827 , the header of this file should be:
7828 \end_layout
7829
7830 \begin_layout LyX-Code
7831
7832 \size small
7833 #% Do not delete the line below; configure depends on this 
7834 \end_layout
7835
7836 \begin_layout LyX-Code
7837
7838 \size small
7839 #  
7840 \backslash
7841 DeclareLaTeXClass[article]{article (with my own headings)}
7842 \end_layout
7843
7844 \begin_layout Standard
7845 This declares a text class 
7846 \begin_inset Flex CharStyle:Code
7847 status collapsed
7848
7849 \begin_layout PlainLayout
7850 myarticle
7851 \end_layout
7852
7853 \end_inset
7854
7855 , associated with the LaTeX document class 
7856 \begin_inset Flex CharStyle:Code
7857 status collapsed
7858
7859 \begin_layout PlainLayout
7860 article.cls
7861 \end_layout
7862
7863 \end_inset
7864
7865  and described as 
7866 \begin_inset Quotes eld
7867 \end_inset
7868
7869 article (with my own headings)
7870 \begin_inset Quotes erd
7871 \end_inset
7872
7873 .
7874  If your text class depends on several packages, you can declare it as:
7875 \end_layout
7876
7877 \begin_layout LyX-Code
7878
7879 \size small
7880 #% Do not delete the line below; configure depends on this 
7881 \end_layout
7882
7883 \begin_layout LyX-Code
7884
7885 \size small
7886 #  
7887 \backslash
7888 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7889 \end_layout
7890
7891 \begin_layout Standard
7892 This indicates that your text class uses the foo.sty package.
7893  Finally, it is also possible to declare classes for DocBook code.
7894  Typical declarations will look like
7895 \end_layout
7896
7897 \begin_layout LyX-Code
7898
7899 \size small
7900 #% Do not delete the line below; configure depends on this 
7901 \end_layout
7902
7903 \begin_layout LyX-Code
7904
7905 \size small
7906
7907 \backslash
7908 DeclareDocBookClass[article]{SGML (DocBook article)}
7909 \end_layout
7910
7911 \begin_layout Standard
7912 Note that these declarations can also be given an optional parameter declaring
7913  the name of the document class (but not a list).
7914 \end_layout
7915
7916 \begin_layout Standard
7917 So, to be as explicit as possible, the form of the layout declaration is:
7918 \end_layout
7919
7920 \begin_layout LyX-Code
7921
7922 \size small
7923 #  
7924 \backslash
7925 DeclareLaTeXClass[class,package.sty]{layout description}
7926 \end_layout
7927
7928 \begin_layout Standard
7929 The class need only be specified if the name of the LaTeX class file and
7930  the name of the layout file are different; if the name of the classfile
7931  is not specified, then LyX will simply assume that it is the same as the
7932  name of the layout file.
7933 \end_layout
7934
7935 \begin_layout Standard
7936 When the text class has been modified to your taste, all you have to do
7937  is to copy it either to 
7938 \begin_inset Flex CharStyle:Code
7939 status collapsed
7940
7941 \begin_layout PlainLayout
7942 LyXDir/layouts/
7943 \end_layout
7944
7945 \end_inset
7946
7947  or to 
7948 \begin_inset Flex CharStyle:Code
7949 status collapsed
7950
7951 \begin_layout PlainLayout
7952 UserDir/layouts
7953 \end_layout
7954
7955 \end_inset
7956
7957 , run 
7958 \begin_inset Flex CharStyle:MenuItem
7959 status collapsed
7960
7961 \begin_layout PlainLayout
7962
7963 \bar under
7964 T
7965 \bar default
7966 ools\SpecialChar \menuseparator
7967
7968 \bar under
7969 R
7970 \bar default
7971 econfigure
7972 \end_layout
7973
7974 \end_inset
7975
7976 , exit LyX and restart it.
7977  Then your new text class should be available along with the others.
7978 \end_layout
7979
7980 \begin_layout Standard
7981 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
7982  you made to your layout files.
7983  As a result, editing layout files could be very time consuming.
7984  Beginning with 1.6, however, you can force a reload of the layout currently
7985  in use by using the LyX function 
7986 \begin_inset Flex CharStyle:MenuItem
7987 status collapsed
7988
7989 \begin_layout PlainLayout
7990 layout-reload
7991 \end_layout
7992
7993 \end_inset
7994
7995 .
7996  There is no default binding for this function---though, of course, you
7997  can bind it to a key yourself (see section 
7998 \begin_inset CommandInset ref
7999 LatexCommand ref
8000 reference "sec:bindings"
8001
8002 \end_inset
8003
8004 ).
8005  If you want to use this function, then, you should simply enter it in the
8006  mini-buffer.
8007  
8008 \emph on
8009 Warning
8010 \emph default
8011 : This is very much an `advanced feature'.
8012  It is 
8013 \emph on
8014 strongly
8015 \emph default
8016  recommended that you save your work before using this function.
8017  In fact, it is 
8018 \emph on
8019 strongly
8020 \emph default
8021  recommended that you not attempt to edit your layout while simultaneously
8022  working on a document that you care about.
8023  Use a test document.
8024  Syntax errors and the like in your layout file could cause peculiar behavior.
8025  In particular, such errors could cause LyX to regard the current layout
8026  as invalid and to attempt to switch to some other layout.
8027  The LyX team strives to keep LyX stable in such situations, but safe is
8028  better than sorry.
8029 \end_layout
8030
8031 \begin_layout Subsection
8032 File format
8033 \end_layout
8034
8035 \begin_layout Standard
8036 The first non-comment line must contain the file format number:
8037 \end_layout
8038
8039 \begin_layout Description
8040 \begin_inset Flex CharStyle:Code
8041 status collapsed
8042
8043 \begin_layout PlainLayout
8044 Format
8045 \end_layout
8046
8047 \end_inset
8048
8049  [
8050 \begin_inset Flex CharStyle:Code
8051 status collapsed
8052
8053 \begin_layout PlainLayout
8054 int
8055 \end_layout
8056
8057 \end_inset
8058
8059 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
8060  don't have an explicit file format).
8061  The file format that is documented here is format 7.
8062 \end_layout
8063
8064 \begin_layout Subsection
8065 General text class parameters
8066 \end_layout
8067
8068 \begin_layout Standard
8069 These are the general parameters which describe the form of the entire document:
8070 \end_layout
8071
8072 \begin_layout Description
8073 \begin_inset Flex CharStyle:Code
8074 status collapsed
8075
8076 \begin_layout PlainLayout
8077 AddToPreamble
8078 \end_layout
8079
8080 \end_inset
8081
8082  Adds information to the document preamble.
8083  Must end with 
8084 \begin_inset Quotes eld
8085 \end_inset
8086
8087
8088 \begin_inset Flex CharStyle:Code
8089 status collapsed
8090
8091 \begin_layout PlainLayout
8092 EndPreamble
8093 \end_layout
8094
8095 \end_inset
8096
8097
8098 \begin_inset Quotes erd
8099 \end_inset
8100
8101 .
8102 \end_layout
8103
8104 \begin_layout Description
8105 \begin_inset Flex CharStyle:Code
8106 status collapsed
8107
8108 \begin_layout PlainLayout
8109 ClassOptions
8110 \end_layout
8111
8112 \end_inset
8113
8114  Describes various global options supported by the document class.
8115  See Section
8116 \begin_inset Space ~
8117 \end_inset
8118
8119
8120 \begin_inset CommandInset ref
8121 LatexCommand ref
8122 reference "sec:classoptions"
8123
8124 \end_inset
8125
8126  for a description.
8127  Must end with 
8128 \begin_inset Quotes eld
8129 \end_inset
8130
8131
8132 \begin_inset Flex CharStyle:Code
8133 status collapsed
8134
8135 \begin_layout PlainLayout
8136 End
8137 \end_layout
8138
8139 \end_inset
8140
8141
8142 \begin_inset Quotes erd
8143 \end_inset
8144
8145 .
8146 \end_layout
8147
8148 \begin_layout Description
8149 \begin_inset Flex CharStyle:Code
8150 status collapsed
8151
8152 \begin_layout PlainLayout
8153 Columns
8154 \end_layout
8155
8156 \end_inset
8157
8158  [
8159 \begin_inset Flex CharStyle:Code
8160 status collapsed
8161
8162 \begin_layout PlainLayout
8163
8164 \emph on
8165 1
8166 \end_layout
8167
8168 \end_inset
8169
8170
8171 \begin_inset Flex CharStyle:Code
8172 status collapsed
8173
8174 \begin_layout PlainLayout
8175 2
8176 \end_layout
8177
8178 \end_inset
8179
8180 ] Whether the class should default to having one or two columns.
8181  Can be changed in the 
8182 \begin_inset Flex CharStyle:MenuItem
8183 status collapsed
8184
8185 \begin_layout PlainLayout
8186
8187 \bar under
8188 D
8189 \bar default
8190 ocument\SpecialChar \menuseparator
8191
8192 \bar under
8193 S
8194 \bar default
8195 ettings
8196 \end_layout
8197
8198 \end_inset
8199
8200  dialog.
8201 \end_layout
8202
8203 \begin_layout Description
8204 \begin_inset Flex CharStyle:Code
8205 status collapsed
8206
8207 \begin_layout PlainLayout
8208 Counter
8209 \end_layout
8210
8211 \end_inset
8212
8213  This sequence defines a new counter.
8214  See Section
8215 \begin_inset Space ~
8216 \end_inset
8217
8218
8219 \begin_inset CommandInset ref
8220 LatexCommand ref
8221 reference "sec:counter"
8222
8223 \end_inset
8224
8225  for details.
8226  Must end with 
8227 \begin_inset Quotes eld
8228 \end_inset
8229
8230
8231 \begin_inset Flex CharStyle:Code
8232 status collapsed
8233
8234 \begin_layout PlainLayout
8235 End
8236 \end_layout
8237
8238 \end_inset
8239
8240
8241 \begin_inset Quotes erd
8242 \end_inset
8243
8244 .
8245 \end_layout
8246
8247 \begin_layout Description
8248 \begin_inset Flex CharStyle:Code
8249 status collapsed
8250
8251 \begin_layout PlainLayout
8252 DefaultFont
8253 \end_layout
8254
8255 \end_inset
8256
8257  Sets the default font used to display the document.
8258  See Section
8259 \begin_inset Space ~
8260 \end_inset
8261
8262
8263 \begin_inset CommandInset ref
8264 LatexCommand ref
8265 reference "sec:fonts"
8266
8267 \end_inset
8268
8269  for how to declare fonts.
8270  Must end with 
8271 \begin_inset Quotes eld
8272 \end_inset
8273
8274
8275 \begin_inset Flex CharStyle:Code
8276 status collapsed
8277
8278 \begin_layout PlainLayout
8279 EndFont
8280 \end_layout
8281
8282 \end_inset
8283
8284
8285 \begin_inset Quotes erd
8286 \end_inset
8287
8288 .
8289 \end_layout
8290
8291 \begin_layout Description
8292 \begin_inset Flex CharStyle:Code
8293 status collapsed
8294
8295 \begin_layout PlainLayout
8296 DefaultStyle
8297 \end_layout
8298
8299 \end_inset
8300
8301  [
8302 \begin_inset Flex CharStyle:Code
8303 status collapsed
8304
8305 \begin_layout PlainLayout
8306 string
8307 \end_layout
8308
8309 \end_inset
8310
8311 ] This is the style that will be assigned to new paragraphs, usually 
8312 \begin_inset Flex CharStyle:MenuItem
8313 status collapsed
8314
8315 \begin_layout PlainLayout
8316 Standard
8317 \end_layout
8318
8319 \end_inset
8320
8321 .
8322  This will default to the first defined style if not given, but you are
8323  highly encouraged to use this directive.
8324 \end_layout
8325
8326 \begin_layout Description
8327 \begin_inset Flex CharStyle:Code
8328 status collapsed
8329
8330 \begin_layout PlainLayout
8331 Float
8332 \end_layout
8333
8334 \end_inset
8335
8336  Defines a new float.
8337  See Section
8338 \begin_inset Space ~
8339 \end_inset
8340
8341
8342 \begin_inset CommandInset ref
8343 LatexCommand ref
8344 reference "sec:floats"
8345
8346 \end_inset
8347
8348  for details.
8349  Must end with 
8350 \begin_inset Quotes eld
8351 \end_inset
8352
8353
8354 \begin_inset Flex CharStyle:Code
8355 status collapsed
8356
8357 \begin_layout PlainLayout
8358 End
8359 \end_layout
8360
8361 \end_inset
8362
8363
8364 \begin_inset Quotes erd
8365 \end_inset
8366
8367 .
8368 \end_layout
8369
8370 \begin_layout Description
8371 \begin_inset Flex CharStyle:Code
8372 status collapsed
8373
8374 \begin_layout PlainLayout
8375 Input
8376 \end_layout
8377
8378 \end_inset
8379
8380  As its name implies, this command allows you to include another layout
8381  definition file within yours to avoid duplicating commands.
8382  Common examples are the standard layout files, for example, 
8383 \begin_inset Flex CharStyle:Code
8384 status collapsed
8385
8386 \begin_layout PlainLayout
8387 stdclass.inc
8388 \end_layout
8389
8390 \end_inset
8391
8392 , which contains most of the basic layouts.
8393 \end_layout
8394
8395 \begin_layout Description
8396 \begin_inset Flex CharStyle:Code
8397 status collapsed
8398
8399 \begin_layout PlainLayout
8400 InsetLayout
8401 \end_layout
8402
8403 \end_inset
8404
8405  This section (re-)defines the layout of an inset.
8406  It can be applied to an existing inset of to a new, user-defined inset,
8407  e.g., a new character style.
8408  See Section
8409 \begin_inset Space ~
8410 \end_inset
8411
8412
8413 \begin_inset CommandInset ref
8414 LatexCommand ref
8415 reference "sec:charstyle"
8416
8417 \end_inset
8418
8419  for more information.
8420  Must end with 
8421 \begin_inset Quotes eld
8422 \end_inset
8423
8424
8425 \begin_inset Flex CharStyle:Code
8426 status collapsed
8427
8428 \begin_layout PlainLayout
8429 End
8430 \end_layout
8431
8432 \end_inset
8433
8434
8435 \begin_inset Quotes erd
8436 \end_inset
8437
8438 .
8439 \end_layout
8440
8441 \begin_layout Description
8442 \begin_inset Flex CharStyle:Code
8443 status collapsed
8444
8445 \begin_layout PlainLayout
8446 LeftMargin
8447 \end_layout
8448
8449 \end_inset
8450
8451  [[FIXME]]
8452 \end_layout
8453
8454 \begin_layout Description
8455 \begin_inset Flex CharStyle:Code
8456 status collapsed
8457
8458 \begin_layout PlainLayout
8459 NoFloat
8460 \end_layout
8461
8462 \end_inset
8463
8464  This command deletes an existing float.
8465  This is particularly useful when you want to suppress a float that has
8466  be defined in an input file.
8467 \end_layout
8468
8469 \begin_layout Description
8470 \begin_inset Flex CharStyle:Code
8471 status collapsed
8472
8473 \begin_layout PlainLayout
8474 NoStyle
8475 \end_layout
8476
8477 \end_inset
8478
8479  This command deletes an existing style.
8480  This is particularly useful when you want to suppress a style that has
8481  be defined in an input file.
8482 \end_layout
8483
8484 \begin_layout Description
8485 \begin_inset Flex CharStyle:Code
8486 status collapsed
8487
8488 \begin_layout PlainLayout
8489 OutputType
8490 \end_layout
8491
8492 \end_inset
8493
8494  [[FIXME]]
8495 \end_layout
8496
8497 \begin_layout Description
8498 \begin_inset Flex CharStyle:Code
8499 status collapsed
8500
8501 \begin_layout PlainLayout
8502
8503 \series medium
8504 PageStyle
8505 \end_layout
8506
8507 \end_inset
8508
8509  [
8510 \emph on
8511
8512 \begin_inset Flex CharStyle:Code
8513 status collapsed
8514
8515 \begin_layout PlainLayout
8516
8517 \emph on
8518 plain
8519 \end_layout
8520
8521 \end_inset
8522
8523
8524 \emph default
8525
8526 \begin_inset Flex CharStyle:Code
8527 status collapsed
8528
8529 \begin_layout PlainLayout
8530 empty
8531 \end_layout
8532
8533 \end_inset
8534
8535
8536 \begin_inset Flex CharStyle:Code
8537 status collapsed
8538
8539 \begin_layout PlainLayout
8540 headings
8541 \end_layout
8542
8543 \end_inset
8544
8545 ] The class default pagestyle.
8546  Can be changed in the 
8547 \begin_inset Flex CharStyle:MenuItem
8548 status collapsed
8549
8550 \begin_layout PlainLayout
8551
8552 \bar under
8553 D
8554 \bar default
8555 ocument\SpecialChar \menuseparator
8556
8557 \bar under
8558 S
8559 \bar default
8560 ettings
8561 \end_layout
8562
8563 \end_inset
8564
8565  dialog.
8566 \end_layout
8567
8568 \begin_layout Description
8569 \begin_inset Flex CharStyle:Code
8570 status collapsed
8571
8572 \begin_layout PlainLayout
8573 Preamble
8574 \end_layout
8575
8576 \end_inset
8577
8578  Sets the preamble for the LaTeX document.
8579  Note that this will completely override any prior 
8580 \begin_inset Flex CharStyle:Code
8581 status collapsed
8582
8583 \begin_layout PlainLayout
8584 Premable
8585 \end_layout
8586
8587 \end_inset
8588
8589  or 
8590 \begin_inset Flex CharStyle:Code
8591 status collapsed
8592
8593 \begin_layout PlainLayout
8594 AddToPreamble
8595 \end_layout
8596
8597 \end_inset
8598
8599  declarations.
8600  Must end with 
8601 \begin_inset Quotes eld
8602 \end_inset
8603
8604
8605 \begin_inset Flex CharStyle:Code
8606 status collapsed
8607
8608 \begin_layout PlainLayout
8609 EndPreamble
8610 \end_layout
8611
8612 \end_inset
8613
8614
8615 \begin_inset Quotes erd
8616 \end_inset
8617
8618 .
8619 \end_layout
8620
8621 \begin_layout Description
8622 \begin_inset Flex CharStyle:Code
8623 status collapsed
8624
8625 \begin_layout PlainLayout
8626 Provides
8627 \end_layout
8628
8629 \end_inset
8630
8631  
8632 \begin_inset CommandInset label
8633 LatexCommand label
8634 name "des:Provides"
8635
8636 \end_inset
8637
8638 [
8639 \begin_inset Flex CharStyle:Code
8640 status collapsed
8641
8642 \begin_layout PlainLayout
8643 string
8644 \end_layout
8645
8646 \end_inset
8647
8648 ] [
8649 \begin_inset Flex CharStyle:Code
8650 status collapsed
8651
8652 \begin_layout PlainLayout
8653
8654 \emph on
8655 0
8656 \end_layout
8657
8658 \end_inset
8659
8660
8661 \begin_inset Flex CharStyle:Code
8662 status collapsed
8663
8664 \begin_layout PlainLayout
8665 1
8666 \end_layout
8667
8668 \end_inset
8669
8670 ] Whether the class already provides the feature 
8671 \begin_inset Flex CharStyle:Code
8672 status collapsed
8673
8674 \begin_layout PlainLayout
8675 string
8676 \end_layout
8677
8678 \end_inset
8679
8680 .
8681  A feature is in general the name of a package (
8682 \begin_inset Flex CharStyle:Code
8683 status collapsed
8684
8685 \begin_layout PlainLayout
8686 amsmath
8687 \end_layout
8688
8689 \end_inset
8690
8691
8692 \begin_inset Flex CharStyle:Code
8693 status collapsed
8694
8695 \begin_layout PlainLayout
8696 makeidx
8697 \end_layout
8698
8699 \end_inset
8700
8701 , \SpecialChar \ldots{}
8702 ) or a macro (
8703 \begin_inset Flex CharStyle:Code
8704 status collapsed
8705
8706 \begin_layout PlainLayout
8707 url
8708 \end_layout
8709
8710 \end_inset
8711
8712
8713 \begin_inset Flex CharStyle:Code
8714 status collapsed
8715
8716 \begin_layout PlainLayout
8717 boldsymbol
8718 \end_layout
8719
8720 \end_inset
8721
8722 ,\SpecialChar \ldots{}
8723 ); the complete list of supported features is unfortunately not documented
8724  outside the LyX source code---but see 
8725 \begin_inset Flex CharStyle:Code
8726 status collapsed
8727
8728 \begin_layout PlainLayout
8729 LaTeXFeatures.cpp
8730 \end_layout
8731
8732 \end_inset
8733
8734  if you're interested.
8735  
8736 \begin_inset Flex CharStyle:MenuItem
8737 status collapsed
8738
8739 \begin_layout PlainLayout
8740
8741 \bar under
8742 H
8743 \bar default
8744 elp\SpecialChar \menuseparator
8745
8746 \bar under
8747 L
8748 \bar default
8749 aTeX Configuration
8750 \end_layout
8751
8752 \end_inset
8753
8754  also gives an overview of the supported packages.
8755 \end_layout
8756
8757 \begin_layout Description
8758 \begin_inset Flex CharStyle:Code
8759 status collapsed
8760
8761 \begin_layout PlainLayout
8762 Requires
8763 \end_layout
8764
8765 \end_inset
8766
8767  [
8768 \begin_inset Flex CharStyle:Code
8769 status collapsed
8770
8771 \begin_layout PlainLayout
8772 string
8773 \end_layout
8774
8775 \end_inset
8776
8777 ] Whether the class requires the feature
8778 \begin_inset Flex CharStyle:Code
8779 status collapsed
8780
8781 \begin_layout PlainLayout
8782  string
8783 \end_layout
8784
8785 \end_inset
8786
8787 .
8788  Multiple features must be separated by commas.
8789  Note that you can only request supported features.
8790 \end_layout
8791
8792 \begin_layout Description
8793 \begin_inset Flex CharStyle:Code
8794 status collapsed
8795
8796 \begin_layout PlainLayout
8797 RightMargin
8798 \end_layout
8799
8800 \end_inset
8801
8802  [[FIXME]]
8803 \end_layout
8804
8805 \begin_layout Description
8806 \begin_inset Flex CharStyle:Code
8807 status collapsed
8808
8809 \begin_layout PlainLayout
8810 SecNumDepth
8811 \end_layout
8812
8813 \end_inset
8814
8815  [[FIXME]]
8816 \end_layout
8817
8818 \begin_layout Description
8819 \begin_inset Flex CharStyle:Code
8820 status collapsed
8821
8822 \begin_layout PlainLayout
8823 Sides
8824 \end_layout
8825
8826 \end_inset
8827
8828  [
8829 \emph on
8830
8831 \begin_inset Flex CharStyle:Code
8832 status collapsed
8833
8834 \begin_layout PlainLayout
8835
8836 \emph on
8837 1
8838 \end_layout
8839
8840 \end_inset
8841
8842
8843 \emph default
8844
8845 \begin_inset Flex CharStyle:Code
8846 status collapsed
8847
8848 \begin_layout PlainLayout
8849 2
8850 \end_layout
8851
8852 \end_inset
8853
8854 ] Whether the class-default should be printing on one or both sides of the
8855  paper.
8856  Can be changed in the 
8857 \begin_inset Flex CharStyle:MenuItem
8858 status collapsed
8859
8860 \begin_layout PlainLayout
8861
8862 \bar under
8863 D
8864 \bar default
8865 ocument\SpecialChar \menuseparator
8866
8867 \bar under
8868 S
8869 \bar default
8870 ettings
8871 \end_layout
8872
8873 \end_inset
8874
8875  dialog.
8876 \end_layout
8877
8878 \begin_layout Description
8879 \begin_inset Flex CharStyle:Code
8880 status collapsed
8881
8882 \begin_layout PlainLayout
8883 Style
8884 \end_layout
8885
8886 \end_inset
8887
8888  This sequence defines a new paragraph style.
8889  If the style already exists, it will redefine some of its parameters instead.
8890  See Section
8891 \begin_inset Space ~
8892 \end_inset
8893
8894
8895 \begin_inset CommandInset ref
8896 LatexCommand ref
8897 reference "sec:style"
8898
8899 \end_inset
8900
8901  for details.
8902  Must end with 
8903 \begin_inset Quotes eld
8904 \end_inset
8905
8906
8907 \begin_inset Flex CharStyle:Code
8908 status collapsed
8909
8910 \begin_layout PlainLayout
8911 End
8912 \end_layout
8913
8914 \end_inset
8915
8916
8917 \begin_inset Quotes erd
8918 \end_inset
8919
8920 .
8921 \end_layout
8922
8923 \begin_layout Description
8924 \begin_inset Flex CharStyle:Code
8925 status collapsed
8926
8927 \begin_layout PlainLayout
8928 TitleLatexName
8929 \end_layout
8930
8931 \end_inset
8932
8933  [
8934 \begin_inset Flex CharStyle:Code
8935 status collapsed
8936
8937 \begin_layout PlainLayout
8938 string="maketitle"
8939 \end_layout
8940
8941 \end_inset
8942
8943 ] The name of the command or environment to be used with 
8944 \begin_inset Flex CharStyle:Code
8945 status collapsed
8946
8947 \begin_layout PlainLayout
8948 TitleLatexType
8949 \end_layout
8950
8951 \end_inset
8952
8953 .
8954 \end_layout
8955
8956 \begin_layout Description
8957 \begin_inset Flex CharStyle:Code
8958 status collapsed
8959
8960 \begin_layout PlainLayout
8961 TitleLatexType
8962 \end_layout
8963
8964 \end_inset
8965
8966  [
8967 \begin_inset Flex CharStyle:Code
8968 status collapsed
8969
8970 \begin_layout PlainLayout
8971
8972 \emph on
8973 CommandAfter
8974 \end_layout
8975
8976 \end_inset
8977
8978
8979 \begin_inset Flex CharStyle:Code
8980 status collapsed
8981
8982 \begin_layout PlainLayout
8983 Environment
8984 \end_layout
8985
8986 \end_inset
8987
8988 ] Indicates what kind of markup is used to define the title of a document.
8989  
8990 \begin_inset Flex CharStyle:Code
8991 status collapsed
8992
8993 \begin_layout PlainLayout
8994 CommandAfter
8995 \end_layout
8996
8997 \end_inset
8998
8999  means that the macro with name 
9000 \begin_inset Flex CharStyle:Code
9001 status collapsed
9002
9003 \begin_layout PlainLayout
9004 TitleLatexName
9005 \end_layout
9006
9007 \end_inset
9008
9009  will be inserted after the last layout which has 
9010 \begin_inset Quotes eld
9011 \end_inset
9012
9013
9014 \begin_inset Flex CharStyle:Code
9015 status collapsed
9016
9017 \begin_layout PlainLayout
9018 InTitle 1
9019 \end_layout
9020
9021 \end_inset
9022
9023
9024 \begin_inset Quotes erd
9025 \end_inset
9026
9027 .
9028  
9029 \begin_inset Flex CharStyle:Code
9030 status collapsed
9031
9032 \begin_layout PlainLayout
9033 Environment
9034 \end_layout
9035
9036 \end_inset
9037
9038  corresponds to the case where the block of paragraphs which have 
9039 \begin_inset Quotes eld
9040 \end_inset
9041
9042
9043 \begin_inset Flex CharStyle:Code
9044 status collapsed
9045
9046 \begin_layout PlainLayout
9047 InTitle 1
9048 \end_layout
9049
9050 \end_inset
9051
9052
9053 \begin_inset Quotes erd
9054 \end_inset
9055
9056  should be enclosed into the 
9057 \begin_inset Flex CharStyle:Code
9058 status collapsed
9059
9060 \begin_layout PlainLayout
9061 TitleLatexName
9062 \end_layout
9063
9064 \end_inset
9065
9066  environment.
9067 \end_layout
9068
9069 \begin_layout Description
9070 \begin_inset Flex CharStyle:Code
9071 status collapsed
9072
9073 \begin_layout PlainLayout
9074 TocDepth
9075 \end_layout
9076
9077 \end_inset
9078
9079  [[FIXME]]
9080 \end_layout
9081
9082 \begin_layout Subsection
9083 \begin_inset Flex CharStyle:Code
9084 status collapsed
9085
9086 \begin_layout PlainLayout
9087 ClassOptions
9088 \end_layout
9089
9090 \end_inset
9091
9092  section
9093 \end_layout
9094
9095 \begin_layout Standard
9096 \begin_inset CommandInset label
9097 LatexCommand label
9098 name "sec:classoptions"
9099
9100 \end_inset
9101
9102 The 
9103 \begin_inset Flex CharStyle:Code
9104 status collapsed
9105
9106 \begin_layout PlainLayout
9107 ClassOptions
9108 \end_layout
9109
9110 \end_inset
9111
9112  section can contain the following entries:
9113 \end_layout
9114
9115 \begin_layout Description
9116 \begin_inset Flex CharStyle:Code
9117 status collapsed
9118
9119 \begin_layout PlainLayout
9120 FontSize
9121 \end_layout
9122
9123 \end_inset
9124
9125  [
9126 \begin_inset Flex CharStyle:Code
9127 status collapsed
9128
9129 \begin_layout PlainLayout
9130 string="10|11|12"
9131 \end_layout
9132
9133 \end_inset
9134
9135 ] The list of available font sizes for the document's main font, separated
9136  by 
9137 \begin_inset Quotes eld
9138 \end_inset
9139
9140
9141 \begin_inset Flex CharStyle:Code
9142 status collapsed
9143
9144 \begin_layout PlainLayout
9145 |
9146 \end_layout
9147
9148 \end_inset
9149
9150
9151 \begin_inset Quotes erd
9152 \end_inset
9153
9154 .
9155 \end_layout
9156
9157 \begin_layout Description
9158 \begin_inset Flex CharStyle:Code
9159 status collapsed
9160
9161 \begin_layout PlainLayout
9162 Header
9163 \end_layout
9164
9165 \end_inset
9166
9167  [[FIXME]]
9168 \end_layout
9169
9170 \begin_layout Description
9171 \begin_inset Flex CharStyle:Code
9172 status collapsed
9173
9174 \begin_layout PlainLayout
9175 PageStyle
9176 \end_layout
9177
9178 \end_inset
9179
9180  [
9181 \begin_inset Flex CharStyle:Code
9182 status collapsed
9183
9184 \begin_layout PlainLayout
9185 string="empty|plain|headings|fancy"
9186 \end_layout
9187
9188 \end_inset
9189
9190 ] The list of available page styles, separated by 
9191 \begin_inset Quotes eld
9192 \end_inset
9193
9194
9195 \begin_inset Flex CharStyle:Code
9196 status collapsed
9197
9198 \begin_layout PlainLayout
9199 |
9200 \end_layout
9201
9202 \end_inset
9203
9204
9205 \begin_inset Quotes erd
9206 \end_inset
9207
9208 .
9209 \end_layout
9210
9211 \begin_layout Description
9212 \begin_inset Flex CharStyle:Code
9213 status collapsed
9214
9215 \begin_layout PlainLayout
9216 Other
9217 \end_layout
9218
9219 \end_inset
9220
9221  [
9222 \begin_inset Flex CharStyle:Code
9223 status collapsed
9224
9225 \begin_layout PlainLayout
9226 string=""
9227 \end_layout
9228
9229 \end_inset
9230
9231 ] Some document class options, separated by a comma, that will be added
9232  to the optional part of the 
9233 \begin_inset Flex CharStyle:Code
9234 status collapsed
9235
9236 \begin_layout PlainLayout
9237
9238 \backslash
9239 documentclass
9240 \end_layout
9241
9242 \end_inset
9243
9244  command.
9245 \end_layout
9246
9247 \begin_layout Standard
9248 The 
9249 \begin_inset Flex CharStyle:Code
9250 status collapsed
9251
9252 \begin_layout PlainLayout
9253 ClassOptions
9254 \end_layout
9255
9256 \end_inset
9257
9258  section must end with 
9259 \begin_inset Quotes eld
9260 \end_inset
9261
9262
9263 \begin_inset Flex CharStyle:Code
9264 status collapsed
9265
9266 \begin_layout PlainLayout
9267 End
9268 \end_layout
9269
9270 \end_inset
9271
9272
9273 \begin_inset Quotes erd
9274 \end_inset
9275
9276 .
9277 \end_layout
9278
9279 \begin_layout Subsection
9280 Paragraph Styles
9281 \end_layout
9282
9283 \begin_layout Standard
9284 \begin_inset CommandInset label
9285 LatexCommand label
9286 name "sec:style"
9287
9288 \end_inset
9289
9290 A paragraph style description looks like this:
9291 \begin_inset Foot
9292 status collapsed
9293
9294 \begin_layout PlainLayout
9295 Note that this will either define a new layout or modify an existing one.
9296 \end_layout
9297
9298 \end_inset
9299
9300
9301 \end_layout
9302
9303 \begin_layout LyX-Code
9304 Style 
9305 \family roman
9306 \emph on
9307 name
9308 \end_layout
9309
9310 \begin_layout LyX-Code
9311  ...
9312 \end_layout
9313
9314 \begin_layout LyX-Code
9315 End
9316 \end_layout
9317
9318 \begin_layout Standard
9319 where the following commands are allowed:
9320 \end_layout
9321
9322 \begin_layout Description
9323 \begin_inset Flex CharStyle:Code
9324 status collapsed
9325
9326 \begin_layout PlainLayout
9327 Align
9328 \end_layout
9329
9330 \end_inset
9331
9332  [
9333 \begin_inset Flex CharStyle:Code
9334 status collapsed
9335
9336 \begin_layout PlainLayout
9337
9338 \emph on
9339 block
9340 \emph default
9341 , left, right, center
9342 \end_layout
9343
9344 \end_inset
9345
9346 ] Paragraph alignment.
9347 \end_layout
9348
9349 \begin_layout Description
9350 \begin_inset Flex CharStyle:Code
9351 status collapsed
9352
9353 \begin_layout PlainLayout
9354 AlignPossible
9355 \end_layout
9356
9357 \end_inset
9358
9359  [
9360 \begin_inset Flex CharStyle:Code
9361 status collapsed
9362
9363 \begin_layout PlainLayout
9364
9365 \emph on
9366 block
9367 \emph default
9368 , left, right, center
9369 \end_layout
9370
9371 \end_inset
9372
9373 ] A comma separated list of permitted alignments.
9374  (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9375  sense.
9376  For example a right-aligned or centered enumeration isn't possible.)
9377 \end_layout
9378
9379 \begin_layout Description
9380 \begin_inset Flex CharStyle:Code
9381 status collapsed
9382
9383 \begin_layout PlainLayout
9384 BottomSep
9385 \end_layout
9386
9387 \end_inset
9388
9389  [
9390 \begin_inset Flex CharStyle:Code
9391 status collapsed
9392
9393 \begin_layout PlainLayout
9394 float=0
9395 \end_layout
9396
9397 \end_inset
9398
9399 ]
9400 \begin_inset Foot
9401 status collapsed
9402
9403 \begin_layout PlainLayout
9404 Note that a `float' here is a real number, such as: 1.5.
9405 \end_layout
9406
9407 \end_inset
9408
9409  The vertical space with which the last of a chain of paragraphs with this
9410  layout is separated from the following paragraph.
9411  If the next paragraph has another layout, the separations are not simply
9412  added, but the maximum is taken.
9413 \end_layout
9414
9415 \begin_layout Description
9416 \begin_inset Flex CharStyle:Code
9417 status collapsed
9418
9419 \begin_layout PlainLayout
9420 Category
9421 \end_layout
9422
9423 \end_inset
9424
9425  
9426 \begin_inset Flex CharStyle:Code
9427 status collapsed
9428
9429 \begin_layout PlainLayout
9430 [string]
9431 \end_layout
9432
9433 \end_inset
9434
9435  The category for this style.
9436  This is used to group related styles in the Layout combobox on the toolbar.
9437  Any string can be used, but you may want to use existing categories with
9438  your own styles.
9439  
9440 \end_layout
9441
9442 \begin_layout Description
9443 \begin_inset Flex CharStyle:Code
9444 status collapsed
9445
9446 \begin_layout PlainLayout
9447 CommandDepth
9448 \end_layout
9449
9450 \end_inset
9451
9452  [[FIXME]]
9453 \end_layout
9454
9455 \begin_layout Description
9456 \begin_inset Flex CharStyle:Code
9457 status collapsed
9458
9459 \begin_layout PlainLayout
9460 CopyStyle
9461 \end_layout
9462
9463 \end_inset
9464
9465  
9466 \begin_inset Flex CharStyle:Code
9467 status collapsed
9468
9469 \begin_layout PlainLayout
9470 [string]
9471 \end_layout
9472
9473 \end_inset
9474
9475  Copies all the features of an existing style into the current one.
9476  
9477 \end_layout
9478
9479 \begin_layout Description
9480 \begin_inset Flex CharStyle:Code
9481 status collapsed
9482
9483 \begin_layout PlainLayout
9484 DependsOn
9485 \end_layout
9486
9487 \end_inset
9488
9489  The name of a style whose preamble should be output 
9490 \emph on
9491 before
9492 \emph default
9493  this one.
9494  This allows to ensure some ordering of the preamble snippets when macros
9495  definitions depend on one another.
9496 \begin_inset Foot
9497 status collapsed
9498
9499 \begin_layout PlainLayout
9500 Note that, besides that functionality, there is no way to ensure any ordering
9501  of preambles.
9502  The ordering that you see in a given version of LyX may change without
9503  warning in later versions.
9504 \end_layout
9505
9506 \end_inset
9507
9508
9509 \end_layout
9510
9511 \begin_layout Description
9512 \begin_inset Flex CharStyle:Code
9513 status collapsed
9514
9515 \begin_layout PlainLayout
9516 EndLabeltype
9517 \end_layout
9518
9519 \end_inset
9520
9521  [
9522 \begin_inset Flex CharStyle:Code
9523 status collapsed
9524
9525 \begin_layout PlainLayout
9526
9527 \emph on
9528 No_Label
9529 \emph default
9530 , Box, Filled_Box, Static
9531 \end_layout
9532
9533 \end_inset
9534
9535 ] The type of label that stands at the end of the paragraph (or sequence
9536  of paragraphs if 
9537 \begin_inset Flex CharStyle:Code
9538 status collapsed
9539
9540 \begin_layout PlainLayout
9541 LatexType
9542 \end_layout
9543
9544 \end_inset
9545
9546  is 
9547 \begin_inset Flex CharStyle:Code
9548 status collapsed
9549
9550 \begin_layout PlainLayout
9551 Environment
9552 \end_layout
9553
9554 \end_inset
9555
9556
9557 \begin_inset Flex CharStyle:Code
9558 status collapsed
9559
9560 \begin_layout PlainLayout
9561 Item_Environment
9562 \end_layout
9563
9564 \end_inset
9565
9566  or 
9567 \begin_inset Flex CharStyle:Code
9568 status collapsed
9569
9570 \begin_layout PlainLayout
9571 List_Environment
9572 \end_layout
9573
9574 \end_inset
9575
9576 ).
9577  
9578 \begin_inset Flex CharStyle:Code
9579 status collapsed
9580
9581 \begin_layout PlainLayout
9582 No_Label
9583 \end_layout
9584
9585 \end_inset
9586
9587  means 
9588 \begin_inset Quotes eld
9589 \end_inset
9590
9591 nothing
9592 \begin_inset Quotes erd
9593 \end_inset
9594
9595
9596 \begin_inset Flex CharStyle:Code
9597 status collapsed
9598
9599 \begin_layout PlainLayout
9600 Box
9601 \end_layout
9602
9603 \end_inset
9604
9605  (resp.
9606 \begin_inset Flex CharStyle:Code
9607 status collapsed
9608
9609 \begin_layout PlainLayout
9610 \begin_inset Space ~
9611 \end_inset
9612
9613 Filled_Box
9614 \end_layout
9615
9616 \end_inset
9617
9618 ) is a white (resp.
9619 \begin_inset Space ~
9620 \end_inset
9621
9622 black) square suitable for end of proof markers, 
9623 \begin_inset Flex CharStyle:Code
9624 status collapsed
9625
9626 \begin_layout PlainLayout
9627 Static
9628 \end_layout
9629
9630 \end_inset
9631
9632  is an explicit text string.
9633 \end_layout
9634
9635 \begin_layout Description
9636 \begin_inset Flex CharStyle:Code
9637 status collapsed
9638
9639 \begin_layout PlainLayout
9640 EndLabelString
9641 \end_layout
9642
9643 \end_inset
9644
9645  [
9646 \begin_inset Flex CharStyle:Code
9647 status collapsed
9648
9649 \begin_layout PlainLayout
9650 string=""
9651 \end_layout
9652
9653 \end_inset
9654
9655 ] The string used for a label with a 
9656 \begin_inset Flex CharStyle:Code
9657 status collapsed
9658
9659 \begin_layout PlainLayout
9660 Static
9661 \end_layout
9662
9663 \end_inset
9664
9665  
9666 \begin_inset Flex CharStyle:Code
9667 status collapsed
9668
9669 \begin_layout PlainLayout
9670 EndLabelType
9671 \end_layout
9672
9673 \end_inset
9674
9675 .
9676  
9677 \end_layout
9678
9679 \begin_layout Description
9680 \begin_inset Flex CharStyle:Code
9681 status collapsed
9682
9683 \begin_layout PlainLayout
9684 Fill_Bottom
9685 \end_layout
9686
9687 \end_inset
9688
9689  [
9690 \begin_inset Flex CharStyle:Code
9691 status collapsed
9692
9693 \begin_layout PlainLayout
9694
9695 \emph on
9696 0
9697 \emph default
9698 ,1
9699 \end_layout
9700
9701 \end_inset
9702
9703 ] Similar to 
9704 \begin_inset Flex CharStyle:Code
9705 status collapsed
9706
9707 \begin_layout PlainLayout
9708 Fill_Top
9709 \end_layout
9710
9711 \end_inset
9712
9713 .
9714 \end_layout
9715
9716 \begin_layout Description
9717 \begin_inset Flex CharStyle:Code
9718 status collapsed
9719
9720 \begin_layout PlainLayout
9721 Fill_Top
9722 \end_layout
9723
9724 \end_inset
9725
9726  [
9727 \begin_inset Flex CharStyle:Code
9728 status collapsed
9729
9730 \begin_layout PlainLayout
9731
9732 \emph on
9733 0
9734 \emph default
9735 ,1
9736 \end_layout
9737
9738 \end_inset
9739
9740 ] With this parameter the 
9741 \begin_inset Flex CharStyle:MenuItem
9742 status collapsed
9743
9744 \begin_layout PlainLayout
9745 Fill
9746 \end_layout
9747
9748 \end_inset
9749
9750  value of the 
9751 \begin_inset Quotes eld
9752 \end_inset
9753
9754 Vertical space above
9755 \begin_inset Quotes erd
9756 \end_inset
9757
9758  list of the 
9759 \begin_inset Flex CharStyle:MenuItem
9760 status collapsed
9761
9762 \begin_layout PlainLayout
9763
9764 \bar under
9765 E
9766 \bar default
9767 dit\SpecialChar \menuseparator
9768
9769 \bar under
9770 P
9771 \bar default
9772 aragraph
9773 \begin_inset Space ~
9774 \end_inset
9775
9776 Settings
9777 \end_layout
9778
9779 \end_inset
9780
9781  dialog can be set when initializing a paragraph with this style.
9782 \begin_inset Foot
9783 status collapsed
9784
9785 \begin_layout PlainLayout
9786
9787 \emph on
9788 Note from Jean-Marc:
9789 \emph default
9790  I'm not sure that this setting has much use, and it should probably be
9791  removed in later versions.
9792 \end_layout
9793
9794 \end_inset
9795
9796  
9797 \end_layout
9798
9799 \begin_layout Description
9800 \begin_inset Flex CharStyle:Code
9801 status collapsed
9802
9803 \begin_layout PlainLayout
9804 Font
9805 \end_layout
9806
9807 \end_inset
9808
9809  The font used for both the text body 
9810 \emph on
9811 and
9812 \emph default
9813  the label.
9814  See section
9815 \begin_inset Space ~
9816 \end_inset
9817
9818
9819 \begin_inset CommandInset ref
9820 LatexCommand ref
9821 reference "sec:fonts"
9822
9823 \end_inset
9824
9825 .
9826  Note that defining this font automatically defines the 
9827 \begin_inset Flex CharStyle:Code
9828 status collapsed
9829
9830 \begin_layout PlainLayout
9831 LabelFont
9832 \end_layout
9833
9834 \end_inset
9835
9836  to the same value.
9837  So you should define this one first if you also want to define 
9838 \begin_inset Flex CharStyle:Code
9839 status collapsed
9840
9841 \begin_layout PlainLayout
9842 LabelFont
9843 \end_layout
9844
9845 \end_inset
9846
9847 .
9848 \end_layout
9849
9850 \begin_layout Description
9851 \begin_inset Flex CharStyle:Code
9852 status collapsed
9853
9854 \begin_layout PlainLayout
9855 FreeSpacing
9856 \end_layout
9857
9858 \end_inset
9859
9860  
9861 \begin_inset CommandInset label
9862 LatexCommand label
9863 name "des:FreeSpacing"
9864
9865 \end_inset
9866
9867 [
9868 \emph on
9869
9870 \begin_inset Flex CharStyle:Code
9871 status collapsed
9872
9873 \begin_layout PlainLayout
9874
9875 \emph on
9876 0
9877 \end_layout
9878
9879 \end_inset
9880
9881
9882 \emph default
9883
9884 \begin_inset Flex CharStyle:Code
9885 status collapsed
9886
9887 \begin_layout PlainLayout
9888 1
9889 \end_layout
9890
9891 \end_inset
9892
9893 ] Usually LyX doesn't allow you to insert more than one space between words,
9894  since a space is considered as the separation between two words, not a
9895  character or symbol of its own.
9896  This is a very fine thing but sometimes annoying, for example, when typing
9897  program code or plain LaTeX code.
9898  For this reason, 
9899 \begin_inset Flex CharStyle:Code
9900 status collapsed
9901
9902 \begin_layout PlainLayout
9903 FreeSpacing
9904 \end_layout
9905
9906 \end_inset
9907
9908  can be enabled.
9909  Note that LyX will create protected blanks for the additional blanks when
9910  in another mode than LaTeX-mode.
9911 \end_layout
9912
9913 \begin_layout Description
9914 \begin_inset Flex CharStyle:Code
9915 status collapsed
9916
9917 \begin_layout PlainLayout
9918 InnerTag
9919 \end_layout
9920
9921 \end_inset
9922
9923  [[FIXME]]
9924 \end_layout
9925
9926 \begin_layout Description
9927 \begin_inset Flex CharStyle:Code
9928 status collapsed
9929
9930 \begin_layout PlainLayout
9931 InTitle
9932 \end_layout
9933
9934 \end_inset
9935
9936  
9937 \begin_inset Flex CharStyle:Code
9938 status collapsed
9939
9940 \begin_layout PlainLayout
9941 [1, 0]
9942 \end_layout
9943
9944 \end_inset
9945
9946  If 1, marks the layout as being part of a title block (see also the 
9947 \begin_inset Flex CharStyle:Code
9948 status collapsed
9949
9950 \begin_layout PlainLayout
9951 TitleLatexType
9952 \end_layout
9953
9954 \end_inset
9955
9956  and 
9957 \begin_inset Flex CharStyle:Code
9958 status collapsed
9959
9960 \begin_layout PlainLayout
9961 TitleLatexName
9962 \end_layout
9963
9964 \end_inset
9965
9966  global entries).
9967 \end_layout
9968
9969 \begin_layout Description
9970 \begin_inset Flex CharStyle:Code
9971 status collapsed
9972
9973 \begin_layout PlainLayout
9974 ItemSep
9975 \end_layout
9976
9977 \end_inset
9978
9979  [
9980 \begin_inset Flex CharStyle:Code
9981 status collapsed
9982
9983 \begin_layout PlainLayout
9984 float=0
9985 \end_layout
9986
9987 \end_inset
9988
9989 ] This provides extra space between paragraphs that have the same layout.
9990  If you put other layouts into an environment, each is separated with the
9991  environment's 
9992 \begin_inset Flex CharStyle:Code
9993 status collapsed
9994
9995 \begin_layout PlainLayout
9996 Parsep
9997 \end_layout
9998
9999 \end_inset
10000
10001 .
10002  But the whole items of the environment are additionally separated with
10003  this 
10004 \begin_inset Flex CharStyle:Code
10005 status collapsed
10006
10007 \begin_layout PlainLayout
10008 Itemsep
10009 \end_layout
10010
10011 \end_inset
10012
10013 .
10014  Note that this is a
10015 \emph on
10016  multiplier.
10017 \end_layout
10018
10019 \begin_layout Description
10020 \begin_inset Flex CharStyle:Code
10021 status collapsed
10022
10023 \begin_layout PlainLayout
10024 ItemTag
10025 \end_layout
10026
10027 \end_inset
10028
10029  [[FIXME]]
10030 \end_layout
10031
10032 \begin_layout Description
10033 \begin_inset Flex CharStyle:Code
10034 status collapsed
10035
10036 \begin_layout PlainLayout
10037 KeepEmpty
10038 \end_layout
10039
10040 \end_inset
10041
10042  
10043 \begin_inset CommandInset label
10044 LatexCommand label
10045 name "des:KeepEmpty"
10046
10047 \end_inset
10048
10049 [
10050 \emph on
10051
10052 \begin_inset Flex CharStyle:Code
10053 status collapsed
10054
10055 \begin_layout PlainLayout
10056
10057 \emph on
10058 0
10059 \end_layout
10060
10061 \end_inset
10062
10063
10064 \emph default
10065
10066 \begin_inset Flex CharStyle:Code
10067 status collapsed
10068
10069 \begin_layout PlainLayout
10070 1
10071 \end_layout
10072
10073 \end_inset
10074
10075 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10076  lead to empty LaTeX output.
10077  There are some cases where this could be desirable however: in a letter
10078  template, the required fields can be provided as empty fields, so that
10079  people do not forget them; in some special classes, a layout can be used
10080  as some kind of break, which does not contain actual text.
10081 \end_layout
10082
10083 \begin_layout Description
10084 \begin_inset Flex CharStyle:Code
10085 status collapsed
10086
10087 \begin_layout PlainLayout
10088 LabelBottomsep
10089 \end_layout
10090
10091 \end_inset
10092
10093  [float=0] The vertical space between the label and the text body.
10094  Only used for labels that are above the text body (
10095 \begin_inset Flex CharStyle:Code
10096 status collapsed
10097
10098 \begin_layout PlainLayout
10099 Top_Environment
10100 \end_layout
10101
10102 \end_inset
10103
10104
10105 \begin_inset Flex CharStyle:Code
10106 status collapsed
10107
10108 \begin_layout PlainLayout
10109 Centered_Top_Environment
10110 \end_layout
10111
10112 \end_inset
10113
10114 ).
10115 \end_layout
10116
10117 \begin_layout Description
10118 \begin_inset Flex CharStyle:Code
10119 status collapsed
10120
10121 \begin_layout PlainLayout
10122 LabelCounter
10123 \end_layout
10124
10125 \end_inset
10126
10127  [
10128 \begin_inset Flex CharStyle:Code
10129 status collapsed
10130
10131 \begin_layout PlainLayout
10132 string=""
10133 \end_layout
10134
10135 \end_inset
10136
10137 ]
10138 \newline
10139 The name of the counter for automatic numbering (see Section 
10140 \begin_inset CommandInset ref
10141 LatexCommand ref
10142 reference "sec:counter"
10143
10144 \end_inset
10145
10146  for details).
10147  This must be given if 
10148 \begin_inset Flex CharStyle:Code
10149 status collapsed
10150
10151 \begin_layout PlainLayout
10152 Labeltype
10153 \end_layout
10154
10155 \end_inset
10156
10157  is 
10158 \begin_inset Flex CharStyle:Code
10159 status collapsed
10160
10161 \begin_layout PlainLayout
10162 Counter
10163 \end_layout
10164
10165 \end_inset
10166
10167 .
10168 \end_layout
10169
10170 \begin_layout Description
10171 \begin_inset Flex CharStyle:Code
10172 status collapsed
10173
10174 \begin_layout PlainLayout
10175 LabelFont
10176 \end_layout
10177
10178 \end_inset
10179
10180  The font used for the label.
10181  See section
10182 \begin_inset Space ~
10183 \end_inset
10184
10185
10186 \begin_inset CommandInset ref
10187 LatexCommand ref
10188 reference "sec:fonts"
10189
10190 \end_inset
10191
10192 .
10193 \end_layout
10194
10195 \begin_layout Description
10196 \begin_inset Flex CharStyle:Code
10197 status collapsed
10198
10199 \begin_layout PlainLayout
10200 Labelsep
10201 \end_layout
10202
10203 \end_inset
10204
10205  [
10206 \begin_inset Flex CharStyle:Code
10207 status collapsed
10208
10209 \begin_layout PlainLayout
10210 string=""
10211 \end_layout
10212
10213 \end_inset
10214
10215 ] The horizontal space between the label and the text body.
10216  Only used for labels that are not above the text body.
10217 \end_layout
10218
10219 \begin_layout Description
10220 \begin_inset Flex CharStyle:Code
10221 status collapsed
10222
10223 \begin_layout PlainLayout
10224 LabelString
10225 \end_layout
10226
10227 \end_inset
10228
10229  [
10230 \begin_inset Flex CharStyle:Code
10231 status collapsed
10232
10233 \begin_layout PlainLayout
10234 string=""
10235 \end_layout
10236
10237 \end_inset
10238
10239 ] The string used for a label with a 
10240 \begin_inset Flex CharStyle:Code
10241 status collapsed
10242
10243 \begin_layout PlainLayout
10244 Static
10245 \end_layout
10246
10247 \end_inset
10248
10249  labeltype.
10250  When 
10251 \begin_inset Flex CharStyle:Code
10252 status collapsed
10253
10254 \begin_layout PlainLayout
10255 LabelCounter
10256 \end_layout
10257
10258 \end_inset
10259
10260  is set, this string can be contain the special formatting commands described
10261  in Section 
10262 \begin_inset CommandInset ref
10263 LatexCommand ref
10264 reference "sec:counter"
10265
10266 \end_inset
10267
10268 .
10269 \begin_inset Foot
10270 status collapsed
10271
10272 \begin_layout PlainLayout
10273 For the sake of backwards compatibility, the string 
10274 \begin_inset Flex CharStyle:Code
10275 status collapsed
10276
10277 \begin_layout PlainLayout
10278 @
10279 \emph on
10280 style-name
10281 \emph default
10282 @
10283 \end_layout
10284
10285 \end_inset
10286
10287  will be replaced by the expanded 
10288 \begin_inset Flex CharStyle:Code
10289 status collapsed
10290
10291 \begin_layout PlainLayout
10292 LabelString
10293 \end_layout
10294
10295 \end_inset
10296
10297  of style 
10298 \begin_inset Flex CharStyle:Code
10299 status collapsed
10300
10301 \begin_layout PlainLayout
10302
10303 \emph on
10304 style-name
10305 \end_layout
10306
10307 \end_inset
10308
10309 .
10310  This feature is now obsolete and should be replaced by the mechanisms of
10311  Section 
10312 \begin_inset CommandInset ref
10313 LatexCommand ref
10314 reference "sec:counter"
10315
10316 \end_inset
10317
10318 .
10319 \end_layout
10320
10321 \end_inset
10322
10323
10324 \end_layout
10325
10326 \begin_layout Description
10327 \begin_inset Flex CharStyle:Code
10328 status collapsed
10329
10330 \begin_layout PlainLayout
10331 LabelStringAppendix
10332 \end_layout
10333
10334 \end_inset
10335
10336  [
10337 \begin_inset Flex CharStyle:Code
10338 status collapsed
10339
10340 \begin_layout PlainLayout
10341 string=""
10342 \end_layout
10343
10344 \end_inset
10345
10346 ] This is used inside the appendix instead of 
10347 \begin_inset Flex CharStyle:Code
10348 status collapsed
10349
10350 \begin_layout PlainLayout
10351 LabelString
10352 \end_layout
10353
10354 \end_inset
10355
10356 .
10357  Note that every 
10358 \begin_inset Flex CharStyle:Code
10359 status collapsed
10360
10361 \begin_layout PlainLayout
10362 LabelString
10363 \end_layout
10364
10365 \end_inset
10366
10367  statement resets 
10368 \begin_inset Flex CharStyle:Code
10369 status collapsed
10370
10371 \begin_layout PlainLayout
10372 LabelStringAppendix
10373 \end_layout
10374
10375 \end_inset
10376
10377  too.
10378 \end_layout
10379
10380 \begin_layout Description
10381 \begin_inset Flex CharStyle:Code
10382 status collapsed
10383
10384 \begin_layout PlainLayout
10385 Labeltype
10386 \end_layout
10387
10388 \end_inset
10389
10390  [
10391 \begin_inset Flex CharStyle:Code
10392 status collapsed
10393
10394 \begin_layout PlainLayout
10395
10396 \emph on
10397 No_Label
10398 \emph default
10399 , Manual, Static, Top_Environment, 
10400 \newline
10401 Centered_Top_Environment, Sensitive,
10402  Counter
10403 \end_layout
10404
10405 \end_inset
10406
10407
10408 \newline
10409
10410 \begin_inset Flex CharStyle:Code
10411 status collapsed
10412
10413 \begin_layout PlainLayout
10414 Manual
10415 \end_layout
10416
10417 \end_inset
10418
10419  means the label is the very first word (up to the first real blank).
10420 \begin_inset Foot
10421 status collapsed
10422
10423 \begin_layout PlainLayout
10424 Use protected spaces if you want more than one word as the label.
10425 \end_layout
10426
10427 \end_inset
10428
10429  
10430 \begin_inset Flex CharStyle:Code
10431 status collapsed
10432
10433 \begin_layout PlainLayout
10434 Static
10435 \end_layout
10436
10437 \end_inset
10438
10439  means it is defined in the layout (see 
10440 \begin_inset Flex CharStyle:Code
10441 status collapsed
10442
10443 \begin_layout PlainLayout
10444 LabelString
10445 \end_layout
10446
10447 \end_inset
10448
10449 ).
10450  
10451 \begin_inset Flex CharStyle:Code
10452 status collapsed
10453
10454 \begin_layout PlainLayout
10455 Top_Environment
10456 \end_layout
10457
10458 \end_inset
10459
10460  and 
10461 \begin_inset Flex CharStyle:Code
10462 status collapsed
10463
10464 \begin_layout PlainLayout
10465 Centered_Top_Environment
10466 \end_layout
10467
10468 \end_inset
10469
10470  are special cases of 
10471 \begin_inset Flex CharStyle:Code
10472 status collapsed
10473
10474 \begin_layout PlainLayout
10475 Static
10476 \end_layout
10477
10478 \end_inset
10479
10480 .
10481  The label will be printed above the paragraph, but only at the top of an
10482  environment or the top of a chain of paragraphs with this layout.
10483  Usage is for example the 
10484 \begin_inset Flex CharStyle:MenuItem
10485 status collapsed
10486
10487 \begin_layout PlainLayout
10488 Abstract
10489 \end_layout
10490
10491 \end_inset
10492
10493  layout or the 
10494 \begin_inset Flex CharStyle:MenuItem
10495 status collapsed
10496
10497 \begin_layout PlainLayout
10498 Bibliography
10499 \end_layout
10500
10501 \end_inset
10502
10503  layout.
10504  This is also the case for 
10505 \begin_inset Flex CharStyle:Code
10506 status collapsed
10507
10508 \begin_layout PlainLayout
10509 Manual
10510 \end_layout
10511
10512 \end_inset
10513
10514  labels with latex type 
10515 \begin_inset Flex CharStyle:Code
10516 status collapsed
10517
10518 \begin_layout PlainLayout
10519 Environment
10520 \end_layout
10521
10522 \end_inset
10523
10524 , in order to make layouts for theorems work correctly.
10525  
10526 \begin_inset Flex CharStyle:Code
10527 status collapsed
10528
10529 \begin_layout PlainLayout
10530 Sensitive
10531 \end_layout
10532
10533 \end_inset
10534
10535  is a special case for the caption-labels 
10536 \begin_inset Quotes eld
10537 \end_inset
10538
10539 Figure
10540 \begin_inset Quotes erd
10541 \end_inset
10542
10543  and 
10544 \begin_inset Quotes eld
10545 \end_inset
10546
10547 Table
10548 \begin_inset Quotes erd
10549 \end_inset
10550
10551 .
10552  
10553 \begin_inset Flex CharStyle:Code
10554 status collapsed
10555
10556 \begin_layout PlainLayout
10557 Sensitive
10558 \end_layout
10559
10560 \end_inset
10561
10562  means the (hardcoded) label string depends on the kind of float.
10563  The 
10564 \begin_inset Flex CharStyle:Code
10565 status collapsed
10566
10567 \begin_layout PlainLayout
10568 Counter
10569 \end_layout
10570
10571 \end_inset
10572
10573  label type defines automatically numbered labels.
10574  See Section 
10575 \begin_inset CommandInset ref
10576 LatexCommand ref
10577 reference "sec:counter"
10578
10579 \end_inset
10580
10581 .
10582 \end_layout
10583
10584 \begin_layout Description
10585 \begin_inset Flex CharStyle:Code
10586 status collapsed
10587
10588 \begin_layout PlainLayout
10589 LatexFooter
10590 \end_layout
10591
10592 \end_inset
10593
10594  [[FIXME]]
10595 \end_layout
10596
10597 \begin_layout Description
10598 \begin_inset Flex CharStyle:Code
10599 status collapsed
10600
10601 \begin_layout PlainLayout
10602 LatexHeader
10603 \end_layout
10604
10605 \end_inset
10606
10607  [[FIXME]]
10608 \end_layout
10609
10610 \begin_layout Description
10611 \begin_inset Flex CharStyle:Code
10612 status collapsed
10613
10614 \begin_layout PlainLayout
10615 LatexName
10616 \end_layout
10617
10618 \end_inset
10619
10620  
10621 \begin_inset CommandInset label
10622 LatexCommand label
10623 name "des:LatexName"
10624
10625 \end_inset
10626
10627 The name of the corresponding LaTeX stuff.
10628  Either the environment or command name.
10629 \end_layout
10630
10631 \begin_layout Description
10632 \begin_inset Flex CharStyle:Code
10633 status collapsed
10634
10635 \begin_layout PlainLayout
10636 LatexParagraph
10637 \end_layout
10638
10639 \end_inset
10640
10641  [[FIXME]]
10642 \end_layout
10643
10644 \begin_layout Description
10645 \begin_inset Flex CharStyle:Code
10646 status collapsed
10647
10648 \begin_layout PlainLayout
10649 LatexParam
10650 \end_layout
10651
10652 \end_inset
10653
10654  
10655 \begin_inset CommandInset label
10656 LatexCommand label
10657 name "des:LatexParam"
10658
10659 \end_inset
10660
10661 An optional parameter for the corresponding 
10662 \begin_inset Flex CharStyle:Code
10663 status collapsed
10664
10665 \begin_layout PlainLayout
10666 LatexName
10667 \end_layout
10668
10669 \end_inset
10670
10671  stuff.
10672  This parameter cannot be changed from within LyX.
10673 \end_layout
10674
10675 \begin_layout Description
10676 \begin_inset Flex CharStyle:Code
10677 status collapsed
10678
10679 \begin_layout PlainLayout
10680 LatexType
10681 \end_layout
10682
10683 \end_inset
10684
10685  
10686 \begin_inset CommandInset label
10687 LatexCommand label
10688 name "des:LatexType"
10689
10690 \end_inset
10691
10692 [
10693 \begin_inset Flex CharStyle:Code
10694 status collapsed
10695
10696 \begin_layout PlainLayout
10697
10698 \emph on
10699 Paragraph
10700 \emph default
10701 , Command, Environment, Item_Environment,
10702 \end_layout
10703
10704 \end_inset
10705
10706  
10707 \begin_inset Flex CharStyle:Code
10708 status collapsed
10709
10710 \begin_layout PlainLayout
10711 List_Environment
10712 \end_layout
10713
10714 \end_inset
10715
10716 ] How the layout should be translated into LaTeX.
10717  
10718 \begin_inset Flex CharStyle:Code
10719 status collapsed
10720
10721 \begin_layout PlainLayout
10722 Paragraph
10723 \end_layout
10724
10725 \end_inset
10726
10727  means nothing special.
10728  
10729 \begin_inset Flex CharStyle:Code
10730 status collapsed
10731
10732 \begin_layout PlainLayout
10733 Command
10734 \end_layout
10735
10736 \end_inset
10737
10738  means 
10739 \begin_inset Flex CharStyle:Code
10740 status collapsed
10741
10742 \begin_layout PlainLayout
10743
10744 \backslash
10745
10746 \emph on
10747 LatexName
10748 \emph default
10749 {\SpecialChar \ldots{}
10750 }
10751 \end_layout
10752
10753 \end_inset
10754
10755  and 
10756 \begin_inset Flex CharStyle:Code
10757 status collapsed
10758
10759 \begin_layout PlainLayout
10760 Environment
10761 \end_layout
10762
10763 \end_inset
10764
10765  means 
10766 \begin_inset Flex CharStyle:Code
10767 status collapsed
10768
10769 \begin_layout PlainLayout
10770
10771 \backslash
10772 begin{
10773 \emph on
10774 LatexName
10775 \emph default
10776 }\SpecialChar \ldots{}
10777
10778 \backslash
10779 end{
10780 \emph on
10781 LatexName
10782 \emph default
10783 }
10784 \end_layout
10785
10786 \end_inset
10787
10788 .
10789  
10790 \begin_inset Flex CharStyle:Code
10791 status collapsed
10792
10793 \begin_layout PlainLayout
10794 Item_Environment
10795 \end_layout
10796
10797 \end_inset
10798
10799  is the same as 
10800 \begin_inset Flex CharStyle:Code
10801 status collapsed
10802
10803 \begin_layout PlainLayout
10804 Environment
10805 \end_layout
10806
10807 \end_inset
10808
10809 , except that a 
10810 \begin_inset Flex CharStyle:Code
10811 status collapsed
10812
10813 \begin_layout PlainLayout
10814
10815 \backslash
10816 item
10817 \end_layout
10818
10819 \end_inset
10820
10821  is generated for each paragraph of this environment.
10822  
10823 \begin_inset Flex CharStyle:Code
10824 status collapsed
10825
10826 \begin_layout PlainLayout
10827 List_Environment
10828 \end_layout
10829
10830 \end_inset
10831
10832  is the same as 
10833 \begin_inset Flex CharStyle:Code
10834 status collapsed
10835
10836 \begin_layout PlainLayout
10837 Item_Environment
10838 \end_layout
10839
10840 \end_inset
10841
10842 , except that 
10843 \begin_inset Flex CharStyle:Code
10844 status collapsed
10845
10846 \begin_layout PlainLayout
10847 LabelWidthString
10848 \end_layout
10849
10850 \end_inset
10851
10852  is passed as an argument to the environment.
10853  
10854 \begin_inset Flex CharStyle:Code
10855 status collapsed
10856
10857 \begin_layout PlainLayout
10858 LabelWidthString
10859 \end_layout
10860
10861 \end_inset
10862
10863  can be defined in the 
10864 \begin_inset Flex CharStyle:MenuItem
10865 status collapsed
10866
10867 \begin_layout PlainLayout
10868
10869 \bar under
10870 L
10871 \bar default
10872 ayout\SpecialChar \menuseparator
10873
10874 \bar under
10875 P
10876 \bar default
10877 aragraph
10878 \end_layout
10879
10880 \end_inset
10881
10882  dialog.
10883  
10884 \begin_inset Flex CharStyle:Code
10885 status collapsed
10886
10887 \begin_layout PlainLayout
10888
10889 \emph on
10890 LatexType
10891 \end_layout
10892
10893 \end_inset
10894
10895  is perhaps a bit misleading, since these rules apply to SGML classes, too.
10896  Visit the SGML class files for specific examples.
10897 \end_layout
10898
10899 \begin_layout Standard
10900 Putting the last few things together, the LaTeX output will be either: 
10901 \end_layout
10902
10903 \begin_layout LyX-Code
10904
10905 \backslash
10906 latexname[latexparam]{\SpecialChar \ldots{}
10907 }
10908 \end_layout
10909
10910 \begin_layout Standard
10911 or: 
10912 \end_layout
10913
10914 \begin_layout LyX-Code
10915
10916 \backslash
10917 begin{latexname}[latexparam] \SpecialChar \ldots{}
10918  
10919 \backslash
10920 end{latexname}.
10921 \end_layout
10922
10923 \begin_layout Standard
10924 depending upon the LaTex type.
10925 \end_layout
10926
10927 \begin_layout Description
10928 \begin_inset Flex CharStyle:Code
10929 status collapsed
10930
10931 \begin_layout PlainLayout
10932 LeftMargin
10933 \end_layout
10934
10935 \end_inset
10936
10937  [
10938 \begin_inset Flex CharStyle:Code
10939 status collapsed
10940
10941 \begin_layout PlainLayout
10942 string=""
10943 \end_layout
10944
10945 \end_inset
10946
10947 ] If you put layouts into environments, the leftmargins are not simply added,
10948  but added with a factor 
10949 \begin_inset Formula $\frac{4}{depth+4}$
10950 \end_inset
10951
10952 .
10953  Note that this parameter is also used when the margin is defined as 
10954 \begin_inset Flex CharStyle:Code
10955 status collapsed
10956
10957 \begin_layout PlainLayout
10958 Manual
10959 \end_layout
10960
10961 \end_inset
10962
10963  or 
10964 \begin_inset Flex CharStyle:Code
10965 status collapsed
10966
10967 \begin_layout PlainLayout
10968 Dynamic
10969 \end_layout
10970
10971 \end_inset
10972
10973 .
10974  Then it is added to the manual or dynamic margin.
10975  
10976 \newline
10977 The argument is passed as a string.
10978  For example 
10979 \begin_inset Quotes eld
10980 \end_inset
10981
10982
10983 \begin_inset Flex CharStyle:Code
10984 status collapsed
10985
10986 \begin_layout PlainLayout
10987 MM
10988 \end_layout
10989
10990 \end_inset
10991
10992
10993 \begin_inset Quotes erd
10994 \end_inset
10995
10996  means that the paragraph is indented with the width of 
10997 \begin_inset Quotes eld
10998 \end_inset
10999
11000
11001 \begin_inset Flex CharStyle:Code
11002 status collapsed
11003
11004 \begin_layout PlainLayout
11005 MM
11006 \end_layout
11007
11008 \end_inset
11009
11010
11011 \begin_inset Quotes erd
11012 \end_inset
11013
11014  in the normal font.
11015  You can get a negative width by prefixing the string with 
11016 \begin_inset Quotes eld
11017 \end_inset
11018
11019
11020 \begin_inset Flex CharStyle:Code
11021 status collapsed
11022
11023 \begin_layout PlainLayout
11024 -
11025 \end_layout
11026
11027 \end_inset
11028
11029
11030 \begin_inset Quotes erd
11031 \end_inset
11032
11033 .
11034  This way was chosen so that the look is the same with each used screen
11035  font.
11036  
11037 \end_layout
11038
11039 \begin_layout Description
11040 \begin_inset Flex CharStyle:Code
11041 status collapsed
11042
11043 \begin_layout PlainLayout
11044 Margin
11045 \end_layout
11046
11047 \end_inset
11048
11049  [
11050 \begin_inset Flex CharStyle:Code
11051 status collapsed
11052
11053 \begin_layout PlainLayout
11054
11055 \emph on
11056 Static
11057 \emph default
11058 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11059 \end_layout
11060
11061 \end_inset
11062
11063
11064 \newline
11065 The kind of margin that the layout has on the left side.
11066  
11067 \begin_inset Flex CharStyle:Code
11068 status collapsed
11069
11070 \begin_layout PlainLayout
11071 Static
11072 \end_layout
11073
11074 \end_inset
11075
11076  just means a fixed margin.
11077  
11078 \begin_inset Flex CharStyle:Code
11079 status collapsed
11080
11081 \begin_layout PlainLayout
11082 Manual
11083 \end_layout
11084
11085 \end_inset
11086
11087  means that the left margin depends on the string entered in the 
11088 \begin_inset Flex CharStyle:MenuItem
11089 status collapsed
11090
11091 \begin_layout PlainLayout
11092
11093 \bar under
11094 E
11095 \bar default
11096 dit\SpecialChar \menuseparator
11097
11098 \bar under
11099 P
11100 \bar default
11101 aragraph
11102 \begin_inset Space ~
11103 \end_inset
11104
11105 Settings
11106 \end_layout
11107
11108 \end_inset
11109
11110  dialog.
11111  This is used to typeset nice lists without tabulators.
11112  
11113 \begin_inset Flex CharStyle:Code
11114 status collapsed
11115
11116 \begin_layout PlainLayout
11117 Dynamic
11118 \end_layout
11119
11120 \end_inset
11121
11122  means that the margin depends on the size of the label.
11123  This is used for automatic enumerated headlines.
11124  It is obvious that the headline 
11125 \begin_inset Quotes eld
11126 \end_inset
11127
11128 5.4.3.2.1 Very long headline
11129 \begin_inset Quotes erd
11130 \end_inset
11131
11132  must have a wider left margin (as wide as 
11133 \begin_inset Quotes eld
11134 \end_inset
11135
11136 5.4.3.2.1
11137 \begin_inset Quotes erd
11138 \end_inset
11139
11140  plus the space) than 
11141 \begin_inset Quotes eld
11142 \end_inset
11143
11144 3.2 Very long headline
11145 \begin_inset Quotes erd
11146 \end_inset
11147
11148 , even if standard 
11149 \begin_inset Quotes eld
11150 \end_inset
11151
11152 word processors
11153 \begin_inset Quotes erd
11154 \end_inset
11155
11156  are not able to do this.
11157  
11158 \begin_inset Flex CharStyle:Code
11159 status collapsed
11160
11161 \begin_layout PlainLayout
11162 First_Dynamic
11163 \end_layout
11164
11165 \end_inset
11166
11167  is similar, but only the very first row of the paragraph is dynamic, while
11168  the others are static; this is used, for example, for descriptions.
11169  
11170 \begin_inset Flex CharStyle:Code
11171 status collapsed
11172
11173 \begin_layout PlainLayout
11174 Right_Address_Box
11175 \end_layout
11176
11177 \end_inset
11178
11179  means the margin is chosen in a way that the longest row of this paragraph
11180  fits to the right margin.
11181  This is used to typeset an address on the right edge of the page.
11182 \end_layout
11183
11184 \begin_layout Description
11185 \begin_inset Flex CharStyle:Code
11186 status collapsed
11187
11188 \begin_layout PlainLayout
11189 NeedProtect
11190 \end_layout
11191
11192 \end_inset
11193
11194  
11195 \begin_inset CommandInset label
11196 LatexCommand label
11197 name "des:NeedProtect"
11198
11199 \end_inset
11200
11201 [
11202 \begin_inset Flex CharStyle:Code
11203 status collapsed
11204
11205 \begin_layout PlainLayout
11206
11207 \emph on
11208 0
11209 \end_layout
11210
11211 \end_inset
11212
11213 ,
11214 \begin_inset Flex CharStyle:Code
11215 status collapsed
11216
11217 \begin_layout PlainLayout
11218 1
11219 \end_layout
11220
11221 \end_inset
11222
11223 ] Whether fragile commands in this layout should be 
11224 \begin_inset Flex CharStyle:Code
11225 status collapsed
11226
11227 \begin_layout PlainLayout
11228
11229 \backslash
11230 protect
11231 \end_layout
11232
11233 \end_inset
11234
11235 'ed.
11236 \end_layout
11237
11238 \begin_layout Description
11239 \begin_inset Flex CharStyle:Code
11240 status collapsed
11241
11242 \begin_layout PlainLayout
11243 Newline
11244 \end_layout
11245
11246 \end_inset
11247
11248  [
11249 \begin_inset Flex CharStyle:Code
11250 status collapsed
11251
11252 \begin_layout PlainLayout
11253 0
11254 \end_layout
11255
11256 \end_inset
11257
11258
11259 \begin_inset Flex CharStyle:Code
11260 status collapsed
11261
11262 \begin_layout PlainLayout
11263
11264 \emph on
11265 1
11266 \end_layout
11267
11268 \end_inset
11269
11270 ] Whether newlines are translated into LaTeX newlines (
11271 \begin_inset Flex CharStyle:Code
11272 status collapsed
11273
11274 \begin_layout PlainLayout
11275
11276 \backslash
11277
11278 \backslash
11279
11280 \end_layout
11281
11282 \end_inset
11283
11284 ) or not.
11285  The translation can be switched off to allow more comfortable LaTeX editing
11286  inside LyX.
11287 \end_layout
11288
11289 \begin_layout Description
11290 \begin_inset Flex CharStyle:Code
11291 status collapsed
11292
11293 \begin_layout PlainLayout
11294 NextNoIndent
11295 \end_layout
11296
11297 \end_inset
11298
11299  [
11300 \begin_inset Flex CharStyle:Code
11301 status collapsed
11302
11303 \begin_layout PlainLayout
11304 1
11305 \end_layout
11306
11307 \end_inset
11308
11309
11310 \begin_inset Flex CharStyle:Code
11311 status collapsed
11312
11313 \begin_layout PlainLayout
11314
11315 \emph on
11316 0
11317 \end_layout
11318
11319 \end_inset
11320
11321 ] Whether the following Paragraph is allowed to indent its very first row.
11322  
11323 \begin_inset Flex CharStyle:Code
11324 status collapsed
11325
11326 \begin_layout PlainLayout
11327 1
11328 \end_layout
11329
11330 \end_inset
11331
11332  means that it is not allowed to do so; 
11333 \begin_inset Flex CharStyle:Code
11334 status collapsed
11335
11336 \begin_layout PlainLayout
11337 0
11338 \end_layout
11339
11340 \end_inset
11341
11342  means it could do so if it wants to.
11343 \end_layout
11344
11345 \begin_layout Description
11346 \begin_inset Flex CharStyle:Code
11347 status collapsed
11348
11349 \begin_layout PlainLayout
11350 ObsoletedBy
11351 \end_layout
11352
11353 \end_inset
11354
11355  [[FIXME]]
11356 \end_layout
11357
11358 \begin_layout Description
11359 \begin_inset Flex CharStyle:Code
11360 status collapsed
11361
11362 \begin_layout PlainLayout
11363 OptionalArgs
11364 \end_layout
11365
11366 \end_inset
11367
11368  [
11369 \begin_inset Flex CharStyle:Code
11370 status collapsed
11371
11372 \begin_layout PlainLayout
11373 int=0
11374 \end_layout
11375
11376 \end_inset
11377
11378 ] The number of optional arguments that can be used with this layout.
11379  This is useful for things like section headings, and only makes sense with
11380  LaTeX.
11381 \end_layout
11382
11383 \begin_layout Description
11384 \begin_inset Flex CharStyle:Code
11385 status collapsed
11386
11387 \begin_layout PlainLayout
11388 ParIndent
11389 \end_layout
11390
11391 \end_inset
11392
11393  [
11394 \begin_inset Flex CharStyle:Code
11395 status collapsed
11396
11397 \begin_layout PlainLayout
11398 string=""
11399 \end_layout
11400
11401 \end_inset
11402
11403 ] The indent of the very first line of a paragraph.
11404  The 
11405 \begin_inset Flex CharStyle:Code
11406 status collapsed
11407
11408 \begin_layout PlainLayout
11409 Parindent
11410 \end_layout
11411
11412 \end_inset
11413
11414  will be fixed for a certain layout.
11415  The exception is Standard layout, since the indentation of a Standard layout
11416  paragraph can be prohibited with 
11417 \begin_inset Flex CharStyle:Code
11418 status collapsed
11419
11420 \begin_layout PlainLayout
11421 NextNoIndent
11422 \end_layout
11423
11424 \end_inset
11425
11426 .
11427  Also, Standard layout paragraphs inside environments use the 
11428 \begin_inset Flex CharStyle:Code
11429 status collapsed
11430
11431 \begin_layout PlainLayout
11432 Parindent
11433 \end_layout
11434
11435 \end_inset
11436
11437  of the environment, not their native one.
11438  For example, Standard paragraphs inside an enumeration are not indented.
11439 \end_layout
11440
11441 \begin_layout Description
11442 \begin_inset Flex CharStyle:Code
11443 status collapsed
11444
11445 \begin_layout PlainLayout
11446 Parsep
11447 \end_layout
11448
11449 \end_inset
11450
11451  [
11452 \begin_inset Flex CharStyle:Code
11453 status collapsed
11454
11455 \begin_layout PlainLayout
11456 float=0
11457 \end_layout
11458
11459 \end_inset
11460
11461 ] The vertical space between two paragraphs of this layout.
11462 \end_layout
11463
11464 \begin_layout Description
11465 \begin_inset Flex CharStyle:Code
11466 status collapsed
11467
11468 \begin_layout PlainLayout
11469 Parskip
11470 \end_layout
11471
11472 \end_inset
11473
11474  [
11475 \begin_inset Flex CharStyle:Code
11476 status collapsed
11477
11478 \begin_layout PlainLayout
11479 float=0
11480 \end_layout
11481
11482 \end_inset
11483
11484 ] LyX allows the user to choose either 
11485 \begin_inset Quotes eld
11486 \end_inset
11487
11488 indent
11489 \begin_inset Quotes erd
11490 \end_inset
11491
11492  or 
11493 \begin_inset Quotes eld
11494 \end_inset
11495
11496 skip
11497 \begin_inset Quotes erd
11498 \end_inset
11499
11500  to typeset a document.
11501  When 
11502 \begin_inset Quotes eld
11503 \end_inset
11504
11505 indent
11506 \begin_inset Quotes erd
11507 \end_inset
11508
11509  is chosen, this value is completely ignored.
11510  When 
11511 \begin_inset Quotes eld
11512 \end_inset
11513
11514 skip
11515 \begin_inset Quotes erd
11516 \end_inset
11517
11518  is chosen, the parindent of a LaTeXtype 
11519 \begin_inset Quotes eld
11520 \end_inset
11521
11522 Paragraph
11523 \begin_inset Quotes erd
11524 \end_inset
11525
11526  layout is ignored and all paragraphs are separated by this parskip argument.
11527  The vertical space is calculated with 
11528 \begin_inset Flex CharStyle:Code
11529 status collapsed
11530
11531 \begin_layout PlainLayout
11532 value
11533 \begin_inset Space ~
11534 \end_inset
11535
11536 * DefaultHeight
11537 \end_layout
11538
11539 \end_inset
11540
11541  where 
11542 \begin_inset Flex CharStyle:Code
11543 status collapsed
11544
11545 \begin_layout PlainLayout
11546 DefaultHeight
11547 \end_layout
11548
11549 \end_inset
11550
11551  is the height of a row with the normal font.
11552  This way, the look stays the same with different screen fonts.
11553 \end_layout
11554
11555 \begin_layout Description
11556 \begin_inset Flex CharStyle:Code
11557 status collapsed
11558
11559 \begin_layout PlainLayout
11560 PassThru
11561 \end_layout
11562
11563 \end_inset
11564
11565  
11566 \begin_inset CommandInset label
11567 LatexCommand label
11568 name "des:PassThru"
11569
11570 \end_inset
11571
11572 [
11573 \emph on
11574
11575 \begin_inset Flex CharStyle:Code
11576 status collapsed
11577
11578 \begin_layout PlainLayout
11579
11580 \emph on
11581 0
11582 \end_layout
11583
11584 \end_inset
11585
11586
11587 \emph default
11588
11589 \begin_inset Flex CharStyle:Code
11590 status collapsed
11591
11592 \begin_layout PlainLayout
11593 1
11594 \end_layout
11595
11596 \end_inset
11597
11598 ] Whether the contents of this paragraph should be output in raw form, meaning
11599  without special translations that LaTeX would require.
11600 \end_layout
11601
11602 \begin_layout Description
11603 \begin_inset Flex CharStyle:Code
11604 status collapsed
11605
11606 \begin_layout PlainLayout
11607 Preamble
11608 \end_layout
11609
11610 \end_inset
11611
11612  
11613 \begin_inset CommandInset label
11614 LatexCommand label
11615 name "des:Preamble"
11616
11617 \end_inset
11618
11619 Information to be included in the LaTeX preamable when this style is used.
11620  Used to define macros, load packages, etc., required by this particular
11621  style.
11622  Must end with 
11623 \begin_inset Quotes eld
11624 \end_inset
11625
11626
11627 \begin_inset Flex CharStyle:Code
11628 status collapsed
11629
11630 \begin_layout PlainLayout
11631 EndPreamble
11632 \end_layout
11633
11634 \end_inset
11635
11636
11637 \begin_inset Quotes erd
11638 \end_inset
11639
11640 .
11641 \end_layout
11642
11643 \begin_layout Description
11644 \begin_inset Flex CharStyle:Code
11645 status collapsed
11646
11647 \begin_layout PlainLayout
11648 Requires 
11649 \end_layout
11650
11651 \end_inset
11652
11653 [
11654 \begin_inset Flex CharStyle:Code
11655 status collapsed
11656
11657 \begin_layout PlainLayout
11658 string
11659 \end_layout
11660
11661 \end_inset
11662
11663
11664 \begin_inset CommandInset label
11665 LatexCommand label
11666 name "des:Requires"
11667
11668 \end_inset
11669
11670 Whether the layout requires the feature 
11671 \begin_inset Flex CharStyle:Code
11672 status collapsed
11673
11674 \begin_layout PlainLayout
11675 string
11676 \end_layout
11677
11678 \end_inset
11679
11680 .
11681  See the description of 
11682 \begin_inset Flex CharStyle:Code
11683 status collapsed
11684
11685 \begin_layout PlainLayout
11686 Provides
11687 \end_layout
11688
11689 \end_inset
11690
11691  above (page 
11692 \begin_inset CommandInset ref
11693 LatexCommand pageref
11694 reference "des:FreeSpacing"
11695
11696 \end_inset
11697
11698 ) for information on `features'.
11699  
11700 \end_layout
11701
11702 \begin_layout Description
11703 \begin_inset Flex CharStyle:Code
11704 status collapsed
11705
11706 \begin_layout PlainLayout
11707 RightMargin
11708 \end_layout
11709
11710 \end_inset
11711
11712  [
11713 \begin_inset Flex CharStyle:Code
11714 status collapsed
11715
11716 \begin_layout PlainLayout
11717 string=""
11718 \end_layout
11719
11720 \end_inset
11721
11722 ] Similar to 
11723 \begin_inset Flex CharStyle:Code
11724 status collapsed
11725
11726 \begin_layout PlainLayout
11727 LeftMargin
11728 \end_layout
11729
11730 \end_inset
11731
11732 .
11733 \end_layout
11734
11735 \begin_layout Description
11736 \begin_inset Flex CharStyle:Code
11737 status collapsed
11738
11739 \begin_layout PlainLayout
11740 Spacing
11741 \end_layout
11742
11743 \end_inset
11744
11745  [
11746 \begin_inset Flex CharStyle:Code
11747 status collapsed
11748
11749 \begin_layout PlainLayout
11750
11751 \emph on
11752 single
11753 \emph default
11754 , onehalf, double, other
11755 \end_layout
11756
11757 \end_inset
11758
11759  
11760 \emph on
11761 value
11762 \emph default
11763 ] This defines what the default spacing should be in the layout.
11764  The arguments 
11765 \begin_inset Flex CharStyle:Code
11766 status collapsed
11767
11768 \begin_layout PlainLayout
11769 single
11770 \end_layout
11771
11772 \end_inset
11773
11774
11775 \begin_inset Flex CharStyle:Code
11776 status collapsed
11777
11778 \begin_layout PlainLayout
11779 onehalf
11780 \end_layout
11781
11782 \end_inset
11783
11784  and 
11785 \begin_inset Flex CharStyle:Code
11786 status collapsed
11787
11788 \begin_layout PlainLayout
11789 double
11790 \end_layout
11791
11792 \end_inset
11793
11794  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11795  If you specify the argument 
11796 \begin_inset Flex CharStyle:Code
11797 status collapsed
11798
11799 \begin_layout PlainLayout
11800 other
11801 \end_layout
11802
11803 \end_inset
11804
11805 , then you should also provide a numerical argument which will be the actual
11806  multiplier value.
11807  Note that, contrary to other parameters, 
11808 \begin_inset Flex CharStyle:Code
11809 status collapsed
11810
11811 \begin_layout PlainLayout
11812 Spacing
11813 \end_layout
11814
11815 \end_inset
11816
11817  implies the generation of specific LaTeX code, using the package 
11818 \family roman
11819
11820 \begin_inset Flex CharStyle:Code
11821 status collapsed
11822
11823 \begin_layout PlainLayout
11824 setspace.sty
11825 \end_layout
11826
11827 \end_inset
11828
11829 .
11830 \end_layout
11831
11832 \begin_layout Description
11833 \begin_inset Flex CharStyle:Code
11834 status collapsed
11835
11836 \begin_layout PlainLayout
11837 TextFont
11838 \end_layout
11839
11840 \end_inset
11841
11842  The font used for the text body .
11843  See section 
11844 \begin_inset CommandInset ref
11845 LatexCommand ref
11846 reference "sec:fonts"
11847
11848 \end_inset
11849
11850 .
11851 \end_layout
11852
11853 \begin_layout Description
11854 \begin_inset Flex CharStyle:Code
11855 status collapsed
11856
11857 \begin_layout PlainLayout
11858
11859 \series medium
11860 TocLevel [int]
11861 \end_layout
11862
11863 \end_inset
11864
11865  The level of the style in the table of contents.
11866  This is used for automatic numbering of section headings.
11867 \end_layout
11868
11869 \begin_layout Description
11870 \begin_inset Flex CharStyle:Code
11871 status collapsed
11872
11873 \begin_layout PlainLayout
11874 TopSep
11875 \end_layout
11876
11877 \end_inset
11878
11879  [
11880 \begin_inset Flex CharStyle:Code
11881 status collapsed
11882
11883 \begin_layout PlainLayout
11884 float=0
11885 \end_layout
11886
11887 \end_inset
11888
11889 ] The vertical space with which the very first of a chain of paragraphs
11890  with this layout is separated from the previous paragraph.
11891  If the previous paragraph has another layout, the separations are not simply
11892  added, but the maximum is taken.
11893 \end_layout
11894
11895 \begin_layout Subsection
11896 Floats
11897 \end_layout
11898
11899 \begin_layout Standard
11900 \begin_inset CommandInset label
11901 LatexCommand label
11902 name "sec:floats"
11903
11904 \end_inset
11905
11906 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11907  define the floats (
11908 \begin_inset Flex CharStyle:MenuItem
11909 status collapsed
11910
11911 \begin_layout PlainLayout
11912 figure
11913 \end_layout
11914
11915 \end_inset
11916
11917
11918 \begin_inset Flex CharStyle:MenuItem
11919 status collapsed
11920
11921 \begin_layout PlainLayout
11922 table
11923 \end_layout
11924
11925 \end_inset
11926
11927 , \SpecialChar \ldots{}
11928 ) in the text class itself.
11929  Standard floats are included in the file 
11930 \begin_inset Flex CharStyle:Code
11931 status collapsed
11932
11933 \begin_layout PlainLayout
11934 stdfloats.inc
11935 \end_layout
11936
11937 \end_inset
11938
11939 , so you may have to do no more than add
11940 \end_layout
11941
11942 \begin_layout LyX-Code
11943 Input stdfloats.inc
11944 \end_layout
11945
11946 \begin_layout Standard
11947 to your layout file.
11948  If you want to implement a text class that proposes some other float types
11949  (like the AGU class bundled with LyX), the information below will hopefully
11950  help you:
11951 \end_layout
11952
11953 \begin_layout Description
11954 \begin_inset Flex CharStyle:Code
11955 status collapsed
11956
11957 \begin_layout PlainLayout
11958 Extension
11959 \end_layout
11960
11961 \end_inset
11962
11963  [
11964 \begin_inset Flex CharStyle:Code
11965 status collapsed
11966
11967 \begin_layout PlainLayout
11968 string
11969 \end_layout
11970
11971 \end_inset
11972
11973 =
11974 \begin_inset Quotes erd
11975 \end_inset
11976
11977
11978 \begin_inset Quotes erd
11979 \end_inset
11980
11981 ] The file name extension of an auxiliary file for the list of figures (or
11982  whatever).
11983  LaTeX writes the captions to this file.
11984 \end_layout
11985
11986 \begin_layout Description
11987 \begin_inset Flex CharStyle:Code
11988 status collapsed
11989
11990 \begin_layout PlainLayout
11991 GuiName
11992 \end_layout
11993
11994 \end_inset
11995
11996  [
11997 \begin_inset Flex CharStyle:Code
11998 status collapsed
11999
12000 \begin_layout PlainLayout
12001 string
12002 \end_layout
12003
12004 \end_inset
12005
12006 =
12007 \begin_inset Quotes erd
12008 \end_inset
12009
12010
12011 \begin_inset Quotes erd
12012 \end_inset
12013
12014 ] The string that will be used in the menus and also for the caption.
12015 \end_layout
12016
12017 \begin_layout Description
12018 \begin_inset Flex CharStyle:Code
12019 status collapsed
12020
12021 \begin_layout PlainLayout
12022 LaTeXBuiltin
12023 \end_layout
12024
12025 \end_inset
12026
12027  [
12028 \begin_inset Flex CharStyle:Code
12029 status collapsed
12030
12031 \begin_layout PlainLayout
12032
12033 \emph on
12034 0
12035 \end_layout
12036
12037 \end_inset
12038
12039
12040 \begin_inset Flex CharStyle:Code
12041 status collapsed
12042
12043 \begin_layout PlainLayout
12044 1
12045 \end_layout
12046
12047 \end_inset
12048
12049 ] Set to 
12050 \begin_inset Flex CharStyle:Code
12051 status collapsed
12052
12053 \begin_layout PlainLayout
12054 1
12055 \end_layout
12056
12057 \end_inset
12058
12059  if the float is already defined by the LaTeX document class.
12060  If this is set to 
12061 \begin_inset Flex CharStyle:Code
12062 status collapsed
12063
12064 \begin_layout PlainLayout
12065 0
12066 \end_layout
12067
12068 \end_inset
12069
12070 , the float will be defined using the LaTeX package 
12071 \begin_inset Flex CharStyle:Code
12072 status collapsed
12073
12074 \begin_layout PlainLayout
12075 float
12076 \end_layout
12077
12078 \end_inset
12079
12080 .
12081 \end_layout
12082
12083 \begin_layout Description
12084 \begin_inset Flex CharStyle:Code
12085 status collapsed
12086
12087 \begin_layout PlainLayout
12088 ListName
12089 \end_layout
12090
12091 \end_inset
12092
12093  [
12094 \begin_inset Flex CharStyle:Code
12095 status collapsed
12096
12097 \begin_layout PlainLayout
12098 string
12099 \end_layout
12100
12101 \end_inset
12102
12103 =
12104 \begin_inset Quotes erd
12105 \end_inset
12106
12107
12108 \begin_inset Quotes erd
12109 \end_inset
12110
12111 ] The heading used for the list of floats.
12112 \end_layout
12113
12114 \begin_layout Description
12115 \begin_inset Flex CharStyle:Code
12116 status collapsed
12117
12118 \begin_layout PlainLayout
12119 NumberWithin
12120 \end_layout
12121
12122 \end_inset
12123
12124  [
12125 \begin_inset Flex CharStyle:Code
12126 status collapsed
12127
12128 \begin_layout PlainLayout
12129 string
12130 \end_layout
12131
12132 \end_inset
12133
12134 =
12135 \begin_inset Quotes erd
12136 \end_inset
12137
12138
12139 \begin_inset Quotes erd
12140 \end_inset
12141
12142 ] This (optional) argument determines whether floats of this class will
12143  be numbered within some sectional unit of the document.
12144  For example, if within is equal to 
12145 \begin_inset Flex CharStyle:Code
12146 status collapsed
12147
12148 \begin_layout PlainLayout
12149 chapter
12150 \end_layout
12151
12152 \end_inset
12153
12154 , the floats will be numbered within chapters.
12155  
12156 \end_layout
12157
12158 \begin_layout Description
12159 \begin_inset Flex CharStyle:Code
12160 status collapsed
12161
12162 \begin_layout PlainLayout
12163 Placement
12164 \end_layout
12165
12166 \end_inset
12167
12168  [
12169 \begin_inset Flex CharStyle:Code
12170 status collapsed
12171
12172 \begin_layout PlainLayout
12173 string
12174 \end_layout
12175
12176 \end_inset
12177
12178 =
12179 \begin_inset Quotes erd
12180 \end_inset
12181
12182
12183 \begin_inset Quotes erd
12184 \end_inset
12185
12186 ] The default placement for the given class of floats.
12187  The string should be as in standard LaTeX: 
12188 \begin_inset Flex CharStyle:Code
12189 status collapsed
12190
12191 \begin_layout PlainLayout
12192 t
12193 \end_layout
12194
12195 \end_inset
12196
12197
12198 \begin_inset Flex CharStyle:Code
12199 status collapsed
12200
12201 \begin_layout PlainLayout
12202 b
12203 \end_layout
12204
12205 \end_inset
12206
12207
12208 \begin_inset Flex CharStyle:Code
12209 status collapsed
12210
12211 \begin_layout PlainLayout
12212 p
12213 \end_layout
12214
12215 \end_inset
12216
12217  and 
12218 \begin_inset Flex CharStyle:Code
12219 status collapsed
12220
12221 \begin_layout PlainLayout
12222 h
12223 \end_layout
12224
12225 \end_inset
12226
12227  for top, bottom, page, and here, respectively.
12228 \begin_inset Foot
12229 status collapsed
12230
12231 \begin_layout PlainLayout
12232 Note that the order of these letters in the string is irrelevant, like in
12233  LaTeX.
12234 \end_layout
12235
12236 \end_inset
12237
12238  On top of that there is a new type, 
12239 \begin_inset Flex CharStyle:Code
12240 status collapsed
12241
12242 \begin_layout PlainLayout
12243 H
12244 \end_layout
12245
12246 \end_inset
12247
12248 , which does not really correspond to a float, since it means: put it 
12249 \begin_inset Quotes eld
12250 \end_inset
12251
12252 here
12253 \begin_inset Quotes erd
12254 \end_inset
12255
12256  and nowhere else.
12257  Note however that the 
12258 \begin_inset Flex CharStyle:Code
12259 status collapsed
12260
12261 \begin_layout PlainLayout
12262 H
12263 \end_layout
12264
12265 \end_inset
12266
12267  specifier is special and, because of implementation details, cannot be
12268  used in non-builtin float types.
12269  If you do not understand what this means, just use 
12270 \begin_inset Quotes eld
12271 \end_inset
12272
12273
12274 \begin_inset Flex CharStyle:Code
12275 status collapsed
12276
12277 \begin_layout PlainLayout
12278 tbp
12279 \end_layout
12280
12281 \end_inset
12282
12283
12284 \begin_inset Quotes erd
12285 \end_inset
12286
12287 .
12288 \end_layout
12289
12290 \begin_layout Description
12291 \begin_inset Flex CharStyle:Code
12292 status collapsed
12293
12294 \begin_layout PlainLayout
12295 Style
12296 \end_layout
12297
12298 \end_inset
12299
12300  [
12301 \begin_inset Flex CharStyle:Code
12302 status collapsed
12303
12304 \begin_layout PlainLayout
12305 string
12306 \end_layout
12307
12308 \end_inset
12309
12310 =
12311 \begin_inset Quotes erd
12312 \end_inset
12313
12314
12315 \begin_inset Quotes erd
12316 \end_inset
12317
12318 ] The style used when defining the float using 
12319 \begin_inset Flex CharStyle:Code
12320 status collapsed
12321
12322 \begin_layout PlainLayout
12323
12324 \backslash
12325 newfloat
12326 \end_layout
12327
12328 \end_inset
12329
12330 .
12331 \end_layout
12332
12333 \begin_layout Description
12334 \begin_inset Flex CharStyle:Code
12335 status collapsed
12336
12337 \begin_layout PlainLayout
12338 Type
12339 \end_layout
12340
12341 \end_inset
12342
12343  [
12344 \begin_inset Flex CharStyle:Code
12345 status collapsed
12346
12347 \begin_layout PlainLayout
12348 string
12349 \end_layout
12350
12351 \end_inset
12352
12353 =
12354 \begin_inset Quotes erd
12355 \end_inset
12356
12357
12358 \begin_inset Quotes erd
12359 \end_inset
12360
12361 ] The 
12362 \begin_inset Quotes eld
12363 \end_inset
12364
12365 type
12366 \begin_inset Quotes erd
12367 \end_inset
12368
12369  of the new class of floats, like program or algorithm.
12370  After the appropriate 
12371 \begin_inset Flex CharStyle:Code
12372 status collapsed
12373
12374 \begin_layout PlainLayout
12375
12376 \backslash
12377 newfloat
12378 \end_layout
12379
12380 \end_inset
12381
12382 , commands such as 
12383 \begin_inset Flex CharStyle:Code
12384 status collapsed
12385
12386 \begin_layout PlainLayout
12387
12388 \backslash
12389 begin{program}
12390 \end_layout
12391
12392 \end_inset
12393
12394  or 
12395 \begin_inset Flex CharStyle:Code
12396 status collapsed
12397
12398 \begin_layout PlainLayout
12399
12400 \backslash
12401 end{algorithm*}
12402 \end_layout
12403
12404 \end_inset
12405
12406  will be available.
12407 \end_layout
12408
12409 \begin_layout Standard
12410 Note that defining a float with type 
12411 \begin_inset Flex CharStyle:Code
12412 status collapsed
12413
12414 \begin_layout PlainLayout
12415
12416 \emph on
12417 type
12418 \end_layout
12419
12420 \end_inset
12421
12422  automatically defines the corresponding counter with name 
12423 \begin_inset Flex CharStyle:Code
12424 status collapsed
12425
12426 \begin_layout PlainLayout
12427
12428 \emph on
12429 type
12430 \end_layout
12431
12432 \end_inset
12433
12434 .
12435 \end_layout
12436
12437 \begin_layout Subsection
12438 Inset layouts and Flex insets
12439 \end_layout
12440
12441 \begin_layout Standard
12442 \begin_inset CommandInset label
12443 LatexCommand label
12444 name "sec:charstyle"
12445
12446 \end_inset
12447
12448 LyX has supported character styles since version 1.4.0; since version 1.6.0
12449  these are called Flex insets.
12450  
12451 \end_layout
12452
12453 \begin_layout Standard
12454 Furthermore, it is possible to define the general layout of many different
12455  types of insets.
12456  Currently, InsetLayout can be used to customize the  layout parameters
12457  for footnotes, marginal notes, note insets, ERT insets, branches, listings,
12458  indexes, boxes, tables, algorithms, URLs, and optional arguments, as well
12459  as Flex insets.
12460  
12461 \end_layout
12462
12463 \begin_layout Standard
12464 Flex insets come in three different kinds: 
12465 \end_layout
12466
12467 \begin_layout Itemize
12468 character style (
12469 \begin_inset Flex CharStyle:Code
12470 status collapsed
12471
12472 \begin_layout PlainLayout
12473 CharStyle
12474 \end_layout
12475
12476 \end_inset
12477
12478 ): These define semantic markup corresponding to such LaTeX commands as
12479  
12480 \begin_inset Flex CharStyle:Code
12481 status collapsed
12482
12483 \begin_layout PlainLayout
12484
12485 \backslash
12486 noun
12487 \end_layout
12488
12489 \end_inset
12490
12491  and 
12492 \begin_inset Flex CharStyle:Code
12493 status collapsed
12494
12495 \begin_layout PlainLayout
12496
12497 \backslash
12498 code
12499 \end_layout
12500
12501 \end_inset
12502
12503 .
12504 \end_layout
12505
12506 \begin_layout Itemize
12507 user custom (
12508 \begin_inset Flex CharStyle:Code
12509 status collapsed
12510
12511 \begin_layout PlainLayout
12512 Custom
12513 \end_layout
12514
12515 \end_inset
12516
12517 ): These can be used to define custom collapsable insets, similar to ERT,
12518  footnote, and the like.
12519 \end_layout
12520
12521 \begin_layout Itemize
12522 XML elements (
12523 \begin_inset Flex CharStyle:Code
12524 status collapsed
12525
12526 \begin_layout PlainLayout
12527 Element
12528 \end_layout
12529
12530 \end_inset
12531
12532 ): For use with DocBook classes.
12533 \end_layout
12534
12535 \begin_layout Standard
12536 The 
12537 \begin_inset Flex CharStyle:Code
12538 status collapsed
12539
12540 \begin_layout PlainLayout
12541 InsetLayout
12542 \end_layout
12543
12544 \end_inset
12545
12546  definition starting line is of the form
12547 \end_layout
12548
12549 \begin_layout LyX-Code
12550 InsetLayout <Type> <Name>
12551 \end_layout
12552
12553 \begin_layout Standard
12554 where 
12555 \begin_inset Flex CharStyle:Code
12556 status collapsed
12557
12558 \begin_layout PlainLayout
12559 <Type>
12560 \end_layout
12561
12562 \end_inset
12563
12564  can be 
12565 \begin_inset Flex CharStyle:Code
12566 status collapsed
12567
12568 \begin_layout PlainLayout
12569 Algorithm
12570 \end_layout
12571
12572 \end_inset
12573
12574
12575 \begin_inset Flex CharStyle:Code
12576 status collapsed
12577
12578 \begin_layout PlainLayout
12579 Branch
12580 \end_layout
12581
12582 \end_inset
12583
12584
12585 \begin_inset Flex CharStyle:Code
12586 status collapsed
12587
12588 \begin_layout PlainLayout
12589 Box
12590 \end_layout
12591
12592 \end_inset
12593
12594
12595 \begin_inset Flex CharStyle:Code
12596 status collapsed
12597
12598 \begin_layout PlainLayout
12599 ERT
12600 \end_layout
12601
12602 \end_inset
12603
12604
12605 \begin_inset Flex CharStyle:Code
12606 status collapsed
12607
12608 \begin_layout PlainLayout
12609 Figure
12610 \end_layout
12611
12612 \end_inset
12613
12614
12615 \begin_inset Flex CharStyle:Code
12616 status collapsed
12617
12618 \begin_layout PlainLayout
12619 Foot
12620 \end_layout
12621
12622 \end_inset
12623
12624
12625 \begin_inset Flex CharStyle:Code
12626 status collapsed
12627
12628 \begin_layout PlainLayout
12629 Index
12630 \end_layout
12631
12632 \end_inset
12633
12634
12635 \begin_inset Flex CharStyle:Code
12636 status collapsed
12637
12638 \begin_layout PlainLayout
12639 Listings
12640 \end_layout
12641
12642 \end_inset
12643
12644
12645 \begin_inset Flex CharStyle:Code
12646 status collapsed
12647
12648 \begin_layout PlainLayout
12649 Marginal
12650 \end_layout
12651
12652 \end_inset
12653
12654
12655 \begin_inset Flex CharStyle:Code
12656 status collapsed
12657
12658 \begin_layout PlainLayout
12659 Note:Comment
12660 \end_layout
12661
12662 \end_inset
12663
12664
12665 \begin_inset Flex CharStyle:Code
12666 status collapsed
12667
12668 \begin_layout PlainLayout
12669 Note:Note
12670 \end_layout
12671
12672 \end_inset
12673
12674
12675 \begin_inset Flex CharStyle:Code
12676 status collapsed
12677
12678 \begin_layout PlainLayout
12679 Note:GreyedOut
12680 \end_layout
12681
12682 \end_inset
12683
12684
12685 \begin_inset Flex CharStyle:Code
12686 status collapsed
12687
12688 \begin_layout PlainLayout
12689 OptArg
12690 \end_layout
12691
12692 \end_inset
12693
12694
12695 \begin_inset Flex CharStyle:Code
12696 status collapsed
12697
12698 \begin_layout PlainLayout
12699 Table
12700 \end_layout
12701
12702 \end_inset
12703
12704
12705 \begin_inset Flex CharStyle:Code
12706 status collapsed
12707
12708 \begin_layout PlainLayout
12709 URL
12710 \end_layout
12711
12712 \end_inset
12713
12714 , or 
12715 \begin_inset Flex CharStyle:Code
12716 status collapsed
12717
12718 \begin_layout PlainLayout
12719 Flex
12720 \end_layout
12721
12722 \end_inset
12723
12724 .
12725  If 
12726 \begin_inset Flex CharStyle:Code
12727 status collapsed
12728
12729 \begin_layout PlainLayout
12730 <Type>
12731 \end_layout
12732
12733 \end_inset
12734
12735  is 
12736 \begin_inset Flex CharStyle:Code
12737 status collapsed
12738
12739 \begin_layout PlainLayout
12740 Flex
12741 \end_layout
12742
12743 \end_inset
12744
12745 , then 
12746 \begin_inset Flex CharStyle:Code
12747 status collapsed
12748
12749 \begin_layout PlainLayout
12750 <Name>
12751 \end_layout
12752
12753 \end_inset
12754
12755  should have the form 
12756 \begin_inset Flex CharStyle:Code
12757 status collapsed
12758
12759 \begin_layout PlainLayout
12760 SubType:StyleName
12761 \end_layout
12762
12763 \end_inset
12764
12765 , where 
12766 \begin_inset Flex CharStyle:Code
12767 status collapsed
12768
12769 \begin_layout PlainLayout
12770 SubType
12771 \end_layout
12772
12773 \end_inset
12774
12775  is either 
12776 \begin_inset Flex CharStyle:Code
12777 status collapsed
12778
12779 \begin_layout PlainLayout
12780 CharStyle
12781 \end_layout
12782
12783 \end_inset
12784
12785
12786 \begin_inset Flex CharStyle:Code
12787 status collapsed
12788
12789 \begin_layout PlainLayout
12790 Custom
12791 \end_layout
12792
12793 \end_inset
12794
12795 , or 
12796 \begin_inset Flex CharStyle:Code
12797 status collapsed
12798
12799 \begin_layout PlainLayout
12800 Element
12801 \end_layout
12802
12803 \end_inset
12804
12805 , and 
12806 \begin_inset Flex CharStyle:Code
12807 status collapsed
12808
12809 \begin_layout PlainLayout
12810 StyleName
12811 \end_layout
12812
12813 \end_inset
12814
12815  is any valid identifier.
12816  
12817 \end_layout
12818
12819 \begin_layout Standard
12820 The following 
12821 \begin_inset Flex CharStyle:Code
12822 status collapsed
12823
12824 \begin_layout PlainLayout
12825 InsetLayout
12826 \end_layout
12827
12828 \end_inset
12829
12830  section can contain the following entries:
12831 \end_layout
12832
12833 \begin_layout Description
12834 \begin_inset Flex CharStyle:Code
12835 status collapsed
12836
12837 \begin_layout PlainLayout
12838 BgColor
12839 \end_layout
12840
12841 \end_inset
12842
12843  The color for the inset's background.
12844  These valid colors are defined in 
12845 \begin_inset Flex CharStyle:Code
12846 status collapsed
12847
12848 \begin_layout PlainLayout
12849 src/ColorCode.h
12850 \end_layout
12851
12852 \end_inset
12853
12854 .
12855 \end_layout
12856
12857 \begin_layout Description
12858 \begin_inset Flex CharStyle:Code
12859 status collapsed
12860
12861 \begin_layout PlainLayout
12862 Decoration
12863 \end_layout
12864
12865 \end_inset
12866
12867  can be 
12868 \begin_inset Flex CharStyle:Code
12869 status collapsed
12870
12871 \begin_layout PlainLayout
12872 Classic
12873 \end_layout
12874
12875 \end_inset
12876
12877
12878 \begin_inset Flex CharStyle:Code
12879 status collapsed
12880
12881 \begin_layout PlainLayout
12882 Minimalistic
12883 \end_layout
12884
12885 \end_inset
12886
12887 , or 
12888 \begin_inset Flex CharStyle:Code
12889 status collapsed
12890
12891 \begin_layout PlainLayout
12892 Conglomerate
12893 \end_layout
12894
12895 \end_inset
12896
12897 , describing the rendering style used for the inset's frame and buttons.
12898  Footnotes generally use 
12899 \begin_inset Flex CharStyle:Code
12900 status collapsed
12901
12902 \begin_layout PlainLayout
12903 Classic
12904 \end_layout
12905
12906 \end_inset
12907
12908 ; ERT insets generally use 
12909 \begin_inset Flex CharStyle:Code
12910 status collapsed
12911
12912 \begin_layout PlainLayout
12913 Minimalistic
12914 \end_layout
12915
12916 \end_inset
12917
12918 ; and character styles use 
12919 \begin_inset Flex CharStyle:Code
12920 status collapsed
12921
12922 \begin_layout PlainLayout
12923 Conglomerate
12924 \end_layout
12925
12926 \end_inset
12927
12928 .
12929 \end_layout
12930
12931 \begin_layout Description
12932 \begin_inset Flex CharStyle:Code
12933 status collapsed
12934
12935 \begin_layout PlainLayout
12936 Font
12937 \end_layout
12938
12939 \end_inset
12940
12941  The font used for both the text body 
12942 \emph on
12943 and
12944 \emph default
12945  the label.
12946  See section
12947 \begin_inset Space ~
12948 \end_inset
12949
12950
12951 \begin_inset CommandInset ref
12952 LatexCommand ref
12953 reference "sec:fonts"
12954
12955 \end_inset
12956
12957 .
12958  Note that defining this font automatically defines the 
12959 \begin_inset Flex CharStyle:Code
12960 status collapsed
12961
12962 \begin_layout PlainLayout
12963 LabelFont
12964 \end_layout
12965
12966 \end_inset
12967
12968  to the same value, so define this first and define 
12969 \begin_inset Flex CharStyle:Code
12970 status collapsed
12971
12972 \begin_layout PlainLayout
12973 LabelFont
12974 \end_layout
12975
12976 \end_inset
12977
12978  later if you want them to be different.
12979 \end_layout
12980
12981 \begin_layout Description
12982 \begin_inset Flex CharStyle:Code
12983 status collapsed
12984
12985 \begin_layout PlainLayout
12986 ForceLTR
12987 \end_layout
12988
12989 \end_inset
12990
12991  [[FIXME]]
12992 \end_layout
12993
12994 \begin_layout Description
12995 \begin_inset Flex CharStyle:Code
12996 status collapsed
12997
12998 \begin_layout PlainLayout
12999 FreeSpacing
13000 \end_layout
13001
13002 \end_inset
13003
13004  As with paragraph styles (see page 
13005 \begin_inset CommandInset ref
13006 LatexCommand pageref
13007 reference "des:FreeSpacing"
13008
13009 \end_inset
13010
13011 ).
13012 \end_layout
13013
13014 \begin_layout Description
13015 \begin_inset Flex CharStyle:Code
13016 status collapsed
13017
13018 \begin_layout PlainLayout
13019 KeepEmpty
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:KeepEmpty"
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 PlainLayout
13039 LabelString
13040 \end_layout
13041
13042 \end_inset
13043
13044  What will be displayed on the button or elsewhere as the inset label.
13045  Some inset types (ERT and Branch) modify this label on the fly.
13046 \end_layout
13047
13048 \begin_layout Description
13049 \begin_inset Flex CharStyle:Code
13050 status collapsed
13051
13052 \begin_layout PlainLayout
13053 LabelFont
13054 \end_layout
13055
13056 \end_inset
13057
13058  The font used for the label.
13059  See section
13060 \begin_inset Space ~
13061 \end_inset
13062
13063
13064 \begin_inset CommandInset ref
13065 LatexCommand ref
13066 reference "sec:fonts"
13067
13068 \end_inset
13069
13070 .
13071  Note that this definition can never appear before 
13072 \begin_inset Flex CharStyle:Code
13073 status collapsed
13074
13075 \begin_layout PlainLayout
13076 Font
13077 \end_layout
13078
13079 \end_inset
13080
13081 , lest it be ineffective.
13082 \end_layout
13083
13084 \begin_layout Description
13085 \begin_inset Flex CharStyle:Code
13086 status collapsed
13087
13088 \begin_layout PlainLayout
13089 LatexName
13090 \end_layout
13091
13092 \end_inset
13093
13094  The name of the corresponding LaTeX stuff.
13095  Either the environment or command name.
13096 \end_layout
13097
13098 \begin_layout Description
13099 \begin_inset Flex CharStyle:Code
13100 status collapsed
13101
13102 \begin_layout PlainLayout
13103 LatexParam
13104 \end_layout
13105
13106 \end_inset
13107
13108  The optional parameter for the corresponding 
13109 \begin_inset Flex CharStyle:Code
13110 status collapsed
13111
13112 \begin_layout PlainLayout
13113 LatexName
13114 \end_layout
13115
13116 \end_inset
13117
13118  stuff, including possible bracket pairs like 
13119 \begin_inset Flex CharStyle:Code
13120 status collapsed
13121
13122 \begin_layout PlainLayout
13123 []
13124 \end_layout
13125
13126 \end_inset
13127
13128 .
13129  This parameter cannot be changed from within LyX.
13130 \end_layout
13131
13132 \begin_layout Description
13133 \begin_inset Flex CharStyle:Code
13134 status collapsed
13135
13136 \begin_layout PlainLayout
13137 LatexType
13138 \end_layout
13139
13140 \end_inset
13141
13142  As with paragraph styles (see page 
13143 \begin_inset CommandInset ref
13144 LatexCommand pageref
13145 reference "des:LatexType"
13146
13147 \end_inset
13148
13149 ).
13150 \end_layout
13151
13152 \begin_layout Description
13153 \begin_inset Flex CharStyle:Code
13154 status collapsed
13155
13156 \begin_layout PlainLayout
13157 LyxType 
13158 \end_layout
13159
13160 \end_inset
13161
13162  Can be 
13163 \begin_inset Flex CharStyle:Code
13164 status collapsed
13165
13166 \begin_layout PlainLayout
13167 charstyle
13168 \end_layout
13169
13170 \end_inset
13171
13172
13173 \begin_inset Flex CharStyle:Code
13174 status collapsed
13175
13176 \begin_layout PlainLayout
13177 custom
13178 \end_layout
13179
13180 \end_inset
13181
13182
13183 \begin_inset Flex CharStyle:Code
13184 status collapsed
13185
13186 \begin_layout PlainLayout
13187 element
13188 \end_layout
13189
13190 \end_inset
13191
13192
13193 \begin_inset Flex CharStyle:Code
13194 status collapsed
13195
13196 \begin_layout PlainLayout
13197 end
13198 \end_layout
13199
13200 \end_inset
13201
13202  (indicating a dummy definition ending definitions of charstyles etc.).
13203  This entry is only meaningful for Flex (user definable) insets.
13204 \end_layout
13205
13206 \begin_layout Description
13207 \begin_inset Flex CharStyle:Code
13208 status collapsed
13209
13210 \begin_layout PlainLayout
13211 Preamble
13212 \end_layout
13213
13214 \end_inset
13215
13216  As with paragraph styles (see page 
13217 \begin_inset CommandInset ref
13218 LatexCommand pageref
13219 reference "des:Preamble"
13220
13221 \end_inset
13222
13223 ).
13224 \end_layout
13225
13226 \begin_layout Description
13227 \begin_inset Flex CharStyle:Code
13228 status collapsed
13229
13230 \begin_layout PlainLayout
13231 Requires 
13232 \end_layout
13233
13234 \end_inset
13235
13236  [
13237 \begin_inset Flex CharStyle:Code
13238 status collapsed
13239
13240 \begin_layout PlainLayout
13241 string
13242 \end_layout
13243
13244 \end_inset
13245
13246 ] As with paragraph styles (see page 
13247 \begin_inset CommandInset ref
13248 LatexCommand pageref
13249 reference "des:Requires"
13250
13251 \end_inset
13252
13253 ).
13254 \end_layout
13255
13256 \begin_layout Subsection
13257 Counters
13258 \end_layout
13259
13260 \begin_layout Standard
13261 \begin_inset CommandInset label
13262 LatexCommand label
13263 name "sec:counter"
13264
13265 \end_inset
13266
13267 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13268  counters (
13269 \begin_inset Flex CharStyle:MenuItem
13270 status collapsed
13271
13272 \begin_layout PlainLayout
13273 chapter
13274 \end_layout
13275
13276 \end_inset
13277
13278
13279 \begin_inset Flex CharStyle:MenuItem
13280 status collapsed
13281
13282 \begin_layout PlainLayout
13283 figure
13284 \end_layout
13285
13286 \end_inset
13287
13288 , \SpecialChar \ldots{}
13289 ) in the text class itself.
13290  The standard counters are defined in the file 
13291 \begin_inset Flex CharStyle:Code
13292 status collapsed
13293
13294 \begin_layout PlainLayout
13295 stdcounters.inc
13296 \end_layout
13297
13298 \end_inset
13299
13300 , so you may have to do no more than add
13301 \end_layout
13302
13303 \begin_layout LyX-Code
13304 Input stdcounters.inc
13305 \end_layout
13306
13307 \begin_layout Standard
13308 to your layout file to get them to work.
13309  But if you want to define custom counters, then you can do so, using the
13310  following parameters:
13311 \end_layout
13312
13313 \begin_layout Description
13314 \begin_inset Flex CharStyle:Code
13315 status collapsed
13316
13317 \begin_layout PlainLayout
13318 LabelString [string=""]
13319 \end_layout
13320
13321 \end_inset
13322
13323  when this is defined, this string defines how the counter is displayed.
13324  Setting this value sets 
13325 \begin_inset Flex CharStyle:Code
13326 status collapsed
13327
13328 \begin_layout PlainLayout
13329 LabelStringAppendix
13330 \end_layout
13331
13332 \end_inset
13333
13334  to the same value.
13335  The following special constructs can be used in the string:
13336 \end_layout
13337
13338 \begin_deeper
13339 \begin_layout Itemize
13340 \begin_inset Flex CharStyle:Code
13341 status collapsed
13342
13343 \begin_layout PlainLayout
13344
13345 \backslash
13346 thecounter
13347 \end_layout
13348
13349 \end_inset
13350
13351  will be replaced by the expansion of the 
13352 \begin_inset Flex CharStyle:Code
13353 status collapsed
13354
13355 \begin_layout PlainLayout
13356 LabelString
13357 \end_layout
13358
13359 \end_inset
13360
13361  (or 
13362 \begin_inset Flex CharStyle:Code
13363 status collapsed
13364
13365 \begin_layout PlainLayout
13366 LabelStringAppendix
13367 \end_layout
13368
13369 \end_inset
13370
13371 ) of the counter 
13372 \begin_inset Flex CharStyle:Code
13373 status collapsed
13374
13375 \begin_layout PlainLayout
13376 counter
13377 \end_layout
13378
13379 \end_inset
13380
13381 .
13382  
13383 \end_layout
13384
13385 \begin_layout Itemize
13386 counter values can be expressed using LaTeX-like macros 
13387 \begin_inset Flex CharStyle:Code
13388 status collapsed
13389
13390 \begin_layout PlainLayout
13391
13392 \backslash
13393
13394 \emph on
13395 numbertype
13396 \emph default
13397 {
13398 \emph on
13399 counter
13400 \emph default
13401 }
13402 \end_layout
13403
13404 \end_inset
13405
13406 , where 
13407 \begin_inset Flex CharStyle:Code
13408 status collapsed
13409
13410 \begin_layout PlainLayout
13411
13412 \emph on
13413 numbertype
13414 \end_layout
13415
13416 \end_inset
13417
13418  can be:
13419 \begin_inset Foot
13420 status collapsed
13421
13422 \begin_layout PlainLayout
13423
13424 \family roman
13425 \series medium
13426 \shape up
13427 \size normal
13428 \emph off
13429 \bar no
13430 \noun off
13431 \color none
13432 Actually, the situation is a bit more complicated: any
13433 \family default
13434 \series default
13435 \shape default
13436 \emph default
13437 \bar default
13438  
13439 \size default
13440 \emph on
13441 \noun default
13442 \color inherit
13443 numbertype
13444 \family roman
13445 \series medium
13446 \shape up
13447 \size normal
13448 \emph off
13449 \bar no
13450 \noun off
13451  other than those descibed below will produce arabic numerals.
13452  It would not be surprising to see this change in the future.
13453 \end_layout
13454
13455 \end_inset
13456
13457  
13458 \begin_inset Flex CharStyle:Code
13459 status collapsed
13460
13461 \begin_layout PlainLayout
13462 arabic
13463 \end_layout
13464
13465 \end_inset
13466
13467 : 1, 2, 3,\SpecialChar \ldots{}
13468
13469 \begin_inset Flex CharStyle:Code
13470 status collapsed
13471
13472 \begin_layout PlainLayout
13473 alph
13474 \end_layout
13475
13476 \end_inset
13477
13478  for lower-case letters: a, b, c, \SpecialChar \ldots{}
13479
13480 \begin_inset Flex CharStyle:Code
13481 status collapsed
13482
13483 \begin_layout PlainLayout
13484 Alph
13485 \end_layout
13486
13487 \end_inset
13488
13489  for upper-case letters: A, B, C, \SpecialChar \ldots{}
13490
13491 \begin_inset Flex CharStyle:Code
13492 status collapsed
13493
13494 \begin_layout PlainLayout
13495 roman
13496 \end_layout
13497
13498 \end_inset
13499
13500  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13501
13502 \begin_inset Flex CharStyle:Code
13503 status collapsed
13504
13505 \begin_layout PlainLayout
13506 Roman
13507 \end_layout
13508
13509 \end_inset
13510
13511  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13512
13513 \begin_inset Flex CharStyle:Code
13514 status collapsed
13515
13516 \begin_layout PlainLayout
13517 hebrew
13518 \end_layout
13519
13520 \end_inset
13521
13522  for hebrew numerals.
13523 \end_layout
13524
13525 \end_deeper
13526 \begin_layout Standard
13527 If LabelString is not defined, a default value is constructed as follows:
13528  if the counter has a master counter 
13529 \begin_inset Flex CharStyle:Code
13530 status collapsed
13531
13532 \begin_layout PlainLayout
13533 master
13534 \end_layout
13535
13536 \end_inset
13537
13538  (defined via 
13539 \begin_inset Flex CharStyle:Code
13540 status collapsed
13541
13542 \begin_layout PlainLayout
13543 Within
13544 \end_layout
13545
13546 \end_inset
13547
13548 ), the string 
13549 \begin_inset Flex CharStyle:Code
13550 status collapsed
13551
13552 \begin_layout PlainLayout
13553
13554 \backslash
13555 themaster.
13556 \backslash
13557 arabic{counter}
13558 \end_layout
13559
13560 \end_inset
13561
13562  is used; otherwise the string 
13563 \begin_inset Flex CharStyle:Code
13564 status collapsed
13565
13566 \begin_layout PlainLayout
13567
13568 \backslash
13569 arabic{counter}
13570 \end_layout
13571
13572 \end_inset
13573
13574  is used.
13575 \end_layout
13576
13577 \begin_layout Description
13578 \begin_inset Flex CharStyle:Code
13579 status collapsed
13580
13581 \begin_layout PlainLayout
13582 LabelStringAppendix [string=""]
13583 \end_layout
13584
13585 \end_inset
13586
13587  Same as 
13588 \begin_inset Flex CharStyle:Code
13589 status collapsed
13590
13591 \begin_layout PlainLayout
13592 LabelString
13593 \end_layout
13594
13595 \end_inset
13596
13597 .
13598 \end_layout
13599
13600 \begin_layout Description
13601 \begin_inset Flex CharStyle:Code
13602 status collapsed
13603
13604 \begin_layout PlainLayout
13605 Name
13606 \end_layout
13607
13608 \end_inset
13609
13610  [
13611 \begin_inset Flex CharStyle:Code
13612 status collapsed
13613
13614 \begin_layout PlainLayout
13615 string
13616 \end_layout
13617
13618 \end_inset
13619
13620 =
13621 \begin_inset Quotes erd
13622 \end_inset
13623
13624
13625 \begin_inset Quotes erd
13626 \end_inset
13627
13628 ] The name of the counter.
13629 \end_layout
13630
13631 \begin_layout Description
13632 \begin_inset Flex CharStyle:Code
13633 status collapsed
13634
13635 \begin_layout PlainLayout
13636 Within
13637 \end_layout
13638
13639 \end_inset
13640
13641  [
13642 \begin_inset Flex CharStyle:Code
13643 status collapsed
13644
13645 \begin_layout PlainLayout
13646 string
13647 \end_layout
13648
13649 \end_inset
13650
13651 =
13652 \begin_inset Quotes erd
13653 \end_inset
13654
13655
13656 \begin_inset Quotes erd
13657 \end_inset
13658
13659 ] If this is set to the name of another counter, the present counter will
13660  be reset everytime the other one is increased.
13661  For example, 
13662 \begin_inset Flex CharStyle:Code
13663 status collapsed
13664
13665 \begin_layout PlainLayout
13666 subsection
13667 \end_layout
13668
13669 \end_inset
13670
13671  is numbered inside 
13672 \begin_inset Flex CharStyle:Code
13673 status collapsed
13674
13675 \begin_layout PlainLayout
13676 section
13677 \end_layout
13678
13679 \end_inset
13680
13681 .
13682 \end_layout
13683
13684 \begin_layout Subsection
13685 Font description
13686 \end_layout
13687
13688 \begin_layout Standard
13689 \begin_inset CommandInset label
13690 LatexCommand label
13691 name "sec:fonts"
13692
13693 \end_inset
13694
13695 A font description looks like this:
13696 \end_layout
13697
13698 \begin_layout LyX-Code
13699 Font 
13700 \family roman
13701 \emph on
13702 or
13703 \family default
13704 \emph default
13705  LabelFont
13706 \end_layout
13707
13708 \begin_layout LyX-Code
13709  ...
13710 \end_layout
13711
13712 \begin_layout LyX-Code
13713 EndFont
13714 \end_layout
13715
13716 \begin_layout Standard
13717 The following commands are available:
13718 \end_layout
13719
13720 \begin_layout Description
13721 \begin_inset Flex CharStyle:Code
13722 status collapsed
13723
13724 \begin_layout PlainLayout
13725 Color
13726 \end_layout
13727
13728 \end_inset
13729
13730  [
13731 \begin_inset Flex CharStyle:Code
13732 status collapsed
13733
13734 \begin_layout PlainLayout
13735
13736 \emph on
13737 none
13738 \end_layout
13739
13740 \end_inset
13741
13742
13743 \begin_inset Flex CharStyle:Code
13744 status collapsed
13745
13746 \begin_layout PlainLayout
13747 black
13748 \end_layout
13749
13750 \end_inset
13751
13752
13753 \begin_inset Flex CharStyle:Code
13754 status collapsed
13755
13756 \begin_layout PlainLayout
13757 white
13758 \end_layout
13759
13760 \end_inset
13761
13762
13763 \begin_inset Flex CharStyle:Code
13764 status collapsed
13765
13766 \begin_layout PlainLayout
13767 red
13768 \end_layout
13769
13770 \end_inset
13771
13772
13773 \begin_inset Flex CharStyle:Code
13774 status collapsed
13775
13776 \begin_layout PlainLayout
13777 green
13778 \end_layout
13779
13780 \end_inset
13781
13782
13783 \begin_inset Flex CharStyle:Code
13784 status collapsed
13785
13786 \begin_layout PlainLayout
13787 blue
13788 \end_layout
13789
13790 \end_inset
13791
13792
13793 \begin_inset Flex CharStyle:Code
13794 status collapsed
13795
13796 \begin_layout PlainLayout
13797 cyan
13798 \end_layout
13799
13800 \end_inset
13801
13802
13803 \begin_inset Flex CharStyle:Code
13804 status collapsed
13805
13806 \begin_layout PlainLayout
13807 magenta
13808 \end_layout
13809
13810 \end_inset
13811
13812
13813 \begin_inset Flex CharStyle:Code
13814 status collapsed
13815
13816 \begin_layout PlainLayout
13817 yellow
13818 \end_layout
13819
13820 \end_inset
13821
13822 ]
13823 \end_layout
13824
13825 \begin_layout Description
13826 \begin_inset Flex CharStyle:Code
13827 status collapsed
13828
13829 \begin_layout PlainLayout
13830 Family
13831 \end_layout
13832
13833 \end_inset
13834
13835  [
13836 \emph on
13837
13838 \begin_inset Flex CharStyle:Code
13839 status collapsed
13840
13841 \begin_layout PlainLayout
13842
13843 \emph on
13844 Roman
13845 \end_layout
13846
13847 \end_inset
13848
13849
13850 \emph default
13851
13852 \begin_inset Flex CharStyle:Code
13853 status collapsed
13854
13855 \begin_layout PlainLayout
13856 Sans
13857 \end_layout
13858
13859 \end_inset
13860
13861
13862 \begin_inset Flex CharStyle:Code
13863 status collapsed
13864
13865 \begin_layout PlainLayout
13866 Typewriter
13867 \end_layout
13868
13869 \end_inset
13870
13871
13872 \end_layout
13873
13874 \begin_layout Description
13875 \begin_inset Flex CharStyle:Code
13876 status collapsed
13877
13878 \begin_layout PlainLayout
13879 Misc
13880 \end_layout
13881
13882 \end_inset
13883
13884  [
13885 \begin_inset Flex CharStyle:Code
13886 status collapsed
13887
13888 \begin_layout PlainLayout
13889 string
13890 \end_layout
13891
13892 \end_inset
13893
13894 ] Valid argument sare: 
13895 \begin_inset Flex CharStyle:Code
13896 status collapsed
13897
13898 \begin_layout PlainLayout
13899 emph
13900 \end_layout
13901
13902 \end_inset
13903
13904
13905 \begin_inset Flex CharStyle:Code
13906 status collapsed
13907
13908 \begin_layout PlainLayout
13909 noun
13910 \end_layout
13911
13912 \end_inset
13913
13914
13915 \begin_inset Flex CharStyle:Code
13916 status collapsed
13917
13918 \begin_layout PlainLayout
13919 underbar
13920 \end_layout
13921
13922 \end_inset
13923
13924
13925 \begin_inset Flex CharStyle:Code
13926 status collapsed
13927
13928 \begin_layout PlainLayout
13929 no_emph
13930 \end_layout
13931
13932 \end_inset
13933
13934
13935 \begin_inset Flex CharStyle:Code
13936 status collapsed
13937
13938 \begin_layout PlainLayout
13939 no_noun
13940 \end_layout
13941
13942 \end_inset
13943
13944  and 
13945 \begin_inset Flex CharStyle:Code
13946 status collapsed
13947
13948 \begin_layout PlainLayout
13949 no_bar
13950 \end_layout
13951
13952 \end_inset
13953
13954 .
13955  Each of these turns on or off the corresponding attribute.
13956 \end_layout
13957
13958 \begin_layout Description
13959 \begin_inset Flex CharStyle:Code
13960 status collapsed
13961
13962 \begin_layout PlainLayout
13963 Series
13964 \end_layout
13965
13966 \end_inset
13967
13968  [
13969 \emph on
13970
13971 \begin_inset Flex CharStyle:Code
13972 status collapsed
13973
13974 \begin_layout PlainLayout
13975
13976 \emph on
13977 Medium
13978 \end_layout
13979
13980 \end_inset
13981
13982
13983 \emph default
13984
13985 \begin_inset Flex CharStyle:Code
13986 status collapsed
13987
13988 \begin_layout PlainLayout
13989 Bold
13990 \end_layout
13991
13992 \end_inset
13993
13994
13995 \end_layout
13996
13997 \begin_layout Description
13998 \begin_inset Flex CharStyle:Code
13999 status collapsed
14000
14001 \begin_layout PlainLayout
14002 Shape
14003 \end_layout
14004
14005 \end_inset
14006
14007  [
14008 \emph on
14009
14010 \begin_inset Flex CharStyle:Code
14011 status collapsed
14012
14013 \begin_layout PlainLayout
14014
14015 \emph on
14016 Up
14017 \end_layout
14018
14019 \end_inset
14020
14021
14022 \emph default
14023
14024 \begin_inset Flex CharStyle:Code
14025 status collapsed
14026
14027 \begin_layout PlainLayout
14028 Italic
14029 \end_layout
14030
14031 \end_inset
14032
14033
14034 \begin_inset Flex CharStyle:Code
14035 status collapsed
14036
14037 \begin_layout PlainLayout
14038 SmallCaps
14039 \end_layout
14040
14041 \end_inset
14042
14043
14044 \begin_inset Flex CharStyle:Code
14045 status collapsed
14046
14047 \begin_layout PlainLayout
14048 Slanted
14049 \end_layout
14050
14051 \end_inset
14052
14053
14054 \end_layout
14055
14056 \begin_layout Description
14057 \begin_inset Flex CharStyle:Code
14058 status collapsed
14059
14060 \begin_layout PlainLayout
14061 Size
14062 \end_layout
14063
14064 \end_inset
14065
14066  [
14067 \begin_inset Flex CharStyle:Code
14068 status collapsed
14069
14070 \begin_layout PlainLayout
14071 tiny
14072 \end_layout
14073
14074 \end_inset
14075
14076
14077 \begin_inset Flex CharStyle:Code
14078 status collapsed
14079
14080 \begin_layout PlainLayout
14081 small
14082 \end_layout
14083
14084 \end_inset
14085
14086
14087 \begin_inset Flex CharStyle:Code
14088 status collapsed
14089
14090 \begin_layout PlainLayout
14091
14092 \emph on
14093 normal
14094 \end_layout
14095
14096 \end_inset
14097
14098
14099 \begin_inset Flex CharStyle:Code
14100 status collapsed
14101
14102 \begin_layout PlainLayout
14103 large
14104 \end_layout
14105
14106 \end_inset
14107
14108
14109 \begin_inset Flex CharStyle:Code
14110 status collapsed
14111
14112 \begin_layout PlainLayout
14113 larger
14114 \end_layout
14115
14116 \end_inset
14117
14118
14119 \begin_inset Flex CharStyle:Code
14120 status collapsed
14121
14122 \begin_layout PlainLayout
14123 largest
14124 \end_layout
14125
14126 \end_inset
14127
14128
14129 \begin_inset Flex CharStyle:Code
14130 status collapsed
14131
14132 \begin_layout PlainLayout
14133 huge
14134 \end_layout
14135
14136 \end_inset
14137
14138
14139 \begin_inset Flex CharStyle:Code
14140 status collapsed
14141
14142 \begin_layout PlainLayout
14143 giant
14144 \end_layout
14145
14146 \end_inset
14147
14148 ]
14149 \end_layout
14150
14151 \begin_layout Subsection
14152 Upgrading old layout files
14153 \end_layout
14154
14155 \begin_layout Standard
14156 The file format of layout files changes from time to time, so old layout
14157  files need to be converted.
14158  This process has been automated since LyX 1.4.0: If LyX reads an old format
14159  layout file it will call the conversion tool 
14160 \begin_inset Flex CharStyle:Code
14161 status collapsed
14162
14163 \begin_layout PlainLayout
14164 LyXDir/scripts/layout2layout.py
14165 \end_layout
14166
14167 \end_inset
14168
14169  and convert it to a temporary file in current format.
14170  The original file is left untouched.
14171  If you want to convert the layout file permanently, just call the converter
14172  by hand:
14173 \end_layout
14174
14175 \begin_layout LyX-Code
14176 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14177 \end_layout
14178
14179 \begin_layout Standard
14180 (You need to replace 
14181 \begin_inset Flex CharStyle:Code
14182 status collapsed
14183
14184 \begin_layout PlainLayout
14185 $LyXDir
14186 \end_layout
14187
14188 \end_inset
14189
14190  with the name of your LyX system directory, unless you happen to have defined
14191  such an environment variable.) Then copy 
14192 \begin_inset Flex CharStyle:Code
14193 status collapsed
14194
14195 \begin_layout PlainLayout
14196 myclassnew.layout
14197 \end_layout
14198
14199 \end_inset
14200
14201  to 
14202 \begin_inset Flex CharStyle:Code
14203 status collapsed
14204
14205 \begin_layout PlainLayout
14206 UserDir/layouts/
14207 \end_layout
14208
14209 \end_inset
14210
14211 .
14212 \end_layout
14213
14214 \begin_layout Standard
14215 The automatic conversion only handles syntax changes.
14216  It cannot handle the case where the contents of included files was changed,
14217  so these will have to be converted separately.
14218 \end_layout
14219
14220 \begin_layout Section
14221 Creating Templates
14222 \begin_inset CommandInset label
14223 LatexCommand label
14224 name "sec:templates"
14225
14226 \end_inset
14227
14228
14229 \end_layout
14230
14231 \begin_layout Standard
14232 Templates are created just like usual documents.
14233  The only difference is that usual documents contain all possible settings,
14234  including the font scheme and the paper size.
14235  Usually a user doesn't want a template to overwrite his defaults in these
14236  cases.
14237  For that reason, the designer of a template should remove the corresponding
14238  commands like 
14239 \begin_inset Flex CharStyle:Code
14240 status collapsed
14241
14242 \begin_layout PlainLayout
14243
14244 \backslash
14245 fontscheme
14246 \end_layout
14247
14248 \end_inset
14249
14250  or 
14251 \begin_inset Flex CharStyle:Code
14252 status collapsed
14253
14254 \begin_layout PlainLayout
14255
14256 \backslash
14257 papersize
14258 \end_layout
14259
14260 \end_inset
14261
14262  from the template LyX file.
14263  This can be done with any simple text-editor, for example 
14264 \begin_inset Flex CharStyle:Code
14265 status collapsed
14266
14267 \begin_layout PlainLayout
14268 vi
14269 \end_layout
14270
14271 \end_inset
14272
14273  or 
14274 \begin_inset Flex CharStyle:Code
14275 status collapsed
14276
14277 \begin_layout PlainLayout
14278 xedit
14279 \end_layout
14280
14281 \end_inset
14282
14283 .
14284  
14285 \end_layout
14286
14287 \begin_layout Standard
14288 Put the edited template files you create in 
14289 \begin_inset Flex CharStyle:Code
14290 status collapsed
14291
14292 \begin_layout PlainLayout
14293 UserDir/templates/
14294 \end_layout
14295
14296 \end_inset
14297
14298 , copy the ones you use from the global template directory in 
14299 \begin_inset Flex CharStyle:Code
14300 status collapsed
14301
14302 \begin_layout PlainLayout
14303 LyXDir/templates/
14304 \end_layout
14305
14306 \end_inset
14307
14308  to the same place, and redefine the template path in the 
14309 \begin_inset Flex CharStyle:MenuItem
14310 status collapsed
14311
14312 \begin_layout PlainLayout
14313
14314 \bar under
14315 T
14316 \family sans
14317 \bar default
14318 ools
14319 \family default
14320 \SpecialChar \menuseparator
14321
14322 \bar under
14323 P
14324 \bar default
14325 references\SpecialChar \menuseparator
14326 Paths
14327 \end_layout
14328
14329 \end_inset
14330
14331  dialog.
14332 \end_layout
14333
14334 \begin_layout Standard
14335 Note that there is a template which has a particular meaning: 
14336 \begin_inset Flex CharStyle:Code
14337 status collapsed
14338
14339 \begin_layout PlainLayout
14340 defaults.lyx
14341 \end_layout
14342
14343 \end_inset
14344
14345 .
14346  This template is loaded everytime you create a new document with 
14347 \begin_inset Flex CharStyle:MenuItem
14348 status collapsed
14349
14350 \begin_layout PlainLayout
14351
14352 \bar under
14353 F
14354 \bar default
14355 ile
14356 \end_layout
14357
14358 \end_inset
14359
14360 \SpecialChar \menuseparator
14361
14362 \begin_inset Flex CharStyle:MenuItem
14363 status collapsed
14364
14365 \begin_layout PlainLayout
14366
14367 \bar under
14368 N
14369 \bar default
14370 ew
14371 \end_layout
14372
14373 \end_inset
14374
14375  in order to provide useful defaults.
14376  To create this template from inside LyX, all you have to do is to open
14377  a document with the correct settings, and use the 
14378 \begin_inset Flex CharStyle:MenuItem
14379 status collapsed
14380
14381 \begin_layout PlainLayout
14382 Sa
14383 \bar under
14384 v
14385 \bar default
14386 e as Document Defaults
14387 \end_layout
14388
14389 \end_inset
14390
14391  button.
14392 \end_layout
14393
14394 \begin_layout Chapter
14395 Including External Material
14396 \end_layout
14397
14398 \begin_layout Standard
14399 The use of material from sources external to LyX is covered in detail in
14400  the 
14401 \emph on
14402 Embedded Objects
14403 \emph default
14404  manual.
14405  This part of the manual covers what needs to happen behind the scenes for
14406  new sorts of material to be included.
14407 \end_layout
14408
14409 \begin_layout Section
14410 How does it work?
14411 \end_layout
14412
14413 \begin_layout Standard
14414 The external material feature is based on the concept of a 
14415 \emph on
14416 template
14417 \emph default
14418 .
14419  A template is a specification of how LyX should interface with a certain
14420  kind of material.
14421  As bundled, LyX comes with predefined templates for Xfig figures, various
14422  raster format images, chess diagrams, and LilyPond music notation.
14423  You can check the actual list by using the menu 
14424 \begin_inset Flex CharStyle:MenuItem
14425 status collapsed
14426
14427 \begin_layout PlainLayout
14428 Insert\SpecialChar \menuseparator
14429 File\SpecialChar \menuseparator
14430 External Material
14431 \end_layout
14432
14433 \end_inset
14434
14435 .
14436  Furthermore, it is possible to roll your own template to support a specific
14437  kind of material.
14438  Later we'll describe in more detail what is involved, and hopefully you
14439  will submit all the templates you create so we can include them in a later
14440  LyX version.
14441 \end_layout
14442
14443 \begin_layout Standard
14444 Another basic idea of the external material feature is to distinguish between
14445  the original file that serves as a base for final material and the produced
14446  file that is included in your exported or printed document.
14447  For example, consider the case of a figure produced with 
14448 \begin_inset Flex CharStyle:Code
14449 status collapsed
14450
14451 \begin_layout PlainLayout
14452 Xfig
14453 \end_layout
14454
14455 \end_inset
14456
14457 .
14458  The Xfig application itself works on an original file with the 
14459 \begin_inset Flex CharStyle:Code
14460 status collapsed
14461
14462 \begin_layout PlainLayout
14463 .fig
14464 \end_layout
14465
14466 \end_inset
14467
14468  extension.
14469  Within XFig, you create and change your figure, and when you are done,
14470  you save the 
14471 \begin_inset Flex CharStyle:Code
14472 status collapsed
14473
14474 \begin_layout PlainLayout
14475 fig
14476 \end_layout
14477
14478 \end_inset
14479
14480 -file.
14481  When you want to include the figure in your document, you invoke 
14482 \begin_inset Flex CharStyle:Code
14483 status collapsed
14484
14485 \begin_layout PlainLayout
14486 transfig
14487 \end_layout
14488
14489 \end_inset
14490
14491  in order to create a PostScript file that can readily be included in your
14492  LaTeX file.
14493  In this case, the 
14494 \begin_inset Flex CharStyle:Code
14495 status collapsed
14496
14497 \begin_layout PlainLayout
14498 .fig
14499 \end_layout
14500
14501 \end_inset
14502
14503  file is the original file, and the PostScript file is the produced file.
14504 \end_layout
14505
14506 \begin_layout Standard
14507 This distinction is important in order to allow updating of the material
14508  while you are in the process of writing the document.
14509  Furthermore, it provides us with the flexibility that is needed to support
14510  multiple export formats.
14511  For instance, in the case of a plain text file, it is not exactly an award-winn
14512 ing idea to include the figure as raw PostScript®.
14513  Instead, you'd either prefer to just include a reference to the figure
14514  or try to invoke some graphics to Ascii converter to make the final result
14515  look similar to the real graphics.
14516  The external material management allows you to do this, because it is parameter
14517 ized on the different export formats that LyX supports.
14518 \end_layout
14519
14520 \begin_layout Standard
14521 Besides supporting the production of different products according to the
14522  exported format, it supports tight integration with editing and viewing
14523  applications.
14524  In the case of an XFig figure, you are able to invoke Xfig on the original
14525  file with a single click from within the external material dialog in LyX,
14526  and also preview the produced PostScript file with ghostview with another
14527  click.
14528  No more fiddling around with the command line and/or file browsers to locate
14529  and manipulate the original or produced files.
14530  In this way, you are finally able to take full advantage of the many different
14531  applications that are relevant to use when you write your documents, and
14532  ultimately be more productive.
14533 \end_layout
14534
14535 \begin_layout Section
14536 The external template configuration file
14537 \end_layout
14538
14539 \begin_layout Standard
14540 It is relatively easy to add custom external template definitions to LyX.
14541  However, be aware that doing this in an careless manner most probably 
14542 \emph on
14543 will
14544 \emph default
14545  introduce an easily exploitable security hole.
14546  So before you do this, please read the discussion about security in section
14547  
14548 \begin_inset CommandInset ref
14549 LatexCommand ref
14550 reference "sec:Security-discussion"
14551
14552 \end_inset
14553
14554 .
14555 \end_layout
14556
14557 \begin_layout Standard
14558 Having said that, we encourage you to submit any interesting templates that
14559  you create.
14560  
14561 \end_layout
14562
14563 \begin_layout Standard
14564 The external templates are defined in the 
14565 \begin_inset Flex CharStyle:Code
14566 status collapsed
14567
14568 \begin_layout PlainLayout
14569 LyXDir/lib/external_templates
14570 \end_layout
14571
14572 \end_inset
14573
14574  file.
14575  You can place your own version in 
14576 \begin_inset Flex CharStyle:Code
14577 status collapsed
14578
14579 \begin_layout PlainLayout
14580 UserDir/external_templates
14581 \end_layout
14582
14583 \end_inset
14584
14585 .
14586 \end_layout
14587
14588 \begin_layout Standard
14589 A typical template looks like this:
14590 \end_layout
14591
14592 \begin_layout LyX-Code
14593 Template XFig
14594 \end_layout
14595
14596 \begin_layout LyX-Code
14597 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14598 \end_layout
14599
14600 \begin_layout LyX-Code
14601 HelpText
14602 \end_layout
14603
14604 \begin_layout LyX-Code
14605 An XFig figure.
14606 \end_layout
14607
14608 \begin_layout LyX-Code
14609 HelpTextEnd
14610 \end_layout
14611
14612 \begin_layout LyX-Code
14613 InputFormat fig
14614 \end_layout
14615
14616 \begin_layout LyX-Code
14617 FileFilter "*.fig"
14618 \end_layout
14619
14620 \begin_layout LyX-Code
14621 AutomaticProduction true
14622 \end_layout
14623
14624 \begin_layout LyX-Code
14625 Transform Rotate
14626 \end_layout
14627
14628 \begin_layout LyX-Code
14629 Transform Resize
14630 \end_layout
14631
14632 \begin_layout LyX-Code
14633 Format LaTeX
14634 \end_layout
14635
14636 \begin_layout LyX-Code
14637 TransformCommand Rotate RotationLatexCommand
14638 \end_layout
14639
14640 \begin_layout LyX-Code
14641 TransformCommand Resize ResizeLatexCommand
14642 \end_layout
14643
14644 \begin_layout LyX-Code
14645 Product "$$RotateFront$$ResizeFront
14646 \end_layout
14647
14648 \begin_layout LyX-Code
14649          
14650 \backslash
14651
14652 \backslash
14653 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14654 \end_layout
14655
14656 \begin_layout LyX-Code
14657          $$ResizeBack$$RotateBack"
14658 \end_layout
14659
14660 \begin_layout LyX-Code
14661 UpdateFormat pstex
14662 \end_layout
14663
14664 \begin_layout LyX-Code
14665 UpdateResult "$$AbsPath$$Basename.pstex_t"
14666 \end_layout
14667
14668 \begin_layout LyX-Code
14669 Requirement "graphicx"
14670 \end_layout
14671
14672 \begin_layout LyX-Code
14673 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14674 \end_layout
14675
14676 \begin_layout LyX-Code
14677 ReferencedFile latex "$$AbsPath$$Basename.eps"
14678 \end_layout
14679
14680 \begin_layout LyX-Code
14681 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14682 \end_layout
14683
14684 \begin_layout LyX-Code
14685 FormatEnd
14686 \end_layout
14687
14688 \begin_layout LyX-Code
14689 Format PDFLaTeX
14690 \end_layout
14691
14692 \begin_layout LyX-Code
14693 TransformCommand Rotate RotationLatexCommand
14694 \end_layout
14695
14696 \begin_layout LyX-Code
14697 TransformCommand Resize ResizeLatexCommand
14698 \end_layout
14699
14700 \begin_layout LyX-Code
14701 Product "$$RotateFront$$ResizeFront
14702 \end_layout
14703
14704 \begin_layout LyX-Code
14705          
14706 \backslash
14707
14708 \backslash
14709 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14710 \end_layout
14711
14712 \begin_layout LyX-Code
14713          $$ResizeBack$$RotateBack"
14714 \end_layout
14715
14716 \begin_layout LyX-Code
14717 UpdateFormat pdftex
14718 \end_layout
14719
14720 \begin_layout LyX-Code
14721 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14722 \end_layout
14723
14724 \begin_layout LyX-Code
14725 Requirement "graphicx"
14726 \end_layout
14727
14728 \begin_layout LyX-Code
14729 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14730 \end_layout
14731
14732 \begin_layout LyX-Code
14733 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14734 \end_layout
14735
14736 \begin_layout LyX-Code
14737 FormatEnd
14738 \end_layout
14739
14740 \begin_layout LyX-Code
14741 Format Ascii
14742 \end_layout
14743
14744 \begin_layout LyX-Code
14745 Product "$$Contents(
14746 \backslash
14747 "$$AbsPath$$Basename.asc
14748 \backslash
14749 ")"
14750 \end_layout
14751
14752 \begin_layout LyX-Code
14753 UpdateFormat asciixfig
14754 \end_layout
14755
14756 \begin_layout LyX-Code
14757 UpdateResult "$$AbsPath$$Basename.asc"
14758 \end_layout
14759
14760 \begin_layout LyX-Code
14761 FormatEnd
14762 \end_layout
14763
14764 \begin_layout LyX-Code
14765 Format DocBook
14766 \end_layout
14767
14768 \begin_layout LyX-Code
14769 Product "<graphic fileref=
14770 \backslash
14771 "$$AbsOrRelPathMaster$$Basename.eps
14772 \backslash
14773 ">
14774 \end_layout
14775
14776 \begin_layout LyX-Code
14777          </graphic>"
14778 \end_layout
14779
14780 \begin_layout LyX-Code
14781 UpdateFormat eps
14782 \end_layout
14783
14784 \begin_layout LyX-Code
14785 UpdateResult "$$AbsPath$$Basename.eps"
14786 \end_layout
14787
14788 \begin_layout LyX-Code
14789 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14790 \end_layout
14791
14792 \begin_layout LyX-Code
14793 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14794 \end_layout
14795
14796 \begin_layout LyX-Code
14797 FormatEnd
14798 \end_layout
14799
14800 \begin_layout LyX-Code
14801 Product "[XFig: $$FName]"
14802 \end_layout
14803
14804 \begin_layout LyX-Code
14805 FormatEnd
14806 \end_layout
14807
14808 \begin_layout LyX-Code
14809 TemplateEnd
14810 \end_layout
14811
14812 \begin_layout Standard
14813 As you can see, the template is enclosed in 
14814 \begin_inset Flex CharStyle:Code
14815 status collapsed
14816
14817 \begin_layout PlainLayout
14818 Template
14819 \end_layout
14820
14821 \end_inset
14822
14823  \SpecialChar \ldots{}
14824  
14825 \begin_inset Flex CharStyle:Code
14826 status collapsed
14827
14828 \begin_layout PlainLayout
14829 TemplateEnd
14830 \end_layout
14831
14832 \end_inset
14833
14834 .
14835  It contains a header specifying some general settings and, for each supported
14836  primary document file format, a section 
14837 \begin_inset Flex CharStyle:Code
14838 status collapsed
14839
14840 \begin_layout PlainLayout
14841 Format
14842 \end_layout
14843
14844 \end_inset
14845
14846  \SpecialChar \ldots{}
14847  
14848 \begin_inset Flex CharStyle:Code
14849 status collapsed
14850
14851 \begin_layout PlainLayout
14852 FormatEnd
14853 \end_layout
14854
14855 \end_inset
14856
14857 .
14858 \end_layout
14859
14860 \begin_layout Subsection
14861 The template header
14862 \end_layout
14863
14864 \begin_layout Description
14865 \begin_inset Flex CharStyle:Code
14866 status collapsed
14867
14868 \begin_layout PlainLayout
14869 AutomaticProduction
14870 \begin_inset Space ~
14871 \end_inset
14872
14873 true|false
14874 \end_layout
14875
14876 \end_inset
14877
14878  Whether the file represented by the template must be generated by LyX.
14879  This command must occur exactly once.
14880 \end_layout
14881
14882 \begin_layout Description
14883 \begin_inset Flex CharStyle:Code
14884 status collapsed
14885
14886 \begin_layout PlainLayout
14887 FileFilter
14888 \begin_inset Space ~
14889 \end_inset
14890
14891 <pattern>
14892 \end_layout
14893
14894 \end_inset
14895
14896  A glob pattern that is used in the file dialog to filter out the desired
14897  files.
14898  If there is more than one possible file extension (e.g.
14899 \begin_inset Space ~
14900 \end_inset
14901
14902 tgif has 
14903 \begin_inset Flex CharStyle:Code
14904 status collapsed
14905
14906 \begin_layout PlainLayout
14907 .obj
14908 \end_layout
14909
14910 \end_inset
14911
14912  and 
14913 \begin_inset Flex CharStyle:Code
14914 status collapsed
14915
14916 \begin_layout PlainLayout
14917 .tgo
14918 \end_layout
14919
14920 \end_inset
14921
14922 ), use something like 
14923 \begin_inset Flex CharStyle:Code
14924 status collapsed
14925
14926 \begin_layout PlainLayout
14927 "*.{obj,tgo}"
14928 \end_layout
14929
14930 \end_inset
14931
14932 .
14933  This command must occur exactly once.
14934 \end_layout
14935
14936 \begin_layout Description
14937 \begin_inset Flex CharStyle:Code
14938 status collapsed
14939
14940 \begin_layout PlainLayout
14941 GuiName
14942 \begin_inset Space ~
14943 \end_inset
14944
14945 <guiname>
14946 \end_layout
14947
14948 \end_inset
14949
14950  The text that is displayed on the button.
14951  This command must occur exactly once.
14952 \end_layout
14953
14954 \begin_layout Description
14955 \begin_inset Flex CharStyle:Code
14956 status collapsed
14957
14958 \begin_layout PlainLayout
14959 HelpText
14960 \begin_inset Space ~
14961 \end_inset
14962
14963 <text>
14964 \begin_inset Space ~
14965 \end_inset
14966
14967 HelpTextEnd
14968 \end_layout
14969
14970 \end_inset
14971
14972  The help text that is used in the External dialog.
14973  Provide enough information to explain to the user just what the template
14974  can provide him with.
14975  This command must occur exactly once.
14976 \end_layout
14977
14978 \begin_layout Description
14979 \begin_inset Flex CharStyle:Code
14980 status collapsed
14981
14982 \begin_layout PlainLayout
14983 InputFormat
14984 \begin_inset Space ~
14985 \end_inset
14986
14987 <format>
14988 \end_layout
14989
14990 \end_inset
14991
14992  The file format of the original file.
14993  This must be the name of a format that is known to LyX (see section 
14994 \begin_inset CommandInset ref
14995 LatexCommand ref
14996 reference "sub:Formats"
14997
14998 \end_inset
14999
15000 ).
15001  Use 
15002 \begin_inset Quotes eld
15003 \end_inset
15004
15005
15006 \begin_inset Flex CharStyle:Code
15007 status collapsed
15008
15009 \begin_layout PlainLayout
15010 *
15011 \end_layout
15012
15013 \end_inset
15014
15015
15016 \begin_inset Quotes erd
15017 \end_inset
15018
15019  if the template can handle original files of more than one format.
15020  LyX will attempt to interrogate the file itself in order to deduce its
15021  format in this case.
15022  This command must occur exactly once.
15023 \end_layout
15024
15025 \begin_layout Description
15026 \begin_inset Flex CharStyle:Code
15027 status collapsed
15028
15029 \begin_layout PlainLayout
15030 Template
15031 \begin_inset Space ~
15032 \end_inset
15033
15034 <id>
15035 \end_layout
15036
15037 \end_inset
15038
15039  A unique name for the template.
15040  It must not contain substitution macros (see below).
15041 \end_layout
15042
15043 \begin_layout Description
15044 \begin_inset Flex CharStyle:Code
15045 status collapsed
15046
15047 \begin_layout PlainLayout
15048 Transform
15049 \begin_inset Space ~
15050 \end_inset
15051
15052 Rotate|Resize|Clip|Extra
15053 \end_layout
15054
15055 \end_inset
15056
15057  This command specifies which transformations are supported by this template.
15058  It may occur zero or more times.
15059  This command enables the corresponding tabs in the external dialog.
15060  Each 
15061 \begin_inset Flex CharStyle:Code
15062 status collapsed
15063
15064 \begin_layout PlainLayout
15065 Transform
15066 \end_layout
15067
15068 \end_inset
15069
15070  command must have either a corresponding 
15071 \begin_inset Flex CharStyle:Code
15072 status collapsed
15073
15074 \begin_layout PlainLayout
15075 TransformCommand
15076 \end_layout
15077
15078 \end_inset
15079
15080  or a 
15081 \begin_inset Flex CharStyle:Code
15082 status collapsed
15083
15084 \begin_layout PlainLayout
15085 TransformOption
15086 \end_layout
15087
15088 \end_inset
15089
15090  command in the 
15091 \begin_inset Flex CharStyle:Code
15092 status collapsed
15093
15094 \begin_layout PlainLayout
15095 Format
15096 \end_layout
15097
15098 \end_inset
15099
15100  section.
15101  Otherwise the transformation will not be supported by that format.
15102 \end_layout
15103
15104 \begin_layout Subsection
15105 The Format section
15106 \end_layout
15107
15108 \begin_layout Description
15109 \begin_inset Flex CharStyle:Code
15110 status collapsed
15111
15112 \begin_layout PlainLayout
15113 Format
15114 \begin_inset Space ~
15115 \end_inset
15116
15117 LaTeX|PDFLaTeX|PlainText|DocBook
15118 \end_layout
15119
15120 \end_inset
15121
15122  The primary document file format that this format definition is for.
15123  Not every template has a sensible representation in all document file formats.
15124  Please define nevertheless a 
15125 \begin_inset Flex CharStyle:Code
15126 status collapsed
15127
15128 \begin_layout PlainLayout
15129 Format
15130 \end_layout
15131
15132 \end_inset
15133
15134  section for all formats.
15135  Use a dummy text when no representation is available.
15136  Then you can at least see a reference to the external material in the exported
15137  document.
15138 \end_layout
15139
15140 \begin_layout Description
15141 \begin_inset Flex CharStyle:Code
15142 status collapsed
15143
15144 \begin_layout PlainLayout
15145 Option
15146 \begin_inset Space ~
15147 \end_inset
15148
15149 <name>
15150 \begin_inset Space ~
15151 \end_inset
15152
15153 <value>
15154 \end_layout
15155
15156 \end_inset
15157
15158  This command defines an additional macro 
15159 \begin_inset Flex CharStyle:Code
15160 status collapsed
15161
15162 \begin_layout PlainLayout
15163 $$<name>
15164 \end_layout
15165
15166 \end_inset
15167
15168  for substitution in 
15169 \begin_inset Flex CharStyle:Code
15170 status collapsed
15171
15172 \begin_layout PlainLayout
15173 Product
15174 \end_layout
15175
15176 \end_inset
15177
15178 .
15179  
15180 \begin_inset Flex CharStyle:Code
15181 status collapsed
15182
15183 \begin_layout PlainLayout
15184 <value>
15185 \end_layout
15186
15187 \end_inset
15188
15189  itself may contain substitution macros.
15190  The advantage over using 
15191 \begin_inset Flex CharStyle:Code
15192 status collapsed
15193
15194 \begin_layout PlainLayout
15195 <value>
15196 \end_layout
15197
15198 \end_inset
15199
15200  directly in 
15201 \begin_inset Flex CharStyle:Code
15202 status collapsed
15203
15204 \begin_layout PlainLayout
15205 Product
15206 \end_layout
15207
15208 \end_inset
15209
15210  is that the substituted value of 
15211 \begin_inset Flex CharStyle:Code
15212 status collapsed
15213
15214 \begin_layout PlainLayout
15215 $$<name>
15216 \end_layout
15217
15218 \end_inset
15219
15220  is sanitized so that it is a valid optional argument in the document format.
15221  This command may occur zero or more times.
15222 \end_layout
15223
15224 \begin_layout Description
15225 \begin_inset Flex CharStyle:Code
15226 status collapsed
15227
15228 \begin_layout PlainLayout
15229 Product
15230 \begin_inset Space ~
15231 \end_inset
15232
15233 <text>
15234 \end_layout
15235
15236 \end_inset
15237
15238  The text that is inserted in the exported document.
15239  This is actually the most important command and can be quite complex.
15240  This command must occur exactly once.
15241 \end_layout
15242
15243 \begin_layout Description
15244 \begin_inset Flex CharStyle:Code
15245 status collapsed
15246
15247 \begin_layout PlainLayout
15248 Preamble
15249 \begin_inset Space ~
15250 \end_inset
15251
15252 <name>
15253 \end_layout
15254
15255 \end_inset
15256
15257  This command specifies a preamble snippet that will be included in the
15258  LaTeX preamble.
15259  It has to be defined using 
15260 \begin_inset Flex CharStyle:Code
15261 status collapsed
15262
15263 \begin_layout PlainLayout
15264 PreambleDef
15265 \end_layout
15266
15267 \end_inset
15268
15269  \SpecialChar \ldots{}
15270  
15271 \begin_inset Flex CharStyle:Code
15272 status collapsed
15273
15274 \begin_layout PlainLayout
15275 PreambleDefEnd
15276 \end_layout
15277
15278 \end_inset
15279
15280 .
15281  This command may occur zero or more times.
15282 \end_layout
15283
15284 \begin_layout Description
15285 \begin_inset Flex CharStyle:Code
15286 status collapsed
15287
15288 \begin_layout PlainLayout
15289 ReferencedFile
15290 \begin_inset Space ~
15291 \end_inset
15292
15293 <format>
15294 \begin_inset Space ~
15295 \end_inset
15296
15297 <filename>
15298 \end_layout
15299
15300 \end_inset
15301
15302  This command denotes files that are created by the conversion process and
15303  are needed for a particular export format.
15304  If the filename is relative, it is interpreted relative to the master document.
15305  This command may be given zero or more times.
15306 \end_layout
15307
15308 \begin_layout Description
15309 \begin_inset Flex CharStyle:Code
15310 status collapsed
15311
15312 \begin_layout PlainLayout
15313 Requirement
15314 \begin_inset Space ~
15315 \end_inset
15316
15317 <package>
15318 \end_layout
15319
15320 \end_inset
15321
15322  The name of a required LaTeX package.
15323  The package is included via 
15324 \begin_inset Flex CharStyle:Code
15325 status collapsed
15326
15327 \begin_layout PlainLayout
15328
15329 \backslash
15330 usepackage{}
15331 \end_layout
15332
15333 \end_inset
15334
15335  in the LaTeX preamble.
15336  This command may occur zero or more times.
15337 \end_layout
15338
15339 \begin_layout Description
15340 \begin_inset Flex CharStyle:Code
15341 status collapsed
15342
15343 \begin_layout PlainLayout
15344 TransformCommand
15345 \begin_inset Space ~
15346 \end_inset
15347
15348 Rotate
15349 \begin_inset Space ~
15350 \end_inset
15351
15352 RotationLatexCommand
15353 \end_layout
15354
15355 \end_inset
15356
15357  This command specifies that the built in LaTeX command should be used for
15358  rotation.
15359  This command may occur once or not at all.
15360 \end_layout
15361
15362 \begin_layout Description
15363 \begin_inset Flex CharStyle:Code
15364 status collapsed
15365
15366 \begin_layout PlainLayout
15367 TransformCommand
15368 \begin_inset Space ~
15369 \end_inset
15370
15371 Resize
15372 \begin_inset Space ~
15373 \end_inset
15374
15375 ResizeLatexCommand
15376 \end_layout
15377
15378 \end_inset
15379
15380  This command specifies that the built in LaTeX command should be used for
15381  resizing.
15382  This command may occur once or not at all.
15383 \end_layout
15384
15385 \begin_layout Description
15386 \begin_inset Flex CharStyle:Code
15387 status collapsed
15388
15389 \begin_layout PlainLayout
15390 TransformOption
15391 \begin_inset Space ~
15392 \end_inset
15393
15394 Rotate
15395 \begin_inset Space ~
15396 \end_inset
15397
15398 RotationLatexOption
15399 \end_layout
15400
15401 \end_inset
15402
15403  This command specifies that rotation is done via an optional argument.
15404  This command may occur once or not at all.
15405 \end_layout
15406
15407 \begin_layout Description
15408 \begin_inset Flex CharStyle:Code
15409 status collapsed
15410
15411 \begin_layout PlainLayout
15412 TransformOption
15413 \begin_inset Space ~
15414 \end_inset
15415
15416 Resize
15417 \begin_inset Space ~
15418 \end_inset
15419
15420 ResizeLatexOption
15421 \end_layout
15422
15423 \end_inset
15424
15425  This command specifies that resizing is done via an optional argument.
15426  This command may occur once or not at all.
15427 \end_layout
15428
15429 \begin_layout Description
15430 \begin_inset Flex CharStyle:Code
15431 status collapsed
15432
15433 \begin_layout PlainLayout
15434 TransformOption
15435 \begin_inset Space ~
15436 \end_inset
15437
15438 Clip
15439 \begin_inset Space ~
15440 \end_inset
15441
15442 ClipLatexOption
15443 \end_layout
15444
15445 \end_inset
15446
15447  This command specifies that clipping is done via an optional argument.
15448  This command may occur once or not at all.
15449 \end_layout
15450
15451 \begin_layout Description
15452 \begin_inset Flex CharStyle:Code
15453 status collapsed
15454
15455 \begin_layout PlainLayout
15456 TransformOption
15457 \begin_inset Space ~
15458 \end_inset
15459
15460 Extra
15461 \begin_inset Space ~
15462 \end_inset
15463
15464 ExtraLatexOption
15465 \end_layout
15466
15467 \end_inset
15468
15469  This command specifies that an extra optional argument is used.
15470  This command may occur once or not at all.
15471 \end_layout
15472
15473 \begin_layout Description
15474 \begin_inset Flex CharStyle:Code
15475 status collapsed
15476
15477 \begin_layout PlainLayout
15478 UpdateFormat
15479 \begin_inset Space ~
15480 \end_inset
15481
15482 <format>
15483 \end_layout
15484
15485 \end_inset
15486
15487  The file format of the converted file.
15488  This must be the name of a format that is known to LyX (see the 
15489 \begin_inset Flex CharStyle:MenuItem
15490 status collapsed
15491
15492 \begin_layout PlainLayout
15493
15494 \bar under
15495 T
15496 \bar default
15497 ools\SpecialChar \menuseparator
15498
15499 \bar under
15500 P
15501 \bar default
15502 references:Conversion
15503 \end_layout
15504
15505 \end_inset
15506
15507  dialog).
15508  This command must occur exactly once.
15509 \end_layout
15510
15511 \begin_layout Description
15512 \begin_inset Flex CharStyle:Code
15513 status collapsed
15514
15515 \begin_layout PlainLayout
15516 UpdateResult
15517 \begin_inset Space ~
15518 \end_inset
15519
15520 <filename>
15521 \end_layout
15522
15523 \end_inset
15524
15525  The file name of the converted file.
15526  The file name must be absolute.
15527  This command must occur exactly once.
15528 \end_layout
15529
15530 \begin_layout Subsection
15531 Preamble definitions
15532 \end_layout
15533
15534 \begin_layout Standard
15535 The external template configuration file may contain additional preamble
15536  definitions enclosed by 
15537 \begin_inset Flex CharStyle:Code
15538 status collapsed
15539
15540 \begin_layout PlainLayout
15541 PreambleDef
15542 \end_layout
15543
15544 \end_inset
15545
15546  \SpecialChar \ldots{}
15547  
15548 \begin_inset Flex CharStyle:Code
15549 status collapsed
15550
15551 \begin_layout PlainLayout
15552 PreambleDefEnd
15553 \end_layout
15554
15555 \end_inset
15556
15557 .
15558  They can be used by the templates in the 
15559 \begin_inset Flex CharStyle:Code
15560 status collapsed
15561
15562 \begin_layout PlainLayout
15563 Format
15564 \end_layout
15565
15566 \end_inset
15567
15568  section.
15569 \end_layout
15570
15571 \begin_layout Section
15572 The substitution mechanism
15573 \end_layout
15574
15575 \begin_layout Standard
15576 When the external material facility invokes an external program, it is done
15577  on the basis of a command defined in the template configuration file.
15578  These commands can contain various macros that are expanded before execution.
15579  Execution always take place in the directory of the containing document.
15580 \end_layout
15581
15582 \begin_layout Standard
15583 Also, whenever external material is to be displayed, the name will be produced
15584  by the substitution mechanism, and most other commands in the template
15585  definition support substitution as well.
15586 \end_layout
15587
15588 \begin_layout Standard
15589 The available macros are the following:
15590 \end_layout
15591
15592 \begin_layout Description
15593 \begin_inset Flex CharStyle:Code
15594 status collapsed
15595
15596 \begin_layout PlainLayout
15597 $$AbsOrRelPathMaster
15598 \end_layout
15599
15600 \end_inset
15601
15602  The file path, absolute or relative to the master LyX document.
15603 \end_layout
15604
15605 \begin_layout Description
15606 \begin_inset Flex CharStyle:Code
15607 status collapsed
15608
15609 \begin_layout PlainLayout
15610 $$AbsOrRelPathParent
15611 \end_layout
15612
15613 \end_inset
15614
15615  The file path, absolute or relative to the LyX document.
15616 \end_layout
15617
15618 \begin_layout Description
15619 \begin_inset Flex CharStyle:Code
15620 status collapsed
15621
15622 \begin_layout PlainLayout
15623 $$AbsPath
15624 \end_layout
15625
15626 \end_inset
15627
15628  The absolute file path.
15629 \end_layout
15630
15631 \begin_layout Description
15632 \begin_inset Flex CharStyle:Code
15633 status collapsed
15634
15635 \begin_layout PlainLayout
15636 $$Basename
15637 \end_layout
15638
15639 \end_inset
15640
15641  The filename without path and without the extension.
15642 \end_layout
15643
15644 \begin_layout Description
15645 \begin_inset Flex CharStyle:Code
15646 status collapsed
15647
15648 \begin_layout PlainLayout
15649 $$Contents(
15650 \begin_inset Quotes eld
15651 \end_inset
15652
15653 filename.ext
15654 \begin_inset Quotes erd
15655 \end_inset
15656
15657 )
15658 \end_layout
15659
15660 \end_inset
15661
15662  This macro will expand to the contents of the file with the name 
15663 \begin_inset Flex CharStyle:Code
15664 status collapsed
15665
15666 \begin_layout PlainLayout
15667 filename.ext
15668 \end_layout
15669
15670 \end_inset
15671
15672 .
15673 \end_layout
15674
15675 \begin_layout Description
15676 \begin_inset Flex CharStyle:Code
15677 status collapsed
15678
15679 \begin_layout PlainLayout
15680 $$Extension
15681 \end_layout
15682
15683 \end_inset
15684
15685  The file extension (including the dot).
15686 \end_layout
15687
15688 \begin_layout Description
15689 \begin_inset Flex CharStyle:Code
15690 status collapsed
15691
15692 \begin_layout PlainLayout
15693 $$FName
15694 \end_layout
15695
15696 \end_inset
15697
15698  The filename of the file specified in the external material dialog.
15699  This is either an absolute name, or it is relative to the LyX document.
15700 \end_layout
15701
15702 \begin_layout Description
15703 \begin_inset Flex CharStyle:Code
15704 status collapsed
15705
15706 \begin_layout PlainLayout
15707 $$FPath
15708 \end_layout
15709
15710 \end_inset
15711
15712  The path part of 
15713 \begin_inset Flex CharStyle:Code
15714 status collapsed
15715
15716 \begin_layout PlainLayout
15717 $$FName
15718 \end_layout
15719
15720 \end_inset
15721
15722  (absolute name or relative to the LyX document).
15723 \end_layout
15724
15725 \begin_layout Description
15726 \begin_inset Flex CharStyle:Code
15727 status collapsed
15728
15729 \begin_layout PlainLayout
15730 $$RelPathMaster
15731 \end_layout
15732
15733 \end_inset
15734
15735  The file path, relative to the master LyX document.
15736 \end_layout
15737
15738 \begin_layout Description
15739 \begin_inset Flex CharStyle:Code
15740 status collapsed
15741
15742 \begin_layout PlainLayout
15743 $$RelPathParent
15744 \end_layout
15745
15746 \end_inset
15747
15748  The file path, relative to the LyX document.
15749 \end_layout
15750
15751 \begin_layout Description
15752 \begin_inset Flex CharStyle:Code
15753 status collapsed
15754
15755 \begin_layout PlainLayout
15756 $$Sysdir
15757 \end_layout
15758
15759 \end_inset
15760
15761  This macro will expand to the absolute path of the system directory.
15762  This is typically used to point to the various helper scripts that are
15763  bundled with LyX.
15764 \end_layout
15765
15766 \begin_layout Description
15767 \begin_inset Flex CharStyle:Code
15768 status collapsed
15769
15770 \begin_layout PlainLayout
15771 $$Tempname
15772 \end_layout
15773
15774 \end_inset
15775
15776  A name and full path to a temporary file which will be automatically deleted
15777  whenever the containing document is closed, or the external material insertion
15778  deleted.
15779 \end_layout
15780
15781 \begin_layout Standard
15782 All path macros contain a trailing directory separator, so you can construct
15783  e.g.
15784  the absolute filename with 
15785 \begin_inset Flex CharStyle:Code
15786 status collapsed
15787
15788 \begin_layout PlainLayout
15789 $$AbsPath$$Basename$$Extension
15790 \end_layout
15791
15792 \end_inset
15793
15794 .
15795 \end_layout
15796
15797 \begin_layout Standard
15798 The macros above are substituted in all commands unless otherwise noted.
15799  The command 
15800 \begin_inset Flex CharStyle:Code
15801 status collapsed
15802
15803 \begin_layout PlainLayout
15804 Product
15805 \end_layout
15806
15807 \end_inset
15808
15809  supports additionally the following substitutions if they are enabled by
15810  the 
15811 \begin_inset Flex CharStyle:Code
15812 status collapsed
15813
15814 \begin_layout PlainLayout
15815 Transform
15816 \end_layout
15817
15818 \end_inset
15819
15820  and 
15821 \begin_inset Flex CharStyle:Code
15822 status collapsed
15823
15824 \begin_layout PlainLayout
15825 TransformCommand
15826 \end_layout
15827
15828 \end_inset
15829
15830  commands:
15831 \end_layout
15832
15833 \begin_layout Description
15834 \begin_inset Flex CharStyle:Code
15835 status collapsed
15836
15837 \begin_layout PlainLayout
15838 $$ResizeFront
15839 \end_layout
15840
15841 \end_inset
15842
15843  The front part of the resize command.
15844 \end_layout
15845
15846 \begin_layout Description
15847 \begin_inset Flex CharStyle:Code
15848 status collapsed
15849
15850 \begin_layout PlainLayout
15851 $$ResizeBack
15852 \end_layout
15853
15854 \end_inset
15855
15856  The back part of the resize command.
15857 \end_layout
15858
15859 \begin_layout Description
15860 \begin_inset Flex CharStyle:Code
15861 status collapsed
15862
15863 \begin_layout PlainLayout
15864 $$RotateFront
15865 \end_layout
15866
15867 \end_inset
15868
15869  The front part of the rotation command.
15870 \end_layout
15871
15872 \begin_layout Description
15873 \begin_inset Flex CharStyle:Code
15874 status collapsed
15875
15876 \begin_layout PlainLayout
15877 $$RotateBack
15878 \end_layout
15879
15880 \end_inset
15881
15882  The back part of the rotation command.
15883 \end_layout
15884
15885 \begin_layout Standard
15886 The value string of the 
15887 \begin_inset Flex CharStyle:Code
15888 status collapsed
15889
15890 \begin_layout PlainLayout
15891 Option
15892 \end_layout
15893
15894 \end_inset
15895
15896  command supports additionally the following substitutions if they are enabled
15897  by the 
15898 \begin_inset Flex CharStyle:Code
15899 status collapsed
15900
15901 \begin_layout PlainLayout
15902 Transform
15903 \end_layout
15904
15905 \end_inset
15906
15907  and 
15908 \begin_inset Flex CharStyle:Code
15909 status collapsed
15910
15911 \begin_layout PlainLayout
15912 TransformOption
15913 \end_layout
15914
15915 \end_inset
15916
15917  commands:
15918 \end_layout
15919
15920 \begin_layout Description
15921 \begin_inset Flex CharStyle:Code
15922 status collapsed
15923
15924 \begin_layout PlainLayout
15925 $$Clip
15926 \end_layout
15927
15928 \end_inset
15929
15930  The clip option.
15931 \end_layout
15932
15933 \begin_layout Description
15934 \begin_inset Flex CharStyle:Code
15935 status collapsed
15936
15937 \begin_layout PlainLayout
15938 $$Extra
15939 \end_layout
15940
15941 \end_inset
15942
15943  The extra option.
15944 \end_layout
15945
15946 \begin_layout Description
15947 \begin_inset Flex CharStyle:Code
15948 status collapsed
15949
15950 \begin_layout PlainLayout
15951 $$Resize
15952 \end_layout
15953
15954 \end_inset
15955
15956  The resize option.
15957 \end_layout
15958
15959 \begin_layout Description
15960 \begin_inset Flex CharStyle:Code
15961 status collapsed
15962
15963 \begin_layout PlainLayout
15964 $$Rotate
15965 \end_layout
15966
15967 \end_inset
15968
15969  The rotation option.
15970 \end_layout
15971
15972 \begin_layout Standard
15973 You may ask why there are so many path macros.
15974  There are mainly two reasons:
15975 \end_layout
15976
15977 \begin_layout Enumerate
15978 Relative and absolute file names should remain relative or absolute, respectivel
15979 y.
15980  Users may have reasons to prefer either form.
15981  Relative names are useful for portable documents that should work on different
15982  machines, for example.
15983  Absolute names may be required by some programs.
15984 \end_layout
15985
15986 \begin_layout Enumerate
15987 LaTeX treats relative file names differently than LyX and other programs
15988  in nested included files.
15989  For LyX, a relative file name is always relative to the document that contains
15990  the file name.
15991  For LaTeX, it is always relative to the master document.
15992  These two definitions are identical if you have only one document, but
15993  differ if you have a master document that includes part documents.
15994  That means that relative filenames must be transformed when presented to
15995  LaTeX.
15996  Fortunately LyX does this automatically for you if you choose the right
15997  macros.
15998 \end_layout
15999
16000 \begin_layout Standard
16001 So which path macro should be used in new template definitions? The rule
16002  is not difficult:
16003 \end_layout
16004
16005 \begin_layout Itemize
16006 Use 
16007 \begin_inset Flex CharStyle:Code
16008 status collapsed
16009
16010 \begin_layout PlainLayout
16011 $$AbsPath
16012 \end_layout
16013
16014 \end_inset
16015
16016  if an absolute path is required.
16017 \end_layout
16018
16019 \begin_layout Itemize
16020 Use 
16021 \begin_inset Flex CharStyle:Code
16022 status collapsed
16023
16024 \begin_layout PlainLayout
16025 $$AbsOrRelPathMaster
16026 \end_layout
16027
16028 \end_inset
16029
16030  if the substituted string is some kind of LaTeX input.
16031 \end_layout
16032
16033 \begin_layout Itemize
16034 Else use 
16035 \begin_inset Flex CharStyle:Code
16036 status collapsed
16037
16038 \begin_layout PlainLayout
16039 $$AbsOrRelPathParent
16040 \end_layout
16041
16042 \end_inset
16043
16044  in order to preserve the user's choice.
16045 \end_layout
16046
16047 \begin_layout Standard
16048 There are special cases where this rule does not work and e.g.
16049 \begin_inset Space ~
16050 \end_inset
16051
16052 relative names are needed, but normally it will work just fine.
16053  One example for such a case is the command 
16054 \begin_inset Flex CharStyle:Code
16055 status collapsed
16056
16057 \begin_layout PlainLayout
16058 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16059 \end_layout
16060
16061 \end_inset
16062
16063  in the XFig template above: We can't use the absolute name because the
16064  copier for 
16065 \begin_inset Flex CharStyle:Code
16066 status collapsed
16067
16068 \begin_layout PlainLayout
16069 .pstex_t
16070 \end_layout
16071
16072 \end_inset
16073
16074  files needs the relative name in order to rewrite the file content.
16075 \end_layout
16076
16077 \begin_layout Section
16078 \begin_inset CommandInset label
16079 LatexCommand label
16080 name "sec:Security-discussion"
16081
16082 \end_inset
16083
16084 Security discussion
16085 \end_layout
16086
16087 \begin_layout Standard
16088 \begin_inset Note Note
16089 status collapsed
16090
16091 \begin_layout PlainLayout
16092 This section is outdated
16093 \end_layout
16094
16095 \end_inset
16096
16097 The external material feature interfaces with a lot of external programs
16098  and does so automatically, so we have to consider the security implications
16099  of this.
16100  In particular, since you have the option of including your own filenames
16101  and/or parameter strings and those are expanded into a command, it seems
16102  that it would be possible to create a malicious document which executes
16103  arbitrary commands when a user views or prints the document.
16104  This is something we definately want to avoid.
16105 \end_layout
16106
16107 \begin_layout Standard
16108 However, since the external program commands are specified in the template
16109  configuration file only, there are no security issues if LyX is properly
16110  configured with safe templates only.
16111  This is so because the external programs are invoked with the 
16112 \begin_inset Flex CharStyle:Code
16113 status collapsed
16114
16115 \begin_layout PlainLayout
16116 execvp
16117 \end_layout
16118
16119 \end_inset
16120
16121 -system call rather than the 
16122 \begin_inset Flex CharStyle:Code
16123 status collapsed
16124
16125 \begin_layout PlainLayout
16126 system
16127 \end_layout
16128
16129 \end_inset
16130
16131  system-call, so it's not possible to execute arbitrary commands from the
16132  filename or parameter section via the shell.
16133 \end_layout
16134
16135 \begin_layout Standard
16136 This also implies that you are restricted in what command strings you can
16137  use in the external material templates.
16138  In particular, pipes and redirection are not readily available.
16139  This has to be so if LyX should remain safe.
16140  If you want to use some of the shell features, you should write a safe
16141  script to do this in a controlled manner, and then invoke the script from
16142  the command string.
16143  In the 
16144 \begin_inset Flex CharStyle:Code
16145 status collapsed
16146
16147 \begin_layout PlainLayout
16148 lib/scripts
16149 \end_layout
16150
16151 \end_inset
16152
16153  directory of the LyX installation, you can find a safe wrapper script 
16154 \begin_inset Flex CharStyle:Code
16155 status collapsed
16156
16157 \begin_layout PlainLayout
16158 general_command_wrapper.py
16159 \end_layout
16160
16161 \end_inset
16162
16163  that supports redirection of input and output.
16164  That can serve as an example for how to write safe template scripts.
16165  For a more advanced example that uses 
16166 \begin_inset Flex CharStyle:Code
16167 status collapsed
16168
16169 \begin_layout PlainLayout
16170 fork
16171 \end_layout
16172
16173 \end_inset
16174
16175  and friends, take a look at the 
16176 \begin_inset Flex CharStyle:Code
16177 status collapsed
16178
16179 \begin_layout PlainLayout
16180 pic2ascii.py
16181 \end_layout
16182
16183 \end_inset
16184
16185  converter script.
16186 \end_layout
16187
16188 \begin_layout Standard
16189 It is possible to design a template that interacts directly with the shell,
16190  but since this would allow a malicious user to execute arbitrary commands
16191  by writing clever filenames and/or parameters, we generally recommend that
16192  you only use safe scripts that work with the 
16193 \begin_inset Flex CharStyle:Code
16194 status collapsed
16195
16196 \begin_layout PlainLayout
16197 execvp
16198 \end_layout
16199
16200 \end_inset
16201
16202  system call in a controlled manner.
16203  Of course, for use in a controlled environment, it can be tempting to just
16204  fall back to use ordinary shell scripts.
16205  If you do so, be aware that you 
16206 \emph on
16207 will
16208 \emph default
16209  provide an easily exploitable security hole in your system.
16210  Of course it stands to reason that such unsafe templates will never be
16211  included in the standard LyX distribution, although we do encourage people
16212  to submit new templates in the open source tradition.
16213  But LyX as shipped from the official distribution channels will never have
16214  unsafe templates.
16215 \end_layout
16216
16217 \begin_layout Standard
16218 Including external material provides a lot of power, and you have to be
16219  careful not to introduce security hazards with this power.
16220  A subtle error in a single line in an innocent looking script can open
16221  the door to huge security problems.
16222  So if you do not fully understand the issues, we recommend that you consult
16223  a knowledgable security professional or the LyX development team if you
16224  have any questions about whether a given template is safe or not.
16225  And do this before you use it in an uncontrolled environment.
16226 \end_layout
16227
16228 \begin_layout Chapter
16229 The LyX Server
16230 \end_layout
16231
16232 \begin_layout Section
16233 Introduction
16234 \end_layout
16235
16236 \begin_layout Standard
16237 The LyX server is a method implemented in LyX that will enable other programs
16238  to talk to LyX, invoke LyX commands, and retrieve information about the
16239  LyX internal state.
16240  This is only intended for advanced users, but they should find it useful.
16241  Please note that, at present, 
16242 \emph on
16243 the server does not work on Windows
16244 \emph default
16245 .
16246 \begin_inset Foot
16247 status collapsed
16248
16249 \begin_layout PlainLayout
16250 There is no principled reason it cannot do so.
16251  But none of the developers on Windows® have yet implemented this functionality
16252  there.
16253 \end_layout
16254
16255 \end_inset
16256
16257
16258 \end_layout
16259
16260 \begin_layout Section
16261 Starting the LyX Server
16262 \end_layout
16263
16264 \begin_layout Standard
16265 The LyX server works through the use of a pair of named pipes.
16266  These are usually located in 
16267 \begin_inset Flex CharStyle:Code
16268 status collapsed
16269
16270 \begin_layout PlainLayout
16271 UserDir
16272 \end_layout
16273
16274 \end_inset
16275
16276  and have the names 
16277 \begin_inset Quotes eld
16278 \end_inset
16279
16280
16281 \begin_inset Flex CharStyle:Code
16282 status collapsed
16283
16284 \begin_layout PlainLayout
16285 .lyxpipe.in
16286 \end_layout
16287
16288 \end_inset
16289
16290
16291 \begin_inset Quotes erd
16292 \end_inset
16293
16294  and 
16295 \begin_inset Quotes eld
16296 \end_inset
16297
16298
16299 \begin_inset Flex CharStyle:Code
16300 status collapsed
16301
16302 \begin_layout PlainLayout
16303 .lyxpipe.out
16304 \end_layout
16305
16306 \end_inset
16307
16308
16309 \begin_inset Quotes erd
16310 \end_inset
16311
16312 .
16313  External programs write into 
16314 \begin_inset Flex CharStyle:Code
16315 status collapsed
16316
16317 \begin_layout PlainLayout
16318 .lyxpipe.in
16319 \end_layout
16320
16321 \end_inset
16322
16323  and read back data from 
16324 \begin_inset Flex CharStyle:Code
16325 status collapsed
16326
16327 \begin_layout PlainLayout
16328 .lyxpipe.out
16329 \end_layout
16330
16331 \end_inset
16332
16333 .
16334  The stem of the pipe names can be defined in the 
16335 \begin_inset Flex CharStyle:MenuItem
16336 status collapsed
16337
16338 \begin_layout PlainLayout
16339
16340 \bar under
16341 T
16342 \bar default
16343 ools\SpecialChar \menuseparator
16344
16345 \bar under
16346 P
16347 \bar default
16348 references
16349 \end_layout
16350
16351 \end_inset
16352
16353  dialog, for example 
16354 \begin_inset Flex CharStyle:Code
16355 status collapsed
16356
16357 \begin_layout PlainLayout
16358 "/home/myhome/.lyxpipe"
16359 \end_layout
16360
16361 \end_inset
16362
16363 .
16364 \end_layout
16365
16366 \begin_layout Standard
16367 LyX will add the '
16368 \begin_inset Flex CharStyle:Code
16369 status collapsed
16370
16371 \begin_layout PlainLayout
16372 .in
16373 \end_layout
16374
16375 \end_inset
16376
16377 ' and '
16378 \begin_inset Flex CharStyle:Code
16379 status collapsed
16380
16381 \begin_layout PlainLayout
16382 .out
16383 \end_layout
16384
16385 \end_inset
16386
16387 ' to create the pipes.
16388  The above setting also has the effect of activating the LyX server.
16389  If one of the pipes already exists, LyX will assume that another LyX process
16390  is already running and will not start the server.
16391  To have several LyX processes with servers at the same time, you have to
16392  change the configuration between the start of the programs.
16393 \end_layout
16394
16395 \begin_layout Standard
16396 If you are developing a client program, you might find it useful to enable
16397  debugging information from the LyX server.
16398  Do this by starting LyX as lyx -dbg lyxserver.
16399 \end_layout
16400
16401 \begin_layout Standard
16402 Warning: if LyX crashes, it may not manage to remove the pipes; in this
16403  case you must remove them manually.
16404  If LyX starts and the pipes exist already, it will not start any server.
16405 \end_layout
16406
16407 \begin_layout Standard
16408 Other than this, there are a few points to consider:
16409 \end_layout
16410
16411 \begin_layout Itemize
16412 Both server and clients must run on UNIX or OS/2 machines.
16413  Communications between LyX on UNIX and clients on OS/2 or vice versa is
16414  not possible right now.
16415 \end_layout
16416
16417 \begin_layout Itemize
16418 On OS/2, only one client can connect to LyXServer at a time.
16419 \end_layout
16420
16421 \begin_layout Itemize
16422 On OS/2, clients must open inpipe with 
16423 \begin_inset Flex CharStyle:Code
16424 status collapsed
16425
16426 \begin_layout PlainLayout
16427 O_WRONLY
16428 \end_layout
16429
16430 \end_inset
16431
16432
16433 \end_layout
16434
16435 \begin_layout Standard
16436 mode.
16437 \end_layout
16438
16439 \begin_layout Standard
16440 You can find a complete example client written in C in the source distribution
16441  as 
16442 \begin_inset Flex CharStyle:Code
16443 status collapsed
16444
16445 \begin_layout PlainLayout
16446 development/lyxserver/server_monitor.c
16447 \end_layout
16448
16449 \end_inset
16450
16451 .
16452 \end_layout
16453
16454 \begin_layout Section
16455 Normal communication
16456 \end_layout
16457
16458 \begin_layout Standard
16459 To issue a LyX call, the client writes a line of ASCII text into the input
16460  pipe.
16461  This line has the following format:
16462 \end_layout
16463
16464 \begin_layout Quote
16465 LYXCMD:
16466 \emph on
16467 clientname
16468 \emph default
16469 :
16470 \emph on
16471 function
16472 \emph default
16473 :
16474 \emph on
16475 argument
16476 \end_layout
16477
16478 \begin_layout Description
16479
16480 \emph on
16481 clientname
16482 \emph default
16483  is a name that the client can choose arbitrarily.
16484  Its only use is that LyX will echo it if it sends an answer---so a client
16485  can dispatch results from different requesters.
16486 \end_layout
16487
16488 \begin_layout Description
16489
16490 \emph on
16491 function
16492 \emph default
16493  is the function you want LyX to perform.
16494  It is the same as the commands you'd use in the minibuffer.
16495 \end_layout
16496
16497 \begin_layout Description
16498
16499 \emph on
16500 argument
16501 \emph default
16502  is an optional argument which is meaningful only to some functions (for
16503  instance 
16504 \begin_inset Quotes eld
16505 \end_inset
16506
16507 self-insert
16508 \begin_inset Quotes erd
16509 \end_inset
16510
16511  which will insert the argument as text at the cursor position.)
16512 \end_layout
16513
16514 \begin_layout Standard
16515 The answer from LyX will arrive in the output pipe and be of the form
16516 \end_layout
16517
16518 \begin_layout Quote
16519 INFO:
16520 \emph on
16521 clientname
16522 \emph default
16523 :
16524 \emph on
16525 function
16526 \emph default
16527 :
16528 \emph on
16529 data
16530 \end_layout
16531
16532 \begin_layout Standard
16533 where 
16534 \emph on
16535 clientname
16536 \emph default
16537  and 
16538 \emph on
16539 function
16540 \emph default
16541  are just echoed from the command request, while 
16542 \emph on
16543 data
16544 \emph default
16545  is more or less useful information filled according to how the command
16546  execution worked out.
16547  Some commands will return information about the internal state of LyX,
16548  such as 
16549 \begin_inset Quotes eld
16550 \end_inset
16551
16552 font-state
16553 \begin_inset Quotes erd
16554 \end_inset
16555
16556 , while other will return an empty data-response.
16557  This means that the command execution went fine.
16558 \end_layout
16559
16560 \begin_layout Standard
16561 In case of errors, the response from LyX will have this form
16562 \end_layout
16563
16564 \begin_layout Quote
16565 ERROR:
16566 \emph on
16567 clientname
16568 \emph default
16569 :
16570 \emph on
16571 function
16572 \emph default
16573 :
16574 \emph on
16575 error message
16576 \end_layout
16577
16578 \begin_layout Standard
16579 where the 
16580 \emph on
16581 error message
16582 \emph default
16583  should contain an explanation of why the command failed.
16584 \end_layout
16585
16586 \begin_layout Standard
16587 Examples:
16588 \end_layout
16589
16590 \begin_layout LyX-Code
16591 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
16592 \end_layout
16593
16594 \begin_layout LyX-Code
16595 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
16596 \newline
16597 read a <~/.lyxpipe.out
16598 \newline
16599 echo $a
16600 \end_layout
16601
16602 \begin_layout Section
16603 Notification
16604 \end_layout
16605
16606 \begin_layout Standard
16607 LyX can notify clients of events going on asynchronously.
16608  Currently it will only do this if the user binds a key sequence with the
16609  function 
16610 \begin_inset Quotes eld
16611 \end_inset
16612
16613 notify
16614 \begin_inset Quotes erd
16615 \end_inset
16616
16617 .
16618  The format of the string LyX sends is as follows:
16619 \end_layout
16620
16621 \begin_layout Quote
16622 \begin_inset Flex CharStyle:Code
16623 status collapsed
16624
16625 \begin_layout PlainLayout
16626 NOTIFY:
16627 \end_layout
16628
16629 \end_inset
16630
16631
16632 \emph on
16633 key-sequence
16634 \end_layout
16635
16636 \begin_layout Standard
16637 where 
16638 \emph on
16639 key-sequence
16640 \emph default
16641  is the printed representation of the key sequence that was actually typed
16642  by the user.
16643 \end_layout
16644
16645 \begin_layout Standard
16646 This mechanism can be used to extend LyX's command set and implement macros:
16647  bind some key sequence to 
16648 \begin_inset Quotes eld
16649 \end_inset
16650
16651 notify
16652 \begin_inset Quotes erd
16653 \end_inset
16654
16655 , start a client that listens on the out pipe, dispatches the command according
16656  to the sequence and starts a function that may use LyX calls and LyX requests
16657  to issue a command or a series of commands to LyX.
16658 \end_layout
16659
16660 \begin_layout Section
16661 The simple LyX Server Protocol
16662 \end_layout
16663
16664 \begin_layout Standard
16665 LyX implements a simple protocol that can be used for session management.
16666  All messages are of the form
16667 \end_layout
16668
16669 \begin_layout Quote
16670 LYXSRV:
16671 \emph on
16672 clientname
16673 \emph default
16674 :
16675 \emph on
16676 protocol message
16677 \end_layout
16678
16679 \begin_layout Standard
16680 where 
16681 \emph on
16682 protocol message
16683 \emph default
16684  can be 
16685 \begin_inset Quotes eld
16686 \end_inset
16687
16688 hello
16689 \begin_inset Quotes erd
16690 \end_inset
16691
16692  or 
16693 \begin_inset Quotes eld
16694 \end_inset
16695
16696 bye
16697 \begin_inset Quotes erd
16698 \end_inset
16699
16700 .
16701  If 
16702 \begin_inset Quotes eld
16703 \end_inset
16704
16705 hello
16706 \begin_inset Quotes erd
16707 \end_inset
16708
16709  is received from a client, LyX will report back to inform the client that
16710  it's listening to it's messages, while 
16711 \begin_inset Quotes eld
16712 \end_inset
16713
16714 bye
16715 \begin_inset Quotes erd
16716 \end_inset
16717
16718  sent from LyX will inform clients that LyX is closing.
16719 \end_layout
16720
16721 \end_body
16722 \end_document