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