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