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