]> git.lyx.org Git - features.git/blob - lib/doc/Customization.lyx
Docs for latest layout changes.
[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 NCustomizing 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 IsPredefined
13084 \end_layout
13085
13086 \end_inset
13087
13088  [
13089 \emph on
13090
13091 \begin_inset Flex Code
13092 status open
13093
13094 \begin_layout Plain Layout
13095 0
13096 \end_layout
13097
13098 \end_inset
13099
13100
13101 \emph default
13102
13103 \begin_inset Flex Code
13104 status collapsed
13105
13106 \begin_layout Plain Layout
13107 1
13108 \end_layout
13109
13110 \end_inset
13111
13112 ] Indicates whether the float is already defined in the document class or
13113  if we instead need to load 
13114 \begin_inset Flex Code
13115 status collapsed
13116
13117 \begin_layout Plain Layout
13118 float.sty
13119 \end_layout
13120
13121 \end_inset
13122
13123  and use what it provides to define it on-the-fly.
13124  The default is 
13125 \begin_inset Flex Code
13126 status collapsed
13127
13128 \begin_layout Plain Layout
13129 0
13130 \end_layout
13131
13132 \end_inset
13133
13134 , which means: use 
13135 \begin_inset Flex Code
13136 status collapsed
13137
13138 \begin_layout Plain Layout
13139 float.sty
13140 \end_layout
13141
13142 \end_inset
13143
13144 .
13145  It should be set to 
13146 \begin_inset Flex Code
13147 status collapsed
13148
13149 \begin_layout Plain Layout
13150 1
13151 \end_layout
13152
13153 \end_inset
13154
13155  if the float is already defined by the LaTeX document class.
13156 \end_layout
13157
13158 \begin_layout Description
13159 \begin_inset Flex Code
13160 status collapsed
13161
13162 \begin_layout Plain Layout
13163 ListCommand
13164 \end_layout
13165
13166 \end_inset
13167
13168  [
13169 \begin_inset Flex Code
13170 status collapsed
13171
13172 \begin_layout Plain Layout
13173 string
13174 \end_layout
13175
13176 \end_inset
13177
13178 =
13179 \begin_inset Quotes erd
13180 \end_inset
13181
13182
13183 \begin_inset Quotes erd
13184 \end_inset
13185
13186 ] The command used to generate a list of floats of this type; the leading
13187  `
13188 \backslash
13189 ' should be omitted.
13190  This 
13191 \emph on
13192 must
13193 \emph default
13194  be given if 
13195 \begin_inset Flex Code
13196 status collapsed
13197
13198 \begin_layout Plain Layout
13199 UsesFloatPkg
13200 \end_layout
13201
13202 \end_inset
13203
13204  is false, since there is no standard way to generate this command.
13205  It is ignored if 
13206 \begin_inset Flex Code
13207 status collapsed
13208
13209 \begin_layout Plain Layout
13210 UsesFloatPkg
13211 \end_layout
13212
13213 \end_inset
13214
13215  is true, since in that case there is a standard way to define the command.
13216 \end_layout
13217
13218 \begin_layout Description
13219 \begin_inset Flex Code
13220 status collapsed
13221
13222 \begin_layout Plain Layout
13223 ListName
13224 \end_layout
13225
13226 \end_inset
13227
13228  [
13229 \begin_inset Flex Code
13230 status collapsed
13231
13232 \begin_layout Plain Layout
13233 string
13234 \end_layout
13235
13236 \end_inset
13237
13238 =
13239 \begin_inset Quotes erd
13240 \end_inset
13241
13242
13243 \begin_inset Quotes erd
13244 \end_inset
13245
13246 ] A title for a list of floats of this kind (list of figures, tables, or
13247  whatever).
13248  It is used for the screen label within LyX; it is passed to LaTeX for use
13249  as the title there; and it is used as the title in XHTML output.
13250  It will be translated to the document language.
13251 \end_layout
13252
13253 \begin_layout Description
13254 \begin_inset Flex Code
13255 status collapsed
13256
13257 \begin_layout Plain Layout
13258 NumberWithin
13259 \end_layout
13260
13261 \end_inset
13262
13263  [
13264 \begin_inset Flex Code
13265 status collapsed
13266
13267 \begin_layout Plain Layout
13268 string
13269 \end_layout
13270
13271 \end_inset
13272
13273 =
13274 \begin_inset Quotes erd
13275 \end_inset
13276
13277
13278 \begin_inset Quotes erd
13279 \end_inset
13280
13281 ] This (optional) argument determines whether floats of this class will
13282  be numbered within some sectional unit of the document.
13283  For example, if within is equal to 
13284 \begin_inset Flex Code
13285 status collapsed
13286
13287 \begin_layout Plain Layout
13288 chapter
13289 \end_layout
13290
13291 \end_inset
13292
13293 , the floats will be numbered within chapters.
13294  
13295 \end_layout
13296
13297 \begin_layout Description
13298 \begin_inset Flex Code
13299 status collapsed
13300
13301 \begin_layout Plain Layout
13302 Placement
13303 \end_layout
13304
13305 \end_inset
13306
13307  [
13308 \begin_inset Flex Code
13309 status collapsed
13310
13311 \begin_layout Plain Layout
13312 string
13313 \end_layout
13314
13315 \end_inset
13316
13317 =
13318 \begin_inset Quotes erd
13319 \end_inset
13320
13321
13322 \begin_inset Quotes erd
13323 \end_inset
13324
13325 ] The default placement for the given class of floats.
13326  The string should be as in standard LaTeX: 
13327 \begin_inset Flex Code
13328 status collapsed
13329
13330 \begin_layout Plain Layout
13331 t
13332 \end_layout
13333
13334 \end_inset
13335
13336
13337 \begin_inset Flex Code
13338 status collapsed
13339
13340 \begin_layout Plain Layout
13341 b
13342 \end_layout
13343
13344 \end_inset
13345
13346
13347 \begin_inset Flex Code
13348 status collapsed
13349
13350 \begin_layout Plain Layout
13351 p
13352 \end_layout
13353
13354 \end_inset
13355
13356  and 
13357 \begin_inset Flex Code
13358 status collapsed
13359
13360 \begin_layout Plain Layout
13361 h
13362 \end_layout
13363
13364 \end_inset
13365
13366  for top, bottom, page, and here, respectively.
13367 \begin_inset Foot
13368 status collapsed
13369
13370 \begin_layout Plain Layout
13371 Note that the order of these letters in the string is irrelevant, like in
13372  LaTeX.
13373 \end_layout
13374
13375 \end_inset
13376
13377  On top of that there is a new type, 
13378 \begin_inset Flex Code
13379 status collapsed
13380
13381 \begin_layout Plain Layout
13382 H
13383 \end_layout
13384
13385 \end_inset
13386
13387 , which does not really correspond to a float, since it means: put it 
13388 \begin_inset Quotes eld
13389 \end_inset
13390
13391 here
13392 \begin_inset Quotes erd
13393 \end_inset
13394
13395  and nowhere else.
13396  Note however that the 
13397 \begin_inset Flex Code
13398 status collapsed
13399
13400 \begin_layout Plain Layout
13401 H
13402 \end_layout
13403
13404 \end_inset
13405
13406  specifier is special and, because of implementation details, cannot be
13407  used in non-built in float types.
13408  If you do not understand what this means, just use 
13409 \begin_inset Quotes eld
13410 \end_inset
13411
13412
13413 \begin_inset Flex Code
13414 status collapsed
13415
13416 \begin_layout Plain Layout
13417 tbp
13418 \end_layout
13419
13420 \end_inset
13421
13422
13423 \begin_inset Quotes erd
13424 \end_inset
13425
13426 .
13427 \end_layout
13428
13429 \begin_layout Description
13430 \begin_inset Flex Code
13431 status collapsed
13432
13433 \begin_layout Plain Layout
13434 RefPrefix
13435 \end_layout
13436
13437 \end_inset
13438
13439  [
13440 \begin_inset Flex Code
13441 status collapsed
13442
13443 \begin_layout Plain Layout
13444 string
13445 \end_layout
13446
13447 \end_inset
13448
13449 ] The prefix to use when creating labels referring to floats of this type.
13450  This allows the use of formatted references.
13451  Note that you can remove any 
13452 \begin_inset Flex Code
13453 status collapsed
13454
13455 \begin_layout Plain Layout
13456 RefPrefix
13457 \end_layout
13458
13459 \end_inset
13460
13461  set by a copied style by using the special value 
13462 \begin_inset Quotes eld
13463 \end_inset
13464
13465 OFF
13466 \begin_inset Quotes erd
13467 \end_inset
13468
13469 , which must be all caps.
13470 \end_layout
13471
13472 \begin_layout Description
13473 \begin_inset Flex Code
13474 status collapsed
13475
13476 \begin_layout Plain Layout
13477 Style
13478 \end_layout
13479
13480 \end_inset
13481
13482  [
13483 \begin_inset Flex Code
13484 status collapsed
13485
13486 \begin_layout Plain Layout
13487 string
13488 \end_layout
13489
13490 \end_inset
13491
13492 =
13493 \begin_inset Quotes erd
13494 \end_inset
13495
13496
13497 \begin_inset Quotes erd
13498 \end_inset
13499
13500 ] The style used when defining the float using 
13501 \begin_inset Flex Code
13502 status collapsed
13503
13504 \begin_layout Plain Layout
13505
13506 \backslash
13507 newfloat
13508 \end_layout
13509
13510 \end_inset
13511
13512 .
13513 \end_layout
13514
13515 \begin_layout Description
13516 \begin_inset Flex Code
13517 status collapsed
13518
13519 \begin_layout Plain Layout
13520 Type
13521 \end_layout
13522
13523 \end_inset
13524
13525  [
13526 \begin_inset Flex Code
13527 status collapsed
13528
13529 \begin_layout Plain Layout
13530 string
13531 \end_layout
13532
13533 \end_inset
13534
13535 =
13536 \begin_inset Quotes erd
13537 \end_inset
13538
13539
13540 \begin_inset Quotes erd
13541 \end_inset
13542
13543 ] The 
13544 \begin_inset Quotes eld
13545 \end_inset
13546
13547 type
13548 \begin_inset Quotes erd
13549 \end_inset
13550
13551  of the new class of floats, like program or algorithm.
13552  After the appropriate 
13553 \begin_inset Flex Code
13554 status collapsed
13555
13556 \begin_layout Plain Layout
13557
13558 \backslash
13559 newfloat
13560 \end_layout
13561
13562 \end_inset
13563
13564 , commands such as 
13565 \begin_inset Flex Code
13566 status collapsed
13567
13568 \begin_layout Plain Layout
13569
13570 \backslash
13571 begin{program}
13572 \end_layout
13573
13574 \end_inset
13575
13576  or 
13577 \begin_inset Flex Code
13578 status collapsed
13579
13580 \begin_layout Plain Layout
13581
13582 \backslash
13583 end{algorithm*}
13584 \end_layout
13585
13586 \end_inset
13587
13588  will be available.
13589 \end_layout
13590
13591 \begin_layout Description
13592 \begin_inset Flex Code
13593 status collapsed
13594
13595 \begin_layout Plain Layout
13596 UsesFloatPkg
13597 \end_layout
13598
13599 \end_inset
13600
13601  [
13602 \begin_inset Flex Code
13603 status open
13604
13605 \begin_layout Plain Layout
13606 0
13607 \end_layout
13608
13609 \end_inset
13610
13611
13612 \begin_inset Flex Code
13613 status collapsed
13614
13615 \begin_layout Plain Layout
13616
13617 \emph on
13618 1
13619 \end_layout
13620
13621 \end_inset
13622
13623 ] Tells us whether this float is defined using the facilities provided by
13624  
13625 \begin_inset Flex Code
13626 status collapsed
13627
13628 \begin_layout Plain Layout
13629 float.sty
13630 \end_layout
13631
13632 \end_inset
13633
13634 , either by the class file or a package, or on-the-fly by LyX itself.
13635 \end_layout
13636
13637 \begin_layout Standard
13638 Note that defining a float with type 
13639 \begin_inset Flex Code
13640 status collapsed
13641
13642 \begin_layout Plain Layout
13643
13644 \emph on
13645 type
13646 \end_layout
13647
13648 \end_inset
13649
13650  automatically defines the corresponding counter with name 
13651 \begin_inset Flex Code
13652 status collapsed
13653
13654 \begin_layout Plain Layout
13655
13656 \emph on
13657 type
13658 \end_layout
13659
13660 \end_inset
13661
13662 .
13663 \end_layout
13664
13665 \begin_layout Subsection
13666 Flex insets and InsetLayout
13667 \begin_inset CommandInset label
13668 LatexCommand label
13669 name "sub:Flex-insets-and"
13670
13671 \end_inset
13672
13673
13674 \end_layout
13675
13676 \begin_layout Standard
13677 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13678  these are called Flex insets.
13679  
13680 \end_layout
13681
13682 \begin_layout Standard
13683 Flex insets come in three different kinds: 
13684 \end_layout
13685
13686 \begin_layout Itemize
13687 character style (
13688 \begin_inset Flex Code
13689 status collapsed
13690
13691 \begin_layout Plain Layout
13692 CharStyle
13693 \end_layout
13694
13695 \end_inset
13696
13697 ): These define semantic markup corresponding to such LaTeX commands as
13698  
13699 \begin_inset Flex Code
13700 status collapsed
13701
13702 \begin_layout Plain Layout
13703
13704 \backslash
13705 noun
13706 \end_layout
13707
13708 \end_inset
13709
13710  and 
13711 \begin_inset Flex Code
13712 status collapsed
13713
13714 \begin_layout Plain Layout
13715
13716 \backslash
13717 code
13718 \end_layout
13719
13720 \end_inset
13721
13722 .
13723 \end_layout
13724
13725 \begin_layout Itemize
13726 user custom (
13727 \begin_inset Flex Code
13728 status collapsed
13729
13730 \begin_layout Plain Layout
13731 Custom
13732 \end_layout
13733
13734 \end_inset
13735
13736 ): These can be used to define custom collapsible insets, similar to TeX
13737  code, footnote, and the like.
13738  An obvious example is an endnote inset, which is defined in the 
13739 \begin_inset Flex Code
13740 status collapsed
13741
13742 \begin_layout Plain Layout
13743 endnote
13744 \end_layout
13745
13746 \end_inset
13747
13748  module.
13749 \end_layout
13750
13751 \begin_layout Itemize
13752 XML elements (
13753 \begin_inset Flex Code
13754 status collapsed
13755
13756 \begin_layout Plain Layout
13757 Element
13758 \end_layout
13759
13760 \end_inset
13761
13762 ): For use with DocBook classes.
13763 \end_layout
13764
13765 \begin_layout Standard
13766 Flex insets are defined using the 
13767 \begin_inset Flex Code
13768 status collapsed
13769
13770 \begin_layout Plain Layout
13771 InsetLayout
13772 \end_layout
13773
13774 \end_inset
13775
13776  tag, which shall be explained in a moment.
13777 \end_layout
13778
13779 \begin_layout Standard
13780 The 
13781 \begin_inset Flex Code
13782 status collapsed
13783
13784 \begin_layout Plain Layout
13785 InsetLayout
13786 \end_layout
13787
13788 \end_inset
13789
13790  tag also serves another function: It can be used to customize the general
13791  layout of many different types of insets.
13792  Currently, 
13793 \begin_inset Flex Code
13794 status collapsed
13795
13796 \begin_layout Plain Layout
13797 InsetLayout
13798 \end_layout
13799
13800 \end_inset
13801
13802  can be used to customize the layout parameters for footnotes, marginal
13803  notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13804  boxes, tables, algorithms, URLs, and optional arguments, as well as to
13805  define Flex insets.
13806 \end_layout
13807
13808 \begin_layout Standard
13809 The 
13810 \begin_inset Flex Code
13811 status collapsed
13812
13813 \begin_layout Plain Layout
13814 InsetLayout
13815 \end_layout
13816
13817 \end_inset
13818
13819  definition must begin with a line of the form:
13820 \end_layout
13821
13822 \begin_layout LyX-Code
13823 InsetLayout <Type>
13824 \end_layout
13825
13826 \begin_layout Standard
13827 Here 
13828 \begin_inset Flex Code
13829 status collapsed
13830
13831 \begin_layout Plain Layout
13832 <Type>
13833 \end_layout
13834
13835 \end_inset
13836
13837  indicates the inset whose layout is being defined, and here there are two
13838  cases.
13839 \end_layout
13840
13841 \begin_layout Enumerate
13842 The layout for a pre-existing inset is being modified.
13843  In this case, can be 
13844 \begin_inset Flex Code
13845 status collapsed
13846
13847 \begin_layout Plain Layout
13848 <Type>
13849 \end_layout
13850
13851 \end_inset
13852
13853  any one of the following: 
13854 \begin_inset Flex Code
13855 status collapsed
13856
13857 \begin_layout Plain Layout
13858 Algorithm
13859 \end_layout
13860
13861 \end_inset
13862
13863
13864 \begin_inset Flex Code
13865 status collapsed
13866
13867 \begin_layout Plain Layout
13868 Branch
13869 \end_layout
13870
13871 \end_inset
13872
13873
13874 \begin_inset Flex Code
13875 status collapsed
13876
13877 \begin_layout Plain Layout
13878 Box
13879 \end_layout
13880
13881 \end_inset
13882
13883
13884 \begin_inset Flex Code
13885 status collapsed
13886
13887 \begin_layout Plain Layout
13888 Box:shaded
13889 \end_layout
13890
13891 \end_inset
13892
13893
13894 \begin_inset Flex Code
13895 status collapsed
13896
13897 \begin_layout Plain Layout
13898 ERT
13899 \end_layout
13900
13901 \end_inset
13902
13903
13904 \begin_inset Flex Code
13905 status collapsed
13906
13907 \begin_layout Plain Layout
13908 Figure
13909 \end_layout
13910
13911 \end_inset
13912
13913
13914 \begin_inset Flex Code
13915 status collapsed
13916
13917 \begin_layout Plain Layout
13918 Foot
13919 \end_layout
13920
13921 \end_inset
13922
13923
13924 \begin_inset Flex Code
13925 status collapsed
13926
13927 \begin_layout Plain Layout
13928 Index
13929 \end_layout
13930
13931 \end_inset
13932
13933
13934 \begin_inset Flex Code
13935 status collapsed
13936
13937 \begin_layout Plain Layout
13938 Info
13939 \end_layout
13940
13941 \end_inset
13942
13943
13944 \begin_inset Flex Code
13945 status collapsed
13946
13947 \begin_layout Plain Layout
13948 Info:menu
13949 \end_layout
13950
13951 \end_inset
13952
13953
13954 \begin_inset Flex Code
13955 status collapsed
13956
13957 \begin_layout Plain Layout
13958 Info:shortcut
13959 \end_layout
13960
13961 \end_inset
13962
13963
13964 \begin_inset Flex Code
13965 status collapsed
13966
13967 \begin_layout Plain Layout
13968 Info:shortcuts
13969 \end_layout
13970
13971 \end_inset
13972
13973
13974 \begin_inset Flex Code
13975 status collapsed
13976
13977 \begin_layout Plain Layout
13978 Listings
13979 \end_layout
13980
13981 \end_inset
13982
13983
13984 \begin_inset Flex Code
13985 status collapsed
13986
13987 \begin_layout Plain Layout
13988 Marginal
13989 \end_layout
13990
13991 \end_inset
13992
13993
13994 \begin_inset Flex Code
13995 status collapsed
13996
13997 \begin_layout Plain Layout
13998 Note:Comment
13999 \end_layout
14000
14001 \end_inset
14002
14003
14004 \begin_inset Flex Code
14005 status collapsed
14006
14007 \begin_layout Plain Layout
14008 Note:Note
14009 \end_layout
14010
14011 \end_inset
14012
14013
14014 \begin_inset Flex Code
14015 status collapsed
14016
14017 \begin_layout Plain Layout
14018 Note:Greyedout
14019 \end_layout
14020
14021 \end_inset
14022
14023
14024 \begin_inset Flex Code
14025 status collapsed
14026
14027 \begin_layout Plain Layout
14028 OptArg
14029 \end_layout
14030
14031 \end_inset
14032
14033
14034 \begin_inset Flex Code
14035 status collapsed
14036
14037 \begin_layout Plain Layout
14038 Table
14039 \end_layout
14040
14041 \end_inset
14042
14043 , or 
14044 \begin_inset Flex Code
14045 status collapsed
14046
14047 \begin_layout Plain Layout
14048 URL
14049 \end_layout
14050
14051 \end_inset
14052
14053 .
14054 \end_layout
14055
14056 \begin_layout Enumerate
14057 The layout for a Flex inset is being defined.
14058  In this case, 
14059 \begin_inset Flex Code
14060 status collapsed
14061
14062 \begin_layout Plain Layout
14063 <Type>
14064 \end_layout
14065
14066 \end_inset
14067
14068  may be be any valid identifier not used by a pre-existing inset.
14069  The identifier may include spaces, but in that case the whole thing must
14070  be wrapped in quotes.
14071  It may also include a namespace identifier, preceding a colon, such as
14072  
14073 \begin_inset Quotes eld
14074 \end_inset
14075
14076
14077 \begin_inset Flex Code
14078 status collapsed
14079
14080 \begin_layout Plain Layout
14081 Flex:Code
14082 \end_layout
14083
14084 \end_inset
14085
14086
14087 \begin_inset Quotes erd
14088 \end_inset
14089
14090 .
14091  Note that the definition of a flex inset 
14092 \emph on
14093 must 
14094 \emph default
14095 also include a 
14096 \begin_inset Flex Code
14097 status collapsed
14098
14099 \begin_layout Plain Layout
14100 LyXType
14101 \end_layout
14102
14103 \end_inset
14104
14105  entry, declaring which type of inset it defines.
14106 \end_layout
14107
14108 \begin_layout Standard
14109 The 
14110 \begin_inset Flex Code
14111 status collapsed
14112
14113 \begin_layout Plain Layout
14114 InsetLayout
14115 \end_layout
14116
14117 \end_inset
14118
14119  definition can contain the following entries:
14120 \end_layout
14121
14122 \begin_layout Description
14123 \begin_inset Flex Code
14124 status collapsed
14125
14126 \begin_layout Plain Layout
14127 BgColor
14128 \end_layout
14129
14130 \end_inset
14131
14132  The color for the inset's background.
14133  The valid colors are defined in 
14134 \begin_inset Flex Code
14135 status collapsed
14136
14137 \begin_layout Plain Layout
14138 src/ColorCode.h
14139 \end_layout
14140
14141 \end_inset
14142
14143 .
14144 \end_layout
14145
14146 \begin_layout Description
14147 \begin_inset Flex Code
14148 status collapsed
14149
14150 \begin_layout Plain Layout
14151 ContentAsLabel
14152 \end_layout
14153
14154 \end_inset
14155
14156  [
14157 \begin_inset Flex Code
14158 status collapsed
14159
14160 \begin_layout Plain Layout
14161
14162 \emph on
14163 0
14164 \end_layout
14165
14166 \end_inset
14167
14168 ,
14169 \begin_inset Flex Code
14170 status collapsed
14171
14172 \begin_layout Plain Layout
14173 1
14174 \end_layout
14175
14176 \end_inset
14177
14178 ] Whether to use the content of the inset as the label, when the inset is
14179  closed.
14180  Default is false.
14181 \end_layout
14182
14183 \begin_layout Description
14184 \begin_inset Flex Code
14185 status collapsed
14186
14187 \begin_layout Plain Layout
14188 CopyStyle
14189 \end_layout
14190
14191 \end_inset
14192
14193  As with paragraph styles (see page 
14194 \begin_inset CommandInset ref
14195 LatexCommand ref
14196 reference "des:CopyStyle"
14197
14198 \end_inset
14199
14200 ).
14201 \end_layout
14202
14203 \begin_layout Description
14204 \begin_inset Flex Code
14205 status collapsed
14206
14207 \begin_layout Plain Layout
14208 CustomPars
14209 \end_layout
14210
14211 \end_inset
14212
14213  [
14214 \begin_inset Flex Code
14215 status collapsed
14216
14217 \begin_layout Plain Layout
14218
14219 \emph on
14220 0
14221 \end_layout
14222
14223 \end_inset
14224
14225 ,
14226 \begin_inset Flex Code
14227 status collapsed
14228
14229 \begin_layout Plain Layout
14230 1
14231 \end_layout
14232
14233 \end_inset
14234
14235 ] Indicates whether the user may employ the Paragraph Settings dialog to
14236  customize the paragraph.
14237 \end_layout
14238
14239 \begin_layout Description
14240 \begin_inset Flex Code
14241 status collapsed
14242
14243 \begin_layout Plain Layout
14244 Decoration
14245 \end_layout
14246
14247 \end_inset
14248
14249  can be 
14250 \begin_inset Flex Code
14251 status collapsed
14252
14253 \begin_layout Plain Layout
14254 Classic
14255 \end_layout
14256
14257 \end_inset
14258
14259
14260 \begin_inset Flex Code
14261 status collapsed
14262
14263 \begin_layout Plain Layout
14264 Minimalistic
14265 \end_layout
14266
14267 \end_inset
14268
14269 , or 
14270 \begin_inset Flex Code
14271 status collapsed
14272
14273 \begin_layout Plain Layout
14274 Conglomerate
14275 \end_layout
14276
14277 \end_inset
14278
14279 , describing the rendering style used for the inset's frame and buttons.
14280  Footnotes generally use 
14281 \begin_inset Flex Code
14282 status collapsed
14283
14284 \begin_layout Plain Layout
14285 Classic
14286 \end_layout
14287
14288 \end_inset
14289
14290 , ERT insets generally 
14291 \begin_inset Flex Code
14292 status collapsed
14293
14294 \begin_layout Plain Layout
14295 Minimalistic
14296 \end_layout
14297
14298 \end_inset
14299
14300 , and character styles 
14301 \begin_inset Flex Code
14302 status collapsed
14303
14304 \begin_layout Plain Layout
14305 Conglomerate
14306 \end_layout
14307
14308 \end_inset
14309
14310 .
14311 \end_layout
14312
14313 \begin_layout Description
14314 \begin_inset Flex Code
14315 status collapsed
14316
14317 \begin_layout Plain Layout
14318 Display
14319 \end_layout
14320
14321 \end_inset
14322
14323  [
14324 \begin_inset Flex Code
14325 status collapsed
14326
14327 \begin_layout Plain Layout
14328 0
14329 \end_layout
14330
14331 \end_inset
14332
14333 ,
14334 \begin_inset Flex Code
14335 status collapsed
14336
14337 \begin_layout Plain Layout
14338
14339 \emph on
14340 1
14341 \end_layout
14342
14343 \end_inset
14344
14345 ] Only useful if 
14346 \begin_inset Flex Code
14347 status collapsed
14348
14349 \begin_layout Plain Layout
14350 LatexType
14351 \end_layout
14352
14353 \end_inset
14354
14355  is 
14356 \begin_inset Flex Code
14357 status collapsed
14358
14359 \begin_layout Plain Layout
14360 Environment
14361 \end_layout
14362
14363 \end_inset
14364
14365 .
14366  Indicates whether the environment will stand on its own in LaTeX output
14367  or will appear inline with the surrounding text.
14368  If set to false, it is supposed that the LaTeX environment ignores white
14369  space (including one newline character) after the 
14370 \begin_inset Flex Code
14371 status collapsed
14372
14373 \begin_layout Plain Layout
14374
14375 \backslash
14376 begin{
14377 \emph on
14378 LatexName
14379 \emph default
14380 }
14381 \end_layout
14382
14383 \end_inset
14384
14385  and 
14386 \begin_inset Flex Code
14387 status collapsed
14388
14389 \begin_layout Plain Layout
14390
14391 \backslash
14392 end{
14393 \emph on
14394 LatexName
14395 \emph default
14396 }
14397 \end_layout
14398
14399 \end_inset
14400
14401  tags.
14402  Default is true.
14403 \end_layout
14404
14405 \begin_layout Description
14406 \begin_inset Flex Code
14407 status collapsed
14408
14409 \begin_layout Plain Layout
14410 End
14411 \end_layout
14412
14413 \end_inset
14414
14415  Required at the end of the InsetLayout declarations.
14416 \end_layout
14417
14418 \begin_layout Description
14419 \begin_inset Flex Code
14420 status collapsed
14421
14422 \begin_layout Plain Layout
14423 Font
14424 \end_layout
14425
14426 \end_inset
14427
14428  The font used for both the text body 
14429 \emph on
14430 and
14431 \emph default
14432  the label.
14433  See section
14434 \begin_inset space ~
14435 \end_inset
14436
14437
14438 \begin_inset CommandInset ref
14439 LatexCommand ref
14440 reference "sub:Font-description"
14441
14442 \end_inset
14443
14444 .
14445  Note that defining this font automatically defines the 
14446 \begin_inset Flex Code
14447 status collapsed
14448
14449 \begin_layout Plain Layout
14450 LabelFont
14451 \end_layout
14452
14453 \end_inset
14454
14455  to the same value, so define this first and define 
14456 \begin_inset Flex Code
14457 status collapsed
14458
14459 \begin_layout Plain Layout
14460 LabelFont
14461 \end_layout
14462
14463 \end_inset
14464
14465  later if you want them to be different.
14466 \end_layout
14467
14468 \begin_layout Description
14469 \begin_inset Flex Code
14470 status collapsed
14471
14472 \begin_layout Plain Layout
14473 ForceLTR
14474 \end_layout
14475
14476 \end_inset
14477
14478  Force the 
14479 \begin_inset Quotes eld
14480 \end_inset
14481
14482 latex
14483 \begin_inset Quotes erd
14484 \end_inset
14485
14486  language, leading to Left-to-Right (latin) output, e.
14487 \begin_inset space \thinspace{}
14488 \end_inset
14489
14490 g.
14491 \begin_inset space \space{}
14492 \end_inset
14493
14494 in TeX code or URL.
14495  A kludge.
14496 \end_layout
14497
14498 \begin_layout Description
14499 \begin_inset Flex Code
14500 status collapsed
14501
14502 \begin_layout Plain Layout
14503 ForcePlain
14504 \end_layout
14505
14506 \end_inset
14507
14508  [
14509 \begin_inset Flex Code
14510 status collapsed
14511
14512 \begin_layout Plain Layout
14513
14514 \emph on
14515 0
14516 \end_layout
14517
14518 \end_inset
14519
14520 ,
14521 \begin_inset Flex Code
14522 status collapsed
14523
14524 \begin_layout Plain Layout
14525 1
14526 \end_layout
14527
14528 \end_inset
14529
14530 ] Indicates whether the PlainLayout should be used or, instead, the user
14531  can change the paragraph style used in the inset.
14532  Default is false.
14533 \end_layout
14534
14535 \begin_layout Description
14536 \begin_inset Flex Code
14537 status collapsed
14538
14539 \begin_layout Plain Layout
14540 FreeSpacing
14541 \end_layout
14542
14543 \end_inset
14544
14545  As with paragraph styles (see page 
14546 \begin_inset CommandInset ref
14547 LatexCommand pageref
14548 reference "des:FreeSpacing"
14549
14550 \end_inset
14551
14552 ).
14553  Default is false.
14554 \end_layout
14555
14556 \begin_layout Description
14557 \begin_inset Flex Code
14558 status collapsed
14559
14560 \begin_layout Plain Layout
14561 HTML*
14562 \end_layout
14563
14564 \end_inset
14565
14566  These tags control XHTML output.
14567  See section 
14568 \begin_inset CommandInset ref
14569 LatexCommand ref
14570 reference "sec:Tags-for-XHTML"
14571
14572 \end_inset
14573
14574 .
14575 \end_layout
14576
14577 \begin_layout Description
14578 \begin_inset Flex Code
14579 status collapsed
14580
14581 \begin_layout Plain Layout
14582 InToc
14583 \end_layout
14584
14585 \end_inset
14586
14587  [
14588 \begin_inset Flex Code
14589 status collapsed
14590
14591 \begin_layout Plain Layout
14592
14593 \emph on
14594 0
14595 \end_layout
14596
14597 \end_inset
14598
14599 ,
14600 \begin_inset Flex Code
14601 status collapsed
14602
14603 \begin_layout Plain Layout
14604 1
14605 \end_layout
14606
14607 \end_inset
14608
14609 ] Whether to include the contents of this inset in the strings generated
14610  for the `Outline' pane.
14611  One would not, for example, want the content of a footnote in a section
14612  header to be included in the TOC displayed in the outline, but one would
14613  normally want the content of a character style displayed.
14614  Default is false: not to include.
14615 \end_layout
14616
14617 \begin_layout Description
14618 \begin_inset Flex Code
14619 status collapsed
14620
14621 \begin_layout Plain Layout
14622 KeepEmpty
14623 \end_layout
14624
14625 \end_inset
14626
14627  As with paragraph styles (see page 
14628 \begin_inset CommandInset ref
14629 LatexCommand pageref
14630 reference "des:KeepEmpty"
14631
14632 \end_inset
14633
14634 ).
14635  Default is false.
14636 \end_layout
14637
14638 \begin_layout Description
14639 \begin_inset Flex Code
14640 status collapsed
14641
14642 \begin_layout Plain Layout
14643 LabelFont
14644 \end_layout
14645
14646 \end_inset
14647
14648  The font used for the label.
14649  See section
14650 \begin_inset space ~
14651 \end_inset
14652
14653
14654 \begin_inset CommandInset ref
14655 LatexCommand ref
14656 reference "sub:Font-description"
14657
14658 \end_inset
14659
14660 .
14661  Note that this definition can never appear before 
14662 \begin_inset Flex Code
14663 status collapsed
14664
14665 \begin_layout Plain Layout
14666 Font
14667 \end_layout
14668
14669 \end_inset
14670
14671 , lest it be ineffective.
14672 \end_layout
14673
14674 \begin_layout Description
14675 \begin_inset Flex Code
14676 status collapsed
14677
14678 \begin_layout Plain Layout
14679 LabelString
14680 \end_layout
14681
14682 \end_inset
14683
14684  What will be displayed on the button or elsewhere as the inset label.
14685  Some inset types (TeX code and Branch) modify this label on the fly.
14686 \end_layout
14687
14688 \begin_layout Description
14689 \begin_inset Flex Code
14690 status collapsed
14691
14692 \begin_layout Plain Layout
14693 LatexName
14694 \end_layout
14695
14696 \end_inset
14697
14698  The name of the corresponding LaTeX stuff.
14699  Either the environment or command name.
14700 \end_layout
14701
14702 \begin_layout Description
14703 \begin_inset Flex Code
14704 status collapsed
14705
14706 \begin_layout Plain Layout
14707 LatexParam
14708 \end_layout
14709
14710 \end_inset
14711
14712  The optional parameter for the corresponding 
14713 \begin_inset Flex Code
14714 status collapsed
14715
14716 \begin_layout Plain Layout
14717 LatexName
14718 \end_layout
14719
14720 \end_inset
14721
14722  stuff, including possible bracket pairs like 
14723 \begin_inset Flex Code
14724 status collapsed
14725
14726 \begin_layout Plain Layout
14727 []
14728 \end_layout
14729
14730 \end_inset
14731
14732 .
14733  This parameter cannot be changed from within LyX.
14734 \end_layout
14735
14736 \begin_layout Description
14737 \begin_inset Flex Code
14738 status collapsed
14739
14740 \begin_layout Plain Layout
14741 LatexType
14742 \end_layout
14743
14744 \end_inset
14745
14746  As with paragraph styles (see page 
14747 \begin_inset CommandInset ref
14748 LatexCommand pageref
14749 reference "des:LatexType"
14750
14751 \end_inset
14752
14753 ).
14754 \end_layout
14755
14756 \begin_layout Description
14757 \begin_inset Flex Code
14758 status collapsed
14759
14760 \begin_layout Plain Layout
14761 LyxType
14762 \end_layout
14763
14764 \end_inset
14765
14766  Can be 
14767 \begin_inset Flex Code
14768 status collapsed
14769
14770 \begin_layout Plain Layout
14771 charstyle
14772 \end_layout
14773
14774 \end_inset
14775
14776
14777 \begin_inset Flex Code
14778 status collapsed
14779
14780 \begin_layout Plain Layout
14781 custom
14782 \end_layout
14783
14784 \end_inset
14785
14786
14787 \begin_inset Flex Code
14788 status collapsed
14789
14790 \begin_layout Plain Layout
14791 element
14792 \end_layout
14793
14794 \end_inset
14795
14796 , or 
14797 \begin_inset Flex Code
14798 status collapsed
14799
14800 \begin_layout Plain Layout
14801 end
14802 \end_layout
14803
14804 \end_inset
14805
14806  (indicating a dummy definition ending definitions of charstyles, etc).
14807  This entry is required in and is only meaningful for Flex insets.
14808  Among other things, it determines on which menu this inset will appear.
14809  Setting 
14810 \begin_inset Flex Code
14811 status collapsed
14812
14813 \begin_layout Plain Layout
14814 LyXType
14815 \end_layout
14816
14817 \end_inset
14818
14819  to 
14820 \begin_inset Flex Code
14821 status collapsed
14822
14823 \begin_layout Plain Layout
14824 charstyle
14825 \end_layout
14826
14827 \end_inset
14828
14829  will set 
14830 \begin_inset Flex Code
14831 status collapsed
14832
14833 \begin_layout Plain Layout
14834 MultiPar
14835 \end_layout
14836
14837 \end_inset
14838
14839  to false.
14840  
14841 \begin_inset Flex Code
14842 status collapsed
14843
14844 \begin_layout Plain Layout
14845 MultiPar
14846 \end_layout
14847
14848 \end_inset
14849
14850  can be set to true for charstyle insets, if you wish, by setting it 
14851 \emph on
14852 after
14853 \emph default
14854  you set the 
14855 \begin_inset Flex Code
14856 status collapsed
14857
14858 \begin_layout Plain Layout
14859 LyXType
14860 \end_layout
14861
14862 \end_inset
14863
14864 .
14865 \end_layout
14866
14867 \begin_layout Description
14868 \begin_inset Flex Code
14869 status collapsed
14870
14871 \begin_layout Plain Layout
14872 MultiPar
14873 \end_layout
14874
14875 \end_inset
14876
14877  [
14878 \begin_inset Flex Code
14879 status collapsed
14880
14881 \begin_layout Plain Layout
14882
14883 \emph on
14884 0
14885 \end_layout
14886
14887 \end_inset
14888
14889 ,
14890 \begin_inset Flex Code
14891 status collapsed
14892
14893 \begin_layout Plain Layout
14894 1
14895 \end_layout
14896
14897 \end_inset
14898
14899 ] Whether multiple paragraphs are permitted in this inset.
14900  This will also set 
14901 \begin_inset Flex Code
14902 status collapsed
14903
14904 \begin_layout Plain Layout
14905 CustomPars
14906 \end_layout
14907
14908 \end_inset
14909
14910  to the same value and 
14911 \begin_inset Flex Code
14912 status collapsed
14913
14914 \begin_layout Plain Layout
14915 ForcePlain
14916 \end_layout
14917
14918 \end_inset
14919
14920  to the opposite value.
14921  These can be reset to other values, if they are used 
14922 \emph on
14923 after
14924 \emph default
14925  
14926 \begin_inset Flex Code
14927 status collapsed
14928
14929 \begin_layout Plain Layout
14930 MultiPar
14931 \end_layout
14932
14933 \end_inset
14934
14935 .
14936  Default is true.
14937 \end_layout
14938
14939 \begin_layout Description
14940 \begin_inset Flex Code
14941 status collapsed
14942
14943 \begin_layout Plain Layout
14944 NeedProtect
14945 \end_layout
14946
14947 \end_inset
14948
14949  [
14950 \begin_inset Flex Code
14951 status collapsed
14952
14953 \begin_layout Plain Layout
14954
14955 \emph on
14956 0
14957 \end_layout
14958
14959 \end_inset
14960
14961 ,
14962 \begin_inset Flex Code
14963 status collapsed
14964
14965 \begin_layout Plain Layout
14966 1
14967 \end_layout
14968
14969 \end_inset
14970
14971 ] Whether fragile commands in this layout should be 
14972 \begin_inset Flex Code
14973 status collapsed
14974
14975 \begin_layout Plain Layout
14976
14977 \backslash
14978 protect
14979 \end_layout
14980
14981 \end_inset
14982
14983 'ed.
14984  (Note: This is 
14985 \emph on
14986 not
14987 \emph default
14988  whether the command should itself be protected.) Default is false.
14989 \end_layout
14990
14991 \begin_layout Description
14992 \begin_inset Flex Code
14993 status collapsed
14994
14995 \begin_layout Plain Layout
14996 ParbreakIsNewline
14997 \end_layout
14998
14999 \end_inset
15000
15001  [
15002 \begin_inset Flex Code
15003 status collapsed
15004
15005 \begin_layout Plain Layout
15006
15007 \emph on
15008 0
15009 \end_layout
15010
15011 \end_inset
15012
15013
15014 \begin_inset Flex Code
15015 status collapsed
15016
15017 \begin_layout Plain Layout
15018 1
15019 \end_layout
15020
15021 \end_inset
15022
15023 ] As with paragraph styles (see page 
15024 \begin_inset CommandInset ref
15025 LatexCommand pageref
15026 reference "des:ParbreakIsNewline"
15027
15028 \end_inset
15029
15030 ).
15031  Default is false.
15032 \end_layout
15033
15034 \begin_layout Description
15035 \begin_inset Flex Code
15036 status collapsed
15037
15038 \begin_layout Plain Layout
15039 PassThru
15040 \end_layout
15041
15042 \end_inset
15043
15044  [
15045 \begin_inset Flex Code
15046 status collapsed
15047
15048 \begin_layout Plain Layout
15049
15050 \emph on
15051 0
15052 \end_layout
15053
15054 \end_inset
15055
15056 ,
15057 \begin_inset Flex Code
15058 status collapsed
15059
15060 \begin_layout Plain Layout
15061 1
15062 \end_layout
15063
15064 \end_inset
15065
15066 ] As with paragraph styles (see page 
15067 \begin_inset CommandInset ref
15068 LatexCommand pageref
15069 reference "des:PassThru"
15070
15071 \end_inset
15072
15073 ).
15074  Default is false.
15075 \end_layout
15076
15077 \begin_layout Description
15078 \begin_inset Flex Code
15079 status collapsed
15080
15081 \begin_layout Plain Layout
15082 Preamble
15083 \end_layout
15084
15085 \end_inset
15086
15087  As with paragraph styles (see page 
15088 \begin_inset CommandInset ref
15089 LatexCommand pageref
15090 reference "des:Preamble"
15091
15092 \end_inset
15093
15094 ).
15095 \end_layout
15096
15097 \begin_layout Description
15098 \begin_inset Flex Code
15099 status collapsed
15100
15101 \begin_layout Plain Layout
15102 RefPrefix
15103 \end_layout
15104
15105 \end_inset
15106
15107  [
15108 \begin_inset Flex Code
15109 status collapsed
15110
15111 \begin_layout Plain Layout
15112 string
15113 \end_layout
15114
15115 \end_inset
15116
15117 ] The prefix to use when creating labels referring to insets of this type.
15118  This allows the use of formatted references.
15119 \end_layout
15120
15121 \begin_layout Description
15122 \begin_inset Flex Code
15123 status collapsed
15124
15125 \begin_layout Plain Layout
15126 Requires
15127 \end_layout
15128
15129 \end_inset
15130
15131  [
15132 \begin_inset Flex Code
15133 status collapsed
15134
15135 \begin_layout Plain Layout
15136 string
15137 \end_layout
15138
15139 \end_inset
15140
15141 ] As with paragraph styles (see page 
15142 \begin_inset CommandInset ref
15143 LatexCommand pageref
15144 reference "des:Requires"
15145
15146 \end_inset
15147
15148 ).
15149 \end_layout
15150
15151 \begin_layout Description
15152 \begin_inset Flex Code
15153 status collapsed
15154
15155 \begin_layout Plain Layout
15156 ResetsFont
15157 \end_layout
15158
15159 \end_inset
15160
15161  [
15162 \begin_inset Flex Code
15163 status collapsed
15164
15165 \begin_layout Plain Layout
15166 0
15167 \end_layout
15168
15169 \end_inset
15170
15171 ,
15172 \begin_inset Flex Code
15173 status collapsed
15174
15175 \begin_layout Plain Layout
15176
15177 \emph on
15178 1
15179 \end_layout
15180
15181 \end_inset
15182
15183 ] Whether this inset should use the font of its surrounding environment
15184  or uses its own.
15185  Default is true: uses its own.
15186 \end_layout
15187
15188 \begin_layout Description
15189 \begin_inset Flex Code
15190 status collapsed
15191
15192 \begin_layout Plain Layout
15193 Spellcheck
15194 \end_layout
15195
15196 \end_inset
15197
15198  [
15199 \begin_inset Flex Code
15200 status collapsed
15201
15202 \begin_layout Plain Layout
15203 0
15204 \end_layout
15205
15206 \end_inset
15207
15208 ,
15209 \begin_inset Flex Code
15210 status collapsed
15211
15212 \begin_layout Plain Layout
15213
15214 \emph on
15215 1
15216 \end_layout
15217
15218 \end_inset
15219
15220 ] Spellcheck the contents of this inset.
15221  Default is true.
15222 \end_layout
15223
15224 \begin_layout Subsection
15225 Counters
15226 \begin_inset CommandInset label
15227 LatexCommand label
15228 name "sub:Counters"
15229
15230 \end_inset
15231
15232
15233 \end_layout
15234
15235 \begin_layout Standard
15236 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15237  counters (
15238 \begin_inset Flex MenuItem
15239 status collapsed
15240
15241 \begin_layout Plain Layout
15242 chapter
15243 \end_layout
15244
15245 \end_inset
15246
15247
15248 \begin_inset Flex MenuItem
15249 status collapsed
15250
15251 \begin_layout Plain Layout
15252 figure
15253 \end_layout
15254
15255 \end_inset
15256
15257 , \SpecialChar \ldots{}
15258 ) in the text class itself.
15259  The standard counters are defined in the file 
15260 \begin_inset Flex Code
15261 status collapsed
15262
15263 \begin_layout Plain Layout
15264 stdcounters.inc
15265 \end_layout
15266
15267 \end_inset
15268
15269 , so you may have to do no more than add
15270 \end_layout
15271
15272 \begin_layout LyX-Code
15273 Input stdcounters.inc
15274 \end_layout
15275
15276 \begin_layout Standard
15277 to your layout file to get them to work.
15278  But if you want to define custom counters, then you can do so.
15279  The counter declaration must begin with:
15280 \end_layout
15281
15282 \begin_layout LyX-Code
15283 Counter CounterName
15284 \end_layout
15285
15286 \begin_layout Standard
15287 where of course `
15288 \begin_inset Flex Code
15289 status collapsed
15290
15291 \begin_layout Plain Layout
15292 CounterName
15293 \end_layout
15294
15295 \end_inset
15296
15297 ' is replaced by the name of the counter.
15298  And it must end with 
15299 \begin_inset Quotes eld
15300 \end_inset
15301
15302
15303 \begin_inset Flex Code
15304 status collapsed
15305
15306 \begin_layout Plain Layout
15307 End
15308 \end_layout
15309
15310 \end_inset
15311
15312
15313 \begin_inset Quotes erd
15314 \end_inset
15315
15316 .
15317  The following parameters can also be used:
15318 \end_layout
15319
15320 \begin_layout Description
15321 \begin_inset Flex Code
15322 status collapsed
15323
15324 \begin_layout Plain Layout
15325 LabelString
15326 \end_layout
15327
15328 \end_inset
15329
15330  [
15331 \begin_inset Flex Code
15332 status collapsed
15333
15334 \begin_layout Plain Layout
15335 string
15336 \end_layout
15337
15338 \end_inset
15339
15340 =
15341 \begin_inset Quotes erd
15342 \end_inset
15343
15344
15345 \begin_inset Quotes erd
15346 \end_inset
15347
15348 ] When defined, this string defines how the counter is displayed.
15349  Setting this value sets 
15350 \begin_inset Flex Code
15351 status collapsed
15352
15353 \begin_layout Plain Layout
15354 LabelStringAppendix
15355 \end_layout
15356
15357 \end_inset
15358
15359  to the same value.
15360  The following special constructs can be used in the string:
15361 \end_layout
15362
15363 \begin_deeper
15364 \begin_layout Itemize
15365 \begin_inset Flex Code
15366 status collapsed
15367
15368 \begin_layout Plain Layout
15369
15370 \backslash
15371 thecounter
15372 \end_layout
15373
15374 \end_inset
15375
15376  will be replaced by the expansion of the 
15377 \begin_inset Flex Code
15378 status collapsed
15379
15380 \begin_layout Plain Layout
15381 LabelString
15382 \end_layout
15383
15384 \end_inset
15385
15386  (or 
15387 \begin_inset Flex Code
15388 status collapsed
15389
15390 \begin_layout Plain Layout
15391 LabelStringAppendix
15392 \end_layout
15393
15394 \end_inset
15395
15396 ) of the counter 
15397 \begin_inset Flex Code
15398 status collapsed
15399
15400 \begin_layout Plain Layout
15401 counter
15402 \end_layout
15403
15404 \end_inset
15405
15406 .
15407  
15408 \end_layout
15409
15410 \begin_layout Itemize
15411 counter values can be expressed using LaTeX-like macros 
15412 \begin_inset Flex Code
15413 status collapsed
15414
15415 \begin_layout Plain Layout
15416
15417 \backslash
15418
15419 \emph on
15420 numbertype
15421 \emph default
15422 {
15423 \emph on
15424 counter
15425 \emph default
15426 }
15427 \end_layout
15428
15429 \end_inset
15430
15431 , where 
15432 \begin_inset Flex Code
15433 status collapsed
15434
15435 \begin_layout Plain Layout
15436
15437 \emph on
15438 numbertype
15439 \end_layout
15440
15441 \end_inset
15442
15443  can be:
15444 \begin_inset Foot
15445 status collapsed
15446
15447 \begin_layout Plain Layout
15448
15449 \family roman
15450 \series medium
15451 \shape up
15452 \size normal
15453 \emph off
15454 \bar no
15455 \noun off
15456 \color none
15457 Actually, the situation is a bit more complicated: any
15458 \family default
15459 \series default
15460 \shape default
15461 \emph default
15462 \bar default
15463  
15464 \size default
15465 \emph on
15466 \noun default
15467 \color inherit
15468 numbertype
15469 \family roman
15470 \series medium
15471 \shape up
15472 \size normal
15473 \emph off
15474 \bar no
15475 \noun off
15476  other than those described below will produce arabic numerals.
15477  It would not be surprising to see this change in the future.
15478 \end_layout
15479
15480 \end_inset
15481
15482  
15483 \begin_inset Flex Code
15484 status collapsed
15485
15486 \begin_layout Plain Layout
15487 arabic
15488 \end_layout
15489
15490 \end_inset
15491
15492 : 1, 2, 3,\SpecialChar \ldots{}
15493
15494 \begin_inset Flex Code
15495 status collapsed
15496
15497 \begin_layout Plain Layout
15498 alph
15499 \end_layout
15500
15501 \end_inset
15502
15503  for lower-case letters: a, b, c, \SpecialChar \ldots{}
15504
15505 \begin_inset Flex Code
15506 status collapsed
15507
15508 \begin_layout Plain Layout
15509 Alph
15510 \end_layout
15511
15512 \end_inset
15513
15514  for upper-case letters: A, B, C, \SpecialChar \ldots{}
15515
15516 \begin_inset Flex Code
15517 status collapsed
15518
15519 \begin_layout Plain Layout
15520 roman
15521 \end_layout
15522
15523 \end_inset
15524
15525  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15526
15527 \begin_inset Flex Code
15528 status collapsed
15529
15530 \begin_layout Plain Layout
15531 Roman
15532 \end_layout
15533
15534 \end_inset
15535
15536  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15537
15538 \begin_inset Flex Code
15539 status collapsed
15540
15541 \begin_layout Plain Layout
15542 hebrew
15543 \end_layout
15544
15545 \end_inset
15546
15547  for hebrew numerals.
15548 \end_layout
15549
15550 \end_deeper
15551 \begin_layout Standard
15552 If LabelString is not defined, a default value is constructed as follows:
15553  if the counter has a master counter 
15554 \begin_inset Flex Code
15555 status collapsed
15556
15557 \begin_layout Plain Layout
15558 master
15559 \end_layout
15560
15561 \end_inset
15562
15563  (defined via 
15564 \begin_inset Flex Code
15565 status collapsed
15566
15567 \begin_layout Plain Layout
15568 Within
15569 \end_layout
15570
15571 \end_inset
15572
15573 ), the string 
15574 \begin_inset Flex Code
15575 status collapsed
15576
15577 \begin_layout Plain Layout
15578
15579 \backslash
15580 themaster.
15581 \backslash
15582 arabic{counter}
15583 \end_layout
15584
15585 \end_inset
15586
15587  is used; otherwise the string 
15588 \begin_inset Flex Code
15589 status collapsed
15590
15591 \begin_layout Plain Layout
15592
15593 \backslash
15594 arabic{counter}
15595 \end_layout
15596
15597 \end_inset
15598
15599  is used.
15600 \end_layout
15601
15602 \begin_layout Description
15603 \begin_inset Flex Code
15604 status collapsed
15605
15606 \begin_layout Plain Layout
15607 LabelStringAppendix
15608 \end_layout
15609
15610 \end_inset
15611
15612  [
15613 \begin_inset Flex Code
15614 status collapsed
15615
15616 \begin_layout Plain Layout
15617 string
15618 \end_layout
15619
15620 \end_inset
15621
15622 =
15623 \begin_inset Quotes erd
15624 \end_inset
15625
15626
15627 \begin_inset Quotes erd
15628 \end_inset
15629
15630 ] Same as 
15631 \begin_inset Flex Code
15632 status collapsed
15633
15634 \begin_layout Plain Layout
15635 LabelString
15636 \end_layout
15637
15638 \end_inset
15639
15640 , but for use in the Appendix.
15641 \end_layout
15642
15643 \begin_layout Description
15644 \begin_inset Flex Code
15645 status collapsed
15646
15647 \begin_layout Plain Layout
15648 PrettyFormat
15649 \end_layout
15650
15651 \end_inset
15652
15653  [
15654 \begin_inset Flex Code
15655 status collapsed
15656
15657 \begin_layout Plain Layout
15658 string
15659 \end_layout
15660
15661 \end_inset
15662
15663 =
15664 \begin_inset Quotes erd
15665 \end_inset
15666
15667
15668 \begin_inset Quotes erd
15669 \end_inset
15670
15671 ] A format for use with formatted references to this counter.
15672  For example, one might want to have references to section numbers appear
15673  as 
15674 \begin_inset Quotes eld
15675 \end_inset
15676
15677 Section 2.4
15678 \begin_inset Quotes erd
15679 \end_inset
15680
15681 .
15682  The string should contain 
15683 \begin_inset Quotes eld
15684 \end_inset
15685
15686 ##
15687 \begin_inset Quotes erd
15688 \end_inset
15689
15690 .
15691  This will be replaced by the counter number itself.
15692  So, for sections, it would be: Section ##.
15693 \end_layout
15694
15695 \begin_layout Description
15696 \begin_inset Flex Code
15697 status collapsed
15698
15699 \begin_layout Plain Layout
15700 Within
15701 \end_layout
15702
15703 \end_inset
15704
15705  [
15706 \begin_inset Flex Code
15707 status collapsed
15708
15709 \begin_layout Plain Layout
15710 string
15711 \end_layout
15712
15713 \end_inset
15714
15715 =
15716 \begin_inset Quotes erd
15717 \end_inset
15718
15719
15720 \begin_inset Quotes erd
15721 \end_inset
15722
15723 ] If this is set to the name of another counter, the present counter will
15724  be reset every time the other one is increased.
15725  For example, 
15726 \begin_inset Flex Code
15727 status collapsed
15728
15729 \begin_layout Plain Layout
15730 subsection
15731 \end_layout
15732
15733 \end_inset
15734
15735  is numbered inside 
15736 \begin_inset Flex Code
15737 status collapsed
15738
15739 \begin_layout Plain Layout
15740 section
15741 \end_layout
15742
15743 \end_inset
15744
15745 .
15746 \end_layout
15747
15748 \begin_layout Subsection
15749 Font description
15750 \begin_inset CommandInset label
15751 LatexCommand label
15752 name "sub:Font-description"
15753
15754 \end_inset
15755
15756
15757 \end_layout
15758
15759 \begin_layout Standard
15760 A font description looks like this:
15761 \end_layout
15762
15763 \begin_layout LyX-Code
15764 Font 
15765 \family roman
15766 \emph on
15767 or
15768 \family default
15769 \emph default
15770  LabelFont
15771 \end_layout
15772
15773 \begin_layout LyX-Code
15774  ...
15775 \end_layout
15776
15777 \begin_layout LyX-Code
15778 EndFont
15779 \end_layout
15780
15781 \begin_layout Standard
15782 The following commands are available:
15783 \end_layout
15784
15785 \begin_layout Description
15786 \begin_inset Flex Code
15787 status collapsed
15788
15789 \begin_layout Plain Layout
15790 Color
15791 \end_layout
15792
15793 \end_inset
15794
15795  [
15796 \begin_inset Flex Code
15797 status collapsed
15798
15799 \begin_layout Plain Layout
15800
15801 \emph on
15802 none
15803 \end_layout
15804
15805 \end_inset
15806
15807
15808 \begin_inset Flex Code
15809 status collapsed
15810
15811 \begin_layout Plain Layout
15812 black
15813 \end_layout
15814
15815 \end_inset
15816
15817
15818 \begin_inset Flex Code
15819 status collapsed
15820
15821 \begin_layout Plain Layout
15822 white
15823 \end_layout
15824
15825 \end_inset
15826
15827
15828 \begin_inset Flex Code
15829 status collapsed
15830
15831 \begin_layout Plain Layout
15832 red
15833 \end_layout
15834
15835 \end_inset
15836
15837
15838 \begin_inset Flex Code
15839 status collapsed
15840
15841 \begin_layout Plain Layout
15842 green
15843 \end_layout
15844
15845 \end_inset
15846
15847
15848 \begin_inset Flex Code
15849 status collapsed
15850
15851 \begin_layout Plain Layout
15852 blue
15853 \end_layout
15854
15855 \end_inset
15856
15857
15858 \begin_inset Flex Code
15859 status collapsed
15860
15861 \begin_layout Plain Layout
15862 cyan
15863 \end_layout
15864
15865 \end_inset
15866
15867
15868 \begin_inset Flex Code
15869 status collapsed
15870
15871 \begin_layout Plain Layout
15872 magenta
15873 \end_layout
15874
15875 \end_inset
15876
15877
15878 \begin_inset Flex Code
15879 status collapsed
15880
15881 \begin_layout Plain Layout
15882 yellow
15883 \end_layout
15884
15885 \end_inset
15886
15887 ]
15888 \end_layout
15889
15890 \begin_layout Description
15891 \begin_inset Flex Code
15892 status collapsed
15893
15894 \begin_layout Plain Layout
15895 Family
15896 \end_layout
15897
15898 \end_inset
15899
15900  [
15901 \begin_inset Flex Code
15902 status collapsed
15903
15904 \begin_layout Plain Layout
15905
15906 \emph on
15907 Roman
15908 \end_layout
15909
15910 \end_inset
15911
15912
15913 \begin_inset Flex Code
15914 status collapsed
15915
15916 \begin_layout Plain Layout
15917 Sans
15918 \end_layout
15919
15920 \end_inset
15921
15922
15923 \begin_inset Flex Code
15924 status collapsed
15925
15926 \begin_layout Plain Layout
15927 Typewriter
15928 \end_layout
15929
15930 \end_inset
15931
15932
15933 \end_layout
15934
15935 \begin_layout Description
15936 \begin_inset Flex Code
15937 status collapsed
15938
15939 \begin_layout Plain Layout
15940 Misc
15941 \end_layout
15942
15943 \end_inset
15944
15945  [
15946 \begin_inset Flex Code
15947 status collapsed
15948
15949 \begin_layout Plain Layout
15950 string
15951 \end_layout
15952
15953 \end_inset
15954
15955 ] Valid arguments are: 
15956 \begin_inset Flex Code
15957 status collapsed
15958
15959 \begin_layout Plain Layout
15960 emph
15961 \end_layout
15962
15963 \end_inset
15964
15965
15966 \begin_inset Flex Code
15967 status collapsed
15968
15969 \begin_layout Plain Layout
15970 noun
15971 \end_layout
15972
15973 \end_inset
15974
15975
15976 \begin_inset Flex Code
15977 status collapsed
15978
15979 \begin_layout Plain Layout
15980 underbar
15981 \end_layout
15982
15983 \end_inset
15984
15985
15986 \begin_inset Flex Code
15987 status collapsed
15988
15989 \begin_layout Plain Layout
15990 no_emph
15991 \end_layout
15992
15993 \end_inset
15994
15995
15996 \begin_inset Flex Code
15997 status collapsed
15998
15999 \begin_layout Plain Layout
16000 no_noun
16001 \end_layout
16002
16003 \end_inset
16004
16005  and 
16006 \begin_inset Flex Code
16007 status collapsed
16008
16009 \begin_layout Plain Layout
16010 no_bar
16011 \end_layout
16012
16013 \end_inset
16014
16015 .
16016  Each of these turns on or off the corresponding attribute.
16017  For example, 
16018 \begin_inset Flex Code
16019 status collapsed
16020
16021 \begin_layout Plain Layout
16022 emph
16023 \end_layout
16024
16025 \end_inset
16026
16027  turns on emphasis, and 
16028 \begin_inset Flex Code
16029 status collapsed
16030
16031 \begin_layout Plain Layout
16032 no_emph
16033 \end_layout
16034
16035 \end_inset
16036
16037  turns it off.
16038  
16039 \begin_inset Newline newline
16040 \end_inset
16041
16042 If the latter seems puzzling, remember that the font settings for the present
16043  context are generally inherited from the surrounding context.
16044  So 
16045 \begin_inset Flex Code
16046 status collapsed
16047
16048 \begin_layout Plain Layout
16049 no_emph
16050 \end_layout
16051
16052 \end_inset
16053
16054  would turn off the emphasis that was anyway in effect, say, in a theorem
16055  environment.
16056 \end_layout
16057
16058 \begin_layout Description
16059 \begin_inset Flex Code
16060 status collapsed
16061
16062 \begin_layout Plain Layout
16063 Series
16064 \end_layout
16065
16066 \end_inset
16067
16068  [
16069 \begin_inset Flex Code
16070 status collapsed
16071
16072 \begin_layout Plain Layout
16073
16074 \emph on
16075 Medium
16076 \end_layout
16077
16078 \end_inset
16079
16080
16081 \begin_inset Flex Code
16082 status collapsed
16083
16084 \begin_layout Plain Layout
16085 Bold
16086 \end_layout
16087
16088 \end_inset
16089
16090
16091 \end_layout
16092
16093 \begin_layout Description
16094 \begin_inset Flex Code
16095 status collapsed
16096
16097 \begin_layout Plain Layout
16098 Shape
16099 \end_layout
16100
16101 \end_inset
16102
16103  [
16104 \begin_inset Flex Code
16105 status collapsed
16106
16107 \begin_layout Plain Layout
16108
16109 \emph on
16110 Up
16111 \end_layout
16112
16113 \end_inset
16114
16115
16116 \begin_inset Flex Code
16117 status collapsed
16118
16119 \begin_layout Plain Layout
16120 Italic
16121 \end_layout
16122
16123 \end_inset
16124
16125
16126 \begin_inset Flex Code
16127 status collapsed
16128
16129 \begin_layout Plain Layout
16130 SmallCaps
16131 \end_layout
16132
16133 \end_inset
16134
16135
16136 \begin_inset Flex Code
16137 status collapsed
16138
16139 \begin_layout Plain Layout
16140 Slanted
16141 \end_layout
16142
16143 \end_inset
16144
16145
16146 \end_layout
16147
16148 \begin_layout Description
16149 \begin_inset Flex Code
16150 status collapsed
16151
16152 \begin_layout Plain Layout
16153 Size
16154 \end_layout
16155
16156 \end_inset
16157
16158  [
16159 \begin_inset Flex Code
16160 status collapsed
16161
16162 \begin_layout Plain Layout
16163 tiny
16164 \end_layout
16165
16166 \end_inset
16167
16168
16169 \begin_inset Flex Code
16170 status collapsed
16171
16172 \begin_layout Plain Layout
16173 small
16174 \end_layout
16175
16176 \end_inset
16177
16178
16179 \begin_inset Flex Code
16180 status collapsed
16181
16182 \begin_layout Plain Layout
16183
16184 \emph on
16185 normal
16186 \end_layout
16187
16188 \end_inset
16189
16190
16191 \begin_inset Flex Code
16192 status collapsed
16193
16194 \begin_layout Plain Layout
16195 large
16196 \end_layout
16197
16198 \end_inset
16199
16200
16201 \begin_inset Flex Code
16202 status collapsed
16203
16204 \begin_layout Plain Layout
16205 larger
16206 \end_layout
16207
16208 \end_inset
16209
16210
16211 \begin_inset Flex Code
16212 status collapsed
16213
16214 \begin_layout Plain Layout
16215 largest
16216 \end_layout
16217
16218 \end_inset
16219
16220
16221 \begin_inset Flex Code
16222 status collapsed
16223
16224 \begin_layout Plain Layout
16225 huge
16226 \end_layout
16227
16228 \end_inset
16229
16230
16231 \begin_inset Flex Code
16232 status collapsed
16233
16234 \begin_layout Plain Layout
16235 giant
16236 \end_layout
16237
16238 \end_inset
16239
16240 ]
16241 \end_layout
16242
16243 \begin_layout Subsection
16244 \begin_inset CommandInset label
16245 LatexCommand label
16246 name "sub:Citation-format-description"
16247
16248 \end_inset
16249
16250 Citation format description
16251 \end_layout
16252
16253 \begin_layout Standard
16254 The 
16255 \begin_inset Flex Code
16256 status collapsed
16257
16258 \begin_layout Plain Layout
16259 CiteFormat
16260 \end_layout
16261
16262 \end_inset
16263
16264  blocks are used to describe how bibliographic information should be displayed,
16265  both within LyX itself (in the citation dialog and in tooltips, for example)
16266  and in XHTML output.
16267  Such a block might look like this:
16268 \end_layout
16269
16270 \begin_layout LyX-Code
16271 CiteFormat
16272 \end_layout
16273
16274 \begin_layout LyX-Code
16275  article ...
16276 \end_layout
16277
16278 \begin_layout LyX-Code
16279  book ...
16280 \end_layout
16281
16282 \begin_layout LyX-Code
16283 End
16284 \end_layout
16285
16286 \begin_layout Standard
16287 The individual lines define how the bibliographic information associated
16288  with an article or book, respectively, is to be displayed, and such a definitio
16289 n can be given for any `entry type' that might be present in a BibTeX file.
16290  LyX defines a default format in the source code that will be used if no
16291  specific definition has been given.
16292  LyX predefines several formats in the file 
16293 \begin_inset Flex Code
16294 status collapsed
16295
16296 \begin_layout Plain Layout
16297 stdciteformats.inc
16298 \end_layout
16299
16300 \end_inset
16301
16302 , which is included in most of LyX's document classes.
16303 \end_layout
16304
16305 \begin_layout Standard
16306 The definitions use a simple language that allows BibTeX keys to be replaced
16307  with their values.
16308  Keys should be enclosed in 
16309 \begin_inset Flex Code
16310 status collapsed
16311
16312 \begin_layout Plain Layout
16313 %
16314 \end_layout
16315
16316 \end_inset
16317
16318  signs, e.g.: 
16319 \begin_inset Flex Code
16320 status collapsed
16321
16322 \begin_layout Plain Layout
16323 %author%
16324 \end_layout
16325
16326 \end_inset
16327
16328 .
16329  So a simple definition might look like this:
16330 \end_layout
16331
16332 \begin_layout LyX-Code
16333 misc %author%, 
16334 \begin_inset Quotes eld
16335 \end_inset
16336
16337 %title
16338 \begin_inset Quotes erd
16339 \end_inset
16340
16341
16342 \end_layout
16343
16344 \begin_layout Standard
16345 This would print the author, followed by a comma, followed by the title,
16346  in quotes, followed by a period.
16347 \end_layout
16348
16349 \begin_layout Standard
16350 Of course, sometimes you may want to print a key only if it exists.
16351  This can be done by using a conditional construction, such as: 
16352 \begin_inset Flex Code
16353 status collapsed
16354
16355 \begin_layout Plain Layout
16356 {%volume%[[vol.
16357 \begin_inset space ~
16358 \end_inset
16359
16360 %volume%]]}
16361 \end_layout
16362
16363 \end_inset
16364
16365 .
16366  This says: If the 
16367 \begin_inset Flex Code
16368 status collapsed
16369
16370 \begin_layout Plain Layout
16371 volume
16372 \end_layout
16373
16374 \end_inset
16375
16376  key exists, then print 
16377 \begin_inset Quotes eld
16378 \end_inset
16379
16380 vol.
16381 \begin_inset space ~
16382 \end_inset
16383
16384
16385 \begin_inset Quotes erd
16386 \end_inset
16387
16388  followed by the volume key.
16389  It is also possible to have an else clause in the conditional, such as:
16390  
16391 \begin_inset Flex Code
16392 status collapsed
16393
16394 \begin_layout Plain Layout
16395 {%author%[[%author%]][[%editor%, ed.]]}
16396 \end_layout
16397
16398 \end_inset
16399
16400 .
16401  Here, the 
16402 \begin_inset Flex Code
16403 status collapsed
16404
16405 \begin_layout Plain Layout
16406 author
16407 \end_layout
16408
16409 \end_inset
16410
16411  key is printed if it exists; otherwise, the editor key is printed, followed
16412  by 
16413 \begin_inset Quotes eld
16414 \end_inset
16415
16416 ,
16417 \begin_inset space ~
16418 \end_inset
16419
16420 ed.
16421 \begin_inset Quotes erd
16422 \end_inset
16423
16424  Note that the key is again enclosed in 
16425 \begin_inset Flex Code
16426 status collapsed
16427
16428 \begin_layout Plain Layout
16429 %
16430 \end_layout
16431
16432 \end_inset
16433
16434  signs; the entire conditional is enclosed in braces; and the if and else
16435  clauses are enclosed in double brackets, 
16436 \begin_inset Quotes eld
16437 \end_inset
16438
16439
16440 \begin_inset Flex Code
16441 status collapsed
16442
16443 \begin_layout Plain Layout
16444 [[
16445 \end_layout
16446
16447 \end_inset
16448
16449
16450 \begin_inset Quotes eld
16451 \end_inset
16452
16453  and 
16454 \begin_inset Quotes eld
16455 \end_inset
16456
16457
16458 \begin_inset Flex Code
16459 status collapsed
16460
16461 \begin_layout Plain Layout
16462 ]]
16463 \end_layout
16464
16465 \end_inset
16466
16467
16468 \begin_inset Quotes erd
16469 \end_inset
16470
16471 .
16472  There must be no space between any of these.
16473 \end_layout
16474
16475 \begin_layout Standard
16476 There is one other piece of syntax available in definitions, which looks
16477  like this: 
16478 \begin_inset Flex Code
16479 status collapsed
16480
16481 \begin_layout Plain Layout
16482 {!<i>!}
16483 \end_layout
16484
16485 \end_inset
16486
16487 .
16488  This defines a piece of formatting information that is to be used when
16489  creating 
16490 \begin_inset Quotes eld
16491 \end_inset
16492
16493 rich text
16494 \begin_inset Quotes erd
16495 \end_inset
16496
16497 .
16498  Obviously, we do not want to output HTML tags when writing plain text,
16499  so they should be wrapped in 
16500 \begin_inset Quotes eld
16501 \end_inset
16502
16503 {!
16504 \begin_inset Quotes erd
16505 \end_inset
16506
16507  and 
16508 \begin_inset Quotes eld
16509 \end_inset
16510
16511 !}
16512 \begin_inset Quotes erd
16513 \end_inset
16514
16515 .
16516 \end_layout
16517
16518 \begin_layout Standard
16519 Two special sorts of definitions are also possible in a 
16520 \begin_inset Flex Code
16521 status collapsed
16522
16523 \begin_layout Plain Layout
16524 CiteFormat
16525 \end_layout
16526
16527 \end_inset
16528
16529  block.
16530  An example of the first would be:
16531 \end_layout
16532
16533 \begin_layout LyX-Code
16534 !quotetitle 
16535 \begin_inset Quotes eld
16536 \end_inset
16537
16538 %title%
16539 \begin_inset Quotes erd
16540 \end_inset
16541
16542
16543 \end_layout
16544
16545 \begin_layout Standard
16546 This is an abbreviation, or macro, and it can be used by treating it as
16547  if it were a key: 
16548 \begin_inset Flex Code
16549 status collapsed
16550
16551 \begin_layout Plain Layout
16552 %!quotetitle%
16553 \end_layout
16554
16555 \end_inset
16556
16557 .
16558  LyX will treat 
16559 \begin_inset Flex Code
16560 status collapsed
16561
16562 \begin_layout Plain Layout
16563 %!quotetitle%
16564 \end_layout
16565
16566 \end_inset
16567
16568  exactly as it would treat its definition.
16569  So, let us issue the obvious 
16570 \emph on
16571 warning
16572 \emph default
16573 .
16574  Do not do this:
16575 \end_layout
16576
16577 \begin_layout LyX-Code
16578 !funfun %funfun%
16579 \end_layout
16580
16581 \begin_layout Standard
16582 or anything like it.
16583  LyX shouldn't go into an infinite loop, but it may go into a long one before
16584  it gives up.
16585 \end_layout
16586
16587 \begin_layout Standard
16588 The second sort of special definition might look like this:
16589 \end_layout
16590
16591 \begin_layout LyX-Code
16592 _pptext pp.
16593 \end_layout
16594
16595 \begin_layout Standard
16596 This defines a translatable piece of text, which allows relevant parts of
16597  the bibliography to be translated.
16598  It can be included in a definition by treating it as a key: 
16599 \begin_inset Flex Code
16600 status collapsed
16601
16602 \begin_layout Plain Layout
16603 %_pptext%
16604 \end_layout
16605
16606 \end_inset
16607
16608 .
16609  Several of these are predefined in 
16610 \begin_inset Flex Code
16611 status collapsed
16612
16613 \begin_layout Plain Layout
16614 stdciteformats.inc
16615 \end_layout
16616
16617 \end_inset
16618
16619 .
16620  Note that these are not macros, in the sense just defined.
16621  They will not be expanded.
16622 \end_layout
16623
16624 \begin_layout Standard
16625 So here then is an example that use all these features:
16626 \end_layout
16627
16628 \begin_layout LyX-Code
16629 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16630 \end_layout
16631
16632 \begin_layout Standard
16633 This defines a macro that prints the author, followed by a comma, if the
16634  
16635 \begin_inset Flex Code
16636 status collapsed
16637
16638 \begin_layout Plain Layout
16639 author
16640 \end_layout
16641
16642 \end_inset
16643
16644  key is defined, or else prints the name of the editor, followed by the
16645  
16646 \begin_inset Flex Code
16647 status collapsed
16648
16649 \begin_layout Plain Layout
16650 _edtext
16651 \end_layout
16652
16653 \end_inset
16654
16655  or its translation (it is by default 
16656 \begin_inset Quotes eld
16657 \end_inset
16658
16659 ed.
16660 \begin_inset Quotes erd
16661 \end_inset
16662
16663 ), if the 
16664 \begin_inset Flex Code
16665 status collapsed
16666
16667 \begin_layout Plain Layout
16668 editor
16669 \end_layout
16670
16671 \end_inset
16672
16673  key is defined.
16674  Note that this is in fact defined in 
16675 \begin_inset Flex Code
16676 status collapsed
16677
16678 \begin_layout Plain Layout
16679 stdciteformats.inc
16680 \end_layout
16681
16682 \end_inset
16683
16684 , so you can use it in your own definitions, or re-definitions, if you load
16685  that file first.
16686 \end_layout
16687
16688 \begin_layout Section
16689 \begin_inset CommandInset label
16690 LatexCommand label
16691 name "sec:Tags-for-XHTML"
16692
16693 \end_inset
16694
16695 Tags for XHTML output
16696 \end_layout
16697
16698 \begin_layout Standard
16699 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16700  by layout information.
16701  In general, LyX provides sensible defaults and, as mentioned earlier, it
16702  will even construct default CSS style rules from the other layout tags.
16703  For example, LyX will attempt to use the information provided in the 
16704 \begin_inset Flex Code
16705 status collapsed
16706
16707 \begin_layout Plain Layout
16708 Font
16709 \end_layout
16710
16711 \end_inset
16712
16713  declaration for the Chapter style to write CSS that will appropriately
16714  format chapter headings.
16715 \end_layout
16716
16717 \begin_layout Standard
16718 In many cases, then, you may not have to do anything at all to get acceptable
16719  XHTML output for your own environments, custom insets, and so forth.
16720  But in some cases you will, and so LyX provides a number of layout tags
16721  that can be used to customize the XHTML and CSS that are generated.
16722 \end_layout
16723
16724 \begin_layout Standard
16725 Note that there are two tags, 
16726 \begin_inset Flex Code
16727 status collapsed
16728
16729 \begin_layout Plain Layout
16730 HTMLPreamble
16731 \end_layout
16732
16733 \end_inset
16734
16735  and 
16736 \begin_inset Flex Code
16737 status collapsed
16738
16739 \begin_layout Plain Layout
16740 AddToHTMLPreamble
16741 \end_layout
16742
16743 \end_inset
16744
16745  that may appear outside style and inset declarations.
16746  See 
16747 \begin_inset CommandInset ref
16748 LatexCommand ref
16749 reference "sub:General-text-class"
16750
16751 \end_inset
16752
16753  for details on these.
16754 \end_layout
16755
16756 \begin_layout Subsection
16757 \begin_inset CommandInset label
16758 LatexCommand label
16759 name "sub:Paragraph-Style-XHTML"
16760
16761 \end_inset
16762
16763 Paragraph styles
16764 \end_layout
16765
16766 \begin_layout Standard
16767 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16768  dealing with a normal paragraph, a command, or an environment, where this
16769  is itself determined by the contents of the corresponding 
16770 \begin_inset Flex Code
16771 status collapsed
16772
16773 \begin_layout Plain Layout
16774 LaTeXType
16775 \end_layout
16776
16777 \end_inset
16778
16779  tag.
16780  
16781 \end_layout
16782
16783 \begin_layout Standard
16784 For a command or normal paragraph, the output XHTML has the following form:
16785 \end_layout
16786
16787 \begin_layout LyX-Code
16788 <tag attr=
16789 \begin_inset Quotes erd
16790 \end_inset
16791
16792 value
16793 \begin_inset Quotes erd
16794 \end_inset
16795
16796 >
16797 \end_layout
16798
16799 \begin_layout LyX-Code
16800 <labeltag attr=
16801 \begin_inset Quotes erd
16802 \end_inset
16803
16804 value
16805 \begin_inset Quotes erd
16806 \end_inset
16807
16808 >Label</labeltag>
16809 \end_layout
16810
16811 \begin_layout LyX-Code
16812 Contents of the paragraph.
16813 \end_layout
16814
16815 \begin_layout LyX-Code
16816 </tag>
16817 \end_layout
16818
16819 \begin_layout Standard
16820 The label tags are of course omitted if the paragraph does not have a label.
16821 \end_layout
16822
16823 \begin_layout Standard
16824 For an environment that is not some sort of list, the XHTML takes this form:
16825 \end_layout
16826
16827 \begin_layout LyX-Code
16828 <tag attr=
16829 \begin_inset Quotes erd
16830 \end_inset
16831
16832 value
16833 \begin_inset Quotes erd
16834 \end_inset
16835
16836 >
16837 \end_layout
16838
16839 \begin_layout LyX-Code
16840 <itemtag attr=
16841 \begin_inset Quotes erd
16842 \end_inset
16843
16844 value
16845 \begin_inset Quotes erd
16846 \end_inset
16847
16848 ><labeltag attr=
16849 \begin_inset Quotes erd
16850 \end_inset
16851
16852 value
16853 \begin_inset Quotes erd
16854 \end_inset
16855
16856 >Environment Label</labeltag>First paragraph.</itemtag>
16857 \end_layout
16858
16859 \begin_layout LyX-Code
16860 <itemtag>Second paragraph.</itemtag>
16861 \end_layout
16862
16863 \begin_layout LyX-Code
16864 </tag>
16865 \end_layout
16866
16867 \begin_layout Standard
16868 Note that the label is output only for the first paragraph, as it should
16869  be for a theorem, for example.
16870  
16871 \end_layout
16872
16873 \begin_layout Standard
16874 For a list, we have one of these forms:
16875 \end_layout
16876
16877 \begin_layout LyX-Code
16878 <tag attr=
16879 \begin_inset Quotes erd
16880 \end_inset
16881
16882 value
16883 \begin_inset Quotes erd
16884 \end_inset
16885
16886 >
16887 \end_layout
16888
16889 \begin_layout LyX-Code
16890 <itemtag attr=
16891 \begin_inset Quotes erd
16892 \end_inset
16893
16894 value
16895 \begin_inset Quotes erd
16896 \end_inset
16897
16898 ><labeltag attr=
16899 \begin_inset Quotes erd
16900 \end_inset
16901
16902 value
16903 \begin_inset Quotes erd
16904 \end_inset
16905
16906 >List Label</labeltag>First item.</itemtag>
16907 \end_layout
16908
16909 \begin_layout LyX-Code
16910 <itemtag attr=
16911 \begin_inset Quotes erd
16912 \end_inset
16913
16914 value
16915 \begin_inset Quotes erd
16916 \end_inset
16917
16918 ><labeltag attr=
16919 \begin_inset Quotes erd
16920 \end_inset
16921
16922 value
16923 \begin_inset Quotes erd
16924 \end_inset
16925
16926 >List Label</labeltag>Second item.</itemtag>
16927 \end_layout
16928
16929 \begin_layout LyX-Code
16930 </tag>
16931 \end_layout
16932
16933 \begin_layout LyX-Code
16934
16935 \end_layout
16936
16937 \begin_layout LyX-Code
16938 <tag attr=
16939 \begin_inset Quotes erd
16940 \end_inset
16941
16942 value
16943 \begin_inset Quotes erd
16944 \end_inset
16945
16946 >
16947 \end_layout
16948
16949 \begin_layout LyX-Code
16950 <labeltag attr=
16951 \begin_inset Quotes erd
16952 \end_inset
16953
16954 value
16955 \begin_inset Quotes erd
16956 \end_inset
16957
16958 >List Label</labeltag><itemtag attr=
16959 \begin_inset Quotes erd
16960 \end_inset
16961
16962 value
16963 \begin_inset Quotes erd
16964 \end_inset
16965
16966 >First item.</itemtag>
16967 \end_layout
16968
16969 \begin_layout LyX-Code
16970 <labeltag attr=
16971 \begin_inset Quotes erd
16972 \end_inset
16973
16974 value
16975 \begin_inset Quotes erd
16976 \end_inset
16977
16978 >List Label</labeltag><itemtag attr=
16979 \begin_inset Quotes erd
16980 \end_inset
16981
16982 value
16983 \begin_inset Quotes erd
16984 \end_inset
16985
16986 >Second item.</itemtag>
16987 \end_layout
16988
16989 \begin_layout LyX-Code
16990 </tag>
16991 \end_layout
16992
16993 \begin_layout Standard
16994 Note the different orders of 
16995 \begin_inset Flex Code
16996 status collapsed
16997
16998 \begin_layout Plain Layout
16999 labeltag
17000 \end_layout
17001
17002 \end_inset
17003
17004  and 
17005 \begin_inset Flex Code
17006 status collapsed
17007
17008 \begin_layout Plain Layout
17009 itemtag
17010 \end_layout
17011
17012 \end_inset
17013
17014 .
17015  Which order we get depends upon the setting of 
17016 \begin_inset Flex Code
17017 status collapsed
17018
17019 \begin_layout Plain Layout
17020 HTMLLabelFirst
17021 \end_layout
17022
17023 \end_inset
17024
17025 : If 
17026 \begin_inset Flex Code
17027 status collapsed
17028
17029 \begin_layout Plain Layout
17030 HTMLLabelFirst
17031 \end_layout
17032
17033 \end_inset
17034
17035  is false (the default), you get the first of these, with the label within
17036  the item; if true, you get the second, with the label outside the item.
17037 \end_layout
17038
17039 \begin_layout Standard
17040 The specific tags and attributes output for each paragraph type can be controlle
17041 d by means of the layout tags we are about to describe.
17042  As mentioned earlier, however, LyX uses sensible defaults for many of these,
17043  so you often may not need to do very much to get good XHTML output.
17044  Think of the available tags as there so you can tweak things to your liking.
17045 \end_layout
17046
17047 \begin_layout Description
17048 \begin_inset Flex Code
17049 status collapsed
17050
17051 \begin_layout Plain Layout
17052 HTMLAttr
17053 \end_layout
17054
17055 \end_inset
17056
17057  [
17058 \begin_inset Flex Code
17059 status collapsed
17060
17061 \begin_layout Plain Layout
17062 string
17063 \end_layout
17064
17065 \end_inset
17066
17067 ] Specifies attribute information to be output with the main tag.
17068  For example, 
17069 \begin_inset Quotes eld
17070 \end_inset
17071
17072
17073 \begin_inset Flex Code
17074 status collapsed
17075
17076 \begin_layout Plain Layout
17077 class=`mydiv'
17078 \end_layout
17079
17080 \end_inset
17081
17082
17083 \begin_inset Quotes erd
17084 \end_inset
17085
17086 .
17087  By default, LyX will output 
17088 \begin_inset Quotes eld
17089 \end_inset
17090
17091
17092 \begin_inset Flex Code
17093 status collapsed
17094
17095 \begin_layout Plain Layout
17096 class=`layoutname'
17097 \end_layout
17098
17099 \end_inset
17100
17101
17102 \begin_inset Quotes erd
17103 \end_inset
17104
17105 , where 
17106 \begin_inset Flex Code
17107 status collapsed
17108
17109 \begin_layout Plain Layout
17110 layoutname
17111 \end_layout
17112
17113 \end_inset
17114
17115  is the LyX name of the layout, made lowercase, for example: chapter.
17116  This should 
17117 \emph on
17118 not
17119 \emph default
17120  contain any style information.
17121  Use 
17122 \begin_inset Flex Code
17123 status collapsed
17124
17125 \begin_layout Plain Layout
17126 HTMLStyle
17127 \end_layout
17128
17129 \end_inset
17130
17131  for that purpose.
17132 \end_layout
17133
17134 \begin_layout Description
17135 \begin_inset Flex Code
17136 status collapsed
17137
17138 \begin_layout Plain Layout
17139 HTMLForceCSS
17140 \end_layout
17141
17142 \end_inset
17143
17144  [
17145 \begin_inset Flex Code
17146 status collapsed
17147
17148 \begin_layout Plain Layout
17149
17150 \emph on
17151 0
17152 \emph default
17153 ,1
17154 \end_layout
17155
17156 \end_inset
17157
17158 ] Whether to output the default CSS information LyX generates for this layout,
17159  even if additional information is explicitly provided via 
17160 \begin_inset Flex Code
17161 status collapsed
17162
17163 \begin_layout Plain Layout
17164 HTMLStyle
17165 \end_layout
17166
17167 \end_inset
17168
17169 .
17170  Setting this to 
17171 \begin_inset Flex Code
17172 status collapsed
17173
17174 \begin_layout Plain Layout
17175 1
17176 \end_layout
17177
17178 \end_inset
17179
17180  allows you to alter or augment the generated CSS, rather than to override
17181  it completely.
17182  Default is 
17183 \begin_inset Flex Code
17184 status collapsed
17185
17186 \begin_layout Plain Layout
17187 0
17188 \end_layout
17189
17190 \end_inset
17191
17192 .
17193 \end_layout
17194
17195 \begin_layout Description
17196 \begin_inset Flex Code
17197 status collapsed
17198
17199 \begin_layout Plain Layout
17200 HTMLItem
17201 \end_layout
17202
17203 \end_inset
17204
17205  [
17206 \begin_inset Flex Code
17207 status collapsed
17208
17209 \begin_layout Plain Layout
17210 string
17211 \end_layout
17212
17213 \end_inset
17214
17215 ] The tag to be used for individual paragraphs of environments, replacing
17216  
17217 \begin_inset Flex Code
17218 status collapsed
17219
17220 \begin_layout Plain Layout
17221 itemtag
17222 \end_layout
17223
17224 \end_inset
17225
17226  in the examples above.
17227  Defaults to 
17228 \begin_inset Flex Code
17229 status collapsed
17230
17231 \begin_layout Plain Layout
17232 div
17233 \end_layout
17234
17235 \end_inset
17236
17237 .
17238 \end_layout
17239
17240 \begin_layout Description
17241 \begin_inset Flex Code
17242 status collapsed
17243
17244 \begin_layout Plain Layout
17245 HTMLItemAttr
17246 \end_layout
17247
17248 \end_inset
17249
17250  [
17251 \begin_inset Flex Code
17252 status collapsed
17253
17254 \begin_layout Plain Layout
17255 string
17256 \end_layout
17257
17258 \end_inset
17259
17260 ] Attributes for the item tag.
17261  Defaults to 
17262 \begin_inset Quotes eld
17263 \end_inset
17264
17265
17266 \begin_inset Flex Code
17267 status collapsed
17268
17269 \begin_layout Plain Layout
17270 class=`layoutname_item'
17271 \end_layout
17272
17273 \end_inset
17274
17275
17276 \begin_inset Quotes erd
17277 \end_inset
17278
17279 .
17280  This should 
17281 \emph on
17282 not
17283 \emph default
17284  contain any style information.
17285  Use 
17286 \begin_inset Flex Code
17287 status collapsed
17288
17289 \begin_layout Plain Layout
17290 HTMLStyle
17291 \end_layout
17292
17293 \end_inset
17294
17295  for that purpose.
17296 \end_layout
17297
17298 \begin_layout Description
17299 \begin_inset Flex Code
17300 status collapsed
17301
17302 \begin_layout Plain Layout
17303 HTMLLabel
17304 \end_layout
17305
17306 \end_inset
17307
17308  [
17309 \begin_inset Flex Code
17310 status collapsed
17311
17312 \begin_layout Plain Layout
17313 string
17314 \end_layout
17315
17316 \end_inset
17317
17318 ] The tag to be used for paragraph and item labels, replacing 
17319 \begin_inset Flex Code
17320 status collapsed
17321
17322 \begin_layout Plain Layout
17323 labeltag
17324 \end_layout
17325
17326 \end_inset
17327
17328  in the examples above.
17329  Defaults to 
17330 \begin_inset Flex Code
17331 status collapsed
17332
17333 \begin_layout Plain Layout
17334 span
17335 \end_layout
17336
17337 \end_inset
17338
17339 , unless 
17340 \begin_inset Flex Code
17341 status collapsed
17342
17343 \begin_layout Plain Layout
17344 LabelType
17345 \end_layout
17346
17347 \end_inset
17348
17349  is either 
17350 \begin_inset Flex Code
17351 status collapsed
17352
17353 \begin_layout Plain Layout
17354 Top_Environment
17355 \end_layout
17356
17357 \end_inset
17358
17359  or 
17360 \begin_inset Flex Code
17361 status collapsed
17362
17363 \begin_layout Plain Layout
17364 Centered_Top_Environment
17365 \end_layout
17366
17367 \end_inset
17368
17369 , in which case it defaults to 
17370 \begin_inset Flex Code
17371 status collapsed
17372
17373 \begin_layout Plain Layout
17374 div
17375 \end_layout
17376
17377 \end_inset
17378
17379 .
17380 \end_layout
17381
17382 \begin_layout Description
17383 \begin_inset Flex Code
17384 status collapsed
17385
17386 \begin_layout Plain Layout
17387 HTMLLabelAttr
17388 \end_layout
17389
17390 \end_inset
17391
17392  [
17393 \begin_inset Flex Code
17394 status collapsed
17395
17396 \begin_layout Plain Layout
17397 string
17398 \end_layout
17399
17400 \end_inset
17401
17402 ] Attributes for the label tag.
17403  Defaults to 
17404 \begin_inset Quotes eld
17405 \end_inset
17406
17407
17408 \begin_inset Flex Code
17409 status collapsed
17410
17411 \begin_layout Plain Layout
17412 class=`layoutname_label'
17413 \end_layout
17414
17415 \end_inset
17416
17417
17418 \begin_inset Quotes erd
17419 \end_inset
17420
17421 .
17422  This should 
17423 \emph on
17424 not
17425 \emph default
17426  contain any style information.
17427  Use 
17428 \begin_inset Flex Code
17429 status collapsed
17430
17431 \begin_layout Plain Layout
17432 HTMLStyle
17433 \end_layout
17434
17435 \end_inset
17436
17437  for that purpose.
17438 \end_layout
17439
17440 \begin_layout Description
17441 \begin_inset Flex Code
17442 status collapsed
17443
17444 \begin_layout Plain Layout
17445 HTMLLabelFirst
17446 \end_layout
17447
17448 \end_inset
17449
17450  [
17451 \begin_inset Flex Code
17452 status collapsed
17453
17454 \begin_layout Plain Layout
17455
17456 \emph on
17457 0
17458 \emph default
17459 ,1
17460 \end_layout
17461
17462 \end_inset
17463
17464 ] Meaningful only for list-like environments, this tag controls whether
17465  the label tag is output before or inside the item tag.
17466  This is used, for example, in the description environment, where we want
17467  `
17468 \begin_inset Flex Code
17469 status collapsed
17470
17471 \begin_layout Plain Layout
17472 <dt>\SpecialChar \ldots{}
17473 </dt><dd>\SpecialChar \ldots{}
17474 </dd>
17475 \end_layout
17476
17477 \end_inset
17478
17479 .
17480  Default is 
17481 \begin_inset Flex Code
17482 status collapsed
17483
17484 \begin_layout Plain Layout
17485 0
17486 \end_layout
17487
17488 \end_inset
17489
17490 : The label tag is output inside the item tag.
17491 \end_layout
17492
17493 \begin_layout Description
17494 \begin_inset Flex Code
17495 status collapsed
17496
17497 \begin_layout Plain Layout
17498 HTMLPreamble
17499 \end_layout
17500
17501 \end_inset
17502
17503  Information to be output in the 
17504 \begin_inset Flex Code
17505 status collapsed
17506
17507 \begin_layout Plain Layout
17508 <head>
17509 \end_layout
17510
17511 \end_inset
17512
17513  section when this style is used.
17514  This might, for example, be used to include a 
17515 \begin_inset Flex Code
17516 status collapsed
17517
17518 \begin_layout Plain Layout
17519 <script>
17520 \end_layout
17521
17522 \end_inset
17523
17524  block defining an 
17525 \begin_inset Flex Code
17526 status collapsed
17527
17528 \begin_layout Plain Layout
17529 onclick
17530 \end_layout
17531
17532 \end_inset
17533
17534  handler.
17535 \end_layout
17536
17537 \begin_layout Description
17538 \begin_inset Flex Code
17539 status collapsed
17540
17541 \begin_layout Plain Layout
17542 HTMLStyle
17543 \end_layout
17544
17545 \end_inset
17546
17547  CSS style information to be included when this style is used.
17548  Note that this will automatically be wrapped in a layout-generated 
17549 \begin_inset Flex Code
17550 status collapsed
17551
17552 \begin_layout Plain Layout
17553 <style>
17554 \end_layout
17555
17556 \end_inset
17557
17558  block, so only the CSS itself need be included.
17559 \end_layout
17560
17561 \begin_layout Description
17562 \begin_inset Flex Code
17563 status collapsed
17564
17565 \begin_layout Plain Layout
17566 HTMLTag
17567 \end_layout
17568
17569 \end_inset
17570
17571  [
17572 \begin_inset Flex Code
17573 status collapsed
17574
17575 \begin_layout Plain Layout
17576 string
17577 \end_layout
17578
17579 \end_inset
17580
17581 ] The tag to be used for the main label, replacing 
17582 \begin_inset Flex Code
17583 status collapsed
17584
17585 \begin_layout Plain Layout
17586 tag
17587 \end_layout
17588
17589 \end_inset
17590
17591  in the examples above.
17592  Defaults to 
17593 \begin_inset Flex Code
17594 status collapsed
17595
17596 \begin_layout Plain Layout
17597 div
17598 \end_layout
17599
17600 \end_inset
17601
17602 .
17603 \end_layout
17604
17605 \begin_layout Description
17606 \begin_inset Flex Code
17607 status collapsed
17608
17609 \begin_layout Plain Layout
17610 HTMLTitle
17611 \end_layout
17612
17613 \end_inset
17614
17615  [
17616 \begin_inset Flex Code
17617 status collapsed
17618
17619 \begin_layout Plain Layout
17620
17621 \emph on
17622 0
17623 \emph default
17624 ,1
17625 \end_layout
17626
17627 \end_inset
17628
17629 ] Marks this style as the one to be used to generate the 
17630 \begin_inset Flex Code
17631 status collapsed
17632
17633 \begin_layout Plain Layout
17634 <title>
17635 \end_layout
17636
17637 \end_inset
17638
17639  tag for the XHTML file.
17640  By default, it is false.
17641  The 
17642 \begin_inset Flex Code
17643 status collapsed
17644
17645 \begin_layout Plain Layout
17646 stdtitle.inc
17647 \end_layout
17648
17649 \end_inset
17650
17651  file sets it to true for the 
17652 \begin_inset Flex Code
17653 status collapsed
17654
17655 \begin_layout Plain Layout
17656 title
17657 \end_layout
17658
17659 \end_inset
17660
17661  environment.
17662  
17663 \end_layout
17664
17665 \begin_layout Subsection
17666 InsetLayout XHTML
17667 \end_layout
17668
17669 \begin_layout Standard
17670 The XHTML output of insets can also be controlled by information in layout
17671  files.
17672 \begin_inset Foot
17673 status collapsed
17674
17675 \begin_layout Plain Layout
17676 At present, this is true only for 
17677 \begin_inset Quotes eld
17678 \end_inset
17679
17680 text
17681 \begin_inset Quotes erd
17682 \end_inset
17683
17684  insets (insets you can type into) and is not true for 
17685 \begin_inset Quotes eld
17686 \end_inset
17687
17688 command
17689 \begin_inset Quotes erd
17690 \end_inset
17691
17692  insets (insets that are associated with dialog boxes).
17693 \end_layout
17694
17695 \end_inset
17696
17697  Here, too, LyX tries to provide sensible defaults, and it constructs default
17698  CSS style rules.
17699  But everything can be customized.
17700 \end_layout
17701
17702 \begin_layout Standard
17703 The XHTML LyX outputs for an inset has the following form:
17704 \end_layout
17705
17706 \begin_layout LyX-Code
17707 <tag attr=
17708 \begin_inset Quotes erd
17709 \end_inset
17710
17711 value
17712 \begin_inset Quotes erd
17713 \end_inset
17714
17715 >
17716 \end_layout
17717
17718 \begin_layout LyX-Code
17719 <labeltag>Label</labeltag>
17720 \end_layout
17721
17722 \begin_layout LyX-Code
17723 <innertag attr=
17724 \begin_inset Quotes erd
17725 \end_inset
17726
17727 value
17728 \begin_inset Quotes erd
17729 \end_inset
17730
17731 >Contents of the inset.</innertag>
17732 \end_layout
17733
17734 \begin_layout LyX-Code
17735 </tag>
17736 \end_layout
17737
17738 \begin_layout Standard
17739 If the inset permits multiple paragraphs---that is, if 
17740 \begin_inset Flex Code
17741 status collapsed
17742
17743 \begin_layout Plain Layout
17744 MultiPar
17745 \end_layout
17746
17747 \end_inset
17748
17749  is true---then the contents of the inset will itself be output as paragraphs
17750  formatted according to the styles used for those paragraphs (standard,
17751  quote, and the like).
17752  The label tag is of course omitted if the paragraph does not have a label
17753  and, at present, is always 
17754 \begin_inset Flex Code
17755 status collapsed
17756
17757 \begin_layout Plain Layout
17758 span
17759 \end_layout
17760
17761 \end_inset
17762
17763 .
17764  The inner tag is optional and, by default, does not appear.
17765 \end_layout
17766
17767 \begin_layout Standard
17768 The specific tags and attributes output for each inset can be controlled
17769  by means of the following layout tags.
17770 \end_layout
17771
17772 \begin_layout Description
17773 \begin_inset Flex Code
17774 status collapsed
17775
17776 \begin_layout Plain Layout
17777 HTMLAttr
17778 \end_layout
17779
17780 \end_inset
17781
17782  [
17783 \begin_inset Flex Code
17784 status collapsed
17785
17786 \begin_layout Plain Layout
17787 string
17788 \end_layout
17789
17790 \end_inset
17791
17792 ] Specifies attribute information to be output with the main tag.
17793  For example, 
17794 \begin_inset Quotes eld
17795 \end_inset
17796
17797
17798 \begin_inset Flex Code
17799 status collapsed
17800
17801 \begin_layout Plain Layout
17802 class=`myinset' onclick=`\SpecialChar \ldots{}
17803 '
17804 \end_layout
17805
17806 \end_inset
17807
17808
17809 \begin_inset Quotes erd
17810 \end_inset
17811
17812 .
17813  By default, LyX will output 
17814 \begin_inset Quotes eld
17815 \end_inset
17816
17817
17818 \begin_inset Flex Code
17819 status collapsed
17820
17821 \begin_layout Plain Layout
17822 class=`insetname'
17823 \end_layout
17824
17825 \end_inset
17826
17827
17828 \begin_inset Quotes erd
17829 \end_inset
17830
17831 , where 
17832 \begin_inset Flex Code
17833 status collapsed
17834
17835 \begin_layout Plain Layout
17836 insetname
17837 \end_layout
17838
17839 \end_inset
17840
17841  is the LyX name of the inset, made lowercase and with non-alphanumeric
17842  characters converted to underscores, for example: footnote.
17843 \end_layout
17844
17845 \begin_layout Description
17846 \begin_inset Flex Code
17847 status collapsed
17848
17849 \begin_layout Plain Layout
17850 HTMLForceCSS
17851 \end_layout
17852
17853 \end_inset
17854
17855  [
17856 \begin_inset Flex Code
17857 status collapsed
17858
17859 \begin_layout Plain Layout
17860
17861 \emph on
17862 0
17863 \emph default
17864 ,1
17865 \end_layout
17866
17867 \end_inset
17868
17869 ] Whether to output the default CSS information LyX generates for this layout,
17870  even if additional information is explicitly provided via 
17871 \begin_inset Flex Code
17872 status collapsed
17873
17874 \begin_layout Plain Layout
17875 HTMLStyle
17876 \end_layout
17877
17878 \end_inset
17879
17880 .
17881  Setting this to 
17882 \begin_inset Flex Code
17883 status collapsed
17884
17885 \begin_layout Plain Layout
17886 1
17887 \end_layout
17888
17889 \end_inset
17890
17891  allows you to alter or augment the generated CSS, rather than to override
17892  it completely.
17893  Default is 0.
17894 \end_layout
17895
17896 \begin_layout Description
17897 \begin_inset Flex Code
17898 status collapsed
17899
17900 \begin_layout Plain Layout
17901 HTMLInnerAttr
17902 \end_layout
17903
17904 \end_inset
17905
17906  [
17907 \begin_inset Flex Code
17908 status collapsed
17909
17910 \begin_layout Plain Layout
17911 string
17912 \end_layout
17913
17914 \end_inset
17915
17916 ] Attributes for the inner tag.
17917  Defaults to 
17918 \begin_inset Quotes eld
17919 \end_inset
17920
17921
17922 \begin_inset Flex Code
17923 status collapsed
17924
17925 \begin_layout Plain Layout
17926 class=`insetname_inner'
17927 \end_layout
17928
17929 \end_inset
17930
17931
17932 \begin_inset Quotes erd
17933 \end_inset
17934
17935 .
17936 \end_layout
17937
17938 \begin_layout Description
17939 \begin_inset Flex Code
17940 status collapsed
17941
17942 \begin_layout Plain Layout
17943 HTMLInnerTag
17944 \end_layout
17945
17946 \end_inset
17947
17948  [
17949 \begin_inset Flex Code
17950 status collapsed
17951
17952 \begin_layout Plain Layout
17953 string
17954 \end_layout
17955
17956 \end_inset
17957
17958 ] The inner tag, replacing 
17959 \begin_inset Flex Code
17960 status collapsed
17961
17962 \begin_layout Plain Layout
17963 innertag
17964 \end_layout
17965
17966 \end_inset
17967
17968  in the examples above.
17969  By default, there is none.
17970 \end_layout
17971
17972 \begin_layout Description
17973 \begin_inset Flex Code
17974 status collapsed
17975
17976 \begin_layout Plain Layout
17977 HTMLIsBlock
17978 \end_layout
17979
17980 \end_inset
17981
17982  [
17983 \begin_inset Flex Code
17984 status collapsed
17985
17986 \begin_layout Plain Layout
17987 0,
17988 \emph on
17989 1
17990 \end_layout
17991
17992 \end_inset
17993
17994 ] Whether this inset represents a standalone block of text (such as a footnote)
17995  or instead represents material that is included in the surrounding text
17996  (such as a branch).
17997  Defaults to 1.
17998 \end_layout
17999
18000 \begin_layout Description
18001 \begin_inset Flex Code
18002 status collapsed
18003
18004 \begin_layout Plain Layout
18005 HTMLLabel
18006 \end_layout
18007
18008 \end_inset
18009
18010  [
18011 \begin_inset Flex Code
18012 status collapsed
18013
18014 \begin_layout Plain Layout
18015 string
18016 \end_layout
18017
18018 \end_inset
18019
18020 ] A label for this inset, possibly including a reference to a counter.
18021  For example, for footnote, it might be: 
18022 \begin_inset Flex Code
18023 status collapsed
18024
18025 \begin_layout Plain Layout
18026
18027 \backslash
18028 arabic{footnote}
18029 \end_layout
18030
18031 \end_inset
18032
18033 .
18034  This is optional, and there is no default.
18035 \end_layout
18036
18037 \begin_layout Description
18038 \begin_inset Flex Code
18039 status collapsed
18040
18041 \begin_layout Plain Layout
18042 HTMLPreamble
18043 \end_layout
18044
18045 \end_inset
18046
18047  Information to be output in the 
18048 \begin_inset Flex Code
18049 status collapsed
18050
18051 \begin_layout Plain Layout
18052 <head>
18053 \end_layout
18054
18055 \end_inset
18056
18057  section when this style is used.
18058  This might, for example, be used to include a 
18059 \begin_inset Flex Code
18060 status collapsed
18061
18062 \begin_layout Plain Layout
18063 <script>
18064 \end_layout
18065
18066 \end_inset
18067
18068  block defining an 
18069 \begin_inset Flex Code
18070 status collapsed
18071
18072 \begin_layout Plain Layout
18073 onclick
18074 \end_layout
18075
18076 \end_inset
18077
18078  handler.
18079 \end_layout
18080
18081 \begin_layout Description
18082 \begin_inset Flex Code
18083 status collapsed
18084
18085 \begin_layout Plain Layout
18086 HTMLStyle
18087 \end_layout
18088
18089 \end_inset
18090
18091  CSS style information to be included when this style is used.
18092  Note that this will automatically be wrapped in a layout-generated 
18093 \begin_inset Flex Code
18094 status collapsed
18095
18096 \begin_layout Plain Layout
18097 <style>
18098 \end_layout
18099
18100 \end_inset
18101
18102  block, so only the CSS itself need be included.
18103 \end_layout
18104
18105 \begin_layout Description
18106 \begin_inset Flex Code
18107 status collapsed
18108
18109 \begin_layout Plain Layout
18110 HTMLTag
18111 \end_layout
18112
18113 \end_inset
18114
18115  [
18116 \begin_inset Flex Code
18117 status collapsed
18118
18119 \begin_layout Plain Layout
18120 string
18121 \end_layout
18122
18123 \end_inset
18124
18125 ] The tag to be used for the main label, replacing 
18126 \begin_inset Flex Code
18127 status collapsed
18128
18129 \begin_layout Plain Layout
18130 tag
18131 \end_layout
18132
18133 \end_inset
18134
18135  in the examples above.
18136  The default depends upon the setting of 
18137 \begin_inset Flex Code
18138 status collapsed
18139
18140 \begin_layout Plain Layout
18141 MultiPar
18142 \end_layout
18143
18144 \end_inset
18145
18146 : If 
18147 \begin_inset Flex Code
18148 status collapsed
18149
18150 \begin_layout Plain Layout
18151 MultiPar
18152 \end_layout
18153
18154 \end_inset
18155
18156  is true, the default is 
18157 \begin_inset Flex Code
18158 status collapsed
18159
18160 \begin_layout Plain Layout
18161 div
18162 \end_layout
18163
18164 \end_inset
18165
18166 ; if it is false, the default is 
18167 \begin_inset Flex Code
18168 status collapsed
18169
18170 \begin_layout Plain Layout
18171 span
18172 \end_layout
18173
18174 \end_inset
18175
18176 .
18177 \end_layout
18178
18179 \begin_layout Subsection
18180 Float XHTML
18181 \end_layout
18182
18183 \begin_layout Standard
18184 The XHTML output for floats too can be controlled by layout information.
18185  The output has the following form:
18186 \end_layout
18187
18188 \begin_layout LyX-Code
18189 <tag attr=
18190 \begin_inset Quotes erd
18191 \end_inset
18192
18193 value
18194 \begin_inset Quotes erd
18195 \end_inset
18196
18197 >
18198 \end_layout
18199
18200 \begin_layout LyX-Code
18201 Contents of the float.
18202 \end_layout
18203
18204 \begin_layout LyX-Code
18205 </tag>
18206 \end_layout
18207
18208 \begin_layout Standard
18209 The caption, if there is one, is a separate inset and will be output as
18210  such.
18211  Its appearance can be controlled via the InsetLayout for caption insets.
18212  
18213 \end_layout
18214
18215 \begin_layout Description
18216 \begin_inset Flex Code
18217 status collapsed
18218
18219 \begin_layout Plain Layout
18220 HTMLAttr
18221 \end_layout
18222
18223 \end_inset
18224
18225  [
18226 \begin_inset Flex Code
18227 status collapsed
18228
18229 \begin_layout Plain Layout
18230 string
18231 \end_layout
18232
18233 \end_inset
18234
18235 ] Specifies attribute information to be output with the main tag.
18236  For example, 
18237 \begin_inset Quotes eld
18238 \end_inset
18239
18240
18241 \begin_inset Flex Code
18242 status collapsed
18243
18244 \begin_layout Plain Layout
18245 class=`myfloat' onclick=`\SpecialChar \ldots{}
18246 '
18247 \end_layout
18248
18249 \end_inset
18250
18251
18252 \begin_inset Quotes erd
18253 \end_inset
18254
18255 .
18256  By default, LyX will output 
18257 \begin_inset Quotes eld
18258 \end_inset
18259
18260
18261 \begin_inset Flex Code
18262 status collapsed
18263
18264 \begin_layout Plain Layout
18265 class=`float float-floattype'
18266 \end_layout
18267
18268 \end_inset
18269
18270
18271 \begin_inset Quotes erd
18272 \end_inset
18273
18274 , where 
18275 \begin_inset Flex Code
18276 status collapsed
18277
18278 \begin_layout Plain Layout
18279 floattype
18280 \end_layout
18281
18282 \end_inset
18283
18284  is LyX's name for this type of float, as determined by the float declaration
18285  (see 
18286 \begin_inset CommandInset ref
18287 LatexCommand ref
18288 reference "sub:Floats"
18289
18290 \end_inset
18291
18292 ), though made lowercase and with non-alphanumeric characters converted
18293  to underscores, for example: float-table.
18294 \end_layout
18295
18296 \begin_layout Description
18297 \begin_inset Flex Code
18298 status collapsed
18299
18300 \begin_layout Plain Layout
18301 HTMLStyle
18302 \end_layout
18303
18304 \end_inset
18305
18306  CSS style information to be included when this float is used.
18307  Note that this will automatically be wrapped in a layout-generated 
18308 \begin_inset Flex Code
18309 status collapsed
18310
18311 \begin_layout Plain Layout
18312 <style>
18313 \end_layout
18314
18315 \end_inset
18316
18317  block, so only the CSS itself need be included.
18318 \end_layout
18319
18320 \begin_layout Description
18321 \begin_inset Flex Code
18322 status collapsed
18323
18324 \begin_layout Plain Layout
18325 HTMLTag
18326 \end_layout
18327
18328 \end_inset
18329
18330  [
18331 \begin_inset Flex Code
18332 status collapsed
18333
18334 \begin_layout Plain Layout
18335 string
18336 \end_layout
18337
18338 \end_inset
18339
18340 ] The tag to be used for this float, replacing 
18341 \begin_inset Quotes eld
18342 \end_inset
18343
18344
18345 \begin_inset Flex Code
18346 status collapsed
18347
18348 \begin_layout Plain Layout
18349 tag
18350 \end_layout
18351
18352 \end_inset
18353
18354
18355 \begin_inset Quotes erd
18356 \end_inset
18357
18358  in the example above.
18359  The default is 
18360 \begin_inset Flex Code
18361 status collapsed
18362
18363 \begin_layout Plain Layout
18364 div
18365 \end_layout
18366
18367 \end_inset
18368
18369  and will rarely need changing.
18370 \end_layout
18371
18372 \begin_layout Subsection
18373 Bibliography formatting
18374 \end_layout
18375
18376 \begin_layout Standard
18377 The bibliography can be formatted using 
18378 \begin_inset Flex Code
18379 status collapsed
18380
18381 \begin_layout Plain Layout
18382 CiteFormat
18383 \end_layout
18384
18385 \end_inset
18386
18387  blocks.
18388  See Section 
18389 \begin_inset CommandInset ref
18390 LatexCommand ref
18391 reference "sub:Citation-format-description"
18392
18393 \end_inset
18394
18395  for the details.
18396 \end_layout
18397
18398 \begin_layout Subsection
18399 LyX-generated CSS
18400 \end_layout
18401
18402 \begin_layout Standard
18403 We have several times mentioned that LyX will generate default CSS style
18404  rules for both insets and paragraph styles, based upon the other layout
18405  information that is provided.
18406  In this section, we shall say a word about which layout information LyX
18407  uses and how.
18408 \end_layout
18409
18410 \begin_layout Standard
18411 At present, LyX auto-generates CSS only for font information, making use
18412  of the 
18413 \begin_inset Flex Code
18414 status collapsed
18415
18416 \begin_layout Plain Layout
18417 Family
18418 \end_layout
18419
18420 \end_inset
18421
18422
18423 \begin_inset Flex Code
18424 status collapsed
18425
18426 \begin_layout Plain Layout
18427 Series
18428 \end_layout
18429
18430 \end_inset
18431
18432
18433 \begin_inset Flex Code
18434 status collapsed
18435
18436 \begin_layout Plain Layout
18437 Shape
18438 \end_layout
18439
18440 \end_inset
18441
18442 , and 
18443 \begin_inset Flex Code
18444 status collapsed
18445
18446 \begin_layout Plain Layout
18447 Size
18448 \end_layout
18449
18450 \end_inset
18451
18452  specified in the 
18453 \begin_inset Flex Code
18454 status collapsed
18455
18456 \begin_layout Plain Layout
18457 Font
18458 \end_layout
18459
18460 \end_inset
18461
18462  declaration.
18463  (See 
18464 \begin_inset CommandInset ref
18465 LatexCommand ref
18466 reference "sub:Font-description"
18467
18468 \end_inset
18469
18470 .) The translation is mostly straightforward and obvious.
18471  For example, 
18472 \begin_inset Quotes eld
18473 \end_inset
18474
18475
18476 \begin_inset Flex Code
18477 status collapsed
18478
18479 \begin_layout Plain Layout
18480 Family Sans
18481 \end_layout
18482
18483 \end_inset
18484
18485
18486 \begin_inset Quotes erd
18487 \end_inset
18488
18489  becomes 
18490 \begin_inset Quotes eld
18491 \end_inset
18492
18493
18494 \begin_inset Flex Code
18495 status collapsed
18496
18497 \begin_layout Plain Layout
18498 font-family: sans-serif;
18499 \end_layout
18500
18501 \end_inset
18502
18503
18504 \begin_inset Quotes erd
18505 \end_inset
18506
18507 .
18508  The correspondence of LyX sizes and CSS sizes is a little less obvious
18509  but nonetheless intuitive.
18510  See the 
18511 \begin_inset Flex Code
18512 status collapsed
18513
18514 \begin_layout Plain Layout
18515 getSizeCSS()
18516 \end_layout
18517
18518 \end_inset
18519
18520  function in 
18521 \begin_inset Flex URL
18522 status collapsed
18523
18524 \begin_layout Plain Layout
18525
18526 src/FontInfo.cpp
18527 \end_layout
18528
18529 \end_inset
18530
18531  for the details.
18532  
18533 \end_layout
18534
18535 \begin_layout Chapter
18536 Including External Material
18537 \end_layout
18538
18539 \begin_layout Standard
18540 \begin_inset Box Shadowbox
18541 position "t"
18542 hor_pos "c"
18543 has_inner_box 1
18544 inner_pos "t"
18545 use_parbox 0
18546 use_makebox 0
18547 width "100col%"
18548 special "none"
18549 height "1in"
18550 height_special "totalheight"
18551 status open
18552
18553 \begin_layout Plain Layout
18554 WARNING: This portion of the documentation has not been updated for some
18555  time.
18556  We certainly hope that it is still accurate, but there are no guarantees.
18557 \end_layout
18558
18559 \end_inset
18560
18561
18562 \end_layout
18563
18564 \begin_layout Standard
18565 The use of material from sources external to LyX is covered in detail in
18566  the 
18567 \emph on
18568 Embedded Objects
18569 \emph default
18570  manual.
18571  This part of the manual covers what needs to happen behind the scenes for
18572  new sorts of material to be included.
18573 \end_layout
18574
18575 \begin_layout Section
18576 How does it work?
18577 \end_layout
18578
18579 \begin_layout Standard
18580 The external material feature is based on the concept of a 
18581 \emph on
18582 template
18583 \emph default
18584 .
18585  A template is a specification of how LyX should interface with a certain
18586  kind of material.
18587  As bundled, LyX comes with predefined templates for Xfig figures, various
18588  raster format images, chess diagrams, and LilyPond music notation.
18589  You can check the actual list by using the menu 
18590 \begin_inset Flex MenuItem
18591 status collapsed
18592
18593 \begin_layout Plain Layout
18594 Insert\SpecialChar \menuseparator
18595 File\SpecialChar \menuseparator
18596 External Material
18597 \end_layout
18598
18599 \end_inset
18600
18601 .
18602  Furthermore, it is possible to roll your own template to support a specific
18603  kind of material.
18604  Later we'll describe in more detail what is involved, and hopefully you
18605  will submit all the templates you create so we can include them in a later
18606  LyX version.
18607 \end_layout
18608
18609 \begin_layout Standard
18610 Another basic idea of the external material feature is to distinguish between
18611  the original file that serves as a base for final material and the produced
18612  file that is included in your exported or printed document.
18613  For example, consider the case of a figure produced with 
18614 \begin_inset Flex Code
18615 status collapsed
18616
18617 \begin_layout Plain Layout
18618 Xfig
18619 \end_layout
18620
18621 \end_inset
18622
18623 .
18624  The Xfig application itself works on an original file with the 
18625 \begin_inset Flex Code
18626 status collapsed
18627
18628 \begin_layout Plain Layout
18629 .fig
18630 \end_layout
18631
18632 \end_inset
18633
18634  extension.
18635  Within Xfig, you create and change your figure, and when you are done,
18636  you save the 
18637 \begin_inset Flex Code
18638 status collapsed
18639
18640 \begin_layout Plain Layout
18641 fig
18642 \end_layout
18643
18644 \end_inset
18645
18646 -file.
18647  When you want to include the figure in your document, you invoke 
18648 \begin_inset Flex Code
18649 status collapsed
18650
18651 \begin_layout Plain Layout
18652 transfig
18653 \end_layout
18654
18655 \end_inset
18656
18657  in order to create a PostScript file that can readily be included in your
18658  LaTeX file.
18659  In this case, the 
18660 \begin_inset Flex Code
18661 status collapsed
18662
18663 \begin_layout Plain Layout
18664 .fig
18665 \end_layout
18666
18667 \end_inset
18668
18669  file is the original file, and the PostScript file is the produced file.
18670 \end_layout
18671
18672 \begin_layout Standard
18673 This distinction is important in order to allow updating of the material
18674  while you are in the process of writing the document.
18675  Furthermore, it provides us with the flexibility that is needed to support
18676  multiple export formats.
18677  For instance, in the case of a plain text file, it is not exactly an award-winn
18678 ing idea to include the figure as raw PostScript.
18679  Instead, you'd either prefer to just include a reference to the figure
18680  or try to invoke some graphics to ASCII converter to make the final result
18681  look similar to the real graphics.
18682  The external material management allows you to do this, because it is parametri
18683 zed on the different export formats that LyX supports.
18684 \end_layout
18685
18686 \begin_layout Standard
18687 Besides supporting the production of different products according to the
18688  exported format, it supports tight integration with editing and viewing
18689  applications.
18690  In the case of an Xfig figure, you are able to invoke Xfig on the original
18691  file with a single click from within the external material dialog in LyX,
18692  and also preview the produced PostScript file with Ghostview with another
18693  click.
18694  No more fiddling around with the command line and/or file browsers to locate
18695  and manipulate the original or produced files.
18696  In this way, you are finally able to take full advantage of the many different
18697  applications that are relevant to use when you write your documents, and
18698  ultimately be more productive.
18699 \end_layout
18700
18701 \begin_layout Section
18702 The external template configuration file
18703 \end_layout
18704
18705 \begin_layout Standard
18706 It is relatively easy to add custom external template definitions to LyX.
18707  However, be aware that doing this in an careless manner most probably 
18708 \emph on
18709 will
18710 \emph default
18711  introduce an easily exploitable security hole.
18712  So before you do this, please read the discussion about security in section
18713  
18714 \begin_inset CommandInset ref
18715 LatexCommand ref
18716 reference "sec:Security-discussion"
18717
18718 \end_inset
18719
18720 .
18721 \end_layout
18722
18723 \begin_layout Standard
18724 Having said that, we encourage you to submit any interesting templates that
18725  you create.
18726  
18727 \end_layout
18728
18729 \begin_layout Standard
18730 The external templates are defined in the 
18731 \begin_inset Flex Code
18732 status collapsed
18733
18734 \begin_layout Plain Layout
18735 LyXDir/lib/external_templates
18736 \end_layout
18737
18738 \end_inset
18739
18740  file.
18741  You can place your own version in 
18742 \begin_inset Flex Code
18743 status collapsed
18744
18745 \begin_layout Plain Layout
18746 UserDir/external_templates
18747 \end_layout
18748
18749 \end_inset
18750
18751 .
18752 \end_layout
18753
18754 \begin_layout Standard
18755 A typical template looks like this:
18756 \end_layout
18757
18758 \begin_layout LyX-Code
18759 Template XFig
18760 \end_layout
18761
18762 \begin_layout LyX-Code
18763 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18764 \end_layout
18765
18766 \begin_layout LyX-Code
18767 HelpText
18768 \end_layout
18769
18770 \begin_layout LyX-Code
18771 An XFig figure.
18772 \end_layout
18773
18774 \begin_layout LyX-Code
18775 HelpTextEnd
18776 \end_layout
18777
18778 \begin_layout LyX-Code
18779 InputFormat fig
18780 \end_layout
18781
18782 \begin_layout LyX-Code
18783 FileFilter "*.fig"
18784 \end_layout
18785
18786 \begin_layout LyX-Code
18787 AutomaticProduction true
18788 \end_layout
18789
18790 \begin_layout LyX-Code
18791 Transform Rotate
18792 \end_layout
18793
18794 \begin_layout LyX-Code
18795 Transform Resize
18796 \end_layout
18797
18798 \begin_layout LyX-Code
18799 Format LaTeX
18800 \end_layout
18801
18802 \begin_layout LyX-Code
18803 TransformCommand Rotate RotationLatexCommand
18804 \end_layout
18805
18806 \begin_layout LyX-Code
18807 TransformCommand Resize ResizeLatexCommand
18808 \end_layout
18809
18810 \begin_layout LyX-Code
18811 Product "$$RotateFront$$ResizeFront
18812 \end_layout
18813
18814 \begin_layout LyX-Code
18815          
18816 \backslash
18817
18818 \backslash
18819 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18820 \end_layout
18821
18822 \begin_layout LyX-Code
18823          $$ResizeBack$$RotateBack"
18824 \end_layout
18825
18826 \begin_layout LyX-Code
18827 UpdateFormat pstex
18828 \end_layout
18829
18830 \begin_layout LyX-Code
18831 UpdateResult "$$AbsPath$$Basename.pstex_t"
18832 \end_layout
18833
18834 \begin_layout LyX-Code
18835 Requirement "graphicx"
18836 \end_layout
18837
18838 \begin_layout LyX-Code
18839 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18840 \end_layout
18841
18842 \begin_layout LyX-Code
18843 ReferencedFile latex "$$AbsPath$$Basename.eps"
18844 \end_layout
18845
18846 \begin_layout LyX-Code
18847 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18848 \end_layout
18849
18850 \begin_layout LyX-Code
18851 FormatEnd
18852 \end_layout
18853
18854 \begin_layout LyX-Code
18855 Format PDFLaTeX
18856 \end_layout
18857
18858 \begin_layout LyX-Code
18859 TransformCommand Rotate RotationLatexCommand
18860 \end_layout
18861
18862 \begin_layout LyX-Code
18863 TransformCommand Resize ResizeLatexCommand
18864 \end_layout
18865
18866 \begin_layout LyX-Code
18867 Product "$$RotateFront$$ResizeFront
18868 \end_layout
18869
18870 \begin_layout LyX-Code
18871          
18872 \backslash
18873
18874 \backslash
18875 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18876 \end_layout
18877
18878 \begin_layout LyX-Code
18879          $$ResizeBack$$RotateBack"
18880 \end_layout
18881
18882 \begin_layout LyX-Code
18883 UpdateFormat pdftex
18884 \end_layout
18885
18886 \begin_layout LyX-Code
18887 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18888 \end_layout
18889
18890 \begin_layout LyX-Code
18891 Requirement "graphicx"
18892 \end_layout
18893
18894 \begin_layout LyX-Code
18895 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18896 \end_layout
18897
18898 \begin_layout LyX-Code
18899 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18900 \end_layout
18901
18902 \begin_layout LyX-Code
18903 FormatEnd
18904 \end_layout
18905
18906 \begin_layout LyX-Code
18907 Format Ascii
18908 \end_layout
18909
18910 \begin_layout LyX-Code
18911 Product "$$Contents(
18912 \backslash
18913 "$$AbsPath$$Basename.asc
18914 \backslash
18915 ")"
18916 \end_layout
18917
18918 \begin_layout LyX-Code
18919 UpdateFormat asciixfig
18920 \end_layout
18921
18922 \begin_layout LyX-Code
18923 UpdateResult "$$AbsPath$$Basename.asc"
18924 \end_layout
18925
18926 \begin_layout LyX-Code
18927 FormatEnd
18928 \end_layout
18929
18930 \begin_layout LyX-Code
18931 Format DocBook
18932 \end_layout
18933
18934 \begin_layout LyX-Code
18935 Product "<graphic fileref=
18936 \backslash
18937 "$$AbsOrRelPathMaster$$Basename.eps
18938 \backslash
18939 ">
18940 \end_layout
18941
18942 \begin_layout LyX-Code
18943          </graphic>"
18944 \end_layout
18945
18946 \begin_layout LyX-Code
18947 UpdateFormat eps
18948 \end_layout
18949
18950 \begin_layout LyX-Code
18951 UpdateResult "$$AbsPath$$Basename.eps"
18952 \end_layout
18953
18954 \begin_layout LyX-Code
18955 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18956 \end_layout
18957
18958 \begin_layout LyX-Code
18959 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18960 \end_layout
18961
18962 \begin_layout LyX-Code
18963 FormatEnd
18964 \end_layout
18965
18966 \begin_layout LyX-Code
18967 Product "[XFig: $$FName]"
18968 \end_layout
18969
18970 \begin_layout LyX-Code
18971 FormatEnd
18972 \end_layout
18973
18974 \begin_layout LyX-Code
18975 TemplateEnd
18976 \end_layout
18977
18978 \begin_layout Standard
18979 As you can see, the template is enclosed in 
18980 \begin_inset Flex Code
18981 status collapsed
18982
18983 \begin_layout Plain Layout
18984 Template
18985 \end_layout
18986
18987 \end_inset
18988
18989  \SpecialChar \ldots{}
18990  
18991 \begin_inset Flex Code
18992 status collapsed
18993
18994 \begin_layout Plain Layout
18995 TemplateEnd
18996 \end_layout
18997
18998 \end_inset
18999
19000 .
19001  It contains a header specifying some general settings and, for each supported
19002  primary document file format, a section 
19003 \begin_inset Flex Code
19004 status collapsed
19005
19006 \begin_layout Plain Layout
19007 Format
19008 \end_layout
19009
19010 \end_inset
19011
19012  \SpecialChar \ldots{}
19013  
19014 \begin_inset Flex Code
19015 status collapsed
19016
19017 \begin_layout Plain Layout
19018 FormatEnd
19019 \end_layout
19020
19021 \end_inset
19022
19023 .
19024 \end_layout
19025
19026 \begin_layout Subsection
19027 The template header
19028 \end_layout
19029
19030 \begin_layout Description
19031 \begin_inset Flex Code
19032 status collapsed
19033
19034 \begin_layout Plain Layout
19035 AutomaticProduction
19036 \begin_inset space ~
19037 \end_inset
19038
19039 true|false
19040 \end_layout
19041
19042 \end_inset
19043
19044  Whether the file represented by the template must be generated by LyX.
19045  This command must occur exactly once.
19046 \end_layout
19047
19048 \begin_layout Description
19049 \begin_inset Flex Code
19050 status collapsed
19051
19052 \begin_layout Plain Layout
19053 FileFilter
19054 \begin_inset space ~
19055 \end_inset
19056
19057 <pattern>
19058 \end_layout
19059
19060 \end_inset
19061
19062  A glob pattern that is used in the file dialog to filter out the desired
19063  files.
19064  If there is more than one possible file extension (e.
19065 \begin_inset space \thinspace{}
19066 \end_inset
19067
19068 g.
19069 \begin_inset space \space{}
19070 \end_inset
19071
19072 tgif has 
19073 \begin_inset Flex Code
19074 status collapsed
19075
19076 \begin_layout Plain Layout
19077 .obj
19078 \end_layout
19079
19080 \end_inset
19081
19082  and 
19083 \begin_inset Flex Code
19084 status collapsed
19085
19086 \begin_layout Plain Layout
19087 .tgo
19088 \end_layout
19089
19090 \end_inset
19091
19092 ), use something like 
19093 \begin_inset Flex Code
19094 status collapsed
19095
19096 \begin_layout Plain Layout
19097 "*.{obj,tgo}"
19098 \end_layout
19099
19100 \end_inset
19101
19102 .
19103  This command must occur exactly once.
19104 \end_layout
19105
19106 \begin_layout Description
19107 \begin_inset Flex Code
19108 status collapsed
19109
19110 \begin_layout Plain Layout
19111 GuiName
19112 \begin_inset space ~
19113 \end_inset
19114
19115 <guiname>
19116 \end_layout
19117
19118 \end_inset
19119
19120  The text that is displayed on the button.
19121  This command must occur exactly once.
19122 \end_layout
19123
19124 \begin_layout Description
19125 \begin_inset Flex Code
19126 status collapsed
19127
19128 \begin_layout Plain Layout
19129 HelpText
19130 \begin_inset space ~
19131 \end_inset
19132
19133 <text>
19134 \begin_inset space ~
19135 \end_inset
19136
19137 HelpTextEnd
19138 \end_layout
19139
19140 \end_inset
19141
19142  The help text that is used in the External dialog.
19143  Provide enough information to explain to the user just what the template
19144  can provide him with.
19145  This command must occur exactly once.
19146 \end_layout
19147
19148 \begin_layout Description
19149 \begin_inset Flex Code
19150 status collapsed
19151
19152 \begin_layout Plain Layout
19153 InputFormat
19154 \begin_inset space ~
19155 \end_inset
19156
19157 <format>
19158 \end_layout
19159
19160 \end_inset
19161
19162  The file format of the original file.
19163  This must be the name of a format that is known to LyX (see section 
19164 \begin_inset CommandInset ref
19165 LatexCommand ref
19166 reference "sec:Formats"
19167
19168 \end_inset
19169
19170 ).
19171  Use 
19172 \begin_inset Quotes eld
19173 \end_inset
19174
19175
19176 \begin_inset Flex Code
19177 status collapsed
19178
19179 \begin_layout Plain Layout
19180 *
19181 \end_layout
19182
19183 \end_inset
19184
19185
19186 \begin_inset Quotes erd
19187 \end_inset
19188
19189  if the template can handle original files of more than one format.
19190  LyX will attempt to interrogate the file itself in order to deduce its
19191  format in this case.
19192  This command must occur exactly once.
19193 \end_layout
19194
19195 \begin_layout Description
19196 \begin_inset Flex Code
19197 status collapsed
19198
19199 \begin_layout Plain Layout
19200 Template
19201 \begin_inset space ~
19202 \end_inset
19203
19204 <id>
19205 \end_layout
19206
19207 \end_inset
19208
19209  A unique name for the template.
19210  It must not contain substitution macros (see below).
19211 \end_layout
19212
19213 \begin_layout Description
19214 \begin_inset Flex Code
19215 status collapsed
19216
19217 \begin_layout Plain Layout
19218 Transform
19219 \begin_inset space ~
19220 \end_inset
19221
19222 Rotate|Resize|Clip|Extra
19223 \end_layout
19224
19225 \end_inset
19226
19227  This command specifies which transformations are supported by this template.
19228  It may occur zero or more times.
19229  This command enables the corresponding tabs in the external dialog.
19230  Each 
19231 \begin_inset Flex Code
19232 status collapsed
19233
19234 \begin_layout Plain Layout
19235 Transform
19236 \end_layout
19237
19238 \end_inset
19239
19240  command must have either a corresponding 
19241 \begin_inset Flex Code
19242 status collapsed
19243
19244 \begin_layout Plain Layout
19245 TransformCommand
19246 \end_layout
19247
19248 \end_inset
19249
19250  or a 
19251 \begin_inset Flex Code
19252 status collapsed
19253
19254 \begin_layout Plain Layout
19255 TransformOption
19256 \end_layout
19257
19258 \end_inset
19259
19260  command in the 
19261 \begin_inset Flex Code
19262 status collapsed
19263
19264 \begin_layout Plain Layout
19265 Format
19266 \end_layout
19267
19268 \end_inset
19269
19270  section.
19271  Otherwise the transformation will not be supported by that format.
19272 \end_layout
19273
19274 \begin_layout Subsection
19275 The Format section
19276 \end_layout
19277
19278 \begin_layout Description
19279 \begin_inset Flex Code
19280 status collapsed
19281
19282 \begin_layout Plain Layout
19283 Format
19284 \begin_inset space ~
19285 \end_inset
19286
19287 LaTeX|PDFLaTeX|PlainText|DocBook
19288 \end_layout
19289
19290 \end_inset
19291
19292  The primary document file format that this format definition is for.
19293  Not every template has a sensible representation in all document file formats.
19294  Please define nevertheless a 
19295 \begin_inset Flex Code
19296 status collapsed
19297
19298 \begin_layout Plain Layout
19299 Format
19300 \end_layout
19301
19302 \end_inset
19303
19304  section for all formats.
19305  Use a dummy text when no representation is available.
19306  Then you can at least see a reference to the external material in the exported
19307  document.
19308 \end_layout
19309
19310 \begin_layout Description
19311 \begin_inset Flex Code
19312 status collapsed
19313
19314 \begin_layout Plain Layout
19315 Option
19316 \begin_inset space ~
19317 \end_inset
19318
19319 <name>
19320 \begin_inset space ~
19321 \end_inset
19322
19323 <value>
19324 \end_layout
19325
19326 \end_inset
19327
19328  This command defines an additional macro 
19329 \begin_inset Flex Code
19330 status collapsed
19331
19332 \begin_layout Plain Layout
19333 $$<name>
19334 \end_layout
19335
19336 \end_inset
19337
19338  for substitution in 
19339 \begin_inset Flex Code
19340 status collapsed
19341
19342 \begin_layout Plain Layout
19343 Product
19344 \end_layout
19345
19346 \end_inset
19347
19348 .
19349  
19350 \begin_inset Flex Code
19351 status collapsed
19352
19353 \begin_layout Plain Layout
19354 <value>
19355 \end_layout
19356
19357 \end_inset
19358
19359  itself may contain substitution macros.
19360  The advantage over using 
19361 \begin_inset Flex Code
19362 status collapsed
19363
19364 \begin_layout Plain Layout
19365 <value>
19366 \end_layout
19367
19368 \end_inset
19369
19370  directly in 
19371 \begin_inset Flex Code
19372 status collapsed
19373
19374 \begin_layout Plain Layout
19375 Product
19376 \end_layout
19377
19378 \end_inset
19379
19380  is that the substituted value of 
19381 \begin_inset Flex Code
19382 status collapsed
19383
19384 \begin_layout Plain Layout
19385 $$<name>
19386 \end_layout
19387
19388 \end_inset
19389
19390  is sanitized so that it is a valid optional argument in the document format.
19391  This command may occur zero or more times.
19392 \end_layout
19393
19394 \begin_layout Description
19395 \begin_inset Flex Code
19396 status collapsed
19397
19398 \begin_layout Plain Layout
19399 Product
19400 \begin_inset space ~
19401 \end_inset
19402
19403 <text>
19404 \end_layout
19405
19406 \end_inset
19407
19408  The text that is inserted in the exported document.
19409  This is actually the most important command and can be quite complex.
19410  This command must occur exactly once.
19411 \end_layout
19412
19413 \begin_layout Description
19414 \begin_inset Flex Code
19415 status collapsed
19416
19417 \begin_layout Plain Layout
19418 Preamble
19419 \begin_inset space ~
19420 \end_inset
19421
19422 <name>
19423 \end_layout
19424
19425 \end_inset
19426
19427  This command specifies a preamble snippet that will be included in the
19428  LaTeX preamble.
19429  It has to be defined using 
19430 \begin_inset Flex Code
19431 status collapsed
19432
19433 \begin_layout Plain Layout
19434 PreambleDef
19435 \end_layout
19436
19437 \end_inset
19438
19439  \SpecialChar \ldots{}
19440  
19441 \begin_inset Flex Code
19442 status collapsed
19443
19444 \begin_layout Plain Layout
19445 PreambleDefEnd
19446 \end_layout
19447
19448 \end_inset
19449
19450 .
19451  This command may occur zero or more times.
19452 \end_layout
19453
19454 \begin_layout Description
19455 \begin_inset Flex Code
19456 status collapsed
19457
19458 \begin_layout Plain Layout
19459 ReferencedFile
19460 \begin_inset space ~
19461 \end_inset
19462
19463 <format>
19464 \begin_inset space ~
19465 \end_inset
19466
19467 <filename>
19468 \end_layout
19469
19470 \end_inset
19471
19472  This command denotes files that are created by the conversion process and
19473  are needed for a particular export format.
19474  If the filename is relative, it is interpreted relative to the master document.
19475  This command may be given zero or more times.
19476 \end_layout
19477
19478 \begin_layout Description
19479 \begin_inset Flex Code
19480 status collapsed
19481
19482 \begin_layout Plain Layout
19483 Requirement
19484 \begin_inset space ~
19485 \end_inset
19486
19487 <package>
19488 \end_layout
19489
19490 \end_inset
19491
19492  The name of a required LaTeX package.
19493  The package is included via 
19494 \begin_inset Flex Code
19495 status collapsed
19496
19497 \begin_layout Plain Layout
19498
19499 \backslash
19500 usepackage{}
19501 \end_layout
19502
19503 \end_inset
19504
19505  in the LaTeX preamble.
19506  This command may occur zero or more times.
19507 \end_layout
19508
19509 \begin_layout Description
19510 \begin_inset Flex Code
19511 status collapsed
19512
19513 \begin_layout Plain Layout
19514 TransformCommand
19515 \begin_inset space ~
19516 \end_inset
19517
19518 Rotate
19519 \begin_inset space ~
19520 \end_inset
19521
19522 RotationLatexCommand
19523 \end_layout
19524
19525 \end_inset
19526
19527  This command specifies that the built in LaTeX command should be used for
19528  rotation.
19529  This command may occur once or not at all.
19530 \end_layout
19531
19532 \begin_layout Description
19533 \begin_inset Flex Code
19534 status collapsed
19535
19536 \begin_layout Plain Layout
19537 TransformCommand
19538 \begin_inset space ~
19539 \end_inset
19540
19541 Resize
19542 \begin_inset space ~
19543 \end_inset
19544
19545 ResizeLatexCommand
19546 \end_layout
19547
19548 \end_inset
19549
19550  This command specifies that the built in LaTeX command should be used for
19551  resizing.
19552  This command may occur once or not at all.
19553 \end_layout
19554
19555 \begin_layout Description
19556 \begin_inset Flex Code
19557 status collapsed
19558
19559 \begin_layout Plain Layout
19560 TransformOption
19561 \begin_inset space ~
19562 \end_inset
19563
19564 Rotate
19565 \begin_inset space ~
19566 \end_inset
19567
19568 RotationLatexOption
19569 \end_layout
19570
19571 \end_inset
19572
19573  This command specifies that rotation is done via an optional argument.
19574  This command may occur once or not at all.
19575 \end_layout
19576
19577 \begin_layout Description
19578 \begin_inset Flex Code
19579 status collapsed
19580
19581 \begin_layout Plain Layout
19582 TransformOption
19583 \begin_inset space ~
19584 \end_inset
19585
19586 Resize
19587 \begin_inset space ~
19588 \end_inset
19589
19590 ResizeLatexOption
19591 \end_layout
19592
19593 \end_inset
19594
19595  This command specifies that resizing is done via an optional argument.
19596  This command may occur once or not at all.
19597 \end_layout
19598
19599 \begin_layout Description
19600 \begin_inset Flex Code
19601 status collapsed
19602
19603 \begin_layout Plain Layout
19604 TransformOption
19605 \begin_inset space ~
19606 \end_inset
19607
19608 Clip
19609 \begin_inset space ~
19610 \end_inset
19611
19612 ClipLatexOption
19613 \end_layout
19614
19615 \end_inset
19616
19617  This command specifies that clipping is done via an optional argument.
19618  This command may occur once or not at all.
19619 \end_layout
19620
19621 \begin_layout Description
19622 \begin_inset Flex Code
19623 status collapsed
19624
19625 \begin_layout Plain Layout
19626 TransformOption
19627 \begin_inset space ~
19628 \end_inset
19629
19630 Extra
19631 \begin_inset space ~
19632 \end_inset
19633
19634 ExtraLatexOption
19635 \end_layout
19636
19637 \end_inset
19638
19639  This command specifies that an extra optional argument is used.
19640  This command may occur once or not at all.
19641 \end_layout
19642
19643 \begin_layout Description
19644 \begin_inset Flex Code
19645 status collapsed
19646
19647 \begin_layout Plain Layout
19648 UpdateFormat
19649 \begin_inset space ~
19650 \end_inset
19651
19652 <format>
19653 \end_layout
19654
19655 \end_inset
19656
19657  The file format of the converted file.
19658  This must be the name of a format that is known to LyX (see the 
19659 \begin_inset Flex MenuItem
19660 status collapsed
19661
19662 \begin_layout Plain Layout
19663
19664 \bar under
19665 T
19666 \bar default
19667 ools\SpecialChar \menuseparator
19668
19669 \bar under
19670 P
19671 \bar default
19672 references:Conversion
19673 \end_layout
19674
19675 \end_inset
19676
19677  dialog).
19678  This command must occur exactly once.
19679 \end_layout
19680
19681 \begin_layout Description
19682 \begin_inset Flex Code
19683 status collapsed
19684
19685 \begin_layout Plain Layout
19686 UpdateResult
19687 \begin_inset space ~
19688 \end_inset
19689
19690 <filename>
19691 \end_layout
19692
19693 \end_inset
19694
19695  The file name of the converted file.
19696  The file name must be absolute.
19697  This command must occur exactly once.
19698 \end_layout
19699
19700 \begin_layout Subsection
19701 Preamble definitions
19702 \end_layout
19703
19704 \begin_layout Standard
19705 The external template configuration file may contain additional preamble
19706  definitions enclosed by 
19707 \begin_inset Flex Code
19708 status collapsed
19709
19710 \begin_layout Plain Layout
19711 PreambleDef
19712 \end_layout
19713
19714 \end_inset
19715
19716  \SpecialChar \ldots{}
19717  
19718 \begin_inset Flex Code
19719 status collapsed
19720
19721 \begin_layout Plain Layout
19722 PreambleDefEnd
19723 \end_layout
19724
19725 \end_inset
19726
19727 .
19728  They can be used by the templates in the 
19729 \begin_inset Flex Code
19730 status collapsed
19731
19732 \begin_layout Plain Layout
19733 Format
19734 \end_layout
19735
19736 \end_inset
19737
19738  section.
19739 \end_layout
19740
19741 \begin_layout Section
19742 The substitution mechanism
19743 \end_layout
19744
19745 \begin_layout Standard
19746 When the external material facility invokes an external program, it is done
19747  on the basis of a command defined in the template configuration file.
19748  These commands can contain various macros that are expanded before execution.
19749  Execution always take place in the directory of the containing document.
19750 \end_layout
19751
19752 \begin_layout Standard
19753 Also, whenever external material is to be displayed, the name will be produced
19754  by the substitution mechanism, and most other commands in the template
19755  definition support substitution as well.
19756 \end_layout
19757
19758 \begin_layout Standard
19759 The available macros are the following:
19760 \end_layout
19761
19762 \begin_layout Description
19763 \begin_inset Flex Code
19764 status collapsed
19765
19766 \begin_layout Plain Layout
19767 $$AbsOrRelPathMaster
19768 \end_layout
19769
19770 \end_inset
19771
19772  The file path, absolute or relative to the master LyX document.
19773 \end_layout
19774
19775 \begin_layout Description
19776 \begin_inset Flex Code
19777 status collapsed
19778
19779 \begin_layout Plain Layout
19780 $$AbsOrRelPathParent
19781 \end_layout
19782
19783 \end_inset
19784
19785  The file path, absolute or relative to the LyX document.
19786 \end_layout
19787
19788 \begin_layout Description
19789 \begin_inset Flex Code
19790 status collapsed
19791
19792 \begin_layout Plain Layout
19793 $$AbsPath
19794 \end_layout
19795
19796 \end_inset
19797
19798  The absolute file path.
19799 \end_layout
19800
19801 \begin_layout Description
19802 \begin_inset Flex Code
19803 status collapsed
19804
19805 \begin_layout Plain Layout
19806 $$Basename
19807 \end_layout
19808
19809 \end_inset
19810
19811  The filename without path and without the extension.
19812 \end_layout
19813
19814 \begin_layout Description
19815 \begin_inset Flex Code
19816 status collapsed
19817
19818 \begin_layout Plain Layout
19819 $$Contents(
19820 \begin_inset Quotes eld
19821 \end_inset
19822
19823 filename.ext
19824 \begin_inset Quotes erd
19825 \end_inset
19826
19827 )
19828 \end_layout
19829
19830 \end_inset
19831
19832  This macro will expand to the contents of the file with the name 
19833 \begin_inset Flex Code
19834 status collapsed
19835
19836 \begin_layout Plain Layout
19837 filename.ext
19838 \end_layout
19839
19840 \end_inset
19841
19842 .
19843 \end_layout
19844
19845 \begin_layout Description
19846 \begin_inset Flex Code
19847 status collapsed
19848
19849 \begin_layout Plain Layout
19850 $$Extension
19851 \end_layout
19852
19853 \end_inset
19854
19855  The file extension (including the dot).
19856 \end_layout
19857
19858 \begin_layout Description
19859 \begin_inset Flex Code
19860 status collapsed
19861
19862 \begin_layout Plain Layout
19863 $$FName
19864 \end_layout
19865
19866 \end_inset
19867
19868  The filename of the file specified in the external material dialog.
19869  This is either an absolute name, or it is relative to the LyX document.
19870 \end_layout
19871
19872 \begin_layout Description
19873 \begin_inset Flex Code
19874 status collapsed
19875
19876 \begin_layout Plain Layout
19877 $$FPath
19878 \end_layout
19879
19880 \end_inset
19881
19882  The path part of 
19883 \begin_inset Flex Code
19884 status collapsed
19885
19886 \begin_layout Plain Layout
19887 $$FName
19888 \end_layout
19889
19890 \end_inset
19891
19892  (absolute name or relative to the LyX document).
19893 \end_layout
19894
19895 \begin_layout Description
19896 \begin_inset Flex Code
19897 status collapsed
19898
19899 \begin_layout Plain Layout
19900 $$RelPathMaster
19901 \end_layout
19902
19903 \end_inset
19904
19905  The file path, relative to the master LyX document.
19906 \end_layout
19907
19908 \begin_layout Description
19909 \begin_inset Flex Code
19910 status collapsed
19911
19912 \begin_layout Plain Layout
19913 $$RelPathParent
19914 \end_layout
19915
19916 \end_inset
19917
19918  The file path, relative to the LyX document.
19919 \end_layout
19920
19921 \begin_layout Description
19922 \begin_inset Flex Code
19923 status collapsed
19924
19925 \begin_layout Plain Layout
19926 $$Sysdir
19927 \end_layout
19928
19929 \end_inset
19930
19931  This macro will expand to the absolute path of the system directory.
19932  This is typically used to point to the various helper scripts that are
19933  bundled with LyX.
19934 \end_layout
19935
19936 \begin_layout Description
19937 \begin_inset Flex Code
19938 status collapsed
19939
19940 \begin_layout Plain Layout
19941 $$Tempname
19942 \end_layout
19943
19944 \end_inset
19945
19946  A name and full path to a temporary file which will be automatically deleted
19947  whenever the containing document is closed, or the external material insertion
19948  deleted.
19949 \end_layout
19950
19951 \begin_layout Standard
19952 All path macros contain a trailing directory separator, so you can construct
19953  e.
19954 \begin_inset space \thinspace{}
19955 \end_inset
19956
19957 g.
19958 \begin_inset space \space{}
19959 \end_inset
19960
19961 the absolute filename with 
19962 \begin_inset Flex Code
19963 status collapsed
19964
19965 \begin_layout Plain Layout
19966 $$AbsPath$$Basename$$Extension
19967 \end_layout
19968
19969 \end_inset
19970
19971 .
19972 \end_layout
19973
19974 \begin_layout Standard
19975 The macros above are substituted in all commands unless otherwise noted.
19976  The command 
19977 \begin_inset Flex Code
19978 status collapsed
19979
19980 \begin_layout Plain Layout
19981 Product
19982 \end_layout
19983
19984 \end_inset
19985
19986  supports additionally the following substitutions if they are enabled by
19987  the 
19988 \begin_inset Flex Code
19989 status collapsed
19990
19991 \begin_layout Plain Layout
19992 Transform
19993 \end_layout
19994
19995 \end_inset
19996
19997  and 
19998 \begin_inset Flex Code
19999 status collapsed
20000
20001 \begin_layout Plain Layout
20002 TransformCommand
20003 \end_layout
20004
20005 \end_inset
20006
20007  commands:
20008 \end_layout
20009
20010 \begin_layout Description
20011 \begin_inset Flex Code
20012 status collapsed
20013
20014 \begin_layout Plain Layout
20015 $$ResizeFront
20016 \end_layout
20017
20018 \end_inset
20019
20020  The front part of the resize command.
20021 \end_layout
20022
20023 \begin_layout Description
20024 \begin_inset Flex Code
20025 status collapsed
20026
20027 \begin_layout Plain Layout
20028 $$ResizeBack
20029 \end_layout
20030
20031 \end_inset
20032
20033  The back part of the resize command.
20034 \end_layout
20035
20036 \begin_layout Description
20037 \begin_inset Flex Code
20038 status collapsed
20039
20040 \begin_layout Plain Layout
20041 $$RotateFront
20042 \end_layout
20043
20044 \end_inset
20045
20046  The front part of the rotation command.
20047 \end_layout
20048
20049 \begin_layout Description
20050 \begin_inset Flex Code
20051 status collapsed
20052
20053 \begin_layout Plain Layout
20054 $$RotateBack
20055 \end_layout
20056
20057 \end_inset
20058
20059  The back part of the rotation command.
20060 \end_layout
20061
20062 \begin_layout Standard
20063 The value string of the 
20064 \begin_inset Flex Code
20065 status collapsed
20066
20067 \begin_layout Plain Layout
20068 Option
20069 \end_layout
20070
20071 \end_inset
20072
20073  command supports additionally the following substitutions if they are enabled
20074  by the 
20075 \begin_inset Flex Code
20076 status collapsed
20077
20078 \begin_layout Plain Layout
20079 Transform
20080 \end_layout
20081
20082 \end_inset
20083
20084  and 
20085 \begin_inset Flex Code
20086 status collapsed
20087
20088 \begin_layout Plain Layout
20089 TransformOption
20090 \end_layout
20091
20092 \end_inset
20093
20094  commands:
20095 \end_layout
20096
20097 \begin_layout Description
20098 \begin_inset Flex Code
20099 status collapsed
20100
20101 \begin_layout Plain Layout
20102 $$Clip
20103 \end_layout
20104
20105 \end_inset
20106
20107  The clip option.
20108 \end_layout
20109
20110 \begin_layout Description
20111 \begin_inset Flex Code
20112 status collapsed
20113
20114 \begin_layout Plain Layout
20115 $$Extra
20116 \end_layout
20117
20118 \end_inset
20119
20120  The extra option.
20121 \end_layout
20122
20123 \begin_layout Description
20124 \begin_inset Flex Code
20125 status collapsed
20126
20127 \begin_layout Plain Layout
20128 $$Resize
20129 \end_layout
20130
20131 \end_inset
20132
20133  The resize option.
20134 \end_layout
20135
20136 \begin_layout Description
20137 \begin_inset Flex Code
20138 status collapsed
20139
20140 \begin_layout Plain Layout
20141 $$Rotate
20142 \end_layout
20143
20144 \end_inset
20145
20146  The rotation option.
20147 \end_layout
20148
20149 \begin_layout Standard
20150 You may ask why there are so many path macros.
20151  There are mainly two reasons:
20152 \end_layout
20153
20154 \begin_layout Enumerate
20155 Relative and absolute file names should remain relative or absolute, respectivel
20156 y.
20157  Users may have reasons to prefer either form.
20158  Relative names are useful for portable documents that should work on different
20159  machines, for example.
20160  Absolute names may be required by some programs.
20161 \end_layout
20162
20163 \begin_layout Enumerate
20164 LaTeX treats relative file names differently than LyX and other programs
20165  in nested included files.
20166  For LyX, a relative file name is always relative to the document that contains
20167  the file name.
20168  For LaTeX, it is always relative to the master document.
20169  These two definitions are identical if you have only one document, but
20170  differ if you have a master document that includes part documents.
20171  That means that relative filenames must be transformed when presented to
20172  LaTeX.
20173  Fortunately LyX does this automatically for you if you choose the right
20174  macros.
20175 \end_layout
20176
20177 \begin_layout Standard
20178 So which path macro should be used in new template definitions? The rule
20179  is not difficult:
20180 \end_layout
20181
20182 \begin_layout Itemize
20183 Use 
20184 \begin_inset Flex Code
20185 status collapsed
20186
20187 \begin_layout Plain Layout
20188 $$AbsPath
20189 \end_layout
20190
20191 \end_inset
20192
20193  if an absolute path is required.
20194 \end_layout
20195
20196 \begin_layout Itemize
20197 Use 
20198 \begin_inset Flex Code
20199 status collapsed
20200
20201 \begin_layout Plain Layout
20202 $$AbsOrRelPathMaster
20203 \end_layout
20204
20205 \end_inset
20206
20207  if the substituted string is some kind of LaTeX input.
20208 \end_layout
20209
20210 \begin_layout Itemize
20211 Else use 
20212 \begin_inset Flex Code
20213 status collapsed
20214
20215 \begin_layout Plain Layout
20216 $$AbsOrRelPathParent
20217 \end_layout
20218
20219 \end_inset
20220
20221  in order to preserve the user's choice.
20222 \end_layout
20223
20224 \begin_layout Standard
20225 There are special cases where this rule does not work and e.
20226 \begin_inset space \thinspace{}
20227 \end_inset
20228
20229 g.
20230 \begin_inset space \space{}
20231 \end_inset
20232
20233 relative names are needed, but normally it will work just fine.
20234  One example for such a case is the command 
20235 \begin_inset Flex Code
20236 status collapsed
20237
20238 \begin_layout Plain Layout
20239 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20240 \end_layout
20241
20242 \end_inset
20243
20244  in the XFig template above: We can't use the absolute name because the
20245  copier for 
20246 \begin_inset Flex Code
20247 status collapsed
20248
20249 \begin_layout Plain Layout
20250 .pstex_t
20251 \end_layout
20252
20253 \end_inset
20254
20255  files needs the relative name in order to rewrite the file content.
20256 \end_layout
20257
20258 \begin_layout Section
20259 Security discussion
20260 \begin_inset CommandInset label
20261 LatexCommand label
20262 name "sec:Security-discussion"
20263
20264 \end_inset
20265
20266
20267 \end_layout
20268
20269 \begin_layout Standard
20270 The external material feature interfaces with a lot of external programs
20271  and does so automatically, so we have to consider the security implications
20272  of this.
20273  In particular, since you have the option of including your own filenames
20274  and/or parameter strings and those are expanded into a command, it seems
20275  that it would be possible to create a malicious document which executes
20276  arbitrary commands when a user views or prints the document.
20277  This is something we definitely want to avoid.
20278 \end_layout
20279
20280 \begin_layout Standard
20281 However, since the external program commands are specified in the template
20282  configuration file only, there are no security issues if LyX is properly
20283  configured with safe templates only.
20284  This is so because the external programs are invoked with the 
20285 \begin_inset Flex Code
20286 status collapsed
20287
20288 \begin_layout Plain Layout
20289 execvp
20290 \end_layout
20291
20292 \end_inset
20293
20294 -system call rather than the 
20295 \begin_inset Flex Code
20296 status collapsed
20297
20298 \begin_layout Plain Layout
20299 system
20300 \end_layout
20301
20302 \end_inset
20303
20304  system-call, so it's not possible to execute arbitrary commands from the
20305  filename or parameter section via the shell.
20306 \end_layout
20307
20308 \begin_layout Standard
20309 This also implies that you are restricted in what command strings you can
20310  use in the external material templates.
20311  In particular, pipes and redirection are not readily available.
20312  This has to be so if LyX should remain safe.
20313  If you want to use some of the shell features, you should write a safe
20314  script to do this in a controlled manner, and then invoke the script from
20315  the command string.
20316  
20317 \end_layout
20318
20319 \begin_layout Standard
20320 It is possible to design a template that interacts directly with the shell,
20321  but since this would allow a malicious user to execute arbitrary commands
20322  by writing clever filenames and/or parameters, we generally recommend that
20323  you only use safe scripts that work with the 
20324 \begin_inset Flex Code
20325 status collapsed
20326
20327 \begin_layout Plain Layout
20328 execvp
20329 \end_layout
20330
20331 \end_inset
20332
20333  system call in a controlled manner.
20334  Of course, for use in a controlled environment, it can be tempting to just
20335  fall back to use ordinary shell scripts.
20336  If you do so, be aware that you 
20337 \emph on
20338 will
20339 \emph default
20340  provide an easily exploitable security hole in your system.
20341  Of course it stands to reason that such unsafe templates will never be
20342  included in the standard LyX distribution, although we do encourage people
20343  to submit new templates in the open source tradition.
20344  But LyX as shipped from the official distribution channels will never have
20345  unsafe templates.
20346 \end_layout
20347
20348 \begin_layout Standard
20349 Including external material provides a lot of power, and you have to be
20350  careful not to introduce security hazards with this power.
20351  A subtle error in a single line in an innocent looking script can open
20352  the door to huge security problems.
20353  So if you do not fully understand the issues, we recommend that you consult
20354  a knowledgeable security professional or the LyX development team if you
20355  have any questions about whether a given template is safe or not.
20356  And do this before you use it in an uncontrolled environment.
20357 \end_layout
20358
20359 \end_body
20360 \end_document