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