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