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