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