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