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