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