]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
da400c95a0ed2f6e4b4ecf7c4809e1c3eb06931b
[lyx.git] / lib / doc / Customization.lyx
1 #LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
2 \lyxformat 339
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 CommandInset label
9522 LatexCommand label
9523 name "des:CopyStyle"
9524
9525 \end_inset
9526
9527
9528 \begin_inset Flex CharStyle:Code
9529 status collapsed
9530
9531 \begin_layout Plain Layout
9532 [string]
9533 \end_layout
9534
9535 \end_inset
9536
9537  Copies all the features of an existing style into the current one.
9538  
9539 \end_layout
9540
9541 \begin_layout Description
9542 \begin_inset Flex CharStyle:Code
9543 status collapsed
9544
9545 \begin_layout Plain Layout
9546 DependsOn
9547 \end_layout
9548
9549 \end_inset
9550
9551  The name of a style whose preamble should be output 
9552 \emph on
9553 before
9554 \emph default
9555  this one.
9556  This allows to ensure some ordering of the preamble snippets when macros
9557  definitions depend on one another.
9558 \begin_inset Foot
9559 status collapsed
9560
9561 \begin_layout Plain Layout
9562 Note that, besides that functionality, there is no way to ensure any ordering
9563  of preambles.
9564  The ordering that you see in a given version of LyX may change without
9565  warning in later versions.
9566 \end_layout
9567
9568 \end_inset
9569
9570
9571 \end_layout
9572
9573 \begin_layout Description
9574 \begin_inset Flex CharStyle:Code
9575 status collapsed
9576
9577 \begin_layout Plain Layout
9578 EndLabeltype
9579 \end_layout
9580
9581 \end_inset
9582
9583  [
9584 \begin_inset Flex CharStyle:Code
9585 status collapsed
9586
9587 \begin_layout Plain Layout
9588
9589 \emph on
9590 No_Label
9591 \emph default
9592 , Box, Filled_Box, Static
9593 \end_layout
9594
9595 \end_inset
9596
9597 ] The type of label that stands at the end of the paragraph (or sequence
9598  of paragraphs if 
9599 \begin_inset Flex CharStyle:Code
9600 status collapsed
9601
9602 \begin_layout Plain Layout
9603 LatexType
9604 \end_layout
9605
9606 \end_inset
9607
9608  is 
9609 \begin_inset Flex CharStyle:Code
9610 status collapsed
9611
9612 \begin_layout Plain Layout
9613 Environment
9614 \end_layout
9615
9616 \end_inset
9617
9618
9619 \begin_inset Flex CharStyle:Code
9620 status collapsed
9621
9622 \begin_layout Plain Layout
9623 Item_Environment
9624 \end_layout
9625
9626 \end_inset
9627
9628  or 
9629 \begin_inset Flex CharStyle:Code
9630 status collapsed
9631
9632 \begin_layout Plain Layout
9633 List_Environment
9634 \end_layout
9635
9636 \end_inset
9637
9638 ).
9639  
9640 \begin_inset Flex CharStyle:Code
9641 status collapsed
9642
9643 \begin_layout Plain Layout
9644 No_Label
9645 \end_layout
9646
9647 \end_inset
9648
9649  means 
9650 \begin_inset Quotes eld
9651 \end_inset
9652
9653 nothing
9654 \begin_inset Quotes erd
9655 \end_inset
9656
9657
9658 \begin_inset Flex CharStyle:Code
9659 status collapsed
9660
9661 \begin_layout Plain Layout
9662 Box
9663 \end_layout
9664
9665 \end_inset
9666
9667  (resp.
9668 \begin_inset Flex CharStyle:Code
9669 status collapsed
9670
9671 \begin_layout Plain Layout
9672 \begin_inset space ~
9673 \end_inset
9674
9675 Filled_Box
9676 \end_layout
9677
9678 \end_inset
9679
9680 ) is a white (resp.
9681 \begin_inset space ~
9682 \end_inset
9683
9684 black) square suitable for end of proof markers, 
9685 \begin_inset Flex CharStyle:Code
9686 status collapsed
9687
9688 \begin_layout Plain Layout
9689 Static
9690 \end_layout
9691
9692 \end_inset
9693
9694  is an explicit text string.
9695 \end_layout
9696
9697 \begin_layout Description
9698 \begin_inset Flex CharStyle:Code
9699 status collapsed
9700
9701 \begin_layout Plain Layout
9702 EndLabelString
9703 \end_layout
9704
9705 \end_inset
9706
9707  [
9708 \begin_inset Flex CharStyle:Code
9709 status collapsed
9710
9711 \begin_layout Plain Layout
9712 string=""
9713 \end_layout
9714
9715 \end_inset
9716
9717 ] The string used for a label with a 
9718 \begin_inset Flex CharStyle:Code
9719 status collapsed
9720
9721 \begin_layout Plain Layout
9722 Static
9723 \end_layout
9724
9725 \end_inset
9726
9727  
9728 \begin_inset Flex CharStyle:Code
9729 status collapsed
9730
9731 \begin_layout Plain Layout
9732 EndLabelType
9733 \end_layout
9734
9735 \end_inset
9736
9737 .
9738  
9739 \end_layout
9740
9741 \begin_layout Description
9742 \begin_inset Flex CharStyle:Code
9743 status collapsed
9744
9745 \begin_layout Plain Layout
9746 Fill_Bottom
9747 \end_layout
9748
9749 \end_inset
9750
9751  [
9752 \begin_inset Flex CharStyle:Code
9753 status collapsed
9754
9755 \begin_layout Plain Layout
9756
9757 \emph on
9758 0
9759 \emph default
9760 ,1
9761 \end_layout
9762
9763 \end_inset
9764
9765 ] Similar to 
9766 \begin_inset Flex CharStyle:Code
9767 status collapsed
9768
9769 \begin_layout Plain Layout
9770 Fill_Top
9771 \end_layout
9772
9773 \end_inset
9774
9775 .
9776 \end_layout
9777
9778 \begin_layout Description
9779 \begin_inset Flex CharStyle:Code
9780 status collapsed
9781
9782 \begin_layout Plain Layout
9783 Fill_Top
9784 \end_layout
9785
9786 \end_inset
9787
9788  [
9789 \begin_inset Flex CharStyle:Code
9790 status collapsed
9791
9792 \begin_layout Plain Layout
9793
9794 \emph on
9795 0
9796 \emph default
9797 ,1
9798 \end_layout
9799
9800 \end_inset
9801
9802 ] With this parameter the 
9803 \begin_inset Flex CharStyle:MenuItem
9804 status collapsed
9805
9806 \begin_layout Plain Layout
9807 Fill
9808 \end_layout
9809
9810 \end_inset
9811
9812  value of the 
9813 \begin_inset Quotes eld
9814 \end_inset
9815
9816 Vertical space above
9817 \begin_inset Quotes erd
9818 \end_inset
9819
9820  list of the 
9821 \begin_inset Flex CharStyle:MenuItem
9822 status collapsed
9823
9824 \begin_layout Plain Layout
9825
9826 \bar under
9827 E
9828 \bar default
9829 dit\SpecialChar \menuseparator
9830
9831 \bar under
9832 P
9833 \bar default
9834 aragraph
9835 \begin_inset space ~
9836 \end_inset
9837
9838 Settings
9839 \end_layout
9840
9841 \end_inset
9842
9843  dialog can be set when initializing a paragraph with this style.
9844 \begin_inset Foot
9845 status collapsed
9846
9847 \begin_layout Plain Layout
9848
9849 \emph on
9850 Note from Jean-Marc:
9851 \emph default
9852  I'm not sure that this setting has much use, and it should probably be
9853  removed in later versions.
9854 \end_layout
9855
9856 \end_inset
9857
9858  
9859 \end_layout
9860
9861 \begin_layout Description
9862 \begin_inset Flex CharStyle:Code
9863 status collapsed
9864
9865 \begin_layout Plain Layout
9866 Font
9867 \end_layout
9868
9869 \end_inset
9870
9871  The font used for both the text body 
9872 \emph on
9873 and
9874 \emph default
9875  the label.
9876  See section
9877 \begin_inset space ~
9878 \end_inset
9879
9880
9881 \begin_inset CommandInset ref
9882 LatexCommand ref
9883 reference "sec:fonts"
9884
9885 \end_inset
9886
9887 .
9888  Note that defining this font automatically defines the 
9889 \begin_inset Flex CharStyle:Code
9890 status collapsed
9891
9892 \begin_layout Plain Layout
9893 LabelFont
9894 \end_layout
9895
9896 \end_inset
9897
9898  to the same value.
9899  So you should define this one first if you also want to define 
9900 \begin_inset Flex CharStyle:Code
9901 status collapsed
9902
9903 \begin_layout Plain Layout
9904 LabelFont
9905 \end_layout
9906
9907 \end_inset
9908
9909 .
9910 \end_layout
9911
9912 \begin_layout Description
9913 \begin_inset Flex CharStyle:Code
9914 status collapsed
9915
9916 \begin_layout Plain Layout
9917 FreeSpacing
9918 \end_layout
9919
9920 \end_inset
9921
9922  
9923 \begin_inset CommandInset label
9924 LatexCommand label
9925 name "des:FreeSpacing"
9926
9927 \end_inset
9928
9929 [
9930 \emph on
9931
9932 \begin_inset Flex CharStyle:Code
9933 status collapsed
9934
9935 \begin_layout Plain Layout
9936
9937 \emph on
9938 0
9939 \end_layout
9940
9941 \end_inset
9942
9943
9944 \emph default
9945
9946 \begin_inset Flex CharStyle:Code
9947 status collapsed
9948
9949 \begin_layout Plain Layout
9950 1
9951 \end_layout
9952
9953 \end_inset
9954
9955 ] Usually LyX doesn't allow you to insert more than one space between words,
9956  since a space is considered as the separation between two words, not a
9957  character or symbol of its own.
9958  This is a very fine thing but sometimes annoying, for example, when typing
9959  program code or plain LaTeX code.
9960  For this reason, 
9961 \begin_inset Flex CharStyle:Code
9962 status collapsed
9963
9964 \begin_layout Plain Layout
9965 FreeSpacing
9966 \end_layout
9967
9968 \end_inset
9969
9970  can be enabled.
9971  Note that LyX will create protected blanks for the additional blanks when
9972  in another mode than LaTeX-mode.
9973 \end_layout
9974
9975 \begin_layout Description
9976 \begin_inset Flex CharStyle:Code
9977 status collapsed
9978
9979 \begin_layout Plain Layout
9980 InnerTag
9981 \end_layout
9982
9983 \end_inset
9984
9985  [[FIXME]]
9986 \end_layout
9987
9988 \begin_layout Description
9989 \begin_inset Flex CharStyle:Code
9990 status collapsed
9991
9992 \begin_layout Plain Layout
9993 InTitle
9994 \end_layout
9995
9996 \end_inset
9997
9998  
9999 \begin_inset Flex CharStyle:Code
10000 status collapsed
10001
10002 \begin_layout Plain Layout
10003 [1, 0]
10004 \end_layout
10005
10006 \end_inset
10007
10008  If 1, marks the layout as being part of a title block (see also the 
10009 \begin_inset Flex CharStyle:Code
10010 status collapsed
10011
10012 \begin_layout Plain Layout
10013 TitleLatexType
10014 \end_layout
10015
10016 \end_inset
10017
10018  and 
10019 \begin_inset Flex CharStyle:Code
10020 status collapsed
10021
10022 \begin_layout Plain Layout
10023 TitleLatexName
10024 \end_layout
10025
10026 \end_inset
10027
10028  global entries).
10029 \end_layout
10030
10031 \begin_layout Description
10032 \begin_inset Flex CharStyle:Code
10033 status collapsed
10034
10035 \begin_layout Plain Layout
10036 ItemSep
10037 \end_layout
10038
10039 \end_inset
10040
10041  [
10042 \begin_inset Flex CharStyle:Code
10043 status collapsed
10044
10045 \begin_layout Plain Layout
10046 float=0
10047 \end_layout
10048
10049 \end_inset
10050
10051 ] This provides extra space between paragraphs that have the same layout.
10052  If you put other layouts into an environment, each is separated with the
10053  environment's 
10054 \begin_inset Flex CharStyle:Code
10055 status collapsed
10056
10057 \begin_layout Plain Layout
10058 Parsep
10059 \end_layout
10060
10061 \end_inset
10062
10063 .
10064  But the whole items of the environment are additionally separated with
10065  this 
10066 \begin_inset Flex CharStyle:Code
10067 status collapsed
10068
10069 \begin_layout Plain Layout
10070 Itemsep
10071 \end_layout
10072
10073 \end_inset
10074
10075 .
10076  Note that this is a
10077 \emph on
10078  multiplier.
10079 \end_layout
10080
10081 \begin_layout Description
10082 \begin_inset Flex CharStyle:Code
10083 status collapsed
10084
10085 \begin_layout Plain Layout
10086 ItemTag
10087 \end_layout
10088
10089 \end_inset
10090
10091  [[FIXME]]
10092 \end_layout
10093
10094 \begin_layout Description
10095 \begin_inset Flex CharStyle:Code
10096 status collapsed
10097
10098 \begin_layout Plain Layout
10099 KeepEmpty
10100 \end_layout
10101
10102 \end_inset
10103
10104  
10105 \begin_inset CommandInset label
10106 LatexCommand label
10107 name "des:KeepEmpty"
10108
10109 \end_inset
10110
10111 [
10112 \emph on
10113
10114 \begin_inset Flex CharStyle:Code
10115 status collapsed
10116
10117 \begin_layout Plain Layout
10118
10119 \emph on
10120 0
10121 \end_layout
10122
10123 \end_inset
10124
10125
10126 \emph default
10127
10128 \begin_inset Flex CharStyle:Code
10129 status collapsed
10130
10131 \begin_layout Plain Layout
10132 1
10133 \end_layout
10134
10135 \end_inset
10136
10137 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10138  lead to empty LaTeX output.
10139  There are some cases where this could be desirable however: in a letter
10140  template, the required fields can be provided as empty fields, so that
10141  people do not forget them; in some special classes, a layout can be used
10142  as some kind of break, which does not contain actual text.
10143 \end_layout
10144
10145 \begin_layout Description
10146 \begin_inset Flex CharStyle:Code
10147 status collapsed
10148
10149 \begin_layout Plain Layout
10150 LabelBottomsep
10151 \end_layout
10152
10153 \end_inset
10154
10155  [float=0] The vertical space between the label and the text body.
10156  Only used for labels that are above the text body (
10157 \begin_inset Flex CharStyle:Code
10158 status collapsed
10159
10160 \begin_layout Plain Layout
10161 Top_Environment
10162 \end_layout
10163
10164 \end_inset
10165
10166
10167 \begin_inset Flex CharStyle:Code
10168 status collapsed
10169
10170 \begin_layout Plain Layout
10171 Centered_Top_Environment
10172 \end_layout
10173
10174 \end_inset
10175
10176 ).
10177 \end_layout
10178
10179 \begin_layout Description
10180 \begin_inset Flex CharStyle:Code
10181 status collapsed
10182
10183 \begin_layout Plain Layout
10184 LabelCounter
10185 \end_layout
10186
10187 \end_inset
10188
10189  [
10190 \begin_inset Flex CharStyle:Code
10191 status collapsed
10192
10193 \begin_layout Plain Layout
10194 string=""
10195 \end_layout
10196
10197 \end_inset
10198
10199 ]
10200 \begin_inset Newline newline
10201 \end_inset
10202
10203 The name of the counter for automatic numbering (see Section 
10204 \begin_inset CommandInset ref
10205 LatexCommand ref
10206 reference "sec:counter"
10207
10208 \end_inset
10209
10210  for details).
10211  This must be given if 
10212 \begin_inset Flex CharStyle:Code
10213 status collapsed
10214
10215 \begin_layout Plain Layout
10216 Labeltype
10217 \end_layout
10218
10219 \end_inset
10220
10221  is 
10222 \begin_inset Flex CharStyle:Code
10223 status collapsed
10224
10225 \begin_layout Plain Layout
10226 Counter
10227 \end_layout
10228
10229 \end_inset
10230
10231 .
10232 \end_layout
10233
10234 \begin_layout Description
10235 \begin_inset Flex CharStyle:Code
10236 status collapsed
10237
10238 \begin_layout Plain Layout
10239 LabelFont
10240 \end_layout
10241
10242 \end_inset
10243
10244  The font used for the label.
10245  See section
10246 \begin_inset space ~
10247 \end_inset
10248
10249
10250 \begin_inset CommandInset ref
10251 LatexCommand ref
10252 reference "sec:fonts"
10253
10254 \end_inset
10255
10256 .
10257 \end_layout
10258
10259 \begin_layout Description
10260 \begin_inset Flex CharStyle:Code
10261 status collapsed
10262
10263 \begin_layout Plain Layout
10264 Labelsep
10265 \end_layout
10266
10267 \end_inset
10268
10269  [
10270 \begin_inset Flex CharStyle:Code
10271 status collapsed
10272
10273 \begin_layout Plain Layout
10274 string=""
10275 \end_layout
10276
10277 \end_inset
10278
10279 ] The horizontal space between the label and the text body.
10280  Only used for labels that are not above the text body.
10281 \end_layout
10282
10283 \begin_layout Description
10284 \begin_inset Flex CharStyle:Code
10285 status collapsed
10286
10287 \begin_layout Plain Layout
10288 LabelString
10289 \end_layout
10290
10291 \end_inset
10292
10293  [
10294 \begin_inset Flex CharStyle:Code
10295 status collapsed
10296
10297 \begin_layout Plain Layout
10298 string=""
10299 \end_layout
10300
10301 \end_inset
10302
10303 ] The string used for a label with a 
10304 \begin_inset Flex CharStyle:Code
10305 status collapsed
10306
10307 \begin_layout Plain Layout
10308 Static
10309 \end_layout
10310
10311 \end_inset
10312
10313  labeltype.
10314  When 
10315 \begin_inset Flex CharStyle:Code
10316 status collapsed
10317
10318 \begin_layout Plain Layout
10319 LabelCounter
10320 \end_layout
10321
10322 \end_inset
10323
10324  is set, this string can be contain the special formatting commands described
10325  in Section 
10326 \begin_inset CommandInset ref
10327 LatexCommand ref
10328 reference "sec:counter"
10329
10330 \end_inset
10331
10332 .
10333 \begin_inset Foot
10334 status collapsed
10335
10336 \begin_layout Plain Layout
10337 For the sake of backwards compatibility, the string 
10338 \begin_inset Flex CharStyle:Code
10339 status collapsed
10340
10341 \begin_layout Plain Layout
10342 @
10343 \emph on
10344 style-name
10345 \emph default
10346 @
10347 \end_layout
10348
10349 \end_inset
10350
10351  will be replaced by the expanded 
10352 \begin_inset Flex CharStyle:Code
10353 status collapsed
10354
10355 \begin_layout Plain Layout
10356 LabelString
10357 \end_layout
10358
10359 \end_inset
10360
10361  of style 
10362 \begin_inset Flex CharStyle:Code
10363 status collapsed
10364
10365 \begin_layout Plain Layout
10366
10367 \emph on
10368 style-name
10369 \end_layout
10370
10371 \end_inset
10372
10373 .
10374  This feature is now obsolete and should be replaced by the mechanisms of
10375  Section 
10376 \begin_inset CommandInset ref
10377 LatexCommand ref
10378 reference "sec:counter"
10379
10380 \end_inset
10381
10382 .
10383 \end_layout
10384
10385 \end_inset
10386
10387
10388 \end_layout
10389
10390 \begin_layout Description
10391 \begin_inset Flex CharStyle:Code
10392 status collapsed
10393
10394 \begin_layout Plain Layout
10395 LabelStringAppendix
10396 \end_layout
10397
10398 \end_inset
10399
10400  [
10401 \begin_inset Flex CharStyle:Code
10402 status collapsed
10403
10404 \begin_layout Plain Layout
10405 string=""
10406 \end_layout
10407
10408 \end_inset
10409
10410 ] This is used inside the appendix instead of 
10411 \begin_inset Flex CharStyle:Code
10412 status collapsed
10413
10414 \begin_layout Plain Layout
10415 LabelString
10416 \end_layout
10417
10418 \end_inset
10419
10420 .
10421  Note that every 
10422 \begin_inset Flex CharStyle:Code
10423 status collapsed
10424
10425 \begin_layout Plain Layout
10426 LabelString
10427 \end_layout
10428
10429 \end_inset
10430
10431  statement resets 
10432 \begin_inset Flex CharStyle:Code
10433 status collapsed
10434
10435 \begin_layout Plain Layout
10436 LabelStringAppendix
10437 \end_layout
10438
10439 \end_inset
10440
10441  too.
10442 \end_layout
10443
10444 \begin_layout Description
10445 \begin_inset Flex CharStyle:Code
10446 status collapsed
10447
10448 \begin_layout Plain Layout
10449 Labeltype
10450 \end_layout
10451
10452 \end_inset
10453
10454  [
10455 \begin_inset Flex CharStyle:Code
10456 status collapsed
10457
10458 \begin_layout Plain Layout
10459
10460 \emph on
10461 No_Label
10462 \emph default
10463 , Manual, Static, Top_Environment, 
10464 \begin_inset Newline newline
10465 \end_inset
10466
10467 Centered_Top_Environment, Sensitive, Counter
10468 \end_layout
10469
10470 \end_inset
10471
10472
10473 \begin_inset Newline newline
10474 \end_inset
10475
10476
10477 \begin_inset Flex CharStyle:Code
10478 status collapsed
10479
10480 \begin_layout Plain Layout
10481 Manual
10482 \end_layout
10483
10484 \end_inset
10485
10486  means the label is the very first word (up to the first real blank).
10487 \begin_inset Foot
10488 status collapsed
10489
10490 \begin_layout Plain Layout
10491 Use protected spaces if you want more than one word as the label.
10492 \end_layout
10493
10494 \end_inset
10495
10496  
10497 \begin_inset Flex CharStyle:Code
10498 status collapsed
10499
10500 \begin_layout Plain Layout
10501 Static
10502 \end_layout
10503
10504 \end_inset
10505
10506  means it is defined in the layout (see 
10507 \begin_inset Flex CharStyle:Code
10508 status collapsed
10509
10510 \begin_layout Plain Layout
10511 LabelString
10512 \end_layout
10513
10514 \end_inset
10515
10516 ).
10517  
10518 \begin_inset Flex CharStyle:Code
10519 status collapsed
10520
10521 \begin_layout Plain Layout
10522 Top_Environment
10523 \end_layout
10524
10525 \end_inset
10526
10527  and 
10528 \begin_inset Flex CharStyle:Code
10529 status collapsed
10530
10531 \begin_layout Plain Layout
10532 Centered_Top_Environment
10533 \end_layout
10534
10535 \end_inset
10536
10537  are special cases of 
10538 \begin_inset Flex CharStyle:Code
10539 status collapsed
10540
10541 \begin_layout Plain Layout
10542 Static
10543 \end_layout
10544
10545 \end_inset
10546
10547 .
10548  The label will be printed above the paragraph, but only at the top of an
10549  environment or the top of a chain of paragraphs with this layout.
10550  Usage is for example the 
10551 \begin_inset Flex CharStyle:MenuItem
10552 status collapsed
10553
10554 \begin_layout Plain Layout
10555 Abstract
10556 \end_layout
10557
10558 \end_inset
10559
10560  layout or the 
10561 \begin_inset Flex CharStyle:MenuItem
10562 status collapsed
10563
10564 \begin_layout Plain Layout
10565 Bibliography
10566 \end_layout
10567
10568 \end_inset
10569
10570  layout.
10571  This is also the case for 
10572 \begin_inset Flex CharStyle:Code
10573 status collapsed
10574
10575 \begin_layout Plain Layout
10576 Manual
10577 \end_layout
10578
10579 \end_inset
10580
10581  labels with latex type 
10582 \begin_inset Flex CharStyle:Code
10583 status collapsed
10584
10585 \begin_layout Plain Layout
10586 Environment
10587 \end_layout
10588
10589 \end_inset
10590
10591 , in order to make layouts for theorems work correctly.
10592  
10593 \begin_inset Flex CharStyle:Code
10594 status collapsed
10595
10596 \begin_layout Plain Layout
10597 Sensitive
10598 \end_layout
10599
10600 \end_inset
10601
10602  is a special case for the caption-labels 
10603 \begin_inset Quotes eld
10604 \end_inset
10605
10606 Figure
10607 \begin_inset Quotes erd
10608 \end_inset
10609
10610  and 
10611 \begin_inset Quotes eld
10612 \end_inset
10613
10614 Table
10615 \begin_inset Quotes erd
10616 \end_inset
10617
10618 .
10619  
10620 \begin_inset Flex CharStyle:Code
10621 status collapsed
10622
10623 \begin_layout Plain Layout
10624 Sensitive
10625 \end_layout
10626
10627 \end_inset
10628
10629  means the (hardcoded) label string depends on the kind of float.
10630  The 
10631 \begin_inset Flex CharStyle:Code
10632 status collapsed
10633
10634 \begin_layout Plain Layout
10635 Counter
10636 \end_layout
10637
10638 \end_inset
10639
10640  label type defines automatically numbered labels.
10641  See Section 
10642 \begin_inset CommandInset ref
10643 LatexCommand ref
10644 reference "sec:counter"
10645
10646 \end_inset
10647
10648 .
10649 \end_layout
10650
10651 \begin_layout Description
10652 \begin_inset Flex CharStyle:Code
10653 status collapsed
10654
10655 \begin_layout Plain Layout
10656 LatexFooter
10657 \end_layout
10658
10659 \end_inset
10660
10661  [[FIXME]]
10662 \end_layout
10663
10664 \begin_layout Description
10665 \begin_inset Flex CharStyle:Code
10666 status collapsed
10667
10668 \begin_layout Plain Layout
10669 LatexHeader
10670 \end_layout
10671
10672 \end_inset
10673
10674  [[FIXME]]
10675 \end_layout
10676
10677 \begin_layout Description
10678 \begin_inset Flex CharStyle:Code
10679 status collapsed
10680
10681 \begin_layout Plain Layout
10682 LatexName
10683 \end_layout
10684
10685 \end_inset
10686
10687  
10688 \begin_inset CommandInset label
10689 LatexCommand label
10690 name "des:LatexName"
10691
10692 \end_inset
10693
10694 The name of the corresponding LaTeX stuff.
10695  Either the environment or command name.
10696 \end_layout
10697
10698 \begin_layout Description
10699 \begin_inset Flex CharStyle:Code
10700 status collapsed
10701
10702 \begin_layout Plain Layout
10703 LatexParagraph
10704 \end_layout
10705
10706 \end_inset
10707
10708  [[FIXME]]
10709 \end_layout
10710
10711 \begin_layout Description
10712 \begin_inset Flex CharStyle:Code
10713 status collapsed
10714
10715 \begin_layout Plain Layout
10716 LatexParam
10717 \end_layout
10718
10719 \end_inset
10720
10721  
10722 \begin_inset CommandInset label
10723 LatexCommand label
10724 name "des:LatexParam"
10725
10726 \end_inset
10727
10728 An optional parameter for the corresponding 
10729 \begin_inset Flex CharStyle:Code
10730 status collapsed
10731
10732 \begin_layout Plain Layout
10733 LatexName
10734 \end_layout
10735
10736 \end_inset
10737
10738  stuff.
10739  This parameter cannot be changed from within LyX.
10740 \end_layout
10741
10742 \begin_layout Description
10743 \begin_inset Flex CharStyle:Code
10744 status collapsed
10745
10746 \begin_layout Plain Layout
10747 LatexType
10748 \end_layout
10749
10750 \end_inset
10751
10752  
10753 \begin_inset CommandInset label
10754 LatexCommand label
10755 name "des:LatexType"
10756
10757 \end_inset
10758
10759 [
10760 \begin_inset Flex CharStyle:Code
10761 status collapsed
10762
10763 \begin_layout Plain Layout
10764
10765 \emph on
10766 Paragraph
10767 \emph default
10768 , Command, Environment, Item_Environment,
10769 \end_layout
10770
10771 \end_inset
10772
10773  
10774 \begin_inset Flex CharStyle:Code
10775 status collapsed
10776
10777 \begin_layout Plain Layout
10778 List_Environment
10779 \end_layout
10780
10781 \end_inset
10782
10783 ] How the layout should be translated into LaTeX.
10784  
10785 \begin_inset Flex CharStyle:Code
10786 status collapsed
10787
10788 \begin_layout Plain Layout
10789 Paragraph
10790 \end_layout
10791
10792 \end_inset
10793
10794  means nothing special.
10795  
10796 \begin_inset Flex CharStyle:Code
10797 status collapsed
10798
10799 \begin_layout Plain Layout
10800 Command
10801 \end_layout
10802
10803 \end_inset
10804
10805  means 
10806 \begin_inset Flex CharStyle:Code
10807 status collapsed
10808
10809 \begin_layout Plain Layout
10810
10811 \backslash
10812
10813 \emph on
10814 LatexName
10815 \emph default
10816 {\SpecialChar \ldots{}
10817 }
10818 \end_layout
10819
10820 \end_inset
10821
10822  and 
10823 \begin_inset Flex CharStyle:Code
10824 status collapsed
10825
10826 \begin_layout Plain Layout
10827 Environment
10828 \end_layout
10829
10830 \end_inset
10831
10832  means 
10833 \begin_inset Flex CharStyle:Code
10834 status collapsed
10835
10836 \begin_layout Plain Layout
10837
10838 \backslash
10839 begin{
10840 \emph on
10841 LatexName
10842 \emph default
10843 }\SpecialChar \ldots{}
10844
10845 \backslash
10846 end{
10847 \emph on
10848 LatexName
10849 \emph default
10850 }
10851 \end_layout
10852
10853 \end_inset
10854
10855 .
10856  
10857 \begin_inset Flex CharStyle:Code
10858 status collapsed
10859
10860 \begin_layout Plain Layout
10861 Item_Environment
10862 \end_layout
10863
10864 \end_inset
10865
10866  is the same as 
10867 \begin_inset Flex CharStyle:Code
10868 status collapsed
10869
10870 \begin_layout Plain Layout
10871 Environment
10872 \end_layout
10873
10874 \end_inset
10875
10876 , except that a 
10877 \begin_inset Flex CharStyle:Code
10878 status collapsed
10879
10880 \begin_layout Plain Layout
10881
10882 \backslash
10883 item
10884 \end_layout
10885
10886 \end_inset
10887
10888  is generated for each paragraph of this environment.
10889  
10890 \begin_inset Flex CharStyle:Code
10891 status collapsed
10892
10893 \begin_layout Plain Layout
10894 List_Environment
10895 \end_layout
10896
10897 \end_inset
10898
10899  is the same as 
10900 \begin_inset Flex CharStyle:Code
10901 status collapsed
10902
10903 \begin_layout Plain Layout
10904 Item_Environment
10905 \end_layout
10906
10907 \end_inset
10908
10909 , except that 
10910 \begin_inset Flex CharStyle:Code
10911 status collapsed
10912
10913 \begin_layout Plain Layout
10914 LabelWidthString
10915 \end_layout
10916
10917 \end_inset
10918
10919  is passed as an argument to the environment.
10920  
10921 \begin_inset Flex CharStyle:Code
10922 status collapsed
10923
10924 \begin_layout Plain Layout
10925 LabelWidthString
10926 \end_layout
10927
10928 \end_inset
10929
10930  can be defined in the 
10931 \begin_inset Flex CharStyle:MenuItem
10932 status collapsed
10933
10934 \begin_layout Plain Layout
10935
10936 \bar under
10937 L
10938 \bar default
10939 ayout\SpecialChar \menuseparator
10940
10941 \bar under
10942 P
10943 \bar default
10944 aragraph
10945 \end_layout
10946
10947 \end_inset
10948
10949  dialog.
10950  
10951 \begin_inset Flex CharStyle:Code
10952 status collapsed
10953
10954 \begin_layout Plain Layout
10955
10956 \emph on
10957 LatexType
10958 \end_layout
10959
10960 \end_inset
10961
10962  is perhaps a bit misleading, since these rules apply to SGML classes, too.
10963  Visit the SGML class files for specific examples.
10964 \end_layout
10965
10966 \begin_layout Standard
10967 Putting the last few things together, the LaTeX output will be either: 
10968 \end_layout
10969
10970 \begin_layout LyX-Code
10971
10972 \backslash
10973 latexname[latexparam]{\SpecialChar \ldots{}
10974 }
10975 \end_layout
10976
10977 \begin_layout Standard
10978 or: 
10979 \end_layout
10980
10981 \begin_layout LyX-Code
10982
10983 \backslash
10984 begin{latexname}[latexparam] \SpecialChar \ldots{}
10985  
10986 \backslash
10987 end{latexname}.
10988 \end_layout
10989
10990 \begin_layout Standard
10991 depending upon the LaTex type.
10992 \end_layout
10993
10994 \begin_layout Description
10995 \begin_inset Flex CharStyle:Code
10996 status collapsed
10997
10998 \begin_layout Plain Layout
10999 LeftMargin
11000 \end_layout
11001
11002 \end_inset
11003
11004  [
11005 \begin_inset Flex CharStyle:Code
11006 status collapsed
11007
11008 \begin_layout Plain Layout
11009 string=""
11010 \end_layout
11011
11012 \end_inset
11013
11014 ] If you put layouts into environments, the leftmargins are not simply added,
11015  but added with a factor 
11016 \begin_inset Formula $\frac{4}{depth+4}$
11017 \end_inset
11018
11019 .
11020  Note that this parameter is also used when the margin is defined as 
11021 \begin_inset Flex CharStyle:Code
11022 status collapsed
11023
11024 \begin_layout Plain Layout
11025 Manual
11026 \end_layout
11027
11028 \end_inset
11029
11030  or 
11031 \begin_inset Flex CharStyle:Code
11032 status collapsed
11033
11034 \begin_layout Plain Layout
11035 Dynamic
11036 \end_layout
11037
11038 \end_inset
11039
11040 .
11041  Then it is added to the manual or dynamic margin.
11042  
11043 \begin_inset Newline newline
11044 \end_inset
11045
11046 The argument is passed as a string.
11047  For example 
11048 \begin_inset Quotes eld
11049 \end_inset
11050
11051
11052 \begin_inset Flex CharStyle:Code
11053 status collapsed
11054
11055 \begin_layout Plain Layout
11056 MM
11057 \end_layout
11058
11059 \end_inset
11060
11061
11062 \begin_inset Quotes erd
11063 \end_inset
11064
11065  means that the paragraph is indented with the width of 
11066 \begin_inset Quotes eld
11067 \end_inset
11068
11069
11070 \begin_inset Flex CharStyle:Code
11071 status collapsed
11072
11073 \begin_layout Plain Layout
11074 MM
11075 \end_layout
11076
11077 \end_inset
11078
11079
11080 \begin_inset Quotes erd
11081 \end_inset
11082
11083  in the normal font.
11084  You can get a negative width by prefixing the string with 
11085 \begin_inset Quotes eld
11086 \end_inset
11087
11088
11089 \begin_inset Flex CharStyle:Code
11090 status collapsed
11091
11092 \begin_layout Plain Layout
11093 -
11094 \end_layout
11095
11096 \end_inset
11097
11098
11099 \begin_inset Quotes erd
11100 \end_inset
11101
11102 .
11103  This way was chosen so that the look is the same with each used screen
11104  font.
11105  
11106 \end_layout
11107
11108 \begin_layout Description
11109 \begin_inset Flex CharStyle:Code
11110 status collapsed
11111
11112 \begin_layout Plain Layout
11113 Margin
11114 \end_layout
11115
11116 \end_inset
11117
11118  [
11119 \begin_inset Flex CharStyle:Code
11120 status collapsed
11121
11122 \begin_layout Plain Layout
11123
11124 \emph on
11125 Static
11126 \emph default
11127 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11128 \end_layout
11129
11130 \end_inset
11131
11132
11133 \begin_inset Newline newline
11134 \end_inset
11135
11136 The kind of margin that the layout has on the left side.
11137  
11138 \begin_inset Flex CharStyle:Code
11139 status collapsed
11140
11141 \begin_layout Plain Layout
11142 Static
11143 \end_layout
11144
11145 \end_inset
11146
11147  just means a fixed margin.
11148  
11149 \begin_inset Flex CharStyle:Code
11150 status collapsed
11151
11152 \begin_layout Plain Layout
11153 Manual
11154 \end_layout
11155
11156 \end_inset
11157
11158  means that the left margin depends on the string entered in the 
11159 \begin_inset Flex CharStyle:MenuItem
11160 status collapsed
11161
11162 \begin_layout Plain Layout
11163
11164 \bar under
11165 E
11166 \bar default
11167 dit\SpecialChar \menuseparator
11168
11169 \bar under
11170 P
11171 \bar default
11172 aragraph
11173 \begin_inset space ~
11174 \end_inset
11175
11176 Settings
11177 \end_layout
11178
11179 \end_inset
11180
11181  dialog.
11182  This is used to typeset nice lists without tabulators.
11183  
11184 \begin_inset Flex CharStyle:Code
11185 status collapsed
11186
11187 \begin_layout Plain Layout
11188 Dynamic
11189 \end_layout
11190
11191 \end_inset
11192
11193  means that the margin depends on the size of the label.
11194  This is used for automatic enumerated headlines.
11195  It is obvious that the headline 
11196 \begin_inset Quotes eld
11197 \end_inset
11198
11199 5.4.3.2.1 Very long headline
11200 \begin_inset Quotes erd
11201 \end_inset
11202
11203  must have a wider left margin (as wide as 
11204 \begin_inset Quotes eld
11205 \end_inset
11206
11207 5.4.3.2.1
11208 \begin_inset Quotes erd
11209 \end_inset
11210
11211  plus the space) than 
11212 \begin_inset Quotes eld
11213 \end_inset
11214
11215 3.2 Very long headline
11216 \begin_inset Quotes erd
11217 \end_inset
11218
11219 , even if standard 
11220 \begin_inset Quotes eld
11221 \end_inset
11222
11223 word processors
11224 \begin_inset Quotes erd
11225 \end_inset
11226
11227  are not able to do this.
11228  
11229 \begin_inset Flex CharStyle:Code
11230 status collapsed
11231
11232 \begin_layout Plain Layout
11233 First_Dynamic
11234 \end_layout
11235
11236 \end_inset
11237
11238  is similar, but only the very first row of the paragraph is dynamic, while
11239  the others are static; this is used, for example, for descriptions.
11240  
11241 \begin_inset Flex CharStyle:Code
11242 status collapsed
11243
11244 \begin_layout Plain Layout
11245 Right_Address_Box
11246 \end_layout
11247
11248 \end_inset
11249
11250  means the margin is chosen in a way that the longest row of this paragraph
11251  fits to the right margin.
11252  This is used to typeset an address on the right edge of the page.
11253 \end_layout
11254
11255 \begin_layout Description
11256 \begin_inset Flex CharStyle:Code
11257 status collapsed
11258
11259 \begin_layout Plain Layout
11260 NeedProtect
11261 \end_layout
11262
11263 \end_inset
11264
11265  
11266 \begin_inset CommandInset label
11267 LatexCommand label
11268 name "des:NeedProtect"
11269
11270 \end_inset
11271
11272 [
11273 \begin_inset Flex CharStyle:Code
11274 status collapsed
11275
11276 \begin_layout Plain Layout
11277
11278 \emph on
11279 0
11280 \end_layout
11281
11282 \end_inset
11283
11284 ,
11285 \begin_inset Flex CharStyle:Code
11286 status collapsed
11287
11288 \begin_layout Plain Layout
11289 1
11290 \end_layout
11291
11292 \end_inset
11293
11294 ] Whether fragile commands in this layout should be 
11295 \begin_inset Flex CharStyle:Code
11296 status collapsed
11297
11298 \begin_layout Plain Layout
11299
11300 \backslash
11301 protect
11302 \end_layout
11303
11304 \end_inset
11305
11306 'ed.
11307 \end_layout
11308
11309 \begin_layout Description
11310 \begin_inset Flex CharStyle:Code
11311 status collapsed
11312
11313 \begin_layout Plain Layout
11314 Newline
11315 \end_layout
11316
11317 \end_inset
11318
11319  [
11320 \begin_inset Flex CharStyle:Code
11321 status collapsed
11322
11323 \begin_layout Plain Layout
11324 0
11325 \end_layout
11326
11327 \end_inset
11328
11329
11330 \begin_inset Flex CharStyle:Code
11331 status collapsed
11332
11333 \begin_layout Plain Layout
11334
11335 \emph on
11336 1
11337 \end_layout
11338
11339 \end_inset
11340
11341 ] Whether newlines are translated into LaTeX newlines (
11342 \begin_inset Flex CharStyle:Code
11343 status collapsed
11344
11345 \begin_layout Plain Layout
11346
11347 \backslash
11348
11349 \backslash
11350
11351 \end_layout
11352
11353 \end_inset
11354
11355 ) or not.
11356  The translation can be switched off to allow more comfortable LaTeX editing
11357  inside LyX.
11358 \end_layout
11359
11360 \begin_layout Description
11361 \begin_inset Flex CharStyle:Code
11362 status collapsed
11363
11364 \begin_layout Plain Layout
11365 NextNoIndent
11366 \end_layout
11367
11368 \end_inset
11369
11370  [
11371 \begin_inset Flex CharStyle:Code
11372 status collapsed
11373
11374 \begin_layout Plain Layout
11375 1
11376 \end_layout
11377
11378 \end_inset
11379
11380
11381 \begin_inset Flex CharStyle:Code
11382 status collapsed
11383
11384 \begin_layout Plain Layout
11385
11386 \emph on
11387 0
11388 \end_layout
11389
11390 \end_inset
11391
11392 ] Whether the following Paragraph is allowed to indent its very first row.
11393  
11394 \begin_inset Flex CharStyle:Code
11395 status collapsed
11396
11397 \begin_layout Plain Layout
11398 1
11399 \end_layout
11400
11401 \end_inset
11402
11403  means that it is not allowed to do so; 
11404 \begin_inset Flex CharStyle:Code
11405 status collapsed
11406
11407 \begin_layout Plain Layout
11408 0
11409 \end_layout
11410
11411 \end_inset
11412
11413  means it could do so if it wants to.
11414 \end_layout
11415
11416 \begin_layout Description
11417 \begin_inset Flex CharStyle:Code
11418 status collapsed
11419
11420 \begin_layout Plain Layout
11421 ObsoletedBy
11422 \end_layout
11423
11424 \end_inset
11425
11426  [[FIXME]]
11427 \end_layout
11428
11429 \begin_layout Description
11430 \begin_inset Flex CharStyle:Code
11431 status collapsed
11432
11433 \begin_layout Plain Layout
11434 OptionalArgs
11435 \end_layout
11436
11437 \end_inset
11438
11439  [
11440 \begin_inset Flex CharStyle:Code
11441 status collapsed
11442
11443 \begin_layout Plain Layout
11444 int=0
11445 \end_layout
11446
11447 \end_inset
11448
11449 ] The number of optional arguments that can be used with this layout.
11450  This is useful for things like section headings, and only makes sense with
11451  LaTeX.
11452 \end_layout
11453
11454 \begin_layout Description
11455 \begin_inset Flex CharStyle:Code
11456 status collapsed
11457
11458 \begin_layout Plain Layout
11459 ParIndent
11460 \end_layout
11461
11462 \end_inset
11463
11464  [
11465 \begin_inset Flex CharStyle:Code
11466 status collapsed
11467
11468 \begin_layout Plain Layout
11469 string=""
11470 \end_layout
11471
11472 \end_inset
11473
11474 ] The indent of the very first line of a paragraph.
11475  The 
11476 \begin_inset Flex CharStyle:Code
11477 status collapsed
11478
11479 \begin_layout Plain Layout
11480 Parindent
11481 \end_layout
11482
11483 \end_inset
11484
11485  will be fixed for a certain layout.
11486  The exception is Standard layout, since the indentation of a Standard layout
11487  paragraph can be prohibited with 
11488 \begin_inset Flex CharStyle:Code
11489 status collapsed
11490
11491 \begin_layout Plain Layout
11492 NextNoIndent
11493 \end_layout
11494
11495 \end_inset
11496
11497 .
11498  Also, Standard layout paragraphs inside environments use the 
11499 \begin_inset Flex CharStyle:Code
11500 status collapsed
11501
11502 \begin_layout Plain Layout
11503 Parindent
11504 \end_layout
11505
11506 \end_inset
11507
11508  of the environment, not their native one.
11509  For example, Standard paragraphs inside an enumeration are not indented.
11510 \end_layout
11511
11512 \begin_layout Description
11513 \begin_inset Flex CharStyle:Code
11514 status collapsed
11515
11516 \begin_layout Plain Layout
11517 Parsep
11518 \end_layout
11519
11520 \end_inset
11521
11522  [
11523 \begin_inset Flex CharStyle:Code
11524 status collapsed
11525
11526 \begin_layout Plain Layout
11527 float=0
11528 \end_layout
11529
11530 \end_inset
11531
11532 ] The vertical space between two paragraphs of this layout.
11533 \end_layout
11534
11535 \begin_layout Description
11536 \begin_inset Flex CharStyle:Code
11537 status collapsed
11538
11539 \begin_layout Plain Layout
11540 Parskip
11541 \end_layout
11542
11543 \end_inset
11544
11545  [
11546 \begin_inset Flex CharStyle:Code
11547 status collapsed
11548
11549 \begin_layout Plain Layout
11550 float=0
11551 \end_layout
11552
11553 \end_inset
11554
11555 ] LyX allows the user to choose either 
11556 \begin_inset Quotes eld
11557 \end_inset
11558
11559 indent
11560 \begin_inset Quotes erd
11561 \end_inset
11562
11563  or 
11564 \begin_inset Quotes eld
11565 \end_inset
11566
11567 skip
11568 \begin_inset Quotes erd
11569 \end_inset
11570
11571  to typeset a document.
11572  When 
11573 \begin_inset Quotes eld
11574 \end_inset
11575
11576 indent
11577 \begin_inset Quotes erd
11578 \end_inset
11579
11580  is chosen, this value is completely ignored.
11581  When 
11582 \begin_inset Quotes eld
11583 \end_inset
11584
11585 skip
11586 \begin_inset Quotes erd
11587 \end_inset
11588
11589  is chosen, the parindent of a LaTeXtype 
11590 \begin_inset Quotes eld
11591 \end_inset
11592
11593 Paragraph
11594 \begin_inset Quotes erd
11595 \end_inset
11596
11597  layout is ignored and all paragraphs are separated by this parskip argument.
11598  The vertical space is calculated with 
11599 \begin_inset Flex CharStyle:Code
11600 status collapsed
11601
11602 \begin_layout Plain Layout
11603 value
11604 \begin_inset space ~
11605 \end_inset
11606
11607 * DefaultHeight
11608 \end_layout
11609
11610 \end_inset
11611
11612  where 
11613 \begin_inset Flex CharStyle:Code
11614 status collapsed
11615
11616 \begin_layout Plain Layout
11617 DefaultHeight
11618 \end_layout
11619
11620 \end_inset
11621
11622  is the height of a row with the normal font.
11623  This way, the look stays the same with different screen fonts.
11624 \end_layout
11625
11626 \begin_layout Description
11627 \begin_inset Flex CharStyle:Code
11628 status collapsed
11629
11630 \begin_layout Plain Layout
11631 PassThru
11632 \end_layout
11633
11634 \end_inset
11635
11636  
11637 \begin_inset CommandInset label
11638 LatexCommand label
11639 name "des:PassThru"
11640
11641 \end_inset
11642
11643 [
11644 \emph on
11645
11646 \begin_inset Flex CharStyle:Code
11647 status collapsed
11648
11649 \begin_layout Plain Layout
11650
11651 \emph on
11652 0
11653 \end_layout
11654
11655 \end_inset
11656
11657
11658 \emph default
11659
11660 \begin_inset Flex CharStyle:Code
11661 status collapsed
11662
11663 \begin_layout Plain Layout
11664 1
11665 \end_layout
11666
11667 \end_inset
11668
11669 ] Whether the contents of this paragraph should be output in raw form, meaning
11670  without special translations that LaTeX would require.
11671 \end_layout
11672
11673 \begin_layout Description
11674 \begin_inset Flex CharStyle:Code
11675 status collapsed
11676
11677 \begin_layout Plain Layout
11678 Preamble
11679 \end_layout
11680
11681 \end_inset
11682
11683  
11684 \begin_inset CommandInset label
11685 LatexCommand label
11686 name "des:Preamble"
11687
11688 \end_inset
11689
11690 Information to be included in the LaTeX preamable when this style is used.
11691  Used to define macros, load packages, etc., required by this particular
11692  style.
11693  Must end with 
11694 \begin_inset Quotes eld
11695 \end_inset
11696
11697
11698 \begin_inset Flex CharStyle:Code
11699 status collapsed
11700
11701 \begin_layout Plain Layout
11702 EndPreamble
11703 \end_layout
11704
11705 \end_inset
11706
11707
11708 \begin_inset Quotes erd
11709 \end_inset
11710
11711 .
11712 \end_layout
11713
11714 \begin_layout Description
11715 \begin_inset Flex CharStyle:Code
11716 status collapsed
11717
11718 \begin_layout Plain Layout
11719 Requires 
11720 \end_layout
11721
11722 \end_inset
11723
11724 [
11725 \begin_inset Flex CharStyle:Code
11726 status collapsed
11727
11728 \begin_layout Plain Layout
11729 string
11730 \end_layout
11731
11732 \end_inset
11733
11734
11735 \begin_inset CommandInset label
11736 LatexCommand label
11737 name "des:Requires"
11738
11739 \end_inset
11740
11741 Whether the layout requires the feature 
11742 \begin_inset Flex CharStyle:Code
11743 status collapsed
11744
11745 \begin_layout Plain Layout
11746 string
11747 \end_layout
11748
11749 \end_inset
11750
11751 .
11752  See the description of 
11753 \begin_inset Flex CharStyle:Code
11754 status collapsed
11755
11756 \begin_layout Plain Layout
11757 Provides
11758 \end_layout
11759
11760 \end_inset
11761
11762  above (page 
11763 \begin_inset CommandInset ref
11764 LatexCommand pageref
11765 reference "des:FreeSpacing"
11766
11767 \end_inset
11768
11769 ) for information on `features'.
11770  
11771 \end_layout
11772
11773 \begin_layout Description
11774 \begin_inset Flex CharStyle:Code
11775 status collapsed
11776
11777 \begin_layout Plain Layout
11778 RightMargin
11779 \end_layout
11780
11781 \end_inset
11782
11783  [
11784 \begin_inset Flex CharStyle:Code
11785 status collapsed
11786
11787 \begin_layout Plain Layout
11788 string=""
11789 \end_layout
11790
11791 \end_inset
11792
11793 ] Similar to 
11794 \begin_inset Flex CharStyle:Code
11795 status collapsed
11796
11797 \begin_layout Plain Layout
11798 LeftMargin
11799 \end_layout
11800
11801 \end_inset
11802
11803 .
11804 \end_layout
11805
11806 \begin_layout Description
11807 \begin_inset Flex CharStyle:Code
11808 status collapsed
11809
11810 \begin_layout Plain Layout
11811 Spacing
11812 \end_layout
11813
11814 \end_inset
11815
11816  [
11817 \begin_inset Flex CharStyle:Code
11818 status collapsed
11819
11820 \begin_layout Plain Layout
11821
11822 \emph on
11823 single
11824 \emph default
11825 , onehalf, double, other
11826 \end_layout
11827
11828 \end_inset
11829
11830  
11831 \emph on
11832 value
11833 \emph default
11834 ] This defines what the default spacing should be in the layout.
11835  The arguments 
11836 \begin_inset Flex CharStyle:Code
11837 status collapsed
11838
11839 \begin_layout Plain Layout
11840 single
11841 \end_layout
11842
11843 \end_inset
11844
11845
11846 \begin_inset Flex CharStyle:Code
11847 status collapsed
11848
11849 \begin_layout Plain Layout
11850 onehalf
11851 \end_layout
11852
11853 \end_inset
11854
11855  and 
11856 \begin_inset Flex CharStyle:Code
11857 status collapsed
11858
11859 \begin_layout Plain Layout
11860 double
11861 \end_layout
11862
11863 \end_inset
11864
11865  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11866  If you specify the argument 
11867 \begin_inset Flex CharStyle:Code
11868 status collapsed
11869
11870 \begin_layout Plain Layout
11871 other
11872 \end_layout
11873
11874 \end_inset
11875
11876 , then you should also provide a numerical argument which will be the actual
11877  multiplier value.
11878  Note that, contrary to other parameters, 
11879 \begin_inset Flex CharStyle:Code
11880 status collapsed
11881
11882 \begin_layout Plain Layout
11883 Spacing
11884 \end_layout
11885
11886 \end_inset
11887
11888  implies the generation of specific LaTeX code, using the package 
11889 \family roman
11890
11891 \begin_inset Flex CharStyle:Code
11892 status collapsed
11893
11894 \begin_layout Plain Layout
11895 setspace.sty
11896 \end_layout
11897
11898 \end_inset
11899
11900 .
11901 \end_layout
11902
11903 \begin_layout Description
11904 \begin_inset Flex CharStyle:Code
11905 status collapsed
11906
11907 \begin_layout Plain Layout
11908 TextFont
11909 \end_layout
11910
11911 \end_inset
11912
11913  The font used for the text body .
11914  See section 
11915 \begin_inset CommandInset ref
11916 LatexCommand ref
11917 reference "sec:fonts"
11918
11919 \end_inset
11920
11921 .
11922 \end_layout
11923
11924 \begin_layout Description
11925 \begin_inset Flex CharStyle:Code
11926 status collapsed
11927
11928 \begin_layout Plain Layout
11929
11930 \series medium
11931 TocLevel [int]
11932 \end_layout
11933
11934 \end_inset
11935
11936  The level of the style in the table of contents.
11937  This is used for automatic numbering of section headings.
11938 \end_layout
11939
11940 \begin_layout Description
11941 \begin_inset Flex CharStyle:Code
11942 status collapsed
11943
11944 \begin_layout Plain Layout
11945 TopSep
11946 \end_layout
11947
11948 \end_inset
11949
11950  [
11951 \begin_inset Flex CharStyle:Code
11952 status collapsed
11953
11954 \begin_layout Plain Layout
11955 float=0
11956 \end_layout
11957
11958 \end_inset
11959
11960 ] The vertical space with which the very first of a chain of paragraphs
11961  with this layout is separated from the previous paragraph.
11962  If the previous paragraph has another layout, the separations are not simply
11963  added, but the maximum is taken.
11964 \end_layout
11965
11966 \begin_layout Subsection
11967 Floats
11968 \end_layout
11969
11970 \begin_layout Standard
11971 \begin_inset CommandInset label
11972 LatexCommand label
11973 name "sec:floats"
11974
11975 \end_inset
11976
11977 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11978  define the floats (
11979 \begin_inset Flex CharStyle:MenuItem
11980 status collapsed
11981
11982 \begin_layout Plain Layout
11983 figure
11984 \end_layout
11985
11986 \end_inset
11987
11988
11989 \begin_inset Flex CharStyle:MenuItem
11990 status collapsed
11991
11992 \begin_layout Plain Layout
11993 table
11994 \end_layout
11995
11996 \end_inset
11997
11998 , \SpecialChar \ldots{}
11999 ) in the text class itself.
12000  Standard floats are included in the file 
12001 \begin_inset Flex CharStyle:Code
12002 status collapsed
12003
12004 \begin_layout Plain Layout
12005 stdfloats.inc
12006 \end_layout
12007
12008 \end_inset
12009
12010 , so you may have to do no more than add
12011 \end_layout
12012
12013 \begin_layout LyX-Code
12014 Input stdfloats.inc
12015 \end_layout
12016
12017 \begin_layout Standard
12018 to your layout file.
12019  If you want to implement a text class that proposes some other float types
12020  (like the AGU class bundled with LyX), the information below will hopefully
12021  help you:
12022 \end_layout
12023
12024 \begin_layout Description
12025 \begin_inset Flex CharStyle:Code
12026 status collapsed
12027
12028 \begin_layout Plain Layout
12029 Extension
12030 \end_layout
12031
12032 \end_inset
12033
12034  [
12035 \begin_inset Flex CharStyle:Code
12036 status collapsed
12037
12038 \begin_layout Plain Layout
12039 string
12040 \end_layout
12041
12042 \end_inset
12043
12044 =
12045 \begin_inset Quotes erd
12046 \end_inset
12047
12048
12049 \begin_inset Quotes erd
12050 \end_inset
12051
12052 ] The file name extension of an auxiliary file for the list of figures (or
12053  whatever).
12054  LaTeX writes the captions to this file.
12055 \end_layout
12056
12057 \begin_layout Description
12058 \begin_inset Flex CharStyle:Code
12059 status collapsed
12060
12061 \begin_layout Plain Layout
12062 GuiName
12063 \end_layout
12064
12065 \end_inset
12066
12067  [
12068 \begin_inset Flex CharStyle:Code
12069 status collapsed
12070
12071 \begin_layout Plain Layout
12072 string
12073 \end_layout
12074
12075 \end_inset
12076
12077 =
12078 \begin_inset Quotes erd
12079 \end_inset
12080
12081
12082 \begin_inset Quotes erd
12083 \end_inset
12084
12085 ] The string that will be used in the menus and also for the caption.
12086 \end_layout
12087
12088 \begin_layout Description
12089 \begin_inset Flex CharStyle:Code
12090 status collapsed
12091
12092 \begin_layout Plain Layout
12093 LaTeXBuiltin
12094 \end_layout
12095
12096 \end_inset
12097
12098  [
12099 \begin_inset Flex CharStyle:Code
12100 status collapsed
12101
12102 \begin_layout Plain Layout
12103
12104 \emph on
12105 0
12106 \end_layout
12107
12108 \end_inset
12109
12110
12111 \begin_inset Flex CharStyle:Code
12112 status collapsed
12113
12114 \begin_layout Plain Layout
12115 1
12116 \end_layout
12117
12118 \end_inset
12119
12120 ] Set to 
12121 \begin_inset Flex CharStyle:Code
12122 status collapsed
12123
12124 \begin_layout Plain Layout
12125 1
12126 \end_layout
12127
12128 \end_inset
12129
12130  if the float is already defined by the LaTeX document class.
12131  If this is set to 
12132 \begin_inset Flex CharStyle:Code
12133 status collapsed
12134
12135 \begin_layout Plain Layout
12136 0
12137 \end_layout
12138
12139 \end_inset
12140
12141 , the float will be defined using the LaTeX package 
12142 \begin_inset Flex CharStyle:Code
12143 status collapsed
12144
12145 \begin_layout Plain Layout
12146 float
12147 \end_layout
12148
12149 \end_inset
12150
12151 .
12152 \end_layout
12153
12154 \begin_layout Description
12155 \begin_inset Flex CharStyle:Code
12156 status collapsed
12157
12158 \begin_layout Plain Layout
12159 ListName
12160 \end_layout
12161
12162 \end_inset
12163
12164  [
12165 \begin_inset Flex CharStyle:Code
12166 status collapsed
12167
12168 \begin_layout Plain Layout
12169 string
12170 \end_layout
12171
12172 \end_inset
12173
12174 =
12175 \begin_inset Quotes erd
12176 \end_inset
12177
12178
12179 \begin_inset Quotes erd
12180 \end_inset
12181
12182 ] The heading used for the list of floats.
12183 \end_layout
12184
12185 \begin_layout Description
12186 \begin_inset Flex CharStyle:Code
12187 status collapsed
12188
12189 \begin_layout Plain Layout
12190 NumberWithin
12191 \end_layout
12192
12193 \end_inset
12194
12195  [
12196 \begin_inset Flex CharStyle:Code
12197 status collapsed
12198
12199 \begin_layout Plain Layout
12200 string
12201 \end_layout
12202
12203 \end_inset
12204
12205 =
12206 \begin_inset Quotes erd
12207 \end_inset
12208
12209
12210 \begin_inset Quotes erd
12211 \end_inset
12212
12213 ] This (optional) argument determines whether floats of this class will
12214  be numbered within some sectional unit of the document.
12215  For example, if within is equal to 
12216 \begin_inset Flex CharStyle:Code
12217 status collapsed
12218
12219 \begin_layout Plain Layout
12220 chapter
12221 \end_layout
12222
12223 \end_inset
12224
12225 , the floats will be numbered within chapters.
12226  
12227 \end_layout
12228
12229 \begin_layout Description
12230 \begin_inset Flex CharStyle:Code
12231 status collapsed
12232
12233 \begin_layout Plain Layout
12234 Placement
12235 \end_layout
12236
12237 \end_inset
12238
12239  [
12240 \begin_inset Flex CharStyle:Code
12241 status collapsed
12242
12243 \begin_layout Plain Layout
12244 string
12245 \end_layout
12246
12247 \end_inset
12248
12249 =
12250 \begin_inset Quotes erd
12251 \end_inset
12252
12253
12254 \begin_inset Quotes erd
12255 \end_inset
12256
12257 ] The default placement for the given class of floats.
12258  The string should be as in standard LaTeX: 
12259 \begin_inset Flex CharStyle:Code
12260 status collapsed
12261
12262 \begin_layout Plain Layout
12263 t
12264 \end_layout
12265
12266 \end_inset
12267
12268
12269 \begin_inset Flex CharStyle:Code
12270 status collapsed
12271
12272 \begin_layout Plain Layout
12273 b
12274 \end_layout
12275
12276 \end_inset
12277
12278
12279 \begin_inset Flex CharStyle:Code
12280 status collapsed
12281
12282 \begin_layout Plain Layout
12283 p
12284 \end_layout
12285
12286 \end_inset
12287
12288  and 
12289 \begin_inset Flex CharStyle:Code
12290 status collapsed
12291
12292 \begin_layout Plain Layout
12293 h
12294 \end_layout
12295
12296 \end_inset
12297
12298  for top, bottom, page, and here, respectively.
12299 \begin_inset Foot
12300 status collapsed
12301
12302 \begin_layout Plain Layout
12303 Note that the order of these letters in the string is irrelevant, like in
12304  LaTeX.
12305 \end_layout
12306
12307 \end_inset
12308
12309  On top of that there is a new type, 
12310 \begin_inset Flex CharStyle:Code
12311 status collapsed
12312
12313 \begin_layout Plain Layout
12314 H
12315 \end_layout
12316
12317 \end_inset
12318
12319 , which does not really correspond to a float, since it means: put it 
12320 \begin_inset Quotes eld
12321 \end_inset
12322
12323 here
12324 \begin_inset Quotes erd
12325 \end_inset
12326
12327  and nowhere else.
12328  Note however that the 
12329 \begin_inset Flex CharStyle:Code
12330 status collapsed
12331
12332 \begin_layout Plain Layout
12333 H
12334 \end_layout
12335
12336 \end_inset
12337
12338  specifier is special and, because of implementation details, cannot be
12339  used in non-builtin float types.
12340  If you do not understand what this means, just use 
12341 \begin_inset Quotes eld
12342 \end_inset
12343
12344
12345 \begin_inset Flex CharStyle:Code
12346 status collapsed
12347
12348 \begin_layout Plain Layout
12349 tbp
12350 \end_layout
12351
12352 \end_inset
12353
12354
12355 \begin_inset Quotes erd
12356 \end_inset
12357
12358 .
12359 \end_layout
12360
12361 \begin_layout Description
12362 \begin_inset Flex CharStyle:Code
12363 status collapsed
12364
12365 \begin_layout Plain Layout
12366 Style
12367 \end_layout
12368
12369 \end_inset
12370
12371  [
12372 \begin_inset Flex CharStyle:Code
12373 status collapsed
12374
12375 \begin_layout Plain Layout
12376 string
12377 \end_layout
12378
12379 \end_inset
12380
12381 =
12382 \begin_inset Quotes erd
12383 \end_inset
12384
12385
12386 \begin_inset Quotes erd
12387 \end_inset
12388
12389 ] The style used when defining the float using 
12390 \begin_inset Flex CharStyle:Code
12391 status collapsed
12392
12393 \begin_layout Plain Layout
12394
12395 \backslash
12396 newfloat
12397 \end_layout
12398
12399 \end_inset
12400
12401 .
12402 \end_layout
12403
12404 \begin_layout Description
12405 \begin_inset Flex CharStyle:Code
12406 status collapsed
12407
12408 \begin_layout Plain Layout
12409 Type
12410 \end_layout
12411
12412 \end_inset
12413
12414  [
12415 \begin_inset Flex CharStyle:Code
12416 status collapsed
12417
12418 \begin_layout Plain Layout
12419 string
12420 \end_layout
12421
12422 \end_inset
12423
12424 =
12425 \begin_inset Quotes erd
12426 \end_inset
12427
12428
12429 \begin_inset Quotes erd
12430 \end_inset
12431
12432 ] The 
12433 \begin_inset Quotes eld
12434 \end_inset
12435
12436 type
12437 \begin_inset Quotes erd
12438 \end_inset
12439
12440  of the new class of floats, like program or algorithm.
12441  After the appropriate 
12442 \begin_inset Flex CharStyle:Code
12443 status collapsed
12444
12445 \begin_layout Plain Layout
12446
12447 \backslash
12448 newfloat
12449 \end_layout
12450
12451 \end_inset
12452
12453 , commands such as 
12454 \begin_inset Flex CharStyle:Code
12455 status collapsed
12456
12457 \begin_layout Plain Layout
12458
12459 \backslash
12460 begin{program}
12461 \end_layout
12462
12463 \end_inset
12464
12465  or 
12466 \begin_inset Flex CharStyle:Code
12467 status collapsed
12468
12469 \begin_layout Plain Layout
12470
12471 \backslash
12472 end{algorithm*}
12473 \end_layout
12474
12475 \end_inset
12476
12477  will be available.
12478 \end_layout
12479
12480 \begin_layout Standard
12481 Note that defining a float with type 
12482 \begin_inset Flex CharStyle:Code
12483 status collapsed
12484
12485 \begin_layout Plain Layout
12486
12487 \emph on
12488 type
12489 \end_layout
12490
12491 \end_inset
12492
12493  automatically defines the corresponding counter with name 
12494 \begin_inset Flex CharStyle:Code
12495 status collapsed
12496
12497 \begin_layout Plain Layout
12498
12499 \emph on
12500 type
12501 \end_layout
12502
12503 \end_inset
12504
12505 .
12506 \end_layout
12507
12508 \begin_layout Subsection
12509 Inset layouts and Flex insets
12510 \end_layout
12511
12512 \begin_layout Standard
12513 \begin_inset CommandInset label
12514 LatexCommand label
12515 name "sec:charstyle"
12516
12517 \end_inset
12518
12519 LyX has supported character styles since version 1.4.0; since version 1.6.0
12520  these are called Flex insets.
12521  
12522 \end_layout
12523
12524 \begin_layout Standard
12525 Furthermore, it is possible to define the general layout of many different
12526  types of insets.
12527  Currently, InsetLayout can be used to customize the  layout parameters
12528  for footnotes, marginal notes, note insets, ERT insets, branches, listings,
12529  indexes, boxes, tables, algorithms, URLs, and optional arguments, as well
12530  as Flex insets.
12531  
12532 \end_layout
12533
12534 \begin_layout Standard
12535 Flex insets come in three different kinds: 
12536 \end_layout
12537
12538 \begin_layout Itemize
12539 character style (
12540 \begin_inset Flex CharStyle:Code
12541 status collapsed
12542
12543 \begin_layout Plain Layout
12544 CharStyle
12545 \end_layout
12546
12547 \end_inset
12548
12549 ): These define semantic markup corresponding to such LaTeX commands as
12550  
12551 \begin_inset Flex CharStyle:Code
12552 status collapsed
12553
12554 \begin_layout Plain Layout
12555
12556 \backslash
12557 noun
12558 \end_layout
12559
12560 \end_inset
12561
12562  and 
12563 \begin_inset Flex CharStyle:Code
12564 status collapsed
12565
12566 \begin_layout Plain Layout
12567
12568 \backslash
12569 code
12570 \end_layout
12571
12572 \end_inset
12573
12574 .
12575 \end_layout
12576
12577 \begin_layout Itemize
12578 user custom (
12579 \begin_inset Flex CharStyle:Code
12580 status collapsed
12581
12582 \begin_layout Plain Layout
12583 Custom
12584 \end_layout
12585
12586 \end_inset
12587
12588 ): These can be used to define custom collapsable insets, similar to ERT,
12589  footnote, and the like.
12590 \end_layout
12591
12592 \begin_layout Itemize
12593 XML elements (
12594 \begin_inset Flex CharStyle:Code
12595 status collapsed
12596
12597 \begin_layout Plain Layout
12598 Element
12599 \end_layout
12600
12601 \end_inset
12602
12603 ): For use with DocBook classes.
12604 \end_layout
12605
12606 \begin_layout Standard
12607 The 
12608 \begin_inset Flex CharStyle:Code
12609 status collapsed
12610
12611 \begin_layout Plain Layout
12612 InsetLayout
12613 \end_layout
12614
12615 \end_inset
12616
12617  definition starting line is of the form
12618 \end_layout
12619
12620 \begin_layout LyX-Code
12621 InsetLayout <Type> <Name>
12622 \end_layout
12623
12624 \begin_layout Standard
12625 where 
12626 \begin_inset Flex CharStyle:Code
12627 status collapsed
12628
12629 \begin_layout Plain Layout
12630 <Type>
12631 \end_layout
12632
12633 \end_inset
12634
12635  can be 
12636 \begin_inset Flex CharStyle:Code
12637 status collapsed
12638
12639 \begin_layout Plain Layout
12640 Algorithm
12641 \end_layout
12642
12643 \end_inset
12644
12645
12646 \begin_inset Flex CharStyle:Code
12647 status collapsed
12648
12649 \begin_layout Plain Layout
12650 Branch
12651 \end_layout
12652
12653 \end_inset
12654
12655
12656 \begin_inset Flex CharStyle:Code
12657 status collapsed
12658
12659 \begin_layout Plain Layout
12660 Box
12661 \end_layout
12662
12663 \end_inset
12664
12665
12666 \begin_inset Flex CharStyle:Code
12667 status collapsed
12668
12669 \begin_layout Plain Layout
12670 ERT
12671 \end_layout
12672
12673 \end_inset
12674
12675
12676 \begin_inset Flex CharStyle:Code
12677 status collapsed
12678
12679 \begin_layout Plain Layout
12680 Figure
12681 \end_layout
12682
12683 \end_inset
12684
12685
12686 \begin_inset Flex CharStyle:Code
12687 status collapsed
12688
12689 \begin_layout Plain Layout
12690 Foot
12691 \end_layout
12692
12693 \end_inset
12694
12695
12696 \begin_inset Flex CharStyle:Code
12697 status collapsed
12698
12699 \begin_layout Plain Layout
12700 Index
12701 \end_layout
12702
12703 \end_inset
12704
12705
12706 \begin_inset Flex CharStyle:Code
12707 status collapsed
12708
12709 \begin_layout Plain Layout
12710 Listings
12711 \end_layout
12712
12713 \end_inset
12714
12715
12716 \begin_inset Flex CharStyle:Code
12717 status collapsed
12718
12719 \begin_layout Plain Layout
12720 Marginal
12721 \end_layout
12722
12723 \end_inset
12724
12725
12726 \begin_inset Flex CharStyle:Code
12727 status collapsed
12728
12729 \begin_layout Plain Layout
12730 Note:Comment
12731 \end_layout
12732
12733 \end_inset
12734
12735
12736 \begin_inset Flex CharStyle:Code
12737 status collapsed
12738
12739 \begin_layout Plain Layout
12740 Note:Note
12741 \end_layout
12742
12743 \end_inset
12744
12745
12746 \begin_inset Flex CharStyle:Code
12747 status collapsed
12748
12749 \begin_layout Plain Layout
12750 Note:GreyedOut
12751 \end_layout
12752
12753 \end_inset
12754
12755
12756 \begin_inset Flex CharStyle:Code
12757 status collapsed
12758
12759 \begin_layout Plain Layout
12760 OptArg
12761 \end_layout
12762
12763 \end_inset
12764
12765
12766 \begin_inset Flex CharStyle:Code
12767 status collapsed
12768
12769 \begin_layout Plain Layout
12770 Table
12771 \end_layout
12772
12773 \end_inset
12774
12775
12776 \begin_inset Flex CharStyle:Code
12777 status collapsed
12778
12779 \begin_layout Plain Layout
12780 URL
12781 \end_layout
12782
12783 \end_inset
12784
12785 , or 
12786 \begin_inset Flex CharStyle:Code
12787 status collapsed
12788
12789 \begin_layout Plain Layout
12790 Flex
12791 \end_layout
12792
12793 \end_inset
12794
12795 .
12796  If 
12797 \begin_inset Flex CharStyle:Code
12798 status collapsed
12799
12800 \begin_layout Plain Layout
12801 <Type>
12802 \end_layout
12803
12804 \end_inset
12805
12806  is 
12807 \begin_inset Flex CharStyle:Code
12808 status collapsed
12809
12810 \begin_layout Plain Layout
12811 Flex
12812 \end_layout
12813
12814 \end_inset
12815
12816 , then 
12817 \begin_inset Flex CharStyle:Code
12818 status collapsed
12819
12820 \begin_layout Plain Layout
12821 <Name>
12822 \end_layout
12823
12824 \end_inset
12825
12826  should have the form 
12827 \begin_inset Flex CharStyle:Code
12828 status collapsed
12829
12830 \begin_layout Plain Layout
12831 SubType:StyleName
12832 \end_layout
12833
12834 \end_inset
12835
12836 , where 
12837 \begin_inset Flex CharStyle:Code
12838 status collapsed
12839
12840 \begin_layout Plain Layout
12841 SubType
12842 \end_layout
12843
12844 \end_inset
12845
12846  is either 
12847 \begin_inset Flex CharStyle:Code
12848 status collapsed
12849
12850 \begin_layout Plain Layout
12851 CharStyle
12852 \end_layout
12853
12854 \end_inset
12855
12856
12857 \begin_inset Flex CharStyle:Code
12858 status collapsed
12859
12860 \begin_layout Plain Layout
12861 Custom
12862 \end_layout
12863
12864 \end_inset
12865
12866 , or 
12867 \begin_inset Flex CharStyle:Code
12868 status collapsed
12869
12870 \begin_layout Plain Layout
12871 Element
12872 \end_layout
12873
12874 \end_inset
12875
12876 , and 
12877 \begin_inset Flex CharStyle:Code
12878 status collapsed
12879
12880 \begin_layout Plain Layout
12881 StyleName
12882 \end_layout
12883
12884 \end_inset
12885
12886  is any valid identifier.
12887  
12888 \end_layout
12889
12890 \begin_layout Standard
12891 The following 
12892 \begin_inset Flex CharStyle:Code
12893 status collapsed
12894
12895 \begin_layout Plain Layout
12896 InsetLayout
12897 \end_layout
12898
12899 \end_inset
12900
12901  section can contain the following entries:
12902 \end_layout
12903
12904 \begin_layout Description
12905 \begin_inset Flex CharStyle:Code
12906 status collapsed
12907
12908 \begin_layout Plain Layout
12909 BgColor
12910 \end_layout
12911
12912 \end_inset
12913
12914  The color for the inset's background.
12915  These valid colors are defined in 
12916 \begin_inset Flex CharStyle:Code
12917 status collapsed
12918
12919 \begin_layout Plain Layout
12920 src/ColorCode.h
12921 \end_layout
12922
12923 \end_inset
12924
12925 .
12926 \end_layout
12927
12928 \begin_layout Description
12929 \begin_inset Flex CharStyle:Code
12930 status collapsed
12931
12932 \begin_layout Plain Layout
12933 CopyStyle
12934 \end_layout
12935
12936 \end_inset
12937
12938  As with paragraph styles (see page 
12939 \begin_inset CommandInset ref
12940 LatexCommand ref
12941 reference "des:CopyStyle"
12942
12943 \end_inset
12944
12945 ).
12946 \end_layout
12947
12948 \begin_layout Description
12949 \begin_inset Flex CharStyle:Code
12950 status collapsed
12951
12952 \begin_layout Plain Layout
12953 Decoration
12954 \end_layout
12955
12956 \end_inset
12957
12958  can be 
12959 \begin_inset Flex CharStyle:Code
12960 status collapsed
12961
12962 \begin_layout Plain Layout
12963 Classic
12964 \end_layout
12965
12966 \end_inset
12967
12968
12969 \begin_inset Flex CharStyle:Code
12970 status collapsed
12971
12972 \begin_layout Plain Layout
12973 Minimalistic
12974 \end_layout
12975
12976 \end_inset
12977
12978 , or 
12979 \begin_inset Flex CharStyle:Code
12980 status collapsed
12981
12982 \begin_layout Plain Layout
12983 Conglomerate
12984 \end_layout
12985
12986 \end_inset
12987
12988 , describing the rendering style used for the inset's frame and buttons.
12989  Footnotes generally use 
12990 \begin_inset Flex CharStyle:Code
12991 status collapsed
12992
12993 \begin_layout Plain Layout
12994 Classic
12995 \end_layout
12996
12997 \end_inset
12998
12999 ; ERT insets generally use 
13000 \begin_inset Flex CharStyle:Code
13001 status collapsed
13002
13003 \begin_layout Plain Layout
13004 Minimalistic
13005 \end_layout
13006
13007 \end_inset
13008
13009 ; and character styles use 
13010 \begin_inset Flex CharStyle:Code
13011 status collapsed
13012
13013 \begin_layout Plain Layout
13014 Conglomerate
13015 \end_layout
13016
13017 \end_inset
13018
13019 .
13020 \end_layout
13021
13022 \begin_layout Description
13023 \begin_inset Flex CharStyle:Code
13024 status collapsed
13025
13026 \begin_layout Plain Layout
13027 Font
13028 \end_layout
13029
13030 \end_inset
13031
13032  The font used for both the text body 
13033 \emph on
13034 and
13035 \emph default
13036  the label.
13037  See section
13038 \begin_inset space ~
13039 \end_inset
13040
13041
13042 \begin_inset CommandInset ref
13043 LatexCommand ref
13044 reference "sec:fonts"
13045
13046 \end_inset
13047
13048 .
13049  Note that defining this font automatically defines the 
13050 \begin_inset Flex CharStyle:Code
13051 status collapsed
13052
13053 \begin_layout Plain Layout
13054 LabelFont
13055 \end_layout
13056
13057 \end_inset
13058
13059  to the same value, so define this first and define 
13060 \begin_inset Flex CharStyle:Code
13061 status collapsed
13062
13063 \begin_layout Plain Layout
13064 LabelFont
13065 \end_layout
13066
13067 \end_inset
13068
13069  later if you want them to be different.
13070 \end_layout
13071
13072 \begin_layout Description
13073 \begin_inset Flex CharStyle:Code
13074 status collapsed
13075
13076 \begin_layout Plain Layout
13077 ForceLTR
13078 \end_layout
13079
13080 \end_inset
13081
13082  [[FIXME]]
13083 \end_layout
13084
13085 \begin_layout Description
13086 \begin_inset Flex CharStyle:Code
13087 status collapsed
13088
13089 \begin_layout Plain Layout
13090 FreeSpacing
13091 \end_layout
13092
13093 \end_inset
13094
13095  As with paragraph styles (see page 
13096 \begin_inset CommandInset ref
13097 LatexCommand pageref
13098 reference "des:FreeSpacing"
13099
13100 \end_inset
13101
13102 ).
13103 \end_layout
13104
13105 \begin_layout Description
13106 \begin_inset Flex CharStyle:Code
13107 status collapsed
13108
13109 \begin_layout Plain Layout
13110 KeepEmpty
13111 \end_layout
13112
13113 \end_inset
13114
13115  As with paragraph styles (see page 
13116 \begin_inset CommandInset ref
13117 LatexCommand pageref
13118 reference "des:KeepEmpty"
13119
13120 \end_inset
13121
13122 ).
13123 \end_layout
13124
13125 \begin_layout Description
13126 \begin_inset Flex CharStyle:Code
13127 status collapsed
13128
13129 \begin_layout Plain Layout
13130 LabelString
13131 \end_layout
13132
13133 \end_inset
13134
13135  What will be displayed on the button or elsewhere as the inset label.
13136  Some inset types (ERT and Branch) modify this label on the fly.
13137 \end_layout
13138
13139 \begin_layout Description
13140 \begin_inset Flex CharStyle:Code
13141 status collapsed
13142
13143 \begin_layout Plain Layout
13144 LabelFont
13145 \end_layout
13146
13147 \end_inset
13148
13149  The font used for the label.
13150  See section
13151 \begin_inset space ~
13152 \end_inset
13153
13154
13155 \begin_inset CommandInset ref
13156 LatexCommand ref
13157 reference "sec:fonts"
13158
13159 \end_inset
13160
13161 .
13162  Note that this definition can never appear before 
13163 \begin_inset Flex CharStyle:Code
13164 status collapsed
13165
13166 \begin_layout Plain Layout
13167 Font
13168 \end_layout
13169
13170 \end_inset
13171
13172 , lest it be ineffective.
13173 \end_layout
13174
13175 \begin_layout Description
13176 \begin_inset Flex CharStyle:Code
13177 status collapsed
13178
13179 \begin_layout Plain Layout
13180 LatexName
13181 \end_layout
13182
13183 \end_inset
13184
13185  The name of the corresponding LaTeX stuff.
13186  Either the environment or command name.
13187 \end_layout
13188
13189 \begin_layout Description
13190 \begin_inset Flex CharStyle:Code
13191 status collapsed
13192
13193 \begin_layout Plain Layout
13194 LatexParam
13195 \end_layout
13196
13197 \end_inset
13198
13199  The optional parameter for the corresponding 
13200 \begin_inset Flex CharStyle:Code
13201 status collapsed
13202
13203 \begin_layout Plain Layout
13204 LatexName
13205 \end_layout
13206
13207 \end_inset
13208
13209  stuff, including possible bracket pairs like 
13210 \begin_inset Flex CharStyle:Code
13211 status collapsed
13212
13213 \begin_layout Plain Layout
13214 []
13215 \end_layout
13216
13217 \end_inset
13218
13219 .
13220  This parameter cannot be changed from within LyX.
13221 \end_layout
13222
13223 \begin_layout Description
13224 \begin_inset Flex CharStyle:Code
13225 status collapsed
13226
13227 \begin_layout Plain Layout
13228 LatexType
13229 \end_layout
13230
13231 \end_inset
13232
13233  As with paragraph styles (see page 
13234 \begin_inset CommandInset ref
13235 LatexCommand pageref
13236 reference "des:LatexType"
13237
13238 \end_inset
13239
13240 ).
13241 \end_layout
13242
13243 \begin_layout Description
13244 \begin_inset Flex CharStyle:Code
13245 status collapsed
13246
13247 \begin_layout Plain Layout
13248 LyxType 
13249 \end_layout
13250
13251 \end_inset
13252
13253  Can be 
13254 \begin_inset Flex CharStyle:Code
13255 status collapsed
13256
13257 \begin_layout Plain Layout
13258 charstyle
13259 \end_layout
13260
13261 \end_inset
13262
13263
13264 \begin_inset Flex CharStyle:Code
13265 status collapsed
13266
13267 \begin_layout Plain Layout
13268 custom
13269 \end_layout
13270
13271 \end_inset
13272
13273
13274 \begin_inset Flex CharStyle:Code
13275 status collapsed
13276
13277 \begin_layout Plain Layout
13278 element
13279 \end_layout
13280
13281 \end_inset
13282
13283
13284 \begin_inset Flex CharStyle:Code
13285 status collapsed
13286
13287 \begin_layout Plain Layout
13288 end
13289 \end_layout
13290
13291 \end_inset
13292
13293  (indicating a dummy definition ending definitions of charstyles etc.).
13294  This entry is only meaningful for Flex (user definable) insets.
13295 \end_layout
13296
13297 \begin_layout Description
13298 \begin_inset Flex CharStyle:Code
13299 status collapsed
13300
13301 \begin_layout Plain Layout
13302 Preamble
13303 \end_layout
13304
13305 \end_inset
13306
13307  As with paragraph styles (see page 
13308 \begin_inset CommandInset ref
13309 LatexCommand pageref
13310 reference "des:Preamble"
13311
13312 \end_inset
13313
13314 ).
13315 \end_layout
13316
13317 \begin_layout Description
13318 \begin_inset Flex CharStyle:Code
13319 status collapsed
13320
13321 \begin_layout Plain Layout
13322 Requires 
13323 \end_layout
13324
13325 \end_inset
13326
13327  [
13328 \begin_inset Flex CharStyle:Code
13329 status collapsed
13330
13331 \begin_layout Plain Layout
13332 string
13333 \end_layout
13334
13335 \end_inset
13336
13337 ] As with paragraph styles (see page 
13338 \begin_inset CommandInset ref
13339 LatexCommand pageref
13340 reference "des:Requires"
13341
13342 \end_inset
13343
13344 ).
13345 \end_layout
13346
13347 \begin_layout Subsection
13348 Counters
13349 \end_layout
13350
13351 \begin_layout Standard
13352 \begin_inset CommandInset label
13353 LatexCommand label
13354 name "sec:counter"
13355
13356 \end_inset
13357
13358 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13359  counters (
13360 \begin_inset Flex CharStyle:MenuItem
13361 status collapsed
13362
13363 \begin_layout Plain Layout
13364 chapter
13365 \end_layout
13366
13367 \end_inset
13368
13369
13370 \begin_inset Flex CharStyle:MenuItem
13371 status collapsed
13372
13373 \begin_layout Plain Layout
13374 figure
13375 \end_layout
13376
13377 \end_inset
13378
13379 , \SpecialChar \ldots{}
13380 ) in the text class itself.
13381  The standard counters are defined in the file 
13382 \begin_inset Flex CharStyle:Code
13383 status collapsed
13384
13385 \begin_layout Plain Layout
13386 stdcounters.inc
13387 \end_layout
13388
13389 \end_inset
13390
13391 , so you may have to do no more than add
13392 \end_layout
13393
13394 \begin_layout LyX-Code
13395 Input stdcounters.inc
13396 \end_layout
13397
13398 \begin_layout Standard
13399 to your layout file to get them to work.
13400  But if you want to define custom counters, then you can do so, using the
13401  following parameters:
13402 \end_layout
13403
13404 \begin_layout Description
13405 \begin_inset Flex CharStyle:Code
13406 status collapsed
13407
13408 \begin_layout Plain Layout
13409 LabelString [string=""]
13410 \end_layout
13411
13412 \end_inset
13413
13414  when this is defined, this string defines how the counter is displayed.
13415  Setting this value sets 
13416 \begin_inset Flex CharStyle:Code
13417 status collapsed
13418
13419 \begin_layout Plain Layout
13420 LabelStringAppendix
13421 \end_layout
13422
13423 \end_inset
13424
13425  to the same value.
13426  The following special constructs can be used in the string:
13427 \end_layout
13428
13429 \begin_deeper
13430 \begin_layout Itemize
13431 \begin_inset Flex CharStyle:Code
13432 status collapsed
13433
13434 \begin_layout Plain Layout
13435
13436 \backslash
13437 thecounter
13438 \end_layout
13439
13440 \end_inset
13441
13442  will be replaced by the expansion of the 
13443 \begin_inset Flex CharStyle:Code
13444 status collapsed
13445
13446 \begin_layout Plain Layout
13447 LabelString
13448 \end_layout
13449
13450 \end_inset
13451
13452  (or 
13453 \begin_inset Flex CharStyle:Code
13454 status collapsed
13455
13456 \begin_layout Plain Layout
13457 LabelStringAppendix
13458 \end_layout
13459
13460 \end_inset
13461
13462 ) of the counter 
13463 \begin_inset Flex CharStyle:Code
13464 status collapsed
13465
13466 \begin_layout Plain Layout
13467 counter
13468 \end_layout
13469
13470 \end_inset
13471
13472 .
13473  
13474 \end_layout
13475
13476 \begin_layout Itemize
13477 counter values can be expressed using LaTeX-like macros 
13478 \begin_inset Flex CharStyle:Code
13479 status collapsed
13480
13481 \begin_layout Plain Layout
13482
13483 \backslash
13484
13485 \emph on
13486 numbertype
13487 \emph default
13488 {
13489 \emph on
13490 counter
13491 \emph default
13492 }
13493 \end_layout
13494
13495 \end_inset
13496
13497 , where 
13498 \begin_inset Flex CharStyle:Code
13499 status collapsed
13500
13501 \begin_layout Plain Layout
13502
13503 \emph on
13504 numbertype
13505 \end_layout
13506
13507 \end_inset
13508
13509  can be:
13510 \begin_inset Foot
13511 status collapsed
13512
13513 \begin_layout Plain Layout
13514
13515 \family roman
13516 \series medium
13517 \shape up
13518 \size normal
13519 \emph off
13520 \bar no
13521 \noun off
13522 \color none
13523 Actually, the situation is a bit more complicated: any
13524 \family default
13525 \series default
13526 \shape default
13527 \emph default
13528 \bar default
13529  
13530 \size default
13531 \emph on
13532 \noun default
13533 \color inherit
13534 numbertype
13535 \family roman
13536 \series medium
13537 \shape up
13538 \size normal
13539 \emph off
13540 \bar no
13541 \noun off
13542  other than those descibed below will produce arabic numerals.
13543  It would not be surprising to see this change in the future.
13544 \end_layout
13545
13546 \end_inset
13547
13548  
13549 \begin_inset Flex CharStyle:Code
13550 status collapsed
13551
13552 \begin_layout Plain Layout
13553 arabic
13554 \end_layout
13555
13556 \end_inset
13557
13558 : 1, 2, 3,\SpecialChar \ldots{}
13559
13560 \begin_inset Flex CharStyle:Code
13561 status collapsed
13562
13563 \begin_layout Plain Layout
13564 alph
13565 \end_layout
13566
13567 \end_inset
13568
13569  for lower-case letters: a, b, c, \SpecialChar \ldots{}
13570
13571 \begin_inset Flex CharStyle:Code
13572 status collapsed
13573
13574 \begin_layout Plain Layout
13575 Alph
13576 \end_layout
13577
13578 \end_inset
13579
13580  for upper-case letters: A, B, C, \SpecialChar \ldots{}
13581
13582 \begin_inset Flex CharStyle:Code
13583 status collapsed
13584
13585 \begin_layout Plain Layout
13586 roman
13587 \end_layout
13588
13589 \end_inset
13590
13591  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13592
13593 \begin_inset Flex CharStyle:Code
13594 status collapsed
13595
13596 \begin_layout Plain Layout
13597 Roman
13598 \end_layout
13599
13600 \end_inset
13601
13602  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13603
13604 \begin_inset Flex CharStyle:Code
13605 status collapsed
13606
13607 \begin_layout Plain Layout
13608 hebrew
13609 \end_layout
13610
13611 \end_inset
13612
13613  for hebrew numerals.
13614 \end_layout
13615
13616 \end_deeper
13617 \begin_layout Standard
13618 If LabelString is not defined, a default value is constructed as follows:
13619  if the counter has a master counter 
13620 \begin_inset Flex CharStyle:Code
13621 status collapsed
13622
13623 \begin_layout Plain Layout
13624 master
13625 \end_layout
13626
13627 \end_inset
13628
13629  (defined via 
13630 \begin_inset Flex CharStyle:Code
13631 status collapsed
13632
13633 \begin_layout Plain Layout
13634 Within
13635 \end_layout
13636
13637 \end_inset
13638
13639 ), the string 
13640 \begin_inset Flex CharStyle:Code
13641 status collapsed
13642
13643 \begin_layout Plain Layout
13644
13645 \backslash
13646 themaster.
13647 \backslash
13648 arabic{counter}
13649 \end_layout
13650
13651 \end_inset
13652
13653  is used; otherwise the string 
13654 \begin_inset Flex CharStyle:Code
13655 status collapsed
13656
13657 \begin_layout Plain Layout
13658
13659 \backslash
13660 arabic{counter}
13661 \end_layout
13662
13663 \end_inset
13664
13665  is used.
13666 \end_layout
13667
13668 \begin_layout Description
13669 \begin_inset Flex CharStyle:Code
13670 status collapsed
13671
13672 \begin_layout Plain Layout
13673 LabelStringAppendix [string=""]
13674 \end_layout
13675
13676 \end_inset
13677
13678  Same as 
13679 \begin_inset Flex CharStyle:Code
13680 status collapsed
13681
13682 \begin_layout Plain Layout
13683 LabelString
13684 \end_layout
13685
13686 \end_inset
13687
13688 .
13689 \end_layout
13690
13691 \begin_layout Description
13692 \begin_inset Flex CharStyle:Code
13693 status collapsed
13694
13695 \begin_layout Plain Layout
13696 Name
13697 \end_layout
13698
13699 \end_inset
13700
13701  [
13702 \begin_inset Flex CharStyle:Code
13703 status collapsed
13704
13705 \begin_layout Plain Layout
13706 string
13707 \end_layout
13708
13709 \end_inset
13710
13711 =
13712 \begin_inset Quotes erd
13713 \end_inset
13714
13715
13716 \begin_inset Quotes erd
13717 \end_inset
13718
13719 ] The name of the counter.
13720 \end_layout
13721
13722 \begin_layout Description
13723 \begin_inset Flex CharStyle:Code
13724 status collapsed
13725
13726 \begin_layout Plain Layout
13727 Within
13728 \end_layout
13729
13730 \end_inset
13731
13732  [
13733 \begin_inset Flex CharStyle:Code
13734 status collapsed
13735
13736 \begin_layout Plain Layout
13737 string
13738 \end_layout
13739
13740 \end_inset
13741
13742 =
13743 \begin_inset Quotes erd
13744 \end_inset
13745
13746
13747 \begin_inset Quotes erd
13748 \end_inset
13749
13750 ] If this is set to the name of another counter, the present counter will
13751  be reset everytime the other one is increased.
13752  For example, 
13753 \begin_inset Flex CharStyle:Code
13754 status collapsed
13755
13756 \begin_layout Plain Layout
13757 subsection
13758 \end_layout
13759
13760 \end_inset
13761
13762  is numbered inside 
13763 \begin_inset Flex CharStyle:Code
13764 status collapsed
13765
13766 \begin_layout Plain Layout
13767 section
13768 \end_layout
13769
13770 \end_inset
13771
13772 .
13773 \end_layout
13774
13775 \begin_layout Subsection
13776 Font description
13777 \end_layout
13778
13779 \begin_layout Standard
13780 \begin_inset CommandInset label
13781 LatexCommand label
13782 name "sec:fonts"
13783
13784 \end_inset
13785
13786 A font description looks like this:
13787 \end_layout
13788
13789 \begin_layout LyX-Code
13790 Font 
13791 \family roman
13792 \emph on
13793 or
13794 \family default
13795 \emph default
13796  LabelFont
13797 \end_layout
13798
13799 \begin_layout LyX-Code
13800  ...
13801 \end_layout
13802
13803 \begin_layout LyX-Code
13804 EndFont
13805 \end_layout
13806
13807 \begin_layout Standard
13808 The following commands are available:
13809 \end_layout
13810
13811 \begin_layout Description
13812 \begin_inset Flex CharStyle:Code
13813 status collapsed
13814
13815 \begin_layout Plain Layout
13816 Color
13817 \end_layout
13818
13819 \end_inset
13820
13821  [
13822 \begin_inset Flex CharStyle:Code
13823 status collapsed
13824
13825 \begin_layout Plain Layout
13826
13827 \emph on
13828 none
13829 \end_layout
13830
13831 \end_inset
13832
13833
13834 \begin_inset Flex CharStyle:Code
13835 status collapsed
13836
13837 \begin_layout Plain Layout
13838 black
13839 \end_layout
13840
13841 \end_inset
13842
13843
13844 \begin_inset Flex CharStyle:Code
13845 status collapsed
13846
13847 \begin_layout Plain Layout
13848 white
13849 \end_layout
13850
13851 \end_inset
13852
13853
13854 \begin_inset Flex CharStyle:Code
13855 status collapsed
13856
13857 \begin_layout Plain Layout
13858 red
13859 \end_layout
13860
13861 \end_inset
13862
13863
13864 \begin_inset Flex CharStyle:Code
13865 status collapsed
13866
13867 \begin_layout Plain Layout
13868 green
13869 \end_layout
13870
13871 \end_inset
13872
13873
13874 \begin_inset Flex CharStyle:Code
13875 status collapsed
13876
13877 \begin_layout Plain Layout
13878 blue
13879 \end_layout
13880
13881 \end_inset
13882
13883
13884 \begin_inset Flex CharStyle:Code
13885 status collapsed
13886
13887 \begin_layout Plain Layout
13888 cyan
13889 \end_layout
13890
13891 \end_inset
13892
13893
13894 \begin_inset Flex CharStyle:Code
13895 status collapsed
13896
13897 \begin_layout Plain Layout
13898 magenta
13899 \end_layout
13900
13901 \end_inset
13902
13903
13904 \begin_inset Flex CharStyle:Code
13905 status collapsed
13906
13907 \begin_layout Plain Layout
13908 yellow
13909 \end_layout
13910
13911 \end_inset
13912
13913 ]
13914 \end_layout
13915
13916 \begin_layout Description
13917 \begin_inset Flex CharStyle:Code
13918 status collapsed
13919
13920 \begin_layout Plain Layout
13921 Family
13922 \end_layout
13923
13924 \end_inset
13925
13926  [
13927 \emph on
13928
13929 \begin_inset Flex CharStyle:Code
13930 status collapsed
13931
13932 \begin_layout Plain Layout
13933
13934 \emph on
13935 Roman
13936 \end_layout
13937
13938 \end_inset
13939
13940
13941 \emph default
13942
13943 \begin_inset Flex CharStyle:Code
13944 status collapsed
13945
13946 \begin_layout Plain Layout
13947 Sans
13948 \end_layout
13949
13950 \end_inset
13951
13952
13953 \begin_inset Flex CharStyle:Code
13954 status collapsed
13955
13956 \begin_layout Plain Layout
13957 Typewriter
13958 \end_layout
13959
13960 \end_inset
13961
13962
13963 \end_layout
13964
13965 \begin_layout Description
13966 \begin_inset Flex CharStyle:Code
13967 status collapsed
13968
13969 \begin_layout Plain Layout
13970 Misc
13971 \end_layout
13972
13973 \end_inset
13974
13975  [
13976 \begin_inset Flex CharStyle:Code
13977 status collapsed
13978
13979 \begin_layout Plain Layout
13980 string
13981 \end_layout
13982
13983 \end_inset
13984
13985 ] Valid argument sare: 
13986 \begin_inset Flex CharStyle:Code
13987 status collapsed
13988
13989 \begin_layout Plain Layout
13990 emph
13991 \end_layout
13992
13993 \end_inset
13994
13995
13996 \begin_inset Flex CharStyle:Code
13997 status collapsed
13998
13999 \begin_layout Plain Layout
14000 noun
14001 \end_layout
14002
14003 \end_inset
14004
14005
14006 \begin_inset Flex CharStyle:Code
14007 status collapsed
14008
14009 \begin_layout Plain Layout
14010 underbar
14011 \end_layout
14012
14013 \end_inset
14014
14015
14016 \begin_inset Flex CharStyle:Code
14017 status collapsed
14018
14019 \begin_layout Plain Layout
14020 no_emph
14021 \end_layout
14022
14023 \end_inset
14024
14025
14026 \begin_inset Flex CharStyle:Code
14027 status collapsed
14028
14029 \begin_layout Plain Layout
14030 no_noun
14031 \end_layout
14032
14033 \end_inset
14034
14035  and 
14036 \begin_inset Flex CharStyle:Code
14037 status collapsed
14038
14039 \begin_layout Plain Layout
14040 no_bar
14041 \end_layout
14042
14043 \end_inset
14044
14045 .
14046  Each of these turns on or off the corresponding attribute.
14047 \end_layout
14048
14049 \begin_layout Description
14050 \begin_inset Flex CharStyle:Code
14051 status collapsed
14052
14053 \begin_layout Plain Layout
14054 Series
14055 \end_layout
14056
14057 \end_inset
14058
14059  [
14060 \emph on
14061
14062 \begin_inset Flex CharStyle:Code
14063 status collapsed
14064
14065 \begin_layout Plain Layout
14066
14067 \emph on
14068 Medium
14069 \end_layout
14070
14071 \end_inset
14072
14073
14074 \emph default
14075
14076 \begin_inset Flex CharStyle:Code
14077 status collapsed
14078
14079 \begin_layout Plain Layout
14080 Bold
14081 \end_layout
14082
14083 \end_inset
14084
14085
14086 \end_layout
14087
14088 \begin_layout Description
14089 \begin_inset Flex CharStyle:Code
14090 status collapsed
14091
14092 \begin_layout Plain Layout
14093 Shape
14094 \end_layout
14095
14096 \end_inset
14097
14098  [
14099 \emph on
14100
14101 \begin_inset Flex CharStyle:Code
14102 status collapsed
14103
14104 \begin_layout Plain Layout
14105
14106 \emph on
14107 Up
14108 \end_layout
14109
14110 \end_inset
14111
14112
14113 \emph default
14114
14115 \begin_inset Flex CharStyle:Code
14116 status collapsed
14117
14118 \begin_layout Plain Layout
14119 Italic
14120 \end_layout
14121
14122 \end_inset
14123
14124
14125 \begin_inset Flex CharStyle:Code
14126 status collapsed
14127
14128 \begin_layout Plain Layout
14129 SmallCaps
14130 \end_layout
14131
14132 \end_inset
14133
14134
14135 \begin_inset Flex CharStyle:Code
14136 status collapsed
14137
14138 \begin_layout Plain Layout
14139 Slanted
14140 \end_layout
14141
14142 \end_inset
14143
14144
14145 \end_layout
14146
14147 \begin_layout Description
14148 \begin_inset Flex CharStyle:Code
14149 status collapsed
14150
14151 \begin_layout Plain Layout
14152 Size
14153 \end_layout
14154
14155 \end_inset
14156
14157  [
14158 \begin_inset Flex CharStyle:Code
14159 status collapsed
14160
14161 \begin_layout Plain Layout
14162 tiny
14163 \end_layout
14164
14165 \end_inset
14166
14167
14168 \begin_inset Flex CharStyle:Code
14169 status collapsed
14170
14171 \begin_layout Plain Layout
14172 small
14173 \end_layout
14174
14175 \end_inset
14176
14177
14178 \begin_inset Flex CharStyle:Code
14179 status collapsed
14180
14181 \begin_layout Plain Layout
14182
14183 \emph on
14184 normal
14185 \end_layout
14186
14187 \end_inset
14188
14189
14190 \begin_inset Flex CharStyle:Code
14191 status collapsed
14192
14193 \begin_layout Plain Layout
14194 large
14195 \end_layout
14196
14197 \end_inset
14198
14199
14200 \begin_inset Flex CharStyle:Code
14201 status collapsed
14202
14203 \begin_layout Plain Layout
14204 larger
14205 \end_layout
14206
14207 \end_inset
14208
14209
14210 \begin_inset Flex CharStyle:Code
14211 status collapsed
14212
14213 \begin_layout Plain Layout
14214 largest
14215 \end_layout
14216
14217 \end_inset
14218
14219
14220 \begin_inset Flex CharStyle:Code
14221 status collapsed
14222
14223 \begin_layout Plain Layout
14224 huge
14225 \end_layout
14226
14227 \end_inset
14228
14229
14230 \begin_inset Flex CharStyle:Code
14231 status collapsed
14232
14233 \begin_layout Plain Layout
14234 giant
14235 \end_layout
14236
14237 \end_inset
14238
14239 ]
14240 \end_layout
14241
14242 \begin_layout Subsection
14243 Upgrading old layout files
14244 \end_layout
14245
14246 \begin_layout Standard
14247 The file format of layout files changes from time to time, so old layout
14248  files need to be converted.
14249  This process has been automated since LyX 1.4.0: If LyX reads an old format
14250  layout file it will call the conversion tool 
14251 \begin_inset Flex CharStyle:Code
14252 status collapsed
14253
14254 \begin_layout Plain Layout
14255 LyXDir/scripts/layout2layout.py
14256 \end_layout
14257
14258 \end_inset
14259
14260  and convert it to a temporary file in current format.
14261  The original file is left untouched.
14262  If you want to convert the layout file permanently, just call the converter
14263  by hand:
14264 \end_layout
14265
14266 \begin_layout LyX-Code
14267 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14268 \end_layout
14269
14270 \begin_layout Standard
14271 (You need to replace 
14272 \begin_inset Flex CharStyle:Code
14273 status collapsed
14274
14275 \begin_layout Plain Layout
14276 $LyXDir
14277 \end_layout
14278
14279 \end_inset
14280
14281  with the name of your LyX system directory, unless you happen to have defined
14282  such an environment variable.) Then copy 
14283 \begin_inset Flex CharStyle:Code
14284 status collapsed
14285
14286 \begin_layout Plain Layout
14287 myclassnew.layout
14288 \end_layout
14289
14290 \end_inset
14291
14292  to 
14293 \begin_inset Flex CharStyle:Code
14294 status collapsed
14295
14296 \begin_layout Plain Layout
14297 UserDir/layouts/
14298 \end_layout
14299
14300 \end_inset
14301
14302 .
14303 \end_layout
14304
14305 \begin_layout Standard
14306 The automatic conversion only handles syntax changes.
14307  It cannot handle the case where the contents of included files was changed,
14308  so these will have to be converted separately.
14309 \end_layout
14310
14311 \begin_layout Section
14312 Creating Templates
14313 \begin_inset CommandInset label
14314 LatexCommand label
14315 name "sec:templates"
14316
14317 \end_inset
14318
14319
14320 \end_layout
14321
14322 \begin_layout Standard
14323 Templates are created just like usual documents.
14324  The only difference is that usual documents contain all possible settings,
14325  including the font scheme and the paper size.
14326  Usually a user doesn't want a template to overwrite his defaults in these
14327  cases.
14328  For that reason, the designer of a template should remove the corresponding
14329  commands like 
14330 \begin_inset Flex CharStyle:Code
14331 status collapsed
14332
14333 \begin_layout Plain Layout
14334
14335 \backslash
14336 fontscheme
14337 \end_layout
14338
14339 \end_inset
14340
14341  or 
14342 \begin_inset Flex CharStyle:Code
14343 status collapsed
14344
14345 \begin_layout Plain Layout
14346
14347 \backslash
14348 papersize
14349 \end_layout
14350
14351 \end_inset
14352
14353  from the template LyX file.
14354  This can be done with any simple text-editor, for example 
14355 \begin_inset Flex CharStyle:Code
14356 status collapsed
14357
14358 \begin_layout Plain Layout
14359 vi
14360 \end_layout
14361
14362 \end_inset
14363
14364  or 
14365 \begin_inset Flex CharStyle:Code
14366 status collapsed
14367
14368 \begin_layout Plain Layout
14369 xedit
14370 \end_layout
14371
14372 \end_inset
14373
14374 .
14375  
14376 \end_layout
14377
14378 \begin_layout Standard
14379 Put the edited template files you create in 
14380 \begin_inset Flex CharStyle:Code
14381 status collapsed
14382
14383 \begin_layout Plain Layout
14384 UserDir/templates/
14385 \end_layout
14386
14387 \end_inset
14388
14389 , copy the ones you use from the global template directory in 
14390 \begin_inset Flex CharStyle:Code
14391 status collapsed
14392
14393 \begin_layout Plain Layout
14394 LyXDir/templates/
14395 \end_layout
14396
14397 \end_inset
14398
14399  to the same place, and redefine the template path in the 
14400 \begin_inset Flex CharStyle:MenuItem
14401 status collapsed
14402
14403 \begin_layout Plain Layout
14404
14405 \bar under
14406 T
14407 \family sans
14408 \bar default
14409 ools
14410 \family default
14411 \SpecialChar \menuseparator
14412
14413 \bar under
14414 P
14415 \bar default
14416 references\SpecialChar \menuseparator
14417 Paths
14418 \end_layout
14419
14420 \end_inset
14421
14422  dialog.
14423 \end_layout
14424
14425 \begin_layout Standard
14426 Note that there is a template which has a particular meaning: 
14427 \begin_inset Flex CharStyle:Code
14428 status collapsed
14429
14430 \begin_layout Plain Layout
14431 defaults.lyx
14432 \end_layout
14433
14434 \end_inset
14435
14436 .
14437  This template is loaded everytime you create a new document with 
14438 \begin_inset Flex CharStyle:MenuItem
14439 status collapsed
14440
14441 \begin_layout Plain Layout
14442
14443 \bar under
14444 F
14445 \bar default
14446 ile
14447 \end_layout
14448
14449 \end_inset
14450
14451 \SpecialChar \menuseparator
14452
14453 \begin_inset Flex CharStyle:MenuItem
14454 status collapsed
14455
14456 \begin_layout Plain Layout
14457
14458 \bar under
14459 N
14460 \bar default
14461 ew
14462 \end_layout
14463
14464 \end_inset
14465
14466  in order to provide useful defaults.
14467  To create this template from inside LyX, all you have to do is to open
14468  a document with the correct settings, and use the 
14469 \begin_inset Flex CharStyle:MenuItem
14470 status collapsed
14471
14472 \begin_layout Plain Layout
14473 Sa
14474 \bar under
14475 v
14476 \bar default
14477 e as Document Defaults
14478 \end_layout
14479
14480 \end_inset
14481
14482  button.
14483 \end_layout
14484
14485 \begin_layout Chapter
14486 Including External Material
14487 \end_layout
14488
14489 \begin_layout Standard
14490 The use of material from sources external to LyX is covered in detail in
14491  the 
14492 \emph on
14493 Embedded Objects
14494 \emph default
14495  manual.
14496  This part of the manual covers what needs to happen behind the scenes for
14497  new sorts of material to be included.
14498 \end_layout
14499
14500 \begin_layout Section
14501 How does it work?
14502 \end_layout
14503
14504 \begin_layout Standard
14505 The external material feature is based on the concept of a 
14506 \emph on
14507 template
14508 \emph default
14509 .
14510  A template is a specification of how LyX should interface with a certain
14511  kind of material.
14512  As bundled, LyX comes with predefined templates for Xfig figures, various
14513  raster format images, chess diagrams, and LilyPond music notation.
14514  You can check the actual list by using the menu 
14515 \begin_inset Flex CharStyle:MenuItem
14516 status collapsed
14517
14518 \begin_layout Plain Layout
14519 Insert\SpecialChar \menuseparator
14520 File\SpecialChar \menuseparator
14521 External Material
14522 \end_layout
14523
14524 \end_inset
14525
14526 .
14527  Furthermore, it is possible to roll your own template to support a specific
14528  kind of material.
14529  Later we'll describe in more detail what is involved, and hopefully you
14530  will submit all the templates you create so we can include them in a later
14531  LyX version.
14532 \end_layout
14533
14534 \begin_layout Standard
14535 Another basic idea of the external material feature is to distinguish between
14536  the original file that serves as a base for final material and the produced
14537  file that is included in your exported or printed document.
14538  For example, consider the case of a figure produced with 
14539 \begin_inset Flex CharStyle:Code
14540 status collapsed
14541
14542 \begin_layout Plain Layout
14543 Xfig
14544 \end_layout
14545
14546 \end_inset
14547
14548 .
14549  The Xfig application itself works on an original file with the 
14550 \begin_inset Flex CharStyle:Code
14551 status collapsed
14552
14553 \begin_layout Plain Layout
14554 .fig
14555 \end_layout
14556
14557 \end_inset
14558
14559  extension.
14560  Within XFig, you create and change your figure, and when you are done,
14561  you save the 
14562 \begin_inset Flex CharStyle:Code
14563 status collapsed
14564
14565 \begin_layout Plain Layout
14566 fig
14567 \end_layout
14568
14569 \end_inset
14570
14571 -file.
14572  When you want to include the figure in your document, you invoke 
14573 \begin_inset Flex CharStyle:Code
14574 status collapsed
14575
14576 \begin_layout Plain Layout
14577 transfig
14578 \end_layout
14579
14580 \end_inset
14581
14582  in order to create a PostScript file that can readily be included in your
14583  LaTeX file.
14584  In this case, the 
14585 \begin_inset Flex CharStyle:Code
14586 status collapsed
14587
14588 \begin_layout Plain Layout
14589 .fig
14590 \end_layout
14591
14592 \end_inset
14593
14594  file is the original file, and the PostScript file is the produced file.
14595 \end_layout
14596
14597 \begin_layout Standard
14598 This distinction is important in order to allow updating of the material
14599  while you are in the process of writing the document.
14600  Furthermore, it provides us with the flexibility that is needed to support
14601  multiple export formats.
14602  For instance, in the case of a plain text file, it is not exactly an award-winn
14603 ing idea to include the figure as raw PostScript®.
14604  Instead, you'd either prefer to just include a reference to the figure
14605  or try to invoke some graphics to Ascii converter to make the final result
14606  look similar to the real graphics.
14607  The external material management allows you to do this, because it is parameter
14608 ized on the different export formats that LyX supports.
14609 \end_layout
14610
14611 \begin_layout Standard
14612 Besides supporting the production of different products according to the
14613  exported format, it supports tight integration with editing and viewing
14614  applications.
14615  In the case of an XFig figure, you are able to invoke Xfig on the original
14616  file with a single click from within the external material dialog in LyX,
14617  and also preview the produced PostScript file with ghostview with another
14618  click.
14619  No more fiddling around with the command line and/or file browsers to locate
14620  and manipulate the original or produced files.
14621  In this way, you are finally able to take full advantage of the many different
14622  applications that are relevant to use when you write your documents, and
14623  ultimately be more productive.
14624 \end_layout
14625
14626 \begin_layout Section
14627 The external template configuration file
14628 \end_layout
14629
14630 \begin_layout Standard
14631 It is relatively easy to add custom external template definitions to LyX.
14632  However, be aware that doing this in an careless manner most probably 
14633 \emph on
14634 will
14635 \emph default
14636  introduce an easily exploitable security hole.
14637  So before you do this, please read the discussion about security in section
14638  
14639 \begin_inset CommandInset ref
14640 LatexCommand ref
14641 reference "sec:Security-discussion"
14642
14643 \end_inset
14644
14645 .
14646 \end_layout
14647
14648 \begin_layout Standard
14649 Having said that, we encourage you to submit any interesting templates that
14650  you create.
14651  
14652 \end_layout
14653
14654 \begin_layout Standard
14655 The external templates are defined in the 
14656 \begin_inset Flex CharStyle:Code
14657 status collapsed
14658
14659 \begin_layout Plain Layout
14660 LyXDir/lib/external_templates
14661 \end_layout
14662
14663 \end_inset
14664
14665  file.
14666  You can place your own version in 
14667 \begin_inset Flex CharStyle:Code
14668 status collapsed
14669
14670 \begin_layout Plain Layout
14671 UserDir/external_templates
14672 \end_layout
14673
14674 \end_inset
14675
14676 .
14677 \end_layout
14678
14679 \begin_layout Standard
14680 A typical template looks like this:
14681 \end_layout
14682
14683 \begin_layout LyX-Code
14684 Template XFig
14685 \end_layout
14686
14687 \begin_layout LyX-Code
14688 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14689 \end_layout
14690
14691 \begin_layout LyX-Code
14692 HelpText
14693 \end_layout
14694
14695 \begin_layout LyX-Code
14696 An XFig figure.
14697 \end_layout
14698
14699 \begin_layout LyX-Code
14700 HelpTextEnd
14701 \end_layout
14702
14703 \begin_layout LyX-Code
14704 InputFormat fig
14705 \end_layout
14706
14707 \begin_layout LyX-Code
14708 FileFilter "*.fig"
14709 \end_layout
14710
14711 \begin_layout LyX-Code
14712 AutomaticProduction true
14713 \end_layout
14714
14715 \begin_layout LyX-Code
14716 Transform Rotate
14717 \end_layout
14718
14719 \begin_layout LyX-Code
14720 Transform Resize
14721 \end_layout
14722
14723 \begin_layout LyX-Code
14724 Format LaTeX
14725 \end_layout
14726
14727 \begin_layout LyX-Code
14728 TransformCommand Rotate RotationLatexCommand
14729 \end_layout
14730
14731 \begin_layout LyX-Code
14732 TransformCommand Resize ResizeLatexCommand
14733 \end_layout
14734
14735 \begin_layout LyX-Code
14736 Product "$$RotateFront$$ResizeFront
14737 \end_layout
14738
14739 \begin_layout LyX-Code
14740          
14741 \backslash
14742
14743 \backslash
14744 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14745 \end_layout
14746
14747 \begin_layout LyX-Code
14748          $$ResizeBack$$RotateBack"
14749 \end_layout
14750
14751 \begin_layout LyX-Code
14752 UpdateFormat pstex
14753 \end_layout
14754
14755 \begin_layout LyX-Code
14756 UpdateResult "$$AbsPath$$Basename.pstex_t"
14757 \end_layout
14758
14759 \begin_layout LyX-Code
14760 Requirement "graphicx"
14761 \end_layout
14762
14763 \begin_layout LyX-Code
14764 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14765 \end_layout
14766
14767 \begin_layout LyX-Code
14768 ReferencedFile latex "$$AbsPath$$Basename.eps"
14769 \end_layout
14770
14771 \begin_layout LyX-Code
14772 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14773 \end_layout
14774
14775 \begin_layout LyX-Code
14776 FormatEnd
14777 \end_layout
14778
14779 \begin_layout LyX-Code
14780 Format PDFLaTeX
14781 \end_layout
14782
14783 \begin_layout LyX-Code
14784 TransformCommand Rotate RotationLatexCommand
14785 \end_layout
14786
14787 \begin_layout LyX-Code
14788 TransformCommand Resize ResizeLatexCommand
14789 \end_layout
14790
14791 \begin_layout LyX-Code
14792 Product "$$RotateFront$$ResizeFront
14793 \end_layout
14794
14795 \begin_layout LyX-Code
14796          
14797 \backslash
14798
14799 \backslash
14800 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14801 \end_layout
14802
14803 \begin_layout LyX-Code
14804          $$ResizeBack$$RotateBack"
14805 \end_layout
14806
14807 \begin_layout LyX-Code
14808 UpdateFormat pdftex
14809 \end_layout
14810
14811 \begin_layout LyX-Code
14812 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14813 \end_layout
14814
14815 \begin_layout LyX-Code
14816 Requirement "graphicx"
14817 \end_layout
14818
14819 \begin_layout LyX-Code
14820 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14821 \end_layout
14822
14823 \begin_layout LyX-Code
14824 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14825 \end_layout
14826
14827 \begin_layout LyX-Code
14828 FormatEnd
14829 \end_layout
14830
14831 \begin_layout LyX-Code
14832 Format Ascii
14833 \end_layout
14834
14835 \begin_layout LyX-Code
14836 Product "$$Contents(
14837 \backslash
14838 "$$AbsPath$$Basename.asc
14839 \backslash
14840 ")"
14841 \end_layout
14842
14843 \begin_layout LyX-Code
14844 UpdateFormat asciixfig
14845 \end_layout
14846
14847 \begin_layout LyX-Code
14848 UpdateResult "$$AbsPath$$Basename.asc"
14849 \end_layout
14850
14851 \begin_layout LyX-Code
14852 FormatEnd
14853 \end_layout
14854
14855 \begin_layout LyX-Code
14856 Format DocBook
14857 \end_layout
14858
14859 \begin_layout LyX-Code
14860 Product "<graphic fileref=
14861 \backslash
14862 "$$AbsOrRelPathMaster$$Basename.eps
14863 \backslash
14864 ">
14865 \end_layout
14866
14867 \begin_layout LyX-Code
14868          </graphic>"
14869 \end_layout
14870
14871 \begin_layout LyX-Code
14872 UpdateFormat eps
14873 \end_layout
14874
14875 \begin_layout LyX-Code
14876 UpdateResult "$$AbsPath$$Basename.eps"
14877 \end_layout
14878
14879 \begin_layout LyX-Code
14880 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14881 \end_layout
14882
14883 \begin_layout LyX-Code
14884 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14885 \end_layout
14886
14887 \begin_layout LyX-Code
14888 FormatEnd
14889 \end_layout
14890
14891 \begin_layout LyX-Code
14892 Product "[XFig: $$FName]"
14893 \end_layout
14894
14895 \begin_layout LyX-Code
14896 FormatEnd
14897 \end_layout
14898
14899 \begin_layout LyX-Code
14900 TemplateEnd
14901 \end_layout
14902
14903 \begin_layout Standard
14904 As you can see, the template is enclosed in 
14905 \begin_inset Flex CharStyle:Code
14906 status collapsed
14907
14908 \begin_layout Plain Layout
14909 Template
14910 \end_layout
14911
14912 \end_inset
14913
14914  \SpecialChar \ldots{}
14915  
14916 \begin_inset Flex CharStyle:Code
14917 status collapsed
14918
14919 \begin_layout Plain Layout
14920 TemplateEnd
14921 \end_layout
14922
14923 \end_inset
14924
14925 .
14926  It contains a header specifying some general settings and, for each supported
14927  primary document file format, a section 
14928 \begin_inset Flex CharStyle:Code
14929 status collapsed
14930
14931 \begin_layout Plain Layout
14932 Format
14933 \end_layout
14934
14935 \end_inset
14936
14937  \SpecialChar \ldots{}
14938  
14939 \begin_inset Flex CharStyle:Code
14940 status collapsed
14941
14942 \begin_layout Plain Layout
14943 FormatEnd
14944 \end_layout
14945
14946 \end_inset
14947
14948 .
14949 \end_layout
14950
14951 \begin_layout Subsection
14952 The template header
14953 \end_layout
14954
14955 \begin_layout Description
14956 \begin_inset Flex CharStyle:Code
14957 status collapsed
14958
14959 \begin_layout Plain Layout
14960 AutomaticProduction
14961 \begin_inset space ~
14962 \end_inset
14963
14964 true|false
14965 \end_layout
14966
14967 \end_inset
14968
14969  Whether the file represented by the template must be generated by LyX.
14970  This command must occur exactly once.
14971 \end_layout
14972
14973 \begin_layout Description
14974 \begin_inset Flex CharStyle:Code
14975 status collapsed
14976
14977 \begin_layout Plain Layout
14978 FileFilter
14979 \begin_inset space ~
14980 \end_inset
14981
14982 <pattern>
14983 \end_layout
14984
14985 \end_inset
14986
14987  A glob pattern that is used in the file dialog to filter out the desired
14988  files.
14989  If there is more than one possible file extension (e.g.
14990 \begin_inset space ~
14991 \end_inset
14992
14993 tgif has 
14994 \begin_inset Flex CharStyle:Code
14995 status collapsed
14996
14997 \begin_layout Plain Layout
14998 .obj
14999 \end_layout
15000
15001 \end_inset
15002
15003  and 
15004 \begin_inset Flex CharStyle:Code
15005 status collapsed
15006
15007 \begin_layout Plain Layout
15008 .tgo
15009 \end_layout
15010
15011 \end_inset
15012
15013 ), use something like 
15014 \begin_inset Flex CharStyle:Code
15015 status collapsed
15016
15017 \begin_layout Plain Layout
15018 "*.{obj,tgo}"
15019 \end_layout
15020
15021 \end_inset
15022
15023 .
15024  This command must occur exactly once.
15025 \end_layout
15026
15027 \begin_layout Description
15028 \begin_inset Flex CharStyle:Code
15029 status collapsed
15030
15031 \begin_layout Plain Layout
15032 GuiName
15033 \begin_inset space ~
15034 \end_inset
15035
15036 <guiname>
15037 \end_layout
15038
15039 \end_inset
15040
15041  The text that is displayed on the button.
15042  This command must occur exactly once.
15043 \end_layout
15044
15045 \begin_layout Description
15046 \begin_inset Flex CharStyle:Code
15047 status collapsed
15048
15049 \begin_layout Plain Layout
15050 HelpText
15051 \begin_inset space ~
15052 \end_inset
15053
15054 <text>
15055 \begin_inset space ~
15056 \end_inset
15057
15058 HelpTextEnd
15059 \end_layout
15060
15061 \end_inset
15062
15063  The help text that is used in the External dialog.
15064  Provide enough information to explain to the user just what the template
15065  can provide him with.
15066  This command must occur exactly once.
15067 \end_layout
15068
15069 \begin_layout Description
15070 \begin_inset Flex CharStyle:Code
15071 status collapsed
15072
15073 \begin_layout Plain Layout
15074 InputFormat
15075 \begin_inset space ~
15076 \end_inset
15077
15078 <format>
15079 \end_layout
15080
15081 \end_inset
15082
15083  The file format of the original file.
15084  This must be the name of a format that is known to LyX (see section 
15085 \begin_inset CommandInset ref
15086 LatexCommand ref
15087 reference "sub:Formats"
15088
15089 \end_inset
15090
15091 ).
15092  Use 
15093 \begin_inset Quotes eld
15094 \end_inset
15095
15096
15097 \begin_inset Flex CharStyle:Code
15098 status collapsed
15099
15100 \begin_layout Plain Layout
15101 *
15102 \end_layout
15103
15104 \end_inset
15105
15106
15107 \begin_inset Quotes erd
15108 \end_inset
15109
15110  if the template can handle original files of more than one format.
15111  LyX will attempt to interrogate the file itself in order to deduce its
15112  format in this case.
15113  This command must occur exactly once.
15114 \end_layout
15115
15116 \begin_layout Description
15117 \begin_inset Flex CharStyle:Code
15118 status collapsed
15119
15120 \begin_layout Plain Layout
15121 Template
15122 \begin_inset space ~
15123 \end_inset
15124
15125 <id>
15126 \end_layout
15127
15128 \end_inset
15129
15130  A unique name for the template.
15131  It must not contain substitution macros (see below).
15132 \end_layout
15133
15134 \begin_layout Description
15135 \begin_inset Flex CharStyle:Code
15136 status collapsed
15137
15138 \begin_layout Plain Layout
15139 Transform
15140 \begin_inset space ~
15141 \end_inset
15142
15143 Rotate|Resize|Clip|Extra
15144 \end_layout
15145
15146 \end_inset
15147
15148  This command specifies which transformations are supported by this template.
15149  It may occur zero or more times.
15150  This command enables the corresponding tabs in the external dialog.
15151  Each 
15152 \begin_inset Flex CharStyle:Code
15153 status collapsed
15154
15155 \begin_layout Plain Layout
15156 Transform
15157 \end_layout
15158
15159 \end_inset
15160
15161  command must have either a corresponding 
15162 \begin_inset Flex CharStyle:Code
15163 status collapsed
15164
15165 \begin_layout Plain Layout
15166 TransformCommand
15167 \end_layout
15168
15169 \end_inset
15170
15171  or a 
15172 \begin_inset Flex CharStyle:Code
15173 status collapsed
15174
15175 \begin_layout Plain Layout
15176 TransformOption
15177 \end_layout
15178
15179 \end_inset
15180
15181  command in the 
15182 \begin_inset Flex CharStyle:Code
15183 status collapsed
15184
15185 \begin_layout Plain Layout
15186 Format
15187 \end_layout
15188
15189 \end_inset
15190
15191  section.
15192  Otherwise the transformation will not be supported by that format.
15193 \end_layout
15194
15195 \begin_layout Subsection
15196 The Format section
15197 \end_layout
15198
15199 \begin_layout Description
15200 \begin_inset Flex CharStyle:Code
15201 status collapsed
15202
15203 \begin_layout Plain Layout
15204 Format
15205 \begin_inset space ~
15206 \end_inset
15207
15208 LaTeX|PDFLaTeX|PlainText|DocBook
15209 \end_layout
15210
15211 \end_inset
15212
15213  The primary document file format that this format definition is for.
15214  Not every template has a sensible representation in all document file formats.
15215  Please define nevertheless a 
15216 \begin_inset Flex CharStyle:Code
15217 status collapsed
15218
15219 \begin_layout Plain Layout
15220 Format
15221 \end_layout
15222
15223 \end_inset
15224
15225  section for all formats.
15226  Use a dummy text when no representation is available.
15227  Then you can at least see a reference to the external material in the exported
15228  document.
15229 \end_layout
15230
15231 \begin_layout Description
15232 \begin_inset Flex CharStyle:Code
15233 status collapsed
15234
15235 \begin_layout Plain Layout
15236 Option
15237 \begin_inset space ~
15238 \end_inset
15239
15240 <name>
15241 \begin_inset space ~
15242 \end_inset
15243
15244 <value>
15245 \end_layout
15246
15247 \end_inset
15248
15249  This command defines an additional macro 
15250 \begin_inset Flex CharStyle:Code
15251 status collapsed
15252
15253 \begin_layout Plain Layout
15254 $$<name>
15255 \end_layout
15256
15257 \end_inset
15258
15259  for substitution in 
15260 \begin_inset Flex CharStyle:Code
15261 status collapsed
15262
15263 \begin_layout Plain Layout
15264 Product
15265 \end_layout
15266
15267 \end_inset
15268
15269 .
15270  
15271 \begin_inset Flex CharStyle:Code
15272 status collapsed
15273
15274 \begin_layout Plain Layout
15275 <value>
15276 \end_layout
15277
15278 \end_inset
15279
15280  itself may contain substitution macros.
15281  The advantage over using 
15282 \begin_inset Flex CharStyle:Code
15283 status collapsed
15284
15285 \begin_layout Plain Layout
15286 <value>
15287 \end_layout
15288
15289 \end_inset
15290
15291  directly in 
15292 \begin_inset Flex CharStyle:Code
15293 status collapsed
15294
15295 \begin_layout Plain Layout
15296 Product
15297 \end_layout
15298
15299 \end_inset
15300
15301  is that the substituted value of 
15302 \begin_inset Flex CharStyle:Code
15303 status collapsed
15304
15305 \begin_layout Plain Layout
15306 $$<name>
15307 \end_layout
15308
15309 \end_inset
15310
15311  is sanitized so that it is a valid optional argument in the document format.
15312  This command may occur zero or more times.
15313 \end_layout
15314
15315 \begin_layout Description
15316 \begin_inset Flex CharStyle:Code
15317 status collapsed
15318
15319 \begin_layout Plain Layout
15320 Product
15321 \begin_inset space ~
15322 \end_inset
15323
15324 <text>
15325 \end_layout
15326
15327 \end_inset
15328
15329  The text that is inserted in the exported document.
15330  This is actually the most important command and can be quite complex.
15331  This command must occur exactly once.
15332 \end_layout
15333
15334 \begin_layout Description
15335 \begin_inset Flex CharStyle:Code
15336 status collapsed
15337
15338 \begin_layout Plain Layout
15339 Preamble
15340 \begin_inset space ~
15341 \end_inset
15342
15343 <name>
15344 \end_layout
15345
15346 \end_inset
15347
15348  This command specifies a preamble snippet that will be included in the
15349  LaTeX preamble.
15350  It has to be defined using 
15351 \begin_inset Flex CharStyle:Code
15352 status collapsed
15353
15354 \begin_layout Plain Layout
15355 PreambleDef
15356 \end_layout
15357
15358 \end_inset
15359
15360  \SpecialChar \ldots{}
15361  
15362 \begin_inset Flex CharStyle:Code
15363 status collapsed
15364
15365 \begin_layout Plain Layout
15366 PreambleDefEnd
15367 \end_layout
15368
15369 \end_inset
15370
15371 .
15372  This command may occur zero or more times.
15373 \end_layout
15374
15375 \begin_layout Description
15376 \begin_inset Flex CharStyle:Code
15377 status collapsed
15378
15379 \begin_layout Plain Layout
15380 ReferencedFile
15381 \begin_inset space ~
15382 \end_inset
15383
15384 <format>
15385 \begin_inset space ~
15386 \end_inset
15387
15388 <filename>
15389 \end_layout
15390
15391 \end_inset
15392
15393  This command denotes files that are created by the conversion process and
15394  are needed for a particular export format.
15395  If the filename is relative, it is interpreted relative to the master document.
15396  This command may be given zero or more times.
15397 \end_layout
15398
15399 \begin_layout Description
15400 \begin_inset Flex CharStyle:Code
15401 status collapsed
15402
15403 \begin_layout Plain Layout
15404 Requirement
15405 \begin_inset space ~
15406 \end_inset
15407
15408 <package>
15409 \end_layout
15410
15411 \end_inset
15412
15413  The name of a required LaTeX package.
15414  The package is included via 
15415 \begin_inset Flex CharStyle:Code
15416 status collapsed
15417
15418 \begin_layout Plain Layout
15419
15420 \backslash
15421 usepackage{}
15422 \end_layout
15423
15424 \end_inset
15425
15426  in the LaTeX preamble.
15427  This command may occur zero or more times.
15428 \end_layout
15429
15430 \begin_layout Description
15431 \begin_inset Flex CharStyle:Code
15432 status collapsed
15433
15434 \begin_layout Plain Layout
15435 TransformCommand
15436 \begin_inset space ~
15437 \end_inset
15438
15439 Rotate
15440 \begin_inset space ~
15441 \end_inset
15442
15443 RotationLatexCommand
15444 \end_layout
15445
15446 \end_inset
15447
15448  This command specifies that the built in LaTeX command should be used for
15449  rotation.
15450  This command may occur once or not at all.
15451 \end_layout
15452
15453 \begin_layout Description
15454 \begin_inset Flex CharStyle:Code
15455 status collapsed
15456
15457 \begin_layout Plain Layout
15458 TransformCommand
15459 \begin_inset space ~
15460 \end_inset
15461
15462 Resize
15463 \begin_inset space ~
15464 \end_inset
15465
15466 ResizeLatexCommand
15467 \end_layout
15468
15469 \end_inset
15470
15471  This command specifies that the built in LaTeX command should be used for
15472  resizing.
15473  This command may occur once or not at all.
15474 \end_layout
15475
15476 \begin_layout Description
15477 \begin_inset Flex CharStyle:Code
15478 status collapsed
15479
15480 \begin_layout Plain Layout
15481 TransformOption
15482 \begin_inset space ~
15483 \end_inset
15484
15485 Rotate
15486 \begin_inset space ~
15487 \end_inset
15488
15489 RotationLatexOption
15490 \end_layout
15491
15492 \end_inset
15493
15494  This command specifies that rotation is done via an optional argument.
15495  This command may occur once or not at all.
15496 \end_layout
15497
15498 \begin_layout Description
15499 \begin_inset Flex CharStyle:Code
15500 status collapsed
15501
15502 \begin_layout Plain Layout
15503 TransformOption
15504 \begin_inset space ~
15505 \end_inset
15506
15507 Resize
15508 \begin_inset space ~
15509 \end_inset
15510
15511 ResizeLatexOption
15512 \end_layout
15513
15514 \end_inset
15515
15516  This command specifies that resizing is done via an optional argument.
15517  This command may occur once or not at all.
15518 \end_layout
15519
15520 \begin_layout Description
15521 \begin_inset Flex CharStyle:Code
15522 status collapsed
15523
15524 \begin_layout Plain Layout
15525 TransformOption
15526 \begin_inset space ~
15527 \end_inset
15528
15529 Clip
15530 \begin_inset space ~
15531 \end_inset
15532
15533 ClipLatexOption
15534 \end_layout
15535
15536 \end_inset
15537
15538  This command specifies that clipping is done via an optional argument.
15539  This command may occur once or not at all.
15540 \end_layout
15541
15542 \begin_layout Description
15543 \begin_inset Flex CharStyle:Code
15544 status collapsed
15545
15546 \begin_layout Plain Layout
15547 TransformOption
15548 \begin_inset space ~
15549 \end_inset
15550
15551 Extra
15552 \begin_inset space ~
15553 \end_inset
15554
15555 ExtraLatexOption
15556 \end_layout
15557
15558 \end_inset
15559
15560  This command specifies that an extra optional argument is used.
15561  This command may occur once or not at all.
15562 \end_layout
15563
15564 \begin_layout Description
15565 \begin_inset Flex CharStyle:Code
15566 status collapsed
15567
15568 \begin_layout Plain Layout
15569 UpdateFormat
15570 \begin_inset space ~
15571 \end_inset
15572
15573 <format>
15574 \end_layout
15575
15576 \end_inset
15577
15578  The file format of the converted file.
15579  This must be the name of a format that is known to LyX (see the 
15580 \begin_inset Flex CharStyle:MenuItem
15581 status collapsed
15582
15583 \begin_layout Plain Layout
15584
15585 \bar under
15586 T
15587 \bar default
15588 ools\SpecialChar \menuseparator
15589
15590 \bar under
15591 P
15592 \bar default
15593 references:Conversion
15594 \end_layout
15595
15596 \end_inset
15597
15598  dialog).
15599  This command must occur exactly once.
15600 \end_layout
15601
15602 \begin_layout Description
15603 \begin_inset Flex CharStyle:Code
15604 status collapsed
15605
15606 \begin_layout Plain Layout
15607 UpdateResult
15608 \begin_inset space ~
15609 \end_inset
15610
15611 <filename>
15612 \end_layout
15613
15614 \end_inset
15615
15616  The file name of the converted file.
15617  The file name must be absolute.
15618  This command must occur exactly once.
15619 \end_layout
15620
15621 \begin_layout Subsection
15622 Preamble definitions
15623 \end_layout
15624
15625 \begin_layout Standard
15626 The external template configuration file may contain additional preamble
15627  definitions enclosed by 
15628 \begin_inset Flex CharStyle:Code
15629 status collapsed
15630
15631 \begin_layout Plain Layout
15632 PreambleDef
15633 \end_layout
15634
15635 \end_inset
15636
15637  \SpecialChar \ldots{}
15638  
15639 \begin_inset Flex CharStyle:Code
15640 status collapsed
15641
15642 \begin_layout Plain Layout
15643 PreambleDefEnd
15644 \end_layout
15645
15646 \end_inset
15647
15648 .
15649  They can be used by the templates in the 
15650 \begin_inset Flex CharStyle:Code
15651 status collapsed
15652
15653 \begin_layout Plain Layout
15654 Format
15655 \end_layout
15656
15657 \end_inset
15658
15659  section.
15660 \end_layout
15661
15662 \begin_layout Section
15663 The substitution mechanism
15664 \end_layout
15665
15666 \begin_layout Standard
15667 When the external material facility invokes an external program, it is done
15668  on the basis of a command defined in the template configuration file.
15669  These commands can contain various macros that are expanded before execution.
15670  Execution always take place in the directory of the containing document.
15671 \end_layout
15672
15673 \begin_layout Standard
15674 Also, whenever external material is to be displayed, the name will be produced
15675  by the substitution mechanism, and most other commands in the template
15676  definition support substitution as well.
15677 \end_layout
15678
15679 \begin_layout Standard
15680 The available macros are the following:
15681 \end_layout
15682
15683 \begin_layout Description
15684 \begin_inset Flex CharStyle:Code
15685 status collapsed
15686
15687 \begin_layout Plain Layout
15688 $$AbsOrRelPathMaster
15689 \end_layout
15690
15691 \end_inset
15692
15693  The file path, absolute or relative to the master LyX document.
15694 \end_layout
15695
15696 \begin_layout Description
15697 \begin_inset Flex CharStyle:Code
15698 status collapsed
15699
15700 \begin_layout Plain Layout
15701 $$AbsOrRelPathParent
15702 \end_layout
15703
15704 \end_inset
15705
15706  The file path, absolute or relative to the LyX document.
15707 \end_layout
15708
15709 \begin_layout Description
15710 \begin_inset Flex CharStyle:Code
15711 status collapsed
15712
15713 \begin_layout Plain Layout
15714 $$AbsPath
15715 \end_layout
15716
15717 \end_inset
15718
15719  The absolute file path.
15720 \end_layout
15721
15722 \begin_layout Description
15723 \begin_inset Flex CharStyle:Code
15724 status collapsed
15725
15726 \begin_layout Plain Layout
15727 $$Basename
15728 \end_layout
15729
15730 \end_inset
15731
15732  The filename without path and without the extension.
15733 \end_layout
15734
15735 \begin_layout Description
15736 \begin_inset Flex CharStyle:Code
15737 status collapsed
15738
15739 \begin_layout Plain Layout
15740 $$Contents(
15741 \begin_inset Quotes eld
15742 \end_inset
15743
15744 filename.ext
15745 \begin_inset Quotes erd
15746 \end_inset
15747
15748 )
15749 \end_layout
15750
15751 \end_inset
15752
15753  This macro will expand to the contents of the file with the name 
15754 \begin_inset Flex CharStyle:Code
15755 status collapsed
15756
15757 \begin_layout Plain Layout
15758 filename.ext
15759 \end_layout
15760
15761 \end_inset
15762
15763 .
15764 \end_layout
15765
15766 \begin_layout Description
15767 \begin_inset Flex CharStyle:Code
15768 status collapsed
15769
15770 \begin_layout Plain Layout
15771 $$Extension
15772 \end_layout
15773
15774 \end_inset
15775
15776  The file extension (including the dot).
15777 \end_layout
15778
15779 \begin_layout Description
15780 \begin_inset Flex CharStyle:Code
15781 status collapsed
15782
15783 \begin_layout Plain Layout
15784 $$FName
15785 \end_layout
15786
15787 \end_inset
15788
15789  The filename of the file specified in the external material dialog.
15790  This is either an absolute name, or it is relative to the LyX document.
15791 \end_layout
15792
15793 \begin_layout Description
15794 \begin_inset Flex CharStyle:Code
15795 status collapsed
15796
15797 \begin_layout Plain Layout
15798 $$FPath
15799 \end_layout
15800
15801 \end_inset
15802
15803  The path part of 
15804 \begin_inset Flex CharStyle:Code
15805 status collapsed
15806
15807 \begin_layout Plain Layout
15808 $$FName
15809 \end_layout
15810
15811 \end_inset
15812
15813  (absolute name or relative to the LyX document).
15814 \end_layout
15815
15816 \begin_layout Description
15817 \begin_inset Flex CharStyle:Code
15818 status collapsed
15819
15820 \begin_layout Plain Layout
15821 $$RelPathMaster
15822 \end_layout
15823
15824 \end_inset
15825
15826  The file path, relative to the master LyX document.
15827 \end_layout
15828
15829 \begin_layout Description
15830 \begin_inset Flex CharStyle:Code
15831 status collapsed
15832
15833 \begin_layout Plain Layout
15834 $$RelPathParent
15835 \end_layout
15836
15837 \end_inset
15838
15839  The file path, relative to the LyX document.
15840 \end_layout
15841
15842 \begin_layout Description
15843 \begin_inset Flex CharStyle:Code
15844 status collapsed
15845
15846 \begin_layout Plain Layout
15847 $$Sysdir
15848 \end_layout
15849
15850 \end_inset
15851
15852  This macro will expand to the absolute path of the system directory.
15853  This is typically used to point to the various helper scripts that are
15854  bundled with LyX.
15855 \end_layout
15856
15857 \begin_layout Description
15858 \begin_inset Flex CharStyle:Code
15859 status collapsed
15860
15861 \begin_layout Plain Layout
15862 $$Tempname
15863 \end_layout
15864
15865 \end_inset
15866
15867  A name and full path to a temporary file which will be automatically deleted
15868  whenever the containing document is closed, or the external material insertion
15869  deleted.
15870 \end_layout
15871
15872 \begin_layout Standard
15873 All path macros contain a trailing directory separator, so you can construct
15874  e.g.
15875  the absolute filename with 
15876 \begin_inset Flex CharStyle:Code
15877 status collapsed
15878
15879 \begin_layout Plain Layout
15880 $$AbsPath$$Basename$$Extension
15881 \end_layout
15882
15883 \end_inset
15884
15885 .
15886 \end_layout
15887
15888 \begin_layout Standard
15889 The macros above are substituted in all commands unless otherwise noted.
15890  The command 
15891 \begin_inset Flex CharStyle:Code
15892 status collapsed
15893
15894 \begin_layout Plain Layout
15895 Product
15896 \end_layout
15897
15898 \end_inset
15899
15900  supports additionally the following substitutions if they are enabled by
15901  the 
15902 \begin_inset Flex CharStyle:Code
15903 status collapsed
15904
15905 \begin_layout Plain Layout
15906 Transform
15907 \end_layout
15908
15909 \end_inset
15910
15911  and 
15912 \begin_inset Flex CharStyle:Code
15913 status collapsed
15914
15915 \begin_layout Plain Layout
15916 TransformCommand
15917 \end_layout
15918
15919 \end_inset
15920
15921  commands:
15922 \end_layout
15923
15924 \begin_layout Description
15925 \begin_inset Flex CharStyle:Code
15926 status collapsed
15927
15928 \begin_layout Plain Layout
15929 $$ResizeFront
15930 \end_layout
15931
15932 \end_inset
15933
15934  The front part of the resize command.
15935 \end_layout
15936
15937 \begin_layout Description
15938 \begin_inset Flex CharStyle:Code
15939 status collapsed
15940
15941 \begin_layout Plain Layout
15942 $$ResizeBack
15943 \end_layout
15944
15945 \end_inset
15946
15947  The back part of the resize command.
15948 \end_layout
15949
15950 \begin_layout Description
15951 \begin_inset Flex CharStyle:Code
15952 status collapsed
15953
15954 \begin_layout Plain Layout
15955 $$RotateFront
15956 \end_layout
15957
15958 \end_inset
15959
15960  The front part of the rotation command.
15961 \end_layout
15962
15963 \begin_layout Description
15964 \begin_inset Flex CharStyle:Code
15965 status collapsed
15966
15967 \begin_layout Plain Layout
15968 $$RotateBack
15969 \end_layout
15970
15971 \end_inset
15972
15973  The back part of the rotation command.
15974 \end_layout
15975
15976 \begin_layout Standard
15977 The value string of the 
15978 \begin_inset Flex CharStyle:Code
15979 status collapsed
15980
15981 \begin_layout Plain Layout
15982 Option
15983 \end_layout
15984
15985 \end_inset
15986
15987  command supports additionally the following substitutions if they are enabled
15988  by the 
15989 \begin_inset Flex CharStyle:Code
15990 status collapsed
15991
15992 \begin_layout Plain Layout
15993 Transform
15994 \end_layout
15995
15996 \end_inset
15997
15998  and 
15999 \begin_inset Flex CharStyle:Code
16000 status collapsed
16001
16002 \begin_layout Plain Layout
16003 TransformOption
16004 \end_layout
16005
16006 \end_inset
16007
16008  commands:
16009 \end_layout
16010
16011 \begin_layout Description
16012 \begin_inset Flex CharStyle:Code
16013 status collapsed
16014
16015 \begin_layout Plain Layout
16016 $$Clip
16017 \end_layout
16018
16019 \end_inset
16020
16021  The clip option.
16022 \end_layout
16023
16024 \begin_layout Description
16025 \begin_inset Flex CharStyle:Code
16026 status collapsed
16027
16028 \begin_layout Plain Layout
16029 $$Extra
16030 \end_layout
16031
16032 \end_inset
16033
16034  The extra option.
16035 \end_layout
16036
16037 \begin_layout Description
16038 \begin_inset Flex CharStyle:Code
16039 status collapsed
16040
16041 \begin_layout Plain Layout
16042 $$Resize
16043 \end_layout
16044
16045 \end_inset
16046
16047  The resize option.
16048 \end_layout
16049
16050 \begin_layout Description
16051 \begin_inset Flex CharStyle:Code
16052 status collapsed
16053
16054 \begin_layout Plain Layout
16055 $$Rotate
16056 \end_layout
16057
16058 \end_inset
16059
16060  The rotation option.
16061 \end_layout
16062
16063 \begin_layout Standard
16064 You may ask why there are so many path macros.
16065  There are mainly two reasons:
16066 \end_layout
16067
16068 \begin_layout Enumerate
16069 Relative and absolute file names should remain relative or absolute, respectivel
16070 y.
16071  Users may have reasons to prefer either form.
16072  Relative names are useful for portable documents that should work on different
16073  machines, for example.
16074  Absolute names may be required by some programs.
16075 \end_layout
16076
16077 \begin_layout Enumerate
16078 LaTeX treats relative file names differently than LyX and other programs
16079  in nested included files.
16080  For LyX, a relative file name is always relative to the document that contains
16081  the file name.
16082  For LaTeX, it is always relative to the master document.
16083  These two definitions are identical if you have only one document, but
16084  differ if you have a master document that includes part documents.
16085  That means that relative filenames must be transformed when presented to
16086  LaTeX.
16087  Fortunately LyX does this automatically for you if you choose the right
16088  macros.
16089 \end_layout
16090
16091 \begin_layout Standard
16092 So which path macro should be used in new template definitions? The rule
16093  is not difficult:
16094 \end_layout
16095
16096 \begin_layout Itemize
16097 Use 
16098 \begin_inset Flex CharStyle:Code
16099 status collapsed
16100
16101 \begin_layout Plain Layout
16102 $$AbsPath
16103 \end_layout
16104
16105 \end_inset
16106
16107  if an absolute path is required.
16108 \end_layout
16109
16110 \begin_layout Itemize
16111 Use 
16112 \begin_inset Flex CharStyle:Code
16113 status collapsed
16114
16115 \begin_layout Plain Layout
16116 $$AbsOrRelPathMaster
16117 \end_layout
16118
16119 \end_inset
16120
16121  if the substituted string is some kind of LaTeX input.
16122 \end_layout
16123
16124 \begin_layout Itemize
16125 Else use 
16126 \begin_inset Flex CharStyle:Code
16127 status collapsed
16128
16129 \begin_layout Plain Layout
16130 $$AbsOrRelPathParent
16131 \end_layout
16132
16133 \end_inset
16134
16135  in order to preserve the user's choice.
16136 \end_layout
16137
16138 \begin_layout Standard
16139 There are special cases where this rule does not work and e.g.
16140 \begin_inset space ~
16141 \end_inset
16142
16143 relative names are needed, but normally it will work just fine.
16144  One example for such a case is the command 
16145 \begin_inset Flex CharStyle:Code
16146 status collapsed
16147
16148 \begin_layout Plain Layout
16149 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16150 \end_layout
16151
16152 \end_inset
16153
16154  in the XFig template above: We can't use the absolute name because the
16155  copier for 
16156 \begin_inset Flex CharStyle:Code
16157 status collapsed
16158
16159 \begin_layout Plain Layout
16160 .pstex_t
16161 \end_layout
16162
16163 \end_inset
16164
16165  files needs the relative name in order to rewrite the file content.
16166 \end_layout
16167
16168 \begin_layout Section
16169 \begin_inset CommandInset label
16170 LatexCommand label
16171 name "sec:Security-discussion"
16172
16173 \end_inset
16174
16175 Security discussion
16176 \end_layout
16177
16178 \begin_layout Standard
16179 \begin_inset Note Note
16180 status collapsed
16181
16182 \begin_layout Plain Layout
16183 This section is outdated
16184 \end_layout
16185
16186 \end_inset
16187
16188 The external material feature interfaces with a lot of external programs
16189  and does so automatically, so we have to consider the security implications
16190  of this.
16191  In particular, since you have the option of including your own filenames
16192  and/or parameter strings and those are expanded into a command, it seems
16193  that it would be possible to create a malicious document which executes
16194  arbitrary commands when a user views or prints the document.
16195  This is something we definately want to avoid.
16196 \end_layout
16197
16198 \begin_layout Standard
16199 However, since the external program commands are specified in the template
16200  configuration file only, there are no security issues if LyX is properly
16201  configured with safe templates only.
16202  This is so because the external programs are invoked with the 
16203 \begin_inset Flex CharStyle:Code
16204 status collapsed
16205
16206 \begin_layout Plain Layout
16207 execvp
16208 \end_layout
16209
16210 \end_inset
16211
16212 -system call rather than the 
16213 \begin_inset Flex CharStyle:Code
16214 status collapsed
16215
16216 \begin_layout Plain Layout
16217 system
16218 \end_layout
16219
16220 \end_inset
16221
16222  system-call, so it's not possible to execute arbitrary commands from the
16223  filename or parameter section via the shell.
16224 \end_layout
16225
16226 \begin_layout Standard
16227 This also implies that you are restricted in what command strings you can
16228  use in the external material templates.
16229  In particular, pipes and redirection are not readily available.
16230  This has to be so if LyX should remain safe.
16231  If you want to use some of the shell features, you should write a safe
16232  script to do this in a controlled manner, and then invoke the script from
16233  the command string.
16234  In the 
16235 \begin_inset Flex CharStyle:Code
16236 status collapsed
16237
16238 \begin_layout Plain Layout
16239 lib/scripts
16240 \end_layout
16241
16242 \end_inset
16243
16244  directory of the LyX installation, you can find a safe wrapper script 
16245 \begin_inset Flex CharStyle:Code
16246 status collapsed
16247
16248 \begin_layout Plain Layout
16249 general_command_wrapper.py
16250 \end_layout
16251
16252 \end_inset
16253
16254  that supports redirection of input and output.
16255  That can serve as an example for how to write safe template scripts.
16256  For a more advanced example that uses 
16257 \begin_inset Flex CharStyle:Code
16258 status collapsed
16259
16260 \begin_layout Plain Layout
16261 fork
16262 \end_layout
16263
16264 \end_inset
16265
16266  and friends, take a look at the 
16267 \begin_inset Flex CharStyle:Code
16268 status collapsed
16269
16270 \begin_layout Plain Layout
16271 pic2ascii.py
16272 \end_layout
16273
16274 \end_inset
16275
16276  converter script.
16277 \end_layout
16278
16279 \begin_layout Standard
16280 It is possible to design a template that interacts directly with the shell,
16281  but since this would allow a malicious user to execute arbitrary commands
16282  by writing clever filenames and/or parameters, we generally recommend that
16283  you only use safe scripts that work with the 
16284 \begin_inset Flex CharStyle:Code
16285 status collapsed
16286
16287 \begin_layout Plain Layout
16288 execvp
16289 \end_layout
16290
16291 \end_inset
16292
16293  system call in a controlled manner.
16294  Of course, for use in a controlled environment, it can be tempting to just
16295  fall back to use ordinary shell scripts.
16296  If you do so, be aware that you 
16297 \emph on
16298 will
16299 \emph default
16300  provide an easily exploitable security hole in your system.
16301  Of course it stands to reason that such unsafe templates will never be
16302  included in the standard LyX distribution, although we do encourage people
16303  to submit new templates in the open source tradition.
16304  But LyX as shipped from the official distribution channels will never have
16305  unsafe templates.
16306 \end_layout
16307
16308 \begin_layout Standard
16309 Including external material provides a lot of power, and you have to be
16310  careful not to introduce security hazards with this power.
16311  A subtle error in a single line in an innocent looking script can open
16312  the door to huge security problems.
16313  So if you do not fully understand the issues, we recommend that you consult
16314  a knowledgable security professional or the LyX development team if you
16315  have any questions about whether a given template is safe or not.
16316  And do this before you use it in an uncontrolled environment.
16317 \end_layout
16318
16319 \begin_layout Chapter
16320 The LyX Server
16321 \end_layout
16322
16323 \begin_layout Section
16324 Introduction
16325 \end_layout
16326
16327 \begin_layout Standard
16328 The LyX server is a method implemented in LyX that will enable other programs
16329  to talk to LyX, invoke LyX commands, and retrieve information about the
16330  LyX internal state.
16331  This is only intended for advanced users, but they should find it useful.
16332  Please note that, at present, 
16333 \emph on
16334 the server does not work on Windows
16335 \emph default
16336 .
16337 \begin_inset Foot
16338 status collapsed
16339
16340 \begin_layout Plain Layout
16341 There is no principled reason it cannot do so.
16342  But none of the developers on Windows® have yet implemented this functionality
16343  there.
16344 \end_layout
16345
16346 \end_inset
16347
16348
16349 \end_layout
16350
16351 \begin_layout Section
16352 Starting the LyX Server
16353 \end_layout
16354
16355 \begin_layout Standard
16356 The LyX server works through the use of a pair of named pipes.
16357  These are usually located in 
16358 \begin_inset Flex CharStyle:Code
16359 status collapsed
16360
16361 \begin_layout Plain Layout
16362 UserDir
16363 \end_layout
16364
16365 \end_inset
16366
16367  and have the names 
16368 \begin_inset Quotes eld
16369 \end_inset
16370
16371
16372 \begin_inset Flex CharStyle:Code
16373 status collapsed
16374
16375 \begin_layout Plain Layout
16376 .lyxpipe.in
16377 \end_layout
16378
16379 \end_inset
16380
16381
16382 \begin_inset Quotes erd
16383 \end_inset
16384
16385  and 
16386 \begin_inset Quotes eld
16387 \end_inset
16388
16389
16390 \begin_inset Flex CharStyle:Code
16391 status collapsed
16392
16393 \begin_layout Plain Layout
16394 .lyxpipe.out
16395 \end_layout
16396
16397 \end_inset
16398
16399
16400 \begin_inset Quotes erd
16401 \end_inset
16402
16403 .
16404  External programs write into 
16405 \begin_inset Flex CharStyle:Code
16406 status collapsed
16407
16408 \begin_layout Plain Layout
16409 .lyxpipe.in
16410 \end_layout
16411
16412 \end_inset
16413
16414  and read back data from 
16415 \begin_inset Flex CharStyle:Code
16416 status collapsed
16417
16418 \begin_layout Plain Layout
16419 .lyxpipe.out
16420 \end_layout
16421
16422 \end_inset
16423
16424 .
16425  The stem of the pipe names can be defined in the 
16426 \begin_inset Flex CharStyle:MenuItem
16427 status collapsed
16428
16429 \begin_layout Plain Layout
16430
16431 \bar under
16432 T
16433 \bar default
16434 ools\SpecialChar \menuseparator
16435
16436 \bar under
16437 P
16438 \bar default
16439 references
16440 \end_layout
16441
16442 \end_inset
16443
16444  dialog, for example 
16445 \begin_inset Flex CharStyle:Code
16446 status collapsed
16447
16448 \begin_layout Plain Layout
16449 "/home/myhome/.lyxpipe"
16450 \end_layout
16451
16452 \end_inset
16453
16454 .
16455 \end_layout
16456
16457 \begin_layout Standard
16458 LyX will add the '
16459 \begin_inset Flex CharStyle:Code
16460 status collapsed
16461
16462 \begin_layout Plain Layout
16463 .in
16464 \end_layout
16465
16466 \end_inset
16467
16468 ' and '
16469 \begin_inset Flex CharStyle:Code
16470 status collapsed
16471
16472 \begin_layout Plain Layout
16473 .out
16474 \end_layout
16475
16476 \end_inset
16477
16478 ' to create the pipes.
16479  The above setting also has the effect of activating the LyX server.
16480  If one of the pipes already exists, LyX will assume that another LyX process
16481  is already running and will not start the server.
16482  To have several LyX processes with servers at the same time, you have to
16483  change the configuration between the start of the programs.
16484 \end_layout
16485
16486 \begin_layout Standard
16487 If you are developing a client program, you might find it useful to enable
16488  debugging information from the LyX server.
16489  Do this by starting LyX as lyx -dbg lyxserver.
16490 \end_layout
16491
16492 \begin_layout Standard
16493 Warning: if LyX crashes, it may not manage to remove the pipes; in this
16494  case you must remove them manually.
16495  If LyX starts and the pipes exist already, it will not start any server.
16496 \end_layout
16497
16498 \begin_layout Standard
16499 Other than this, there are a few points to consider:
16500 \end_layout
16501
16502 \begin_layout Itemize
16503 Both server and clients must run on UNIX or OS/2 machines.
16504  Communications between LyX on UNIX and clients on OS/2 or vice versa is
16505  not possible right now.
16506 \end_layout
16507
16508 \begin_layout Itemize
16509 On OS/2, only one client can connect to LyXServer at a time.
16510 \end_layout
16511
16512 \begin_layout Itemize
16513 On OS/2, clients must open inpipe with 
16514 \begin_inset Flex CharStyle:Code
16515 status collapsed
16516
16517 \begin_layout Plain Layout
16518 O_WRONLY
16519 \end_layout
16520
16521 \end_inset
16522
16523
16524 \end_layout
16525
16526 \begin_layout Standard
16527 mode.
16528 \end_layout
16529
16530 \begin_layout Standard
16531 You can find a complete example client written in C in the source distribution
16532  as 
16533 \begin_inset Flex CharStyle:Code
16534 status collapsed
16535
16536 \begin_layout Plain Layout
16537 development/lyxserver/server_monitor.c
16538 \end_layout
16539
16540 \end_inset
16541
16542 .
16543 \end_layout
16544
16545 \begin_layout Section
16546 Normal communication
16547 \end_layout
16548
16549 \begin_layout Standard
16550 To issue a LyX call, the client writes a line of ASCII text into the input
16551  pipe.
16552  This line has the following format:
16553 \end_layout
16554
16555 \begin_layout Quote
16556 LYXCMD:
16557 \emph on
16558 clientname
16559 \emph default
16560 :
16561 \emph on
16562 function
16563 \emph default
16564 :
16565 \emph on
16566 argument
16567 \end_layout
16568
16569 \begin_layout Description
16570
16571 \emph on
16572 clientname
16573 \emph default
16574  is a name that the client can choose arbitrarily.
16575  Its only use is that LyX will echo it if it sends an answer---so a client
16576  can dispatch results from different requesters.
16577 \end_layout
16578
16579 \begin_layout Description
16580
16581 \emph on
16582 function
16583 \emph default
16584  is the function you want LyX to perform.
16585  It is the same as the commands you'd use in the minibuffer.
16586 \end_layout
16587
16588 \begin_layout Description
16589
16590 \emph on
16591 argument
16592 \emph default
16593  is an optional argument which is meaningful only to some functions (for
16594  instance 
16595 \begin_inset Quotes eld
16596 \end_inset
16597
16598 self-insert
16599 \begin_inset Quotes erd
16600 \end_inset
16601
16602  which will insert the argument as text at the cursor position.)
16603 \end_layout
16604
16605 \begin_layout Standard
16606 The answer from LyX will arrive in the output pipe and be of the form
16607 \end_layout
16608
16609 \begin_layout Quote
16610 INFO:
16611 \emph on
16612 clientname
16613 \emph default
16614 :
16615 \emph on
16616 function
16617 \emph default
16618 :
16619 \emph on
16620 data
16621 \end_layout
16622
16623 \begin_layout Standard
16624 where 
16625 \emph on
16626 clientname
16627 \emph default
16628  and 
16629 \emph on
16630 function
16631 \emph default
16632  are just echoed from the command request, while 
16633 \emph on
16634 data
16635 \emph default
16636  is more or less useful information filled according to how the command
16637  execution worked out.
16638  Some commands will return information about the internal state of LyX,
16639  such as 
16640 \begin_inset Quotes eld
16641 \end_inset
16642
16643 font-state
16644 \begin_inset Quotes erd
16645 \end_inset
16646
16647 , while other will return an empty data-response.
16648  This means that the command execution went fine.
16649 \end_layout
16650
16651 \begin_layout Standard
16652 In case of errors, the response from LyX will have this form
16653 \end_layout
16654
16655 \begin_layout Quote
16656 ERROR:
16657 \emph on
16658 clientname
16659 \emph default
16660 :
16661 \emph on
16662 function
16663 \emph default
16664 :
16665 \emph on
16666 error message
16667 \end_layout
16668
16669 \begin_layout Standard
16670 where the 
16671 \emph on
16672 error message
16673 \emph default
16674  should contain an explanation of why the command failed.
16675 \end_layout
16676
16677 \begin_layout Standard
16678 Examples:
16679 \end_layout
16680
16681 \begin_layout LyX-Code
16682 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
16683 \end_layout
16684
16685 \begin_layout LyX-Code
16686 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
16687 \begin_inset Newline newline
16688 \end_inset
16689
16690 read a <~/.lyxpipe.out
16691 \begin_inset Newline newline
16692 \end_inset
16693
16694 echo $a
16695 \end_layout
16696
16697 \begin_layout Section
16698 Notification
16699 \end_layout
16700
16701 \begin_layout Standard
16702 LyX can notify clients of events going on asynchronously.
16703  Currently it will only do this if the user binds a key sequence with the
16704  function 
16705 \begin_inset Quotes eld
16706 \end_inset
16707
16708 notify
16709 \begin_inset Quotes erd
16710 \end_inset
16711
16712 .
16713  The format of the string LyX sends is as follows:
16714 \end_layout
16715
16716 \begin_layout Quote
16717 \begin_inset Flex CharStyle:Code
16718 status collapsed
16719
16720 \begin_layout Plain Layout
16721 NOTIFY:
16722 \end_layout
16723
16724 \end_inset
16725
16726
16727 \emph on
16728 key-sequence
16729 \end_layout
16730
16731 \begin_layout Standard
16732 where 
16733 \emph on
16734 key-sequence
16735 \emph default
16736  is the printed representation of the key sequence that was actually typed
16737  by the user.
16738 \end_layout
16739
16740 \begin_layout Standard
16741 This mechanism can be used to extend LyX's command set and implement macros:
16742  bind some key sequence to 
16743 \begin_inset Quotes eld
16744 \end_inset
16745
16746 notify
16747 \begin_inset Quotes erd
16748 \end_inset
16749
16750 , start a client that listens on the out pipe, dispatches the command according
16751  to the sequence and starts a function that may use LyX calls and LyX requests
16752  to issue a command or a series of commands to LyX.
16753 \end_layout
16754
16755 \begin_layout Section
16756 The simple LyX Server Protocol
16757 \end_layout
16758
16759 \begin_layout Standard
16760 LyX implements a simple protocol that can be used for session management.
16761  All messages are of the form
16762 \end_layout
16763
16764 \begin_layout Quote
16765 LYXSRV:
16766 \emph on
16767 clientname
16768 \emph default
16769 :
16770 \emph on
16771 protocol message
16772 \end_layout
16773
16774 \begin_layout Standard
16775 where 
16776 \emph on
16777 protocol message
16778 \emph default
16779  can be 
16780 \begin_inset Quotes eld
16781 \end_inset
16782
16783 hello
16784 \begin_inset Quotes erd
16785 \end_inset
16786
16787  or 
16788 \begin_inset Quotes eld
16789 \end_inset
16790
16791 bye
16792 \begin_inset Quotes erd
16793 \end_inset
16794
16795 .
16796  If 
16797 \begin_inset Quotes eld
16798 \end_inset
16799
16800 hello
16801 \begin_inset Quotes erd
16802 \end_inset
16803
16804  is received from a client, LyX will report back to inform the client that
16805  it's listening to it's messages, while 
16806 \begin_inset Quotes eld
16807 \end_inset
16808
16809 bye
16810 \begin_inset Quotes erd
16811 \end_inset
16812
16813  sent from LyX will inform clients that LyX is closing.
16814 \end_layout
16815
16816 \end_body
16817 \end_document