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