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