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