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