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