]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
Insert explicit layout version number.
[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 
7190 \begin_inset Flex CharStyle:Code
7191 status collapsed
7192
7193 \begin_layout Plain Layout
7194 19
7195 \end_layout
7196
7197 \end_inset
7198
7199 .
7200  But LyX is capable of reading earlier formats, too, just as it is capable
7201  of reading files produced by earlier versions of LyX.
7202 \end_layout
7203
7204 \begin_layout Subsection
7205 General text class parameters
7206 \end_layout
7207
7208 \begin_layout Standard
7209 These are the general parameters which describe the form of the entire document:
7210 \end_layout
7211
7212 \begin_layout Description
7213 \begin_inset Flex CharStyle:Code
7214 status collapsed
7215
7216 \begin_layout Plain Layout
7217 AddToPreamble
7218 \end_layout
7219
7220 \end_inset
7221
7222  Adds information to the document preamble.
7223  Must end with 
7224 \begin_inset Quotes eld
7225 \end_inset
7226
7227
7228 \begin_inset Flex CharStyle:Code
7229 status collapsed
7230
7231 \begin_layout Plain Layout
7232 EndPreamble
7233 \end_layout
7234
7235 \end_inset
7236
7237
7238 \begin_inset Quotes erd
7239 \end_inset
7240
7241 .
7242 \end_layout
7243
7244 \begin_layout Description
7245 \begin_inset Flex CharStyle:Code
7246 status collapsed
7247
7248 \begin_layout Plain Layout
7249 ClassOptions
7250 \end_layout
7251
7252 \end_inset
7253
7254  Describes various global options supported by the document class.
7255  See Section
7256 \begin_inset space ~
7257 \end_inset
7258
7259
7260 \begin_inset CommandInset ref
7261 LatexCommand ref
7262 reference "sub:ClassOptions"
7263
7264 \end_inset
7265
7266  for a description.
7267  Must end with 
7268 \begin_inset Quotes eld
7269 \end_inset
7270
7271
7272 \begin_inset Flex CharStyle:Code
7273 status collapsed
7274
7275 \begin_layout Plain Layout
7276 End
7277 \end_layout
7278
7279 \end_inset
7280
7281
7282 \begin_inset Quotes erd
7283 \end_inset
7284
7285 .
7286 \end_layout
7287
7288 \begin_layout Description
7289 \begin_inset Flex CharStyle:Code
7290 status collapsed
7291
7292 \begin_layout Plain Layout
7293 Columns
7294 \end_layout
7295
7296 \end_inset
7297
7298  [
7299 \begin_inset Flex CharStyle:Code
7300 status collapsed
7301
7302 \begin_layout Plain Layout
7303
7304 \emph on
7305 1
7306 \end_layout
7307
7308 \end_inset
7309
7310
7311 \begin_inset Flex CharStyle:Code
7312 status collapsed
7313
7314 \begin_layout Plain Layout
7315 2
7316 \end_layout
7317
7318 \end_inset
7319
7320 ] Whether the class should 
7321 \emph on
7322 default
7323 \emph default
7324  to having one or two columns.
7325  Can be changed in the 
7326 \begin_inset Flex CharStyle:MenuItem
7327 status collapsed
7328
7329 \begin_layout Plain Layout
7330 Document\SpecialChar \menuseparator
7331 Settings
7332 \end_layout
7333
7334 \end_inset
7335
7336  dialog.
7337 \end_layout
7338
7339 \begin_layout Description
7340 \begin_inset Flex CharStyle:Code
7341 status collapsed
7342
7343 \begin_layout Plain Layout
7344 Counter
7345 \end_layout
7346
7347 \end_inset
7348
7349  [
7350 \begin_inset Flex CharStyle:Code
7351 status collapsed
7352
7353 \begin_layout Plain Layout
7354 string
7355 \end_layout
7356
7357 \end_inset
7358
7359 ] This sequence defines the properties for a counter.
7360  If the counter does not yet exist, it is created; if it does exist, it
7361  is modified.
7362  Must end with 
7363 \begin_inset Quotes eld
7364 \end_inset
7365
7366
7367 \begin_inset Flex CharStyle:Code
7368 status collapsed
7369
7370 \begin_layout Plain Layout
7371 End
7372 \end_layout
7373
7374 \end_inset
7375
7376
7377 \begin_inset Quotes erd
7378 \end_inset
7379
7380 .
7381 \begin_inset Newline newline
7382 \end_inset
7383
7384 See Section
7385 \begin_inset space ~
7386 \end_inset
7387
7388
7389 \begin_inset CommandInset ref
7390 LatexCommand ref
7391 reference "sub:Counters"
7392
7393 \end_inset
7394
7395  for details on counters.
7396 \end_layout
7397
7398 \begin_layout Description
7399 \begin_inset Flex CharStyle:Code
7400 status collapsed
7401
7402 \begin_layout Plain Layout
7403 DefaultFont
7404 \end_layout
7405
7406 \end_inset
7407
7408  Sets the default font used to display the document.
7409  See Section
7410 \begin_inset space ~
7411 \end_inset
7412
7413
7414 \begin_inset CommandInset ref
7415 LatexCommand ref
7416 reference "sub:Font-description"
7417
7418 \end_inset
7419
7420  for how to declare fonts.
7421  Must end with 
7422 \begin_inset Quotes eld
7423 \end_inset
7424
7425
7426 \begin_inset Flex CharStyle:Code
7427 status collapsed
7428
7429 \begin_layout Plain Layout
7430 EndFont
7431 \end_layout
7432
7433 \end_inset
7434
7435
7436 \begin_inset Quotes erd
7437 \end_inset
7438
7439 .
7440 \end_layout
7441
7442 \begin_layout Description
7443 \begin_inset Flex CharStyle:Code
7444 status collapsed
7445
7446 \begin_layout Plain Layout
7447 DefaultModule
7448 \end_layout
7449
7450 \end_inset
7451
7452  [
7453 \begin_inset Flex CharStyle:Code
7454 status collapsed
7455
7456 \begin_layout Plain Layout
7457 string]
7458 \end_layout
7459
7460 \end_inset
7461
7462  Specifies a module to be included by default with this document class.
7463  The module should be specified by filename without the 
7464 \begin_inset Flex CharStyle:Code
7465 status collapsed
7466
7467 \begin_layout Plain Layout
7468 .module
7469 \end_layout
7470
7471 \end_inset
7472
7473  extension.
7474  The user can still remove the module, but it will be active at the outset.
7475  (This applies only when new files are created, or when this class is chosen
7476  for an existing document.)
7477 \end_layout
7478
7479 \begin_layout Description
7480 \begin_inset Flex CharStyle:Code
7481 status collapsed
7482
7483 \begin_layout Plain Layout
7484 DefaultStyle
7485 \end_layout
7486
7487 \end_inset
7488
7489  [
7490 \begin_inset Flex CharStyle:Code
7491 status collapsed
7492
7493 \begin_layout Plain Layout
7494 string
7495 \end_layout
7496
7497 \end_inset
7498
7499 ] This is the style that will be assigned to new paragraphs, usually 
7500 \begin_inset Flex CharStyle:MenuItem
7501 status collapsed
7502
7503 \begin_layout Plain Layout
7504 Standard
7505 \end_layout
7506
7507 \end_inset
7508
7509 .
7510  This will default to the first defined style if not given, but you are
7511  encouraged to use this directive.
7512 \end_layout
7513
7514 \begin_layout Description
7515 \begin_inset Flex CharStyle:Code
7516 status collapsed
7517
7518 \begin_layout Plain Layout
7519 ExcludesModule
7520 \end_layout
7521
7522 \end_inset
7523
7524  [
7525 \begin_inset Flex CharStyle:Code
7526 status collapsed
7527
7528 \begin_layout Plain Layout
7529 string
7530 \end_layout
7531
7532 \end_inset
7533
7534 ] This tag indicates that the module in question—which should be specified
7535  by filename without the 
7536 \begin_inset Flex CharStyle:Code
7537 status collapsed
7538
7539 \begin_layout Plain Layout
7540 .module
7541 \end_layout
7542
7543 \end_inset
7544
7545  extension—cannot be used with this document class.
7546  This might be used in a journal-specific layout file to prevent, say, the
7547  use of the 
7548 \begin_inset Flex CharStyle:Code
7549 status collapsed
7550
7551 \begin_layout Plain Layout
7552 theorems-sec
7553 \end_layout
7554
7555 \end_inset
7556
7557  module that numbers theorems by section.
7558  This tag may 
7559 \emph on
7560 not
7561 \emph default
7562  be used in a module.
7563  Modules have their own way of excluding other modules (see 
7564 \begin_inset CommandInset ref
7565 LatexCommand ref
7566 reference "sub:Layout-modules"
7567
7568 \end_inset
7569
7570 ).
7571 \end_layout
7572
7573 \begin_layout Description
7574 \begin_inset Flex CharStyle:Code
7575 status collapsed
7576
7577 \begin_layout Plain Layout
7578 Float
7579 \end_layout
7580
7581 \end_inset
7582
7583  Defines a new float.
7584  See Section
7585 \begin_inset space ~
7586 \end_inset
7587
7588
7589 \begin_inset CommandInset ref
7590 LatexCommand ref
7591 reference "sub:Floats"
7592
7593 \end_inset
7594
7595  for details.
7596  Must end with 
7597 \begin_inset Quotes eld
7598 \end_inset
7599
7600
7601 \begin_inset Flex CharStyle:Code
7602 status collapsed
7603
7604 \begin_layout Plain Layout
7605 End
7606 \end_layout
7607
7608 \end_inset
7609
7610
7611 \begin_inset Quotes erd
7612 \end_inset
7613
7614 .
7615 \end_layout
7616
7617 \begin_layout Description
7618 \begin_inset Flex CharStyle:Code
7619 status collapsed
7620
7621 \begin_layout Plain Layout
7622 IfCounter
7623 \end_layout
7624
7625 \end_inset
7626
7627  [
7628 \begin_inset Flex CharStyle:Code
7629 status collapsed
7630
7631 \begin_layout Plain Layout
7632 string
7633 \end_layout
7634
7635 \end_inset
7636
7637 ] Modifies the properties of the given counter.
7638  If the counter does not exist, the section is ignored.
7639  Must end with 
7640 \begin_inset Quotes eld
7641 \end_inset
7642
7643
7644 \begin_inset Flex CharStyle:Code
7645 status collapsed
7646
7647 \begin_layout Plain Layout
7648 End
7649 \end_layout
7650
7651 \end_inset
7652
7653
7654 \begin_inset Quotes erd
7655 \end_inset
7656
7657 .
7658 \begin_inset Newline newline
7659 \end_inset
7660
7661 See Section
7662 \begin_inset space ~
7663 \end_inset
7664
7665
7666 \begin_inset CommandInset ref
7667 LatexCommand ref
7668 reference "sub:Counters"
7669
7670 \end_inset
7671
7672  for details on counters.
7673 \end_layout
7674
7675 \begin_layout Description
7676 \begin_inset Flex CharStyle:Code
7677 status collapsed
7678
7679 \begin_layout Plain Layout
7680 IfStyle
7681 \end_layout
7682
7683 \end_inset
7684
7685  [
7686 \begin_inset Flex CharStyle:Code
7687 status collapsed
7688
7689 \begin_layout Plain Layout
7690 string
7691 \end_layout
7692
7693 \end_inset
7694
7695 ] Modifies the properties of the given paragraph style.
7696  If the style does not exist, the section is ignored.
7697  Must end with 
7698 \begin_inset Quotes eld
7699 \end_inset
7700
7701
7702 \begin_inset Flex CharStyle:Code
7703 status collapsed
7704
7705 \begin_layout Plain Layout
7706 End
7707 \end_layout
7708
7709 \end_inset
7710
7711
7712 \begin_inset Quotes erd
7713 \end_inset
7714
7715 .
7716 \end_layout
7717
7718 \begin_layout Description
7719 \begin_inset Flex CharStyle:Code
7720 status collapsed
7721
7722 \begin_layout Plain Layout
7723 Input
7724 \end_layout
7725
7726 \end_inset
7727
7728  As its name implies, this command allows you to include another layout
7729  definition file within yours to avoid duplicating commands.
7730  Common examples are the standard layout files, for example, 
7731 \begin_inset Flex CharStyle:Code
7732 status collapsed
7733
7734 \begin_layout Plain Layout
7735 stdclass.inc
7736 \end_layout
7737
7738 \end_inset
7739
7740 , which contains most of the basic layouts.
7741 \end_layout
7742
7743 \begin_layout Description
7744 \begin_inset Flex CharStyle:Code
7745 status collapsed
7746
7747 \begin_layout Plain Layout
7748 InsetLayout
7749 \end_layout
7750
7751 \end_inset
7752
7753  This section (re-)defines the layout of an inset.
7754  It can be applied to an existing inset or to a new, user-defined inset,
7755  e.g., a new character style.
7756  Must end with 
7757 \begin_inset Quotes eld
7758 \end_inset
7759
7760
7761 \begin_inset Flex CharStyle:Code
7762 status collapsed
7763
7764 \begin_layout Plain Layout
7765 End
7766 \end_layout
7767
7768 \end_inset
7769
7770
7771 \begin_inset Quotes erd
7772 \end_inset
7773
7774 .
7775 \begin_inset Newline newline
7776 \end_inset
7777
7778 See Section
7779 \begin_inset space ~
7780 \end_inset
7781
7782
7783 \begin_inset CommandInset ref
7784 LatexCommand ref
7785 reference "sub:Flex-insets-and"
7786
7787 \end_inset
7788
7789  for more information.
7790  
7791 \end_layout
7792
7793 \begin_layout Description
7794 \begin_inset Flex CharStyle:Code
7795 status collapsed
7796
7797 \begin_layout Plain Layout
7798 LeftMargin
7799 \end_layout
7800
7801 \end_inset
7802
7803  [
7804 \begin_inset Flex CharStyle:Code
7805 status collapsed
7806
7807 \begin_layout Plain Layout
7808 string
7809 \end_layout
7810
7811 \end_inset
7812
7813 ] A string that indicates the width of the left margin on the screen, for
7814  example, 
7815 \begin_inset Quotes eld
7816 \end_inset
7817
7818 MMMMM
7819 \begin_inset Quotes erd
7820 \end_inset
7821
7822 .
7823  (Note that this is not a `length', like 
7824 \begin_inset Quotes eld
7825 \end_inset
7826
7827 2ex
7828 \begin_inset Quotes erd
7829 \end_inset
7830
7831 .)
7832 \end_layout
7833
7834 \begin_layout Description
7835 \begin_inset Flex CharStyle:Code
7836 status collapsed
7837
7838 \begin_layout Plain Layout
7839 NoFloat
7840 \end_layout
7841
7842 \end_inset
7843
7844  This command deletes an existing float.
7845  This is particularly useful when you want to suppress a float that has
7846  been defined in an input file.
7847 \end_layout
7848
7849 \begin_layout Description
7850 \begin_inset Flex CharStyle:Code
7851 status collapsed
7852
7853 \begin_layout Plain Layout
7854 NoStyle
7855 \end_layout
7856
7857 \end_inset
7858
7859  This command deletes an existing style.
7860  This is particularly useful when you want to suppress a style that has
7861  be defined in an input file.
7862 \end_layout
7863
7864 \begin_layout Description
7865 \begin_inset Flex CharStyle:Code
7866 status collapsed
7867
7868 \begin_layout Plain Layout
7869 OutputFormat
7870 \end_layout
7871
7872 \end_inset
7873
7874  A string indicating the file format (as defined in the Preferences dialog)
7875  produced by this class.
7876  It is mainly useful when 
7877 \begin_inset Flex CharStyle:Code
7878 status collapsed
7879
7880 \begin_layout Plain Layout
7881 OutputType
7882 \end_layout
7883
7884 \end_inset
7885
7886  is `literate' and one wants to define a new type of literate document.
7887  This string is reset to `docbook', `latex', or `literate' when the correspondin
7888
7889 \begin_inset Flex CharStyle:Code
7890 status collapsed
7891
7892 \begin_layout Plain Layout
7893 OutputType
7894 \end_layout
7895
7896 \end_inset
7897
7898  parameter is encountered.
7899 \end_layout
7900
7901 \begin_layout Description
7902 \begin_inset Flex CharStyle:Code
7903 status collapsed
7904
7905 \begin_layout Plain Layout
7906 OutputType
7907 \end_layout
7908
7909 \end_inset
7910
7911  A string indicating what sort of output documents using this class will
7912  produce.
7913  At present, the options are: `docbook', `latex', and `literate'.
7914 \end_layout
7915
7916 \begin_layout Description
7917 \begin_inset Flex CharStyle:Code
7918 status open
7919
7920 \begin_layout Plain Layout
7921 PageStyle
7922 \end_layout
7923
7924 \end_inset
7925
7926  [
7927 \emph on
7928
7929 \begin_inset Flex CharStyle:Code
7930 status collapsed
7931
7932 \begin_layout Plain Layout
7933
7934 \emph on
7935 plain
7936 \end_layout
7937
7938 \end_inset
7939
7940
7941 \emph default
7942
7943 \begin_inset Flex CharStyle:Code
7944 status collapsed
7945
7946 \begin_layout Plain Layout
7947 empty
7948 \end_layout
7949
7950 \end_inset
7951
7952
7953 \begin_inset Flex CharStyle:Code
7954 status collapsed
7955
7956 \begin_layout Plain Layout
7957 headings
7958 \end_layout
7959
7960 \end_inset
7961
7962 ] The default pagestyle.
7963  Can be changed in the 
7964 \begin_inset Flex CharStyle:MenuItem
7965 status collapsed
7966
7967 \begin_layout Plain Layout
7968 Document\SpecialChar \menuseparator
7969 Settings
7970 \end_layout
7971
7972 \end_inset
7973
7974  dialog.
7975 \end_layout
7976
7977 \begin_layout Description
7978 \begin_inset Flex CharStyle:Code
7979 status open
7980
7981 \begin_layout Plain Layout
7982 Preamble
7983 \end_layout
7984
7985 \end_inset
7986
7987  Sets the preamble for the LaTeX document.
7988  Note that this will completely override any prior 
7989 \begin_inset Flex CharStyle:Code
7990 status collapsed
7991
7992 \begin_layout Plain Layout
7993 Preamble
7994 \end_layout
7995
7996 \end_inset
7997
7998  or 
7999 \begin_inset Flex CharStyle:Code
8000 status collapsed
8001
8002 \begin_layout Plain Layout
8003 AddToPreamble
8004 \end_layout
8005
8006 \end_inset
8007
8008  declarations.
8009  (Use 
8010 \begin_inset Flex CharStyle:Code
8011 status collapsed
8012
8013 \begin_layout Plain Layout
8014 AddToPreamble
8015 \end_layout
8016
8017 \end_inset
8018
8019  if you just want to add material to the preamble.) Must end with 
8020 \begin_inset Quotes eld
8021 \end_inset
8022
8023
8024 \begin_inset Flex CharStyle:Code
8025 status collapsed
8026
8027 \begin_layout Plain Layout
8028 EndPreamble
8029 \end_layout
8030
8031 \end_inset
8032
8033
8034 \begin_inset Quotes erd
8035 \end_inset
8036
8037 .
8038 \end_layout
8039
8040 \begin_layout Description
8041 \begin_inset Flex CharStyle:Code
8042 status collapsed
8043
8044 \begin_layout Plain Layout
8045 Provides
8046 \end_layout
8047
8048 \end_inset
8049
8050  [
8051 \begin_inset Flex CharStyle:Code
8052 status collapsed
8053
8054 \begin_layout Plain Layout
8055 string
8056 \end_layout
8057
8058 \end_inset
8059
8060 ] [
8061 \begin_inset Flex CharStyle:Code
8062 status collapsed
8063
8064 \begin_layout Plain Layout
8065
8066 \emph on
8067 0
8068 \end_layout
8069
8070 \end_inset
8071
8072
8073 \begin_inset Flex CharStyle:Code
8074 status collapsed
8075
8076 \begin_layout Plain Layout
8077 1
8078 \end_layout
8079
8080 \end_inset
8081
8082 ] Whether the class already provides the feature 
8083 \begin_inset Flex CharStyle:Code
8084 status collapsed
8085
8086 \begin_layout Plain Layout
8087 string
8088 \end_layout
8089
8090 \end_inset
8091
8092 .
8093  A feature is in general the name of a package (
8094 \begin_inset Flex CharStyle:Code
8095 status collapsed
8096
8097 \begin_layout Plain Layout
8098 amsmath
8099 \end_layout
8100
8101 \end_inset
8102
8103
8104 \begin_inset Flex CharStyle:Code
8105 status collapsed
8106
8107 \begin_layout Plain Layout
8108 makeidx
8109 \end_layout
8110
8111 \end_inset
8112
8113 , \SpecialChar \ldots{}
8114 ) or a macro (
8115 \begin_inset Flex CharStyle:Code
8116 status collapsed
8117
8118 \begin_layout Plain Layout
8119 url
8120 \end_layout
8121
8122 \end_inset
8123
8124
8125 \begin_inset Flex CharStyle:Code
8126 status collapsed
8127
8128 \begin_layout Plain Layout
8129 boldsymbol
8130 \end_layout
8131
8132 \end_inset
8133
8134 ,\SpecialChar \ldots{}
8135 ); the complete list of supported features is unfortunately not documented
8136  outside the LyX source code—but see 
8137 \begin_inset Flex CharStyle:Code
8138 status collapsed
8139
8140 \begin_layout Plain Layout
8141 LaTeXFeatures.cpp
8142 \end_layout
8143
8144 \end_inset
8145
8146  if you're interested.
8147  
8148 \begin_inset Flex CharStyle:MenuItem
8149 status collapsed
8150
8151 \begin_layout Plain Layout
8152 Help\SpecialChar \menuseparator
8153 LaTeX Configuration
8154 \end_layout
8155
8156 \end_inset
8157
8158  also gives an overview of the supported packages.
8159 \end_layout
8160
8161 \begin_layout Description
8162 \begin_inset Flex CharStyle:Code
8163 status collapsed
8164
8165 \begin_layout Plain Layout
8166 ProvidesModule
8167 \end_layout
8168
8169 \end_inset
8170
8171  [
8172 \begin_inset Flex CharStyle:Code
8173 status collapsed
8174
8175 \begin_layout Plain Layout
8176 string
8177 \end_layout
8178
8179 \end_inset
8180
8181 ] Indicates that this layout provides the functionality of the module mentioned,
8182  which should be specified by the filename without the 
8183 \begin_inset Flex CharStyle:Code
8184 status collapsed
8185
8186 \begin_layout Plain Layout
8187 .module
8188 \end_layout
8189
8190 \end_inset
8191
8192  extension.
8193  This will typically be used if the layout includes the module directly,
8194  rather than using the 
8195 \begin_inset Flex CharStyle:Code
8196 status collapsed
8197
8198 \begin_layout Plain Layout
8199 DefaultModule
8200 \end_layout
8201
8202 \end_inset
8203
8204  tag to indicate that it ought to be used.
8205  It could also be used in a module that provided an alternate implementation
8206  of the same functionality.
8207 \end_layout
8208
8209 \begin_layout Description
8210 \begin_inset Flex CharStyle:Code
8211 status collapsed
8212
8213 \begin_layout Plain Layout
8214 Requires
8215 \end_layout
8216
8217 \end_inset
8218
8219  [
8220 \begin_inset Flex CharStyle:Code
8221 status collapsed
8222
8223 \begin_layout Plain Layout
8224 string
8225 \end_layout
8226
8227 \end_inset
8228
8229 ] Whether the class requires the feature 
8230 \begin_inset Flex CharStyle:Code
8231 status collapsed
8232
8233 \begin_layout Plain Layout
8234 string
8235 \end_layout
8236
8237 \end_inset
8238
8239 .
8240  Multiple features must be separated by commas.
8241  Note that you can only request supported features.
8242  (Again, see 
8243 \begin_inset Flex CharStyle:Code
8244 status collapsed
8245
8246 \begin_layout Plain Layout
8247 LaTeXFeatures.cpp
8248 \end_layout
8249
8250 \end_inset
8251
8252  for a list of these.)
8253 \end_layout
8254
8255 \begin_layout Description
8256 \begin_inset Flex CharStyle:Code
8257 status collapsed
8258
8259 \begin_layout Plain Layout
8260 RightMargin
8261 \end_layout
8262
8263 \end_inset
8264
8265  A string that indicates the width of the right margin on the screen, for
8266  example, 
8267 \begin_inset Quotes eld
8268 \end_inset
8269
8270 MMMMM
8271 \begin_inset Quotes erd
8272 \end_inset
8273
8274 .
8275 \end_layout
8276
8277 \begin_layout Description
8278 \begin_inset Flex CharStyle:Code
8279 status collapsed
8280
8281 \begin_layout Plain Layout
8282 SecNumDepth
8283 \end_layout
8284
8285 \end_inset
8286
8287  Sets which divisions get numbered.
8288  Corresponds to the 
8289 \begin_inset Flex CharStyle:Code
8290 status collapsed
8291
8292 \begin_layout Plain Layout
8293 secnumdepth
8294 \end_layout
8295
8296 \end_inset
8297
8298  counter in LaTeX.
8299 \end_layout
8300
8301 \begin_layout Description
8302 \begin_inset Flex CharStyle:Code
8303 status collapsed
8304
8305 \begin_layout Plain Layout
8306 Sides
8307 \end_layout
8308
8309 \end_inset
8310
8311  [
8312 \emph on
8313
8314 \begin_inset Flex CharStyle:Code
8315 status collapsed
8316
8317 \begin_layout Plain Layout
8318
8319 \emph on
8320 1
8321 \end_layout
8322
8323 \end_inset
8324
8325
8326 \emph default
8327
8328 \begin_inset Flex CharStyle:Code
8329 status collapsed
8330
8331 \begin_layout Plain Layout
8332 2
8333 \end_layout
8334
8335 \end_inset
8336
8337 ] Whether the class-default should be printing on one or both sides of the
8338  paper.
8339  Can be changed in the 
8340 \begin_inset Flex CharStyle:MenuItem
8341 status collapsed
8342
8343 \begin_layout Plain Layout
8344 Document\SpecialChar \menuseparator
8345 Settings
8346 \end_layout
8347
8348 \end_inset
8349
8350  dialog.
8351 \end_layout
8352
8353 \begin_layout Description
8354 \begin_inset Flex CharStyle:Code
8355 status collapsed
8356
8357 \begin_layout Plain Layout
8358 Style
8359 \end_layout
8360
8361 \end_inset
8362
8363  This sequence defines a paragraph style.
8364  If the style does not yet exist, it is created; if it does exist, its parameter
8365 s are modified.
8366  Must end with 
8367 \begin_inset Quotes eld
8368 \end_inset
8369
8370
8371 \begin_inset Flex CharStyle:Code
8372 status collapsed
8373
8374 \begin_layout Plain Layout
8375 End
8376 \end_layout
8377
8378 \end_inset
8379
8380
8381 \begin_inset Quotes erd
8382 \end_inset
8383
8384 .
8385 \begin_inset Newline newline
8386 \end_inset
8387
8388 See Section
8389 \begin_inset space ~
8390 \end_inset
8391
8392
8393 \begin_inset CommandInset ref
8394 LatexCommand ref
8395 reference "sub:Paragraph-Styles"
8396
8397 \end_inset
8398
8399  for details on paragraph styles.
8400 \end_layout
8401
8402 \begin_layout Description
8403 \begin_inset Flex CharStyle:Code
8404 status collapsed
8405
8406 \begin_layout Plain Layout
8407 TitleLatexName
8408 \end_layout
8409
8410 \end_inset
8411
8412  [
8413 \begin_inset Flex CharStyle:Code
8414 status collapsed
8415
8416 \begin_layout Plain Layout
8417 string="maketitle"
8418 \end_layout
8419
8420 \end_inset
8421
8422 ] The name of the command or environment to be used with 
8423 \begin_inset Flex CharStyle:Code
8424 status collapsed
8425
8426 \begin_layout Plain Layout
8427 TitleLatexType
8428 \end_layout
8429
8430 \end_inset
8431
8432 .
8433 \end_layout
8434
8435 \begin_layout Description
8436 \begin_inset Flex CharStyle:Code
8437 status collapsed
8438
8439 \begin_layout Plain Layout
8440 TitleLatexType
8441 \end_layout
8442
8443 \end_inset
8444
8445  [
8446 \begin_inset Flex CharStyle:Code
8447 status collapsed
8448
8449 \begin_layout Plain Layout
8450
8451 \emph on
8452 CommandAfter
8453 \end_layout
8454
8455 \end_inset
8456
8457
8458 \begin_inset Flex CharStyle:Code
8459 status collapsed
8460
8461 \begin_layout Plain Layout
8462 Environment
8463 \end_layout
8464
8465 \end_inset
8466
8467 ] Indicates what kind of markup is used to define the title of a document.
8468  
8469 \begin_inset Flex CharStyle:Code
8470 status collapsed
8471
8472 \begin_layout Plain Layout
8473 CommandAfter
8474 \end_layout
8475
8476 \end_inset
8477
8478  means that the macro with name 
8479 \begin_inset Flex CharStyle:Code
8480 status collapsed
8481
8482 \begin_layout Plain Layout
8483 TitleLatexName
8484 \end_layout
8485
8486 \end_inset
8487
8488  will be inserted after the last layout which has 
8489 \begin_inset Quotes eld
8490 \end_inset
8491
8492
8493 \begin_inset Flex CharStyle:Code
8494 status collapsed
8495
8496 \begin_layout Plain Layout
8497 InTitle 1
8498 \end_layout
8499
8500 \end_inset
8501
8502
8503 \begin_inset Quotes erd
8504 \end_inset
8505
8506 .
8507  
8508 \begin_inset Flex CharStyle:Code
8509 status collapsed
8510
8511 \begin_layout Plain Layout
8512 Environment
8513 \end_layout
8514
8515 \end_inset
8516
8517  corresponds to the case where the block of paragraphs which have 
8518 \begin_inset Quotes eld
8519 \end_inset
8520
8521
8522 \begin_inset Flex CharStyle:Code
8523 status collapsed
8524
8525 \begin_layout Plain Layout
8526 InTitle 1
8527 \end_layout
8528
8529 \end_inset
8530
8531
8532 \begin_inset Quotes erd
8533 \end_inset
8534
8535  should be enclosed into the 
8536 \begin_inset Flex CharStyle:Code
8537 status collapsed
8538
8539 \begin_layout Plain Layout
8540 TitleLatexName
8541 \end_layout
8542
8543 \end_inset
8544
8545  environment.
8546 \end_layout
8547
8548 \begin_layout Description
8549 \begin_inset Flex CharStyle:Code
8550 status collapsed
8551
8552 \begin_layout Plain Layout
8553 TocDepth
8554 \end_layout
8555
8556 \end_inset
8557
8558  Sets which divisions are included in the table of contents.
8559  Corresponds to the 
8560 \begin_inset Flex CharStyle:Code
8561 status collapsed
8562
8563 \begin_layout Plain Layout
8564 tocdepth
8565 \end_layout
8566
8567 \end_inset
8568
8569  counter in LaTeX.
8570 \end_layout
8571
8572 \begin_layout Subsection
8573 \begin_inset Flex CharStyle:Code
8574 status collapsed
8575
8576 \begin_layout Plain Layout
8577 ClassOptions
8578 \end_layout
8579
8580 \end_inset
8581
8582  section
8583 \begin_inset CommandInset label
8584 LatexCommand label
8585 name "sub:ClassOptions"
8586
8587 \end_inset
8588
8589
8590 \end_layout
8591
8592 \begin_layout Standard
8593 The 
8594 \begin_inset Flex CharStyle:Code
8595 status collapsed
8596
8597 \begin_layout Plain Layout
8598 ClassOptions
8599 \end_layout
8600
8601 \end_inset
8602
8603  section can contain the following entries:
8604 \end_layout
8605
8606 \begin_layout Description
8607 \begin_inset Flex CharStyle:Code
8608 status collapsed
8609
8610 \begin_layout Plain Layout
8611 FontSize
8612 \end_layout
8613
8614 \end_inset
8615
8616  [
8617 \begin_inset Flex CharStyle:Code
8618 status collapsed
8619
8620 \begin_layout Plain Layout
8621 string="10|11|12"
8622 \end_layout
8623
8624 \end_inset
8625
8626 ] The list of available font sizes for the document's main font, separated
8627  by 
8628 \begin_inset Quotes eld
8629 \end_inset
8630
8631
8632 \begin_inset Flex CharStyle:Code
8633 status collapsed
8634
8635 \begin_layout Plain Layout
8636 |
8637 \end_layout
8638
8639 \end_inset
8640
8641
8642 \begin_inset Quotes erd
8643 \end_inset
8644
8645 .
8646 \end_layout
8647
8648 \begin_layout Description
8649 \begin_inset Flex CharStyle:Code
8650 status collapsed
8651
8652 \begin_layout Plain Layout
8653 Header
8654 \end_layout
8655
8656 \end_inset
8657
8658  Used to set the DTD line with XML-based output classes.
8659  E.
8660 \begin_inset space \thinspace{}
8661 \end_inset
8662
8663 g.: PUBLIC 
8664 \begin_inset Quotes eld
8665 \end_inset
8666
8667 -//OASIS//DTD DocBook V4.2//EN
8668 \begin_inset Quotes erd
8669 \end_inset
8670
8671 .
8672 \end_layout
8673
8674 \begin_layout Description
8675 \begin_inset Flex CharStyle:Code
8676 status collapsed
8677
8678 \begin_layout Plain Layout
8679 PageStyle
8680 \end_layout
8681
8682 \end_inset
8683
8684  [
8685 \begin_inset Flex CharStyle:Code
8686 status collapsed
8687
8688 \begin_layout Plain Layout
8689 string="empty|plain|headings|fancy"
8690 \end_layout
8691
8692 \end_inset
8693
8694 ] The list of available page styles, separated by 
8695 \begin_inset Quotes eld
8696 \end_inset
8697
8698
8699 \begin_inset Flex CharStyle:Code
8700 status collapsed
8701
8702 \begin_layout Plain Layout
8703 |
8704 \end_layout
8705
8706 \end_inset
8707
8708
8709 \begin_inset Quotes erd
8710 \end_inset
8711
8712 .
8713 \end_layout
8714
8715 \begin_layout Description
8716 \begin_inset Flex CharStyle:Code
8717 status collapsed
8718
8719 \begin_layout Plain Layout
8720 Other
8721 \end_layout
8722
8723 \end_inset
8724
8725  [
8726 \begin_inset Flex CharStyle:Code
8727 status collapsed
8728
8729 \begin_layout Plain Layout
8730 string=""
8731 \end_layout
8732
8733 \end_inset
8734
8735 ] Some document class options, separated by a comma, that will be added
8736  to the optional part of the 
8737 \begin_inset Flex CharStyle:Code
8738 status collapsed
8739
8740 \begin_layout Plain Layout
8741
8742 \backslash
8743 documentclass
8744 \end_layout
8745
8746 \end_inset
8747
8748  command.
8749 \end_layout
8750
8751 \begin_layout Standard
8752 The 
8753 \begin_inset Flex CharStyle:Code
8754 status collapsed
8755
8756 \begin_layout Plain Layout
8757 ClassOptions
8758 \end_layout
8759
8760 \end_inset
8761
8762  section must end with 
8763 \begin_inset Quotes eld
8764 \end_inset
8765
8766
8767 \begin_inset Flex CharStyle:Code
8768 status collapsed
8769
8770 \begin_layout Plain Layout
8771 End
8772 \end_layout
8773
8774 \end_inset
8775
8776
8777 \begin_inset Quotes erd
8778 \end_inset
8779
8780 .
8781 \end_layout
8782
8783 \begin_layout Subsection
8784 Paragraph Styles
8785 \begin_inset CommandInset label
8786 LatexCommand label
8787 name "sub:Paragraph-Styles"
8788
8789 \end_inset
8790
8791
8792 \end_layout
8793
8794 \begin_layout Standard
8795 A paragraph style description looks like this:
8796 \begin_inset Foot
8797 status collapsed
8798
8799 \begin_layout Plain Layout
8800 Note that this will either define a new layout or modify an existing one.
8801 \end_layout
8802
8803 \end_inset
8804
8805
8806 \end_layout
8807
8808 \begin_layout LyX-Code
8809 Style 
8810 \family roman
8811 \emph on
8812 name
8813 \end_layout
8814
8815 \begin_layout LyX-Code
8816  ...
8817 \end_layout
8818
8819 \begin_layout LyX-Code
8820 End
8821 \end_layout
8822
8823 \begin_layout Standard
8824 where the following commands are allowed:
8825 \end_layout
8826
8827 \begin_layout Description
8828 \begin_inset Flex CharStyle:Code
8829 status collapsed
8830
8831 \begin_layout Plain Layout
8832 Align
8833 \end_layout
8834
8835 \end_inset
8836
8837  [
8838 \begin_inset Flex CharStyle:Code
8839 status collapsed
8840
8841 \begin_layout Plain Layout
8842
8843 \emph on
8844 block
8845 \emph default
8846 , left, right, center
8847 \end_layout
8848
8849 \end_inset
8850
8851 ] Paragraph alignment.
8852 \end_layout
8853
8854 \begin_layout Description
8855 \begin_inset Flex CharStyle:Code
8856 status collapsed
8857
8858 \begin_layout Plain Layout
8859 AlignPossible
8860 \end_layout
8861
8862 \end_inset
8863
8864  [
8865 \begin_inset Flex CharStyle:Code
8866 status collapsed
8867
8868 \begin_layout Plain Layout
8869
8870 \emph on
8871 block
8872 \emph default
8873 , left, right, center
8874 \end_layout
8875
8876 \end_inset
8877
8878 ] A comma separated list of permitted alignments.
8879  (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8880  sense.
8881  For example a right-aligned or centered enumeration isn't possible.)
8882 \end_layout
8883
8884 \begin_layout Description
8885 \begin_inset Flex CharStyle:Code
8886 status collapsed
8887
8888 \begin_layout Plain Layout
8889 BabelPreamble
8890 \end_layout
8891
8892 \end_inset
8893
8894  Language dependent information to be included in the LaTeX preamble when
8895  this style is used.
8896  Note that this will completely override any prior 
8897 \begin_inset Flex CharStyle:Code
8898 status collapsed
8899
8900 \begin_layout Plain Layout
8901 BabelPreamble
8902 \end_layout
8903
8904 \end_inset
8905
8906  declarations.
8907  Must end with 
8908 \begin_inset Quotes eld
8909 \end_inset
8910
8911
8912 \begin_inset Flex CharStyle:Code
8913 status collapsed
8914
8915 \begin_layout Plain Layout
8916 EndBabelPreamble
8917 \end_layout
8918
8919 \end_inset
8920
8921
8922 \begin_inset Quotes erd
8923 \end_inset
8924
8925 .
8926  The contents of this tag will occur once in the LaTeX preamble for each
8927  language used by the document.
8928  Each time, the following substitutions are made:
8929 \end_layout
8930
8931 \begin_deeper
8932 \begin_layout Itemize
8933 \begin_inset Flex CharStyle:Code
8934 status collapsed
8935
8936 \begin_layout Plain Layout
8937 $$lang
8938 \end_layout
8939
8940 \end_inset
8941
8942  is replaced by the language name (as used by the babel package).
8943 \end_layout
8944
8945 \begin_layout Itemize
8946 The 
8947 \begin_inset Quotes eld
8948 \end_inset
8949
8950 Function
8951 \begin_inset Quotes erd
8952 \end_inset
8953
8954  
8955 \begin_inset Flex CharStyle:Code
8956 status collapsed
8957
8958 \begin_layout Plain Layout
8959 _()
8960 \end_layout
8961
8962 \end_inset
8963
8964  replaces its argument by the translation of the argument to the current
8965  language.
8966 \end_layout
8967
8968 \begin_layout Standard
8969 This preamble snippet will only be used if the document contains more than
8970  one language and the babel package is used.
8971 \end_layout
8972
8973 \end_deeper
8974 \begin_layout Description
8975 \begin_inset Flex CharStyle:Code
8976 status collapsed
8977
8978 \begin_layout Plain Layout
8979 BottomSep
8980 \end_layout
8981
8982 \end_inset
8983
8984  [
8985 \begin_inset Flex CharStyle:Code
8986 status collapsed
8987
8988 \begin_layout Plain Layout
8989 float=0
8990 \end_layout
8991
8992 \end_inset
8993
8994 ]
8995 \begin_inset Foot
8996 status collapsed
8997
8998 \begin_layout Plain Layout
8999 Note that a `float' here is a real number, such as: 1.5.
9000 \end_layout
9001
9002 \end_inset
9003
9004  The vertical space with which the last of a chain of paragraphs with this
9005  layout is separated from the following paragraph.
9006  If the next paragraph has another layout, the separations are not simply
9007  added, but the maximum is taken.
9008 \end_layout
9009
9010 \begin_layout Description
9011 \begin_inset Flex CharStyle:Code
9012 status collapsed
9013
9014 \begin_layout Plain Layout
9015 Category
9016 \end_layout
9017
9018 \end_inset
9019
9020  
9021 \begin_inset Flex CharStyle:Code
9022 status collapsed
9023
9024 \begin_layout Plain Layout
9025 [string]
9026 \end_layout
9027
9028 \end_inset
9029
9030  The category for this style.
9031  This is used to group related styles in the Layout combobox on the toolbar.
9032  Any string can be used, but you may want to use existing categories with
9033  your own styles.
9034  
9035 \end_layout
9036
9037 \begin_layout Description
9038 \begin_inset Flex CharStyle:Code
9039 status collapsed
9040
9041 \begin_layout Plain Layout
9042 CommandDepth
9043 \end_layout
9044
9045 \end_inset
9046
9047  Depth of XML command.
9048  Used only with XML-type formats.
9049 \end_layout
9050
9051 \begin_layout Description
9052 \begin_inset Flex CharStyle:Code
9053 status collapsed
9054
9055 \begin_layout Plain Layout
9056 CopyStyle
9057 \end_layout
9058
9059 \end_inset
9060
9061  
9062 \begin_inset CommandInset label
9063 LatexCommand label
9064 name "des:CopyStyle"
9065
9066 \end_inset
9067
9068
9069 \begin_inset Flex CharStyle:Code
9070 status collapsed
9071
9072 \begin_layout Plain Layout
9073 [string]
9074 \end_layout
9075
9076 \end_inset
9077
9078  Copies all the features of an existing style into the current one.
9079  
9080 \end_layout
9081
9082 \begin_layout Description
9083 \begin_inset Flex CharStyle:Code
9084 status collapsed
9085
9086 \begin_layout Plain Layout
9087 DependsOn
9088 \end_layout
9089
9090 \end_inset
9091
9092  The name of a style whose preamble should be output 
9093 \emph on
9094 before
9095 \emph default
9096  this one.
9097  This allows to ensure some ordering of the preamble snippets when macros
9098  definitions depend on one another.
9099 \begin_inset Foot
9100 status collapsed
9101
9102 \begin_layout Plain Layout
9103 Note that, besides that functionality, there is no way to ensure any ordering
9104  of preambles.
9105  The ordering that you see in a given version of LyX may change without
9106  warning in later versions.
9107 \end_layout
9108
9109 \end_inset
9110
9111
9112 \end_layout
9113
9114 \begin_layout Description
9115 \begin_inset Flex CharStyle:Code
9116 status collapsed
9117
9118 \begin_layout Plain Layout
9119 EndLabeltype
9120 \end_layout
9121
9122 \end_inset
9123
9124  [
9125 \begin_inset Flex CharStyle:Code
9126 status collapsed
9127
9128 \begin_layout Plain Layout
9129
9130 \emph on
9131 No_Label
9132 \emph default
9133 , Box, Filled_Box, Static
9134 \end_layout
9135
9136 \end_inset
9137
9138 ] The type of label that stands at the end of the paragraph (or sequence
9139  of paragraphs if 
9140 \begin_inset Flex CharStyle:Code
9141 status collapsed
9142
9143 \begin_layout Plain Layout
9144 LatexType
9145 \end_layout
9146
9147 \end_inset
9148
9149  is 
9150 \begin_inset Flex CharStyle:Code
9151 status collapsed
9152
9153 \begin_layout Plain Layout
9154 Environment
9155 \end_layout
9156
9157 \end_inset
9158
9159
9160 \begin_inset Flex CharStyle:Code
9161 status collapsed
9162
9163 \begin_layout Plain Layout
9164 Item_Environment
9165 \end_layout
9166
9167 \end_inset
9168
9169  or 
9170 \begin_inset Flex CharStyle:Code
9171 status collapsed
9172
9173 \begin_layout Plain Layout
9174 List_Environment
9175 \end_layout
9176
9177 \end_inset
9178
9179 ).
9180  
9181 \begin_inset Flex CharStyle:Code
9182 status collapsed
9183
9184 \begin_layout Plain Layout
9185 No_Label
9186 \end_layout
9187
9188 \end_inset
9189
9190  means 
9191 \begin_inset Quotes eld
9192 \end_inset
9193
9194 nothing
9195 \begin_inset Quotes erd
9196 \end_inset
9197
9198
9199 \begin_inset Flex CharStyle:Code
9200 status collapsed
9201
9202 \begin_layout Plain Layout
9203 Box
9204 \end_layout
9205
9206 \end_inset
9207
9208  (resp.
9209 \begin_inset Flex CharStyle:Code
9210 status collapsed
9211
9212 \begin_layout Plain Layout
9213 \begin_inset space ~
9214 \end_inset
9215
9216 Filled_Box
9217 \end_layout
9218
9219 \end_inset
9220
9221 ) is a white (resp.
9222 \begin_inset space ~
9223 \end_inset
9224
9225 black) square suitable for end of proof markers, 
9226 \begin_inset Flex CharStyle:Code
9227 status collapsed
9228
9229 \begin_layout Plain Layout
9230 Static
9231 \end_layout
9232
9233 \end_inset
9234
9235  is an explicit text string.
9236 \end_layout
9237
9238 \begin_layout Description
9239 \begin_inset Flex CharStyle:Code
9240 status collapsed
9241
9242 \begin_layout Plain Layout
9243 EndLabelString
9244 \end_layout
9245
9246 \end_inset
9247
9248  [
9249 \begin_inset Flex CharStyle:Code
9250 status collapsed
9251
9252 \begin_layout Plain Layout
9253 string=""
9254 \end_layout
9255
9256 \end_inset
9257
9258 ] The string used for a label with a 
9259 \begin_inset Flex CharStyle:Code
9260 status collapsed
9261
9262 \begin_layout Plain Layout
9263 Static
9264 \end_layout
9265
9266 \end_inset
9267
9268  
9269 \begin_inset Flex CharStyle:Code
9270 status collapsed
9271
9272 \begin_layout Plain Layout
9273 EndLabelType
9274 \end_layout
9275
9276 \end_inset
9277
9278 .
9279  
9280 \end_layout
9281
9282 \begin_layout Description
9283 \begin_inset Flex CharStyle:Code
9284 status collapsed
9285
9286 \begin_layout Plain Layout
9287 Fill_Bottom
9288 \end_layout
9289
9290 \end_inset
9291
9292  [
9293 \begin_inset Flex CharStyle:Code
9294 status collapsed
9295
9296 \begin_layout Plain Layout
9297
9298 \emph on
9299 0
9300 \emph default
9301 ,1
9302 \end_layout
9303
9304 \end_inset
9305
9306 ] Similar to 
9307 \begin_inset Flex CharStyle:Code
9308 status collapsed
9309
9310 \begin_layout Plain Layout
9311 Fill_Top
9312 \end_layout
9313
9314 \end_inset
9315
9316 .
9317 \end_layout
9318
9319 \begin_layout Description
9320 \begin_inset Flex CharStyle:Code
9321 status collapsed
9322
9323 \begin_layout Plain Layout
9324 Fill_Top
9325 \end_layout
9326
9327 \end_inset
9328
9329  [
9330 \begin_inset Flex CharStyle:Code
9331 status collapsed
9332
9333 \begin_layout Plain Layout
9334
9335 \emph on
9336 0
9337 \emph default
9338 ,1
9339 \end_layout
9340
9341 \end_inset
9342
9343 ] With this parameter the 
9344 \begin_inset Flex CharStyle:MenuItem
9345 status collapsed
9346
9347 \begin_layout Plain Layout
9348 Fill
9349 \end_layout
9350
9351 \end_inset
9352
9353  value of the 
9354 \begin_inset Quotes eld
9355 \end_inset
9356
9357 Vertical space above
9358 \begin_inset Quotes erd
9359 \end_inset
9360
9361  list of the 
9362 \begin_inset Flex CharStyle:MenuItem
9363 status collapsed
9364
9365 \begin_layout Plain Layout
9366 Edit\SpecialChar \menuseparator
9367 Paragraph
9368 \begin_inset space ~
9369 \end_inset
9370
9371 Settings
9372 \end_layout
9373
9374 \end_inset
9375
9376  dialog can be set when initializing a paragraph with this style.
9377 \begin_inset Foot
9378 status collapsed
9379
9380 \begin_layout Plain Layout
9381
9382 \emph on
9383 Note from Jean-Marc:
9384 \emph default
9385  I'm not sure that this setting has much use, and it should probably be
9386  removed in later versions.
9387 \end_layout
9388
9389 \end_inset
9390
9391  
9392 \end_layout
9393
9394 \begin_layout Description
9395 \begin_inset Flex CharStyle:Code
9396 status collapsed
9397
9398 \begin_layout Plain Layout
9399 Font
9400 \end_layout
9401
9402 \end_inset
9403
9404  The font used for both the text body 
9405 \emph on
9406 and
9407 \emph default
9408  the label.
9409  See section
9410 \begin_inset space ~
9411 \end_inset
9412
9413
9414 \begin_inset CommandInset ref
9415 LatexCommand ref
9416 reference "sub:Font-description"
9417
9418 \end_inset
9419
9420 .
9421  Note that defining this font automatically defines the 
9422 \begin_inset Flex CharStyle:Code
9423 status collapsed
9424
9425 \begin_layout Plain Layout
9426 LabelFont
9427 \end_layout
9428
9429 \end_inset
9430
9431  to the same value.
9432  So you should define this one first if you also want to define 
9433 \begin_inset Flex CharStyle:Code
9434 status collapsed
9435
9436 \begin_layout Plain Layout
9437 LabelFont
9438 \end_layout
9439
9440 \end_inset
9441
9442 .
9443 \end_layout
9444
9445 \begin_layout Description
9446 \begin_inset Flex CharStyle:Code
9447 status collapsed
9448
9449 \begin_layout Plain Layout
9450 FreeSpacing
9451 \end_layout
9452
9453 \end_inset
9454
9455  
9456 \begin_inset CommandInset label
9457 LatexCommand label
9458 name "des:FreeSpacing"
9459
9460 \end_inset
9461
9462 [
9463 \emph on
9464
9465 \begin_inset Flex CharStyle:Code
9466 status collapsed
9467
9468 \begin_layout Plain Layout
9469
9470 \emph on
9471 0
9472 \end_layout
9473
9474 \end_inset
9475
9476
9477 \emph default
9478
9479 \begin_inset Flex CharStyle:Code
9480 status collapsed
9481
9482 \begin_layout Plain Layout
9483 1
9484 \end_layout
9485
9486 \end_inset
9487
9488 ] Usually LyX doesn't allow you to insert more than one space between words,
9489  since a space is considered as the separation between two words, not a
9490  character or symbol of its own.
9491  This is a very fine thing but sometimes annoying, for example, when typing
9492  program code or plain LaTeX code.
9493  For this reason, 
9494 \begin_inset Flex CharStyle:Code
9495 status collapsed
9496
9497 \begin_layout Plain Layout
9498 FreeSpacing
9499 \end_layout
9500
9501 \end_inset
9502
9503  can be enabled.
9504  Note that LyX will create protected blanks for the additional blanks when
9505  in another mode than LaTeX-mode.
9506 \end_layout
9507
9508 \begin_layout Description
9509 \begin_inset Flex CharStyle:Code
9510 status collapsed
9511
9512 \begin_layout Plain Layout
9513 InnerTag
9514 \end_layout
9515
9516 \end_inset
9517
9518  [[FIXME]] (Used only with XML-type formats.)
9519 \end_layout
9520
9521 \begin_layout Description
9522 \begin_inset Flex CharStyle:Code
9523 status collapsed
9524
9525 \begin_layout Plain Layout
9526 InPreamble
9527 \end_layout
9528
9529 \end_inset
9530
9531  
9532 \begin_inset Flex CharStyle:Code
9533 status collapsed
9534
9535 \begin_layout Plain Layout
9536 [1, 0]
9537 \end_layout
9538
9539 \end_inset
9540
9541  If 1, marks the layout as to be included in the document preamble rather
9542  than in the document body.
9543  This is useful for document classes that want such information as the title
9544  and author to appear in the preamble.
9545 \end_layout
9546
9547 \begin_layout Description
9548 \begin_inset Flex CharStyle:Code
9549 status collapsed
9550
9551 \begin_layout Plain Layout
9552 InTitle
9553 \end_layout
9554
9555 \end_inset
9556
9557  
9558 \begin_inset Flex CharStyle:Code
9559 status collapsed
9560
9561 \begin_layout Plain Layout
9562 [1, 0]
9563 \end_layout
9564
9565 \end_inset
9566
9567  If 1, marks the layout as being part of a title block (see also the 
9568 \begin_inset Flex CharStyle:Code
9569 status collapsed
9570
9571 \begin_layout Plain Layout
9572 TitleLatexType
9573 \end_layout
9574
9575 \end_inset
9576
9577  and 
9578 \begin_inset Flex CharStyle:Code
9579 status collapsed
9580
9581 \begin_layout Plain Layout
9582 TitleLatexName
9583 \end_layout
9584
9585 \end_inset
9586
9587  global entries).
9588 \end_layout
9589
9590 \begin_layout Description
9591 \begin_inset Flex CharStyle:Code
9592 status collapsed
9593
9594 \begin_layout Plain Layout
9595 ItemSep
9596 \end_layout
9597
9598 \end_inset
9599
9600  [
9601 \begin_inset Flex CharStyle:Code
9602 status collapsed
9603
9604 \begin_layout Plain Layout
9605 float=0
9606 \end_layout
9607
9608 \end_inset
9609
9610 ] This provides extra space between paragraphs that have the same layout.
9611  If you put other layouts into an environment, each is separated with the
9612  environment's 
9613 \begin_inset Flex CharStyle:Code
9614 status collapsed
9615
9616 \begin_layout Plain Layout
9617 Parsep
9618 \end_layout
9619
9620 \end_inset
9621
9622 .
9623  But the whole items of the environment are additionally separated with
9624  this 
9625 \begin_inset Flex CharStyle:Code
9626 status collapsed
9627
9628 \begin_layout Plain Layout
9629 Itemsep
9630 \end_layout
9631
9632 \end_inset
9633
9634 .
9635  Note that this is a
9636 \emph on
9637  multiplier.
9638 \end_layout
9639
9640 \begin_layout Description
9641 \begin_inset Flex CharStyle:Code
9642 status collapsed
9643
9644 \begin_layout Plain Layout
9645 ItemTag
9646 \end_layout
9647
9648 \end_inset
9649
9650  [[FIXME]] (Used only with XML-type formats.)
9651 \end_layout
9652
9653 \begin_layout Description
9654 \begin_inset Flex CharStyle:Code
9655 status collapsed
9656
9657 \begin_layout Plain Layout
9658 KeepEmpty
9659 \end_layout
9660
9661 \end_inset
9662
9663  
9664 \begin_inset CommandInset label
9665 LatexCommand label
9666 name "des:KeepEmpty"
9667
9668 \end_inset
9669
9670 [
9671 \emph on
9672
9673 \begin_inset Flex CharStyle:Code
9674 status collapsed
9675
9676 \begin_layout Plain Layout
9677
9678 \emph on
9679 0
9680 \end_layout
9681
9682 \end_inset
9683
9684
9685 \emph default
9686
9687 \begin_inset Flex CharStyle:Code
9688 status collapsed
9689
9690 \begin_layout Plain Layout
9691 1
9692 \end_layout
9693
9694 \end_inset
9695
9696 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9697  lead to empty LaTeX output.
9698  There are some cases where this could be desirable however: in a letter
9699  template, the required fields can be provided as empty fields, so that
9700  people do not forget them; in some special classes, a layout can be used
9701  as some kind of break, which does not contain actual text.
9702 \end_layout
9703
9704 \begin_layout Description
9705 \begin_inset Flex CharStyle:Code
9706 status collapsed
9707
9708 \begin_layout Plain Layout
9709 LabelBottomsep
9710 \end_layout
9711
9712 \end_inset
9713
9714  [float=0] The vertical space between the label and the text body.
9715  Only used for labels that are above the text body (
9716 \begin_inset Flex CharStyle:Code
9717 status collapsed
9718
9719 \begin_layout Plain Layout
9720 Top_Environment
9721 \end_layout
9722
9723 \end_inset
9724
9725
9726 \begin_inset Flex CharStyle:Code
9727 status collapsed
9728
9729 \begin_layout Plain Layout
9730 Centered_Top_Environment
9731 \end_layout
9732
9733 \end_inset
9734
9735 ).
9736 \end_layout
9737
9738 \begin_layout Description
9739 \begin_inset Flex CharStyle:Code
9740 status collapsed
9741
9742 \begin_layout Plain Layout
9743 LabelCounter
9744 \end_layout
9745
9746 \end_inset
9747
9748  [
9749 \begin_inset Flex CharStyle:Code
9750 status collapsed
9751
9752 \begin_layout Plain Layout
9753 string=""
9754 \end_layout
9755
9756 \end_inset
9757
9758 ]
9759 \begin_inset Newline newline
9760 \end_inset
9761
9762 The name of the counter for automatic numbering.
9763  
9764 \begin_inset Newline newline
9765 \end_inset
9766
9767 This 
9768 \emph on
9769 must
9770 \emph default
9771  be given if 
9772 \begin_inset Flex CharStyle:Code
9773 status collapsed
9774
9775 \begin_layout Plain Layout
9776 LabelType
9777 \end_layout
9778
9779 \end_inset
9780
9781  is 
9782 \begin_inset Flex CharStyle:Code
9783 status collapsed
9784
9785 \begin_layout Plain Layout
9786 Counter
9787 \end_layout
9788
9789 \end_inset
9790
9791 .
9792  In that case, the counter will be stepped each time the layout appears.
9793  
9794 \begin_inset Newline newline
9795 \end_inset
9796
9797 This 
9798 \emph on
9799 may
9800 \emph default
9801  also be given if 
9802 \begin_inset Flex CharStyle:Code
9803 status collapsed
9804
9805 \begin_layout Plain Layout
9806 LabelType
9807 \end_layout
9808
9809 \end_inset
9810
9811  is 
9812 \begin_inset Flex CharStyle:Code
9813 status collapsed
9814
9815 \begin_layout Plain Layout
9816 Enumerate
9817 \end_layout
9818
9819 \end_inset
9820
9821 , though this case is a bit complicated.
9822  Suppose you declare 
9823 \begin_inset Quotes eld
9824 \end_inset
9825
9826
9827 \begin_inset Flex CharStyle:Code
9828 status collapsed
9829
9830 \begin_layout Plain Layout
9831 LabelCounter myenum
9832 \end_layout
9833
9834 \end_inset
9835
9836
9837 \begin_inset Quotes erd
9838 \end_inset
9839
9840 .
9841  Then the actual counters used are 
9842 \begin_inset Flex CharStyle:Code
9843 status collapsed
9844
9845 \begin_layout Plain Layout
9846 myenumi
9847 \end_layout
9848
9849 \end_inset
9850
9851
9852 \begin_inset Flex CharStyle:Code
9853 status collapsed
9854
9855 \begin_layout Plain Layout
9856 myenumii
9857 \end_layout
9858
9859 \end_inset
9860
9861
9862 \begin_inset Flex CharStyle:Code
9863 status collapsed
9864
9865 \begin_layout Plain Layout
9866 myenumiii
9867 \end_layout
9868
9869 \end_inset
9870
9871 , and 
9872 \begin_inset Flex CharStyle:Code
9873 status collapsed
9874
9875 \begin_layout Plain Layout
9876 myenumiv
9877 \end_layout
9878
9879 \end_inset
9880
9881 , much as in LaTeX.
9882  These counters must all be declared separately.
9883 \begin_inset Newline newline
9884 \end_inset
9885
9886 See Section 
9887 \begin_inset CommandInset ref
9888 LatexCommand ref
9889 reference "sub:Counters"
9890
9891 \end_inset
9892
9893  for details on counters.
9894 \end_layout
9895
9896 \begin_layout Description
9897 \begin_inset Flex CharStyle:Code
9898 status collapsed
9899
9900 \begin_layout Plain Layout
9901 LabelFont
9902 \end_layout
9903
9904 \end_inset
9905
9906  The font used for the label.
9907  See section
9908 \begin_inset space ~
9909 \end_inset
9910
9911
9912 \begin_inset CommandInset ref
9913 LatexCommand ref
9914 reference "sub:Font-description"
9915
9916 \end_inset
9917
9918 .
9919 \end_layout
9920
9921 \begin_layout Description
9922 \begin_inset Flex CharStyle:Code
9923 status collapsed
9924
9925 \begin_layout Plain Layout
9926 LabelIndent
9927 \end_layout
9928
9929 \end_inset
9930
9931  Text that indicates how far a label should be indented.
9932 \end_layout
9933
9934 \begin_layout Description
9935 \begin_inset Flex CharStyle:Code
9936 status collapsed
9937
9938 \begin_layout Plain Layout
9939 Labelsep
9940 \end_layout
9941
9942 \end_inset
9943
9944  [
9945 \begin_inset Flex CharStyle:Code
9946 status collapsed
9947
9948 \begin_layout Plain Layout
9949 string=""
9950 \end_layout
9951
9952 \end_inset
9953
9954 ] The horizontal space between the label and the text body.
9955  Only used for labels that are not above the text body.
9956 \end_layout
9957
9958 \begin_layout Description
9959 \begin_inset Flex CharStyle:Code
9960 status collapsed
9961
9962 \begin_layout Plain Layout
9963 LabelString
9964 \end_layout
9965
9966 \end_inset
9967
9968  [
9969 \begin_inset Flex CharStyle:Code
9970 status collapsed
9971
9972 \begin_layout Plain Layout
9973 string=""
9974 \end_layout
9975
9976 \end_inset
9977
9978 ] The string used for a label with a 
9979 \begin_inset Flex CharStyle:Code
9980 status collapsed
9981
9982 \begin_layout Plain Layout
9983 Static
9984 \end_layout
9985
9986 \end_inset
9987
9988  labeltype.
9989  When 
9990 \begin_inset Flex CharStyle:Code
9991 status collapsed
9992
9993 \begin_layout Plain Layout
9994 LabelCounter
9995 \end_layout
9996
9997 \end_inset
9998
9999  is set, this string can be contain the special formatting commands described
10000  in Section 
10001 \begin_inset CommandInset ref
10002 LatexCommand ref
10003 reference "sub:Counters"
10004
10005 \end_inset
10006
10007 .
10008 \begin_inset Foot
10009 status collapsed
10010
10011 \begin_layout Plain Layout
10012 For the sake of backwards compatibility, the string 
10013 \begin_inset Flex CharStyle:Code
10014 status collapsed
10015
10016 \begin_layout Plain Layout
10017 @
10018 \emph on
10019 style-name
10020 \emph default
10021 @
10022 \end_layout
10023
10024 \end_inset
10025
10026  will be replaced by the expanded 
10027 \begin_inset Flex CharStyle:Code
10028 status collapsed
10029
10030 \begin_layout Plain Layout
10031 LabelString
10032 \end_layout
10033
10034 \end_inset
10035
10036  of style 
10037 \begin_inset Flex CharStyle:Code
10038 status collapsed
10039
10040 \begin_layout Plain Layout
10041
10042 \emph on
10043 style-name
10044 \end_layout
10045
10046 \end_inset
10047
10048 .
10049  This feature is now obsolete and should be replaced by the mechanisms of
10050  Section 
10051 \begin_inset CommandInset ref
10052 LatexCommand ref
10053 reference "sub:Counters"
10054
10055 \end_inset
10056
10057 .
10058 \end_layout
10059
10060 \end_inset
10061
10062
10063 \end_layout
10064
10065 \begin_layout Description
10066 \begin_inset Flex CharStyle:Code
10067 status collapsed
10068
10069 \begin_layout Plain Layout
10070 LabelStringAppendix
10071 \end_layout
10072
10073 \end_inset
10074
10075  [
10076 \begin_inset Flex CharStyle:Code
10077 status collapsed
10078
10079 \begin_layout Plain Layout
10080 string=""
10081 \end_layout
10082
10083 \end_inset
10084
10085 ] This is used inside the appendix instead of 
10086 \begin_inset Flex CharStyle:Code
10087 status collapsed
10088
10089 \begin_layout Plain Layout
10090 LabelString
10091 \end_layout
10092
10093 \end_inset
10094
10095 .
10096  Note that every 
10097 \begin_inset Flex CharStyle:Code
10098 status collapsed
10099
10100 \begin_layout Plain Layout
10101 LabelString
10102 \end_layout
10103
10104 \end_inset
10105
10106  statement resets 
10107 \begin_inset Flex CharStyle:Code
10108 status collapsed
10109
10110 \begin_layout Plain Layout
10111 LabelStringAppendix
10112 \end_layout
10113
10114 \end_inset
10115
10116  too.
10117 \end_layout
10118
10119 \begin_layout Description
10120 \begin_inset Flex CharStyle:Code
10121 status collapsed
10122
10123 \begin_layout Plain Layout
10124 LabelTag
10125 \end_layout
10126
10127 \end_inset
10128
10129  [FIXME] (Used only with XML-type formats.)
10130 \end_layout
10131
10132 \begin_layout Description
10133 \begin_inset Flex CharStyle:Code
10134 status collapsed
10135
10136 \begin_layout Plain Layout
10137 LabelType
10138 \end_layout
10139
10140 \end_inset
10141
10142  [
10143 \begin_inset Flex CharStyle:Code
10144 status collapsed
10145
10146 \begin_layout Plain Layout
10147
10148 \emph on
10149 No_Label
10150 \emph default
10151 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10152  Enumerate, Itemize, Bibliography
10153 \end_layout
10154
10155 \end_inset
10156
10157
10158 \end_layout
10159
10160 \begin_deeper
10161 \begin_layout Itemize
10162 \begin_inset Flex CharStyle:Code
10163 status collapsed
10164
10165 \begin_layout Plain Layout
10166 Manual
10167 \end_layout
10168
10169 \end_inset
10170
10171  means the label is the very first word (up to the first real blank).
10172  Use protected spaces (like
10173 \begin_inset space ~
10174 \end_inset
10175
10176 that one) if you want more than one word as the label.
10177  
10178 \end_layout
10179
10180 \begin_layout Itemize
10181 \begin_inset Flex CharStyle:Code
10182 status collapsed
10183
10184 \begin_layout Plain Layout
10185 Static
10186 \end_layout
10187
10188 \end_inset
10189
10190  means the label is simply whatever 
10191 \begin_inset Flex CharStyle:Code
10192 status collapsed
10193
10194 \begin_layout Plain Layout
10195 LabelString
10196 \end_layout
10197
10198 \end_inset
10199
10200  declares it to be.
10201  Note that this really is `static'.
10202 \end_layout
10203
10204 \begin_layout Itemize
10205 \begin_inset Flex CharStyle:Code
10206 status collapsed
10207
10208 \begin_layout Plain Layout
10209 Top_Environment
10210 \end_layout
10211
10212 \end_inset
10213
10214  and 
10215 \begin_inset Flex CharStyle:Code
10216 status collapsed
10217
10218 \begin_layout Plain Layout
10219 Centered_Top_Environment
10220 \end_layout
10221
10222 \end_inset
10223
10224  are special cases of 
10225 \begin_inset Flex CharStyle:Code
10226 status collapsed
10227
10228 \begin_layout Plain Layout
10229 Static
10230 \end_layout
10231
10232 \end_inset
10233
10234 .
10235  The label will be printed above the paragraph, but only at the top of an
10236  environment or the top of a chain of paragraphs with this layout.
10237  This might be used with the 
10238 \begin_inset Flex CharStyle:MenuItem
10239 status collapsed
10240
10241 \begin_layout Plain Layout
10242 Abstract
10243 \end_layout
10244
10245 \end_inset
10246
10247  layout, for example.
10248 \end_layout
10249
10250 \begin_layout Itemize
10251 \begin_inset Flex CharStyle:Code
10252 status collapsed
10253
10254 \begin_layout Plain Layout
10255 Sensitive
10256 \end_layout
10257
10258 \end_inset
10259
10260  is a special case for the caption-labels 
10261 \begin_inset Quotes eld
10262 \end_inset
10263
10264 Figure
10265 \begin_inset Quotes erd
10266 \end_inset
10267
10268  and 
10269 \begin_inset Quotes eld
10270 \end_inset
10271
10272 Table
10273 \begin_inset Quotes erd
10274 \end_inset
10275
10276 .
10277  
10278 \begin_inset Flex CharStyle:Code
10279 status collapsed
10280
10281 \begin_layout Plain Layout
10282 Sensitive
10283 \end_layout
10284
10285 \end_inset
10286
10287  means the (hardcoded) label string depends on the kind of float: It is
10288  hardcoded to be `FloatType N', where N is the value of the counter associated
10289  with the float.
10290 \end_layout
10291
10292 \begin_layout Itemize
10293 The 
10294 \begin_inset Flex CharStyle:Code
10295 status collapsed
10296
10297 \begin_layout Plain Layout
10298 Counter
10299 \end_layout
10300
10301 \end_inset
10302
10303  label type defines automatically numbered labels.
10304  The 
10305 \begin_inset Flex CharStyle:Code
10306 status collapsed
10307
10308 \begin_layout Plain Layout
10309 LabelString
10310 \end_layout
10311
10312 \end_inset
10313
10314  will be expanded to resolve any counter references it contains: For example,
10315  it might be 
10316 \begin_inset Quotes eld
10317 \end_inset
10318
10319
10320 \begin_inset Flex CharStyle:Code
10321 status collapsed
10322
10323 \begin_layout Plain Layout
10324 Section 
10325 \backslash
10326 thechapter.
10327 \backslash
10328 thesection
10329 \end_layout
10330
10331 \end_inset
10332
10333
10334 \begin_inset Quotes erd
10335 \end_inset
10336
10337 .
10338  See Section 
10339 \begin_inset CommandInset ref
10340 LatexCommand ref
10341 reference "sub:Counters"
10342
10343 \end_inset
10344
10345  for more information on counters.
10346 \end_layout
10347
10348 \begin_layout Itemize
10349 \begin_inset Flex CharStyle:Code
10350 status collapsed
10351
10352 \begin_layout Plain Layout
10353 Enumerate
10354 \end_layout
10355
10356 \end_inset
10357
10358  produces the usual sort of enumeration labels.
10359  At present, it is hardcoded to use Arabic numerals, lowercase letters,
10360  small Roman numerals, and uppercase letters for the four possible depths.
10361 \end_layout
10362
10363 \begin_layout Itemize
10364 \begin_inset Flex CharStyle:Code
10365 status collapsed
10366
10367 \begin_layout Plain Layout
10368 Itemize
10369 \end_layout
10370
10371 \end_inset
10372
10373  produces various bullets at the different levels.
10374  It is also hardcoded.
10375 \end_layout
10376
10377 \begin_layout Itemize
10378 \begin_inset Flex CharStyle:Code
10379 status collapsed
10380
10381 \begin_layout Plain Layout
10382 Bibliography
10383 \end_layout
10384
10385 \end_inset
10386
10387  is used internally by LyX and should be used only with 
10388 \begin_inset Flex CharStyle:Code
10389 status collapsed
10390
10391 \begin_layout Plain Layout
10392 LatexType BibEnvironment
10393 \end_layout
10394
10395 \end_inset
10396
10397 .
10398 \end_layout
10399
10400 \end_deeper
10401 \begin_layout Description
10402 \begin_inset Flex CharStyle:Code
10403 status collapsed
10404
10405 \begin_layout Plain Layout
10406 LangPreamble
10407 \end_layout
10408
10409 \end_inset
10410
10411  Like 
10412 \begin_inset Flex CharStyle:Code
10413 status collapsed
10414
10415 \begin_layout Plain Layout
10416 BabelPreamble
10417 \end_layout
10418
10419 \end_inset
10420
10421 , but this preamble snippet occurs independently from the babel package,
10422  and only for the document language.
10423  Must end with 
10424 \begin_inset Quotes eld
10425 \end_inset
10426
10427
10428 \begin_inset Flex CharStyle:Code
10429 status collapsed
10430
10431 \begin_layout Plain Layout
10432 EndLangPreamble
10433 \end_layout
10434
10435 \end_inset
10436
10437
10438 \begin_inset Quotes erd
10439 \end_inset
10440
10441 .
10442 \end_layout
10443
10444 \begin_deeper
10445 \begin_layout Standard
10446 If the style defines text that appears in the typeset document, it may use
10447  
10448 \begin_inset Flex CharStyle:Code
10449 status collapsed
10450
10451 \begin_layout Plain Layout
10452 LangPreamble
10453 \end_layout
10454
10455 \end_inset
10456
10457  and 
10458 \begin_inset Flex CharStyle:Code
10459 status collapsed
10460
10461 \begin_layout Plain Layout
10462 BabelPreamble
10463 \end_layout
10464
10465 \end_inset
10466
10467  to support non-english and even multilanguage documents correctly.
10468  The following excerpt (from the 
10469 \begin_inset Flex CharStyle:Code
10470 status collapsed
10471
10472 \begin_layout Plain Layout
10473 theorems-ams.inc
10474 \end_layout
10475
10476 \end_inset
10477
10478  file) shows how this works:
10479 \end_layout
10480
10481 \begin_layout LyX-Code
10482 Preamble
10483 \end_layout
10484
10485 \begin_layout LyX-Code
10486   
10487 \backslash
10488 theoremstyle{remark}
10489 \end_layout
10490
10491 \begin_layout LyX-Code
10492   
10493 \backslash
10494 newtheorem{claim}[thm]{
10495 \backslash
10496 protect
10497 \backslash
10498 claimname}
10499 \end_layout
10500
10501 \begin_layout LyX-Code
10502 EndPreamble
10503 \end_layout
10504
10505 \begin_layout LyX-Code
10506 LangPreamble
10507 \end_layout
10508
10509 \begin_layout LyX-Code
10510   
10511 \backslash
10512 providecommand{
10513 \backslash
10514 claimname}{_(Claim)}
10515 \end_layout
10516
10517 \begin_layout LyX-Code
10518
10519 \end_layout
10520
10521 \begin_layout LyX-Code
10522 EndLangPreamble
10523 \end_layout
10524
10525 \begin_layout LyX-Code
10526 BabelPreamble
10527 \end_layout
10528
10529 \begin_layout LyX-Code
10530     
10531 \backslash
10532 addto
10533 \backslash
10534 captions$$lang{
10535 \backslash
10536 renewcommand{
10537 \backslash
10538 claimname}{_(Claim)}}
10539 \end_layout
10540
10541 \begin_layout LyX-Code
10542 EndBabelPreamble
10543 \end_layout
10544
10545 \begin_layout Standard
10546 The key to correct translation of the user visible text is the definition
10547  of the command 
10548 \begin_inset Flex CharStyle:Code
10549 status collapsed
10550
10551 \begin_layout Plain Layout
10552
10553 \backslash
10554 claimname
10555 \end_layout
10556
10557 \end_inset
10558
10559  in the language preamble.
10560  This command holds the name of the theorem that will appear in the output.
10561  The 
10562 \begin_inset Flex CharStyle:Code
10563 status collapsed
10564
10565 \begin_layout Plain Layout
10566 BabelPreamble
10567 \end_layout
10568
10569 \end_inset
10570
10571  then uses the commands offered by the babel package to redefine 
10572 \begin_inset Flex CharStyle:Code
10573 status collapsed
10574
10575 \begin_layout Plain Layout
10576
10577 \backslash
10578 claimname
10579 \end_layout
10580
10581 \end_inset
10582
10583  for each used language in multilanguage documents.
10584 \end_layout
10585
10586 \end_deeper
10587 \begin_layout Description
10588 \begin_inset Flex CharStyle:Code
10589 status collapsed
10590
10591 \begin_layout Plain Layout
10592 LatexName
10593 \end_layout
10594
10595 \end_inset
10596
10597  The name of the corresponding LaTeX stuff.
10598  Either the environment or command name.
10599 \end_layout
10600
10601 \begin_layout Description
10602 \begin_inset Flex CharStyle:Code
10603 status collapsed
10604
10605 \begin_layout Plain Layout
10606 LatexParam
10607 \end_layout
10608
10609 \end_inset
10610
10611  An optional parameter for the corresponding 
10612 \begin_inset Flex CharStyle:Code
10613 status collapsed
10614
10615 \begin_layout Plain Layout
10616 LatexName
10617 \end_layout
10618
10619 \end_inset
10620
10621  stuff.
10622  This parameter cannot be changed from within LyX.
10623 \end_layout
10624
10625 \begin_layout Description
10626 \begin_inset Flex CharStyle:Code
10627 status collapsed
10628
10629 \begin_layout Plain Layout
10630 LatexType
10631 \end_layout
10632
10633 \end_inset
10634
10635  
10636 \begin_inset CommandInset label
10637 LatexCommand label
10638 name "des:LatexType"
10639
10640 \end_inset
10641
10642 [
10643 \begin_inset Flex CharStyle:Code
10644 status collapsed
10645
10646 \begin_layout Plain Layout
10647
10648 \emph on
10649 Paragraph
10650 \emph default
10651 , Command, Environment, Item_Environment,
10652 \end_layout
10653
10654 \end_inset
10655
10656  
10657 \begin_inset Flex CharStyle:Code
10658 status collapsed
10659
10660 \begin_layout Plain Layout
10661 List_Environment, Bib_Environment
10662 \end_layout
10663
10664 \end_inset
10665
10666 ] How the layout should be translated into LaTeX.
10667 \begin_inset Foot
10668 status collapsed
10669
10670 \begin_layout Plain Layout
10671 \begin_inset Flex CharStyle:Code
10672 status collapsed
10673
10674 \begin_layout Plain Layout
10675 LatexType
10676 \end_layout
10677
10678 \end_inset
10679
10680  is perhaps a bit misleading, since these rules apply to SGML classes, too.
10681  Visit the SGML class files for specific examples.
10682 \end_layout
10683
10684 \end_inset
10685
10686
10687 \end_layout
10688
10689 \begin_deeper
10690 \begin_layout Itemize
10691 \begin_inset Flex CharStyle:Code
10692 status collapsed
10693
10694 \begin_layout Plain Layout
10695 Paragraph
10696 \end_layout
10697
10698 \end_inset
10699
10700  means nothing special.
10701  
10702 \end_layout
10703
10704 \begin_layout Itemize
10705 \begin_inset Flex CharStyle:Code
10706 status collapsed
10707
10708 \begin_layout Plain Layout
10709 Command
10710 \end_layout
10711
10712 \end_inset
10713
10714  means 
10715 \begin_inset Flex CharStyle:Code
10716 status collapsed
10717
10718 \begin_layout Plain Layout
10719
10720 \backslash
10721
10722 \emph on
10723 LatexName
10724 \emph default
10725 {\SpecialChar \ldots{}
10726 }
10727 \end_layout
10728
10729 \end_inset
10730
10731 .
10732 \end_layout
10733
10734 \begin_layout Itemize
10735 \begin_inset Flex CharStyle:Code
10736 status collapsed
10737
10738 \begin_layout Plain Layout
10739 Environment
10740 \end_layout
10741
10742 \end_inset
10743
10744  means 
10745 \begin_inset Flex CharStyle:Code
10746 status collapsed
10747
10748 \begin_layout Plain Layout
10749
10750 \backslash
10751 begin{
10752 \emph on
10753 LatexName
10754 \emph default
10755 }\SpecialChar \ldots{}
10756
10757 \backslash
10758 end{
10759 \emph on
10760 LatexName
10761 \emph default
10762 }
10763 \end_layout
10764
10765 \end_inset
10766
10767 .
10768  
10769 \end_layout
10770
10771 \begin_layout Itemize
10772 \begin_inset Flex CharStyle:Code
10773 status collapsed
10774
10775 \begin_layout Plain Layout
10776 Item_Environment
10777 \end_layout
10778
10779 \end_inset
10780
10781  is the same as 
10782 \begin_inset Flex CharStyle:Code
10783 status collapsed
10784
10785 \begin_layout Plain Layout
10786 Environment
10787 \end_layout
10788
10789 \end_inset
10790
10791 , except that an 
10792 \begin_inset Flex CharStyle:Code
10793 status collapsed
10794
10795 \begin_layout Plain Layout
10796
10797 \backslash
10798 item
10799 \end_layout
10800
10801 \end_inset
10802
10803  is generated for each paragraph of this environment.
10804  
10805 \end_layout
10806
10807 \begin_layout Itemize
10808 \begin_inset Flex CharStyle:Code
10809 status collapsed
10810
10811 \begin_layout Plain Layout
10812 List_Environment
10813 \end_layout
10814
10815 \end_inset
10816
10817  is the same as 
10818 \begin_inset Flex CharStyle:Code
10819 status collapsed
10820
10821 \begin_layout Plain Layout
10822 Item_Environment
10823 \end_layout
10824
10825 \end_inset
10826
10827 , except that 
10828 \begin_inset Flex CharStyle:Code
10829 status collapsed
10830
10831 \begin_layout Plain Layout
10832 LabelWidthString
10833 \end_layout
10834
10835 \end_inset
10836
10837  is passed as an argument to the environment.
10838  
10839 \begin_inset Flex CharStyle:Code
10840 status collapsed
10841
10842 \begin_layout Plain Layout
10843 LabelWidthString
10844 \end_layout
10845
10846 \end_inset
10847
10848  can be defined in the 
10849 \begin_inset Flex CharStyle:MenuItem
10850 status collapsed
10851
10852 \begin_layout Plain Layout
10853
10854 \bar under
10855 L
10856 \bar default
10857 ayout\SpecialChar \menuseparator
10858
10859 \bar under
10860 P
10861 \bar default
10862 aragraph
10863 \end_layout
10864
10865 \end_inset
10866
10867  dialog.
10868  
10869 \end_layout
10870
10871 \begin_layout Standard
10872 Putting the last few things together, the LaTeX output will be either: 
10873 \end_layout
10874
10875 \begin_layout LyX-Code
10876
10877 \backslash
10878 latexname[latexparam]{\SpecialChar \ldots{}
10879 }
10880 \end_layout
10881
10882 \begin_layout Standard
10883 or: 
10884 \end_layout
10885
10886 \begin_layout LyX-Code
10887
10888 \backslash
10889 begin{latexname}[latexparam] \SpecialChar \ldots{}
10890  
10891 \backslash
10892 end{latexname}.
10893 \end_layout
10894
10895 \begin_layout Standard
10896 depending upon the LaTeX type.
10897 \end_layout
10898
10899 \end_deeper
10900 \begin_layout Description
10901 \begin_inset Flex CharStyle:Code
10902 status collapsed
10903
10904 \begin_layout Plain Layout
10905 LeftMargin
10906 \end_layout
10907
10908 \end_inset
10909
10910  [
10911 \begin_inset Flex CharStyle:Code
10912 status collapsed
10913
10914 \begin_layout Plain Layout
10915 string=""
10916 \end_layout
10917
10918 \end_inset
10919
10920 ] If you put layouts into environments, the leftmargins are not simply added,
10921  but added with a factor 
10922 \begin_inset Formula $\frac{4}{depth+4}$
10923 \end_inset
10924
10925 .
10926  Note that this parameter is also used when the margin is defined as 
10927 \begin_inset Flex CharStyle:Code
10928 status collapsed
10929
10930 \begin_layout Plain Layout
10931 Manual
10932 \end_layout
10933
10934 \end_inset
10935
10936  or 
10937 \begin_inset Flex CharStyle:Code
10938 status collapsed
10939
10940 \begin_layout Plain Layout
10941 Dynamic
10942 \end_layout
10943
10944 \end_inset
10945
10946 .
10947  Then it is added to the manual or dynamic margin.
10948  
10949 \begin_inset Newline newline
10950 \end_inset
10951
10952 The argument is passed as a string.
10953  For example 
10954 \begin_inset Quotes eld
10955 \end_inset
10956
10957
10958 \begin_inset Flex CharStyle:Code
10959 status collapsed
10960
10961 \begin_layout Plain Layout
10962 MM
10963 \end_layout
10964
10965 \end_inset
10966
10967
10968 \begin_inset Quotes erd
10969 \end_inset
10970
10971  means that the paragraph is indented with the width of 
10972 \begin_inset Quotes eld
10973 \end_inset
10974
10975
10976 \begin_inset Flex CharStyle:Code
10977 status collapsed
10978
10979 \begin_layout Plain Layout
10980 MM
10981 \end_layout
10982
10983 \end_inset
10984
10985
10986 \begin_inset Quotes erd
10987 \end_inset
10988
10989  in the normal font.
10990  You can get a negative width by prefixing the string with 
10991 \begin_inset Quotes eld
10992 \end_inset
10993
10994
10995 \begin_inset Flex CharStyle:Code
10996 status collapsed
10997
10998 \begin_layout Plain Layout
10999 -
11000 \end_layout
11001
11002 \end_inset
11003
11004
11005 \begin_inset Quotes erd
11006 \end_inset
11007
11008 .
11009  This way was chosen so that the look is the same with each used screen
11010  font.
11011  
11012 \end_layout
11013
11014 \begin_layout Description
11015 \begin_inset Flex CharStyle:Code
11016 status collapsed
11017
11018 \begin_layout Plain Layout
11019 Margin
11020 \end_layout
11021
11022 \end_inset
11023
11024  [
11025 \begin_inset Flex CharStyle:Code
11026 status collapsed
11027
11028 \begin_layout Plain Layout
11029
11030 \emph on
11031 Static
11032 \emph default
11033 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11034 \end_layout
11035
11036 \end_inset
11037
11038
11039 \begin_inset Newline newline
11040 \end_inset
11041
11042 The kind of margin that the layout has on the left side.
11043  
11044 \begin_inset Flex CharStyle:Code
11045 status collapsed
11046
11047 \begin_layout Plain Layout
11048 Static
11049 \end_layout
11050
11051 \end_inset
11052
11053  just means a fixed margin.
11054  
11055 \begin_inset Flex CharStyle:Code
11056 status collapsed
11057
11058 \begin_layout Plain Layout
11059 Manual
11060 \end_layout
11061
11062 \end_inset
11063
11064  means that the left margin depends on the string entered in the 
11065 \begin_inset Flex CharStyle:MenuItem
11066 status collapsed
11067
11068 \begin_layout Plain Layout
11069 Edit\SpecialChar \menuseparator
11070 Paragraph
11071 \begin_inset space ~
11072 \end_inset
11073
11074 Settings
11075 \end_layout
11076
11077 \end_inset
11078
11079  dialog.
11080  This is used to typeset nice lists without tabulators.
11081  
11082 \begin_inset Flex CharStyle:Code
11083 status collapsed
11084
11085 \begin_layout Plain Layout
11086 Dynamic
11087 \end_layout
11088
11089 \end_inset
11090
11091  means that the margin depends on the size of the label.
11092  This is used for automatic enumerated headlines.
11093  It is obvious that the headline 
11094 \begin_inset Quotes eld
11095 \end_inset
11096
11097 5.4.3.2.1 Very long headline
11098 \begin_inset Quotes erd
11099 \end_inset
11100
11101  must have a wider left margin (as wide as 
11102 \begin_inset Quotes eld
11103 \end_inset
11104
11105 5.4.3.2.1
11106 \begin_inset Quotes erd
11107 \end_inset
11108
11109  plus the space) than 
11110 \begin_inset Quotes eld
11111 \end_inset
11112
11113 3.2 Very long headline
11114 \begin_inset Quotes erd
11115 \end_inset
11116
11117 , even if standard 
11118 \begin_inset Quotes eld
11119 \end_inset
11120
11121 word processors
11122 \begin_inset Quotes erd
11123 \end_inset
11124
11125  are not able to do this.
11126  
11127 \begin_inset Flex CharStyle:Code
11128 status collapsed
11129
11130 \begin_layout Plain Layout
11131 First_Dynamic
11132 \end_layout
11133
11134 \end_inset
11135
11136  is similar, but only the very first row of the paragraph is dynamic, while
11137  the others are static; this is used, for example, for descriptions.
11138  
11139 \begin_inset Flex CharStyle:Code
11140 status collapsed
11141
11142 \begin_layout Plain Layout
11143 Right_Address_Box
11144 \end_layout
11145
11146 \end_inset
11147
11148  means the margin is chosen in a way that the longest row of this paragraph
11149  fits to the right margin.
11150  This is used to typeset an address on the right edge of the page.
11151 \end_layout
11152
11153 \begin_layout Description
11154 \begin_inset Flex CharStyle:Code
11155 status collapsed
11156
11157 \begin_layout Plain Layout
11158 NeedProtect
11159 \end_layout
11160
11161 \end_inset
11162
11163  [
11164 \begin_inset Flex CharStyle:Code
11165 status collapsed
11166
11167 \begin_layout Plain Layout
11168
11169 \emph on
11170 0
11171 \end_layout
11172
11173 \end_inset
11174
11175 ,
11176 \begin_inset Flex CharStyle:Code
11177 status collapsed
11178
11179 \begin_layout Plain Layout
11180 1
11181 \end_layout
11182
11183 \end_inset
11184
11185 ] Whether fragile commands in this layout should be 
11186 \begin_inset Flex CharStyle:Code
11187 status collapsed
11188
11189 \begin_layout Plain Layout
11190
11191 \backslash
11192 protect
11193 \end_layout
11194
11195 \end_inset
11196
11197 'ed.
11198  (Note: This is 
11199 \emph on
11200 not
11201 \emph default
11202  whether this command should itself be protected.)
11203 \end_layout
11204
11205 \begin_layout Description
11206 \begin_inset Flex CharStyle:Code
11207 status collapsed
11208
11209 \begin_layout Plain Layout
11210 Newline
11211 \end_layout
11212
11213 \end_inset
11214
11215  [
11216 \begin_inset Flex CharStyle:Code
11217 status collapsed
11218
11219 \begin_layout Plain Layout
11220 0
11221 \end_layout
11222
11223 \end_inset
11224
11225
11226 \begin_inset Flex CharStyle:Code
11227 status collapsed
11228
11229 \begin_layout Plain Layout
11230
11231 \emph on
11232 1
11233 \end_layout
11234
11235 \end_inset
11236
11237 ] Whether newlines are translated into LaTeX newlines (
11238 \begin_inset Flex CharStyle:Code
11239 status collapsed
11240
11241 \begin_layout Plain Layout
11242
11243 \backslash
11244
11245 \backslash
11246
11247 \end_layout
11248
11249 \end_inset
11250
11251 ) or not.
11252  The translation can be switched off to allow more comfortable LaTeX editing
11253  inside LyX.
11254 \end_layout
11255
11256 \begin_layout Description
11257 \begin_inset Flex CharStyle:Code
11258 status collapsed
11259
11260 \begin_layout Plain Layout
11261 NextNoIndent
11262 \end_layout
11263
11264 \end_inset
11265
11266  [
11267 \begin_inset Flex CharStyle:Code
11268 status collapsed
11269
11270 \begin_layout Plain Layout
11271 1
11272 \end_layout
11273
11274 \end_inset
11275
11276
11277 \begin_inset Flex CharStyle:Code
11278 status collapsed
11279
11280 \begin_layout Plain Layout
11281
11282 \emph on
11283 0
11284 \end_layout
11285
11286 \end_inset
11287
11288 ] Whether the following Paragraph is allowed to indent its very first row.
11289  
11290 \begin_inset Flex CharStyle:Code
11291 status collapsed
11292
11293 \begin_layout Plain Layout
11294 1
11295 \end_layout
11296
11297 \end_inset
11298
11299  means that it is not allowed to do so; 
11300 \begin_inset Flex CharStyle:Code
11301 status collapsed
11302
11303 \begin_layout Plain Layout
11304 0
11305 \end_layout
11306
11307 \end_inset
11308
11309  means it could do so if it wants to.
11310 \end_layout
11311
11312 \begin_layout Description
11313 \begin_inset Flex CharStyle:Code
11314 status collapsed
11315
11316 \begin_layout Plain Layout
11317 ObsoletedBy
11318 \end_layout
11319
11320 \end_inset
11321
11322  Name of a layout that has replaced this layout.
11323  This is used to rename a layout, while keeping backward compatibility.
11324 \end_layout
11325
11326 \begin_layout Description
11327 \begin_inset Flex CharStyle:Code
11328 status collapsed
11329
11330 \begin_layout Plain Layout
11331 OptionalArgs
11332 \end_layout
11333
11334 \end_inset
11335
11336  [
11337 \begin_inset Flex CharStyle:Code
11338 status collapsed
11339
11340 \begin_layout Plain Layout
11341 int=0
11342 \end_layout
11343
11344 \end_inset
11345
11346 ] The number of optional arguments that can be used with this layout.
11347  This is useful for things like section headings, and only makes sense with
11348  LaTeX.
11349 \end_layout
11350
11351 \begin_layout Description
11352 \begin_inset Flex CharStyle:Code
11353 status collapsed
11354
11355 \begin_layout Plain Layout
11356 ParIndent
11357 \end_layout
11358
11359 \end_inset
11360
11361  [
11362 \begin_inset Flex CharStyle:Code
11363 status collapsed
11364
11365 \begin_layout Plain Layout
11366 string=""
11367 \end_layout
11368
11369 \end_inset
11370
11371 ] The indent of the very first line of a paragraph.
11372  The 
11373 \begin_inset Flex CharStyle:Code
11374 status collapsed
11375
11376 \begin_layout Plain Layout
11377 Parindent
11378 \end_layout
11379
11380 \end_inset
11381
11382  will be fixed for a certain layout.
11383  The exception is Standard layout, since the indentation of a Standard layout
11384  paragraph can be prohibited with 
11385 \begin_inset Flex CharStyle:Code
11386 status collapsed
11387
11388 \begin_layout Plain Layout
11389 NextNoIndent
11390 \end_layout
11391
11392 \end_inset
11393
11394 .
11395  Also, Standard layout paragraphs inside environments use the 
11396 \begin_inset Flex CharStyle:Code
11397 status collapsed
11398
11399 \begin_layout Plain Layout
11400 Parindent
11401 \end_layout
11402
11403 \end_inset
11404
11405  of the environment, not their native one.
11406  For example, Standard paragraphs inside an enumeration are not indented.
11407 \end_layout
11408
11409 \begin_layout Description
11410 \begin_inset Flex CharStyle:Code
11411 status collapsed
11412
11413 \begin_layout Plain Layout
11414 Parsep
11415 \end_layout
11416
11417 \end_inset
11418
11419  [
11420 \begin_inset Flex CharStyle:Code
11421 status collapsed
11422
11423 \begin_layout Plain Layout
11424 float=0
11425 \end_layout
11426
11427 \end_inset
11428
11429 ] The vertical space between two paragraphs of this layout.
11430 \end_layout
11431
11432 \begin_layout Description
11433 \begin_inset Flex CharStyle:Code
11434 status collapsed
11435
11436 \begin_layout Plain Layout
11437 Parskip
11438 \end_layout
11439
11440 \end_inset
11441
11442  [
11443 \begin_inset Flex CharStyle:Code
11444 status collapsed
11445
11446 \begin_layout Plain Layout
11447 float=0
11448 \end_layout
11449
11450 \end_inset
11451
11452 ] LyX allows the user to choose either 
11453 \begin_inset Quotes eld
11454 \end_inset
11455
11456 indent
11457 \begin_inset Quotes erd
11458 \end_inset
11459
11460  or 
11461 \begin_inset Quotes eld
11462 \end_inset
11463
11464 skip
11465 \begin_inset Quotes erd
11466 \end_inset
11467
11468  to typeset a document.
11469  When 
11470 \begin_inset Quotes eld
11471 \end_inset
11472
11473 indent
11474 \begin_inset Quotes erd
11475 \end_inset
11476
11477  is chosen, this value is completely ignored.
11478  When 
11479 \begin_inset Quotes eld
11480 \end_inset
11481
11482 skip
11483 \begin_inset Quotes erd
11484 \end_inset
11485
11486  is chosen, the parindent of a LaTeXtype 
11487 \begin_inset Quotes eld
11488 \end_inset
11489
11490 Paragraph
11491 \begin_inset Quotes erd
11492 \end_inset
11493
11494  layout is ignored and all paragraphs are separated by this parskip argument.
11495  The vertical space is calculated with 
11496 \begin_inset Flex CharStyle:Code
11497 status collapsed
11498
11499 \begin_layout Plain Layout
11500 value
11501 \begin_inset space ~
11502 \end_inset
11503
11504 * DefaultHeight
11505 \end_layout
11506
11507 \end_inset
11508
11509  where 
11510 \begin_inset Flex CharStyle:Code
11511 status collapsed
11512
11513 \begin_layout Plain Layout
11514 DefaultHeight
11515 \end_layout
11516
11517 \end_inset
11518
11519  is the height of a row with the normal font.
11520  This way, the look stays the same with different screen fonts.
11521 \end_layout
11522
11523 \begin_layout Description
11524 \begin_inset Flex CharStyle:Code
11525 status collapsed
11526
11527 \begin_layout Plain Layout
11528 PassThru
11529 \end_layout
11530
11531 \end_inset
11532
11533  
11534 \begin_inset CommandInset label
11535 LatexCommand label
11536 name "des:PathThru"
11537
11538 \end_inset
11539
11540 [
11541 \emph on
11542
11543 \begin_inset Flex CharStyle:Code
11544 status collapsed
11545
11546 \begin_layout Plain Layout
11547
11548 \emph on
11549 0
11550 \end_layout
11551
11552 \end_inset
11553
11554
11555 \emph default
11556
11557 \begin_inset Flex CharStyle:Code
11558 status collapsed
11559
11560 \begin_layout Plain Layout
11561 1
11562 \end_layout
11563
11564 \end_inset
11565
11566 ] Whether the contents of this paragraph should be output in raw form, meaning
11567  without special translations that LaTeX would require.
11568 \end_layout
11569
11570 \begin_layout Description
11571 \begin_inset Flex CharStyle:Code
11572 status collapsed
11573
11574 \begin_layout Plain Layout
11575 Preamble
11576 \end_layout
11577
11578 \end_inset
11579
11580  
11581 \begin_inset CommandInset label
11582 LatexCommand label
11583 name "des:Preamble"
11584
11585 \end_inset
11586
11587 Information to be included in the LaTeX preamble when this style is used.
11588  Used to define macros, load packages, etc., required by this particular
11589  style.
11590  Must end with 
11591 \begin_inset Quotes eld
11592 \end_inset
11593
11594
11595 \begin_inset Flex CharStyle:Code
11596 status collapsed
11597
11598 \begin_layout Plain Layout
11599 EndPreamble
11600 \end_layout
11601
11602 \end_inset
11603
11604
11605 \begin_inset Quotes erd
11606 \end_inset
11607
11608 .
11609 \end_layout
11610
11611 \begin_layout Description
11612 \begin_inset Flex CharStyle:Code
11613 status collapsed
11614
11615 \begin_layout Plain Layout
11616 Requires 
11617 \end_layout
11618
11619 \end_inset
11620
11621 [
11622 \begin_inset Flex CharStyle:Code
11623 status collapsed
11624
11625 \begin_layout Plain Layout
11626 string
11627 \end_layout
11628
11629 \end_inset
11630
11631
11632 \begin_inset CommandInset label
11633 LatexCommand label
11634 name "des:Requires"
11635
11636 \end_inset
11637
11638 Whether the layout requires the feature 
11639 \begin_inset Flex CharStyle:Code
11640 status collapsed
11641
11642 \begin_layout Plain Layout
11643 string
11644 \end_layout
11645
11646 \end_inset
11647
11648 .
11649  See the description of 
11650 \begin_inset Flex CharStyle:Code
11651 status collapsed
11652
11653 \begin_layout Plain Layout
11654 Provides
11655 \end_layout
11656
11657 \end_inset
11658
11659  above (page 
11660 \begin_inset CommandInset ref
11661 LatexCommand pageref
11662 reference "des:FreeSpacing"
11663
11664 \end_inset
11665
11666 ) for information on `features'.
11667  
11668 \end_layout
11669
11670 \begin_layout Description
11671 \begin_inset Flex CharStyle:Code
11672 status collapsed
11673
11674 \begin_layout Plain Layout
11675 RightMargin
11676 \end_layout
11677
11678 \end_inset
11679
11680  [
11681 \begin_inset Flex CharStyle:Code
11682 status collapsed
11683
11684 \begin_layout Plain Layout
11685 string=""
11686 \end_layout
11687
11688 \end_inset
11689
11690 ] Similar to 
11691 \begin_inset Flex CharStyle:Code
11692 status collapsed
11693
11694 \begin_layout Plain Layout
11695 LeftMargin
11696 \end_layout
11697
11698 \end_inset
11699
11700 .
11701 \end_layout
11702
11703 \begin_layout Description
11704 \begin_inset Flex CharStyle:Code
11705 status collapsed
11706
11707 \begin_layout Plain Layout
11708 Spacing
11709 \end_layout
11710
11711 \end_inset
11712
11713  [
11714 \begin_inset Flex CharStyle:Code
11715 status collapsed
11716
11717 \begin_layout Plain Layout
11718
11719 \emph on
11720 single
11721 \emph default
11722 , onehalf, double, other
11723 \end_layout
11724
11725 \end_inset
11726
11727  
11728 \emph on
11729 value
11730 \emph default
11731 ] This defines what the default spacing should be in the layout.
11732  The arguments 
11733 \begin_inset Flex CharStyle:Code
11734 status collapsed
11735
11736 \begin_layout Plain Layout
11737 single
11738 \end_layout
11739
11740 \end_inset
11741
11742
11743 \begin_inset Flex CharStyle:Code
11744 status collapsed
11745
11746 \begin_layout Plain Layout
11747 onehalf
11748 \end_layout
11749
11750 \end_inset
11751
11752  and 
11753 \begin_inset Flex CharStyle:Code
11754 status collapsed
11755
11756 \begin_layout Plain Layout
11757 double
11758 \end_layout
11759
11760 \end_inset
11761
11762  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11763  If you specify the argument 
11764 \begin_inset Flex CharStyle:Code
11765 status collapsed
11766
11767 \begin_layout Plain Layout
11768 other
11769 \end_layout
11770
11771 \end_inset
11772
11773 , then you should also provide a numerical argument which will be the actual
11774  multiplier value.
11775  Note that, contrary to other parameters, 
11776 \begin_inset Flex CharStyle:Code
11777 status collapsed
11778
11779 \begin_layout Plain Layout
11780 Spacing
11781 \end_layout
11782
11783 \end_inset
11784
11785  implies the generation of specific LaTeX code, using the package 
11786 \family roman
11787
11788 \begin_inset Flex CharStyle:Code
11789 status collapsed
11790
11791 \begin_layout Plain Layout
11792 setspace.sty
11793 \end_layout
11794
11795 \end_inset
11796
11797 .
11798 \end_layout
11799
11800 \begin_layout Description
11801 \begin_inset Flex CharStyle:Code
11802 status collapsed
11803
11804 \begin_layout Plain Layout
11805 TextFont
11806 \end_layout
11807
11808 \end_inset
11809
11810  The font used for the text body .
11811  See section 
11812 \begin_inset CommandInset ref
11813 LatexCommand ref
11814 reference "sub:Font-description"
11815
11816 \end_inset
11817
11818 .
11819 \end_layout
11820
11821 \begin_layout Description
11822 \begin_inset Flex CharStyle:Code
11823 status collapsed
11824
11825 \begin_layout Plain Layout
11826
11827 \series medium
11828 TocLevel [int]
11829 \end_layout
11830
11831 \end_inset
11832
11833  The level of the style in the table of contents.
11834  This is used for automatic numbering of section headings.
11835 \end_layout
11836
11837 \begin_layout Description
11838 \begin_inset Flex CharStyle:Code
11839 status collapsed
11840
11841 \begin_layout Plain Layout
11842 TopSep
11843 \end_layout
11844
11845 \end_inset
11846
11847  [
11848 \begin_inset Flex CharStyle:Code
11849 status collapsed
11850
11851 \begin_layout Plain Layout
11852 float=0
11853 \end_layout
11854
11855 \end_inset
11856
11857 ] The vertical space with which the very first of a chain of paragraphs
11858  with this layout is separated from the previous paragraph.
11859  If the previous paragraph has another layout, the separations are not simply
11860  added, but the maximum is taken.
11861 \end_layout
11862
11863 \begin_layout Subsection
11864 Floats
11865 \begin_inset CommandInset label
11866 LatexCommand label
11867 name "sub:Floats"
11868
11869 \end_inset
11870
11871
11872 \end_layout
11873
11874 \begin_layout Standard
11875 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11876  define the floats (
11877 \begin_inset Flex CharStyle:MenuItem
11878 status collapsed
11879
11880 \begin_layout Plain Layout
11881 figure
11882 \end_layout
11883
11884 \end_inset
11885
11886
11887 \begin_inset Flex CharStyle:MenuItem
11888 status collapsed
11889
11890 \begin_layout Plain Layout
11891 table
11892 \end_layout
11893
11894 \end_inset
11895
11896 , \SpecialChar \ldots{}
11897 ) in the text class itself.
11898  Standard floats are included in the file 
11899 \begin_inset Flex CharStyle:Code
11900 status collapsed
11901
11902 \begin_layout Plain Layout
11903 stdfloats.inc
11904 \end_layout
11905
11906 \end_inset
11907
11908 , so you may have to do no more than add
11909 \end_layout
11910
11911 \begin_layout LyX-Code
11912 Input stdfloats.inc
11913 \end_layout
11914
11915 \begin_layout Standard
11916 to your layout file.
11917  If you want to implement a text class that proposes some other float types
11918  (like the AGU class bundled with LyX), the information below will hopefully
11919  help you:
11920 \end_layout
11921
11922 \begin_layout Description
11923 \begin_inset Flex CharStyle:Code
11924 status collapsed
11925
11926 \begin_layout Plain Layout
11927 Extension
11928 \end_layout
11929
11930 \end_inset
11931
11932  [
11933 \begin_inset Flex CharStyle:Code
11934 status collapsed
11935
11936 \begin_layout Plain Layout
11937 string
11938 \end_layout
11939
11940 \end_inset
11941
11942 =
11943 \begin_inset Quotes erd
11944 \end_inset
11945
11946
11947 \begin_inset Quotes erd
11948 \end_inset
11949
11950 ] The file name extension of an auxiliary file for the list of figures (or
11951  whatever).
11952  LaTeX writes the captions to this file.
11953 \end_layout
11954
11955 \begin_layout Description
11956 \begin_inset Flex CharStyle:Code
11957 status collapsed
11958
11959 \begin_layout Plain Layout
11960 GuiName
11961 \end_layout
11962
11963 \end_inset
11964
11965  [
11966 \begin_inset Flex CharStyle:Code
11967 status collapsed
11968
11969 \begin_layout Plain Layout
11970 string
11971 \end_layout
11972
11973 \end_inset
11974
11975 =
11976 \begin_inset Quotes erd
11977 \end_inset
11978
11979
11980 \begin_inset Quotes erd
11981 \end_inset
11982
11983 ] The string that will be used in the menus and also for the caption.
11984  This is translated to the current language if babel is used.
11985 \end_layout
11986
11987 \begin_layout Description
11988 \begin_inset Flex CharStyle:Code
11989 status collapsed
11990
11991 \begin_layout Plain Layout
11992 LaTeXBuiltin
11993 \end_layout
11994
11995 \end_inset
11996
11997  [
11998 \begin_inset Flex CharStyle:Code
11999 status collapsed
12000
12001 \begin_layout Plain Layout
12002
12003 \emph on
12004 0
12005 \end_layout
12006
12007 \end_inset
12008
12009
12010 \begin_inset Flex CharStyle:Code
12011 status collapsed
12012
12013 \begin_layout Plain Layout
12014 1
12015 \end_layout
12016
12017 \end_inset
12018
12019 ] Set to 
12020 \begin_inset Flex CharStyle:Code
12021 status collapsed
12022
12023 \begin_layout Plain Layout
12024 1
12025 \end_layout
12026
12027 \end_inset
12028
12029  if the float is already defined by the LaTeX document class.
12030  If this is set to 
12031 \begin_inset Flex CharStyle:Code
12032 status collapsed
12033
12034 \begin_layout Plain Layout
12035 0
12036 \end_layout
12037
12038 \end_inset
12039
12040 , the float will be defined using the LaTeX package 
12041 \begin_inset Flex CharStyle:Code
12042 status collapsed
12043
12044 \begin_layout Plain Layout
12045 float
12046 \end_layout
12047
12048 \end_inset
12049
12050 .
12051 \end_layout
12052
12053 \begin_layout Description
12054 \begin_inset Flex CharStyle:Code
12055 status collapsed
12056
12057 \begin_layout Plain Layout
12058 ListName
12059 \end_layout
12060
12061 \end_inset
12062
12063  [
12064 \begin_inset Flex CharStyle:Code
12065 status collapsed
12066
12067 \begin_layout Plain Layout
12068 string
12069 \end_layout
12070
12071 \end_inset
12072
12073 =
12074 \begin_inset Quotes erd
12075 \end_inset
12076
12077
12078 \begin_inset Quotes erd
12079 \end_inset
12080
12081 ] The heading used for the list of floats.
12082  This is translated to the document language.
12083 \end_layout
12084
12085 \begin_layout Description
12086 \begin_inset Flex CharStyle:Code
12087 status collapsed
12088
12089 \begin_layout Plain Layout
12090 NumberWithin
12091 \end_layout
12092
12093 \end_inset
12094
12095  [
12096 \begin_inset Flex CharStyle:Code
12097 status collapsed
12098
12099 \begin_layout Plain Layout
12100 string
12101 \end_layout
12102
12103 \end_inset
12104
12105 =
12106 \begin_inset Quotes erd
12107 \end_inset
12108
12109
12110 \begin_inset Quotes erd
12111 \end_inset
12112
12113 ] This (optional) argument determines whether floats of this class will
12114  be numbered within some sectional unit of the document.
12115  For example, if within is equal to 
12116 \begin_inset Flex CharStyle:Code
12117 status collapsed
12118
12119 \begin_layout Plain Layout
12120 chapter
12121 \end_layout
12122
12123 \end_inset
12124
12125 , the floats will be numbered within chapters.
12126  
12127 \end_layout
12128
12129 \begin_layout Description
12130 \begin_inset Flex CharStyle:Code
12131 status collapsed
12132
12133 \begin_layout Plain Layout
12134 Placement
12135 \end_layout
12136
12137 \end_inset
12138
12139  [
12140 \begin_inset Flex CharStyle:Code
12141 status collapsed
12142
12143 \begin_layout Plain Layout
12144 string
12145 \end_layout
12146
12147 \end_inset
12148
12149 =
12150 \begin_inset Quotes erd
12151 \end_inset
12152
12153
12154 \begin_inset Quotes erd
12155 \end_inset
12156
12157 ] The default placement for the given class of floats.
12158  The string should be as in standard LaTeX: 
12159 \begin_inset Flex CharStyle:Code
12160 status collapsed
12161
12162 \begin_layout Plain Layout
12163 t
12164 \end_layout
12165
12166 \end_inset
12167
12168
12169 \begin_inset Flex CharStyle:Code
12170 status collapsed
12171
12172 \begin_layout Plain Layout
12173 b
12174 \end_layout
12175
12176 \end_inset
12177
12178
12179 \begin_inset Flex CharStyle:Code
12180 status collapsed
12181
12182 \begin_layout Plain Layout
12183 p
12184 \end_layout
12185
12186 \end_inset
12187
12188  and 
12189 \begin_inset Flex CharStyle:Code
12190 status collapsed
12191
12192 \begin_layout Plain Layout
12193 h
12194 \end_layout
12195
12196 \end_inset
12197
12198  for top, bottom, page, and here, respectively.
12199 \begin_inset Foot
12200 status collapsed
12201
12202 \begin_layout Plain Layout
12203 Note that the order of these letters in the string is irrelevant, like in
12204  LaTeX.
12205 \end_layout
12206
12207 \end_inset
12208
12209  On top of that there is a new type, 
12210 \begin_inset Flex CharStyle:Code
12211 status collapsed
12212
12213 \begin_layout Plain Layout
12214 H
12215 \end_layout
12216
12217 \end_inset
12218
12219 , which does not really correspond to a float, since it means: put it 
12220 \begin_inset Quotes eld
12221 \end_inset
12222
12223 here
12224 \begin_inset Quotes erd
12225 \end_inset
12226
12227  and nowhere else.
12228  Note however that the 
12229 \begin_inset Flex CharStyle:Code
12230 status collapsed
12231
12232 \begin_layout Plain Layout
12233 H
12234 \end_layout
12235
12236 \end_inset
12237
12238  specifier is special and, because of implementation details, cannot be
12239  used in non-built in float types.
12240  If you do not understand what this means, just use 
12241 \begin_inset Quotes eld
12242 \end_inset
12243
12244
12245 \begin_inset Flex CharStyle:Code
12246 status collapsed
12247
12248 \begin_layout Plain Layout
12249 tbp
12250 \end_layout
12251
12252 \end_inset
12253
12254
12255 \begin_inset Quotes erd
12256 \end_inset
12257
12258 .
12259 \end_layout
12260
12261 \begin_layout Description
12262 \begin_inset Flex CharStyle:Code
12263 status collapsed
12264
12265 \begin_layout Plain Layout
12266 Style
12267 \end_layout
12268
12269 \end_inset
12270
12271  [
12272 \begin_inset Flex CharStyle:Code
12273 status collapsed
12274
12275 \begin_layout Plain Layout
12276 string
12277 \end_layout
12278
12279 \end_inset
12280
12281 =
12282 \begin_inset Quotes erd
12283 \end_inset
12284
12285
12286 \begin_inset Quotes erd
12287 \end_inset
12288
12289 ] The style used when defining the float using 
12290 \begin_inset Flex CharStyle:Code
12291 status collapsed
12292
12293 \begin_layout Plain Layout
12294
12295 \backslash
12296 newfloat
12297 \end_layout
12298
12299 \end_inset
12300
12301 .
12302 \end_layout
12303
12304 \begin_layout Description
12305 \begin_inset Flex CharStyle:Code
12306 status collapsed
12307
12308 \begin_layout Plain Layout
12309 Type
12310 \end_layout
12311
12312 \end_inset
12313
12314  [
12315 \begin_inset Flex CharStyle:Code
12316 status collapsed
12317
12318 \begin_layout Plain Layout
12319 string
12320 \end_layout
12321
12322 \end_inset
12323
12324 =
12325 \begin_inset Quotes erd
12326 \end_inset
12327
12328
12329 \begin_inset Quotes erd
12330 \end_inset
12331
12332 ] The 
12333 \begin_inset Quotes eld
12334 \end_inset
12335
12336 type
12337 \begin_inset Quotes erd
12338 \end_inset
12339
12340  of the new class of floats, like program or algorithm.
12341  After the appropriate 
12342 \begin_inset Flex CharStyle:Code
12343 status collapsed
12344
12345 \begin_layout Plain Layout
12346
12347 \backslash
12348 newfloat
12349 \end_layout
12350
12351 \end_inset
12352
12353 , commands such as 
12354 \begin_inset Flex CharStyle:Code
12355 status collapsed
12356
12357 \begin_layout Plain Layout
12358
12359 \backslash
12360 begin{program}
12361 \end_layout
12362
12363 \end_inset
12364
12365  or 
12366 \begin_inset Flex CharStyle:Code
12367 status collapsed
12368
12369 \begin_layout Plain Layout
12370
12371 \backslash
12372 end{algorithm*}
12373 \end_layout
12374
12375 \end_inset
12376
12377  will be available.
12378 \end_layout
12379
12380 \begin_layout Standard
12381 Note that defining a float with type 
12382 \begin_inset Flex CharStyle:Code
12383 status collapsed
12384
12385 \begin_layout Plain Layout
12386
12387 \emph on
12388 type
12389 \end_layout
12390
12391 \end_inset
12392
12393  automatically defines the corresponding counter with name 
12394 \begin_inset Flex CharStyle:Code
12395 status collapsed
12396
12397 \begin_layout Plain Layout
12398
12399 \emph on
12400 type
12401 \end_layout
12402
12403 \end_inset
12404
12405 .
12406 \end_layout
12407
12408 \begin_layout Subsection
12409 Flex insets and InsetLayout
12410 \begin_inset CommandInset label
12411 LatexCommand label
12412 name "sub:Flex-insets-and"
12413
12414 \end_inset
12415
12416
12417 \end_layout
12418
12419 \begin_layout Standard
12420 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
12421  these are called Flex insets.
12422  
12423 \end_layout
12424
12425 \begin_layout Standard
12426 Flex insets come in three different kinds: 
12427 \end_layout
12428
12429 \begin_layout Itemize
12430 character style (
12431 \begin_inset Flex CharStyle:Code
12432 status collapsed
12433
12434 \begin_layout Plain Layout
12435 CharStyle
12436 \end_layout
12437
12438 \end_inset
12439
12440 ): These define semantic markup corresponding to such LaTeX commands as
12441  
12442 \begin_inset Flex CharStyle:Code
12443 status collapsed
12444
12445 \begin_layout Plain Layout
12446
12447 \backslash
12448 noun
12449 \end_layout
12450
12451 \end_inset
12452
12453  and 
12454 \begin_inset Flex CharStyle:Code
12455 status collapsed
12456
12457 \begin_layout Plain Layout
12458
12459 \backslash
12460 code
12461 \end_layout
12462
12463 \end_inset
12464
12465 .
12466 \end_layout
12467
12468 \begin_layout Itemize
12469 user custom (
12470 \begin_inset Flex CharStyle:Code
12471 status collapsed
12472
12473 \begin_layout Plain Layout
12474 Custom
12475 \end_layout
12476
12477 \end_inset
12478
12479 ): These can be used to define custom collapsible insets, similar to TeX
12480  code, footnote, and the like.
12481  An obvious example is an endnote inset, which is defined in the 
12482 \begin_inset Flex CharStyle:Code
12483 status collapsed
12484
12485 \begin_layout Plain Layout
12486 endnote
12487 \end_layout
12488
12489 \end_inset
12490
12491  module.
12492 \end_layout
12493
12494 \begin_layout Itemize
12495 XML elements (
12496 \begin_inset Flex CharStyle:Code
12497 status collapsed
12498
12499 \begin_layout Plain Layout
12500 Element
12501 \end_layout
12502
12503 \end_inset
12504
12505 ): For use with DocBook classes.
12506 \end_layout
12507
12508 \begin_layout Standard
12509 Flex insets are defined using the 
12510 \begin_inset Flex CharStyle:Code
12511 status collapsed
12512
12513 \begin_layout Plain Layout
12514 InsetLayout
12515 \end_layout
12516
12517 \end_inset
12518
12519  tag, which shall be explained in a moment.
12520 \end_layout
12521
12522 \begin_layout Standard
12523 The 
12524 \begin_inset Flex CharStyle:Code
12525 status collapsed
12526
12527 \begin_layout Plain Layout
12528 InsetLayout
12529 \end_layout
12530
12531 \end_inset
12532
12533  tag also serves another function: It can be used to customize the general
12534  layout of many different types of insets.
12535  Currently, 
12536 \begin_inset Flex CharStyle:Code
12537 status collapsed
12538
12539 \begin_layout Plain Layout
12540 InsetLayout
12541 \end_layout
12542
12543 \end_inset
12544
12545  can be used to customize the layout parameters for footnotes, marginal
12546  notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
12547  boxes, tables, algorithms, URLs, and optional arguments, as well as to
12548  define Flex insets.
12549 \end_layout
12550
12551 \begin_layout Standard
12552 The 
12553 \begin_inset Flex CharStyle:Code
12554 status collapsed
12555
12556 \begin_layout Plain Layout
12557 InsetLayout
12558 \end_layout
12559
12560 \end_inset
12561
12562  definition must begin with a line of the form:
12563 \end_layout
12564
12565 \begin_layout LyX-Code
12566 InsetLayout <Type>
12567 \end_layout
12568
12569 \begin_layout Standard
12570 Here 
12571 \begin_inset Flex CharStyle:Code
12572 status collapsed
12573
12574 \begin_layout Plain Layout
12575 <Type>
12576 \end_layout
12577
12578 \end_inset
12579
12580  indicates the inset whose layout is being defined, and here there are two
12581  cases.
12582 \end_layout
12583
12584 \begin_layout Enumerate
12585 The layout for a pre-existing inset is being modified.
12586  In this case, can be 
12587 \begin_inset Flex CharStyle:Code
12588 status collapsed
12589
12590 \begin_layout Plain Layout
12591 <Type>
12592 \end_layout
12593
12594 \end_inset
12595
12596  any one of the following: 
12597 \begin_inset Flex CharStyle:Code
12598 status collapsed
12599
12600 \begin_layout Plain Layout
12601 Algorithm
12602 \end_layout
12603
12604 \end_inset
12605
12606
12607 \begin_inset Flex CharStyle:Code
12608 status collapsed
12609
12610 \begin_layout Plain Layout
12611 Branch
12612 \end_layout
12613
12614 \end_inset
12615
12616
12617 \begin_inset Flex CharStyle:Code
12618 status collapsed
12619
12620 \begin_layout Plain Layout
12621 Box
12622 \end_layout
12623
12624 \end_inset
12625
12626
12627 \begin_inset Flex CharStyle:Code
12628 status collapsed
12629
12630 \begin_layout Plain Layout
12631 Box:shaded
12632 \end_layout
12633
12634 \end_inset
12635
12636
12637 \begin_inset Flex CharStyle:Code
12638 status collapsed
12639
12640 \begin_layout Plain Layout
12641 ERT
12642 \end_layout
12643
12644 \end_inset
12645
12646
12647 \begin_inset Flex CharStyle:Code
12648 status collapsed
12649
12650 \begin_layout Plain Layout
12651 Figure
12652 \end_layout
12653
12654 \end_inset
12655
12656
12657 \begin_inset Flex CharStyle:Code
12658 status collapsed
12659
12660 \begin_layout Plain Layout
12661 Foot
12662 \end_layout
12663
12664 \end_inset
12665
12666
12667 \begin_inset Flex CharStyle:Code
12668 status collapsed
12669
12670 \begin_layout Plain Layout
12671 Index
12672 \end_layout
12673
12674 \end_inset
12675
12676
12677 \begin_inset Flex CharStyle:Code
12678 status collapsed
12679
12680 \begin_layout Plain Layout
12681 Info
12682 \end_layout
12683
12684 \end_inset
12685
12686
12687 \begin_inset Flex CharStyle:Code
12688 status collapsed
12689
12690 \begin_layout Plain Layout
12691 Info:menu
12692 \end_layout
12693
12694 \end_inset
12695
12696
12697 \begin_inset Flex CharStyle:Code
12698 status collapsed
12699
12700 \begin_layout Plain Layout
12701 Info:shortcut
12702 \end_layout
12703
12704 \end_inset
12705
12706
12707 \begin_inset Flex CharStyle:Code
12708 status collapsed
12709
12710 \begin_layout Plain Layout
12711 Info:shortcuts
12712 \end_layout
12713
12714 \end_inset
12715
12716
12717 \begin_inset Flex CharStyle:Code
12718 status collapsed
12719
12720 \begin_layout Plain Layout
12721 Listings
12722 \end_layout
12723
12724 \end_inset
12725
12726
12727 \begin_inset Flex CharStyle:Code
12728 status collapsed
12729
12730 \begin_layout Plain Layout
12731 Marginal
12732 \end_layout
12733
12734 \end_inset
12735
12736
12737 \begin_inset Flex CharStyle:Code
12738 status collapsed
12739
12740 \begin_layout Plain Layout
12741 Note:Comment
12742 \end_layout
12743
12744 \end_inset
12745
12746
12747 \begin_inset Flex CharStyle:Code
12748 status collapsed
12749
12750 \begin_layout Plain Layout
12751 Note:Note
12752 \end_layout
12753
12754 \end_inset
12755
12756
12757 \begin_inset Flex CharStyle:Code
12758 status collapsed
12759
12760 \begin_layout Plain Layout
12761 Note:GreyedOut
12762 \end_layout
12763
12764 \end_inset
12765
12766
12767 \begin_inset Flex CharStyle:Code
12768 status collapsed
12769
12770 \begin_layout Plain Layout
12771 OptArg
12772 \end_layout
12773
12774 \end_inset
12775
12776
12777 \begin_inset Flex CharStyle:Code
12778 status collapsed
12779
12780 \begin_layout Plain Layout
12781 Table
12782 \end_layout
12783
12784 \end_inset
12785
12786 , or 
12787 \begin_inset Flex CharStyle:Code
12788 status collapsed
12789
12790 \begin_layout Plain Layout
12791 URL
12792 \end_layout
12793
12794 \end_inset
12795
12796 .
12797 \end_layout
12798
12799 \begin_layout Enumerate
12800 The layout for a Flex inset is being defined.
12801  In this case, 
12802 \begin_inset Flex CharStyle:Code
12803 status collapsed
12804
12805 \begin_layout Plain Layout
12806 <Type>
12807 \end_layout
12808
12809 \end_inset
12810
12811  can be any valid identifier not used by a pre-existing inset.
12812  Note that the definition of a flex inset must
12813 \emph on
12814  als
12815 \emph default
12816 o include a 
12817 \begin_inset Flex CharStyle:Code
12818 status collapsed
12819
12820 \begin_layout Plain Layout
12821 LyXType
12822 \end_layout
12823
12824 \end_inset
12825
12826  entry.
12827 \end_layout
12828
12829 \begin_layout Standard
12830 The 
12831 \begin_inset Flex CharStyle:Code
12832 status collapsed
12833
12834 \begin_layout Plain Layout
12835 InsetLayout
12836 \end_layout
12837
12838 \end_inset
12839
12840  definition can contain the following entries:
12841 \end_layout
12842
12843 \begin_layout Description
12844 \begin_inset Flex CharStyle:Code
12845 status collapsed
12846
12847 \begin_layout Plain Layout
12848 BgColor
12849 \end_layout
12850
12851 \end_inset
12852
12853  The color for the inset's background.
12854  The valid colors are defined in 
12855 \begin_inset Flex CharStyle:Code
12856 status collapsed
12857
12858 \begin_layout Plain Layout
12859 src/ColorCode.h
12860 \end_layout
12861
12862 \end_inset
12863
12864 .
12865 \end_layout
12866
12867 \begin_layout Description
12868 \begin_inset Flex CharStyle:Code
12869 status collapsed
12870
12871 \begin_layout Plain Layout
12872 CopyStyle
12873 \end_layout
12874
12875 \end_inset
12876
12877  As with paragraph styles (see page 
12878 \begin_inset CommandInset ref
12879 LatexCommand ref
12880 reference "des:CopyStyle"
12881
12882 \end_inset
12883
12884 ).
12885 \end_layout
12886
12887 \begin_layout Description
12888 \begin_inset Flex CharStyle:Code
12889 status collapsed
12890
12891 \begin_layout Plain Layout
12892 CustomPars
12893 \end_layout
12894
12895 \end_inset
12896
12897  [
12898 \begin_inset Flex CharStyle:Code
12899 status collapsed
12900
12901 \begin_layout Plain Layout
12902
12903 \emph on
12904 0
12905 \end_layout
12906
12907 \end_inset
12908
12909 ,
12910 \begin_inset Flex CharStyle:Code
12911 status collapsed
12912
12913 \begin_layout Plain Layout
12914 1
12915 \end_layout
12916
12917 \end_inset
12918
12919 ] Indicates whether the user may employ the Paragraph Settings dialog to
12920  customize the paragraph.
12921 \end_layout
12922
12923 \begin_layout Description
12924 \begin_inset Flex CharStyle:Code
12925 status collapsed
12926
12927 \begin_layout Plain Layout
12928 Decoration
12929 \end_layout
12930
12931 \end_inset
12932
12933  can be 
12934 \begin_inset Flex CharStyle:Code
12935 status collapsed
12936
12937 \begin_layout Plain Layout
12938 Classic
12939 \end_layout
12940
12941 \end_inset
12942
12943
12944 \begin_inset Flex CharStyle:Code
12945 status collapsed
12946
12947 \begin_layout Plain Layout
12948 Minimalistic
12949 \end_layout
12950
12951 \end_inset
12952
12953 , or 
12954 \begin_inset Flex CharStyle:Code
12955 status collapsed
12956
12957 \begin_layout Plain Layout
12958 Conglomerate
12959 \end_layout
12960
12961 \end_inset
12962
12963 , describing the rendering style used for the inset's frame and buttons.
12964  Footnotes generally use 
12965 \begin_inset Flex CharStyle:Code
12966 status collapsed
12967
12968 \begin_layout Plain Layout
12969 Classic
12970 \end_layout
12971
12972 \end_inset
12973
12974 , ERT insets generally 
12975 \begin_inset Flex CharStyle:Code
12976 status collapsed
12977
12978 \begin_layout Plain Layout
12979 Minimalistic
12980 \end_layout
12981
12982 \end_inset
12983
12984 , and character styles 
12985 \begin_inset Flex CharStyle:Code
12986 status collapsed
12987
12988 \begin_layout Plain Layout
12989 Conglomerate
12990 \end_layout
12991
12992 \end_inset
12993
12994 .
12995 \end_layout
12996
12997 \begin_layout Description
12998 \begin_inset Flex CharStyle:Code
12999 status collapsed
13000
13001 \begin_layout Plain Layout
13002 End
13003 \end_layout
13004
13005 \end_inset
13006
13007  Required at the end of the InsetLayout declarations.
13008 \end_layout
13009
13010 \begin_layout Description
13011 \begin_inset Flex CharStyle:Code
13012 status collapsed
13013
13014 \begin_layout Plain Layout
13015 Font
13016 \end_layout
13017
13018 \end_inset
13019
13020  The font used for both the text body 
13021 \emph on
13022 and
13023 \emph default
13024  the label.
13025  See section
13026 \begin_inset space ~
13027 \end_inset
13028
13029
13030 \begin_inset CommandInset ref
13031 LatexCommand ref
13032 reference "sub:Font-description"
13033
13034 \end_inset
13035
13036 .
13037  Note that defining this font automatically defines the 
13038 \begin_inset Flex CharStyle:Code
13039 status collapsed
13040
13041 \begin_layout Plain Layout
13042 LabelFont
13043 \end_layout
13044
13045 \end_inset
13046
13047  to the same value, so define this first and define 
13048 \begin_inset Flex CharStyle:Code
13049 status collapsed
13050
13051 \begin_layout Plain Layout
13052 LabelFont
13053 \end_layout
13054
13055 \end_inset
13056
13057  later if you want them to be different.
13058 \end_layout
13059
13060 \begin_layout Description
13061 \begin_inset Flex CharStyle:Code
13062 status collapsed
13063
13064 \begin_layout Plain Layout
13065 ForceLTR
13066 \end_layout
13067
13068 \end_inset
13069
13070  Force the 
13071 \begin_inset Quotes eld
13072 \end_inset
13073
13074 latex
13075 \begin_inset Quotes erd
13076 \end_inset
13077
13078  language, leading to Left-to-Right (latin) output, e.
13079 \begin_inset space \thinspace{}
13080 \end_inset
13081
13082 g.
13083 \begin_inset space \space{}
13084 \end_inset
13085
13086 in TeX code or URL.
13087  A kludge.
13088 \end_layout
13089
13090 \begin_layout Description
13091 \begin_inset Flex CharStyle:Code
13092 status collapsed
13093
13094 \begin_layout Plain Layout
13095 ForcePlain
13096 \end_layout
13097
13098 \end_inset
13099
13100  [
13101 \begin_inset Flex CharStyle:Code
13102 status collapsed
13103
13104 \begin_layout Plain Layout
13105
13106 \emph on
13107 0
13108 \end_layout
13109
13110 \end_inset
13111
13112 ,
13113 \begin_inset Flex CharStyle:Code
13114 status collapsed
13115
13116 \begin_layout Plain Layout
13117 1
13118 \end_layout
13119
13120 \end_inset
13121
13122 ] Indicates whether the PlainLayout should be used or, instead, the user
13123  can change the paragraph style used in the inset.
13124 \end_layout
13125
13126 \begin_layout Description
13127 \begin_inset Flex CharStyle:Code
13128 status collapsed
13129
13130 \begin_layout Plain Layout
13131 FreeSpacing
13132 \end_layout
13133
13134 \end_inset
13135
13136  As with paragraph styles (see page 
13137 \begin_inset CommandInset ref
13138 LatexCommand pageref
13139 reference "des:FreeSpacing"
13140
13141 \end_inset
13142
13143 ).
13144 \end_layout
13145
13146 \begin_layout Description
13147 \begin_inset Flex CharStyle:Code
13148 status collapsed
13149
13150 \begin_layout Plain Layout
13151 InToc
13152 \end_layout
13153
13154 \end_inset
13155
13156  [
13157 \begin_inset Flex CharStyle:Code
13158 status collapsed
13159
13160 \begin_layout Plain Layout
13161
13162 \emph on
13163 0
13164 \end_layout
13165
13166 \end_inset
13167
13168 ,
13169 \begin_inset Flex CharStyle:Code
13170 status collapsed
13171
13172 \begin_layout Plain Layout
13173 1
13174 \end_layout
13175
13176 \end_inset
13177
13178 ] Whether to include the contents of this inset in the strings generated
13179  for the `Outline' pane.
13180  One would not, for example, want the content of a footnote in a section
13181  header to be included in the TOC displayed in the outline, but one would
13182  normally want the content of a character style displayed.
13183  Default is false: not to include.
13184 \end_layout
13185
13186 \begin_layout Description
13187 \begin_inset Flex CharStyle:Code
13188 status collapsed
13189
13190 \begin_layout Plain Layout
13191 KeepEmpty
13192 \end_layout
13193
13194 \end_inset
13195
13196  As with paragraph styles (see page 
13197 \begin_inset CommandInset ref
13198 LatexCommand pageref
13199 reference "des:KeepEmpty"
13200
13201 \end_inset
13202
13203 ).
13204 \end_layout
13205
13206 \begin_layout Description
13207 \begin_inset Flex CharStyle:Code
13208 status collapsed
13209
13210 \begin_layout Plain Layout
13211 LabelFont
13212 \end_layout
13213
13214 \end_inset
13215
13216  The font used for the label.
13217  See section
13218 \begin_inset space ~
13219 \end_inset
13220
13221
13222 \begin_inset CommandInset ref
13223 LatexCommand ref
13224 reference "sub:Font-description"
13225
13226 \end_inset
13227
13228 .
13229  Note that this definition can never appear before 
13230 \begin_inset Flex CharStyle:Code
13231 status collapsed
13232
13233 \begin_layout Plain Layout
13234 Font
13235 \end_layout
13236
13237 \end_inset
13238
13239 , lest it be ineffective.
13240 \end_layout
13241
13242 \begin_layout Description
13243 \begin_inset Flex CharStyle:Code
13244 status collapsed
13245
13246 \begin_layout Plain Layout
13247 LabelString
13248 \end_layout
13249
13250 \end_inset
13251
13252  What will be displayed on the button or elsewhere as the inset label.
13253  Some inset types (TeX code and Branch) modify this label on the fly.
13254 \end_layout
13255
13256 \begin_layout Description
13257 \begin_inset Flex CharStyle:Code
13258 status collapsed
13259
13260 \begin_layout Plain Layout
13261 LatexName
13262 \end_layout
13263
13264 \end_inset
13265
13266  The name of the corresponding LaTeX stuff.
13267  Either the environment or command name.
13268 \end_layout
13269
13270 \begin_layout Description
13271 \begin_inset Flex CharStyle:Code
13272 status collapsed
13273
13274 \begin_layout Plain Layout
13275 LatexParam
13276 \end_layout
13277
13278 \end_inset
13279
13280  The optional parameter for the corresponding 
13281 \begin_inset Flex CharStyle:Code
13282 status collapsed
13283
13284 \begin_layout Plain Layout
13285 LatexName
13286 \end_layout
13287
13288 \end_inset
13289
13290  stuff, including possible bracket pairs like 
13291 \begin_inset Flex CharStyle:Code
13292 status collapsed
13293
13294 \begin_layout Plain Layout
13295 []
13296 \end_layout
13297
13298 \end_inset
13299
13300 .
13301  This parameter cannot be changed from within LyX.
13302 \end_layout
13303
13304 \begin_layout Description
13305 \begin_inset Flex CharStyle:Code
13306 status collapsed
13307
13308 \begin_layout Plain Layout
13309 LatexType
13310 \end_layout
13311
13312 \end_inset
13313
13314  As with paragraph styles (see page 
13315 \begin_inset CommandInset ref
13316 LatexCommand pageref
13317 reference "des:LatexType"
13318
13319 \end_inset
13320
13321 ).
13322 \end_layout
13323
13324 \begin_layout Description
13325 \begin_inset Flex CharStyle:Code
13326 status collapsed
13327
13328 \begin_layout Plain Layout
13329 LyxType 
13330 \end_layout
13331
13332 \end_inset
13333
13334  Can be 
13335 \begin_inset Flex CharStyle:Code
13336 status collapsed
13337
13338 \begin_layout Plain Layout
13339 charstyle
13340 \end_layout
13341
13342 \end_inset
13343
13344
13345 \begin_inset Flex CharStyle:Code
13346 status collapsed
13347
13348 \begin_layout Plain Layout
13349 custom
13350 \end_layout
13351
13352 \end_inset
13353
13354
13355 \begin_inset Flex CharStyle:Code
13356 status collapsed
13357
13358 \begin_layout Plain Layout
13359 element
13360 \end_layout
13361
13362 \end_inset
13363
13364 , or 
13365 \begin_inset Flex CharStyle:Code
13366 status collapsed
13367
13368 \begin_layout Plain Layout
13369 end
13370 \end_layout
13371
13372 \end_inset
13373
13374  (indicating a dummy definition ending definitions of charstyles, etc).
13375  This entry is required in and is only meaningful for Flex insets.
13376  Among other things, it determines on which menu this inset will appear.
13377 \end_layout
13378
13379 \begin_layout Description
13380 \begin_inset Flex CharStyle:Code
13381 status collapsed
13382
13383 \begin_layout Plain Layout
13384 MultiPar
13385 \end_layout
13386
13387 \end_inset
13388
13389  [
13390 \begin_inset Flex CharStyle:Code
13391 status collapsed
13392
13393 \begin_layout Plain Layout
13394
13395 \emph on
13396 0
13397 \end_layout
13398
13399 \end_inset
13400
13401 ,
13402 \begin_inset Flex CharStyle:Code
13403 status collapsed
13404
13405 \begin_layout Plain Layout
13406 1
13407 \end_layout
13408
13409 \end_inset
13410
13411 ] Whether multiple paragraphs are permitted in this inset.
13412  This will also set CustomPars to the same value and ForcePlain to the opposite
13413  value.
13414  These can be reset to other values, if they are used 
13415 \emph on
13416 after
13417 \emph default
13418  MultiPar.
13419 \end_layout
13420
13421 \begin_layout Description
13422 \begin_inset Flex CharStyle:Code
13423 status collapsed
13424
13425 \begin_layout Plain Layout
13426 NeedProtect
13427 \end_layout
13428
13429 \end_inset
13430
13431  [
13432 \begin_inset Flex CharStyle:Code
13433 status collapsed
13434
13435 \begin_layout Plain Layout
13436
13437 \emph on
13438 0
13439 \end_layout
13440
13441 \end_inset
13442
13443 ,
13444 \begin_inset Flex CharStyle:Code
13445 status collapsed
13446
13447 \begin_layout Plain Layout
13448 1
13449 \end_layout
13450
13451 \end_inset
13452
13453 ] Whether fragile commands in this layout should be 
13454 \begin_inset Flex CharStyle:Code
13455 status collapsed
13456
13457 \begin_layout Plain Layout
13458
13459 \backslash
13460 protect
13461 \end_layout
13462
13463 \end_inset
13464
13465 'ed.
13466  (Note: This is 
13467 \emph on
13468 not
13469 \emph default
13470  whether the command should itself be protected.)
13471 \end_layout
13472
13473 \begin_layout Description
13474 \begin_inset Flex CharStyle:Code
13475 status collapsed
13476
13477 \begin_layout Plain Layout
13478 PassThru
13479 \end_layout
13480
13481 \end_inset
13482
13483  [
13484 \begin_inset Flex CharStyle:Code
13485 status collapsed
13486
13487 \begin_layout Plain Layout
13488
13489 \emph on
13490 0
13491 \end_layout
13492
13493 \end_inset
13494
13495 ,
13496 \begin_inset Flex CharStyle:Code
13497 status collapsed
13498
13499 \begin_layout Plain Layout
13500 1
13501 \end_layout
13502
13503 \end_inset
13504
13505 ] As with paragraph styles (see page 
13506 \begin_inset CommandInset ref
13507 LatexCommand ref
13508 reference "des:PathThru"
13509
13510 \end_inset
13511
13512 ).
13513 \end_layout
13514
13515 \begin_layout Description
13516 \begin_inset Flex CharStyle:Code
13517 status collapsed
13518
13519 \begin_layout Plain Layout
13520 Preamble
13521 \end_layout
13522
13523 \end_inset
13524
13525  As with paragraph styles (see page 
13526 \begin_inset CommandInset ref
13527 LatexCommand pageref
13528 reference "des:Preamble"
13529
13530 \end_inset
13531
13532 ).
13533 \end_layout
13534
13535 \begin_layout Description
13536 \begin_inset Flex CharStyle:Code
13537 status collapsed
13538
13539 \begin_layout Plain Layout
13540 Requires 
13541 \end_layout
13542
13543 \end_inset
13544
13545  [
13546 \begin_inset Flex CharStyle:Code
13547 status collapsed
13548
13549 \begin_layout Plain Layout
13550 string
13551 \end_layout
13552
13553 \end_inset
13554
13555 ] As with paragraph styles (see page 
13556 \begin_inset CommandInset ref
13557 LatexCommand pageref
13558 reference "des:Requires"
13559
13560 \end_inset
13561
13562 ).
13563 \end_layout
13564
13565 \begin_layout Subsection
13566 Counters
13567 \begin_inset CommandInset label
13568 LatexCommand label
13569 name "sub:Counters"
13570
13571 \end_inset
13572
13573
13574 \end_layout
13575
13576 \begin_layout Standard
13577 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13578  counters (
13579 \begin_inset Flex CharStyle:MenuItem
13580 status collapsed
13581
13582 \begin_layout Plain Layout
13583 chapter
13584 \end_layout
13585
13586 \end_inset
13587
13588
13589 \begin_inset Flex CharStyle:MenuItem
13590 status collapsed
13591
13592 \begin_layout Plain Layout
13593 figure
13594 \end_layout
13595
13596 \end_inset
13597
13598 , \SpecialChar \ldots{}
13599 ) in the text class itself.
13600  The standard counters are defined in the file 
13601 \begin_inset Flex CharStyle:Code
13602 status collapsed
13603
13604 \begin_layout Plain Layout
13605 stdcounters.inc
13606 \end_layout
13607
13608 \end_inset
13609
13610 , so you may have to do no more than add
13611 \end_layout
13612
13613 \begin_layout LyX-Code
13614 Input stdcounters.inc
13615 \end_layout
13616
13617 \begin_layout Standard
13618 to your layout file to get them to work.
13619  But if you want to define custom counters, then you can do so.
13620  The counter declaration must begin with:
13621 \end_layout
13622
13623 \begin_layout LyX-Code
13624 Counter CounterName
13625 \end_layout
13626
13627 \begin_layout Standard
13628 where of course `
13629 \begin_inset Flex CharStyle:Code
13630 status collapsed
13631
13632 \begin_layout Plain Layout
13633 CounterName
13634 \end_layout
13635
13636 \end_inset
13637
13638 ' is replaced by the name of the counter.
13639  And it must end with 
13640 \begin_inset Quotes eld
13641 \end_inset
13642
13643
13644 \begin_inset Flex CharStyle:Code
13645 status collapsed
13646
13647 \begin_layout Plain Layout
13648 End
13649 \end_layout
13650
13651 \end_inset
13652
13653
13654 \begin_inset Quotes erd
13655 \end_inset
13656
13657 .
13658  The following parameters can also be used:
13659 \end_layout
13660
13661 \begin_layout Description
13662 \begin_inset Flex CharStyle:Code
13663 status collapsed
13664
13665 \begin_layout Plain Layout
13666 LabelString [string=""]
13667 \end_layout
13668
13669 \end_inset
13670
13671  when this is defined, this string defines how the counter is displayed.
13672  Setting this value sets 
13673 \begin_inset Flex CharStyle:Code
13674 status collapsed
13675
13676 \begin_layout Plain Layout
13677 LabelStringAppendix
13678 \end_layout
13679
13680 \end_inset
13681
13682  to the same value.
13683  The following special constructs can be used in the string:
13684 \end_layout
13685
13686 \begin_deeper
13687 \begin_layout Itemize
13688 \begin_inset Flex CharStyle:Code
13689 status collapsed
13690
13691 \begin_layout Plain Layout
13692
13693 \backslash
13694 thecounter
13695 \end_layout
13696
13697 \end_inset
13698
13699  will be replaced by the expansion of the 
13700 \begin_inset Flex CharStyle:Code
13701 status collapsed
13702
13703 \begin_layout Plain Layout
13704 LabelString
13705 \end_layout
13706
13707 \end_inset
13708
13709  (or 
13710 \begin_inset Flex CharStyle:Code
13711 status collapsed
13712
13713 \begin_layout Plain Layout
13714 LabelStringAppendix
13715 \end_layout
13716
13717 \end_inset
13718
13719 ) of the counter 
13720 \begin_inset Flex CharStyle:Code
13721 status collapsed
13722
13723 \begin_layout Plain Layout
13724 counter
13725 \end_layout
13726
13727 \end_inset
13728
13729 .
13730  
13731 \end_layout
13732
13733 \begin_layout Itemize
13734 counter values can be expressed using LaTeX-like macros 
13735 \begin_inset Flex CharStyle:Code
13736 status collapsed
13737
13738 \begin_layout Plain Layout
13739
13740 \backslash
13741
13742 \emph on
13743 numbertype
13744 \emph default
13745 {
13746 \emph on
13747 counter
13748 \emph default
13749 }
13750 \end_layout
13751
13752 \end_inset
13753
13754 , where 
13755 \begin_inset Flex CharStyle:Code
13756 status collapsed
13757
13758 \begin_layout Plain Layout
13759
13760 \emph on
13761 numbertype
13762 \end_layout
13763
13764 \end_inset
13765
13766  can be:
13767 \begin_inset Foot
13768 status collapsed
13769
13770 \begin_layout Plain Layout
13771
13772 \family roman
13773 \series medium
13774 \shape up
13775 \size normal
13776 \emph off
13777 \bar no
13778 \noun off
13779 \color none
13780 Actually, the situation is a bit more complicated: any
13781 \family default
13782 \series default
13783 \shape default
13784 \emph default
13785 \bar default
13786  
13787 \size default
13788 \emph on
13789 \noun default
13790 \color inherit
13791 numbertype
13792 \family roman
13793 \series medium
13794 \shape up
13795 \size normal
13796 \emph off
13797 \bar no
13798 \noun off
13799  other than those described below will produce arabic numerals.
13800  It would not be surprising to see this change in the future.
13801 \end_layout
13802
13803 \end_inset
13804
13805  
13806 \begin_inset Flex CharStyle:Code
13807 status collapsed
13808
13809 \begin_layout Plain Layout
13810 arabic
13811 \end_layout
13812
13813 \end_inset
13814
13815 : 1, 2, 3,\SpecialChar \ldots{}
13816
13817 \begin_inset Flex CharStyle:Code
13818 status collapsed
13819
13820 \begin_layout Plain Layout
13821 alph
13822 \end_layout
13823
13824 \end_inset
13825
13826  for lower-case letters: a, b, c, \SpecialChar \ldots{}
13827
13828 \begin_inset Flex CharStyle:Code
13829 status collapsed
13830
13831 \begin_layout Plain Layout
13832 Alph
13833 \end_layout
13834
13835 \end_inset
13836
13837  for upper-case letters: A, B, C, \SpecialChar \ldots{}
13838
13839 \begin_inset Flex CharStyle:Code
13840 status collapsed
13841
13842 \begin_layout Plain Layout
13843 roman
13844 \end_layout
13845
13846 \end_inset
13847
13848  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13849
13850 \begin_inset Flex CharStyle:Code
13851 status collapsed
13852
13853 \begin_layout Plain Layout
13854 Roman
13855 \end_layout
13856
13857 \end_inset
13858
13859  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13860
13861 \begin_inset Flex CharStyle:Code
13862 status collapsed
13863
13864 \begin_layout Plain Layout
13865 hebrew
13866 \end_layout
13867
13868 \end_inset
13869
13870  for hebrew numerals.
13871 \end_layout
13872
13873 \end_deeper
13874 \begin_layout Standard
13875 If LabelString is not defined, a default value is constructed as follows:
13876  if the counter has a master counter 
13877 \begin_inset Flex CharStyle:Code
13878 status collapsed
13879
13880 \begin_layout Plain Layout
13881 master
13882 \end_layout
13883
13884 \end_inset
13885
13886  (defined via 
13887 \begin_inset Flex CharStyle:Code
13888 status collapsed
13889
13890 \begin_layout Plain Layout
13891 Within
13892 \end_layout
13893
13894 \end_inset
13895
13896 ), the string 
13897 \begin_inset Flex CharStyle:Code
13898 status collapsed
13899
13900 \begin_layout Plain Layout
13901
13902 \backslash
13903 themaster.
13904 \backslash
13905 arabic{counter}
13906 \end_layout
13907
13908 \end_inset
13909
13910  is used; otherwise the string 
13911 \begin_inset Flex CharStyle:Code
13912 status collapsed
13913
13914 \begin_layout Plain Layout
13915
13916 \backslash
13917 arabic{counter}
13918 \end_layout
13919
13920 \end_inset
13921
13922  is used.
13923 \end_layout
13924
13925 \begin_layout Description
13926 \begin_inset Flex CharStyle:Code
13927 status collapsed
13928
13929 \begin_layout Plain Layout
13930 LabelStringAppendix [string=""]
13931 \end_layout
13932
13933 \end_inset
13934
13935  Same as 
13936 \begin_inset Flex CharStyle:Code
13937 status collapsed
13938
13939 \begin_layout Plain Layout
13940 LabelString
13941 \end_layout
13942
13943 \end_inset
13944
13945 , but for use in the Appendix.
13946 \end_layout
13947
13948 \begin_layout Description
13949 \begin_inset Flex CharStyle:Code
13950 status collapsed
13951
13952 \begin_layout Plain Layout
13953 Within
13954 \end_layout
13955
13956 \end_inset
13957
13958  [
13959 \begin_inset Flex CharStyle:Code
13960 status collapsed
13961
13962 \begin_layout Plain Layout
13963 string
13964 \end_layout
13965
13966 \end_inset
13967
13968 =
13969 \begin_inset Quotes erd
13970 \end_inset
13971
13972
13973 \begin_inset Quotes erd
13974 \end_inset
13975
13976 ] If this is set to the name of another counter, the present counter will
13977  be reset every time the other one is increased.
13978  For example, 
13979 \begin_inset Flex CharStyle:Code
13980 status collapsed
13981
13982 \begin_layout Plain Layout
13983 subsection
13984 \end_layout
13985
13986 \end_inset
13987
13988  is numbered inside 
13989 \begin_inset Flex CharStyle:Code
13990 status collapsed
13991
13992 \begin_layout Plain Layout
13993 section
13994 \end_layout
13995
13996 \end_inset
13997
13998 .
13999 \end_layout
14000
14001 \begin_layout Subsection
14002 Font description
14003 \begin_inset CommandInset label
14004 LatexCommand label
14005 name "sub:Font-description"
14006
14007 \end_inset
14008
14009
14010 \end_layout
14011
14012 \begin_layout Standard
14013 A font description looks like this:
14014 \end_layout
14015
14016 \begin_layout LyX-Code
14017 Font 
14018 \family roman
14019 \emph on
14020 or
14021 \family default
14022 \emph default
14023  LabelFont
14024 \end_layout
14025
14026 \begin_layout LyX-Code
14027  ...
14028 \end_layout
14029
14030 \begin_layout LyX-Code
14031 EndFont
14032 \end_layout
14033
14034 \begin_layout Standard
14035 The following commands are available:
14036 \end_layout
14037
14038 \begin_layout Description
14039 \begin_inset Flex CharStyle:Code
14040 status collapsed
14041
14042 \begin_layout Plain Layout
14043 Color
14044 \end_layout
14045
14046 \end_inset
14047
14048  [
14049 \begin_inset Flex CharStyle:Code
14050 status collapsed
14051
14052 \begin_layout Plain Layout
14053
14054 \emph on
14055 none
14056 \end_layout
14057
14058 \end_inset
14059
14060
14061 \begin_inset Flex CharStyle:Code
14062 status collapsed
14063
14064 \begin_layout Plain Layout
14065 black
14066 \end_layout
14067
14068 \end_inset
14069
14070
14071 \begin_inset Flex CharStyle:Code
14072 status collapsed
14073
14074 \begin_layout Plain Layout
14075 white
14076 \end_layout
14077
14078 \end_inset
14079
14080
14081 \begin_inset Flex CharStyle:Code
14082 status collapsed
14083
14084 \begin_layout Plain Layout
14085 red
14086 \end_layout
14087
14088 \end_inset
14089
14090
14091 \begin_inset Flex CharStyle:Code
14092 status collapsed
14093
14094 \begin_layout Plain Layout
14095 green
14096 \end_layout
14097
14098 \end_inset
14099
14100
14101 \begin_inset Flex CharStyle:Code
14102 status collapsed
14103
14104 \begin_layout Plain Layout
14105 blue
14106 \end_layout
14107
14108 \end_inset
14109
14110
14111 \begin_inset Flex CharStyle:Code
14112 status collapsed
14113
14114 \begin_layout Plain Layout
14115 cyan
14116 \end_layout
14117
14118 \end_inset
14119
14120
14121 \begin_inset Flex CharStyle:Code
14122 status collapsed
14123
14124 \begin_layout Plain Layout
14125 magenta
14126 \end_layout
14127
14128 \end_inset
14129
14130
14131 \begin_inset Flex CharStyle:Code
14132 status collapsed
14133
14134 \begin_layout Plain Layout
14135 yellow
14136 \end_layout
14137
14138 \end_inset
14139
14140 ]
14141 \end_layout
14142
14143 \begin_layout Description
14144 \begin_inset Flex CharStyle:Code
14145 status collapsed
14146
14147 \begin_layout Plain Layout
14148 Family
14149 \end_layout
14150
14151 \end_inset
14152
14153  [
14154 \emph on
14155
14156 \begin_inset Flex CharStyle:Code
14157 status collapsed
14158
14159 \begin_layout Plain Layout
14160
14161 \emph on
14162 Roman
14163 \end_layout
14164
14165 \end_inset
14166
14167
14168 \emph default
14169
14170 \begin_inset Flex CharStyle:Code
14171 status collapsed
14172
14173 \begin_layout Plain Layout
14174 Sans
14175 \end_layout
14176
14177 \end_inset
14178
14179
14180 \begin_inset Flex CharStyle:Code
14181 status collapsed
14182
14183 \begin_layout Plain Layout
14184 Typewriter
14185 \end_layout
14186
14187 \end_inset
14188
14189
14190 \end_layout
14191
14192 \begin_layout Description
14193 \begin_inset Flex CharStyle:Code
14194 status collapsed
14195
14196 \begin_layout Plain Layout
14197 Misc
14198 \end_layout
14199
14200 \end_inset
14201
14202  [
14203 \begin_inset Flex CharStyle:Code
14204 status collapsed
14205
14206 \begin_layout Plain Layout
14207 string
14208 \end_layout
14209
14210 \end_inset
14211
14212 ] Valid arguments are: 
14213 \begin_inset Flex CharStyle:Code
14214 status collapsed
14215
14216 \begin_layout Plain Layout
14217 emph
14218 \end_layout
14219
14220 \end_inset
14221
14222
14223 \begin_inset Flex CharStyle:Code
14224 status collapsed
14225
14226 \begin_layout Plain Layout
14227 noun
14228 \end_layout
14229
14230 \end_inset
14231
14232
14233 \begin_inset Flex CharStyle:Code
14234 status collapsed
14235
14236 \begin_layout Plain Layout
14237 underbar
14238 \end_layout
14239
14240 \end_inset
14241
14242
14243 \begin_inset Flex CharStyle:Code
14244 status collapsed
14245
14246 \begin_layout Plain Layout
14247 no_emph
14248 \end_layout
14249
14250 \end_inset
14251
14252
14253 \begin_inset Flex CharStyle:Code
14254 status collapsed
14255
14256 \begin_layout Plain Layout
14257 no_noun
14258 \end_layout
14259
14260 \end_inset
14261
14262  and 
14263 \begin_inset Flex CharStyle:Code
14264 status collapsed
14265
14266 \begin_layout Plain Layout
14267 no_bar
14268 \end_layout
14269
14270 \end_inset
14271
14272 .
14273  Each of these turns on or off the corresponding attribute.
14274  For example, 
14275 \begin_inset Flex CharStyle:Code
14276 status collapsed
14277
14278 \begin_layout Plain Layout
14279 emph
14280 \end_layout
14281
14282 \end_inset
14283
14284  turns on emphasis, and 
14285 \begin_inset Flex CharStyle:Code
14286 status collapsed
14287
14288 \begin_layout Plain Layout
14289 no_emph
14290 \end_layout
14291
14292 \end_inset
14293
14294  turns it off.
14295  
14296 \begin_inset Newline newline
14297 \end_inset
14298
14299 If the latter seems puzzling, remember that the font settings for the present
14300  context are generally inherited from the surrounding context.
14301  So 
14302 \begin_inset Flex CharStyle:Code
14303 status collapsed
14304
14305 \begin_layout Plain Layout
14306 no_emph
14307 \end_layout
14308
14309 \end_inset
14310
14311  would turn off the emphasis that was anyway in effect, say, in a theorem
14312  environment.
14313 \end_layout
14314
14315 \begin_layout Description
14316 \begin_inset Flex CharStyle:Code
14317 status collapsed
14318
14319 \begin_layout Plain Layout
14320 Series
14321 \end_layout
14322
14323 \end_inset
14324
14325  [
14326 \emph on
14327
14328 \begin_inset Flex CharStyle:Code
14329 status collapsed
14330
14331 \begin_layout Plain Layout
14332
14333 \emph on
14334 Medium
14335 \end_layout
14336
14337 \end_inset
14338
14339
14340 \emph default
14341
14342 \begin_inset Flex CharStyle:Code
14343 status collapsed
14344
14345 \begin_layout Plain Layout
14346 Bold
14347 \end_layout
14348
14349 \end_inset
14350
14351
14352 \end_layout
14353
14354 \begin_layout Description
14355 \begin_inset Flex CharStyle:Code
14356 status collapsed
14357
14358 \begin_layout Plain Layout
14359 Shape
14360 \end_layout
14361
14362 \end_inset
14363
14364  [
14365 \emph on
14366
14367 \begin_inset Flex CharStyle:Code
14368 status collapsed
14369
14370 \begin_layout Plain Layout
14371
14372 \emph on
14373 Up
14374 \end_layout
14375
14376 \end_inset
14377
14378
14379 \emph default
14380
14381 \begin_inset Flex CharStyle:Code
14382 status collapsed
14383
14384 \begin_layout Plain Layout
14385 Italic
14386 \end_layout
14387
14388 \end_inset
14389
14390
14391 \begin_inset Flex CharStyle:Code
14392 status collapsed
14393
14394 \begin_layout Plain Layout
14395 SmallCaps
14396 \end_layout
14397
14398 \end_inset
14399
14400
14401 \begin_inset Flex CharStyle:Code
14402 status collapsed
14403
14404 \begin_layout Plain Layout
14405 Slanted
14406 \end_layout
14407
14408 \end_inset
14409
14410
14411 \end_layout
14412
14413 \begin_layout Description
14414 \begin_inset Flex CharStyle:Code
14415 status collapsed
14416
14417 \begin_layout Plain Layout
14418 Size
14419 \end_layout
14420
14421 \end_inset
14422
14423  [
14424 \begin_inset Flex CharStyle:Code
14425 status collapsed
14426
14427 \begin_layout Plain Layout
14428 tiny
14429 \end_layout
14430
14431 \end_inset
14432
14433
14434 \begin_inset Flex CharStyle:Code
14435 status collapsed
14436
14437 \begin_layout Plain Layout
14438 small
14439 \end_layout
14440
14441 \end_inset
14442
14443
14444 \begin_inset Flex CharStyle:Code
14445 status collapsed
14446
14447 \begin_layout Plain Layout
14448
14449 \emph on
14450 normal
14451 \end_layout
14452
14453 \end_inset
14454
14455
14456 \begin_inset Flex CharStyle:Code
14457 status collapsed
14458
14459 \begin_layout Plain Layout
14460 large
14461 \end_layout
14462
14463 \end_inset
14464
14465
14466 \begin_inset Flex CharStyle:Code
14467 status collapsed
14468
14469 \begin_layout Plain Layout
14470 larger
14471 \end_layout
14472
14473 \end_inset
14474
14475
14476 \begin_inset Flex CharStyle:Code
14477 status collapsed
14478
14479 \begin_layout Plain Layout
14480 largest
14481 \end_layout
14482
14483 \end_inset
14484
14485
14486 \begin_inset Flex CharStyle:Code
14487 status collapsed
14488
14489 \begin_layout Plain Layout
14490 huge
14491 \end_layout
14492
14493 \end_inset
14494
14495
14496 \begin_inset Flex CharStyle:Code
14497 status collapsed
14498
14499 \begin_layout Plain Layout
14500 giant
14501 \end_layout
14502
14503 \end_inset
14504
14505 ]
14506 \end_layout
14507
14508 \begin_layout Subsection
14509 Upgrading old layout files
14510 \end_layout
14511
14512 \begin_layout Standard
14513 The file format of layout files changes from time to time, so old layout
14514  files need to be converted.
14515  This process has been automated since LyX 1.4.0: If LyX reads an old format
14516  layout file it will call the conversion tool 
14517 \begin_inset Flex CharStyle:Code
14518 status collapsed
14519
14520 \begin_layout Plain Layout
14521 LyXDir/scripts/layout2layout.py
14522 \end_layout
14523
14524 \end_inset
14525
14526  and convert it to a temporary file in current format.
14527  The original file is left untouched.
14528  If you want to convert the layout file permanently, just call the converter
14529  by hand:
14530 \end_layout
14531
14532 \begin_layout LyX-Code
14533 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14534 \end_layout
14535
14536 \begin_layout Standard
14537 (You need to replace 
14538 \begin_inset Flex CharStyle:Code
14539 status collapsed
14540
14541 \begin_layout Plain Layout
14542 $LyXDir
14543 \end_layout
14544
14545 \end_inset
14546
14547  with the name of your LyX system directory, unless you happen to have defined
14548  such an environment variable.) Then copy 
14549 \begin_inset Flex CharStyle:Code
14550 status collapsed
14551
14552 \begin_layout Plain Layout
14553 myclassnew.layout
14554 \end_layout
14555
14556 \end_inset
14557
14558  to 
14559 \begin_inset Flex CharStyle:Code
14560 status collapsed
14561
14562 \begin_layout Plain Layout
14563 UserDir/layouts/
14564 \end_layout
14565
14566 \end_inset
14567
14568 .
14569 \end_layout
14570
14571 \begin_layout Standard
14572 The automatic conversion only handles syntax changes.
14573  It cannot handle the case where the contents of included files was changed,
14574  so these will have to be converted separately.
14575 \end_layout
14576
14577 \begin_layout Section
14578 Creating Templates
14579 \begin_inset CommandInset label
14580 LatexCommand label
14581 name "sec:Creating-Templates"
14582
14583 \end_inset
14584
14585
14586 \end_layout
14587
14588 \begin_layout Standard
14589 Templates are created just like usual documents.
14590  The only difference is that usual documents contain all possible settings,
14591  including the font scheme and the paper size.
14592  Usually a user doesn't want a template to overwrite his defaults in these
14593  cases.
14594  For that reason, the designer of a template should remove the corresponding
14595  commands like 
14596 \begin_inset Flex CharStyle:Code
14597 status collapsed
14598
14599 \begin_layout Plain Layout
14600
14601 \backslash
14602 fontscheme
14603 \end_layout
14604
14605 \end_inset
14606
14607  or 
14608 \begin_inset Flex CharStyle:Code
14609 status collapsed
14610
14611 \begin_layout Plain Layout
14612
14613 \backslash
14614 papersize
14615 \end_layout
14616
14617 \end_inset
14618
14619  from the template LyX file.
14620  This can be done with any simple text-editor, for example 
14621 \begin_inset Flex CharStyle:Code
14622 status collapsed
14623
14624 \begin_layout Plain Layout
14625 vi
14626 \end_layout
14627
14628 \end_inset
14629
14630  or 
14631 \begin_inset Flex CharStyle:Code
14632 status collapsed
14633
14634 \begin_layout Plain Layout
14635 xedit
14636 \end_layout
14637
14638 \end_inset
14639
14640 .
14641  
14642 \end_layout
14643
14644 \begin_layout Standard
14645 Put the edited template files you create in 
14646 \begin_inset Flex CharStyle:Code
14647 status collapsed
14648
14649 \begin_layout Plain Layout
14650 UserDir/templates/
14651 \end_layout
14652
14653 \end_inset
14654
14655 , copy the ones you use from the global template directory in 
14656 \begin_inset Flex CharStyle:Code
14657 status collapsed
14658
14659 \begin_layout Plain Layout
14660 LyXDir/templates/
14661 \end_layout
14662
14663 \end_inset
14664
14665  to the same place, and redefine the template path in the 
14666 \begin_inset Flex CharStyle:MenuItem
14667 status collapsed
14668
14669 \begin_layout Plain Layout
14670 Tools\SpecialChar \menuseparator
14671 Preferences\SpecialChar \menuseparator
14672 Paths
14673 \end_layout
14674
14675 \end_inset
14676
14677  dialog.
14678 \end_layout
14679
14680 \begin_layout Standard
14681 Note that there is a template which has a particular meaning: 
14682 \begin_inset Flex CharStyle:Code
14683 status collapsed
14684
14685 \begin_layout Plain Layout
14686 defaults.lyx
14687 \end_layout
14688
14689 \end_inset
14690
14691 .
14692  This template is loaded every time you create a new document with 
14693 \begin_inset Flex CharStyle:MenuItem
14694 status collapsed
14695
14696 \begin_layout Plain Layout
14697 File\SpecialChar \menuseparator
14698 New
14699 \end_layout
14700
14701 \end_inset
14702
14703  in order to provide useful defaults.
14704  To create this template from inside LyX, all you have to do is to open
14705  a document with the correct settings, and use the 
14706 \begin_inset Flex CharStyle:MenuItem
14707 status collapsed
14708
14709 \begin_layout Plain Layout
14710 Save as Document Defaults
14711 \end_layout
14712
14713 \end_inset
14714
14715  button.
14716 \end_layout
14717
14718 \begin_layout Chapter
14719 Including External Material
14720 \end_layout
14721
14722 \begin_layout Standard
14723 \begin_inset Box Shadowbox
14724 position "t"
14725 hor_pos "c"
14726 has_inner_box 1
14727 inner_pos "t"
14728 use_parbox 0
14729 width "100col%"
14730 special "none"
14731 height "1in"
14732 height_special "totalheight"
14733 status open
14734
14735 \begin_layout Plain Layout
14736 WARNING: This portion of the documentation has not been updated for some
14737  time.
14738  We certainly hope that it is still accurate, but there are no guarantees.
14739 \end_layout
14740
14741 \end_inset
14742
14743
14744 \end_layout
14745
14746 \begin_layout Standard
14747 The use of material from sources external to LyX is covered in detail in
14748  the 
14749 \emph on
14750 Embedded Objects
14751 \emph default
14752  manual.
14753  This part of the manual covers what needs to happen behind the scenes for
14754  new sorts of material to be included.
14755 \end_layout
14756
14757 \begin_layout Section
14758 How does it work?
14759 \end_layout
14760
14761 \begin_layout Standard
14762 The external material feature is based on the concept of a 
14763 \emph on
14764 template
14765 \emph default
14766 .
14767  A template is a specification of how LyX should interface with a certain
14768  kind of material.
14769  As bundled, LyX comes with predefined templates for Xfig figures, various
14770  raster format images, chess diagrams, and LilyPond music notation.
14771  You can check the actual list by using the menu 
14772 \begin_inset Flex CharStyle:MenuItem
14773 status collapsed
14774
14775 \begin_layout Plain Layout
14776 Insert\SpecialChar \menuseparator
14777 File\SpecialChar \menuseparator
14778 External Material
14779 \end_layout
14780
14781 \end_inset
14782
14783 .
14784  Furthermore, it is possible to roll your own template to support a specific
14785  kind of material.
14786  Later we'll describe in more detail what is involved, and hopefully you
14787  will submit all the templates you create so we can include them in a later
14788  LyX version.
14789 \end_layout
14790
14791 \begin_layout Standard
14792 Another basic idea of the external material feature is to distinguish between
14793  the original file that serves as a base for final material and the produced
14794  file that is included in your exported or printed document.
14795  For example, consider the case of a figure produced with 
14796 \begin_inset Flex CharStyle:Code
14797 status collapsed
14798
14799 \begin_layout Plain Layout
14800 Xfig
14801 \end_layout
14802
14803 \end_inset
14804
14805 .
14806  The Xfig application itself works on an original file with the 
14807 \begin_inset Flex CharStyle:Code
14808 status collapsed
14809
14810 \begin_layout Plain Layout
14811 .fig
14812 \end_layout
14813
14814 \end_inset
14815
14816  extension.
14817  Within Xfig, you create and change your figure, and when you are done,
14818  you save the 
14819 \begin_inset Flex CharStyle:Code
14820 status collapsed
14821
14822 \begin_layout Plain Layout
14823 fig
14824 \end_layout
14825
14826 \end_inset
14827
14828 -file.
14829  When you want to include the figure in your document, you invoke 
14830 \begin_inset Flex CharStyle:Code
14831 status collapsed
14832
14833 \begin_layout Plain Layout
14834 transfig
14835 \end_layout
14836
14837 \end_inset
14838
14839  in order to create a PostScript file that can readily be included in your
14840  LaTeX file.
14841  In this case, the 
14842 \begin_inset Flex CharStyle:Code
14843 status collapsed
14844
14845 \begin_layout Plain Layout
14846 .fig
14847 \end_layout
14848
14849 \end_inset
14850
14851  file is the original file, and the PostScript file is the produced file.
14852 \end_layout
14853
14854 \begin_layout Standard
14855 This distinction is important in order to allow updating of the material
14856  while you are in the process of writing the document.
14857  Furthermore, it provides us with the flexibility that is needed to support
14858  multiple export formats.
14859  For instance, in the case of a plain text file, it is not exactly an award-winn
14860 ing idea to include the figure as raw PostScript.
14861  Instead, you'd either prefer to just include a reference to the figure
14862  or try to invoke some graphics to ASCII converter to make the final result
14863  look similar to the real graphics.
14864  The external material management allows you to do this, because it is parametri
14865 zed on the different export formats that LyX supports.
14866 \end_layout
14867
14868 \begin_layout Standard
14869 Besides supporting the production of different products according to the
14870  exported format, it supports tight integration with editing and viewing
14871  applications.
14872  In the case of an Xfig figure, you are able to invoke Xfig on the original
14873  file with a single click from within the external material dialog in LyX,
14874  and also preview the produced PostScript file with Ghostview with another
14875  click.
14876  No more fiddling around with the command line and/or file browsers to locate
14877  and manipulate the original or produced files.
14878  In this way, you are finally able to take full advantage of the many different
14879  applications that are relevant to use when you write your documents, and
14880  ultimately be more productive.
14881 \end_layout
14882
14883 \begin_layout Section
14884 The external template configuration file
14885 \end_layout
14886
14887 \begin_layout Standard
14888 It is relatively easy to add custom external template definitions to LyX.
14889  However, be aware that doing this in an careless manner most probably 
14890 \emph on
14891 will
14892 \emph default
14893  introduce an easily exploitable security hole.
14894  So before you do this, please read the discussion about security in section
14895  
14896 \begin_inset CommandInset ref
14897 LatexCommand ref
14898 reference "sec:Security-discussion"
14899
14900 \end_inset
14901
14902 .
14903 \end_layout
14904
14905 \begin_layout Standard
14906 Having said that, we encourage you to submit any interesting templates that
14907  you create.
14908  
14909 \end_layout
14910
14911 \begin_layout Standard
14912 The external templates are defined in the 
14913 \begin_inset Flex CharStyle:Code
14914 status collapsed
14915
14916 \begin_layout Plain Layout
14917 LyXDir/lib/external_templates
14918 \end_layout
14919
14920 \end_inset
14921
14922  file.
14923  You can place your own version in 
14924 \begin_inset Flex CharStyle:Code
14925 status collapsed
14926
14927 \begin_layout Plain Layout
14928 UserDir/external_templates
14929 \end_layout
14930
14931 \end_inset
14932
14933 .
14934 \end_layout
14935
14936 \begin_layout Standard
14937 A typical template looks like this:
14938 \end_layout
14939
14940 \begin_layout LyX-Code
14941 Template XFig
14942 \end_layout
14943
14944 \begin_layout LyX-Code
14945 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14946 \end_layout
14947
14948 \begin_layout LyX-Code
14949 HelpText
14950 \end_layout
14951
14952 \begin_layout LyX-Code
14953 An XFig figure.
14954 \end_layout
14955
14956 \begin_layout LyX-Code
14957 HelpTextEnd
14958 \end_layout
14959
14960 \begin_layout LyX-Code
14961 InputFormat fig
14962 \end_layout
14963
14964 \begin_layout LyX-Code
14965 FileFilter "*.fig"
14966 \end_layout
14967
14968 \begin_layout LyX-Code
14969 AutomaticProduction true
14970 \end_layout
14971
14972 \begin_layout LyX-Code
14973 Transform Rotate
14974 \end_layout
14975
14976 \begin_layout LyX-Code
14977 Transform Resize
14978 \end_layout
14979
14980 \begin_layout LyX-Code
14981 Format LaTeX
14982 \end_layout
14983
14984 \begin_layout LyX-Code
14985 TransformCommand Rotate RotationLatexCommand
14986 \end_layout
14987
14988 \begin_layout LyX-Code
14989 TransformCommand Resize ResizeLatexCommand
14990 \end_layout
14991
14992 \begin_layout LyX-Code
14993 Product "$$RotateFront$$ResizeFront
14994 \end_layout
14995
14996 \begin_layout LyX-Code
14997          
14998 \backslash
14999
15000 \backslash
15001 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
15002 \end_layout
15003
15004 \begin_layout LyX-Code
15005          $$ResizeBack$$RotateBack"
15006 \end_layout
15007
15008 \begin_layout LyX-Code
15009 UpdateFormat pstex
15010 \end_layout
15011
15012 \begin_layout LyX-Code
15013 UpdateResult "$$AbsPath$$Basename.pstex_t"
15014 \end_layout
15015
15016 \begin_layout LyX-Code
15017 Requirement "graphicx"
15018 \end_layout
15019
15020 \begin_layout LyX-Code
15021 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15022 \end_layout
15023
15024 \begin_layout LyX-Code
15025 ReferencedFile latex "$$AbsPath$$Basename.eps"
15026 \end_layout
15027
15028 \begin_layout LyX-Code
15029 ReferencedFile dvi "$$AbsPath$$Basename.eps"
15030 \end_layout
15031
15032 \begin_layout LyX-Code
15033 FormatEnd
15034 \end_layout
15035
15036 \begin_layout LyX-Code
15037 Format PDFLaTeX
15038 \end_layout
15039
15040 \begin_layout LyX-Code
15041 TransformCommand Rotate RotationLatexCommand
15042 \end_layout
15043
15044 \begin_layout LyX-Code
15045 TransformCommand Resize ResizeLatexCommand
15046 \end_layout
15047
15048 \begin_layout LyX-Code
15049 Product "$$RotateFront$$ResizeFront
15050 \end_layout
15051
15052 \begin_layout LyX-Code
15053          
15054 \backslash
15055
15056 \backslash
15057 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
15058 \end_layout
15059
15060 \begin_layout LyX-Code
15061          $$ResizeBack$$RotateBack"
15062 \end_layout
15063
15064 \begin_layout LyX-Code
15065 UpdateFormat pdftex
15066 \end_layout
15067
15068 \begin_layout LyX-Code
15069 UpdateResult "$$AbsPath$$Basename.pdftex_t"
15070 \end_layout
15071
15072 \begin_layout LyX-Code
15073 Requirement "graphicx"
15074 \end_layout
15075
15076 \begin_layout LyX-Code
15077 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
15078 \end_layout
15079
15080 \begin_layout LyX-Code
15081 ReferencedFile latex "$$AbsPath$$Basename.pdf"
15082 \end_layout
15083
15084 \begin_layout LyX-Code
15085 FormatEnd
15086 \end_layout
15087
15088 \begin_layout LyX-Code
15089 Format Ascii
15090 \end_layout
15091
15092 \begin_layout LyX-Code
15093 Product "$$Contents(
15094 \backslash
15095 "$$AbsPath$$Basename.asc
15096 \backslash
15097 ")"
15098 \end_layout
15099
15100 \begin_layout LyX-Code
15101 UpdateFormat asciixfig
15102 \end_layout
15103
15104 \begin_layout LyX-Code
15105 UpdateResult "$$AbsPath$$Basename.asc"
15106 \end_layout
15107
15108 \begin_layout LyX-Code
15109 FormatEnd
15110 \end_layout
15111
15112 \begin_layout LyX-Code
15113 Format DocBook
15114 \end_layout
15115
15116 \begin_layout LyX-Code
15117 Product "<graphic fileref=
15118 \backslash
15119 "$$AbsOrRelPathMaster$$Basename.eps
15120 \backslash
15121 ">
15122 \end_layout
15123
15124 \begin_layout LyX-Code
15125          </graphic>"
15126 \end_layout
15127
15128 \begin_layout LyX-Code
15129 UpdateFormat eps
15130 \end_layout
15131
15132 \begin_layout LyX-Code
15133 UpdateResult "$$AbsPath$$Basename.eps"
15134 \end_layout
15135
15136 \begin_layout LyX-Code
15137 ReferencedFile docbook "$$AbsPath$$Basename.eps"
15138 \end_layout
15139
15140 \begin_layout LyX-Code
15141 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
15142 \end_layout
15143
15144 \begin_layout LyX-Code
15145 FormatEnd
15146 \end_layout
15147
15148 \begin_layout LyX-Code
15149 Product "[XFig: $$FName]"
15150 \end_layout
15151
15152 \begin_layout LyX-Code
15153 FormatEnd
15154 \end_layout
15155
15156 \begin_layout LyX-Code
15157 TemplateEnd
15158 \end_layout
15159
15160 \begin_layout Standard
15161 As you can see, the template is enclosed in 
15162 \begin_inset Flex CharStyle:Code
15163 status collapsed
15164
15165 \begin_layout Plain Layout
15166 Template
15167 \end_layout
15168
15169 \end_inset
15170
15171  \SpecialChar \ldots{}
15172  
15173 \begin_inset Flex CharStyle:Code
15174 status collapsed
15175
15176 \begin_layout Plain Layout
15177 TemplateEnd
15178 \end_layout
15179
15180 \end_inset
15181
15182 .
15183  It contains a header specifying some general settings and, for each supported
15184  primary document file format, a section 
15185 \begin_inset Flex CharStyle:Code
15186 status collapsed
15187
15188 \begin_layout Plain Layout
15189 Format
15190 \end_layout
15191
15192 \end_inset
15193
15194  \SpecialChar \ldots{}
15195  
15196 \begin_inset Flex CharStyle:Code
15197 status collapsed
15198
15199 \begin_layout Plain Layout
15200 FormatEnd
15201 \end_layout
15202
15203 \end_inset
15204
15205 .
15206 \end_layout
15207
15208 \begin_layout Subsection
15209 The template header
15210 \end_layout
15211
15212 \begin_layout Description
15213 \begin_inset Flex CharStyle:Code
15214 status collapsed
15215
15216 \begin_layout Plain Layout
15217 AutomaticProduction
15218 \begin_inset space ~
15219 \end_inset
15220
15221 true|false
15222 \end_layout
15223
15224 \end_inset
15225
15226  Whether the file represented by the template must be generated by LyX.
15227  This command must occur exactly once.
15228 \end_layout
15229
15230 \begin_layout Description
15231 \begin_inset Flex CharStyle:Code
15232 status collapsed
15233
15234 \begin_layout Plain Layout
15235 FileFilter
15236 \begin_inset space ~
15237 \end_inset
15238
15239 <pattern>
15240 \end_layout
15241
15242 \end_inset
15243
15244  A glob pattern that is used in the file dialog to filter out the desired
15245  files.
15246  If there is more than one possible file extension (e.
15247 \begin_inset space \thinspace{}
15248 \end_inset
15249
15250 g.
15251 \begin_inset space \space{}
15252 \end_inset
15253
15254 tgif has 
15255 \begin_inset Flex CharStyle:Code
15256 status collapsed
15257
15258 \begin_layout Plain Layout
15259 .obj
15260 \end_layout
15261
15262 \end_inset
15263
15264  and 
15265 \begin_inset Flex CharStyle:Code
15266 status collapsed
15267
15268 \begin_layout Plain Layout
15269 .tgo
15270 \end_layout
15271
15272 \end_inset
15273
15274 ), use something like 
15275 \begin_inset Flex CharStyle:Code
15276 status collapsed
15277
15278 \begin_layout Plain Layout
15279 "*.{obj,tgo}"
15280 \end_layout
15281
15282 \end_inset
15283
15284 .
15285  This command must occur exactly once.
15286 \end_layout
15287
15288 \begin_layout Description
15289 \begin_inset Flex CharStyle:Code
15290 status collapsed
15291
15292 \begin_layout Plain Layout
15293 GuiName
15294 \begin_inset space ~
15295 \end_inset
15296
15297 <guiname>
15298 \end_layout
15299
15300 \end_inset
15301
15302  The text that is displayed on the button.
15303  This command must occur exactly once.
15304 \end_layout
15305
15306 \begin_layout Description
15307 \begin_inset Flex CharStyle:Code
15308 status collapsed
15309
15310 \begin_layout Plain Layout
15311 HelpText
15312 \begin_inset space ~
15313 \end_inset
15314
15315 <text>
15316 \begin_inset space ~
15317 \end_inset
15318
15319 HelpTextEnd
15320 \end_layout
15321
15322 \end_inset
15323
15324  The help text that is used in the External dialog.
15325  Provide enough information to explain to the user just what the template
15326  can provide him with.
15327  This command must occur exactly once.
15328 \end_layout
15329
15330 \begin_layout Description
15331 \begin_inset Flex CharStyle:Code
15332 status collapsed
15333
15334 \begin_layout Plain Layout
15335 InputFormat
15336 \begin_inset space ~
15337 \end_inset
15338
15339 <format>
15340 \end_layout
15341
15342 \end_inset
15343
15344  The file format of the original file.
15345  This must be the name of a format that is known to LyX (see section 
15346 \begin_inset CommandInset ref
15347 LatexCommand ref
15348 reference "sec:Formats"
15349
15350 \end_inset
15351
15352 ).
15353  Use 
15354 \begin_inset Quotes eld
15355 \end_inset
15356
15357
15358 \begin_inset Flex CharStyle:Code
15359 status collapsed
15360
15361 \begin_layout Plain Layout
15362 *
15363 \end_layout
15364
15365 \end_inset
15366
15367
15368 \begin_inset Quotes erd
15369 \end_inset
15370
15371  if the template can handle original files of more than one format.
15372  LyX will attempt to interrogate the file itself in order to deduce its
15373  format in this case.
15374  This command must occur exactly once.
15375 \end_layout
15376
15377 \begin_layout Description
15378 \begin_inset Flex CharStyle:Code
15379 status collapsed
15380
15381 \begin_layout Plain Layout
15382 Template
15383 \begin_inset space ~
15384 \end_inset
15385
15386 <id>
15387 \end_layout
15388
15389 \end_inset
15390
15391  A unique name for the template.
15392  It must not contain substitution macros (see below).
15393 \end_layout
15394
15395 \begin_layout Description
15396 \begin_inset Flex CharStyle:Code
15397 status collapsed
15398
15399 \begin_layout Plain Layout
15400 Transform
15401 \begin_inset space ~
15402 \end_inset
15403
15404 Rotate|Resize|Clip|Extra
15405 \end_layout
15406
15407 \end_inset
15408
15409  This command specifies which transformations are supported by this template.
15410  It may occur zero or more times.
15411  This command enables the corresponding tabs in the external dialog.
15412  Each 
15413 \begin_inset Flex CharStyle:Code
15414 status collapsed
15415
15416 \begin_layout Plain Layout
15417 Transform
15418 \end_layout
15419
15420 \end_inset
15421
15422  command must have either a corresponding 
15423 \begin_inset Flex CharStyle:Code
15424 status collapsed
15425
15426 \begin_layout Plain Layout
15427 TransformCommand
15428 \end_layout
15429
15430 \end_inset
15431
15432  or a 
15433 \begin_inset Flex CharStyle:Code
15434 status collapsed
15435
15436 \begin_layout Plain Layout
15437 TransformOption
15438 \end_layout
15439
15440 \end_inset
15441
15442  command in the 
15443 \begin_inset Flex CharStyle:Code
15444 status collapsed
15445
15446 \begin_layout Plain Layout
15447 Format
15448 \end_layout
15449
15450 \end_inset
15451
15452  section.
15453  Otherwise the transformation will not be supported by that format.
15454 \end_layout
15455
15456 \begin_layout Subsection
15457 The Format section
15458 \end_layout
15459
15460 \begin_layout Description
15461 \begin_inset Flex CharStyle:Code
15462 status collapsed
15463
15464 \begin_layout Plain Layout
15465 Format
15466 \begin_inset space ~
15467 \end_inset
15468
15469 LaTeX|PDFLaTeX|PlainText|DocBook
15470 \end_layout
15471
15472 \end_inset
15473
15474  The primary document file format that this format definition is for.
15475  Not every template has a sensible representation in all document file formats.
15476  Please define nevertheless a 
15477 \begin_inset Flex CharStyle:Code
15478 status collapsed
15479
15480 \begin_layout Plain Layout
15481 Format
15482 \end_layout
15483
15484 \end_inset
15485
15486  section for all formats.
15487  Use a dummy text when no representation is available.
15488  Then you can at least see a reference to the external material in the exported
15489  document.
15490 \end_layout
15491
15492 \begin_layout Description
15493 \begin_inset Flex CharStyle:Code
15494 status collapsed
15495
15496 \begin_layout Plain Layout
15497 Option
15498 \begin_inset space ~
15499 \end_inset
15500
15501 <name>
15502 \begin_inset space ~
15503 \end_inset
15504
15505 <value>
15506 \end_layout
15507
15508 \end_inset
15509
15510  This command defines an additional macro 
15511 \begin_inset Flex CharStyle:Code
15512 status collapsed
15513
15514 \begin_layout Plain Layout
15515 $$<name>
15516 \end_layout
15517
15518 \end_inset
15519
15520  for substitution in 
15521 \begin_inset Flex CharStyle:Code
15522 status collapsed
15523
15524 \begin_layout Plain Layout
15525 Product
15526 \end_layout
15527
15528 \end_inset
15529
15530 .
15531  
15532 \begin_inset Flex CharStyle:Code
15533 status collapsed
15534
15535 \begin_layout Plain Layout
15536 <value>
15537 \end_layout
15538
15539 \end_inset
15540
15541  itself may contain substitution macros.
15542  The advantage over using 
15543 \begin_inset Flex CharStyle:Code
15544 status collapsed
15545
15546 \begin_layout Plain Layout
15547 <value>
15548 \end_layout
15549
15550 \end_inset
15551
15552  directly in 
15553 \begin_inset Flex CharStyle:Code
15554 status collapsed
15555
15556 \begin_layout Plain Layout
15557 Product
15558 \end_layout
15559
15560 \end_inset
15561
15562  is that the substituted value of 
15563 \begin_inset Flex CharStyle:Code
15564 status collapsed
15565
15566 \begin_layout Plain Layout
15567 $$<name>
15568 \end_layout
15569
15570 \end_inset
15571
15572  is sanitized so that it is a valid optional argument in the document format.
15573  This command may occur zero or more times.
15574 \end_layout
15575
15576 \begin_layout Description
15577 \begin_inset Flex CharStyle:Code
15578 status collapsed
15579
15580 \begin_layout Plain Layout
15581 Product
15582 \begin_inset space ~
15583 \end_inset
15584
15585 <text>
15586 \end_layout
15587
15588 \end_inset
15589
15590  The text that is inserted in the exported document.
15591  This is actually the most important command and can be quite complex.
15592  This command must occur exactly once.
15593 \end_layout
15594
15595 \begin_layout Description
15596 \begin_inset Flex CharStyle:Code
15597 status collapsed
15598
15599 \begin_layout Plain Layout
15600 Preamble
15601 \begin_inset space ~
15602 \end_inset
15603
15604 <name>
15605 \end_layout
15606
15607 \end_inset
15608
15609  This command specifies a preamble snippet that will be included in the
15610  LaTeX preamble.
15611  It has to be defined using 
15612 \begin_inset Flex CharStyle:Code
15613 status collapsed
15614
15615 \begin_layout Plain Layout
15616 PreambleDef
15617 \end_layout
15618
15619 \end_inset
15620
15621  \SpecialChar \ldots{}
15622  
15623 \begin_inset Flex CharStyle:Code
15624 status collapsed
15625
15626 \begin_layout Plain Layout
15627 PreambleDefEnd
15628 \end_layout
15629
15630 \end_inset
15631
15632 .
15633  This command may occur zero or more times.
15634 \end_layout
15635
15636 \begin_layout Description
15637 \begin_inset Flex CharStyle:Code
15638 status collapsed
15639
15640 \begin_layout Plain Layout
15641 ReferencedFile
15642 \begin_inset space ~
15643 \end_inset
15644
15645 <format>
15646 \begin_inset space ~
15647 \end_inset
15648
15649 <filename>
15650 \end_layout
15651
15652 \end_inset
15653
15654  This command denotes files that are created by the conversion process and
15655  are needed for a particular export format.
15656  If the filename is relative, it is interpreted relative to the master document.
15657  This command may be given zero or more times.
15658 \end_layout
15659
15660 \begin_layout Description
15661 \begin_inset Flex CharStyle:Code
15662 status collapsed
15663
15664 \begin_layout Plain Layout
15665 Requirement
15666 \begin_inset space ~
15667 \end_inset
15668
15669 <package>
15670 \end_layout
15671
15672 \end_inset
15673
15674  The name of a required LaTeX package.
15675  The package is included via 
15676 \begin_inset Flex CharStyle:Code
15677 status collapsed
15678
15679 \begin_layout Plain Layout
15680
15681 \backslash
15682 usepackage{}
15683 \end_layout
15684
15685 \end_inset
15686
15687  in the LaTeX preamble.
15688  This command may occur zero or more times.
15689 \end_layout
15690
15691 \begin_layout Description
15692 \begin_inset Flex CharStyle:Code
15693 status collapsed
15694
15695 \begin_layout Plain Layout
15696 TransformCommand
15697 \begin_inset space ~
15698 \end_inset
15699
15700 Rotate
15701 \begin_inset space ~
15702 \end_inset
15703
15704 RotationLatexCommand
15705 \end_layout
15706
15707 \end_inset
15708
15709  This command specifies that the built in LaTeX command should be used for
15710  rotation.
15711  This command may occur once or not at all.
15712 \end_layout
15713
15714 \begin_layout Description
15715 \begin_inset Flex CharStyle:Code
15716 status collapsed
15717
15718 \begin_layout Plain Layout
15719 TransformCommand
15720 \begin_inset space ~
15721 \end_inset
15722
15723 Resize
15724 \begin_inset space ~
15725 \end_inset
15726
15727 ResizeLatexCommand
15728 \end_layout
15729
15730 \end_inset
15731
15732  This command specifies that the built in LaTeX command should be used for
15733  resizing.
15734  This command may occur once or not at all.
15735 \end_layout
15736
15737 \begin_layout Description
15738 \begin_inset Flex CharStyle:Code
15739 status collapsed
15740
15741 \begin_layout Plain Layout
15742 TransformOption
15743 \begin_inset space ~
15744 \end_inset
15745
15746 Rotate
15747 \begin_inset space ~
15748 \end_inset
15749
15750 RotationLatexOption
15751 \end_layout
15752
15753 \end_inset
15754
15755  This command specifies that rotation is done via an optional argument.
15756  This command may occur once or not at all.
15757 \end_layout
15758
15759 \begin_layout Description
15760 \begin_inset Flex CharStyle:Code
15761 status collapsed
15762
15763 \begin_layout Plain Layout
15764 TransformOption
15765 \begin_inset space ~
15766 \end_inset
15767
15768 Resize
15769 \begin_inset space ~
15770 \end_inset
15771
15772 ResizeLatexOption
15773 \end_layout
15774
15775 \end_inset
15776
15777  This command specifies that resizing is done via an optional argument.
15778  This command may occur once or not at all.
15779 \end_layout
15780
15781 \begin_layout Description
15782 \begin_inset Flex CharStyle:Code
15783 status collapsed
15784
15785 \begin_layout Plain Layout
15786 TransformOption
15787 \begin_inset space ~
15788 \end_inset
15789
15790 Clip
15791 \begin_inset space ~
15792 \end_inset
15793
15794 ClipLatexOption
15795 \end_layout
15796
15797 \end_inset
15798
15799  This command specifies that clipping is done via an optional argument.
15800  This command may occur once or not at all.
15801 \end_layout
15802
15803 \begin_layout Description
15804 \begin_inset Flex CharStyle:Code
15805 status collapsed
15806
15807 \begin_layout Plain Layout
15808 TransformOption
15809 \begin_inset space ~
15810 \end_inset
15811
15812 Extra
15813 \begin_inset space ~
15814 \end_inset
15815
15816 ExtraLatexOption
15817 \end_layout
15818
15819 \end_inset
15820
15821  This command specifies that an extra optional argument is used.
15822  This command may occur once or not at all.
15823 \end_layout
15824
15825 \begin_layout Description
15826 \begin_inset Flex CharStyle:Code
15827 status collapsed
15828
15829 \begin_layout Plain Layout
15830 UpdateFormat
15831 \begin_inset space ~
15832 \end_inset
15833
15834 <format>
15835 \end_layout
15836
15837 \end_inset
15838
15839  The file format of the converted file.
15840  This must be the name of a format that is known to LyX (see the 
15841 \begin_inset Flex CharStyle:MenuItem
15842 status collapsed
15843
15844 \begin_layout Plain Layout
15845
15846 \bar under
15847 T
15848 \bar default
15849 ools\SpecialChar \menuseparator
15850
15851 \bar under
15852 P
15853 \bar default
15854 references:Conversion
15855 \end_layout
15856
15857 \end_inset
15858
15859  dialog).
15860  This command must occur exactly once.
15861 \end_layout
15862
15863 \begin_layout Description
15864 \begin_inset Flex CharStyle:Code
15865 status collapsed
15866
15867 \begin_layout Plain Layout
15868 UpdateResult
15869 \begin_inset space ~
15870 \end_inset
15871
15872 <filename>
15873 \end_layout
15874
15875 \end_inset
15876
15877  The file name of the converted file.
15878  The file name must be absolute.
15879  This command must occur exactly once.
15880 \end_layout
15881
15882 \begin_layout Subsection
15883 Preamble definitions
15884 \end_layout
15885
15886 \begin_layout Standard
15887 The external template configuration file may contain additional preamble
15888  definitions enclosed by 
15889 \begin_inset Flex CharStyle:Code
15890 status collapsed
15891
15892 \begin_layout Plain Layout
15893 PreambleDef
15894 \end_layout
15895
15896 \end_inset
15897
15898  \SpecialChar \ldots{}
15899  
15900 \begin_inset Flex CharStyle:Code
15901 status collapsed
15902
15903 \begin_layout Plain Layout
15904 PreambleDefEnd
15905 \end_layout
15906
15907 \end_inset
15908
15909 .
15910  They can be used by the templates in the 
15911 \begin_inset Flex CharStyle:Code
15912 status collapsed
15913
15914 \begin_layout Plain Layout
15915 Format
15916 \end_layout
15917
15918 \end_inset
15919
15920  section.
15921 \end_layout
15922
15923 \begin_layout Section
15924 The substitution mechanism
15925 \end_layout
15926
15927 \begin_layout Standard
15928 When the external material facility invokes an external program, it is done
15929  on the basis of a command defined in the template configuration file.
15930  These commands can contain various macros that are expanded before execution.
15931  Execution always take place in the directory of the containing document.
15932 \end_layout
15933
15934 \begin_layout Standard
15935 Also, whenever external material is to be displayed, the name will be produced
15936  by the substitution mechanism, and most other commands in the template
15937  definition support substitution as well.
15938 \end_layout
15939
15940 \begin_layout Standard
15941 The available macros are the following:
15942 \end_layout
15943
15944 \begin_layout Description
15945 \begin_inset Flex CharStyle:Code
15946 status collapsed
15947
15948 \begin_layout Plain Layout
15949 $$AbsOrRelPathMaster
15950 \end_layout
15951
15952 \end_inset
15953
15954  The file path, absolute or relative to the master LyX document.
15955 \end_layout
15956
15957 \begin_layout Description
15958 \begin_inset Flex CharStyle:Code
15959 status collapsed
15960
15961 \begin_layout Plain Layout
15962 $$AbsOrRelPathParent
15963 \end_layout
15964
15965 \end_inset
15966
15967  The file path, absolute or relative to the LyX document.
15968 \end_layout
15969
15970 \begin_layout Description
15971 \begin_inset Flex CharStyle:Code
15972 status collapsed
15973
15974 \begin_layout Plain Layout
15975 $$AbsPath
15976 \end_layout
15977
15978 \end_inset
15979
15980  The absolute file path.
15981 \end_layout
15982
15983 \begin_layout Description
15984 \begin_inset Flex CharStyle:Code
15985 status collapsed
15986
15987 \begin_layout Plain Layout
15988 $$Basename
15989 \end_layout
15990
15991 \end_inset
15992
15993  The filename without path and without the extension.
15994 \end_layout
15995
15996 \begin_layout Description
15997 \begin_inset Flex CharStyle:Code
15998 status collapsed
15999
16000 \begin_layout Plain Layout
16001 $$Contents(
16002 \begin_inset Quotes eld
16003 \end_inset
16004
16005 filename.ext
16006 \begin_inset Quotes erd
16007 \end_inset
16008
16009 )
16010 \end_layout
16011
16012 \end_inset
16013
16014  This macro will expand to the contents of the file with the name 
16015 \begin_inset Flex CharStyle:Code
16016 status collapsed
16017
16018 \begin_layout Plain Layout
16019 filename.ext
16020 \end_layout
16021
16022 \end_inset
16023
16024 .
16025 \end_layout
16026
16027 \begin_layout Description
16028 \begin_inset Flex CharStyle:Code
16029 status collapsed
16030
16031 \begin_layout Plain Layout
16032 $$Extension
16033 \end_layout
16034
16035 \end_inset
16036
16037  The file extension (including the dot).
16038 \end_layout
16039
16040 \begin_layout Description
16041 \begin_inset Flex CharStyle:Code
16042 status collapsed
16043
16044 \begin_layout Plain Layout
16045 $$FName
16046 \end_layout
16047
16048 \end_inset
16049
16050  The filename of the file specified in the external material dialog.
16051  This is either an absolute name, or it is relative to the LyX document.
16052 \end_layout
16053
16054 \begin_layout Description
16055 \begin_inset Flex CharStyle:Code
16056 status collapsed
16057
16058 \begin_layout Plain Layout
16059 $$FPath
16060 \end_layout
16061
16062 \end_inset
16063
16064  The path part of 
16065 \begin_inset Flex CharStyle:Code
16066 status collapsed
16067
16068 \begin_layout Plain Layout
16069 $$FName
16070 \end_layout
16071
16072 \end_inset
16073
16074  (absolute name or relative to the LyX document).
16075 \end_layout
16076
16077 \begin_layout Description
16078 \begin_inset Flex CharStyle:Code
16079 status collapsed
16080
16081 \begin_layout Plain Layout
16082 $$RelPathMaster
16083 \end_layout
16084
16085 \end_inset
16086
16087  The file path, relative to the master LyX document.
16088 \end_layout
16089
16090 \begin_layout Description
16091 \begin_inset Flex CharStyle:Code
16092 status collapsed
16093
16094 \begin_layout Plain Layout
16095 $$RelPathParent
16096 \end_layout
16097
16098 \end_inset
16099
16100  The file path, relative to the LyX document.
16101 \end_layout
16102
16103 \begin_layout Description
16104 \begin_inset Flex CharStyle:Code
16105 status collapsed
16106
16107 \begin_layout Plain Layout
16108 $$Sysdir
16109 \end_layout
16110
16111 \end_inset
16112
16113  This macro will expand to the absolute path of the system directory.
16114  This is typically used to point to the various helper scripts that are
16115  bundled with LyX.
16116 \end_layout
16117
16118 \begin_layout Description
16119 \begin_inset Flex CharStyle:Code
16120 status collapsed
16121
16122 \begin_layout Plain Layout
16123 $$Tempname
16124 \end_layout
16125
16126 \end_inset
16127
16128  A name and full path to a temporary file which will be automatically deleted
16129  whenever the containing document is closed, or the external material insertion
16130  deleted.
16131 \end_layout
16132
16133 \begin_layout Standard
16134 All path macros contain a trailing directory separator, so you can construct
16135  e.
16136 \begin_inset space \thinspace{}
16137 \end_inset
16138
16139 g.
16140 \begin_inset space \space{}
16141 \end_inset
16142
16143 the absolute filename with 
16144 \begin_inset Flex CharStyle:Code
16145 status collapsed
16146
16147 \begin_layout Plain Layout
16148 $$AbsPath$$Basename$$Extension
16149 \end_layout
16150
16151 \end_inset
16152
16153 .
16154 \end_layout
16155
16156 \begin_layout Standard
16157 The macros above are substituted in all commands unless otherwise noted.
16158  The command 
16159 \begin_inset Flex CharStyle:Code
16160 status collapsed
16161
16162 \begin_layout Plain Layout
16163 Product
16164 \end_layout
16165
16166 \end_inset
16167
16168  supports additionally the following substitutions if they are enabled by
16169  the 
16170 \begin_inset Flex CharStyle:Code
16171 status collapsed
16172
16173 \begin_layout Plain Layout
16174 Transform
16175 \end_layout
16176
16177 \end_inset
16178
16179  and 
16180 \begin_inset Flex CharStyle:Code
16181 status collapsed
16182
16183 \begin_layout Plain Layout
16184 TransformCommand
16185 \end_layout
16186
16187 \end_inset
16188
16189  commands:
16190 \end_layout
16191
16192 \begin_layout Description
16193 \begin_inset Flex CharStyle:Code
16194 status collapsed
16195
16196 \begin_layout Plain Layout
16197 $$ResizeFront
16198 \end_layout
16199
16200 \end_inset
16201
16202  The front part of the resize command.
16203 \end_layout
16204
16205 \begin_layout Description
16206 \begin_inset Flex CharStyle:Code
16207 status collapsed
16208
16209 \begin_layout Plain Layout
16210 $$ResizeBack
16211 \end_layout
16212
16213 \end_inset
16214
16215  The back part of the resize command.
16216 \end_layout
16217
16218 \begin_layout Description
16219 \begin_inset Flex CharStyle:Code
16220 status collapsed
16221
16222 \begin_layout Plain Layout
16223 $$RotateFront
16224 \end_layout
16225
16226 \end_inset
16227
16228  The front part of the rotation command.
16229 \end_layout
16230
16231 \begin_layout Description
16232 \begin_inset Flex CharStyle:Code
16233 status collapsed
16234
16235 \begin_layout Plain Layout
16236 $$RotateBack
16237 \end_layout
16238
16239 \end_inset
16240
16241  The back part of the rotation command.
16242 \end_layout
16243
16244 \begin_layout Standard
16245 The value string of the 
16246 \begin_inset Flex CharStyle:Code
16247 status collapsed
16248
16249 \begin_layout Plain Layout
16250 Option
16251 \end_layout
16252
16253 \end_inset
16254
16255  command supports additionally the following substitutions if they are enabled
16256  by the 
16257 \begin_inset Flex CharStyle:Code
16258 status collapsed
16259
16260 \begin_layout Plain Layout
16261 Transform
16262 \end_layout
16263
16264 \end_inset
16265
16266  and 
16267 \begin_inset Flex CharStyle:Code
16268 status collapsed
16269
16270 \begin_layout Plain Layout
16271 TransformOption
16272 \end_layout
16273
16274 \end_inset
16275
16276  commands:
16277 \end_layout
16278
16279 \begin_layout Description
16280 \begin_inset Flex CharStyle:Code
16281 status collapsed
16282
16283 \begin_layout Plain Layout
16284 $$Clip
16285 \end_layout
16286
16287 \end_inset
16288
16289  The clip option.
16290 \end_layout
16291
16292 \begin_layout Description
16293 \begin_inset Flex CharStyle:Code
16294 status collapsed
16295
16296 \begin_layout Plain Layout
16297 $$Extra
16298 \end_layout
16299
16300 \end_inset
16301
16302  The extra option.
16303 \end_layout
16304
16305 \begin_layout Description
16306 \begin_inset Flex CharStyle:Code
16307 status collapsed
16308
16309 \begin_layout Plain Layout
16310 $$Resize
16311 \end_layout
16312
16313 \end_inset
16314
16315  The resize option.
16316 \end_layout
16317
16318 \begin_layout Description
16319 \begin_inset Flex CharStyle:Code
16320 status collapsed
16321
16322 \begin_layout Plain Layout
16323 $$Rotate
16324 \end_layout
16325
16326 \end_inset
16327
16328  The rotation option.
16329 \end_layout
16330
16331 \begin_layout Standard
16332 You may ask why there are so many path macros.
16333  There are mainly two reasons:
16334 \end_layout
16335
16336 \begin_layout Enumerate
16337 Relative and absolute file names should remain relative or absolute, respectivel
16338 y.
16339  Users may have reasons to prefer either form.
16340  Relative names are useful for portable documents that should work on different
16341  machines, for example.
16342  Absolute names may be required by some programs.
16343 \end_layout
16344
16345 \begin_layout Enumerate
16346 LaTeX treats relative file names differently than LyX and other programs
16347  in nested included files.
16348  For LyX, a relative file name is always relative to the document that contains
16349  the file name.
16350  For LaTeX, it is always relative to the master document.
16351  These two definitions are identical if you have only one document, but
16352  differ if you have a master document that includes part documents.
16353  That means that relative filenames must be transformed when presented to
16354  LaTeX.
16355  Fortunately LyX does this automatically for you if you choose the right
16356  macros.
16357 \end_layout
16358
16359 \begin_layout Standard
16360 So which path macro should be used in new template definitions? The rule
16361  is not difficult:
16362 \end_layout
16363
16364 \begin_layout Itemize
16365 Use 
16366 \begin_inset Flex CharStyle:Code
16367 status collapsed
16368
16369 \begin_layout Plain Layout
16370 $$AbsPath
16371 \end_layout
16372
16373 \end_inset
16374
16375  if an absolute path is required.
16376 \end_layout
16377
16378 \begin_layout Itemize
16379 Use 
16380 \begin_inset Flex CharStyle:Code
16381 status collapsed
16382
16383 \begin_layout Plain Layout
16384 $$AbsOrRelPathMaster
16385 \end_layout
16386
16387 \end_inset
16388
16389  if the substituted string is some kind of LaTeX input.
16390 \end_layout
16391
16392 \begin_layout Itemize
16393 Else use 
16394 \begin_inset Flex CharStyle:Code
16395 status collapsed
16396
16397 \begin_layout Plain Layout
16398 $$AbsOrRelPathParent
16399 \end_layout
16400
16401 \end_inset
16402
16403  in order to preserve the user's choice.
16404 \end_layout
16405
16406 \begin_layout Standard
16407 There are special cases where this rule does not work and e.
16408 \begin_inset space \thinspace{}
16409 \end_inset
16410
16411 g.
16412 \begin_inset space \space{}
16413 \end_inset
16414
16415 relative names are needed, but normally it will work just fine.
16416  One example for such a case is the command 
16417 \begin_inset Flex CharStyle:Code
16418 status collapsed
16419
16420 \begin_layout Plain Layout
16421 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16422 \end_layout
16423
16424 \end_inset
16425
16426  in the XFig template above: We can't use the absolute name because the
16427  copier for 
16428 \begin_inset Flex CharStyle:Code
16429 status collapsed
16430
16431 \begin_layout Plain Layout
16432 .pstex_t
16433 \end_layout
16434
16435 \end_inset
16436
16437  files needs the relative name in order to rewrite the file content.
16438 \end_layout
16439
16440 \begin_layout Section
16441 Security discussion
16442 \begin_inset CommandInset label
16443 LatexCommand label
16444 name "sec:Security-discussion"
16445
16446 \end_inset
16447
16448
16449 \end_layout
16450
16451 \begin_layout Standard
16452 The external material feature interfaces with a lot of external programs
16453  and does so automatically, so we have to consider the security implications
16454  of this.
16455  In particular, since you have the option of including your own filenames
16456  and/or parameter strings and those are expanded into a command, it seems
16457  that it would be possible to create a malicious document which executes
16458  arbitrary commands when a user views or prints the document.
16459  This is something we definitely want to avoid.
16460 \end_layout
16461
16462 \begin_layout Standard
16463 However, since the external program commands are specified in the template
16464  configuration file only, there are no security issues if LyX is properly
16465  configured with safe templates only.
16466  This is so because the external programs are invoked with the 
16467 \begin_inset Flex CharStyle:Code
16468 status collapsed
16469
16470 \begin_layout Plain Layout
16471 execvp
16472 \end_layout
16473
16474 \end_inset
16475
16476 -system call rather than the 
16477 \begin_inset Flex CharStyle:Code
16478 status collapsed
16479
16480 \begin_layout Plain Layout
16481 system
16482 \end_layout
16483
16484 \end_inset
16485
16486  system-call, so it's not possible to execute arbitrary commands from the
16487  filename or parameter section via the shell.
16488 \end_layout
16489
16490 \begin_layout Standard
16491 This also implies that you are restricted in what command strings you can
16492  use in the external material templates.
16493  In particular, pipes and redirection are not readily available.
16494  This has to be so if LyX should remain safe.
16495  If you want to use some of the shell features, you should write a safe
16496  script to do this in a controlled manner, and then invoke the script from
16497  the command string.
16498  
16499 \end_layout
16500
16501 \begin_layout Standard
16502 It is possible to design a template that interacts directly with the shell,
16503  but since this would allow a malicious user to execute arbitrary commands
16504  by writing clever filenames and/or parameters, we generally recommend that
16505  you only use safe scripts that work with the 
16506 \begin_inset Flex CharStyle:Code
16507 status collapsed
16508
16509 \begin_layout Plain Layout
16510 execvp
16511 \end_layout
16512
16513 \end_inset
16514
16515  system call in a controlled manner.
16516  Of course, for use in a controlled environment, it can be tempting to just
16517  fall back to use ordinary shell scripts.
16518  If you do so, be aware that you 
16519 \emph on
16520 will
16521 \emph default
16522  provide an easily exploitable security hole in your system.
16523  Of course it stands to reason that such unsafe templates will never be
16524  included in the standard LyX distribution, although we do encourage people
16525  to submit new templates in the open source tradition.
16526  But LyX as shipped from the official distribution channels will never have
16527  unsafe templates.
16528 \end_layout
16529
16530 \begin_layout Standard
16531 Including external material provides a lot of power, and you have to be
16532  careful not to introduce security hazards with this power.
16533  A subtle error in a single line in an innocent looking script can open
16534  the door to huge security problems.
16535  So if you do not fully understand the issues, we recommend that you consult
16536  a knowledgeable security professional or the LyX development team if you
16537  have any questions about whether a given template is safe or not.
16538  And do this before you use it in an uncontrolled environment.
16539 \end_layout
16540
16541 \end_body
16542 \end_document