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