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