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