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