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