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