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