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