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