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