]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
Documentation for XHTML support (or otherwise) or indexes and glossaries.
[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 \end_layout
5312
5313 \begin_layout Standard
5314 You can think of the layout file for a given document class as a translation
5315  manual between LyX constructs---paragraphs with their corresponding styles,
5316  certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5317  XHTML constructs.
5318  Almost everything LyX knows about 
5319 \begin_inset Flex CharStyle:Code
5320 status collapsed
5321
5322 \begin_layout Plain Layout
5323 article.cls
5324 \end_layout
5325
5326 \end_inset
5327
5328 , for example, is contained in the file 
5329 \begin_inset Flex CharStyle:Code
5330 status collapsed
5331
5332 \begin_layout Plain Layout
5333 article.layout
5334 \end_layout
5335
5336 \end_inset
5337
5338  and in various other files it includes.
5339  For this reason, anyone intending to write layout files should plan to
5340  study the existing files.
5341  A good place to start is with 
5342 \begin_inset Flex CharStyle:Code
5343 status collapsed
5344
5345 \begin_layout Plain Layout
5346 stdsections.inc
5347 \end_layout
5348
5349 \end_inset
5350
5351 , which is included in 
5352 \begin_inset Flex CharStyle:Code
5353 status collapsed
5354
5355 \begin_layout Plain Layout
5356 article.layout
5357 \end_layout
5358
5359 \end_inset
5360
5361
5362 \begin_inset Flex CharStyle:Code
5363 status collapsed
5364
5365 \begin_layout Plain Layout
5366 book.layout
5367 \end_layout
5368
5369 \end_inset
5370
5371 , and many of the other layout files for document classes.
5372  This file is where sections and the like are defined: 
5373 \begin_inset Flex CharStyle:Code
5374 status collapsed
5375
5376 \begin_layout Plain Layout
5377 stdsections.inc
5378 \end_layout
5379
5380 \end_inset
5381
5382  tells LyX how paragraphs that are marked with the Section, Subsection,
5383  etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5384  commands and tags.
5385  The 
5386 \begin_inset Flex CharStyle:Code
5387 status collapsed
5388
5389 \begin_layout Plain Layout
5390 article.layout
5391 \end_layout
5392
5393 \end_inset
5394
5395  file basically just includes several of these 
5396 \begin_inset Flex CharStyle:Code
5397 status collapsed
5398
5399 \begin_layout Plain Layout
5400 std*.inc
5401 \end_layout
5402
5403 \end_inset
5404
5405  files.
5406 \end_layout
5407
5408 \begin_layout Standard
5409 Defining the LyX--LaTeX correspondence is not the only thing layout files
5410  do, though.
5411  Their other job is to define how the LyX constructs themselves will appear
5412  on-screen.
5413  The fact that layout files have these two jobs is often a source of confusion,
5414  because they are completely separate.
5415  Telling LyX how to translate a certain paragraph style into LaTeX does
5416  not tell LyX how to display it; conversely, telling LyX how to display
5417  a certain paragraph style does not tell LyX how to translate it into LaTeX
5418  (let alone tell LaTeX how to display it).
5419  So, in general, when you define a new LyX construct, you must always do
5420  two quite separate things: (i)
5421 \begin_inset space ~
5422 \end_inset
5423
5424 tell LyX how to translate it into LaTeX and (ii)
5425 \begin_inset space ~
5426 \end_inset
5427
5428 tell LyX how to display it.
5429 \end_layout
5430
5431 \begin_layout Standard
5432 Much the same is true, of course, as regards LyX's other backend formats,
5433  though XHTML is in some ways different, because in that case LyX 
5434 \emph on
5435 is
5436 \emph default
5437  able, to some extent, to use information about how it should display a
5438  paragraph on the screen to output information (in the form of CSS) about
5439  how the paragraph should be displayed in a browser.
5440  Even in this case, however, the distinction between what LyX does internally
5441  and how things are rendered externally remains in force, and the two can
5442  be controlled separately.
5443  See 
5444 \begin_inset CommandInset ref
5445 LatexCommand prettyref
5446 reference "sec:Tags-for-XHTML"
5447
5448 \end_inset
5449
5450  for the details.
5451 \end_layout
5452
5453 \begin_layout Section
5454 Installing new LaTeX files
5455 \end_layout
5456
5457 \begin_layout Standard
5458 Some installations may not include a LaTeX package or class file that you
5459  would like to use within LyX.
5460  For example, you might need FoilTeX, a package for preparing slides for
5461  overhead projectors.
5462  Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5463  a user interface for installing such packages.
5464  For example, with MiKTeX, you start the program 
5465 \begin_inset Quotes eld
5466 \end_inset
5467
5468 Browse Packages
5469 \begin_inset Quotes erd
5470 \end_inset
5471
5472  to get a list of available packages.
5473  To install one, right click on it or use the toolbar button to install
5474  it.
5475  
5476 \end_layout
5477
5478 \begin_layout Standard
5479 If your LaTeX distribution doesn't provide such a `package manager', or
5480  if the file is not available from your distribution, then you can follow
5481  these steps to install it manually.
5482 \end_layout
5483
5484 \begin_layout Enumerate
5485 Get the package from 
5486 \begin_inset CommandInset href
5487 LatexCommand href
5488 name "CTAN"
5489 target "http://www.ctan.org/"
5490
5491 \end_inset
5492
5493  or wherever.
5494 \end_layout
5495
5496 \begin_layout Enumerate
5497 You can install the package in several different places.
5498  If you want it to be available for all users on your system, then you should
5499  install it in your `local' TeX tree; if you want (or need) it to be available
5500  just for you, then you can install it in your own `user' TeX tree.
5501  Where these trees should be created, if they do not already exist, depends
5502  upon the details of your system.
5503  To find out where they are, look in the file 
5504 \begin_inset Flex CharStyle:Code
5505 status collapsed
5506
5507 \begin_layout Plain Layout
5508 texmf.cnf
5509 \end_layout
5510
5511 \end_inset
5512
5513 .
5514 \begin_inset Foot
5515 status collapsed
5516
5517 \begin_layout Plain Layout
5518 This usually lives in the directory 
5519 \begin_inset Flex CharStyle:Code
5520 status collapsed
5521
5522 \begin_layout Plain Layout
5523 $TEXMF/web2c
5524 \end_layout
5525
5526 \end_inset
5527
5528 , though you can run 
5529 \begin_inset Flex CharStyle:Code
5530 status collapsed
5531
5532 \begin_layout Plain Layout
5533 kpsewhich texmf.cnf
5534 \end_layout
5535
5536 \end_inset
5537
5538  to locate it.
5539 \end_layout
5540
5541 \end_inset
5542
5543  The location of the `local' TeX tree is defined by the 
5544 \begin_inset Flex CharStyle:Code
5545 status collapsed
5546
5547 \begin_layout Plain Layout
5548 TEXMFLOCAL
5549 \end_layout
5550
5551 \end_inset
5552
5553  variable; this is usually somewhere like 
5554 \begin_inset Flex URL
5555 status collapsed
5556
5557 \begin_layout Plain Layout
5558
5559 /usr/local/share/texmf/
5560 \end_layout
5561
5562 \end_inset
5563
5564 .
5565  The location of the `user' TeX tree is defined by 
5566 \begin_inset Flex CharStyle:Code
5567 status collapsed
5568
5569 \begin_layout Plain Layout
5570 TEXMFHOME
5571 \end_layout
5572
5573 \end_inset
5574
5575  and is commonly 
5576 \begin_inset Flex CharStyle:Code
5577 status collapsed
5578
5579 \begin_layout Plain Layout
5580 $HOME/texmf/
5581 \end_layout
5582
5583 \end_inset
5584
5585 .
5586  (If these variables are not predefined, you can define them.) You'll probably
5587  need root permissions to create or modify the `local' tree, but your `user'
5588  tree shouldn't have such limitations.
5589 \end_layout
5590
5591 \begin_layout Enumerate
5592 Make sure 
5593 \begin_inset Flex CharStyle:Code
5594 status collapsed
5595
5596 \begin_layout Plain Layout
5597 TEXMF
5598 \end_layout
5599
5600 \end_inset
5601
5602  includes the 
5603 \begin_inset Flex CharStyle:Code
5604 status collapsed
5605
5606 \begin_layout Plain Layout
5607 TEXMFLOCAL
5608 \end_layout
5609
5610 \end_inset
5611
5612  and 
5613 \begin_inset Flex CharStyle:Code
5614 status collapsed
5615
5616 \begin_layout Plain Layout
5617 TEXMFHOME
5618 \end_layout
5619
5620 \end_inset
5621
5622  variables; e.
5623 \begin_inset space \thinspace{}
5624 \end_inset
5625
5626 g.
5627 \begin_inset Newline newline
5628 \end_inset
5629
5630
5631 \begin_inset Flex CharStyle:Code
5632 status collapsed
5633
5634 \begin_layout Plain Layout
5635 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5636 \end_layout
5637
5638 \end_inset
5639
5640
5641 \begin_inset Newline newline
5642 \end_inset
5643
5644 It probably does.
5645 \end_layout
5646
5647 \begin_layout Enumerate
5648 Your local and user trees 
5649 \emph on
5650 must
5651 \emph default
5652  have the same sort of directory structure as your main existing 
5653 \begin_inset Flex CharStyle:Code
5654 status collapsed
5655
5656 \begin_layout Plain Layout
5657 texmf
5658 \end_layout
5659
5660 \end_inset
5661
5662  directory, which will be found at 
5663 \begin_inset Flex CharStyle:Code
5664 status collapsed
5665
5666 \begin_layout Plain Layout
5667 TEXMFMAIN
5668 \end_layout
5669
5670 \end_inset
5671
5672  (commonly, 
5673 \begin_inset Flex CharStyle:Code
5674 status collapsed
5675
5676 \begin_layout Plain Layout
5677 /usr/share/texmf/
5678 \end_layout
5679
5680 \end_inset
5681
5682 .) For example, latex packages should go under 
5683 \begin_inset Flex CharStyle:Code
5684 status collapsed
5685
5686 \begin_layout Plain Layout
5687 $TEXMFLOCAL/tex/latex/
5688 \end_layout
5689
5690 \end_inset
5691
5692  or 
5693 \begin_inset Flex CharStyle:Code
5694 status collapsed
5695
5696 \begin_layout Plain Layout
5697 $TEXMFHOME/tex/latex/
5698 \end_layout
5699
5700 \end_inset
5701
5702 .
5703  If you do not put them here, they probably will not work.
5704 \end_layout
5705
5706 \begin_layout Enumerate
5707 Once your tree is properly set up, you can install the package into an appropria
5708 te location.
5709  If you are lucky, your package will have been provided as a so-called `TDS'
5710  (TeX Directory Structure) zip file.
5711  To install it, you want to unzip it from the top of your tree.
5712  So, for example, you can copy the file 
5713 \begin_inset Flex CharStyle:Code
5714 status collapsed
5715
5716 \begin_layout Plain Layout
5717 newpkg.zip
5718 \end_layout
5719
5720 \end_inset
5721
5722  to 
5723 \begin_inset Flex CharStyle:Code
5724 status collapsed
5725
5726 \begin_layout Plain Layout
5727 /home/yourname/texmf/
5728 \end_layout
5729
5730 \end_inset
5731
5732  and then, from inside that directory, just run: 
5733 \begin_inset Flex CharStyle:Code
5734 status collapsed
5735
5736 \begin_layout Plain Layout
5737 unzip newpkg.zip
5738 \end_layout
5739
5740 \end_inset
5741
5742 .
5743  This will extract the needed files and copy them where they need to be.
5744 \begin_inset Newline newline
5745 \end_inset
5746
5747 If you do not have a TDS file, then you have to do this manually.
5748  For example, you might install the FoilTeX files into 
5749 \begin_inset Flex URL
5750 status collapsed
5751
5752 \begin_layout Plain Layout
5753
5754 $TEXMFLOCAL/tex/latex/contrib/foiltex
5755 \end_layout
5756
5757 \end_inset
5758
5759 .
5760  Why there? The CTAN download directories are themselves organized much
5761  like a TeX tree, and it isn't a bad idea to follow its structure when you
5762  install your own files.
5763  FoilTeX, as it happens, is found at 
5764 \begin_inset Flex URL
5765 status collapsed
5766
5767 \begin_layout Plain Layout
5768
5769 http://ctan.org/texarchive/macros/latex/contrib/foiltex/
5770 \end_layout
5771
5772 \end_inset
5773
5774 .
5775  
5776 \end_layout
5777
5778 \begin_layout Enumerate
5779 Finally, you must update the database TeX uses to find files.
5780  On MiKTeX, this is done by pressing the button 
5781 \family sans
5782 Refresh
5783 \begin_inset space ~
5784 \end_inset
5785
5786 FNDB
5787 \family default
5788  that you find in MiKTeX's 
5789 \begin_inset Quotes eld
5790 \end_inset
5791
5792 Settings
5793 \begin_inset Quotes erd
5794 \end_inset
5795
5796  program.
5797  
5798 \begin_inset Flex CharStyle:Code
5799 status collapsed
5800
5801 \begin_layout Plain Layout
5802 $TEXMFLOCAL/tex/latex/
5803 \end_layout
5804
5805 \end_inset
5806
5807 .
5808  Under TeXLive and the like, you should run 
5809 \begin_inset Flex CharStyle:Code
5810 status collapsed
5811
5812 \begin_layout Plain Layout
5813 texhash
5814 \end_layout
5815
5816 \end_inset
5817
5818  from a terminal, with root permissions if necessary.
5819  
5820 \end_layout
5821
5822 \begin_layout Standard
5823 Your package is now installed and available to LaTeX.
5824  You can verify this from a terminal by typing `
5825 \begin_inset Flex CharStyle:Code
5826 status collapsed
5827
5828 \begin_layout Plain Layout
5829 kpsewhich yourfile.ext
5830 \end_layout
5831
5832 \end_inset
5833
5834 '.
5835  To make LyX aware of it, however, you will need to reconfigure (
5836 \begin_inset Flex CharStyle:MenuItem
5837 status collapsed
5838
5839 \begin_layout Plain Layout
5840 Tools\SpecialChar \menuseparator
5841 Reconfigure
5842 \end_layout
5843
5844 \end_inset
5845
5846 ) and then restart LyX.
5847  If the new package was a document class, such as FoilTeX again, you will
5848  now see it available under 
5849 \begin_inset Flex CharStyle:MenuItem
5850 status collapsed
5851
5852 \begin_layout Plain Layout
5853 Document\SpecialChar \menuseparator
5854 Settings\SpecialChar \menuseparator
5855 Document Class
5856 \end_layout
5857
5858 \end_inset
5859
5860 , in this case as 
5861 \begin_inset Flex CharStyle:MenuItem
5862 status collapsed
5863
5864 \begin_layout Plain Layout
5865 slides (FoilTeX)
5866 \end_layout
5867
5868 \end_inset
5869
5870 .
5871 \end_layout
5872
5873 \begin_layout Standard
5874 What if there isn't a layout file is available for your new document class?
5875  Then, unfortunately, LyX will know nothing about it until you create a
5876  layout file yourself (or get someone else to do it).
5877  That is the topic of the next section.
5878 \end_layout
5879
5880 \begin_layout Section
5881 Types of layout files
5882 \end_layout
5883
5884 \begin_layout Standard
5885 This section describes the various sorts of LyX files that contain layout
5886  information.
5887  These files describe various paragraph and character styles, determining
5888  how LyX should display them and how they should be translated into LaTeX,
5889  DocBook, XHTML, or whatever output format is being used.
5890  
5891 \end_layout
5892
5893 \begin_layout Standard
5894 We shall try to provide a thorough description of the process of writing
5895  layout files here.
5896  However, there are so many different types of documents supported even
5897  by just LaTeX that we can't hope to cover every different possibility or
5898  problem you might encounter.
5899  The LyX users' list is frequented by people with lots of experience with
5900  layout design who are willing to share what they've learned, so please
5901  feel free to ask questions there.
5902 \end_layout
5903
5904 \begin_layout Standard
5905 As you prepare to write a new layout, it is extremely helpful to look at
5906  the layouts distributed with LyX.
5907  If you write a LyX layout for a LaTeX document class that might also be
5908  used by others, or write a module that might be useful to others, then
5909  you should consider posting your layout to the 
5910 \begin_inset CommandInset href
5911 LatexCommand href
5912 name "layout section on the LyX wiki"
5913 target "http://wiki.lyx.org/Layouts/Layouts"
5914
5915 \end_inset
5916
5917  or even to the LyX developers' list, so that it might be included in LyX
5918  itself.
5919 \begin_inset Foot
5920 status collapsed
5921
5922 \begin_layout Plain Layout
5923 Note that LyX is licensed under the General Public License, so any material
5924  that is contribued to LyX must be similarly licensed.
5925 \end_layout
5926
5927 \end_inset
5928
5929
5930 \end_layout
5931
5932 \begin_layout Subsection
5933 Layout modules
5934 \begin_inset CommandInset label
5935 LatexCommand label
5936 name "sub:Layout-modules"
5937
5938 \end_inset
5939
5940
5941 \end_layout
5942
5943 \begin_layout Standard
5944 We have spoken to this point about `layout files'.
5945  But there are different sorts of files that contain layout information.
5946  Layout files, strictly so called, have the 
5947 \begin_inset Flex CharStyle:Code
5948 status collapsed
5949
5950 \begin_layout Plain Layout
5951 .layout
5952 \end_layout
5953
5954 \end_inset
5955
5956  extension and provide LyX with information about document classes.
5957  As of LyX 1.6, however, layout information can also be contained in layout
5958  
5959 \emph on
5960 modules
5961 \emph default
5962 , which have the 
5963 \begin_inset Flex CharStyle:Code
5964 status collapsed
5965
5966 \begin_layout Plain Layout
5967 .module
5968 \end_layout
5969
5970 \end_inset
5971
5972  extension.
5973  Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5974  some modules—such as the 
5975 \begin_inset Flex CharStyle:Code
5976 status collapsed
5977
5978 \begin_layout Plain Layout
5979 endnotes
5980 \end_layout
5981
5982 \end_inset
5983
5984  module—specifcally provide support for one package.
5985  In a sense, layout modules are similar to included
5986 \begin_inset Foot
5987 status collapsed
5988
5989 \begin_layout Plain Layout
5990 These can have any extension, but by convention have the 
5991 \begin_inset Flex CharStyle:Code
5992 status collapsed
5993
5994 \begin_layout Plain Layout
5995 .inc
5996 \end_layout
5997
5998 \end_inset
5999
6000  extension.
6001 \end_layout
6002
6003 \end_inset
6004
6005  files—files like 
6006 \begin_inset Flex CharStyle:Code
6007 status collapsed
6008
6009 \begin_layout Plain Layout
6010 stdsections.inc
6011 \end_layout
6012
6013 \end_inset
6014
6015 —in that modules are not specific to a given document class but may be used
6016  with many different classes.
6017  The difference is that using an included file with 
6018 \begin_inset Flex CharStyle:Code
6019 status collapsed
6020
6021 \begin_layout Plain Layout
6022 article.cls
6023 \end_layout
6024
6025 \end_inset
6026
6027  requires editing that file.
6028  Modules, by contrast, are selected in the 
6029 \begin_inset Flex CharStyle:MenuItem
6030 status collapsed
6031
6032 \begin_layout Plain Layout
6033 Document\SpecialChar \menuseparator
6034 Settings
6035 \end_layout
6036
6037 \end_inset
6038
6039  dialog.
6040 \end_layout
6041
6042 \begin_layout Standard
6043 Building modules is the easiest way to get started with layout editing,
6044  since it can be as simple as adding a single new paragraph style or flex
6045  inset.
6046  But modules may, in principle, contain anything a layout file can contain.
6047 \end_layout
6048
6049 \begin_layout Standard
6050 After creating a new module and copying it to the 
6051 \begin_inset Flex CharStyle:Code
6052 status collapsed
6053
6054 \begin_layout Plain Layout
6055 layout/
6056 \end_layout
6057
6058 \end_inset
6059
6060  folder, you will need to reconfigure and then restart LyX for the module
6061  to appear in the menu.
6062  However, changes you make to the module will be seen immediately, if you
6063  open 
6064 \begin_inset Flex CharStyle:MenuItem
6065 status collapsed
6066
6067 \begin_layout Plain Layout
6068 Document\SpecialChar \menuseparator
6069 Settings
6070 \end_layout
6071
6072 \end_inset
6073
6074 , highlight something, and then hit 
6075 \begin_inset Quotes eld
6076 \end_inset
6077
6078 OK
6079 \begin_inset Quotes erd
6080 \end_inset
6081
6082 .
6083  
6084 \emph on
6085 It is strongly recommended that you save your work before doing this
6086 \emph default
6087 .
6088  In fact, 
6089 \emph on
6090 it is strongly recommended that you not attempt to edit modules while simultaneo
6091 usly working on actual documents
6092 \emph default
6093 .
6094  Though of course the developers strive to keep LyX stable in such situations,
6095  syntax errors and the like in your module file could cause strange behavior.
6096 \end_layout
6097
6098 \begin_layout Subsection
6099 Layout for 
6100 \begin_inset Flex CharStyle:MenuItem
6101 status collapsed
6102
6103 \begin_layout Plain Layout
6104 .sty
6105 \end_layout
6106
6107 \end_inset
6108
6109  files
6110 \end_layout
6111
6112 \begin_layout Standard
6113 There are two situations you are likely to encounter when wanting to support
6114  a new LaTeX document class, involving LaTeX2e class (
6115 \begin_inset Flex CharStyle:Code
6116 status collapsed
6117
6118 \begin_layout Plain Layout
6119 .cls
6120 \end_layout
6121
6122 \end_inset
6123
6124 ) and style (
6125 \begin_inset Flex CharStyle:Code
6126 status collapsed
6127
6128 \begin_layout Plain Layout
6129 .sty
6130 \end_layout
6131
6132 \end_inset
6133
6134 ) files.
6135  Supporting a style file is usually fairly easy.
6136  Supporting a new class file is a bit harder.
6137  We'll discuss the former in this section and the latter in the next.
6138  Similar remarks apply, of course, if you want to support a new DocBook
6139  DTD.
6140 \end_layout
6141
6142 \begin_layout Standard
6143 The easier case is the one in which your new document class is provided
6144  as a style file that is to be used in conjunction with an already supported
6145  document class.
6146  For the sake of the example, we'll assume that the style file is called
6147  
6148 \begin_inset Flex CharStyle:MenuItem
6149 status collapsed
6150
6151 \begin_layout Plain Layout
6152 myclass.sty
6153 \end_layout
6154
6155 \end_inset
6156
6157  and that it is meant to be used with 
6158 \begin_inset Flex CharStyle:MenuItem
6159 status collapsed
6160
6161 \begin_layout Plain Layout
6162 report.cls
6163 \end_layout
6164
6165 \end_inset
6166
6167 , which is a standard class.
6168  
6169 \end_layout
6170
6171 \begin_layout Standard
6172 Start by copying the existing class's layout file into your local directory:
6173 \begin_inset Foot
6174 status collapsed
6175
6176 \begin_layout Plain Layout
6177 Of course, which directory is your local directory will vary by platform,
6178  and LyX allows you to specify your local directory on startup, too, using
6179  the 
6180 \begin_inset Flex CharStyle:Code
6181 status collapsed
6182
6183 \begin_layout Plain Layout
6184 -userdir
6185 \end_layout
6186
6187 \end_inset
6188
6189  option.
6190 \end_layout
6191
6192 \end_inset
6193
6194
6195 \end_layout
6196
6197 \begin_layout LyX-Code
6198 cp report.layout ~/.lyx/layouts/myclass.layout
6199 \end_layout
6200
6201 \begin_layout Standard
6202 Then edit 
6203 \begin_inset Flex CharStyle:Code
6204 status collapsed
6205
6206 \begin_layout Plain Layout
6207 myclass.layout
6208 \end_layout
6209
6210 \end_inset
6211
6212  and change the line: 
6213 \end_layout
6214
6215 \begin_layout LyX-Code
6216
6217 \backslash
6218 DeclareLaTeXClass{report}
6219 \end_layout
6220
6221 \begin_layout Standard
6222 to read
6223 \end_layout
6224
6225 \begin_layout LyX-Code
6226
6227 \backslash
6228 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6229 \end_layout
6230
6231 \begin_layout Standard
6232 Then add:
6233 \end_layout
6234
6235 \begin_layout LyX-Code
6236 Preamble 
6237 \begin_inset Newline newline
6238 \end_inset
6239
6240     
6241 \backslash
6242 usepackage{myclass}
6243 \begin_inset Newline newline
6244 \end_inset
6245
6246 EndPreamble
6247 \end_layout
6248
6249 \begin_layout Standard
6250 near the top of the file.
6251 \end_layout
6252
6253 \begin_layout Standard
6254 Start LyX and select 
6255 \begin_inset Flex CharStyle:MenuItem
6256 status collapsed
6257
6258 \begin_layout Plain Layout
6259 Tools\SpecialChar \menuseparator
6260 Reconfigure
6261 \end_layout
6262
6263 \end_inset
6264
6265 .
6266  Then restart LyX and try creating a new document.
6267  You should see "
6268 \begin_inset Flex CharStyle:MenuItem
6269 status collapsed
6270
6271 \begin_layout Plain Layout
6272 report (myclass)
6273 \end_layout
6274
6275 \end_inset
6276
6277 " as a document class option in the 
6278 \begin_inset Flex CharStyle:MenuItem
6279 status collapsed
6280
6281 \begin_layout Plain Layout
6282 Document\SpecialChar \menuseparator
6283 Settings
6284 \end_layout
6285
6286 \end_inset
6287
6288  dialog.
6289  It is likely that some of the sectioning commands and such in your new
6290  class will work differently from how they worked in the base class—
6291 \begin_inset Flex CharStyle:Code
6292 status collapsed
6293
6294 \begin_layout Plain Layout
6295 report
6296 \end_layout
6297
6298 \end_inset
6299
6300  in this example—so you can fiddle around with the settings for the different
6301  sections if you wish.
6302  The layout information for sections is contained in 
6303 \begin_inset Flex CharStyle:Code
6304 status collapsed
6305
6306 \begin_layout Plain Layout
6307 stdsections.inc
6308 \end_layout
6309
6310 \end_inset
6311
6312 , but you do not need to copy and change this file.
6313  Instead, you can simply add your changes to your layout file, after the
6314  line 
6315 \begin_inset Flex CharStyle:Code
6316 status collapsed
6317
6318 \begin_layout Plain Layout
6319 Input stdclass.inc
6320 \end_layout
6321
6322 \end_inset
6323
6324 , which itself includes 
6325 \begin_inset Flex CharStyle:Code
6326 status collapsed
6327
6328 \begin_layout Plain Layout
6329 stdsections.inc
6330 \end_layout
6331
6332 \end_inset
6333
6334 .
6335  For example, you might add these lines:
6336 \end_layout
6337
6338 \begin_layout LyX-Code
6339 Style Chapter
6340 \end_layout
6341
6342 \begin_layout LyX-Code
6343     Font
6344 \end_layout
6345
6346 \begin_layout LyX-Code
6347         Family Sans
6348 \end_layout
6349
6350 \begin_layout LyX-Code
6351     EndFont
6352 \end_layout
6353
6354 \begin_layout LyX-Code
6355 End
6356 \end_layout
6357
6358 \begin_layout Standard
6359 to change the font for chapter headings to sans-serif.
6360  This will override (or, in this case, add to) the existing declaration
6361  for the Chapter style.
6362  
6363 \end_layout
6364
6365 \begin_layout Standard
6366 Your new package may also provide commands or environments not present in
6367  the base class.
6368  In this case, you will want to add these to the layout file.
6369  See 
6370 \begin_inset CommandInset ref
6371 LatexCommand ref
6372 reference "sec:TextClass"
6373
6374 \end_inset
6375
6376  for information on how to do so.
6377 \end_layout
6378
6379 \begin_layout Standard
6380 If 
6381 \begin_inset Flex CharStyle:MenuItem
6382 status collapsed
6383
6384 \begin_layout Plain Layout
6385 myclass.sty
6386 \end_layout
6387
6388 \end_inset
6389
6390  can be used with several different document classes, and even if it cannot,
6391  you might find it easiest just to write a module that you can load with
6392  the base class.
6393  The simplest possible such module would be:
6394 \end_layout
6395
6396 \begin_layout LyX-Code
6397 #
6398 \backslash
6399 DeclareLyXModule{My Package} 
6400 \end_layout
6401
6402 \begin_layout LyX-Code
6403 #DescriptionBegin 
6404 \end_layout
6405
6406 \begin_layout LyX-Code
6407 #Support for mypkg.sty.
6408 \end_layout
6409
6410 \begin_layout LyX-Code
6411 #DescriptionEnd 
6412 \begin_inset Newline newline
6413 \end_inset
6414
6415
6416 \end_layout
6417
6418 \begin_layout LyX-Code
6419 Format 21
6420 \begin_inset Newline newline
6421 \end_inset
6422
6423
6424 \end_layout
6425
6426 \begin_layout LyX-Code
6427 Preamble
6428 \begin_inset Newline newline
6429 \end_inset
6430
6431     
6432 \backslash
6433 usepackage{mypkg}
6434 \begin_inset Newline newline
6435 \end_inset
6436
6437 EndPreamble
6438 \end_layout
6439
6440 \begin_layout Standard
6441 A more complex module might modify the behavior of some existing constructs
6442  or define some new ones.
6443  Again, see 
6444 \begin_inset CommandInset ref
6445 LatexCommand ref
6446 reference "sec:TextClass"
6447
6448 \end_inset
6449
6450  for discussion.
6451 \end_layout
6452
6453 \begin_layout Subsection
6454 Layout for 
6455 \begin_inset Flex CharStyle:MenuItem
6456 status collapsed
6457
6458 \begin_layout Plain Layout
6459 .cls
6460 \end_layout
6461
6462 \end_inset
6463
6464  files
6465 \end_layout
6466
6467 \begin_layout Standard
6468 There are two possibilities here.
6469  One is that the class file is itself based upon an existing document class.
6470  For example, many thesis classes are based upon 
6471 \begin_inset Flex CharStyle:MenuItem
6472 status collapsed
6473
6474 \begin_layout Plain Layout
6475 book.cls
6476 \end_layout
6477
6478 \end_inset
6479
6480 .
6481  To see whether yours is, look for a line like
6482 \end_layout
6483
6484 \begin_layout LyX-Code
6485
6486 \backslash
6487 LoadClass{book}
6488 \end_layout
6489
6490 \begin_layout Standard
6491 in the file.
6492  If so, then you may proceed largely as in the previous section, though
6493  the 
6494 \begin_inset Flex CharStyle:Code
6495 status collapsed
6496
6497 \begin_layout Plain Layout
6498 DeclareLaTeXClass
6499 \end_layout
6500
6501 \end_inset
6502
6503  line will be different.
6504  If your new class is 
6505 \begin_inset Flex CharStyle:Code
6506 status collapsed
6507
6508 \begin_layout Plain Layout
6509 thesis
6510 \end_layout
6511
6512 \end_inset
6513
6514  and it is based upon 
6515 \begin_inset Flex CharStyle:Code
6516 status collapsed
6517
6518 \begin_layout Plain Layout
6519 book
6520 \end_layout
6521
6522 \end_inset
6523
6524 , then the line should read:
6525 \begin_inset Foot
6526 status collapsed
6527
6528 \begin_layout Plain Layout
6529 And it will be easiest if you save the file to 
6530 \begin_inset Flex CharStyle:Code
6531 status collapsed
6532
6533 \begin_layout Plain Layout
6534 thesis.layout
6535 \end_layout
6536
6537 \end_inset
6538
6539 : LyX assumes that the document class has the same name as the layout file.
6540  
6541 \end_layout
6542
6543 \end_inset
6544
6545
6546 \end_layout
6547
6548 \begin_layout LyX-Code
6549
6550 \backslash
6551 DeclareLaTeXClass[thesis,book]{thesis}
6552 \end_layout
6553
6554 \begin_layout Standard
6555 If, on the other hand, the new class is not based upon an existing class,
6556  you will probably have to 
6557 \begin_inset Quotes eld
6558 \end_inset
6559
6560 roll your own
6561 \begin_inset Quotes erd
6562 \end_inset
6563
6564  layout.
6565  We strongly suggest copying an existing layout file which uses a similar
6566  LaTeX class and then modifying it, if you can do so.
6567  At least use an existing file as a starting point so you can find out what
6568  items you need to worry about.
6569  Again, the specifics are covered below.
6570 \end_layout
6571
6572 \begin_layout Subsection
6573 Creating templates
6574 \begin_inset CommandInset label
6575 LatexCommand label
6576 name "sub:Creating-Templates"
6577
6578 \end_inset
6579
6580
6581 \end_layout
6582
6583 \begin_layout Standard
6584 Once you have written a layout file for a new document class, you might
6585  want to consider writing a 
6586 \emph on
6587 template
6588 \emph default
6589  for it, too.
6590  A template acts as a kind of tutorial for your layout, showing how it might
6591  be used, though containing dummy content.
6592  You can of course look at the various templates included with LyX for ideas.
6593 \end_layout
6594
6595 \begin_layout Standard
6596 Templates are created just like usual documents: using LyX.
6597  The only difference is that usual documents contain all possible settings,
6598  including the font scheme and the paper size.
6599  Usually a user doesn't want a template to overwrite his preferred settings
6600  for such parameters.
6601  For that reason, the designer of a template should remove the corresponding
6602  commands like 
6603 \begin_inset Flex CharStyle:Code
6604 status collapsed
6605
6606 \begin_layout Plain Layout
6607
6608 \backslash
6609 font_roman
6610 \end_layout
6611
6612 \end_inset
6613
6614  or 
6615 \begin_inset Flex CharStyle:Code
6616 status collapsed
6617
6618 \begin_layout Plain Layout
6619
6620 \backslash
6621 papersize
6622 \end_layout
6623
6624 \end_inset
6625
6626  from the template LyX file.
6627  This can be done with any simple text-editor, for example 
6628 \begin_inset Flex CharStyle:Code
6629 status collapsed
6630
6631 \begin_layout Plain Layout
6632 vi
6633 \end_layout
6634
6635 \end_inset
6636
6637  or 
6638 \begin_inset Flex CharStyle:Code
6639 status collapsed
6640
6641 \begin_layout Plain Layout
6642 notepad
6643 \end_layout
6644
6645 \end_inset
6646
6647 .
6648  
6649 \end_layout
6650
6651 \begin_layout Standard
6652 Put the edited template files you create in 
6653 \begin_inset Flex CharStyle:Code
6654 status collapsed
6655
6656 \begin_layout Plain Layout
6657 UserDir/templates/
6658 \end_layout
6659
6660 \end_inset
6661
6662 , copy the ones you use from the global template directory in 
6663 \begin_inset Flex CharStyle:Code
6664 status collapsed
6665
6666 \begin_layout Plain Layout
6667 LyXDir/templates/
6668 \end_layout
6669
6670 \end_inset
6671
6672  to the same place, and redefine the template path in the 
6673 \begin_inset Flex CharStyle:MenuItem
6674 status collapsed
6675
6676 \begin_layout Plain Layout
6677 Tools\SpecialChar \menuseparator
6678 Preferences\SpecialChar \menuseparator
6679 Paths
6680 \end_layout
6681
6682 \end_inset
6683
6684  dialog.
6685 \end_layout
6686
6687 \begin_layout Standard
6688 Note, by the way, that there is a template which has a particular meaning:
6689  
6690 \begin_inset Flex CharStyle:Code
6691 status collapsed
6692
6693 \begin_layout Plain Layout
6694 defaults.lyx
6695 \end_layout
6696
6697 \end_inset
6698
6699 .
6700  This template is loaded every time you create a new document with 
6701 \begin_inset Flex CharStyle:MenuItem
6702 status collapsed
6703
6704 \begin_layout Plain Layout
6705 File\SpecialChar \menuseparator
6706 New
6707 \end_layout
6708
6709 \end_inset
6710
6711  in order to provide useful defaults.
6712  To create this template from inside LyX, all you have to do is to open
6713  a document with the correct settings, and use the 
6714 \begin_inset Flex CharStyle:MenuItem
6715 status collapsed
6716
6717 \begin_layout Plain Layout
6718 Save as Document Defaults
6719 \end_layout
6720
6721 \end_inset
6722
6723  button.
6724 \end_layout
6725
6726 \begin_layout Subsection
6727 Upgrading old layout files
6728 \end_layout
6729
6730 \begin_layout Standard
6731 The format of layout files changes with each LyX release, so old layout
6732  files need to be converted to the new format.
6733  This process has been automated since LyX 1.4: If LyX reads a layout file
6734  in an older format, it automatically calls the script 
6735 \begin_inset Flex CharStyle:Code
6736 status collapsed
6737
6738 \begin_layout Plain Layout
6739 layout2layout.py
6740 \end_layout
6741
6742 \end_inset
6743
6744  to convert it to a temporary file in current format.
6745  The original file is left untouched.
6746  If you use the layout file often, then, you may want to convert it permanently,
6747  so that LyX does not have to do so itself every time.
6748  To do this, you can call the converter manually:
6749 \end_layout
6750
6751 \begin_layout LyX-Code
6752 mv myclass.layout myclass.old
6753 \end_layout
6754
6755 \begin_layout LyX-Code
6756 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6757 \end_layout
6758
6759 \begin_layout Standard
6760 You need to replace 
6761 \begin_inset Flex CharStyle:Code
6762 status collapsed
6763
6764 \begin_layout Plain Layout
6765 LyXDir
6766 \end_layout
6767
6768 \end_inset
6769
6770  with the name of your LyX system directory, of course.
6771 \end_layout
6772
6773 \begin_layout Standard
6774 Note that manual conversion does not affect included files, so these will
6775  have to be converted separately.
6776 \end_layout
6777
6778 \begin_layout Section
6779 \begin_inset CommandInset label
6780 LatexCommand label
6781 name "sec:TextClass"
6782
6783 \end_inset
6784
6785 The layout file format
6786 \end_layout
6787
6788 \begin_layout Standard
6789 When it's finally time to get your hands dirty and create or edit your own
6790  layout file, the following sections describe what you're up against.
6791  Our advice is to go slowly, save and test often, listen to soothing music,
6792  and enjoy one or two of your favorite adult beverages; more if you are
6793  getting particularly stuck.
6794  It's really not that hard, except that the multitude of options can become
6795  overwhelming if you try to do too much in one sitting.
6796  Go have another adult beverage, just for good measure.
6797 \end_layout
6798
6799 \begin_layout Standard
6800 Note that all the tags used in layout files are case-insensitive.
6801  This means that 
6802 \begin_inset Flex CharStyle:Code
6803 status collapsed
6804
6805 \begin_layout Plain Layout
6806 Style
6807 \end_layout
6808
6809 \end_inset
6810
6811
6812 \begin_inset Flex CharStyle:Code
6813 status collapsed
6814
6815 \begin_layout Plain Layout
6816 style
6817 \end_layout
6818
6819 \end_inset
6820
6821  and 
6822 \begin_inset Flex CharStyle:Code
6823 status collapsed
6824
6825 \begin_layout Plain Layout
6826 StYlE
6827 \end_layout
6828
6829 \end_inset
6830
6831  are really the same tag.
6832  The possible values are printed in brackets after the feature's name.
6833  The default value if a feature isn't specified inside a text class-description
6834  is typeset 
6835 \begin_inset Flex CharStyle:Code
6836 status collapsed
6837
6838 \begin_layout Plain Layout
6839
6840 \emph on
6841 emphasized
6842 \end_layout
6843
6844 \end_inset
6845
6846 .
6847  If the argument has a data type like 
6848 \begin_inset Quotes eld
6849 \end_inset
6850
6851 string
6852 \begin_inset Quotes erd
6853 \end_inset
6854
6855  or 
6856 \begin_inset Quotes eld
6857 \end_inset
6858
6859 float
6860 \begin_inset Quotes erd
6861 \end_inset
6862
6863 , the default is shown like this: 
6864 \begin_inset Flex CharStyle:Code
6865 status collapsed
6866
6867 \begin_layout Plain Layout
6868 float=
6869 \emph on
6870 default
6871 \end_layout
6872
6873 \end_inset
6874
6875 .
6876 \end_layout
6877
6878 \begin_layout Subsection
6879 The Document Class Declaration
6880 \end_layout
6881
6882 \begin_layout Standard
6883 Lines in a layout file which begin with 
6884 \begin_inset Flex CharStyle:Code
6885 status collapsed
6886
6887 \begin_layout Plain Layout
6888 #
6889 \end_layout
6890
6891 \end_inset
6892
6893  are comments.
6894  There is one exception to this rule.
6895  All 
6896 \begin_inset Flex CharStyle:Code
6897 status collapsed
6898
6899 \begin_layout Plain Layout
6900 *.layout
6901 \end_layout
6902
6903 \end_inset
6904
6905  files should begin with a line like:
6906 \end_layout
6907
6908 \begin_layout LyX-Code
6909
6910 \size small
6911 #% Do not delete the line below; configure depends on this 
6912 \end_layout
6913
6914 \begin_layout LyX-Code
6915
6916 \size small
6917 #  
6918 \backslash
6919 DeclareLaTeXClass{article}
6920 \end_layout
6921
6922 \begin_layout Standard
6923 The second line is used when you (re)configure LyX.
6924  The layout file is read by the LaTeX script 
6925 \begin_inset Flex CharStyle:Code
6926 status collapsed
6927
6928 \begin_layout Plain Layout
6929 chkconfig.ltx
6930 \end_layout
6931
6932 \end_inset
6933
6934 , in a special mode where 
6935 \begin_inset Flex CharStyle:Code
6936 status collapsed
6937
6938 \begin_layout Plain Layout
6939 #
6940 \end_layout
6941
6942 \end_inset
6943
6944  is ignored.
6945  The first line is just a LaTeX comment, and the second one contains the
6946  declaration of the text class.
6947  If these lines appear in a file named 
6948 \begin_inset Flex CharStyle:Code
6949 status collapsed
6950
6951 \begin_layout Plain Layout
6952 article.layout
6953 \end_layout
6954
6955 \end_inset
6956
6957 , then they define a text class of name 
6958 \begin_inset Flex CharStyle:Code
6959 status collapsed
6960
6961 \begin_layout Plain Layout
6962 article
6963 \end_layout
6964
6965 \end_inset
6966
6967  (the name of the layout file) which uses the LaTeX document class 
6968 \begin_inset Flex CharStyle:Code
6969 status collapsed
6970
6971 \begin_layout Plain Layout
6972 article.cls
6973 \end_layout
6974
6975 \end_inset
6976
6977  (the default is to use the same name as the layout).
6978  The string 
6979 \begin_inset Quotes eld
6980 \end_inset
6981
6982 article
6983 \begin_inset Quotes erd
6984 \end_inset
6985
6986  that appears above is used as a description of the text class in the 
6987 \begin_inset Flex CharStyle:MenuItem
6988 status collapsed
6989
6990 \begin_layout Plain Layout
6991 Document\SpecialChar \menuseparator
6992 Settings
6993 \end_layout
6994
6995 \end_inset
6996
6997  dialog.
6998 \end_layout
6999
7000 \begin_layout Standard
7001 Let's assume that you wrote your own text class that uses the 
7002 \begin_inset Flex CharStyle:Code
7003 status collapsed
7004
7005 \begin_layout Plain Layout
7006 article.cls
7007 \end_layout
7008
7009 \end_inset
7010
7011  document class, but where you changed the appearance of the section headings.
7012  If you put it in a file 
7013 \begin_inset Flex CharStyle:Code
7014 status collapsed
7015
7016 \begin_layout Plain Layout
7017 myarticle.layout
7018 \end_layout
7019
7020 \end_inset
7021
7022 , the header of this file should be:
7023 \end_layout
7024
7025 \begin_layout LyX-Code
7026
7027 \size small
7028 #% Do not delete the line below; configure depends on this 
7029 \end_layout
7030
7031 \begin_layout LyX-Code
7032
7033 \size small
7034 #  
7035 \backslash
7036 DeclareLaTeXClass[article]{article (with my own headings)}
7037 \end_layout
7038
7039 \begin_layout Standard
7040 This declares a text class 
7041 \begin_inset Flex CharStyle:Code
7042 status collapsed
7043
7044 \begin_layout Plain Layout
7045 myarticle
7046 \end_layout
7047
7048 \end_inset
7049
7050 , associated with the LaTeX document class 
7051 \begin_inset Flex CharStyle:Code
7052 status collapsed
7053
7054 \begin_layout Plain Layout
7055 article.cls
7056 \end_layout
7057
7058 \end_inset
7059
7060  and described as 
7061 \begin_inset Quotes eld
7062 \end_inset
7063
7064 article (with my own headings)
7065 \begin_inset Quotes erd
7066 \end_inset
7067
7068 .
7069  If your text class depends on several packages, you can declare it as:
7070 \end_layout
7071
7072 \begin_layout LyX-Code
7073
7074 \size small
7075 #% Do not delete the line below; configure depends on this 
7076 \end_layout
7077
7078 \begin_layout LyX-Code
7079
7080 \size small
7081 #  
7082 \backslash
7083 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7084 \end_layout
7085
7086 \begin_layout Standard
7087 This indicates that your text class uses the 
7088 \begin_inset Flex CharStyle:Code
7089 status collapsed
7090
7091 \begin_layout Plain Layout
7092 foo.sty
7093 \end_layout
7094
7095 \end_inset
7096
7097  package.
7098  Finally, it is also possible to declare classes for DocBook code.
7099  Typical declarations will look like:
7100 \end_layout
7101
7102 \begin_layout LyX-Code
7103
7104 \size small
7105 #% Do not delete the line below; configure depends on this 
7106 \end_layout
7107
7108 \begin_layout LyX-Code
7109
7110 \size small
7111
7112 \backslash
7113 DeclareDocBookClass[article]{SGML (DocBook article)}
7114 \end_layout
7115
7116 \begin_layout Standard
7117 Note that these declarations can also be given an optional parameter declaring
7118  the name of the document class (but not a list).
7119 \end_layout
7120
7121 \begin_layout Standard
7122 So, to be as explicit as possible, the form of the layout declaration is:
7123 \end_layout
7124
7125 \begin_layout LyX-Code
7126
7127 \size small
7128 #  
7129 \backslash
7130 DeclareLaTeXClass[class,package.sty]{layout description}
7131 \end_layout
7132
7133 \begin_layout Standard
7134 The class need only be specified if the name of the LaTeX class file and
7135  the name of the layout file are different; if the name of the class file
7136  is not specified, then LyX will simply assume that it is the same as the
7137  name of the layout file.
7138 \end_layout
7139
7140 \begin_layout Standard
7141 When the text class has been modified to your taste, all you have to do
7142  is to copy it either to 
7143 \begin_inset Flex CharStyle:Code
7144 status collapsed
7145
7146 \begin_layout Plain Layout
7147 LyXDir/layouts/
7148 \end_layout
7149
7150 \end_inset
7151
7152  or to 
7153 \begin_inset Flex CharStyle:Code
7154 status collapsed
7155
7156 \begin_layout Plain Layout
7157 UserDir/layouts
7158 \end_layout
7159
7160 \end_inset
7161
7162 , run 
7163 \begin_inset Flex CharStyle:MenuItem
7164 status collapsed
7165
7166 \begin_layout Plain Layout
7167 Tools\SpecialChar \menuseparator
7168 Reconfigure
7169 \end_layout
7170
7171 \end_inset
7172
7173 , exit LyX and restart.
7174  Then your new text class should be available along with the others.
7175 \end_layout
7176
7177 \begin_layout Standard
7178 Once the layout file is installed, you can edit it and see your changes
7179  without having to reconfigure or to restart LyX.
7180  
7181 \begin_inset Foot
7182 status collapsed
7183
7184 \begin_layout Plain Layout
7185 In versions of LyX prior to 1.6, this was not true.
7186  As a result, editing layout files was very time consuming, since you had
7187  constantly to restart LyX to see changes.
7188 \end_layout
7189
7190 \end_inset
7191
7192  You can force a reload of the current layout by using the LyX function
7193  
7194 \begin_inset Flex CharStyle:MenuItem
7195 status collapsed
7196
7197 \begin_layout Plain Layout
7198 layout-reload
7199 \end_layout
7200
7201 \end_inset
7202
7203 .
7204  There is no default binding for this function—though, of course, you can
7205  bind it to a key yourself.
7206  But you will normally use this function simply by entering it in the mini-buffe
7207 r.
7208  
7209 \end_layout
7210
7211 \begin_layout Standard
7212
7213 \emph on
7214 Warning
7215 \emph default
7216
7217 \begin_inset Flex CharStyle:MenuItem
7218 status collapsed
7219
7220 \begin_layout Plain Layout
7221 layout-reload
7222 \end_layout
7223
7224 \end_inset
7225
7226  is very much an `advanced feature'.
7227  It is 
7228 \emph on
7229 strongly
7230 \emph default
7231  recommended that you save your work before using this function.
7232  In fact, it is 
7233 \emph on
7234 strongly
7235 \emph default
7236  recommended that you not attempt to edit layout information while simultaneousl
7237 y working on a document that you care about.
7238  Use a test document.
7239  Syntax errors and the like in your layout file could cause peculiar behavior.
7240  In particular, such errors could cause LyX to regard the current layout
7241  as invalid and to attempt to switch to some other layout.
7242 \begin_inset Foot
7243 status collapsed
7244
7245 \begin_layout Plain Layout
7246 Really bad syntax errors may even caused LyX to exit.
7247  This is because certain sorts of errors may make LyX unable to read 
7248 \emph on
7249 any
7250 \emph default
7251  layout information.
7252  Please be careful.
7253 \end_layout
7254
7255 \end_inset
7256
7257  The LyX team strives to keep LyX stable in such situations, but safe is
7258  better than sorry.
7259 \begin_inset Foot
7260 status collapsed
7261
7262 \begin_layout Plain Layout
7263 While we're giving advice: make regular backups.
7264  And be nice to your mother.
7265 \end_layout
7266
7267 \end_inset
7268
7269
7270 \end_layout
7271
7272 \begin_layout Subsection
7273 The Module Declaration
7274 \end_layout
7275
7276 \begin_layout Standard
7277 A module must begin with a line like the following:
7278 \end_layout
7279
7280 \begin_layout LyX-Code
7281 #
7282 \backslash
7283 DeclareLyXModule[endnotes.sty]{Endnotes} 
7284 \end_layout
7285
7286 \begin_layout Standard
7287 The mandatory argument, in curly brackets, is the name of the module, as
7288  it should appear in 
7289 \begin_inset Flex CharStyle:MenuItem
7290 status collapsed
7291
7292 \begin_layout Plain Layout
7293 Document\SpecialChar \menuseparator
7294 Settings
7295 \end_layout
7296
7297 \end_inset
7298
7299 .
7300  The argument in square brackets is optional: It declares any LaTeX packages
7301  on which the module depends.
7302  Please note that only packages about which LyX knows should be listed in
7303  the square brackets.
7304 \begin_inset Foot
7305 status collapsed
7306
7307 \begin_layout Plain Layout
7308 The list of such packages is documented only in the source code.
7309 \end_layout
7310
7311 \end_inset
7312
7313  LyX will not check for arbitrary packages.
7314  It is also possible to use the form 
7315 \begin_inset Flex CharStyle:MenuItem
7316 status collapsed
7317
7318 \begin_layout Plain Layout
7319 from->to
7320 \end_layout
7321
7322 \end_inset
7323
7324  as an optional argument, which declares that the module can only be used
7325  when there exists a conversion chain between the formats `
7326 \begin_inset Flex CharStyle:Code
7327 status collapsed
7328
7329 \begin_layout Plain Layout
7330 from
7331 \end_layout
7332
7333 \end_inset
7334
7335 ' and `
7336 \begin_inset Flex CharStyle:Code
7337 status collapsed
7338
7339 \begin_layout Plain Layout
7340 to
7341 \end_layout
7342
7343 \end_inset
7344
7345 '.
7346 \end_layout
7347
7348 \begin_layout Standard
7349 The module declaration should then be followed by lines like the following:
7350 \end_layout
7351
7352 \begin_layout LyX-Code
7353 #DescriptionBegin 
7354 \end_layout
7355
7356 \begin_layout LyX-Code
7357 #Adds an endnote command, in addition to footnotes.
7358  
7359 \end_layout
7360
7361 \begin_layout LyX-Code
7362 #You will need to add  
7363 \backslash
7364 theendnotes in TeX code where you 
7365 \end_layout
7366
7367 \begin_layout LyX-Code
7368 #want the endnotes to appear.
7369  
7370 \end_layout
7371
7372 \begin_layout LyX-Code
7373 #DescriptionEnd 
7374 \end_layout
7375
7376 \begin_layout LyX-Code
7377 #Requires: somemodule | othermodule
7378 \end_layout
7379
7380 \begin_layout LyX-Code
7381 #Excludes: badmodule
7382 \end_layout
7383
7384 \begin_layout Standard
7385 The description is used in 
7386 \begin_inset Flex CharStyle:MenuItem
7387 status collapsed
7388
7389 \begin_layout Plain Layout
7390 Document\SpecialChar \menuseparator
7391 Settings
7392 \end_layout
7393
7394 \end_inset
7395
7396  to provide the user with information about what the module does.
7397  The 
7398 \begin_inset Flex CharStyle:Code
7399 status collapsed
7400
7401 \begin_layout Plain Layout
7402 Requires
7403 \end_layout
7404
7405 \end_inset
7406
7407  line is used to identify other modules with which this one must be used;
7408  the 
7409 \begin_inset Flex CharStyle:Code
7410 status collapsed
7411
7412 \begin_layout Plain Layout
7413 Excludes
7414 \end_layout
7415
7416 \end_inset
7417
7418  line is used to identify modules with which this one may not be used.
7419  Both are optional, and, as shown, multiple modules should be separated
7420  with the pipe symbol: |.
7421  Note that the required modules are treated disjunctively: 
7422 \emph on
7423 at least one
7424 \emph default
7425  of the required modules must be used.
7426  Similarly, 
7427 \emph on
7428 no
7429 \emph default
7430  excluded module may be used.
7431  Note that modules are identified here by their 
7432 \emph on
7433 filenames
7434 \emph default
7435  without the 
7436 \begin_inset Flex CharStyle:Code
7437 status collapsed
7438
7439 \begin_layout Plain Layout
7440 .module
7441 \end_layout
7442
7443 \end_inset
7444
7445  extension.
7446  So 
7447 \begin_inset Flex CharStyle:Code
7448 status collapsed
7449
7450 \begin_layout Plain Layout
7451 somemodule
7452 \end_layout
7453
7454 \end_inset
7455
7456  is really 
7457 \begin_inset Flex CharStyle:Code
7458 status collapsed
7459
7460 \begin_layout Plain Layout
7461 somemodule.module
7462 \end_layout
7463
7464 \end_inset
7465
7466 .
7467 \end_layout
7468
7469 \begin_layout Subsection
7470 File format
7471 \end_layout
7472
7473 \begin_layout Standard
7474 The first non-comment line of any layout file, included file, or module
7475  
7476 \emph on
7477 must
7478 \emph default
7479  contain the file format number:
7480 \end_layout
7481
7482 \begin_layout Description
7483 \begin_inset Flex CharStyle:Code
7484 status collapsed
7485
7486 \begin_layout Plain Layout
7487 Format
7488 \end_layout
7489
7490 \end_inset
7491
7492  [
7493 \begin_inset Flex CharStyle:Code
7494 status collapsed
7495
7496 \begin_layout Plain Layout
7497 int
7498 \end_layout
7499
7500 \end_inset
7501
7502 ] The format of the layout file.
7503 \end_layout
7504
7505 \begin_layout Standard
7506 This tag was introduced with LyX 1.4.0.
7507  Layout files from LyX 1.3.x and earlier don't have an explicit file format
7508  and are considered to be of format 1.
7509  The format for the present version of LyX is format 21.
7510  But each version of LyX is capable of reading earlier versions' layout
7511  files, just as they are capable of reading files produced by earlier versions
7512  of LyX.
7513  There is, however, no provision for converting to earlier formats.
7514  So LyX 1.6.x will not read layout files in format 21 but only files in format
7515  11 or earlier.
7516 \end_layout
7517
7518 \begin_layout Subsection
7519 \begin_inset CommandInset label
7520 LatexCommand label
7521 name "sub:General-text-class"
7522
7523 \end_inset
7524
7525 General text class parameters
7526 \end_layout
7527
7528 \begin_layout Standard
7529 These are general parameters that govern the behavior of an entire document
7530  class.
7531  (This does 
7532 \emph on
7533 not
7534 \emph default
7535  mean that they must appear in 
7536 \begin_inset Flex CharStyle:Code
7537 status collapsed
7538
7539 \begin_layout Plain Layout
7540 .layout
7541 \end_layout
7542
7543 \end_inset
7544
7545  files rather than in modules.
7546  A module can contain any layout tag.)
7547 \end_layout
7548
7549 \begin_layout Description
7550 \begin_inset Flex CharStyle:Code
7551 status collapsed
7552
7553 \begin_layout Plain Layout
7554 AddToHTMLPreamble
7555 \end_layout
7556
7557 \end_inset
7558
7559  Adds information that will be output in the 
7560 \begin_inset Flex CharStyle:Code
7561 status collapsed
7562
7563 \begin_layout Plain Layout
7564 <head>
7565 \end_layout
7566
7567 \end_inset
7568
7569  block when this document class is output to XHTML.
7570  Typically, this would be used to output CSS style information, but it can
7571  be used for anything that can appear in 
7572 \begin_inset Flex CharStyle:Code
7573 status collapsed
7574
7575 \begin_layout Plain Layout
7576 <head>
7577 \end_layout
7578
7579 \end_inset
7580
7581 .
7582  Must end with 
7583 \begin_inset Quotes eld
7584 \end_inset
7585
7586
7587 \begin_inset Flex CharStyle:Code
7588 status collapsed
7589
7590 \begin_layout Plain Layout
7591 EndPreamble
7592 \end_layout
7593
7594 \end_inset
7595
7596
7597 \begin_inset Quotes erd
7598 \end_inset
7599
7600 .
7601 \end_layout
7602
7603 \begin_layout Description
7604 \begin_inset Flex CharStyle:Code
7605 status collapsed
7606
7607 \begin_layout Plain Layout
7608 AddToPreamble
7609 \end_layout
7610
7611 \end_inset
7612
7613  Adds information to the document preamble.
7614  Must end with 
7615 \begin_inset Quotes eld
7616 \end_inset
7617
7618
7619 \begin_inset Flex CharStyle:Code
7620 status collapsed
7621
7622 \begin_layout Plain Layout
7623 EndPreamble
7624 \end_layout
7625
7626 \end_inset
7627
7628
7629 \begin_inset Quotes erd
7630 \end_inset
7631
7632 .
7633 \end_layout
7634
7635 \begin_layout Description
7636 \begin_inset Flex CharStyle:Code
7637 status collapsed
7638
7639 \begin_layout Plain Layout
7640 ClassOptions
7641 \end_layout
7642
7643 \end_inset
7644
7645  Describes various global options supported by the document class.
7646  See Section
7647 \begin_inset space ~
7648 \end_inset
7649
7650
7651 \begin_inset CommandInset ref
7652 LatexCommand ref
7653 reference "sub:ClassOptions"
7654
7655 \end_inset
7656
7657  for a description.
7658  Must end with 
7659 \begin_inset Quotes eld
7660 \end_inset
7661
7662
7663 \begin_inset Flex CharStyle:Code
7664 status collapsed
7665
7666 \begin_layout Plain Layout
7667 End
7668 \end_layout
7669
7670 \end_inset
7671
7672
7673 \begin_inset Quotes erd
7674 \end_inset
7675
7676 .
7677 \end_layout
7678
7679 \begin_layout Description
7680 \begin_inset Flex CharStyle:Code
7681 status collapsed
7682
7683 \begin_layout Plain Layout
7684 Columns
7685 \end_layout
7686
7687 \end_inset
7688
7689  [
7690 \begin_inset Flex CharStyle:Code
7691 status collapsed
7692
7693 \begin_layout Plain Layout
7694
7695 \emph on
7696 1
7697 \end_layout
7698
7699 \end_inset
7700
7701
7702 \begin_inset Flex CharStyle:Code
7703 status collapsed
7704
7705 \begin_layout Plain Layout
7706 2
7707 \end_layout
7708
7709 \end_inset
7710
7711 ] Whether the class should 
7712 \emph on
7713 default
7714 \emph default
7715  to having one or two columns.
7716  Can be changed in the 
7717 \begin_inset Flex CharStyle:MenuItem
7718 status collapsed
7719
7720 \begin_layout Plain Layout
7721 Document\SpecialChar \menuseparator
7722 Settings
7723 \end_layout
7724
7725 \end_inset
7726
7727  dialog.
7728 \end_layout
7729
7730 \begin_layout Description
7731 \begin_inset Flex CharStyle:Code
7732 status collapsed
7733
7734 \begin_layout Plain Layout
7735 Counter
7736 \end_layout
7737
7738 \end_inset
7739
7740  [
7741 \begin_inset Flex CharStyle:Code
7742 status collapsed
7743
7744 \begin_layout Plain Layout
7745 string
7746 \end_layout
7747
7748 \end_inset
7749
7750 ] This sequence defines the properties for a counter.
7751  If the counter does not yet exist, it is created; if it does exist, it
7752  is modified.
7753  Must end with 
7754 \begin_inset Quotes eld
7755 \end_inset
7756
7757
7758 \begin_inset Flex CharStyle:Code
7759 status collapsed
7760
7761 \begin_layout Plain Layout
7762 End
7763 \end_layout
7764
7765 \end_inset
7766
7767
7768 \begin_inset Quotes erd
7769 \end_inset
7770
7771 .
7772 \begin_inset Newline newline
7773 \end_inset
7774
7775 See Section
7776 \begin_inset space ~
7777 \end_inset
7778
7779
7780 \begin_inset CommandInset ref
7781 LatexCommand ref
7782 reference "sub:Counters"
7783
7784 \end_inset
7785
7786  for details on counters.
7787 \end_layout
7788
7789 \begin_layout Description
7790 \begin_inset Flex CharStyle:Code
7791 status collapsed
7792
7793 \begin_layout Plain Layout
7794 DefaultFont
7795 \end_layout
7796
7797 \end_inset
7798
7799  Sets the default font used to display the document.
7800  See Section
7801 \begin_inset space ~
7802 \end_inset
7803
7804
7805 \begin_inset CommandInset ref
7806 LatexCommand ref
7807 reference "sub:Font-description"
7808
7809 \end_inset
7810
7811  for how to declare fonts.
7812  Must end with 
7813 \begin_inset Quotes eld
7814 \end_inset
7815
7816
7817 \begin_inset Flex CharStyle:Code
7818 status collapsed
7819
7820 \begin_layout Plain Layout
7821 EndFont
7822 \end_layout
7823
7824 \end_inset
7825
7826
7827 \begin_inset Quotes erd
7828 \end_inset
7829
7830 .
7831 \end_layout
7832
7833 \begin_layout Description
7834 \begin_inset Flex CharStyle:Code
7835 status collapsed
7836
7837 \begin_layout Plain Layout
7838 DefaultModule
7839 \end_layout
7840
7841 \end_inset
7842
7843  [
7844 \begin_inset Flex CharStyle:Code
7845 status collapsed
7846
7847 \begin_layout Plain Layout
7848 string]
7849 \end_layout
7850
7851 \end_inset
7852
7853  Specifies a module to be included by default with this document class.
7854  The module should be specified by filename without the 
7855 \begin_inset Flex CharStyle:Code
7856 status collapsed
7857
7858 \begin_layout Plain Layout
7859 .module
7860 \end_layout
7861
7862 \end_inset
7863
7864  extension.
7865  The user can still remove the module, but it will be active at the outset.
7866  (This applies only when new files are created, or when this class is chosen
7867  for an existing document.)
7868 \end_layout
7869
7870 \begin_layout Description
7871 \begin_inset Flex CharStyle:Code
7872 status collapsed
7873
7874 \begin_layout Plain Layout
7875 DefaultStyle
7876 \end_layout
7877
7878 \end_inset
7879
7880  [
7881 \begin_inset Flex CharStyle:Code
7882 status collapsed
7883
7884 \begin_layout Plain Layout
7885 string
7886 \end_layout
7887
7888 \end_inset
7889
7890 ] This is the style that will be assigned to new paragraphs, usually 
7891 \begin_inset Flex CharStyle:MenuItem
7892 status collapsed
7893
7894 \begin_layout Plain Layout
7895 Standard
7896 \end_layout
7897
7898 \end_inset
7899
7900 .
7901  This will default to the first defined style if not given, but you are
7902  encouraged to use this directive.
7903 \end_layout
7904
7905 \begin_layout Description
7906 \begin_inset Flex CharStyle:Code
7907 status collapsed
7908
7909 \begin_layout Plain Layout
7910 ExcludesModule
7911 \end_layout
7912
7913 \end_inset
7914
7915  [
7916 \begin_inset Flex CharStyle:Code
7917 status collapsed
7918
7919 \begin_layout Plain Layout
7920 string
7921 \end_layout
7922
7923 \end_inset
7924
7925 ] This tag indicates that the module in question—which should be specified
7926  by filename without the 
7927 \begin_inset Flex CharStyle:Code
7928 status collapsed
7929
7930 \begin_layout Plain Layout
7931 .module
7932 \end_layout
7933
7934 \end_inset
7935
7936  extension—cannot be used with this document class.
7937  This might be used in a journal-specific layout file to prevent, say, the
7938  use of the 
7939 \begin_inset Flex CharStyle:Code
7940 status collapsed
7941
7942 \begin_layout Plain Layout
7943 theorems-sec
7944 \end_layout
7945
7946 \end_inset
7947
7948  module that numbers theorems by section.
7949  This tag may 
7950 \emph on
7951 not
7952 \emph default
7953  be used in a module.
7954  Modules have their own way of excluding other modules (see 
7955 \begin_inset CommandInset ref
7956 LatexCommand ref
7957 reference "sub:Layout-modules"
7958
7959 \end_inset
7960
7961 ).
7962 \end_layout
7963
7964 \begin_layout Description
7965 \begin_inset Flex CharStyle:Code
7966 status collapsed
7967
7968 \begin_layout Plain Layout
7969 Float
7970 \end_layout
7971
7972 \end_inset
7973
7974  Defines a new float.
7975  See Section
7976 \begin_inset space ~
7977 \end_inset
7978
7979
7980 \begin_inset CommandInset ref
7981 LatexCommand ref
7982 reference "sub:Floats"
7983
7984 \end_inset
7985
7986  for details.
7987  Must end with 
7988 \begin_inset Quotes eld
7989 \end_inset
7990
7991
7992 \begin_inset Flex CharStyle:Code
7993 status collapsed
7994
7995 \begin_layout Plain Layout
7996 End
7997 \end_layout
7998
7999 \end_inset
8000
8001
8002 \begin_inset Quotes erd
8003 \end_inset
8004
8005 .
8006 \end_layout
8007
8008 \begin_layout Description
8009 \begin_inset Flex CharStyle:Code
8010 status collapsed
8011
8012 \begin_layout Plain Layout
8013 HTMLPreamble
8014 \end_layout
8015
8016 \end_inset
8017
8018  Sets the information that will be output in the 
8019 \begin_inset Flex CharStyle:Code
8020 status collapsed
8021
8022 \begin_layout Plain Layout
8023 <head>
8024 \end_layout
8025
8026 \end_inset
8027
8028  block when this document class is output to XHTML.
8029  Note that this will completely override any prior 
8030 \begin_inset Flex CharStyle:Code
8031 status collapsed
8032
8033 \begin_layout Plain Layout
8034 HTMLPreamble
8035 \end_layout
8036
8037 \end_inset
8038
8039  or 
8040 \begin_inset Flex CharStyle:Code
8041 status collapsed
8042
8043 \begin_layout Plain Layout
8044 AddToHTMLPreamble
8045 \end_layout
8046
8047 \end_inset
8048
8049  declarations.
8050  (Use 
8051 \begin_inset Flex CharStyle:Code
8052 status collapsed
8053
8054 \begin_layout Plain Layout
8055 AddToHTMLPreamble
8056 \end_layout
8057
8058 \end_inset
8059
8060  if you just want to add material to the preamble.) Must end with 
8061 \begin_inset Quotes eld
8062 \end_inset
8063
8064
8065 \begin_inset Flex CharStyle:Code
8066 status collapsed
8067
8068 \begin_layout Plain Layout
8069 EndPreamble
8070 \end_layout
8071
8072 \end_inset
8073
8074
8075 \begin_inset Quotes erd
8076 \end_inset
8077
8078 .
8079 \end_layout
8080
8081 \begin_layout Description
8082 \begin_inset Flex CharStyle:Code
8083 status collapsed
8084
8085 \begin_layout Plain Layout
8086 HTMLTOCSection
8087 \end_layout
8088
8089 \end_inset
8090
8091  [
8092 \begin_inset Flex CharStyle:Code
8093 status collapsed
8094
8095 \begin_layout Plain Layout
8096 string
8097 \end_layout
8098
8099 \end_inset
8100
8101 ] The layout to use for the table of contents, bibliography, and so forth,
8102  when the document is output to HTML.
8103  For articles, this should normally be Section; for books, Chapter.
8104  If it is not given, then LyX will attempt to figure out which layout to
8105  use.
8106 \end_layout
8107
8108 \begin_layout Description
8109 \begin_inset Flex CharStyle:Code
8110 status collapsed
8111
8112 \begin_layout Plain Layout
8113 IfCounter
8114 \end_layout
8115
8116 \end_inset
8117
8118  [
8119 \begin_inset Flex CharStyle:Code
8120 status collapsed
8121
8122 \begin_layout Plain Layout
8123 string
8124 \end_layout
8125
8126 \end_inset
8127
8128 ] Modifies the properties of the given counter.
8129  If the counter does not exist, the section is ignored.
8130  Must end with 
8131 \begin_inset Quotes eld
8132 \end_inset
8133
8134
8135 \begin_inset Flex CharStyle:Code
8136 status collapsed
8137
8138 \begin_layout Plain Layout
8139 End
8140 \end_layout
8141
8142 \end_inset
8143
8144
8145 \begin_inset Quotes erd
8146 \end_inset
8147
8148 .
8149 \begin_inset Newline newline
8150 \end_inset
8151
8152 See Section
8153 \begin_inset space ~
8154 \end_inset
8155
8156
8157 \begin_inset CommandInset ref
8158 LatexCommand ref
8159 reference "sub:Counters"
8160
8161 \end_inset
8162
8163  for details on counters.
8164 \end_layout
8165
8166 \begin_layout Description
8167 \begin_inset Flex CharStyle:Code
8168 status collapsed
8169
8170 \begin_layout Plain Layout
8171 IfStyle
8172 \end_layout
8173
8174 \end_inset
8175
8176  [
8177 \begin_inset Flex CharStyle:Code
8178 status collapsed
8179
8180 \begin_layout Plain Layout
8181 string
8182 \end_layout
8183
8184 \end_inset
8185
8186 ] Modifies the properties of the given paragraph style.
8187  If the style does not exist, the section is ignored.
8188  Must end with 
8189 \begin_inset Quotes eld
8190 \end_inset
8191
8192
8193 \begin_inset Flex CharStyle:Code
8194 status collapsed
8195
8196 \begin_layout Plain Layout
8197 End
8198 \end_layout
8199
8200 \end_inset
8201
8202
8203 \begin_inset Quotes erd
8204 \end_inset
8205
8206 .
8207 \end_layout
8208
8209 \begin_layout Description
8210 \begin_inset Flex CharStyle:Code
8211 status collapsed
8212
8213 \begin_layout Plain Layout
8214 Input
8215 \end_layout
8216
8217 \end_inset
8218
8219  As its name implies, this command allows you to include another layout
8220  definition file within yours to avoid duplicating commands.
8221  Common examples are the standard layout files, for example, 
8222 \begin_inset Flex CharStyle:Code
8223 status collapsed
8224
8225 \begin_layout Plain Layout
8226 stdclass.inc
8227 \end_layout
8228
8229 \end_inset
8230
8231 , which contains most of the basic layouts.
8232 \end_layout
8233
8234 \begin_layout Description
8235 \begin_inset Flex CharStyle:Code
8236 status collapsed
8237
8238 \begin_layout Plain Layout
8239 InsetLayout
8240 \end_layout
8241
8242 \end_inset
8243
8244  This section (re-)defines the layout of an inset.
8245  It can be applied to an existing inset or to a new, user-defined inset,
8246  e.g., a new character style.
8247  Must end with 
8248 \begin_inset Quotes eld
8249 \end_inset
8250
8251
8252 \begin_inset Flex CharStyle:Code
8253 status collapsed
8254
8255 \begin_layout Plain Layout
8256 End
8257 \end_layout
8258
8259 \end_inset
8260
8261
8262 \begin_inset Quotes erd
8263 \end_inset
8264
8265 .
8266 \begin_inset Newline newline
8267 \end_inset
8268
8269 See Section
8270 \begin_inset space ~
8271 \end_inset
8272
8273
8274 \begin_inset CommandInset ref
8275 LatexCommand ref
8276 reference "sub:Flex-insets-and"
8277
8278 \end_inset
8279
8280  for more information.
8281  
8282 \end_layout
8283
8284 \begin_layout Description
8285 \begin_inset Flex CharStyle:Code
8286 status collapsed
8287
8288 \begin_layout Plain Layout
8289 LeftMargin
8290 \end_layout
8291
8292 \end_inset
8293
8294  [
8295 \begin_inset Flex CharStyle:Code
8296 status collapsed
8297
8298 \begin_layout Plain Layout
8299 string
8300 \end_layout
8301
8302 \end_inset
8303
8304 ] A string that indicates the width of the left margin on the screen, for
8305  example, 
8306 \begin_inset Quotes eld
8307 \end_inset
8308
8309 MMMMM
8310 \begin_inset Quotes erd
8311 \end_inset
8312
8313 .
8314  (Note that this is not a `length', like 
8315 \begin_inset Quotes eld
8316 \end_inset
8317
8318 2ex
8319 \begin_inset Quotes erd
8320 \end_inset
8321
8322 .)
8323 \end_layout
8324
8325 \begin_layout Description
8326 \begin_inset Flex CharStyle:Code
8327 status collapsed
8328
8329 \begin_layout Plain Layout
8330 NoFloat
8331 \end_layout
8332
8333 \end_inset
8334
8335  This command deletes an existing float.
8336  This is particularly useful when you want to suppress a float that has
8337  been defined in an input file.
8338 \end_layout
8339
8340 \begin_layout Description
8341 \begin_inset Flex CharStyle:Code
8342 status collapsed
8343
8344 \begin_layout Plain Layout
8345 NoStyle
8346 \end_layout
8347
8348 \end_inset
8349
8350  This command deletes an existing style.
8351  This is particularly useful when you want to suppress a style that has
8352  be defined in an input file.
8353 \end_layout
8354
8355 \begin_layout Description
8356 \begin_inset Flex CharStyle:Code
8357 status collapsed
8358
8359 \begin_layout Plain Layout
8360 OutputFormat
8361 \end_layout
8362
8363 \end_inset
8364
8365  A string indicating the file format (as defined in the Preferences dialog)
8366  produced by this class.
8367  It is mainly useful when 
8368 \begin_inset Flex CharStyle:Code
8369 status collapsed
8370
8371 \begin_layout Plain Layout
8372 OutputType
8373 \end_layout
8374
8375 \end_inset
8376
8377  is `literate' and one wants to define a new type of literate document.
8378  This string is reset to `docbook', `latex', or `literate' when the correspondin
8379
8380 \begin_inset Flex CharStyle:Code
8381 status collapsed
8382
8383 \begin_layout Plain Layout
8384 OutputType
8385 \end_layout
8386
8387 \end_inset
8388
8389  parameter is encountered.
8390 \end_layout
8391
8392 \begin_layout Description
8393 \begin_inset Flex CharStyle:Code
8394 status collapsed
8395
8396 \begin_layout Plain Layout
8397 OutputType
8398 \end_layout
8399
8400 \end_inset
8401
8402  A string indicating what sort of output documents using this class will
8403  produce.
8404  At present, the options are: `docbook', `latex', and `literate'.
8405 \end_layout
8406
8407 \begin_layout Description
8408 \begin_inset Flex CharStyle:Code
8409 status collapsed
8410
8411 \begin_layout Plain Layout
8412 PageStyle
8413 \end_layout
8414
8415 \end_inset
8416
8417  [
8418 \emph on
8419
8420 \begin_inset Flex CharStyle:Code
8421 status collapsed
8422
8423 \begin_layout Plain Layout
8424
8425 \emph on
8426 plain
8427 \end_layout
8428
8429 \end_inset
8430
8431
8432 \emph default
8433
8434 \begin_inset Flex CharStyle:Code
8435 status collapsed
8436
8437 \begin_layout Plain Layout
8438 empty
8439 \end_layout
8440
8441 \end_inset
8442
8443
8444 \begin_inset Flex CharStyle:Code
8445 status collapsed
8446
8447 \begin_layout Plain Layout
8448 headings
8449 \end_layout
8450
8451 \end_inset
8452
8453 ] The default pagestyle.
8454  Can be changed in the 
8455 \begin_inset Flex CharStyle:MenuItem
8456 status collapsed
8457
8458 \begin_layout Plain Layout
8459 Document\SpecialChar \menuseparator
8460 Settings
8461 \end_layout
8462
8463 \end_inset
8464
8465  dialog.
8466 \end_layout
8467
8468 \begin_layout Description
8469 \begin_inset Flex CharStyle:Code
8470 status collapsed
8471
8472 \begin_layout Plain Layout
8473 Preamble
8474 \end_layout
8475
8476 \end_inset
8477
8478  Sets the preamble for the LaTeX document.
8479  Note that this will completely override any prior 
8480 \begin_inset Flex CharStyle:Code
8481 status collapsed
8482
8483 \begin_layout Plain Layout
8484 Preamble
8485 \end_layout
8486
8487 \end_inset
8488
8489  or 
8490 \begin_inset Flex CharStyle:Code
8491 status collapsed
8492
8493 \begin_layout Plain Layout
8494 AddToPreamble
8495 \end_layout
8496
8497 \end_inset
8498
8499  declarations.
8500  (Use 
8501 \begin_inset Flex CharStyle:Code
8502 status collapsed
8503
8504 \begin_layout Plain Layout
8505 AddToPreamble
8506 \end_layout
8507
8508 \end_inset
8509
8510  if you just want to add material to the preamble.) Must end with 
8511 \begin_inset Quotes eld
8512 \end_inset
8513
8514
8515 \begin_inset Flex CharStyle:Code
8516 status collapsed
8517
8518 \begin_layout Plain Layout
8519 EndPreamble
8520 \end_layout
8521
8522 \end_inset
8523
8524
8525 \begin_inset Quotes erd
8526 \end_inset
8527
8528 .
8529 \end_layout
8530
8531 \begin_layout Description
8532 \begin_inset Flex CharStyle:Code
8533 status collapsed
8534
8535 \begin_layout Plain Layout
8536 Provides
8537 \end_layout
8538
8539 \end_inset
8540
8541  [
8542 \begin_inset Flex CharStyle:Code
8543 status collapsed
8544
8545 \begin_layout Plain Layout
8546 string
8547 \end_layout
8548
8549 \end_inset
8550
8551 ] [
8552 \begin_inset Flex CharStyle:Code
8553 status collapsed
8554
8555 \begin_layout Plain Layout
8556
8557 \emph on
8558 0
8559 \end_layout
8560
8561 \end_inset
8562
8563
8564 \begin_inset Flex CharStyle:Code
8565 status collapsed
8566
8567 \begin_layout Plain Layout
8568 1
8569 \end_layout
8570
8571 \end_inset
8572
8573 ] Whether the class already provides the feature 
8574 \begin_inset Flex CharStyle:Code
8575 status collapsed
8576
8577 \begin_layout Plain Layout
8578 string
8579 \end_layout
8580
8581 \end_inset
8582
8583 .
8584  A feature is in general the name of a package (
8585 \begin_inset Flex CharStyle:Code
8586 status collapsed
8587
8588 \begin_layout Plain Layout
8589 amsmath
8590 \end_layout
8591
8592 \end_inset
8593
8594
8595 \begin_inset Flex CharStyle:Code
8596 status collapsed
8597
8598 \begin_layout Plain Layout
8599 makeidx
8600 \end_layout
8601
8602 \end_inset
8603
8604 , \SpecialChar \ldots{}
8605 ) or a macro (
8606 \begin_inset Flex CharStyle:Code
8607 status collapsed
8608
8609 \begin_layout Plain Layout
8610 url
8611 \end_layout
8612
8613 \end_inset
8614
8615
8616 \begin_inset Flex CharStyle:Code
8617 status collapsed
8618
8619 \begin_layout Plain Layout
8620 boldsymbol
8621 \end_layout
8622
8623 \end_inset
8624
8625 ,\SpecialChar \ldots{}
8626 ); the complete list of supported features is unfortunately not documented
8627  outside the LyX source code—but see 
8628 \begin_inset Flex CharStyle:Code
8629 status collapsed
8630
8631 \begin_layout Plain Layout
8632 LaTeXFeatures.cpp
8633 \end_layout
8634
8635 \end_inset
8636
8637  if you're interested.
8638  
8639 \begin_inset Flex CharStyle:MenuItem
8640 status collapsed
8641
8642 \begin_layout Plain Layout
8643 Help\SpecialChar \menuseparator
8644 LaTeX Configuration
8645 \end_layout
8646
8647 \end_inset
8648
8649  also gives an overview of the supported packages.
8650 \end_layout
8651
8652 \begin_layout Description
8653 \begin_inset Flex CharStyle:Code
8654 status collapsed
8655
8656 \begin_layout Plain Layout
8657 ProvidesModule
8658 \end_layout
8659
8660 \end_inset
8661
8662  [
8663 \begin_inset Flex CharStyle:Code
8664 status collapsed
8665
8666 \begin_layout Plain Layout
8667 string
8668 \end_layout
8669
8670 \end_inset
8671
8672 ] Indicates that this layout provides the functionality of the module mentioned,
8673  which should be specified by the filename without the 
8674 \begin_inset Flex CharStyle:Code
8675 status collapsed
8676
8677 \begin_layout Plain Layout
8678 .module
8679 \end_layout
8680
8681 \end_inset
8682
8683  extension.
8684  This will typically be used if the layout includes the module directly,
8685  rather than using the 
8686 \begin_inset Flex CharStyle:Code
8687 status collapsed
8688
8689 \begin_layout Plain Layout
8690 DefaultModule
8691 \end_layout
8692
8693 \end_inset
8694
8695  tag to indicate that it ought to be used.
8696  It could also be used in a module that provided an alternate implementation
8697  of the same functionality.
8698 \end_layout
8699
8700 \begin_layout Description
8701 \begin_inset Flex CharStyle:Code
8702 status collapsed
8703
8704 \begin_layout Plain Layout
8705 Requires
8706 \end_layout
8707
8708 \end_inset
8709
8710  [
8711 \begin_inset Flex CharStyle:Code
8712 status collapsed
8713
8714 \begin_layout Plain Layout
8715 string
8716 \end_layout
8717
8718 \end_inset
8719
8720 ] Whether the class requires the feature 
8721 \begin_inset Flex CharStyle:Code
8722 status collapsed
8723
8724 \begin_layout Plain Layout
8725 string
8726 \end_layout
8727
8728 \end_inset
8729
8730 .
8731  Multiple features must be separated by commas.
8732  Note that you can only request supported features.
8733  (Again, see 
8734 \begin_inset Flex CharStyle:Code
8735 status collapsed
8736
8737 \begin_layout Plain Layout
8738 LaTeXFeatures.cpp
8739 \end_layout
8740
8741 \end_inset
8742
8743  for a list of these.)
8744 \end_layout
8745
8746 \begin_layout Description
8747 \begin_inset Flex CharStyle:Code
8748 status collapsed
8749
8750 \begin_layout Plain Layout
8751 RightMargin
8752 \end_layout
8753
8754 \end_inset
8755
8756  A string that indicates the width of the right margin on the screen, for
8757  example, 
8758 \begin_inset Quotes eld
8759 \end_inset
8760
8761 MMMMM
8762 \begin_inset Quotes erd
8763 \end_inset
8764
8765 .
8766 \end_layout
8767
8768 \begin_layout Description
8769 \begin_inset Flex CharStyle:Code
8770 status collapsed
8771
8772 \begin_layout Plain Layout
8773 SecNumDepth
8774 \end_layout
8775
8776 \end_inset
8777
8778  Sets which divisions get numbered.
8779  Corresponds to the 
8780 \begin_inset Flex CharStyle:Code
8781 status collapsed
8782
8783 \begin_layout Plain Layout
8784 secnumdepth
8785 \end_layout
8786
8787 \end_inset
8788
8789  counter in LaTeX.
8790 \end_layout
8791
8792 \begin_layout Description
8793 \begin_inset Flex CharStyle:Code
8794 status collapsed
8795
8796 \begin_layout Plain Layout
8797 Sides
8798 \end_layout
8799
8800 \end_inset
8801
8802  [
8803 \emph on
8804
8805 \begin_inset Flex CharStyle:Code
8806 status collapsed
8807
8808 \begin_layout Plain Layout
8809
8810 \emph on
8811 1
8812 \end_layout
8813
8814 \end_inset
8815
8816
8817 \emph default
8818
8819 \begin_inset Flex CharStyle:Code
8820 status collapsed
8821
8822 \begin_layout Plain Layout
8823 2
8824 \end_layout
8825
8826 \end_inset
8827
8828 ] Whether the class-default should be printing on one or both sides of the
8829  paper.
8830  Can be changed in the 
8831 \begin_inset Flex CharStyle:MenuItem
8832 status collapsed
8833
8834 \begin_layout Plain Layout
8835 Document\SpecialChar \menuseparator
8836 Settings
8837 \end_layout
8838
8839 \end_inset
8840
8841  dialog.
8842 \end_layout
8843
8844 \begin_layout Description
8845 \begin_inset Flex CharStyle:Code
8846 status collapsed
8847
8848 \begin_layout Plain Layout
8849 Style
8850 \end_layout
8851
8852 \end_inset
8853
8854  This sequence defines a paragraph style.
8855  If the style does not yet exist, it is created; if it does exist, its parameter
8856 s are modified.
8857  Must end with 
8858 \begin_inset Quotes eld
8859 \end_inset
8860
8861
8862 \begin_inset Flex CharStyle:Code
8863 status collapsed
8864
8865 \begin_layout Plain Layout
8866 End
8867 \end_layout
8868
8869 \end_inset
8870
8871
8872 \begin_inset Quotes erd
8873 \end_inset
8874
8875 .
8876 \begin_inset Newline newline
8877 \end_inset
8878
8879 See Section
8880 \begin_inset space ~
8881 \end_inset
8882
8883
8884 \begin_inset CommandInset ref
8885 LatexCommand ref
8886 reference "sub:Paragraph-Styles"
8887
8888 \end_inset
8889
8890  for details on paragraph styles.
8891 \end_layout
8892
8893 \begin_layout Description
8894 \begin_inset Flex CharStyle:Code
8895 status collapsed
8896
8897 \begin_layout Plain Layout
8898 TitleLatexName
8899 \end_layout
8900
8901 \end_inset
8902
8903  [
8904 \begin_inset Flex CharStyle:Code
8905 status collapsed
8906
8907 \begin_layout Plain Layout
8908 string="maketitle"
8909 \end_layout
8910
8911 \end_inset
8912
8913 ] The name of the command or environment to be used with 
8914 \begin_inset Flex CharStyle:Code
8915 status collapsed
8916
8917 \begin_layout Plain Layout
8918 TitleLatexType
8919 \end_layout
8920
8921 \end_inset
8922
8923 .
8924 \end_layout
8925
8926 \begin_layout Description
8927 \begin_inset Flex CharStyle:Code
8928 status collapsed
8929
8930 \begin_layout Plain Layout
8931 TitleLatexType
8932 \end_layout
8933
8934 \end_inset
8935
8936  [
8937 \begin_inset Flex CharStyle:Code
8938 status collapsed
8939
8940 \begin_layout Plain Layout
8941
8942 \emph on
8943 CommandAfter
8944 \end_layout
8945
8946 \end_inset
8947
8948
8949 \begin_inset Flex CharStyle:Code
8950 status collapsed
8951
8952 \begin_layout Plain Layout
8953 Environment
8954 \end_layout
8955
8956 \end_inset
8957
8958 ] Indicates what kind of markup is used to define the title of a document.
8959  
8960 \begin_inset Flex CharStyle:Code
8961 status collapsed
8962
8963 \begin_layout Plain Layout
8964 CommandAfter
8965 \end_layout
8966
8967 \end_inset
8968
8969  means that the macro with name 
8970 \begin_inset Flex CharStyle:Code
8971 status collapsed
8972
8973 \begin_layout Plain Layout
8974 TitleLatexName
8975 \end_layout
8976
8977 \end_inset
8978
8979  will be inserted after the last layout which has 
8980 \begin_inset Quotes eld
8981 \end_inset
8982
8983
8984 \begin_inset Flex CharStyle:Code
8985 status collapsed
8986
8987 \begin_layout Plain Layout
8988 InTitle 1
8989 \end_layout
8990
8991 \end_inset
8992
8993
8994 \begin_inset Quotes erd
8995 \end_inset
8996
8997 .
8998  
8999 \begin_inset Flex CharStyle:Code
9000 status collapsed
9001
9002 \begin_layout Plain Layout
9003 Environment
9004 \end_layout
9005
9006 \end_inset
9007
9008  corresponds to the case where the block of paragraphs which have 
9009 \begin_inset Quotes eld
9010 \end_inset
9011
9012
9013 \begin_inset Flex CharStyle:Code
9014 status collapsed
9015
9016 \begin_layout Plain Layout
9017 InTitle 1
9018 \end_layout
9019
9020 \end_inset
9021
9022
9023 \begin_inset Quotes erd
9024 \end_inset
9025
9026  should be enclosed into the 
9027 \begin_inset Flex CharStyle:Code
9028 status collapsed
9029
9030 \begin_layout Plain Layout
9031 TitleLatexName
9032 \end_layout
9033
9034 \end_inset
9035
9036  environment.
9037 \end_layout
9038
9039 \begin_layout Description
9040 \begin_inset Flex CharStyle:Code
9041 status collapsed
9042
9043 \begin_layout Plain Layout
9044 TocDepth
9045 \end_layout
9046
9047 \end_inset
9048
9049  Sets which divisions are included in the table of contents.
9050  Corresponds to the 
9051 \begin_inset Flex CharStyle:Code
9052 status collapsed
9053
9054 \begin_layout Plain Layout
9055 tocdepth
9056 \end_layout
9057
9058 \end_inset
9059
9060  counter in LaTeX.
9061 \end_layout
9062
9063 \begin_layout Subsection
9064 \begin_inset Flex CharStyle:Code
9065 status collapsed
9066
9067 \begin_layout Plain Layout
9068 ClassOptions
9069 \end_layout
9070
9071 \end_inset
9072
9073  section
9074 \begin_inset CommandInset label
9075 LatexCommand label
9076 name "sub:ClassOptions"
9077
9078 \end_inset
9079
9080
9081 \end_layout
9082
9083 \begin_layout Standard
9084 The 
9085 \begin_inset Flex CharStyle:Code
9086 status collapsed
9087
9088 \begin_layout Plain Layout
9089 ClassOptions
9090 \end_layout
9091
9092 \end_inset
9093
9094  section can contain the following entries:
9095 \end_layout
9096
9097 \begin_layout Description
9098 \begin_inset Flex CharStyle:Code
9099 status collapsed
9100
9101 \begin_layout Plain Layout
9102 FontSize
9103 \end_layout
9104
9105 \end_inset
9106
9107  [
9108 \begin_inset Flex CharStyle:Code
9109 status collapsed
9110
9111 \begin_layout Plain Layout
9112 string="10|11|12"
9113 \end_layout
9114
9115 \end_inset
9116
9117 ] The list of available font sizes for the document's main font, separated
9118  by 
9119 \begin_inset Quotes eld
9120 \end_inset
9121
9122
9123 \begin_inset Flex CharStyle:Code
9124 status collapsed
9125
9126 \begin_layout Plain Layout
9127 |
9128 \end_layout
9129
9130 \end_inset
9131
9132
9133 \begin_inset Quotes erd
9134 \end_inset
9135
9136 .
9137 \end_layout
9138
9139 \begin_layout Description
9140 \begin_inset Flex CharStyle:Code
9141 status collapsed
9142
9143 \begin_layout Plain Layout
9144 Header
9145 \end_layout
9146
9147 \end_inset
9148
9149  Used to set the DTD line with XML-based output classes.
9150  E.
9151 \begin_inset space \thinspace{}
9152 \end_inset
9153
9154 g.: PUBLIC 
9155 \begin_inset Quotes eld
9156 \end_inset
9157
9158 -//OASIS//DTD DocBook V4.2//EN
9159 \begin_inset Quotes erd
9160 \end_inset
9161
9162 .
9163 \end_layout
9164
9165 \begin_layout Description
9166 \begin_inset Flex CharStyle:Code
9167 status collapsed
9168
9169 \begin_layout Plain Layout
9170 PageStyle
9171 \end_layout
9172
9173 \end_inset
9174
9175  [
9176 \begin_inset Flex CharStyle:Code
9177 status collapsed
9178
9179 \begin_layout Plain Layout
9180 string="empty|plain|headings|fancy"
9181 \end_layout
9182
9183 \end_inset
9184
9185 ] The list of available page styles, separated by 
9186 \begin_inset Quotes eld
9187 \end_inset
9188
9189
9190 \begin_inset Flex CharStyle:Code
9191 status collapsed
9192
9193 \begin_layout Plain Layout
9194 |
9195 \end_layout
9196
9197 \end_inset
9198
9199
9200 \begin_inset Quotes erd
9201 \end_inset
9202
9203 .
9204 \end_layout
9205
9206 \begin_layout Description
9207 \begin_inset Flex CharStyle:Code
9208 status collapsed
9209
9210 \begin_layout Plain Layout
9211 Other
9212 \end_layout
9213
9214 \end_inset
9215
9216  [
9217 \begin_inset Flex CharStyle:Code
9218 status collapsed
9219
9220 \begin_layout Plain Layout
9221 string=""
9222 \end_layout
9223
9224 \end_inset
9225
9226 ] Some document class options, separated by a comma, that will be added
9227  to the optional part of the 
9228 \begin_inset Flex CharStyle:Code
9229 status collapsed
9230
9231 \begin_layout Plain Layout
9232
9233 \backslash
9234 documentclass
9235 \end_layout
9236
9237 \end_inset
9238
9239  command.
9240 \end_layout
9241
9242 \begin_layout Standard
9243 The 
9244 \begin_inset Flex CharStyle:Code
9245 status collapsed
9246
9247 \begin_layout Plain Layout
9248 ClassOptions
9249 \end_layout
9250
9251 \end_inset
9252
9253  section must end with 
9254 \begin_inset Quotes eld
9255 \end_inset
9256
9257
9258 \begin_inset Flex CharStyle:Code
9259 status collapsed
9260
9261 \begin_layout Plain Layout
9262 End
9263 \end_layout
9264
9265 \end_inset
9266
9267
9268 \begin_inset Quotes erd
9269 \end_inset
9270
9271 .
9272 \end_layout
9273
9274 \begin_layout Subsection
9275 Paragraph Styles
9276 \begin_inset CommandInset label
9277 LatexCommand label
9278 name "sub:Paragraph-Styles"
9279
9280 \end_inset
9281
9282
9283 \end_layout
9284
9285 \begin_layout Standard
9286 A paragraph style description looks like this:
9287 \begin_inset Foot
9288 status collapsed
9289
9290 \begin_layout Plain Layout
9291 Note that this will either define a new layout or modify an existing one.
9292 \end_layout
9293
9294 \end_inset
9295
9296
9297 \end_layout
9298
9299 \begin_layout LyX-Code
9300 Style 
9301 \family roman
9302 \emph on
9303 name
9304 \end_layout
9305
9306 \begin_layout LyX-Code
9307  ...
9308 \end_layout
9309
9310 \begin_layout LyX-Code
9311 End
9312 \end_layout
9313
9314 \begin_layout Standard
9315 where the following commands are allowed:
9316 \end_layout
9317
9318 \begin_layout Description
9319 \begin_inset Flex CharStyle:Code
9320 status collapsed
9321
9322 \begin_layout Plain Layout
9323 Align
9324 \end_layout
9325
9326 \end_inset
9327
9328  [
9329 \begin_inset Flex CharStyle:Code
9330 status collapsed
9331
9332 \begin_layout Plain Layout
9333
9334 \emph on
9335 block
9336 \emph default
9337 , left, right, center
9338 \end_layout
9339
9340 \end_inset
9341
9342 ] Paragraph alignment.
9343 \end_layout
9344
9345 \begin_layout Description
9346 \begin_inset Flex CharStyle:Code
9347 status collapsed
9348
9349 \begin_layout Plain Layout
9350 AlignPossible
9351 \end_layout
9352
9353 \end_inset
9354
9355  [
9356 \begin_inset Flex CharStyle:Code
9357 status collapsed
9358
9359 \begin_layout Plain Layout
9360
9361 \emph on
9362 block
9363 \emph default
9364 , left, right, center
9365 \end_layout
9366
9367 \end_inset
9368
9369 ] A comma separated list of permitted alignments.
9370  (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9371  sense.
9372  For example a right-aligned or centered enumeration isn't possible.)
9373 \end_layout
9374
9375 \begin_layout Description
9376 \begin_inset Flex CharStyle:Code
9377 status collapsed
9378
9379 \begin_layout Plain Layout
9380 BabelPreamble
9381 \end_layout
9382
9383 \end_inset
9384
9385  Language dependent information to be included in the LaTeX preamble when
9386  this style is used.
9387  Note that this will completely override any prior 
9388 \begin_inset Flex CharStyle:Code
9389 status collapsed
9390
9391 \begin_layout Plain Layout
9392 BabelPreamble
9393 \end_layout
9394
9395 \end_inset
9396
9397  declarations.
9398  Must end with 
9399 \begin_inset Quotes eld
9400 \end_inset
9401
9402
9403 \begin_inset Flex CharStyle:Code
9404 status collapsed
9405
9406 \begin_layout Plain Layout
9407 EndBabelPreamble
9408 \end_layout
9409
9410 \end_inset
9411
9412
9413 \begin_inset Quotes erd
9414 \end_inset
9415
9416 .
9417  The contents of this tag will occur once in the LaTeX preamble for each
9418  language used by the document.
9419  Each time, the following substitutions are made:
9420 \end_layout
9421
9422 \begin_deeper
9423 \begin_layout Itemize
9424 \begin_inset Flex CharStyle:Code
9425 status collapsed
9426
9427 \begin_layout Plain Layout
9428 $$lang
9429 \end_layout
9430
9431 \end_inset
9432
9433  is replaced by the language name (as used by the babel package).
9434 \end_layout
9435
9436 \begin_layout Itemize
9437 The 
9438 \begin_inset Quotes eld
9439 \end_inset
9440
9441 Function
9442 \begin_inset Quotes erd
9443 \end_inset
9444
9445  
9446 \begin_inset Flex CharStyle:Code
9447 status collapsed
9448
9449 \begin_layout Plain Layout
9450 _()
9451 \end_layout
9452
9453 \end_inset
9454
9455  replaces its argument by the translation of the argument to the current
9456  language.
9457 \end_layout
9458
9459 \begin_layout Standard
9460 This preamble snippet will only be used if the document contains more than
9461  one language and the babel package is used.
9462 \end_layout
9463
9464 \end_deeper
9465 \begin_layout Description
9466 \begin_inset Flex CharStyle:Code
9467 status collapsed
9468
9469 \begin_layout Plain Layout
9470 BottomSep
9471 \end_layout
9472
9473 \end_inset
9474
9475  [
9476 \begin_inset Flex CharStyle:Code
9477 status collapsed
9478
9479 \begin_layout Plain Layout
9480 float=0
9481 \end_layout
9482
9483 \end_inset
9484
9485 ]
9486 \begin_inset Foot
9487 status collapsed
9488
9489 \begin_layout Plain Layout
9490 Note that a `float' here is a real number, such as: 1.5.
9491 \end_layout
9492
9493 \end_inset
9494
9495  The vertical space with which the last of a chain of paragraphs with this
9496  layout is separated from the following paragraph.
9497  If the next paragraph has another layout, the separations are not simply
9498  added, but the maximum is taken.
9499 \end_layout
9500
9501 \begin_layout Description
9502 \begin_inset Flex CharStyle:Code
9503 status collapsed
9504
9505 \begin_layout Plain Layout
9506 Category
9507 \end_layout
9508
9509 \end_inset
9510
9511  
9512 \begin_inset Flex CharStyle:Code
9513 status collapsed
9514
9515 \begin_layout Plain Layout
9516 [string]
9517 \end_layout
9518
9519 \end_inset
9520
9521  The category for this style.
9522  This is used to group related styles in the Layout combobox on the toolbar.
9523  Any string can be used, but you may want to use existing categories with
9524  your own styles.
9525  
9526 \end_layout
9527
9528 \begin_layout Description
9529 \begin_inset Flex CharStyle:Code
9530 status collapsed
9531
9532 \begin_layout Plain Layout
9533 CommandDepth
9534 \end_layout
9535
9536 \end_inset
9537
9538  Depth of XML command.
9539  Used only with XML-type formats.
9540 \end_layout
9541
9542 \begin_layout Description
9543 \begin_inset Flex CharStyle:Code
9544 status collapsed
9545
9546 \begin_layout Plain Layout
9547 CopyStyle
9548 \end_layout
9549
9550 \end_inset
9551
9552  
9553 \begin_inset CommandInset label
9554 LatexCommand label
9555 name "des:CopyStyle"
9556
9557 \end_inset
9558
9559
9560 \begin_inset Flex CharStyle:Code
9561 status collapsed
9562
9563 \begin_layout Plain Layout
9564 [string]
9565 \end_layout
9566
9567 \end_inset
9568
9569  Copies all the features of an existing style into the current one.
9570  
9571 \end_layout
9572
9573 \begin_layout Description
9574 \begin_inset Flex CharStyle:Code
9575 status collapsed
9576
9577 \begin_layout Plain Layout
9578 DependsOn
9579 \end_layout
9580
9581 \end_inset
9582
9583  The name of a style whose preamble should be output 
9584 \emph on
9585 before
9586 \emph default
9587  this one.
9588  This allows to ensure some ordering of the preamble snippets when macros
9589  definitions depend on one another.
9590 \begin_inset Foot
9591 status collapsed
9592
9593 \begin_layout Plain Layout
9594 Note that, besides that functionality, there is no way to ensure any ordering
9595  of preambles.
9596  The ordering that you see in a given version of LyX may change without
9597  warning in later versions.
9598 \end_layout
9599
9600 \end_inset
9601
9602
9603 \end_layout
9604
9605 \begin_layout Description
9606 \begin_inset Flex CharStyle:Code
9607 status collapsed
9608
9609 \begin_layout Plain Layout
9610 EndLabeltype
9611 \end_layout
9612
9613 \end_inset
9614
9615  [
9616 \begin_inset Flex CharStyle:Code
9617 status collapsed
9618
9619 \begin_layout Plain Layout
9620
9621 \emph on
9622 No_Label
9623 \emph default
9624 , Box, Filled_Box, Static
9625 \end_layout
9626
9627 \end_inset
9628
9629 ] The type of label that stands at the end of the paragraph (or sequence
9630  of paragraphs if 
9631 \begin_inset Flex CharStyle:Code
9632 status collapsed
9633
9634 \begin_layout Plain Layout
9635 LatexType
9636 \end_layout
9637
9638 \end_inset
9639
9640  is 
9641 \begin_inset Flex CharStyle:Code
9642 status collapsed
9643
9644 \begin_layout Plain Layout
9645 Environment
9646 \end_layout
9647
9648 \end_inset
9649
9650
9651 \begin_inset Flex CharStyle:Code
9652 status collapsed
9653
9654 \begin_layout Plain Layout
9655 Item_Environment
9656 \end_layout
9657
9658 \end_inset
9659
9660  or 
9661 \begin_inset Flex CharStyle:Code
9662 status collapsed
9663
9664 \begin_layout Plain Layout
9665 List_Environment
9666 \end_layout
9667
9668 \end_inset
9669
9670 ).
9671  
9672 \begin_inset Flex CharStyle:Code
9673 status collapsed
9674
9675 \begin_layout Plain Layout
9676 No_Label
9677 \end_layout
9678
9679 \end_inset
9680
9681  means 
9682 \begin_inset Quotes eld
9683 \end_inset
9684
9685 nothing
9686 \begin_inset Quotes erd
9687 \end_inset
9688
9689
9690 \begin_inset Flex CharStyle:Code
9691 status collapsed
9692
9693 \begin_layout Plain Layout
9694 Box
9695 \end_layout
9696
9697 \end_inset
9698
9699  (resp.
9700 \begin_inset Flex CharStyle:Code
9701 status collapsed
9702
9703 \begin_layout Plain Layout
9704 \begin_inset space ~
9705 \end_inset
9706
9707 Filled_Box
9708 \end_layout
9709
9710 \end_inset
9711
9712 ) is a white (resp.
9713 \begin_inset space ~
9714 \end_inset
9715
9716 black) square suitable for end of proof markers, 
9717 \begin_inset Flex CharStyle:Code
9718 status collapsed
9719
9720 \begin_layout Plain Layout
9721 Static
9722 \end_layout
9723
9724 \end_inset
9725
9726  is an explicit text string.
9727 \end_layout
9728
9729 \begin_layout Description
9730 \begin_inset Flex CharStyle:Code
9731 status collapsed
9732
9733 \begin_layout Plain Layout
9734 EndLabelString
9735 \end_layout
9736
9737 \end_inset
9738
9739  [
9740 \begin_inset Flex CharStyle:Code
9741 status collapsed
9742
9743 \begin_layout Plain Layout
9744 string=""
9745 \end_layout
9746
9747 \end_inset
9748
9749 ] The string used for a label with a 
9750 \begin_inset Flex CharStyle:Code
9751 status collapsed
9752
9753 \begin_layout Plain Layout
9754 Static
9755 \end_layout
9756
9757 \end_inset
9758
9759  
9760 \begin_inset Flex CharStyle:Code
9761 status collapsed
9762
9763 \begin_layout Plain Layout
9764 EndLabelType
9765 \end_layout
9766
9767 \end_inset
9768
9769 .
9770  
9771 \end_layout
9772
9773 \begin_layout Description
9774 \begin_inset Flex CharStyle:Code
9775 status collapsed
9776
9777 \begin_layout Plain Layout
9778 Fill_Bottom
9779 \end_layout
9780
9781 \end_inset
9782
9783  [
9784 \begin_inset Flex CharStyle:Code
9785 status collapsed
9786
9787 \begin_layout Plain Layout
9788
9789 \emph on
9790 0
9791 \emph default
9792 ,1
9793 \end_layout
9794
9795 \end_inset
9796
9797 ] Similar to 
9798 \begin_inset Flex CharStyle:Code
9799 status collapsed
9800
9801 \begin_layout Plain Layout
9802 Fill_Top
9803 \end_layout
9804
9805 \end_inset
9806
9807 .
9808 \end_layout
9809
9810 \begin_layout Description
9811 \begin_inset Flex CharStyle:Code
9812 status collapsed
9813
9814 \begin_layout Plain Layout
9815 Fill_Top
9816 \end_layout
9817
9818 \end_inset
9819
9820  [
9821 \begin_inset Flex CharStyle:Code
9822 status collapsed
9823
9824 \begin_layout Plain Layout
9825
9826 \emph on
9827 0
9828 \emph default
9829 ,1
9830 \end_layout
9831
9832 \end_inset
9833
9834 ] With this parameter the 
9835 \begin_inset Flex CharStyle:MenuItem
9836 status collapsed
9837
9838 \begin_layout Plain Layout
9839 Fill
9840 \end_layout
9841
9842 \end_inset
9843
9844  value of the 
9845 \begin_inset Quotes eld
9846 \end_inset
9847
9848 Vertical space above
9849 \begin_inset Quotes erd
9850 \end_inset
9851
9852  list of the 
9853 \begin_inset Flex CharStyle:MenuItem
9854 status collapsed
9855
9856 \begin_layout Plain Layout
9857 Edit\SpecialChar \menuseparator
9858 Paragraph
9859 \begin_inset space ~
9860 \end_inset
9861
9862 Settings
9863 \end_layout
9864
9865 \end_inset
9866
9867  dialog can be set when initializing a paragraph with this style.
9868 \begin_inset Foot
9869 status collapsed
9870
9871 \begin_layout Plain Layout
9872
9873 \emph on
9874 Note from Jean-Marc:
9875 \emph default
9876  I'm not sure that this setting has much use, and it should probably be
9877  removed in later versions.
9878 \end_layout
9879
9880 \end_inset
9881
9882  
9883 \end_layout
9884
9885 \begin_layout Description
9886 \begin_inset Flex CharStyle:Code
9887 status collapsed
9888
9889 \begin_layout Plain Layout
9890 Font
9891 \end_layout
9892
9893 \end_inset
9894
9895  The font used for both the text body 
9896 \emph on
9897 and
9898 \emph default
9899  the label.
9900  See section
9901 \begin_inset space ~
9902 \end_inset
9903
9904
9905 \begin_inset CommandInset ref
9906 LatexCommand ref
9907 reference "sub:Font-description"
9908
9909 \end_inset
9910
9911 .
9912  Note that defining this font automatically defines the 
9913 \begin_inset Flex CharStyle:Code
9914 status collapsed
9915
9916 \begin_layout Plain Layout
9917 LabelFont
9918 \end_layout
9919
9920 \end_inset
9921
9922  to the same value.
9923  So you should define this one first if you also want to define 
9924 \begin_inset Flex CharStyle:Code
9925 status collapsed
9926
9927 \begin_layout Plain Layout
9928 LabelFont
9929 \end_layout
9930
9931 \end_inset
9932
9933 .
9934 \end_layout
9935
9936 \begin_layout Description
9937 \begin_inset Flex CharStyle:Code
9938 status collapsed
9939
9940 \begin_layout Plain Layout
9941 FreeSpacing
9942 \end_layout
9943
9944 \end_inset
9945
9946  
9947 \begin_inset CommandInset label
9948 LatexCommand label
9949 name "des:FreeSpacing"
9950
9951 \end_inset
9952
9953 [
9954 \emph on
9955
9956 \begin_inset Flex CharStyle:Code
9957 status collapsed
9958
9959 \begin_layout Plain Layout
9960
9961 \emph on
9962 0
9963 \end_layout
9964
9965 \end_inset
9966
9967
9968 \emph default
9969
9970 \begin_inset Flex CharStyle:Code
9971 status collapsed
9972
9973 \begin_layout Plain Layout
9974 1
9975 \end_layout
9976
9977 \end_inset
9978
9979 ] Usually LyX doesn't allow you to insert more than one space between words,
9980  since a space is considered as the separation between two words, not a
9981  character or symbol of its own.
9982  This is a very fine thing but sometimes annoying, for example, when typing
9983  program code or plain LaTeX code.
9984  For this reason, 
9985 \begin_inset Flex CharStyle:Code
9986 status collapsed
9987
9988 \begin_layout Plain Layout
9989 FreeSpacing
9990 \end_layout
9991
9992 \end_inset
9993
9994  can be enabled.
9995  Note that LyX will create protected blanks for the additional blanks when
9996  in another mode than LaTeX-mode.
9997 \end_layout
9998
9999 \begin_layout Description
10000 \begin_inset Flex CharStyle:Code
10001 status collapsed
10002
10003 \begin_layout Plain Layout
10004 HTML*
10005 \end_layout
10006
10007 \end_inset
10008
10009  These tags are used with XHTML output.
10010  See 
10011 \begin_inset CommandInset ref
10012 LatexCommand prettyref
10013 reference "sub:Paragraph-Style-XHTML"
10014
10015 \end_inset
10016
10017 .
10018 \end_layout
10019
10020 \begin_layout Description
10021 \begin_inset Flex CharStyle:Code
10022 status collapsed
10023
10024 \begin_layout Plain Layout
10025 InnerTag
10026 \end_layout
10027
10028 \end_inset
10029
10030  [[FIXME]] (Used only with XML-type formats.)
10031 \end_layout
10032
10033 \begin_layout Description
10034 \begin_inset Flex CharStyle:Code
10035 status collapsed
10036
10037 \begin_layout Plain Layout
10038 InPreamble
10039 \end_layout
10040
10041 \end_inset
10042
10043  
10044 \begin_inset Flex CharStyle:Code
10045 status collapsed
10046
10047 \begin_layout Plain Layout
10048 [1, 0]
10049 \end_layout
10050
10051 \end_inset
10052
10053  If 1, marks the layout as to be included in the document preamble rather
10054  than in the document body.
10055  This is useful for document classes that want such information as the title
10056  and author to appear in the preamble.
10057 \end_layout
10058
10059 \begin_layout Description
10060 \begin_inset Flex CharStyle:Code
10061 status collapsed
10062
10063 \begin_layout Plain Layout
10064 InTitle
10065 \end_layout
10066
10067 \end_inset
10068
10069  
10070 \begin_inset Flex CharStyle:Code
10071 status collapsed
10072
10073 \begin_layout Plain Layout
10074 [1, 0]
10075 \end_layout
10076
10077 \end_inset
10078
10079  If 1, marks the layout as being part of a title block (see also the 
10080 \begin_inset Flex CharStyle:Code
10081 status collapsed
10082
10083 \begin_layout Plain Layout
10084 TitleLatexType
10085 \end_layout
10086
10087 \end_inset
10088
10089  and 
10090 \begin_inset Flex CharStyle:Code
10091 status collapsed
10092
10093 \begin_layout Plain Layout
10094 TitleLatexName
10095 \end_layout
10096
10097 \end_inset
10098
10099  global entries).
10100 \end_layout
10101
10102 \begin_layout Description
10103 \begin_inset Flex CharStyle:Code
10104 status collapsed
10105
10106 \begin_layout Plain Layout
10107 ItemSep
10108 \end_layout
10109
10110 \end_inset
10111
10112  [
10113 \begin_inset Flex CharStyle:Code
10114 status collapsed
10115
10116 \begin_layout Plain Layout
10117 float=0
10118 \end_layout
10119
10120 \end_inset
10121
10122 ] This provides extra space between paragraphs that have the same layout.
10123  If you put other layouts into an environment, each is separated with the
10124  environment's 
10125 \begin_inset Flex CharStyle:Code
10126 status collapsed
10127
10128 \begin_layout Plain Layout
10129 Parsep
10130 \end_layout
10131
10132 \end_inset
10133
10134 .
10135  But the whole items of the environment are additionally separated with
10136  this 
10137 \begin_inset Flex CharStyle:Code
10138 status collapsed
10139
10140 \begin_layout Plain Layout
10141 Itemsep
10142 \end_layout
10143
10144 \end_inset
10145
10146 .
10147  Note that this is a
10148 \emph on
10149  multiplier.
10150 \end_layout
10151
10152 \begin_layout Description
10153 \begin_inset Flex CharStyle:Code
10154 status collapsed
10155
10156 \begin_layout Plain Layout
10157 ItemTag
10158 \end_layout
10159
10160 \end_inset
10161
10162  [[FIXME]] (Used only with XML-type formats.)
10163 \end_layout
10164
10165 \begin_layout Description
10166 \begin_inset Flex CharStyle:Code
10167 status collapsed
10168
10169 \begin_layout Plain Layout
10170 KeepEmpty
10171 \end_layout
10172
10173 \end_inset
10174
10175  
10176 \begin_inset CommandInset label
10177 LatexCommand label
10178 name "des:KeepEmpty"
10179
10180 \end_inset
10181
10182 [
10183 \emph on
10184
10185 \begin_inset Flex CharStyle:Code
10186 status collapsed
10187
10188 \begin_layout Plain Layout
10189
10190 \emph on
10191 0
10192 \end_layout
10193
10194 \end_inset
10195
10196
10197 \emph default
10198
10199 \begin_inset Flex CharStyle:Code
10200 status collapsed
10201
10202 \begin_layout Plain Layout
10203 1
10204 \end_layout
10205
10206 \end_inset
10207
10208 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10209  lead to empty LaTeX output.
10210  There are some cases where this could be desirable however: in a letter
10211  template, the required fields can be provided as empty fields, so that
10212  people do not forget them; in some special classes, a layout can be used
10213  as some kind of break, which does not contain actual text.
10214 \end_layout
10215
10216 \begin_layout Description
10217 \begin_inset Flex CharStyle:Code
10218 status collapsed
10219
10220 \begin_layout Plain Layout
10221 LabelBottomsep
10222 \end_layout
10223
10224 \end_inset
10225
10226  [float=0] The vertical space between the label and the text body.
10227  Only used for labels that are above the text body (
10228 \begin_inset Flex CharStyle:Code
10229 status collapsed
10230
10231 \begin_layout Plain Layout
10232 Top_Environment
10233 \end_layout
10234
10235 \end_inset
10236
10237
10238 \begin_inset Flex CharStyle:Code
10239 status collapsed
10240
10241 \begin_layout Plain Layout
10242 Centered_Top_Environment
10243 \end_layout
10244
10245 \end_inset
10246
10247 ).
10248 \end_layout
10249
10250 \begin_layout Description
10251 \begin_inset Flex CharStyle:Code
10252 status collapsed
10253
10254 \begin_layout Plain Layout
10255 LabelCounter
10256 \end_layout
10257
10258 \end_inset
10259
10260  [
10261 \begin_inset Flex CharStyle:Code
10262 status collapsed
10263
10264 \begin_layout Plain Layout
10265 string=""
10266 \end_layout
10267
10268 \end_inset
10269
10270 ]
10271 \begin_inset Newline newline
10272 \end_inset
10273
10274 The name of the counter for automatic numbering.
10275  
10276 \begin_inset Newline newline
10277 \end_inset
10278
10279 This 
10280 \emph on
10281 must
10282 \emph default
10283  be given if 
10284 \begin_inset Flex CharStyle:Code
10285 status collapsed
10286
10287 \begin_layout Plain Layout
10288 LabelType
10289 \end_layout
10290
10291 \end_inset
10292
10293  is 
10294 \begin_inset Flex CharStyle:Code
10295 status collapsed
10296
10297 \begin_layout Plain Layout
10298 Counter
10299 \end_layout
10300
10301 \end_inset
10302
10303 .
10304  In that case, the counter will be stepped each time the layout appears.
10305  
10306 \begin_inset Newline newline
10307 \end_inset
10308
10309 This 
10310 \emph on
10311 may
10312 \emph default
10313  also be given if 
10314 \begin_inset Flex CharStyle:Code
10315 status collapsed
10316
10317 \begin_layout Plain Layout
10318 LabelType
10319 \end_layout
10320
10321 \end_inset
10322
10323  is 
10324 \begin_inset Flex CharStyle:Code
10325 status collapsed
10326
10327 \begin_layout Plain Layout
10328 Enumerate
10329 \end_layout
10330
10331 \end_inset
10332
10333 , though this case is a bit complicated.
10334  Suppose you declare 
10335 \begin_inset Quotes eld
10336 \end_inset
10337
10338
10339 \begin_inset Flex CharStyle:Code
10340 status collapsed
10341
10342 \begin_layout Plain Layout
10343 LabelCounter myenum
10344 \end_layout
10345
10346 \end_inset
10347
10348
10349 \begin_inset Quotes erd
10350 \end_inset
10351
10352 .
10353  Then the actual counters used are 
10354 \begin_inset Flex CharStyle:Code
10355 status collapsed
10356
10357 \begin_layout Plain Layout
10358 myenumi
10359 \end_layout
10360
10361 \end_inset
10362
10363
10364 \begin_inset Flex CharStyle:Code
10365 status collapsed
10366
10367 \begin_layout Plain Layout
10368 myenumii
10369 \end_layout
10370
10371 \end_inset
10372
10373
10374 \begin_inset Flex CharStyle:Code
10375 status collapsed
10376
10377 \begin_layout Plain Layout
10378 myenumiii
10379 \end_layout
10380
10381 \end_inset
10382
10383 , and 
10384 \begin_inset Flex CharStyle:Code
10385 status collapsed
10386
10387 \begin_layout Plain Layout
10388 myenumiv
10389 \end_layout
10390
10391 \end_inset
10392
10393 , much as in LaTeX.
10394  These counters must all be declared separately.
10395 \begin_inset Newline newline
10396 \end_inset
10397
10398 See Section 
10399 \begin_inset CommandInset ref
10400 LatexCommand ref
10401 reference "sub:Counters"
10402
10403 \end_inset
10404
10405  for details on counters.
10406 \end_layout
10407
10408 \begin_layout Description
10409 \begin_inset Flex CharStyle:Code
10410 status collapsed
10411
10412 \begin_layout Plain Layout
10413 LabelFont
10414 \end_layout
10415
10416 \end_inset
10417
10418  The font used for the label.
10419  See section
10420 \begin_inset space ~
10421 \end_inset
10422
10423
10424 \begin_inset CommandInset ref
10425 LatexCommand ref
10426 reference "sub:Font-description"
10427
10428 \end_inset
10429
10430 .
10431 \end_layout
10432
10433 \begin_layout Description
10434 \begin_inset Flex CharStyle:Code
10435 status collapsed
10436
10437 \begin_layout Plain Layout
10438 LabelIndent
10439 \end_layout
10440
10441 \end_inset
10442
10443  Text that indicates how far a label should be indented.
10444 \end_layout
10445
10446 \begin_layout Description
10447 \begin_inset Flex CharStyle:Code
10448 status collapsed
10449
10450 \begin_layout Plain Layout
10451 Labelsep
10452 \end_layout
10453
10454 \end_inset
10455
10456  [
10457 \begin_inset Flex CharStyle:Code
10458 status collapsed
10459
10460 \begin_layout Plain Layout
10461 string=""
10462 \end_layout
10463
10464 \end_inset
10465
10466 ] The horizontal space between the label and the text body.
10467  Only used for labels that are not above the text body.
10468 \end_layout
10469
10470 \begin_layout Description
10471 \begin_inset Flex CharStyle:Code
10472 status collapsed
10473
10474 \begin_layout Plain Layout
10475 LabelString
10476 \end_layout
10477
10478 \end_inset
10479
10480  [
10481 \begin_inset Flex CharStyle:Code
10482 status collapsed
10483
10484 \begin_layout Plain Layout
10485 string=""
10486 \end_layout
10487
10488 \end_inset
10489
10490 ] The string used for a label with a 
10491 \begin_inset Flex CharStyle:Code
10492 status collapsed
10493
10494 \begin_layout Plain Layout
10495 Static
10496 \end_layout
10497
10498 \end_inset
10499
10500  labeltype.
10501  When 
10502 \begin_inset Flex CharStyle:Code
10503 status collapsed
10504
10505 \begin_layout Plain Layout
10506 LabelCounter
10507 \end_layout
10508
10509 \end_inset
10510
10511  is set, this string can be contain the special formatting commands described
10512  in Section 
10513 \begin_inset CommandInset ref
10514 LatexCommand ref
10515 reference "sub:Counters"
10516
10517 \end_inset
10518
10519 .
10520 \begin_inset Foot
10521 status collapsed
10522
10523 \begin_layout Plain Layout
10524 For the sake of backwards compatibility, the string 
10525 \begin_inset Flex CharStyle:Code
10526 status collapsed
10527
10528 \begin_layout Plain Layout
10529 @
10530 \emph on
10531 style-name
10532 \emph default
10533 @
10534 \end_layout
10535
10536 \end_inset
10537
10538  will be replaced by the expanded 
10539 \begin_inset Flex CharStyle:Code
10540 status collapsed
10541
10542 \begin_layout Plain Layout
10543 LabelString
10544 \end_layout
10545
10546 \end_inset
10547
10548  of style 
10549 \begin_inset Flex CharStyle:Code
10550 status collapsed
10551
10552 \begin_layout Plain Layout
10553
10554 \emph on
10555 style-name
10556 \end_layout
10557
10558 \end_inset
10559
10560 .
10561  This feature is now obsolete and should be replaced by the mechanisms of
10562  Section 
10563 \begin_inset CommandInset ref
10564 LatexCommand ref
10565 reference "sub:Counters"
10566
10567 \end_inset
10568
10569 .
10570 \end_layout
10571
10572 \end_inset
10573
10574
10575 \end_layout
10576
10577 \begin_layout Description
10578 \begin_inset Flex CharStyle:Code
10579 status collapsed
10580
10581 \begin_layout Plain Layout
10582 LabelStringAppendix
10583 \end_layout
10584
10585 \end_inset
10586
10587  [
10588 \begin_inset Flex CharStyle:Code
10589 status collapsed
10590
10591 \begin_layout Plain Layout
10592 string=""
10593 \end_layout
10594
10595 \end_inset
10596
10597 ] This is used inside the appendix instead of 
10598 \begin_inset Flex CharStyle:Code
10599 status collapsed
10600
10601 \begin_layout Plain Layout
10602 LabelString
10603 \end_layout
10604
10605 \end_inset
10606
10607 .
10608  Note that every 
10609 \begin_inset Flex CharStyle:Code
10610 status collapsed
10611
10612 \begin_layout Plain Layout
10613 LabelString
10614 \end_layout
10615
10616 \end_inset
10617
10618  statement resets 
10619 \begin_inset Flex CharStyle:Code
10620 status collapsed
10621
10622 \begin_layout Plain Layout
10623 LabelStringAppendix
10624 \end_layout
10625
10626 \end_inset
10627
10628  too.
10629 \end_layout
10630
10631 \begin_layout Description
10632 \begin_inset Flex CharStyle:Code
10633 status collapsed
10634
10635 \begin_layout Plain Layout
10636 LabelTag
10637 \end_layout
10638
10639 \end_inset
10640
10641  [FIXME] (Used only with XML-type formats.)
10642 \end_layout
10643
10644 \begin_layout Description
10645 \begin_inset Flex CharStyle:Code
10646 status collapsed
10647
10648 \begin_layout Plain Layout
10649 LabelType
10650 \end_layout
10651
10652 \end_inset
10653
10654  [
10655 \begin_inset Flex CharStyle:Code
10656 status collapsed
10657
10658 \begin_layout Plain Layout
10659
10660 \emph on
10661 No_Label
10662 \emph default
10663 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10664  Enumerate, Itemize, Bibliography
10665 \end_layout
10666
10667 \end_inset
10668
10669
10670 \end_layout
10671
10672 \begin_deeper
10673 \begin_layout Itemize
10674 \begin_inset Flex CharStyle:Code
10675 status collapsed
10676
10677 \begin_layout Plain Layout
10678 Manual
10679 \end_layout
10680
10681 \end_inset
10682
10683  means the label is the very first word (up to the first real blank).
10684  Use protected spaces (like
10685 \begin_inset space ~
10686 \end_inset
10687
10688 that one) if you want more than one word as the label.
10689  
10690 \end_layout
10691
10692 \begin_layout Itemize
10693 \begin_inset Flex CharStyle:Code
10694 status collapsed
10695
10696 \begin_layout Plain Layout
10697 Static
10698 \end_layout
10699
10700 \end_inset
10701
10702  means the label is simply whatever 
10703 \begin_inset Flex CharStyle:Code
10704 status collapsed
10705
10706 \begin_layout Plain Layout
10707 LabelString
10708 \end_layout
10709
10710 \end_inset
10711
10712  declares it to be.
10713  Note that this really is `static'.
10714 \end_layout
10715
10716 \begin_layout Itemize
10717 \begin_inset Flex CharStyle:Code
10718 status collapsed
10719
10720 \begin_layout Plain Layout
10721 Top_Environment
10722 \end_layout
10723
10724 \end_inset
10725
10726  and 
10727 \begin_inset Flex CharStyle:Code
10728 status collapsed
10729
10730 \begin_layout Plain Layout
10731 Centered_Top_Environment
10732 \end_layout
10733
10734 \end_inset
10735
10736  are special cases of 
10737 \begin_inset Flex CharStyle:Code
10738 status collapsed
10739
10740 \begin_layout Plain Layout
10741 Static
10742 \end_layout
10743
10744 \end_inset
10745
10746 .
10747  The label will be printed above the paragraph, but only at the top of an
10748  environment or the top of a chain of paragraphs with this layout.
10749  This might be used with the 
10750 \begin_inset Flex CharStyle:MenuItem
10751 status collapsed
10752
10753 \begin_layout Plain Layout
10754 Abstract
10755 \end_layout
10756
10757 \end_inset
10758
10759  layout, for example.
10760 \end_layout
10761
10762 \begin_layout Itemize
10763 \begin_inset Flex CharStyle:Code
10764 status collapsed
10765
10766 \begin_layout Plain Layout
10767 Sensitive
10768 \end_layout
10769
10770 \end_inset
10771
10772  is a special case for the caption-labels 
10773 \begin_inset Quotes eld
10774 \end_inset
10775
10776 Figure
10777 \begin_inset Quotes erd
10778 \end_inset
10779
10780  and 
10781 \begin_inset Quotes eld
10782 \end_inset
10783
10784 Table
10785 \begin_inset Quotes erd
10786 \end_inset
10787
10788 .
10789  
10790 \begin_inset Flex CharStyle:Code
10791 status collapsed
10792
10793 \begin_layout Plain Layout
10794 Sensitive
10795 \end_layout
10796
10797 \end_inset
10798
10799  means the (hardcoded) label string depends on the kind of float: It is
10800  hardcoded to be `FloatType N', where N is the value of the counter associated
10801  with the float.
10802 \end_layout
10803
10804 \begin_layout Itemize
10805 The 
10806 \begin_inset Flex CharStyle:Code
10807 status collapsed
10808
10809 \begin_layout Plain Layout
10810 Counter
10811 \end_layout
10812
10813 \end_inset
10814
10815  label type defines automatically numbered labels.
10816  The 
10817 \begin_inset Flex CharStyle:Code
10818 status collapsed
10819
10820 \begin_layout Plain Layout
10821 LabelString
10822 \end_layout
10823
10824 \end_inset
10825
10826  will be expanded to resolve any counter references it contains: For example,
10827  it might be 
10828 \begin_inset Quotes eld
10829 \end_inset
10830
10831
10832 \begin_inset Flex CharStyle:Code
10833 status collapsed
10834
10835 \begin_layout Plain Layout
10836 Section 
10837 \backslash
10838 thechapter.
10839 \backslash
10840 thesection
10841 \end_layout
10842
10843 \end_inset
10844
10845
10846 \begin_inset Quotes erd
10847 \end_inset
10848
10849 .
10850  See Section 
10851 \begin_inset CommandInset ref
10852 LatexCommand ref
10853 reference "sub:Counters"
10854
10855 \end_inset
10856
10857  for more information on counters.
10858 \end_layout
10859
10860 \begin_layout Itemize
10861 \begin_inset Flex CharStyle:Code
10862 status collapsed
10863
10864 \begin_layout Plain Layout
10865 Enumerate
10866 \end_layout
10867
10868 \end_inset
10869
10870  produces the usual sort of enumeration labels.
10871  At present, it is hardcoded to use Arabic numerals, lowercase letters,
10872  small Roman numerals, and uppercase letters for the four possible depths.
10873 \end_layout
10874
10875 \begin_layout Itemize
10876 \begin_inset Flex CharStyle:Code
10877 status collapsed
10878
10879 \begin_layout Plain Layout
10880 Itemize
10881 \end_layout
10882
10883 \end_inset
10884
10885  produces various bullets at the different levels.
10886  It is also hardcoded.
10887 \end_layout
10888
10889 \begin_layout Itemize
10890 \begin_inset Flex CharStyle:Code
10891 status collapsed
10892
10893 \begin_layout Plain Layout
10894 Bibliography
10895 \end_layout
10896
10897 \end_inset
10898
10899  is used internally by LyX and should be used only with 
10900 \begin_inset Flex CharStyle:Code
10901 status collapsed
10902
10903 \begin_layout Plain Layout
10904 LatexType BibEnvironment
10905 \end_layout
10906
10907 \end_inset
10908
10909 .
10910 \end_layout
10911
10912 \end_deeper
10913 \begin_layout Description
10914 \begin_inset Flex CharStyle:Code
10915 status collapsed
10916
10917 \begin_layout Plain Layout
10918 LangPreamble
10919 \end_layout
10920
10921 \end_inset
10922
10923  Like 
10924 \begin_inset Flex CharStyle:Code
10925 status collapsed
10926
10927 \begin_layout Plain Layout
10928 BabelPreamble
10929 \end_layout
10930
10931 \end_inset
10932
10933 , but this preamble snippet occurs independently from the babel package,
10934  and only for the document language.
10935  Must end with 
10936 \begin_inset Quotes eld
10937 \end_inset
10938
10939
10940 \begin_inset Flex CharStyle:Code
10941 status collapsed
10942
10943 \begin_layout Plain Layout
10944 EndLangPreamble
10945 \end_layout
10946
10947 \end_inset
10948
10949
10950 \begin_inset Quotes erd
10951 \end_inset
10952
10953 .
10954 \end_layout
10955
10956 \begin_deeper
10957 \begin_layout Standard
10958 If the style defines text that appears in the typeset document, it may use
10959  
10960 \begin_inset Flex CharStyle:Code
10961 status collapsed
10962
10963 \begin_layout Plain Layout
10964 LangPreamble
10965 \end_layout
10966
10967 \end_inset
10968
10969  and 
10970 \begin_inset Flex CharStyle:Code
10971 status collapsed
10972
10973 \begin_layout Plain Layout
10974 BabelPreamble
10975 \end_layout
10976
10977 \end_inset
10978
10979  to support non-english and even multilanguage documents correctly.
10980  The following excerpt (from the 
10981 \begin_inset Flex CharStyle:Code
10982 status collapsed
10983
10984 \begin_layout Plain Layout
10985 theorems-ams.inc
10986 \end_layout
10987
10988 \end_inset
10989
10990  file) shows how this works:
10991 \end_layout
10992
10993 \begin_layout LyX-Code
10994 Preamble
10995 \end_layout
10996
10997 \begin_layout LyX-Code
10998   
10999 \backslash
11000 theoremstyle{remark}
11001 \end_layout
11002
11003 \begin_layout LyX-Code
11004   
11005 \backslash
11006 newtheorem{claim}[thm]{
11007 \backslash
11008 protect
11009 \backslash
11010 claimname}
11011 \end_layout
11012
11013 \begin_layout LyX-Code
11014 EndPreamble
11015 \end_layout
11016
11017 \begin_layout LyX-Code
11018 LangPreamble
11019 \end_layout
11020
11021 \begin_layout LyX-Code
11022   
11023 \backslash
11024 providecommand{
11025 \backslash
11026 claimname}{_(Claim)}
11027 \end_layout
11028
11029 \begin_layout LyX-Code
11030
11031 \end_layout
11032
11033 \begin_layout LyX-Code
11034 EndLangPreamble
11035 \end_layout
11036
11037 \begin_layout LyX-Code
11038 BabelPreamble
11039 \end_layout
11040
11041 \begin_layout LyX-Code
11042     
11043 \backslash
11044 addto
11045 \backslash
11046 captions$$lang{
11047 \backslash
11048 renewcommand{
11049 \backslash
11050 claimname}{_(Claim)}}
11051 \end_layout
11052
11053 \begin_layout LyX-Code
11054 EndBabelPreamble
11055 \end_layout
11056
11057 \begin_layout Standard
11058 The key to correct translation of the user visible text is the definition
11059  of the command 
11060 \begin_inset Flex CharStyle:Code
11061 status collapsed
11062
11063 \begin_layout Plain Layout
11064
11065 \backslash
11066 claimname
11067 \end_layout
11068
11069 \end_inset
11070
11071  in the language preamble.
11072  This command holds the name of the theorem that will appear in the output.
11073  The 
11074 \begin_inset Flex CharStyle:Code
11075 status collapsed
11076
11077 \begin_layout Plain Layout
11078 BabelPreamble
11079 \end_layout
11080
11081 \end_inset
11082
11083  then uses the commands offered by the babel package to redefine 
11084 \begin_inset Flex CharStyle:Code
11085 status collapsed
11086
11087 \begin_layout Plain Layout
11088
11089 \backslash
11090 claimname
11091 \end_layout
11092
11093 \end_inset
11094
11095  for each used language in multilanguage documents.
11096 \end_layout
11097
11098 \end_deeper
11099 \begin_layout Description
11100 \begin_inset Flex CharStyle:Code
11101 status collapsed
11102
11103 \begin_layout Plain Layout
11104 LatexName
11105 \end_layout
11106
11107 \end_inset
11108
11109  The name of the corresponding LaTeX stuff.
11110  Either the environment or command name.
11111 \end_layout
11112
11113 \begin_layout Description
11114 \begin_inset Flex CharStyle:Code
11115 status collapsed
11116
11117 \begin_layout Plain Layout
11118 LatexParam
11119 \end_layout
11120
11121 \end_inset
11122
11123  An optional parameter for the corresponding 
11124 \begin_inset Flex CharStyle:Code
11125 status collapsed
11126
11127 \begin_layout Plain Layout
11128 LatexName
11129 \end_layout
11130
11131 \end_inset
11132
11133  stuff.
11134  This parameter cannot be changed from within LyX.
11135 \end_layout
11136
11137 \begin_layout Description
11138 \begin_inset Flex CharStyle:Code
11139 status collapsed
11140
11141 \begin_layout Plain Layout
11142 LatexType
11143 \end_layout
11144
11145 \end_inset
11146
11147  
11148 \begin_inset CommandInset label
11149 LatexCommand label
11150 name "des:LatexType"
11151
11152 \end_inset
11153
11154 [
11155 \begin_inset Flex CharStyle:Code
11156 status collapsed
11157
11158 \begin_layout Plain Layout
11159
11160 \emph on
11161 Paragraph
11162 \emph default
11163 , Command, Environment, Item_Environment,
11164 \end_layout
11165
11166 \end_inset
11167
11168  
11169 \begin_inset Flex CharStyle:Code
11170 status collapsed
11171
11172 \begin_layout Plain Layout
11173 List_Environment, Bib_Environment
11174 \end_layout
11175
11176 \end_inset
11177
11178 ] How the layout should be translated into LaTeX.
11179 \begin_inset Foot
11180 status collapsed
11181
11182 \begin_layout Plain Layout
11183 \begin_inset Flex CharStyle:Code
11184 status collapsed
11185
11186 \begin_layout Plain Layout
11187 LatexType
11188 \end_layout
11189
11190 \end_inset
11191
11192  is perhaps a bit misleading, since these rules apply to SGML classes, too.
11193  Visit the SGML class files for specific examples.
11194 \end_layout
11195
11196 \end_inset
11197
11198
11199 \end_layout
11200
11201 \begin_deeper
11202 \begin_layout Itemize
11203 \begin_inset Flex CharStyle:Code
11204 status collapsed
11205
11206 \begin_layout Plain Layout
11207 Paragraph
11208 \end_layout
11209
11210 \end_inset
11211
11212  means nothing special.
11213  
11214 \end_layout
11215
11216 \begin_layout Itemize
11217 \begin_inset Flex CharStyle:Code
11218 status collapsed
11219
11220 \begin_layout Plain Layout
11221 Command
11222 \end_layout
11223
11224 \end_inset
11225
11226  means 
11227 \begin_inset Flex CharStyle:Code
11228 status collapsed
11229
11230 \begin_layout Plain Layout
11231
11232 \backslash
11233
11234 \emph on
11235 LatexName
11236 \emph default
11237 {\SpecialChar \ldots{}
11238 }
11239 \end_layout
11240
11241 \end_inset
11242
11243 .
11244 \end_layout
11245
11246 \begin_layout Itemize
11247 \begin_inset Flex CharStyle:Code
11248 status collapsed
11249
11250 \begin_layout Plain Layout
11251 Environment
11252 \end_layout
11253
11254 \end_inset
11255
11256  means 
11257 \begin_inset Flex CharStyle:Code
11258 status collapsed
11259
11260 \begin_layout Plain Layout
11261
11262 \backslash
11263 begin{
11264 \emph on
11265 LatexName
11266 \emph default
11267 }\SpecialChar \ldots{}
11268
11269 \backslash
11270 end{
11271 \emph on
11272 LatexName
11273 \emph default
11274 }
11275 \end_layout
11276
11277 \end_inset
11278
11279 .
11280  
11281 \end_layout
11282
11283 \begin_layout Itemize
11284 \begin_inset Flex CharStyle:Code
11285 status collapsed
11286
11287 \begin_layout Plain Layout
11288 Item_Environment
11289 \end_layout
11290
11291 \end_inset
11292
11293  is the same as 
11294 \begin_inset Flex CharStyle:Code
11295 status collapsed
11296
11297 \begin_layout Plain Layout
11298 Environment
11299 \end_layout
11300
11301 \end_inset
11302
11303 , except that an 
11304 \begin_inset Flex CharStyle:Code
11305 status collapsed
11306
11307 \begin_layout Plain Layout
11308
11309 \backslash
11310 item
11311 \end_layout
11312
11313 \end_inset
11314
11315  is generated for each paragraph of this environment.
11316  
11317 \end_layout
11318
11319 \begin_layout Itemize
11320 \begin_inset Flex CharStyle:Code
11321 status collapsed
11322
11323 \begin_layout Plain Layout
11324 List_Environment
11325 \end_layout
11326
11327 \end_inset
11328
11329  is the same as 
11330 \begin_inset Flex CharStyle:Code
11331 status collapsed
11332
11333 \begin_layout Plain Layout
11334 Item_Environment
11335 \end_layout
11336
11337 \end_inset
11338
11339 , except that 
11340 \begin_inset Flex CharStyle:Code
11341 status collapsed
11342
11343 \begin_layout Plain Layout
11344 LabelWidthString
11345 \end_layout
11346
11347 \end_inset
11348
11349  is passed as an argument to the environment.
11350  
11351 \begin_inset Flex CharStyle:Code
11352 status collapsed
11353
11354 \begin_layout Plain Layout
11355 LabelWidthString
11356 \end_layout
11357
11358 \end_inset
11359
11360  can be defined in the 
11361 \begin_inset Flex CharStyle:MenuItem
11362 status collapsed
11363
11364 \begin_layout Plain Layout
11365
11366 \bar under
11367 L
11368 \bar default
11369 ayout\SpecialChar \menuseparator
11370
11371 \bar under
11372 P
11373 \bar default
11374 aragraph
11375 \end_layout
11376
11377 \end_inset
11378
11379  dialog.
11380  
11381 \end_layout
11382
11383 \begin_layout Standard
11384 Putting the last few things together, the LaTeX output will be either: 
11385 \end_layout
11386
11387 \begin_layout LyX-Code
11388
11389 \backslash
11390 latexname[latexparam]{\SpecialChar \ldots{}
11391 }
11392 \end_layout
11393
11394 \begin_layout Standard
11395 or: 
11396 \end_layout
11397
11398 \begin_layout LyX-Code
11399
11400 \backslash
11401 begin{latexname}[latexparam] \SpecialChar \ldots{}
11402  
11403 \backslash
11404 end{latexname}.
11405 \end_layout
11406
11407 \begin_layout Standard
11408 depending upon the LaTeX type.
11409 \end_layout
11410
11411 \end_deeper
11412 \begin_layout Description
11413 \begin_inset Flex CharStyle:Code
11414 status collapsed
11415
11416 \begin_layout Plain Layout
11417 LeftMargin
11418 \end_layout
11419
11420 \end_inset
11421
11422  [
11423 \begin_inset Flex CharStyle:Code
11424 status collapsed
11425
11426 \begin_layout Plain Layout
11427 string=""
11428 \end_layout
11429
11430 \end_inset
11431
11432 ] If you put layouts into environments, the leftmargins are not simply added,
11433  but added with a factor 
11434 \begin_inset Formula $\frac{4}{depth+4}$
11435 \end_inset
11436
11437 .
11438  Note that this parameter is also used when the margin is defined as 
11439 \begin_inset Flex CharStyle:Code
11440 status collapsed
11441
11442 \begin_layout Plain Layout
11443 Manual
11444 \end_layout
11445
11446 \end_inset
11447
11448  or 
11449 \begin_inset Flex CharStyle:Code
11450 status collapsed
11451
11452 \begin_layout Plain Layout
11453 Dynamic
11454 \end_layout
11455
11456 \end_inset
11457
11458 .
11459  Then it is added to the manual or dynamic margin.
11460  
11461 \begin_inset Newline newline
11462 \end_inset
11463
11464 The argument is passed as a string.
11465  For example 
11466 \begin_inset Quotes eld
11467 \end_inset
11468
11469
11470 \begin_inset Flex CharStyle:Code
11471 status collapsed
11472
11473 \begin_layout Plain Layout
11474 MM
11475 \end_layout
11476
11477 \end_inset
11478
11479
11480 \begin_inset Quotes erd
11481 \end_inset
11482
11483  means that the paragraph is indented with the width of 
11484 \begin_inset Quotes eld
11485 \end_inset
11486
11487
11488 \begin_inset Flex CharStyle:Code
11489 status collapsed
11490
11491 \begin_layout Plain Layout
11492 MM
11493 \end_layout
11494
11495 \end_inset
11496
11497
11498 \begin_inset Quotes erd
11499 \end_inset
11500
11501  in the normal font.
11502  You can get a negative width by prefixing the string with 
11503 \begin_inset Quotes eld
11504 \end_inset
11505
11506
11507 \begin_inset Flex CharStyle:Code
11508 status collapsed
11509
11510 \begin_layout Plain Layout
11511 -
11512 \end_layout
11513
11514 \end_inset
11515
11516
11517 \begin_inset Quotes erd
11518 \end_inset
11519
11520 .
11521  This way was chosen so that the look is the same with each used screen
11522  font.
11523  
11524 \end_layout
11525
11526 \begin_layout Description
11527 \begin_inset Flex CharStyle:Code
11528 status collapsed
11529
11530 \begin_layout Plain Layout
11531 Margin
11532 \end_layout
11533
11534 \end_inset
11535
11536  [
11537 \begin_inset Flex CharStyle:Code
11538 status collapsed
11539
11540 \begin_layout Plain Layout
11541
11542 \emph on
11543 Static
11544 \emph default
11545 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11546 \end_layout
11547
11548 \end_inset
11549
11550
11551 \begin_inset Newline newline
11552 \end_inset
11553
11554 The kind of margin that the layout has on the left side.
11555  
11556 \begin_inset Flex CharStyle:Code
11557 status collapsed
11558
11559 \begin_layout Plain Layout
11560 Static
11561 \end_layout
11562
11563 \end_inset
11564
11565  just means a fixed margin.
11566  
11567 \begin_inset Flex CharStyle:Code
11568 status collapsed
11569
11570 \begin_layout Plain Layout
11571 Manual
11572 \end_layout
11573
11574 \end_inset
11575
11576  means that the left margin depends on the string entered in the 
11577 \begin_inset Flex CharStyle:MenuItem
11578 status collapsed
11579
11580 \begin_layout Plain Layout
11581 Edit\SpecialChar \menuseparator
11582 Paragraph
11583 \begin_inset space ~
11584 \end_inset
11585
11586 Settings
11587 \end_layout
11588
11589 \end_inset
11590
11591  dialog.
11592  This is used to typeset nice lists without tabulators.
11593  
11594 \begin_inset Flex CharStyle:Code
11595 status collapsed
11596
11597 \begin_layout Plain Layout
11598 Dynamic
11599 \end_layout
11600
11601 \end_inset
11602
11603  means that the margin depends on the size of the label.
11604  This is used for automatic enumerated headlines.
11605  It is obvious that the headline 
11606 \begin_inset Quotes eld
11607 \end_inset
11608
11609 5.4.3.2.1 Very long headline
11610 \begin_inset Quotes erd
11611 \end_inset
11612
11613  must have a wider left margin (as wide as 
11614 \begin_inset Quotes eld
11615 \end_inset
11616
11617 5.4.3.2.1
11618 \begin_inset Quotes erd
11619 \end_inset
11620
11621  plus the space) than 
11622 \begin_inset Quotes eld
11623 \end_inset
11624
11625 3.2 Very long headline
11626 \begin_inset Quotes erd
11627 \end_inset
11628
11629 , even if standard 
11630 \begin_inset Quotes eld
11631 \end_inset
11632
11633 word processors
11634 \begin_inset Quotes erd
11635 \end_inset
11636
11637  are not able to do this.
11638  
11639 \begin_inset Flex CharStyle:Code
11640 status collapsed
11641
11642 \begin_layout Plain Layout
11643 First_Dynamic
11644 \end_layout
11645
11646 \end_inset
11647
11648  is similar, but only the very first row of the paragraph is dynamic, while
11649  the others are static; this is used, for example, for descriptions.
11650  
11651 \begin_inset Flex CharStyle:Code
11652 status collapsed
11653
11654 \begin_layout Plain Layout
11655 Right_Address_Box
11656 \end_layout
11657
11658 \end_inset
11659
11660  means the margin is chosen in a way that the longest row of this paragraph
11661  fits to the right margin.
11662  This is used to typeset an address on the right edge of the page.
11663 \end_layout
11664
11665 \begin_layout Description
11666 \begin_inset Flex CharStyle:Code
11667 status collapsed
11668
11669 \begin_layout Plain Layout
11670 NeedProtect
11671 \end_layout
11672
11673 \end_inset
11674
11675  [
11676 \begin_inset Flex CharStyle:Code
11677 status collapsed
11678
11679 \begin_layout Plain Layout
11680
11681 \emph on
11682 0
11683 \end_layout
11684
11685 \end_inset
11686
11687 ,
11688 \begin_inset Flex CharStyle:Code
11689 status collapsed
11690
11691 \begin_layout Plain Layout
11692 1
11693 \end_layout
11694
11695 \end_inset
11696
11697 ] Whether fragile commands in this layout should be 
11698 \begin_inset Flex CharStyle:Code
11699 status collapsed
11700
11701 \begin_layout Plain Layout
11702
11703 \backslash
11704 protect
11705 \end_layout
11706
11707 \end_inset
11708
11709 'ed.
11710  (Note: This is 
11711 \emph on
11712 not
11713 \emph default
11714  whether this command should itself be protected.)
11715 \end_layout
11716
11717 \begin_layout Description
11718 \begin_inset Flex CharStyle:Code
11719 status collapsed
11720
11721 \begin_layout Plain Layout
11722 Newline
11723 \end_layout
11724
11725 \end_inset
11726
11727  [
11728 \begin_inset Flex CharStyle:Code
11729 status collapsed
11730
11731 \begin_layout Plain Layout
11732 0
11733 \end_layout
11734
11735 \end_inset
11736
11737
11738 \begin_inset Flex CharStyle:Code
11739 status collapsed
11740
11741 \begin_layout Plain Layout
11742
11743 \emph on
11744 1
11745 \end_layout
11746
11747 \end_inset
11748
11749 ] Whether newlines are translated into LaTeX newlines (
11750 \begin_inset Flex CharStyle:Code
11751 status collapsed
11752
11753 \begin_layout Plain Layout
11754
11755 \backslash
11756
11757 \backslash
11758
11759 \end_layout
11760
11761 \end_inset
11762
11763 ) or not.
11764  The translation can be switched off to allow more comfortable LaTeX editing
11765  inside LyX.
11766 \end_layout
11767
11768 \begin_layout Description
11769 \begin_inset Flex CharStyle:Code
11770 status collapsed
11771
11772 \begin_layout Plain Layout
11773 NextNoIndent
11774 \end_layout
11775
11776 \end_inset
11777
11778  [
11779 \begin_inset Flex CharStyle:Code
11780 status collapsed
11781
11782 \begin_layout Plain Layout
11783 1
11784 \end_layout
11785
11786 \end_inset
11787
11788
11789 \begin_inset Flex CharStyle:Code
11790 status collapsed
11791
11792 \begin_layout Plain Layout
11793
11794 \emph on
11795 0
11796 \end_layout
11797
11798 \end_inset
11799
11800 ] Whether the following Paragraph is allowed to indent its very first row.
11801  
11802 \begin_inset Flex CharStyle:Code
11803 status collapsed
11804
11805 \begin_layout Plain Layout
11806 1
11807 \end_layout
11808
11809 \end_inset
11810
11811  means that it is not allowed to do so; 
11812 \begin_inset Flex CharStyle:Code
11813 status collapsed
11814
11815 \begin_layout Plain Layout
11816 0
11817 \end_layout
11818
11819 \end_inset
11820
11821  means it could do so if it wants to.
11822 \end_layout
11823
11824 \begin_layout Description
11825 \begin_inset Flex CharStyle:Code
11826 status collapsed
11827
11828 \begin_layout Plain Layout
11829 ObsoletedBy
11830 \end_layout
11831
11832 \end_inset
11833
11834  Name of a layout that has replaced this layout.
11835  This is used to rename a layout, while keeping backward compatibility.
11836 \end_layout
11837
11838 \begin_layout Description
11839 \begin_inset Flex CharStyle:Code
11840 status collapsed
11841
11842 \begin_layout Plain Layout
11843 OptionalArgs
11844 \end_layout
11845
11846 \end_inset
11847
11848  [
11849 \begin_inset Flex CharStyle:Code
11850 status collapsed
11851
11852 \begin_layout Plain Layout
11853 int=0
11854 \end_layout
11855
11856 \end_inset
11857
11858 ] The number of optional arguments that can be used with this layout.
11859  This is useful for things like section headings, and only makes sense with
11860  LaTeX.
11861 \end_layout
11862
11863 \begin_layout Description
11864 \begin_inset Flex CharStyle:Code
11865 status collapsed
11866
11867 \begin_layout Plain Layout
11868 ParIndent
11869 \end_layout
11870
11871 \end_inset
11872
11873  [
11874 \begin_inset Flex CharStyle:Code
11875 status collapsed
11876
11877 \begin_layout Plain Layout
11878 string=""
11879 \end_layout
11880
11881 \end_inset
11882
11883 ] The indent of the very first line of a paragraph.
11884  The 
11885 \begin_inset Flex CharStyle:Code
11886 status collapsed
11887
11888 \begin_layout Plain Layout
11889 Parindent
11890 \end_layout
11891
11892 \end_inset
11893
11894  will be fixed for a certain layout.
11895  The exception is Standard layout, since the indentation of a Standard layout
11896  paragraph can be prohibited with 
11897 \begin_inset Flex CharStyle:Code
11898 status collapsed
11899
11900 \begin_layout Plain Layout
11901 NextNoIndent
11902 \end_layout
11903
11904 \end_inset
11905
11906 .
11907  Also, Standard layout paragraphs inside environments use the 
11908 \begin_inset Flex CharStyle:Code
11909 status collapsed
11910
11911 \begin_layout Plain Layout
11912 Parindent
11913 \end_layout
11914
11915 \end_inset
11916
11917  of the environment, not their native one.
11918  For example, Standard paragraphs inside an enumeration are not indented.
11919 \end_layout
11920
11921 \begin_layout Description
11922 \begin_inset Flex CharStyle:Code
11923 status collapsed
11924
11925 \begin_layout Plain Layout
11926 Parsep
11927 \end_layout
11928
11929 \end_inset
11930
11931  [
11932 \begin_inset Flex CharStyle:Code
11933 status collapsed
11934
11935 \begin_layout Plain Layout
11936 float=0
11937 \end_layout
11938
11939 \end_inset
11940
11941 ] The vertical space between two paragraphs of this layout.
11942 \end_layout
11943
11944 \begin_layout Description
11945 \begin_inset Flex CharStyle:Code
11946 status collapsed
11947
11948 \begin_layout Plain Layout
11949 Parskip
11950 \end_layout
11951
11952 \end_inset
11953
11954  [
11955 \begin_inset Flex CharStyle:Code
11956 status collapsed
11957
11958 \begin_layout Plain Layout
11959 float=0
11960 \end_layout
11961
11962 \end_inset
11963
11964 ] LyX allows the user to choose either 
11965 \begin_inset Quotes eld
11966 \end_inset
11967
11968 indent
11969 \begin_inset Quotes erd
11970 \end_inset
11971
11972  or 
11973 \begin_inset Quotes eld
11974 \end_inset
11975
11976 skip
11977 \begin_inset Quotes erd
11978 \end_inset
11979
11980  to typeset a document.
11981  When 
11982 \begin_inset Quotes eld
11983 \end_inset
11984
11985 indent
11986 \begin_inset Quotes erd
11987 \end_inset
11988
11989  is chosen, this value is completely ignored.
11990  When 
11991 \begin_inset Quotes eld
11992 \end_inset
11993
11994 skip
11995 \begin_inset Quotes erd
11996 \end_inset
11997
11998  is chosen, the parindent of a LaTeXtype 
11999 \begin_inset Quotes eld
12000 \end_inset
12001
12002 Paragraph
12003 \begin_inset Quotes erd
12004 \end_inset
12005
12006  layout is ignored and all paragraphs are separated by this parskip argument.
12007  The vertical space is calculated with 
12008 \begin_inset Flex CharStyle:Code
12009 status collapsed
12010
12011 \begin_layout Plain Layout
12012 value
12013 \begin_inset space ~
12014 \end_inset
12015
12016 * DefaultHeight
12017 \end_layout
12018
12019 \end_inset
12020
12021  where 
12022 \begin_inset Flex CharStyle:Code
12023 status collapsed
12024
12025 \begin_layout Plain Layout
12026 DefaultHeight
12027 \end_layout
12028
12029 \end_inset
12030
12031  is the height of a row with the normal font.
12032  This way, the look stays the same with different screen fonts.
12033 \end_layout
12034
12035 \begin_layout Description
12036 \begin_inset Flex CharStyle:Code
12037 status collapsed
12038
12039 \begin_layout Plain Layout
12040 PassThru
12041 \end_layout
12042
12043 \end_inset
12044
12045  
12046 \begin_inset CommandInset label
12047 LatexCommand label
12048 name "des:PathThru"
12049
12050 \end_inset
12051
12052 [
12053 \emph on
12054
12055 \begin_inset Flex CharStyle:Code
12056 status collapsed
12057
12058 \begin_layout Plain Layout
12059
12060 \emph on
12061 0
12062 \end_layout
12063
12064 \end_inset
12065
12066
12067 \emph default
12068
12069 \begin_inset Flex CharStyle:Code
12070 status collapsed
12071
12072 \begin_layout Plain Layout
12073 1
12074 \end_layout
12075
12076 \end_inset
12077
12078 ] Whether the contents of this paragraph should be output in raw form, meaning
12079  without special translations that LaTeX would require.
12080 \end_layout
12081
12082 \begin_layout Description
12083 \begin_inset Flex CharStyle:Code
12084 status collapsed
12085
12086 \begin_layout Plain Layout
12087 Preamble
12088 \end_layout
12089
12090 \end_inset
12091
12092  
12093 \begin_inset CommandInset label
12094 LatexCommand label
12095 name "des:Preamble"
12096
12097 \end_inset
12098
12099 Information to be included in the LaTeX preamble when this style is used.
12100  Used to define macros, load packages, etc., required by this particular
12101  style.
12102  Must end with 
12103 \begin_inset Quotes eld
12104 \end_inset
12105
12106
12107 \begin_inset Flex CharStyle:Code
12108 status collapsed
12109
12110 \begin_layout Plain Layout
12111 EndPreamble
12112 \end_layout
12113
12114 \end_inset
12115
12116
12117 \begin_inset Quotes erd
12118 \end_inset
12119
12120 .
12121 \end_layout
12122
12123 \begin_layout Description
12124 \begin_inset Flex CharStyle:Code
12125 status collapsed
12126
12127 \begin_layout Plain Layout
12128 Requires 
12129 \end_layout
12130
12131 \end_inset
12132
12133 [
12134 \begin_inset Flex CharStyle:Code
12135 status collapsed
12136
12137 \begin_layout Plain Layout
12138 string
12139 \end_layout
12140
12141 \end_inset
12142
12143
12144 \begin_inset CommandInset label
12145 LatexCommand label
12146 name "des:Requires"
12147
12148 \end_inset
12149
12150 Whether the layout requires the feature 
12151 \begin_inset Flex CharStyle:Code
12152 status collapsed
12153
12154 \begin_layout Plain Layout
12155 string
12156 \end_layout
12157
12158 \end_inset
12159
12160 .
12161  See the description of 
12162 \begin_inset Flex CharStyle:Code
12163 status collapsed
12164
12165 \begin_layout Plain Layout
12166 Provides
12167 \end_layout
12168
12169 \end_inset
12170
12171  above (page 
12172 \begin_inset CommandInset ref
12173 LatexCommand pageref
12174 reference "des:FreeSpacing"
12175
12176 \end_inset
12177
12178 ) for information on `features'.
12179  
12180 \end_layout
12181
12182 \begin_layout Description
12183 \begin_inset Flex CharStyle:Code
12184 status collapsed
12185
12186 \begin_layout Plain Layout
12187 RightMargin
12188 \end_layout
12189
12190 \end_inset
12191
12192  [
12193 \begin_inset Flex CharStyle:Code
12194 status collapsed
12195
12196 \begin_layout Plain Layout
12197 string=""
12198 \end_layout
12199
12200 \end_inset
12201
12202 ] Similar to 
12203 \begin_inset Flex CharStyle:Code
12204 status collapsed
12205
12206 \begin_layout Plain Layout
12207 LeftMargin
12208 \end_layout
12209
12210 \end_inset
12211
12212 .
12213 \end_layout
12214
12215 \begin_layout Description
12216 \begin_inset Flex CharStyle:Code
12217 status collapsed
12218
12219 \begin_layout Plain Layout
12220 Spacing
12221 \end_layout
12222
12223 \end_inset
12224
12225  [
12226 \begin_inset Flex CharStyle:Code
12227 status collapsed
12228
12229 \begin_layout Plain Layout
12230
12231 \emph on
12232 single
12233 \emph default
12234 , onehalf, double, other
12235 \end_layout
12236
12237 \end_inset
12238
12239  
12240 \emph on
12241 value
12242 \emph default
12243 ] This defines what the default spacing should be in the layout.
12244  The arguments 
12245 \begin_inset Flex CharStyle:Code
12246 status collapsed
12247
12248 \begin_layout Plain Layout
12249 single
12250 \end_layout
12251
12252 \end_inset
12253
12254
12255 \begin_inset Flex CharStyle:Code
12256 status collapsed
12257
12258 \begin_layout Plain Layout
12259 onehalf
12260 \end_layout
12261
12262 \end_inset
12263
12264  and 
12265 \begin_inset Flex CharStyle:Code
12266 status collapsed
12267
12268 \begin_layout Plain Layout
12269 double
12270 \end_layout
12271
12272 \end_inset
12273
12274  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12275  If you specify the argument 
12276 \begin_inset Flex CharStyle:Code
12277 status collapsed
12278
12279 \begin_layout Plain Layout
12280 other
12281 \end_layout
12282
12283 \end_inset
12284
12285 , then you should also provide a numerical argument which will be the actual
12286  multiplier value.
12287  Note that, contrary to other parameters, 
12288 \begin_inset Flex CharStyle:Code
12289 status collapsed
12290
12291 \begin_layout Plain Layout
12292 Spacing
12293 \end_layout
12294
12295 \end_inset
12296
12297  implies the generation of specific LaTeX code, using the package 
12298 \family roman
12299
12300 \begin_inset Flex CharStyle:Code
12301 status collapsed
12302
12303 \begin_layout Plain Layout
12304 setspace.sty
12305 \end_layout
12306
12307 \end_inset
12308
12309 .
12310 \end_layout
12311
12312 \begin_layout Description
12313 \begin_inset Flex CharStyle:Code
12314 status collapsed
12315
12316 \begin_layout Plain Layout
12317 TextFont
12318 \end_layout
12319
12320 \end_inset
12321
12322  The font used for the text body .
12323  See section 
12324 \begin_inset CommandInset ref
12325 LatexCommand ref
12326 reference "sub:Font-description"
12327
12328 \end_inset
12329
12330 .
12331 \end_layout
12332
12333 \begin_layout Description
12334 \begin_inset Flex CharStyle:Code
12335 status collapsed
12336
12337 \begin_layout Plain Layout
12338 TocLevel
12339 \end_layout
12340
12341 \end_inset
12342
12343
12344 \series medium
12345  
12346 \begin_inset Flex CharStyle:Code
12347 status collapsed
12348
12349 \begin_layout Plain Layout
12350
12351 \series medium
12352 [int]
12353 \end_layout
12354
12355 \end_inset
12356
12357
12358 \series default
12359  The level of the style in the table of contents.
12360  This is used for automatic numbering of section headings.
12361 \end_layout
12362
12363 \begin_layout Description
12364 \begin_inset Flex CharStyle:Code
12365 status collapsed
12366
12367 \begin_layout Plain Layout
12368 TopSep
12369 \end_layout
12370
12371 \end_inset
12372
12373  [
12374 \begin_inset Flex CharStyle:Code
12375 status collapsed
12376
12377 \begin_layout Plain Layout
12378 float=0
12379 \end_layout
12380
12381 \end_inset
12382
12383 ] The vertical space with which the very first of a chain of paragraphs
12384  with this layout is separated from the previous paragraph.
12385  If the previous paragraph has another layout, the separations are not simply
12386  added, but the maximum is taken.
12387 \end_layout
12388
12389 \begin_layout Subsection
12390 Floats
12391 \begin_inset CommandInset label
12392 LatexCommand label
12393 name "sub:Floats"
12394
12395 \end_inset
12396
12397
12398 \end_layout
12399
12400 \begin_layout Standard
12401 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12402  define the floats (
12403 \begin_inset Flex CharStyle:MenuItem
12404 status collapsed
12405
12406 \begin_layout Plain Layout
12407 figure
12408 \end_layout
12409
12410 \end_inset
12411
12412
12413 \begin_inset Flex CharStyle:MenuItem
12414 status collapsed
12415
12416 \begin_layout Plain Layout
12417 table
12418 \end_layout
12419
12420 \end_inset
12421
12422 , \SpecialChar \ldots{}
12423 ) in the text class itself.
12424  Standard floats are included in the file 
12425 \begin_inset Flex CharStyle:Code
12426 status collapsed
12427
12428 \begin_layout Plain Layout
12429 stdfloats.inc
12430 \end_layout
12431
12432 \end_inset
12433
12434 , so you may have to do no more than add
12435 \end_layout
12436
12437 \begin_layout LyX-Code
12438 Input stdfloats.inc
12439 \end_layout
12440
12441 \begin_layout Standard
12442 to your layout file.
12443  If you want to implement a text class that proposes some other float types
12444  (like the AGU class bundled with LyX), the information below will hopefully
12445  help you:
12446 \end_layout
12447
12448 \begin_layout Description
12449 \begin_inset Flex CharStyle:Code
12450 status collapsed
12451
12452 \begin_layout Plain Layout
12453 Extension
12454 \end_layout
12455
12456 \end_inset
12457
12458  [
12459 \begin_inset Flex CharStyle:Code
12460 status collapsed
12461
12462 \begin_layout Plain Layout
12463 string
12464 \end_layout
12465
12466 \end_inset
12467
12468 =
12469 \begin_inset Quotes erd
12470 \end_inset
12471
12472
12473 \begin_inset Quotes erd
12474 \end_inset
12475
12476 ] The file name extension of an auxiliary file for the list of figures (or
12477  whatever).
12478  LaTeX writes the captions to this file.
12479 \end_layout
12480
12481 \begin_layout Description
12482 \begin_inset Flex CharStyle:Code
12483 status collapsed
12484
12485 \begin_layout Plain Layout
12486 GuiName
12487 \end_layout
12488
12489 \end_inset
12490
12491  [
12492 \begin_inset Flex CharStyle:Code
12493 status collapsed
12494
12495 \begin_layout Plain Layout
12496 string
12497 \end_layout
12498
12499 \end_inset
12500
12501 =
12502 \begin_inset Quotes erd
12503 \end_inset
12504
12505
12506 \begin_inset Quotes erd
12507 \end_inset
12508
12509 ] The string that will be used in the menus and also for the caption.
12510  This is translated to the current language if babel is used.
12511 \end_layout
12512
12513 \begin_layout Description
12514 \begin_inset Flex CharStyle:Code
12515 status collapsed
12516
12517 \begin_layout Plain Layout
12518 HTML*
12519 \end_layout
12520
12521 \end_inset
12522
12523  These are used for XHTML output.
12524  See 
12525 \end_layout
12526
12527 \begin_layout Description
12528 \begin_inset Flex CharStyle:Code
12529 status collapsed
12530
12531 \begin_layout Plain Layout
12532 LaTeXBuiltin
12533 \end_layout
12534
12535 \end_inset
12536
12537  [
12538 \begin_inset Flex CharStyle:Code
12539 status collapsed
12540
12541 \begin_layout Plain Layout
12542
12543 \emph on
12544 0
12545 \end_layout
12546
12547 \end_inset
12548
12549
12550 \begin_inset Flex CharStyle:Code
12551 status collapsed
12552
12553 \begin_layout Plain Layout
12554 1
12555 \end_layout
12556
12557 \end_inset
12558
12559 ] Set to 
12560 \begin_inset Flex CharStyle:Code
12561 status collapsed
12562
12563 \begin_layout Plain Layout
12564 1
12565 \end_layout
12566
12567 \end_inset
12568
12569  if the float is already defined by the LaTeX document class.
12570  If this is set to 
12571 \begin_inset Flex CharStyle:Code
12572 status collapsed
12573
12574 \begin_layout Plain Layout
12575 0
12576 \end_layout
12577
12578 \end_inset
12579
12580 , the float will be defined using the LaTeX package 
12581 \begin_inset Flex CharStyle:Code
12582 status collapsed
12583
12584 \begin_layout Plain Layout
12585 float
12586 \end_layout
12587
12588 \end_inset
12589
12590 .
12591 \end_layout
12592
12593 \begin_layout Description
12594 \begin_inset Flex CharStyle:Code
12595 status collapsed
12596
12597 \begin_layout Plain Layout
12598 ListName
12599 \end_layout
12600
12601 \end_inset
12602
12603  [
12604 \begin_inset Flex CharStyle:Code
12605 status collapsed
12606
12607 \begin_layout Plain Layout
12608 string
12609 \end_layout
12610
12611 \end_inset
12612
12613 =
12614 \begin_inset Quotes erd
12615 \end_inset
12616
12617
12618 \begin_inset Quotes erd
12619 \end_inset
12620
12621 ] The heading used for the list of floats.
12622  This is translated to the document language.
12623 \end_layout
12624
12625 \begin_layout Description
12626 \begin_inset Flex CharStyle:Code
12627 status collapsed
12628
12629 \begin_layout Plain Layout
12630 NumberWithin
12631 \end_layout
12632
12633 \end_inset
12634
12635  [
12636 \begin_inset Flex CharStyle:Code
12637 status collapsed
12638
12639 \begin_layout Plain Layout
12640 string
12641 \end_layout
12642
12643 \end_inset
12644
12645 =
12646 \begin_inset Quotes erd
12647 \end_inset
12648
12649
12650 \begin_inset Quotes erd
12651 \end_inset
12652
12653 ] This (optional) argument determines whether floats of this class will
12654  be numbered within some sectional unit of the document.
12655  For example, if within is equal to 
12656 \begin_inset Flex CharStyle:Code
12657 status collapsed
12658
12659 \begin_layout Plain Layout
12660 chapter
12661 \end_layout
12662
12663 \end_inset
12664
12665 , the floats will be numbered within chapters.
12666  
12667 \end_layout
12668
12669 \begin_layout Description
12670 \begin_inset Flex CharStyle:Code
12671 status collapsed
12672
12673 \begin_layout Plain Layout
12674 Placement
12675 \end_layout
12676
12677 \end_inset
12678
12679  [
12680 \begin_inset Flex CharStyle:Code
12681 status collapsed
12682
12683 \begin_layout Plain Layout
12684 string
12685 \end_layout
12686
12687 \end_inset
12688
12689 =
12690 \begin_inset Quotes erd
12691 \end_inset
12692
12693
12694 \begin_inset Quotes erd
12695 \end_inset
12696
12697 ] The default placement for the given class of floats.
12698  The string should be as in standard LaTeX: 
12699 \begin_inset Flex CharStyle:Code
12700 status collapsed
12701
12702 \begin_layout Plain Layout
12703 t
12704 \end_layout
12705
12706 \end_inset
12707
12708
12709 \begin_inset Flex CharStyle:Code
12710 status collapsed
12711
12712 \begin_layout Plain Layout
12713 b
12714 \end_layout
12715
12716 \end_inset
12717
12718
12719 \begin_inset Flex CharStyle:Code
12720 status collapsed
12721
12722 \begin_layout Plain Layout
12723 p
12724 \end_layout
12725
12726 \end_inset
12727
12728  and 
12729 \begin_inset Flex CharStyle:Code
12730 status collapsed
12731
12732 \begin_layout Plain Layout
12733 h
12734 \end_layout
12735
12736 \end_inset
12737
12738  for top, bottom, page, and here, respectively.
12739 \begin_inset Foot
12740 status collapsed
12741
12742 \begin_layout Plain Layout
12743 Note that the order of these letters in the string is irrelevant, like in
12744  LaTeX.
12745 \end_layout
12746
12747 \end_inset
12748
12749  On top of that there is a new type, 
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 , which does not really correspond to a float, since it means: put it 
12760 \begin_inset Quotes eld
12761 \end_inset
12762
12763 here
12764 \begin_inset Quotes erd
12765 \end_inset
12766
12767  and nowhere else.
12768  Note however that the 
12769 \begin_inset Flex CharStyle:Code
12770 status collapsed
12771
12772 \begin_layout Plain Layout
12773 H
12774 \end_layout
12775
12776 \end_inset
12777
12778  specifier is special and, because of implementation details, cannot be
12779  used in non-built in float types.
12780  If you do not understand what this means, just use 
12781 \begin_inset Quotes eld
12782 \end_inset
12783
12784
12785 \begin_inset Flex CharStyle:Code
12786 status collapsed
12787
12788 \begin_layout Plain Layout
12789 tbp
12790 \end_layout
12791
12792 \end_inset
12793
12794
12795 \begin_inset Quotes erd
12796 \end_inset
12797
12798 .
12799 \end_layout
12800
12801 \begin_layout Description
12802 \begin_inset Flex CharStyle:Code
12803 status collapsed
12804
12805 \begin_layout Plain Layout
12806 Style
12807 \end_layout
12808
12809 \end_inset
12810
12811  [
12812 \begin_inset Flex CharStyle:Code
12813 status collapsed
12814
12815 \begin_layout Plain Layout
12816 string
12817 \end_layout
12818
12819 \end_inset
12820
12821 =
12822 \begin_inset Quotes erd
12823 \end_inset
12824
12825
12826 \begin_inset Quotes erd
12827 \end_inset
12828
12829 ] The style used when defining the float using 
12830 \begin_inset Flex CharStyle:Code
12831 status collapsed
12832
12833 \begin_layout Plain Layout
12834
12835 \backslash
12836 newfloat
12837 \end_layout
12838
12839 \end_inset
12840
12841 .
12842 \end_layout
12843
12844 \begin_layout Description
12845 \begin_inset Flex CharStyle:Code
12846 status collapsed
12847
12848 \begin_layout Plain Layout
12849 Type
12850 \end_layout
12851
12852 \end_inset
12853
12854  [
12855 \begin_inset Flex CharStyle:Code
12856 status collapsed
12857
12858 \begin_layout Plain Layout
12859 string
12860 \end_layout
12861
12862 \end_inset
12863
12864 =
12865 \begin_inset Quotes erd
12866 \end_inset
12867
12868
12869 \begin_inset Quotes erd
12870 \end_inset
12871
12872 ] The 
12873 \begin_inset Quotes eld
12874 \end_inset
12875
12876 type
12877 \begin_inset Quotes erd
12878 \end_inset
12879
12880  of the new class of floats, like program or algorithm.
12881  After the appropriate 
12882 \begin_inset Flex CharStyle:Code
12883 status collapsed
12884
12885 \begin_layout Plain Layout
12886
12887 \backslash
12888 newfloat
12889 \end_layout
12890
12891 \end_inset
12892
12893 , commands such as 
12894 \begin_inset Flex CharStyle:Code
12895 status collapsed
12896
12897 \begin_layout Plain Layout
12898
12899 \backslash
12900 begin{program}
12901 \end_layout
12902
12903 \end_inset
12904
12905  or 
12906 \begin_inset Flex CharStyle:Code
12907 status collapsed
12908
12909 \begin_layout Plain Layout
12910
12911 \backslash
12912 end{algorithm*}
12913 \end_layout
12914
12915 \end_inset
12916
12917  will be available.
12918 \end_layout
12919
12920 \begin_layout Standard
12921 Note that defining a float with type 
12922 \begin_inset Flex CharStyle:Code
12923 status collapsed
12924
12925 \begin_layout Plain Layout
12926
12927 \emph on
12928 type
12929 \end_layout
12930
12931 \end_inset
12932
12933  automatically defines the corresponding counter with name 
12934 \begin_inset Flex CharStyle:Code
12935 status collapsed
12936
12937 \begin_layout Plain Layout
12938
12939 \emph on
12940 type
12941 \end_layout
12942
12943 \end_inset
12944
12945 .
12946 \end_layout
12947
12948 \begin_layout Subsection
12949 Flex insets and InsetLayout
12950 \begin_inset CommandInset label
12951 LatexCommand label
12952 name "sub:Flex-insets-and"
12953
12954 \end_inset
12955
12956
12957 \end_layout
12958
12959 \begin_layout Standard
12960 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
12961  these are called Flex insets.
12962  
12963 \end_layout
12964
12965 \begin_layout Standard
12966 Flex insets come in three different kinds: 
12967 \end_layout
12968
12969 \begin_layout Itemize
12970 character style (
12971 \begin_inset Flex CharStyle:Code
12972 status collapsed
12973
12974 \begin_layout Plain Layout
12975 CharStyle
12976 \end_layout
12977
12978 \end_inset
12979
12980 ): These define semantic markup corresponding to such LaTeX commands as
12981  
12982 \begin_inset Flex CharStyle:Code
12983 status collapsed
12984
12985 \begin_layout Plain Layout
12986
12987 \backslash
12988 noun
12989 \end_layout
12990
12991 \end_inset
12992
12993  and 
12994 \begin_inset Flex CharStyle:Code
12995 status collapsed
12996
12997 \begin_layout Plain Layout
12998
12999 \backslash
13000 code
13001 \end_layout
13002
13003 \end_inset
13004
13005 .
13006 \end_layout
13007
13008 \begin_layout Itemize
13009 user custom (
13010 \begin_inset Flex CharStyle:Code
13011 status collapsed
13012
13013 \begin_layout Plain Layout
13014 Custom
13015 \end_layout
13016
13017 \end_inset
13018
13019 ): These can be used to define custom collapsible insets, similar to TeX
13020  code, footnote, and the like.
13021  An obvious example is an endnote inset, which is defined in the 
13022 \begin_inset Flex CharStyle:Code
13023 status collapsed
13024
13025 \begin_layout Plain Layout
13026 endnote
13027 \end_layout
13028
13029 \end_inset
13030
13031  module.
13032 \end_layout
13033
13034 \begin_layout Itemize
13035 XML elements (
13036 \begin_inset Flex CharStyle:Code
13037 status collapsed
13038
13039 \begin_layout Plain Layout
13040 Element
13041 \end_layout
13042
13043 \end_inset
13044
13045 ): For use with DocBook classes.
13046 \end_layout
13047
13048 \begin_layout Standard
13049 Flex insets are defined using the 
13050 \begin_inset Flex CharStyle:Code
13051 status collapsed
13052
13053 \begin_layout Plain Layout
13054 InsetLayout
13055 \end_layout
13056
13057 \end_inset
13058
13059  tag, which shall be explained in a moment.
13060 \end_layout
13061
13062 \begin_layout Standard
13063 The 
13064 \begin_inset Flex CharStyle:Code
13065 status collapsed
13066
13067 \begin_layout Plain Layout
13068 InsetLayout
13069 \end_layout
13070
13071 \end_inset
13072
13073  tag also serves another function: It can be used to customize the general
13074  layout of many different types of insets.
13075  Currently, 
13076 \begin_inset Flex CharStyle:Code
13077 status collapsed
13078
13079 \begin_layout Plain Layout
13080 InsetLayout
13081 \end_layout
13082
13083 \end_inset
13084
13085  can be used to customize the layout parameters for footnotes, marginal
13086  notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13087  boxes, tables, algorithms, URLs, and optional arguments, as well as to
13088  define Flex insets.
13089 \end_layout
13090
13091 \begin_layout Standard
13092 The 
13093 \begin_inset Flex CharStyle:Code
13094 status collapsed
13095
13096 \begin_layout Plain Layout
13097 InsetLayout
13098 \end_layout
13099
13100 \end_inset
13101
13102  definition must begin with a line of the form:
13103 \end_layout
13104
13105 \begin_layout LyX-Code
13106 InsetLayout <Type>
13107 \end_layout
13108
13109 \begin_layout Standard
13110 Here 
13111 \begin_inset Flex CharStyle:Code
13112 status collapsed
13113
13114 \begin_layout Plain Layout
13115 <Type>
13116 \end_layout
13117
13118 \end_inset
13119
13120  indicates the inset whose layout is being defined, and here there are two
13121  cases.
13122 \end_layout
13123
13124 \begin_layout Enumerate
13125 The layout for a pre-existing inset is being modified.
13126  In this case, can be 
13127 \begin_inset Flex CharStyle:Code
13128 status collapsed
13129
13130 \begin_layout Plain Layout
13131 <Type>
13132 \end_layout
13133
13134 \end_inset
13135
13136  any one of the following: 
13137 \begin_inset Flex CharStyle:Code
13138 status collapsed
13139
13140 \begin_layout Plain Layout
13141 Algorithm
13142 \end_layout
13143
13144 \end_inset
13145
13146
13147 \begin_inset Flex CharStyle:Code
13148 status collapsed
13149
13150 \begin_layout Plain Layout
13151 Branch
13152 \end_layout
13153
13154 \end_inset
13155
13156
13157 \begin_inset Flex CharStyle:Code
13158 status collapsed
13159
13160 \begin_layout Plain Layout
13161 Box
13162 \end_layout
13163
13164 \end_inset
13165
13166
13167 \begin_inset Flex CharStyle:Code
13168 status collapsed
13169
13170 \begin_layout Plain Layout
13171 Box:shaded
13172 \end_layout
13173
13174 \end_inset
13175
13176
13177 \begin_inset Flex CharStyle:Code
13178 status collapsed
13179
13180 \begin_layout Plain Layout
13181 ERT
13182 \end_layout
13183
13184 \end_inset
13185
13186
13187 \begin_inset Flex CharStyle:Code
13188 status collapsed
13189
13190 \begin_layout Plain Layout
13191 Figure
13192 \end_layout
13193
13194 \end_inset
13195
13196
13197 \begin_inset Flex CharStyle:Code
13198 status collapsed
13199
13200 \begin_layout Plain Layout
13201 Foot
13202 \end_layout
13203
13204 \end_inset
13205
13206
13207 \begin_inset Flex CharStyle:Code
13208 status collapsed
13209
13210 \begin_layout Plain Layout
13211 Index
13212 \end_layout
13213
13214 \end_inset
13215
13216
13217 \begin_inset Flex CharStyle:Code
13218 status collapsed
13219
13220 \begin_layout Plain Layout
13221 Info
13222 \end_layout
13223
13224 \end_inset
13225
13226
13227 \begin_inset Flex CharStyle:Code
13228 status collapsed
13229
13230 \begin_layout Plain Layout
13231 Info:menu
13232 \end_layout
13233
13234 \end_inset
13235
13236
13237 \begin_inset Flex CharStyle:Code
13238 status collapsed
13239
13240 \begin_layout Plain Layout
13241 Info:shortcut
13242 \end_layout
13243
13244 \end_inset
13245
13246
13247 \begin_inset Flex CharStyle:Code
13248 status collapsed
13249
13250 \begin_layout Plain Layout
13251 Info:shortcuts
13252 \end_layout
13253
13254 \end_inset
13255
13256
13257 \begin_inset Flex CharStyle:Code
13258 status collapsed
13259
13260 \begin_layout Plain Layout
13261 Listings
13262 \end_layout
13263
13264 \end_inset
13265
13266
13267 \begin_inset Flex CharStyle:Code
13268 status collapsed
13269
13270 \begin_layout Plain Layout
13271 Marginal
13272 \end_layout
13273
13274 \end_inset
13275
13276
13277 \begin_inset Flex CharStyle:Code
13278 status collapsed
13279
13280 \begin_layout Plain Layout
13281 Note:Comment
13282 \end_layout
13283
13284 \end_inset
13285
13286
13287 \begin_inset Flex CharStyle:Code
13288 status collapsed
13289
13290 \begin_layout Plain Layout
13291 Note:Note
13292 \end_layout
13293
13294 \end_inset
13295
13296
13297 \begin_inset Flex CharStyle:Code
13298 status collapsed
13299
13300 \begin_layout Plain Layout
13301 Note:GreyedOut
13302 \end_layout
13303
13304 \end_inset
13305
13306
13307 \begin_inset Flex CharStyle:Code
13308 status collapsed
13309
13310 \begin_layout Plain Layout
13311 OptArg
13312 \end_layout
13313
13314 \end_inset
13315
13316
13317 \begin_inset Flex CharStyle:Code
13318 status collapsed
13319
13320 \begin_layout Plain Layout
13321 Table
13322 \end_layout
13323
13324 \end_inset
13325
13326 , or 
13327 \begin_inset Flex CharStyle:Code
13328 status collapsed
13329
13330 \begin_layout Plain Layout
13331 URL
13332 \end_layout
13333
13334 \end_inset
13335
13336 .
13337 \end_layout
13338
13339 \begin_layout Enumerate
13340 The layout for a Flex inset is being defined.
13341  In this case, 
13342 \begin_inset Flex CharStyle:Code
13343 status collapsed
13344
13345 \begin_layout Plain Layout
13346 <Type>
13347 \end_layout
13348
13349 \end_inset
13350
13351  can be any valid identifier not used by a pre-existing inset.
13352  Note that the definition of a flex inset 
13353 \emph on
13354 must 
13355 \emph default
13356 also include a 
13357 \begin_inset Flex CharStyle:Code
13358 status collapsed
13359
13360 \begin_layout Plain Layout
13361 LyXType
13362 \end_layout
13363
13364 \end_inset
13365
13366  entry, declaring which type of inset this is.
13367 \end_layout
13368
13369 \begin_layout Standard
13370 The 
13371 \begin_inset Flex CharStyle:Code
13372 status collapsed
13373
13374 \begin_layout Plain Layout
13375 InsetLayout
13376 \end_layout
13377
13378 \end_inset
13379
13380  definition can contain the following entries:
13381 \end_layout
13382
13383 \begin_layout Description
13384 \begin_inset Flex CharStyle:Code
13385 status collapsed
13386
13387 \begin_layout Plain Layout
13388 BgColor
13389 \end_layout
13390
13391 \end_inset
13392
13393  The color for the inset's background.
13394  The valid colors are defined in 
13395 \begin_inset Flex CharStyle:Code
13396 status collapsed
13397
13398 \begin_layout Plain Layout
13399 src/ColorCode.h
13400 \end_layout
13401
13402 \end_inset
13403
13404 .
13405 \end_layout
13406
13407 \begin_layout Description
13408 \begin_inset Flex CharStyle:Code
13409 status collapsed
13410
13411 \begin_layout Plain Layout
13412 ContentAsLabel
13413 \end_layout
13414
13415 \end_inset
13416
13417  [
13418 \begin_inset Flex CharStyle:Code
13419 status collapsed
13420
13421 \begin_layout Plain Layout
13422
13423 \emph on
13424 0
13425 \end_layout
13426
13427 \end_inset
13428
13429 ,
13430 \begin_inset Flex CharStyle:Code
13431 status collapsed
13432
13433 \begin_layout Plain Layout
13434 1
13435 \end_layout
13436
13437 \end_inset
13438
13439 ] Whether to use the content of the inset as the label, when the inset is
13440  closed.
13441  Default is false.
13442 \end_layout
13443
13444 \begin_layout Description
13445 \begin_inset Flex CharStyle:Code
13446 status collapsed
13447
13448 \begin_layout Plain Layout
13449 CopyStyle
13450 \end_layout
13451
13452 \end_inset
13453
13454  As with paragraph styles (see page 
13455 \begin_inset CommandInset ref
13456 LatexCommand ref
13457 reference "des:CopyStyle"
13458
13459 \end_inset
13460
13461 ).
13462 \end_layout
13463
13464 \begin_layout Description
13465 \begin_inset Flex CharStyle:Code
13466 status collapsed
13467
13468 \begin_layout Plain Layout
13469 CustomPars
13470 \end_layout
13471
13472 \end_inset
13473
13474  [
13475 \begin_inset Flex CharStyle:Code
13476 status collapsed
13477
13478 \begin_layout Plain Layout
13479
13480 \emph on
13481 0
13482 \end_layout
13483
13484 \end_inset
13485
13486 ,
13487 \begin_inset Flex CharStyle:Code
13488 status collapsed
13489
13490 \begin_layout Plain Layout
13491 1
13492 \end_layout
13493
13494 \end_inset
13495
13496 ] Indicates whether the user may employ the Paragraph Settings dialog to
13497  customize the paragraph.
13498 \end_layout
13499
13500 \begin_layout Description
13501 \begin_inset Flex CharStyle:Code
13502 status collapsed
13503
13504 \begin_layout Plain Layout
13505 Decoration
13506 \end_layout
13507
13508 \end_inset
13509
13510  can be 
13511 \begin_inset Flex CharStyle:Code
13512 status collapsed
13513
13514 \begin_layout Plain Layout
13515 Classic
13516 \end_layout
13517
13518 \end_inset
13519
13520
13521 \begin_inset Flex CharStyle:Code
13522 status collapsed
13523
13524 \begin_layout Plain Layout
13525 Minimalistic
13526 \end_layout
13527
13528 \end_inset
13529
13530 , or 
13531 \begin_inset Flex CharStyle:Code
13532 status collapsed
13533
13534 \begin_layout Plain Layout
13535 Conglomerate
13536 \end_layout
13537
13538 \end_inset
13539
13540 , describing the rendering style used for the inset's frame and buttons.
13541  Footnotes generally use 
13542 \begin_inset Flex CharStyle:Code
13543 status collapsed
13544
13545 \begin_layout Plain Layout
13546 Classic
13547 \end_layout
13548
13549 \end_inset
13550
13551 , ERT insets generally 
13552 \begin_inset Flex CharStyle:Code
13553 status collapsed
13554
13555 \begin_layout Plain Layout
13556 Minimalistic
13557 \end_layout
13558
13559 \end_inset
13560
13561 , and character styles 
13562 \begin_inset Flex CharStyle:Code
13563 status collapsed
13564
13565 \begin_layout Plain Layout
13566 Conglomerate
13567 \end_layout
13568
13569 \end_inset
13570
13571 .
13572 \end_layout
13573
13574 \begin_layout Description
13575 \begin_inset Flex CharStyle:Code
13576 status collapsed
13577
13578 \begin_layout Plain Layout
13579 End
13580 \end_layout
13581
13582 \end_inset
13583
13584  Required at the end of the InsetLayout declarations.
13585 \end_layout
13586
13587 \begin_layout Description
13588 \begin_inset Flex CharStyle:Code
13589 status collapsed
13590
13591 \begin_layout Plain Layout
13592 Font
13593 \end_layout
13594
13595 \end_inset
13596
13597  The font used for both the text body 
13598 \emph on
13599 and
13600 \emph default
13601  the label.
13602  See section
13603 \begin_inset space ~
13604 \end_inset
13605
13606
13607 \begin_inset CommandInset ref
13608 LatexCommand ref
13609 reference "sub:Font-description"
13610
13611 \end_inset
13612
13613 .
13614  Note that defining this font automatically defines the 
13615 \begin_inset Flex CharStyle:Code
13616 status collapsed
13617
13618 \begin_layout Plain Layout
13619 LabelFont
13620 \end_layout
13621
13622 \end_inset
13623
13624  to the same value, so define this first and define 
13625 \begin_inset Flex CharStyle:Code
13626 status collapsed
13627
13628 \begin_layout Plain Layout
13629 LabelFont
13630 \end_layout
13631
13632 \end_inset
13633
13634  later if you want them to be different.
13635 \end_layout
13636
13637 \begin_layout Description
13638 \begin_inset Flex CharStyle:Code
13639 status collapsed
13640
13641 \begin_layout Plain Layout
13642 ForceLTR
13643 \end_layout
13644
13645 \end_inset
13646
13647  Force the 
13648 \begin_inset Quotes eld
13649 \end_inset
13650
13651 latex
13652 \begin_inset Quotes erd
13653 \end_inset
13654
13655  language, leading to Left-to-Right (latin) output, e.
13656 \begin_inset space \thinspace{}
13657 \end_inset
13658
13659 g.
13660 \begin_inset space \space{}
13661 \end_inset
13662
13663 in TeX code or URL.
13664  A kludge.
13665 \end_layout
13666
13667 \begin_layout Description
13668 \begin_inset Flex CharStyle:Code
13669 status collapsed
13670
13671 \begin_layout Plain Layout
13672 ForcePlain
13673 \end_layout
13674
13675 \end_inset
13676
13677  [
13678 \begin_inset Flex CharStyle:Code
13679 status collapsed
13680
13681 \begin_layout Plain Layout
13682
13683 \emph on
13684 0
13685 \end_layout
13686
13687 \end_inset
13688
13689 ,
13690 \begin_inset Flex CharStyle:Code
13691 status collapsed
13692
13693 \begin_layout Plain Layout
13694 1
13695 \end_layout
13696
13697 \end_inset
13698
13699 ] Indicates whether the PlainLayout should be used or, instead, the user
13700  can change the paragraph style used in the inset.
13701  Default is false.
13702 \end_layout
13703
13704 \begin_layout Description
13705 \begin_inset Flex CharStyle:Code
13706 status collapsed
13707
13708 \begin_layout Plain Layout
13709 FreeSpacing
13710 \end_layout
13711
13712 \end_inset
13713
13714  As with paragraph styles (see page 
13715 \begin_inset CommandInset ref
13716 LatexCommand pageref
13717 reference "des:FreeSpacing"
13718
13719 \end_inset
13720
13721 ).
13722  Default is false.
13723 \end_layout
13724
13725 \begin_layout Description
13726 \begin_inset Flex CharStyle:Code
13727 status collapsed
13728
13729 \begin_layout Plain Layout
13730 HTML*
13731 \end_layout
13732
13733 \end_inset
13734
13735  These tags control XHTML output.
13736  See 
13737 \end_layout
13738
13739 \begin_layout Description
13740 \begin_inset Flex CharStyle:Code
13741 status collapsed
13742
13743 \begin_layout Plain Layout
13744 InToc
13745 \end_layout
13746
13747 \end_inset
13748
13749  [
13750 \begin_inset Flex CharStyle:Code
13751 status collapsed
13752
13753 \begin_layout Plain Layout
13754
13755 \emph on
13756 0
13757 \end_layout
13758
13759 \end_inset
13760
13761 ,
13762 \begin_inset Flex CharStyle:Code
13763 status collapsed
13764
13765 \begin_layout Plain Layout
13766 1
13767 \end_layout
13768
13769 \end_inset
13770
13771 ] Whether to include the contents of this inset in the strings generated
13772  for the `Outline' pane.
13773  One would not, for example, want the content of a footnote in a section
13774  header to be included in the TOC displayed in the outline, but one would
13775  normally want the content of a character style displayed.
13776  Default is false: not to include.
13777 \end_layout
13778
13779 \begin_layout Description
13780 \begin_inset Flex CharStyle:Code
13781 status collapsed
13782
13783 \begin_layout Plain Layout
13784 KeepEmpty
13785 \end_layout
13786
13787 \end_inset
13788
13789  As with paragraph styles (see page 
13790 \begin_inset CommandInset ref
13791 LatexCommand pageref
13792 reference "des:KeepEmpty"
13793
13794 \end_inset
13795
13796 ).
13797  Default is false.
13798 \end_layout
13799
13800 \begin_layout Description
13801 \begin_inset Flex CharStyle:Code
13802 status collapsed
13803
13804 \begin_layout Plain Layout
13805 LabelFont
13806 \end_layout
13807
13808 \end_inset
13809
13810  The font used for the label.
13811  See section
13812 \begin_inset space ~
13813 \end_inset
13814
13815
13816 \begin_inset CommandInset ref
13817 LatexCommand ref
13818 reference "sub:Font-description"
13819
13820 \end_inset
13821
13822 .
13823  Note that this definition can never appear before 
13824 \begin_inset Flex CharStyle:Code
13825 status collapsed
13826
13827 \begin_layout Plain Layout
13828 Font
13829 \end_layout
13830
13831 \end_inset
13832
13833 , lest it be ineffective.
13834 \end_layout
13835
13836 \begin_layout Description
13837 \begin_inset Flex CharStyle:Code
13838 status collapsed
13839
13840 \begin_layout Plain Layout
13841 LabelString
13842 \end_layout
13843
13844 \end_inset
13845
13846  What will be displayed on the button or elsewhere as the inset label.
13847  Some inset types (TeX code and Branch) modify this label on the fly.
13848 \end_layout
13849
13850 \begin_layout Description
13851 \begin_inset Flex CharStyle:Code
13852 status collapsed
13853
13854 \begin_layout Plain Layout
13855 LatexName
13856 \end_layout
13857
13858 \end_inset
13859
13860  The name of the corresponding LaTeX stuff.
13861  Either the environment or command name.
13862 \end_layout
13863
13864 \begin_layout Description
13865 \begin_inset Flex CharStyle:Code
13866 status collapsed
13867
13868 \begin_layout Plain Layout
13869 LatexParam
13870 \end_layout
13871
13872 \end_inset
13873
13874  The optional parameter for the corresponding 
13875 \begin_inset Flex CharStyle:Code
13876 status collapsed
13877
13878 \begin_layout Plain Layout
13879 LatexName
13880 \end_layout
13881
13882 \end_inset
13883
13884  stuff, including possible bracket pairs like 
13885 \begin_inset Flex CharStyle:Code
13886 status collapsed
13887
13888 \begin_layout Plain Layout
13889 []
13890 \end_layout
13891
13892 \end_inset
13893
13894 .
13895  This parameter cannot be changed from within LyX.
13896 \end_layout
13897
13898 \begin_layout Description
13899 \begin_inset Flex CharStyle:Code
13900 status collapsed
13901
13902 \begin_layout Plain Layout
13903 LatexType
13904 \end_layout
13905
13906 \end_inset
13907
13908  As with paragraph styles (see page 
13909 \begin_inset CommandInset ref
13910 LatexCommand pageref
13911 reference "des:LatexType"
13912
13913 \end_inset
13914
13915 ).
13916 \end_layout
13917
13918 \begin_layout Description
13919 \begin_inset Flex CharStyle:Code
13920 status collapsed
13921
13922 \begin_layout Plain Layout
13923 LyxType 
13924 \end_layout
13925
13926 \end_inset
13927
13928  Can be 
13929 \begin_inset Flex CharStyle:Code
13930 status collapsed
13931
13932 \begin_layout Plain Layout
13933 charstyle
13934 \end_layout
13935
13936 \end_inset
13937
13938
13939 \begin_inset Flex CharStyle:Code
13940 status collapsed
13941
13942 \begin_layout Plain Layout
13943 custom
13944 \end_layout
13945
13946 \end_inset
13947
13948
13949 \begin_inset Flex CharStyle:Code
13950 status collapsed
13951
13952 \begin_layout Plain Layout
13953 element
13954 \end_layout
13955
13956 \end_inset
13957
13958 , or 
13959 \begin_inset Flex CharStyle:Code
13960 status collapsed
13961
13962 \begin_layout Plain Layout
13963 end
13964 \end_layout
13965
13966 \end_inset
13967
13968  (indicating a dummy definition ending definitions of charstyles, etc).
13969  This entry is required in and is only meaningful for Flex insets.
13970  Among other things, it determines on which menu this inset will appear.
13971 \end_layout
13972
13973 \begin_layout Description
13974 \begin_inset Flex CharStyle:Code
13975 status collapsed
13976
13977 \begin_layout Plain Layout
13978 MultiPar
13979 \end_layout
13980
13981 \end_inset
13982
13983  [
13984 \begin_inset Flex CharStyle:Code
13985 status collapsed
13986
13987 \begin_layout Plain Layout
13988
13989 \emph on
13990 0
13991 \end_layout
13992
13993 \end_inset
13994
13995 ,
13996 \begin_inset Flex CharStyle:Code
13997 status collapsed
13998
13999 \begin_layout Plain Layout
14000 1
14001 \end_layout
14002
14003 \end_inset
14004
14005 ] Whether multiple paragraphs are permitted in this inset.
14006  This will also set 
14007 \begin_inset Flex CharStyle:Code
14008 status collapsed
14009
14010 \begin_layout Plain Layout
14011 CustomPars
14012 \end_layout
14013
14014 \end_inset
14015
14016  to the same value and 
14017 \begin_inset Flex CharStyle:Code
14018 status collapsed
14019
14020 \begin_layout Plain Layout
14021 ForcePlain
14022 \end_layout
14023
14024 \end_inset
14025
14026  to the opposite value.
14027  These can be reset to other values, if they are used 
14028 \emph on
14029 after
14030 \emph default
14031  
14032 \begin_inset Flex CharStyle:Code
14033 status collapsed
14034
14035 \begin_layout Plain Layout
14036 MultiPar
14037 \end_layout
14038
14039 \end_inset
14040
14041 .
14042  Default is true.
14043 \end_layout
14044
14045 \begin_layout Description
14046 \begin_inset Flex CharStyle:Code
14047 status collapsed
14048
14049 \begin_layout Plain Layout
14050 NeedProtect
14051 \end_layout
14052
14053 \end_inset
14054
14055  [
14056 \begin_inset Flex CharStyle:Code
14057 status collapsed
14058
14059 \begin_layout Plain Layout
14060
14061 \emph on
14062 0
14063 \end_layout
14064
14065 \end_inset
14066
14067 ,
14068 \begin_inset Flex CharStyle:Code
14069 status collapsed
14070
14071 \begin_layout Plain Layout
14072 1
14073 \end_layout
14074
14075 \end_inset
14076
14077 ] Whether fragile commands in this layout should be 
14078 \begin_inset Flex CharStyle:Code
14079 status collapsed
14080
14081 \begin_layout Plain Layout
14082
14083 \backslash
14084 protect
14085 \end_layout
14086
14087 \end_inset
14088
14089 'ed.
14090  (Note: This is 
14091 \emph on
14092 not
14093 \emph default
14094  whether the command should itself be protected.) Default is false.
14095 \end_layout
14096
14097 \begin_layout Description
14098 \begin_inset Flex CharStyle:Code
14099 status collapsed
14100
14101 \begin_layout Plain Layout
14102 PassThru
14103 \end_layout
14104
14105 \end_inset
14106
14107  [
14108 \begin_inset Flex CharStyle:Code
14109 status collapsed
14110
14111 \begin_layout Plain Layout
14112
14113 \emph on
14114 0
14115 \end_layout
14116
14117 \end_inset
14118
14119 ,
14120 \begin_inset Flex CharStyle:Code
14121 status collapsed
14122
14123 \begin_layout Plain Layout
14124 1
14125 \end_layout
14126
14127 \end_inset
14128
14129 ] As with paragraph styles (see page 
14130 \begin_inset CommandInset ref
14131 LatexCommand pageref
14132 reference "des:PathThru"
14133
14134 \end_inset
14135
14136 ).
14137  Default is false.
14138 \end_layout
14139
14140 \begin_layout Description
14141 \begin_inset Flex CharStyle:Code
14142 status collapsed
14143
14144 \begin_layout Plain Layout
14145 Preamble
14146 \end_layout
14147
14148 \end_inset
14149
14150  As with paragraph styles (see page 
14151 \begin_inset CommandInset ref
14152 LatexCommand pageref
14153 reference "des:Preamble"
14154
14155 \end_inset
14156
14157 ).
14158 \end_layout
14159
14160 \begin_layout Description
14161 \begin_inset Flex CharStyle:Code
14162 status collapsed
14163
14164 \begin_layout Plain Layout
14165 Requires 
14166 \end_layout
14167
14168 \end_inset
14169
14170  [
14171 \begin_inset Flex CharStyle:Code
14172 status collapsed
14173
14174 \begin_layout Plain Layout
14175 string
14176 \end_layout
14177
14178 \end_inset
14179
14180 ] As with paragraph styles (see page 
14181 \begin_inset CommandInset ref
14182 LatexCommand pageref
14183 reference "des:Requires"
14184
14185 \end_inset
14186
14187 ).
14188 \end_layout
14189
14190 \begin_layout Subsection
14191 Counters
14192 \begin_inset CommandInset label
14193 LatexCommand label
14194 name "sub:Counters"
14195
14196 \end_inset
14197
14198
14199 \end_layout
14200
14201 \begin_layout Standard
14202 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14203  counters (
14204 \begin_inset Flex CharStyle:MenuItem
14205 status collapsed
14206
14207 \begin_layout Plain Layout
14208 chapter
14209 \end_layout
14210
14211 \end_inset
14212
14213
14214 \begin_inset Flex CharStyle:MenuItem
14215 status collapsed
14216
14217 \begin_layout Plain Layout
14218 figure
14219 \end_layout
14220
14221 \end_inset
14222
14223 , \SpecialChar \ldots{}
14224 ) in the text class itself.
14225  The standard counters are defined in the file 
14226 \begin_inset Flex CharStyle:Code
14227 status collapsed
14228
14229 \begin_layout Plain Layout
14230 stdcounters.inc
14231 \end_layout
14232
14233 \end_inset
14234
14235 , so you may have to do no more than add
14236 \end_layout
14237
14238 \begin_layout LyX-Code
14239 Input stdcounters.inc
14240 \end_layout
14241
14242 \begin_layout Standard
14243 to your layout file to get them to work.
14244  But if you want to define custom counters, then you can do so.
14245  The counter declaration must begin with:
14246 \end_layout
14247
14248 \begin_layout LyX-Code
14249 Counter CounterName
14250 \end_layout
14251
14252 \begin_layout Standard
14253 where of course `
14254 \begin_inset Flex CharStyle:Code
14255 status collapsed
14256
14257 \begin_layout Plain Layout
14258 CounterName
14259 \end_layout
14260
14261 \end_inset
14262
14263 ' is replaced by the name of the counter.
14264  And it must end with 
14265 \begin_inset Quotes eld
14266 \end_inset
14267
14268
14269 \begin_inset Flex CharStyle:Code
14270 status collapsed
14271
14272 \begin_layout Plain Layout
14273 End
14274 \end_layout
14275
14276 \end_inset
14277
14278
14279 \begin_inset Quotes erd
14280 \end_inset
14281
14282 .
14283  The following parameters can also be used:
14284 \end_layout
14285
14286 \begin_layout Description
14287 \begin_inset Flex CharStyle:Code
14288 status collapsed
14289
14290 \begin_layout Plain Layout
14291 LabelString [string=""]
14292 \end_layout
14293
14294 \end_inset
14295
14296  when this is defined, this string defines how the counter is displayed.
14297  Setting this value sets 
14298 \begin_inset Flex CharStyle:Code
14299 status collapsed
14300
14301 \begin_layout Plain Layout
14302 LabelStringAppendix
14303 \end_layout
14304
14305 \end_inset
14306
14307  to the same value.
14308  The following special constructs can be used in the string:
14309 \end_layout
14310
14311 \begin_deeper
14312 \begin_layout Itemize
14313 \begin_inset Flex CharStyle:Code
14314 status collapsed
14315
14316 \begin_layout Plain Layout
14317
14318 \backslash
14319 thecounter
14320 \end_layout
14321
14322 \end_inset
14323
14324  will be replaced by the expansion of the 
14325 \begin_inset Flex CharStyle:Code
14326 status collapsed
14327
14328 \begin_layout Plain Layout
14329 LabelString
14330 \end_layout
14331
14332 \end_inset
14333
14334  (or 
14335 \begin_inset Flex CharStyle:Code
14336 status collapsed
14337
14338 \begin_layout Plain Layout
14339 LabelStringAppendix
14340 \end_layout
14341
14342 \end_inset
14343
14344 ) of the counter 
14345 \begin_inset Flex CharStyle:Code
14346 status collapsed
14347
14348 \begin_layout Plain Layout
14349 counter
14350 \end_layout
14351
14352 \end_inset
14353
14354 .
14355  
14356 \end_layout
14357
14358 \begin_layout Itemize
14359 counter values can be expressed using LaTeX-like macros 
14360 \begin_inset Flex CharStyle:Code
14361 status collapsed
14362
14363 \begin_layout Plain Layout
14364
14365 \backslash
14366
14367 \emph on
14368 numbertype
14369 \emph default
14370 {
14371 \emph on
14372 counter
14373 \emph default
14374 }
14375 \end_layout
14376
14377 \end_inset
14378
14379 , where 
14380 \begin_inset Flex CharStyle:Code
14381 status collapsed
14382
14383 \begin_layout Plain Layout
14384
14385 \emph on
14386 numbertype
14387 \end_layout
14388
14389 \end_inset
14390
14391  can be:
14392 \begin_inset Foot
14393 status collapsed
14394
14395 \begin_layout Plain Layout
14396
14397 \family roman
14398 \series medium
14399 \shape up
14400 \size normal
14401 \emph off
14402 \bar no
14403 \noun off
14404 \color none
14405 Actually, the situation is a bit more complicated: any
14406 \family default
14407 \series default
14408 \shape default
14409 \emph default
14410 \bar default
14411  
14412 \size default
14413 \emph on
14414 \noun default
14415 \color inherit
14416 numbertype
14417 \family roman
14418 \series medium
14419 \shape up
14420 \size normal
14421 \emph off
14422 \bar no
14423 \noun off
14424  other than those described below will produce arabic numerals.
14425  It would not be surprising to see this change in the future.
14426 \end_layout
14427
14428 \end_inset
14429
14430  
14431 \begin_inset Flex CharStyle:Code
14432 status collapsed
14433
14434 \begin_layout Plain Layout
14435 arabic
14436 \end_layout
14437
14438 \end_inset
14439
14440 : 1, 2, 3,\SpecialChar \ldots{}
14441
14442 \begin_inset Flex CharStyle:Code
14443 status collapsed
14444
14445 \begin_layout Plain Layout
14446 alph
14447 \end_layout
14448
14449 \end_inset
14450
14451  for lower-case letters: a, b, c, \SpecialChar \ldots{}
14452
14453 \begin_inset Flex CharStyle:Code
14454 status collapsed
14455
14456 \begin_layout Plain Layout
14457 Alph
14458 \end_layout
14459
14460 \end_inset
14461
14462  for upper-case letters: A, B, C, \SpecialChar \ldots{}
14463
14464 \begin_inset Flex CharStyle:Code
14465 status collapsed
14466
14467 \begin_layout Plain Layout
14468 roman
14469 \end_layout
14470
14471 \end_inset
14472
14473  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
14474
14475 \begin_inset Flex CharStyle:Code
14476 status collapsed
14477
14478 \begin_layout Plain Layout
14479 Roman
14480 \end_layout
14481
14482 \end_inset
14483
14484  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
14485
14486 \begin_inset Flex CharStyle:Code
14487 status collapsed
14488
14489 \begin_layout Plain Layout
14490 hebrew
14491 \end_layout
14492
14493 \end_inset
14494
14495  for hebrew numerals.
14496 \end_layout
14497
14498 \end_deeper
14499 \begin_layout Standard
14500 If LabelString is not defined, a default value is constructed as follows:
14501  if the counter has a master counter 
14502 \begin_inset Flex CharStyle:Code
14503 status collapsed
14504
14505 \begin_layout Plain Layout
14506 master
14507 \end_layout
14508
14509 \end_inset
14510
14511  (defined via 
14512 \begin_inset Flex CharStyle:Code
14513 status collapsed
14514
14515 \begin_layout Plain Layout
14516 Within
14517 \end_layout
14518
14519 \end_inset
14520
14521 ), the string 
14522 \begin_inset Flex CharStyle:Code
14523 status collapsed
14524
14525 \begin_layout Plain Layout
14526
14527 \backslash
14528 themaster.
14529 \backslash
14530 arabic{counter}
14531 \end_layout
14532
14533 \end_inset
14534
14535  is used; otherwise the string 
14536 \begin_inset Flex CharStyle:Code
14537 status collapsed
14538
14539 \begin_layout Plain Layout
14540
14541 \backslash
14542 arabic{counter}
14543 \end_layout
14544
14545 \end_inset
14546
14547  is used.
14548 \end_layout
14549
14550 \begin_layout Description
14551 \begin_inset Flex CharStyle:Code
14552 status collapsed
14553
14554 \begin_layout Plain Layout
14555 LabelStringAppendix [string=""]
14556 \end_layout
14557
14558 \end_inset
14559
14560  Same as 
14561 \begin_inset Flex CharStyle:Code
14562 status collapsed
14563
14564 \begin_layout Plain Layout
14565 LabelString
14566 \end_layout
14567
14568 \end_inset
14569
14570 , but for use in the Appendix.
14571 \end_layout
14572
14573 \begin_layout Description
14574 \begin_inset Flex CharStyle:Code
14575 status collapsed
14576
14577 \begin_layout Plain Layout
14578 Within
14579 \end_layout
14580
14581 \end_inset
14582
14583  [
14584 \begin_inset Flex CharStyle:Code
14585 status collapsed
14586
14587 \begin_layout Plain Layout
14588 string
14589 \end_layout
14590
14591 \end_inset
14592
14593 =
14594 \begin_inset Quotes erd
14595 \end_inset
14596
14597
14598 \begin_inset Quotes erd
14599 \end_inset
14600
14601 ] If this is set to the name of another counter, the present counter will
14602  be reset every time the other one is increased.
14603  For example, 
14604 \begin_inset Flex CharStyle:Code
14605 status collapsed
14606
14607 \begin_layout Plain Layout
14608 subsection
14609 \end_layout
14610
14611 \end_inset
14612
14613  is numbered inside 
14614 \begin_inset Flex CharStyle:Code
14615 status collapsed
14616
14617 \begin_layout Plain Layout
14618 section
14619 \end_layout
14620
14621 \end_inset
14622
14623 .
14624 \end_layout
14625
14626 \begin_layout Subsection
14627 Font description
14628 \begin_inset CommandInset label
14629 LatexCommand label
14630 name "sub:Font-description"
14631
14632 \end_inset
14633
14634
14635 \end_layout
14636
14637 \begin_layout Standard
14638 A font description looks like this:
14639 \end_layout
14640
14641 \begin_layout LyX-Code
14642 Font 
14643 \family roman
14644 \emph on
14645 or
14646 \family default
14647 \emph default
14648  LabelFont
14649 \end_layout
14650
14651 \begin_layout LyX-Code
14652  ...
14653 \end_layout
14654
14655 \begin_layout LyX-Code
14656 EndFont
14657 \end_layout
14658
14659 \begin_layout Standard
14660 The following commands are available:
14661 \end_layout
14662
14663 \begin_layout Description
14664 \begin_inset Flex CharStyle:Code
14665 status collapsed
14666
14667 \begin_layout Plain Layout
14668 Color
14669 \end_layout
14670
14671 \end_inset
14672
14673  [
14674 \begin_inset Flex CharStyle:Code
14675 status collapsed
14676
14677 \begin_layout Plain Layout
14678
14679 \emph on
14680 none
14681 \end_layout
14682
14683 \end_inset
14684
14685
14686 \begin_inset Flex CharStyle:Code
14687 status collapsed
14688
14689 \begin_layout Plain Layout
14690 black
14691 \end_layout
14692
14693 \end_inset
14694
14695
14696 \begin_inset Flex CharStyle:Code
14697 status collapsed
14698
14699 \begin_layout Plain Layout
14700 white
14701 \end_layout
14702
14703 \end_inset
14704
14705
14706 \begin_inset Flex CharStyle:Code
14707 status collapsed
14708
14709 \begin_layout Plain Layout
14710 red
14711 \end_layout
14712
14713 \end_inset
14714
14715
14716 \begin_inset Flex CharStyle:Code
14717 status collapsed
14718
14719 \begin_layout Plain Layout
14720 green
14721 \end_layout
14722
14723 \end_inset
14724
14725
14726 \begin_inset Flex CharStyle:Code
14727 status collapsed
14728
14729 \begin_layout Plain Layout
14730 blue
14731 \end_layout
14732
14733 \end_inset
14734
14735
14736 \begin_inset Flex CharStyle:Code
14737 status collapsed
14738
14739 \begin_layout Plain Layout
14740 cyan
14741 \end_layout
14742
14743 \end_inset
14744
14745
14746 \begin_inset Flex CharStyle:Code
14747 status collapsed
14748
14749 \begin_layout Plain Layout
14750 magenta
14751 \end_layout
14752
14753 \end_inset
14754
14755
14756 \begin_inset Flex CharStyle:Code
14757 status collapsed
14758
14759 \begin_layout Plain Layout
14760 yellow
14761 \end_layout
14762
14763 \end_inset
14764
14765 ]
14766 \end_layout
14767
14768 \begin_layout Description
14769 \begin_inset Flex CharStyle:Code
14770 status collapsed
14771
14772 \begin_layout Plain Layout
14773 Family
14774 \end_layout
14775
14776 \end_inset
14777
14778  [
14779 \emph on
14780
14781 \begin_inset Flex CharStyle:Code
14782 status collapsed
14783
14784 \begin_layout Plain Layout
14785
14786 \emph on
14787 Roman
14788 \end_layout
14789
14790 \end_inset
14791
14792
14793 \emph default
14794
14795 \begin_inset Flex CharStyle:Code
14796 status collapsed
14797
14798 \begin_layout Plain Layout
14799 Sans
14800 \end_layout
14801
14802 \end_inset
14803
14804
14805 \begin_inset Flex CharStyle:Code
14806 status collapsed
14807
14808 \begin_layout Plain Layout
14809 Typewriter
14810 \end_layout
14811
14812 \end_inset
14813
14814
14815 \end_layout
14816
14817 \begin_layout Description
14818 \begin_inset Flex CharStyle:Code
14819 status collapsed
14820
14821 \begin_layout Plain Layout
14822 Misc
14823 \end_layout
14824
14825 \end_inset
14826
14827  [
14828 \begin_inset Flex CharStyle:Code
14829 status collapsed
14830
14831 \begin_layout Plain Layout
14832 string
14833 \end_layout
14834
14835 \end_inset
14836
14837 ] Valid arguments are: 
14838 \begin_inset Flex CharStyle:Code
14839 status collapsed
14840
14841 \begin_layout Plain Layout
14842 emph
14843 \end_layout
14844
14845 \end_inset
14846
14847
14848 \begin_inset Flex CharStyle:Code
14849 status collapsed
14850
14851 \begin_layout Plain Layout
14852 noun
14853 \end_layout
14854
14855 \end_inset
14856
14857
14858 \begin_inset Flex CharStyle:Code
14859 status collapsed
14860
14861 \begin_layout Plain Layout
14862 underbar
14863 \end_layout
14864
14865 \end_inset
14866
14867
14868 \begin_inset Flex CharStyle:Code
14869 status collapsed
14870
14871 \begin_layout Plain Layout
14872 no_emph
14873 \end_layout
14874
14875 \end_inset
14876
14877
14878 \begin_inset Flex CharStyle:Code
14879 status collapsed
14880
14881 \begin_layout Plain Layout
14882 no_noun
14883 \end_layout
14884
14885 \end_inset
14886
14887  and 
14888 \begin_inset Flex CharStyle:Code
14889 status collapsed
14890
14891 \begin_layout Plain Layout
14892 no_bar
14893 \end_layout
14894
14895 \end_inset
14896
14897 .
14898  Each of these turns on or off the corresponding attribute.
14899  For example, 
14900 \begin_inset Flex CharStyle:Code
14901 status collapsed
14902
14903 \begin_layout Plain Layout
14904 emph
14905 \end_layout
14906
14907 \end_inset
14908
14909  turns on emphasis, and 
14910 \begin_inset Flex CharStyle:Code
14911 status collapsed
14912
14913 \begin_layout Plain Layout
14914 no_emph
14915 \end_layout
14916
14917 \end_inset
14918
14919  turns it off.
14920  
14921 \begin_inset Newline newline
14922 \end_inset
14923
14924 If the latter seems puzzling, remember that the font settings for the present
14925  context are generally inherited from the surrounding context.
14926  So 
14927 \begin_inset Flex CharStyle:Code
14928 status collapsed
14929
14930 \begin_layout Plain Layout
14931 no_emph
14932 \end_layout
14933
14934 \end_inset
14935
14936  would turn off the emphasis that was anyway in effect, say, in a theorem
14937  environment.
14938 \end_layout
14939
14940 \begin_layout Description
14941 \begin_inset Flex CharStyle:Code
14942 status collapsed
14943
14944 \begin_layout Plain Layout
14945 Series
14946 \end_layout
14947
14948 \end_inset
14949
14950  [
14951 \emph on
14952
14953 \begin_inset Flex CharStyle:Code
14954 status collapsed
14955
14956 \begin_layout Plain Layout
14957
14958 \emph on
14959 Medium
14960 \end_layout
14961
14962 \end_inset
14963
14964
14965 \emph default
14966
14967 \begin_inset Flex CharStyle:Code
14968 status collapsed
14969
14970 \begin_layout Plain Layout
14971 Bold
14972 \end_layout
14973
14974 \end_inset
14975
14976
14977 \end_layout
14978
14979 \begin_layout Description
14980 \begin_inset Flex CharStyle:Code
14981 status collapsed
14982
14983 \begin_layout Plain Layout
14984 Shape
14985 \end_layout
14986
14987 \end_inset
14988
14989  [
14990 \emph on
14991
14992 \begin_inset Flex CharStyle:Code
14993 status collapsed
14994
14995 \begin_layout Plain Layout
14996
14997 \emph on
14998 Up
14999 \end_layout
15000
15001 \end_inset
15002
15003
15004 \emph default
15005
15006 \begin_inset Flex CharStyle:Code
15007 status collapsed
15008
15009 \begin_layout Plain Layout
15010 Italic
15011 \end_layout
15012
15013 \end_inset
15014
15015
15016 \begin_inset Flex CharStyle:Code
15017 status collapsed
15018
15019 \begin_layout Plain Layout
15020 SmallCaps
15021 \end_layout
15022
15023 \end_inset
15024
15025
15026 \begin_inset Flex CharStyle:Code
15027 status collapsed
15028
15029 \begin_layout Plain Layout
15030 Slanted
15031 \end_layout
15032
15033 \end_inset
15034
15035
15036 \end_layout
15037
15038 \begin_layout Description
15039 \begin_inset Flex CharStyle:Code
15040 status collapsed
15041
15042 \begin_layout Plain Layout
15043 Size
15044 \end_layout
15045
15046 \end_inset
15047
15048  [
15049 \begin_inset Flex CharStyle:Code
15050 status collapsed
15051
15052 \begin_layout Plain Layout
15053 tiny
15054 \end_layout
15055
15056 \end_inset
15057
15058
15059 \begin_inset Flex CharStyle:Code
15060 status collapsed
15061
15062 \begin_layout Plain Layout
15063 small
15064 \end_layout
15065
15066 \end_inset
15067
15068
15069 \begin_inset Flex CharStyle:Code
15070 status collapsed
15071
15072 \begin_layout Plain Layout
15073
15074 \emph on
15075 normal
15076 \end_layout
15077
15078 \end_inset
15079
15080
15081 \begin_inset Flex CharStyle:Code
15082 status collapsed
15083
15084 \begin_layout Plain Layout
15085 large
15086 \end_layout
15087
15088 \end_inset
15089
15090
15091 \begin_inset Flex CharStyle:Code
15092 status collapsed
15093
15094 \begin_layout Plain Layout
15095 larger
15096 \end_layout
15097
15098 \end_inset
15099
15100
15101 \begin_inset Flex CharStyle:Code
15102 status collapsed
15103
15104 \begin_layout Plain Layout
15105 largest
15106 \end_layout
15107
15108 \end_inset
15109
15110
15111 \begin_inset Flex CharStyle:Code
15112 status collapsed
15113
15114 \begin_layout Plain Layout
15115 huge
15116 \end_layout
15117
15118 \end_inset
15119
15120
15121 \begin_inset Flex CharStyle:Code
15122 status collapsed
15123
15124 \begin_layout Plain Layout
15125 giant
15126 \end_layout
15127
15128 \end_inset
15129
15130 ]
15131 \end_layout
15132
15133 \begin_layout Section
15134 \begin_inset CommandInset label
15135 LatexCommand label
15136 name "sec:Tags-for-XHTML"
15137
15138 \end_inset
15139
15140 Tags for XHTML output
15141 \end_layout
15142
15143 \begin_layout Standard
15144 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
15145  by layout information.
15146  In general, LyX provides sensible defaults and, as mentioned earlier, it
15147  will even construct default CSS style rules from the other layout tags.
15148  For example, LyX will attempt to use the information provided in the 
15149 \begin_inset Flex CharStyle:Code
15150 status collapsed
15151
15152 \begin_layout Plain Layout
15153 Font
15154 \end_layout
15155
15156 \end_inset
15157
15158  declaration for the Chapter style to write CSS that will appropriately
15159  format chapter headings.
15160 \end_layout
15161
15162 \begin_layout Standard
15163 In many cases, then, you may not have to do anything at all to get acceptable
15164  XHTML output for your own environments, custom insets, and so forth.
15165  But in some cases you will, and so LyX provides a number of layout tags
15166  that can be used to customize the XHTML and CSS that are generated.
15167 \end_layout
15168
15169 \begin_layout Standard
15170 Note that there are two tags, 
15171 \begin_inset Flex CharStyle:Code
15172 status collapsed
15173
15174 \begin_layout Plain Layout
15175 HTMLPreamble
15176 \end_layout
15177
15178 \end_inset
15179
15180  and 
15181 \begin_inset Flex CharStyle:Code
15182 status collapsed
15183
15184 \begin_layout Plain Layout
15185 AddToHTMLPreamble
15186 \end_layout
15187
15188 \end_inset
15189
15190  that may appear outside style and inset declarations.
15191  See 
15192 \begin_inset CommandInset ref
15193 LatexCommand prettyref
15194 reference "sub:General-text-class"
15195
15196 \end_inset
15197
15198  for details on these.
15199 \end_layout
15200
15201 \begin_layout Subsection
15202 \begin_inset CommandInset label
15203 LatexCommand label
15204 name "sub:Paragraph-Style-XHTML"
15205
15206 \end_inset
15207
15208 Paragraph styles
15209 \end_layout
15210
15211 \begin_layout Standard
15212 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
15213  dealing with a normal paragraph, a command, or an environment, where this
15214  is itself determined by the contents of the corresponding 
15215 \begin_inset Flex CharStyle:Code
15216 status collapsed
15217
15218 \begin_layout Plain Layout
15219 LaTeXType
15220 \end_layout
15221
15222 \end_inset
15223
15224  tag.
15225  
15226 \end_layout
15227
15228 \begin_layout Standard
15229 For a command or normal paragraph, the output XHTML has the following form:
15230 \end_layout
15231
15232 \begin_layout LyX-Code
15233 <tag attr=
15234 \begin_inset Quotes erd
15235 \end_inset
15236
15237 value
15238 \begin_inset Quotes erd
15239 \end_inset
15240
15241 >
15242 \end_layout
15243
15244 \begin_layout LyX-Code
15245 <labeltag attr=
15246 \begin_inset Quotes erd
15247 \end_inset
15248
15249 value
15250 \begin_inset Quotes erd
15251 \end_inset
15252
15253 >Label</labeltag>
15254 \end_layout
15255
15256 \begin_layout LyX-Code
15257 Contents of the paragraph.
15258 \end_layout
15259
15260 \begin_layout LyX-Code
15261 </tag>
15262 \end_layout
15263
15264 \begin_layout Standard
15265 The label tags are of course omitted if the paragraph does not have a label.
15266 \end_layout
15267
15268 \begin_layout Standard
15269 For an environment that is not some sort of list, the XHTML takes this form:
15270 \end_layout
15271
15272 \begin_layout LyX-Code
15273 <tag attr=
15274 \begin_inset Quotes erd
15275 \end_inset
15276
15277 value
15278 \begin_inset Quotes erd
15279 \end_inset
15280
15281 >
15282 \end_layout
15283
15284 \begin_layout LyX-Code
15285 <itemtag attr=
15286 \begin_inset Quotes erd
15287 \end_inset
15288
15289 value
15290 \begin_inset Quotes erd
15291 \end_inset
15292
15293 ><labeltag attr=
15294 \begin_inset Quotes erd
15295 \end_inset
15296
15297 value
15298 \begin_inset Quotes erd
15299 \end_inset
15300
15301 >Environment Label</labeltag>First paragraph.</itemtag>
15302 \end_layout
15303
15304 \begin_layout LyX-Code
15305 <itemtag>Second paragraph.</itemtag>
15306 \end_layout
15307
15308 \begin_layout LyX-Code
15309 </tag>
15310 \end_layout
15311
15312 \begin_layout Standard
15313 Note that the label is output only for the first paragraph, as it should
15314  be for a theorem, for example.
15315  
15316 \end_layout
15317
15318 \begin_layout Standard
15319 For a list, we have one of these forms:
15320 \end_layout
15321
15322 \begin_layout LyX-Code
15323 <tag attr=
15324 \begin_inset Quotes erd
15325 \end_inset
15326
15327 value
15328 \begin_inset Quotes erd
15329 \end_inset
15330
15331 >
15332 \end_layout
15333
15334 \begin_layout LyX-Code
15335 <itemtag attr=
15336 \begin_inset Quotes erd
15337 \end_inset
15338
15339 value
15340 \begin_inset Quotes erd
15341 \end_inset
15342
15343 ><labeltag attr=
15344 \begin_inset Quotes erd
15345 \end_inset
15346
15347 value
15348 \begin_inset Quotes erd
15349 \end_inset
15350
15351 >List Label</labeltag>First item.</itemtag>
15352 \end_layout
15353
15354 \begin_layout LyX-Code
15355 <itemtag attr=
15356 \begin_inset Quotes erd
15357 \end_inset
15358
15359 value
15360 \begin_inset Quotes erd
15361 \end_inset
15362
15363 ><labeltag attr=
15364 \begin_inset Quotes erd
15365 \end_inset
15366
15367 value
15368 \begin_inset Quotes erd
15369 \end_inset
15370
15371 >List Label</labeltag>Second item.</itemtag>
15372 \end_layout
15373
15374 \begin_layout LyX-Code
15375 </tag>
15376 \end_layout
15377
15378 \begin_layout LyX-Code
15379
15380 \end_layout
15381
15382 \begin_layout LyX-Code
15383 <tag attr=
15384 \begin_inset Quotes erd
15385 \end_inset
15386
15387 value
15388 \begin_inset Quotes erd
15389 \end_inset
15390
15391 >
15392 \end_layout
15393
15394 \begin_layout LyX-Code
15395 <labeltag attr=
15396 \begin_inset Quotes erd
15397 \end_inset
15398
15399 value
15400 \begin_inset Quotes erd
15401 \end_inset
15402
15403 >List Label</labeltag><itemtag attr=
15404 \begin_inset Quotes erd
15405 \end_inset
15406
15407 value
15408 \begin_inset Quotes erd
15409 \end_inset
15410
15411 >First item.</itemtag>
15412 \end_layout
15413
15414 \begin_layout LyX-Code
15415 <labeltag attr=
15416 \begin_inset Quotes erd
15417 \end_inset
15418
15419 value
15420 \begin_inset Quotes erd
15421 \end_inset
15422
15423 >List Label</labeltag><itemtag attr=
15424 \begin_inset Quotes erd
15425 \end_inset
15426
15427 value
15428 \begin_inset Quotes erd
15429 \end_inset
15430
15431 >Second item.</itemtag>
15432 \end_layout
15433
15434 \begin_layout LyX-Code
15435 </tag>
15436 \end_layout
15437
15438 \begin_layout Standard
15439 Note the different orders of 
15440 \begin_inset Flex CharStyle:Code
15441 status collapsed
15442
15443 \begin_layout Plain Layout
15444 labeltag
15445 \end_layout
15446
15447 \end_inset
15448
15449  and 
15450 \begin_inset Flex CharStyle:Code
15451 status collapsed
15452
15453 \begin_layout Plain Layout
15454 itemtag
15455 \end_layout
15456
15457 \end_inset
15458
15459 .
15460  Which order we get depends upon the setting of 
15461 \begin_inset Flex CharStyle:Code
15462 status collapsed
15463
15464 \begin_layout Plain Layout
15465 HTMLLabelFirst
15466 \end_layout
15467
15468 \end_inset
15469
15470 : If 
15471 \begin_inset Flex CharStyle:Code
15472 status collapsed
15473
15474 \begin_layout Plain Layout
15475 HTMLLabelFirst
15476 \end_layout
15477
15478 \end_inset
15479
15480  is false (the default), you get the first of these, with the label within
15481  the item; if true, you get the second, with the label outside the item.
15482 \end_layout
15483
15484 \begin_layout Standard
15485 The specific tags and attributes output for each paragraph type can be controlle
15486 d by means of the layout tags we are about to describe.
15487  As mentioned earlier, however, LyX uses sensible defaults for many of these,
15488  so you often may not need to do very much to get good XHTML output.
15489  Think of the available tags as there so you can tweak things to your liking.
15490 \end_layout
15491
15492 \begin_layout Description
15493 \begin_inset Flex CharStyle:Code
15494 status collapsed
15495
15496 \begin_layout Plain Layout
15497 HTMLAttr
15498 \end_layout
15499
15500 \end_inset
15501
15502  [
15503 \begin_inset Flex CharStyle:Code
15504 status collapsed
15505
15506 \begin_layout Plain Layout
15507 string
15508 \end_layout
15509
15510 \end_inset
15511
15512 ] Specifies attribute information to be output with the main tag.
15513  For example, 
15514 \begin_inset Quotes eld
15515 \end_inset
15516
15517
15518 \begin_inset Flex CharStyle:Code
15519 status collapsed
15520
15521 \begin_layout Plain Layout
15522 class=`mydiv'
15523 \end_layout
15524
15525 \end_inset
15526
15527
15528 \begin_inset Quotes erd
15529 \end_inset
15530
15531 .
15532  By default, LyX will output 
15533 \begin_inset Quotes eld
15534 \end_inset
15535
15536
15537 \begin_inset Flex CharStyle:Code
15538 status collapsed
15539
15540 \begin_layout Plain Layout
15541 class=`layoutname'
15542 \end_layout
15543
15544 \end_inset
15545
15546
15547 \begin_inset Quotes erd
15548 \end_inset
15549
15550 , where 
15551 \begin_inset Flex CharStyle:Code
15552 status collapsed
15553
15554 \begin_layout Plain Layout
15555 layoutname
15556 \end_layout
15557
15558 \end_inset
15559
15560  is the LyX name of the layout, made lowercase, for example: chapter.
15561 \end_layout
15562
15563 \begin_layout Description
15564 \begin_inset Flex CharStyle:Code
15565 status collapsed
15566
15567 \begin_layout Plain Layout
15568 HTMLForceCSS
15569 \end_layout
15570
15571 \end_inset
15572
15573  [
15574 \begin_inset Flex CharStyle:Code
15575 status collapsed
15576
15577 \begin_layout Plain Layout
15578 0,1
15579 \end_layout
15580
15581 \end_inset
15582
15583 ] Whether to output the default CSS information LyX generates for this layout,
15584  even if additional information is explicitly provided via 
15585 \begin_inset Flex CharStyle:Code
15586 status collapsed
15587
15588 \begin_layout Plain Layout
15589 HTMLStyle
15590 \end_layout
15591
15592 \end_inset
15593
15594 .
15595  Setting this to 
15596 \begin_inset Flex CharStyle:Code
15597 status collapsed
15598
15599 \begin_layout Plain Layout
15600 1
15601 \end_layout
15602
15603 \end_inset
15604
15605  allows you to alter or augment the generated CSS, rather than to override
15606  it completely.
15607  Default is 
15608 \begin_inset Flex CharStyle:Code
15609 status collapsed
15610
15611 \begin_layout Plain Layout
15612 0
15613 \end_layout
15614
15615 \end_inset
15616
15617 .
15618 \end_layout
15619
15620 \begin_layout Description
15621 \begin_inset Flex CharStyle:Code
15622 status collapsed
15623
15624 \begin_layout Plain Layout
15625 HTMLItem
15626 \end_layout
15627
15628 \end_inset
15629
15630  [
15631 \begin_inset Flex CharStyle:Code
15632 status collapsed
15633
15634 \begin_layout Plain Layout
15635 string
15636 \end_layout
15637
15638 \end_inset
15639
15640 ] The tag to be used for individual paragraphs of environments, replacing
15641  
15642 \begin_inset Flex CharStyle:Code
15643 status collapsed
15644
15645 \begin_layout Plain Layout
15646 itemtag
15647 \end_layout
15648
15649 \end_inset
15650
15651  in the examples above.
15652  Defaults to 
15653 \begin_inset Flex CharStyle:Code
15654 status collapsed
15655
15656 \begin_layout Plain Layout
15657 div
15658 \end_layout
15659
15660 \end_inset
15661
15662 .
15663 \end_layout
15664
15665 \begin_layout Description
15666 \begin_inset Flex CharStyle:Code
15667 status collapsed
15668
15669 \begin_layout Plain Layout
15670 HTMLItemAttr
15671 \end_layout
15672
15673 \end_inset
15674
15675  [
15676 \begin_inset Flex CharStyle:Code
15677 status collapsed
15678
15679 \begin_layout Plain Layout
15680 string
15681 \end_layout
15682
15683 \end_inset
15684
15685 ] Attributes for the item tag.
15686  Defaults to 
15687 \begin_inset Quotes eld
15688 \end_inset
15689
15690
15691 \begin_inset Flex CharStyle:Code
15692 status collapsed
15693
15694 \begin_layout Plain Layout
15695 class=`layoutname_item'
15696 \end_layout
15697
15698 \end_inset
15699
15700
15701 \begin_inset Quotes erd
15702 \end_inset
15703
15704 .
15705 \end_layout
15706
15707 \begin_layout Description
15708 \begin_inset Flex CharStyle:Code
15709 status collapsed
15710
15711 \begin_layout Plain Layout
15712 HTMLLabel
15713 \end_layout
15714
15715 \end_inset
15716
15717  [
15718 \begin_inset Flex CharStyle:Code
15719 status collapsed
15720
15721 \begin_layout Plain Layout
15722 string
15723 \end_layout
15724
15725 \end_inset
15726
15727 ] The tag to be used for paragraph and item labels, replacing 
15728 \begin_inset Flex CharStyle:Code
15729 status collapsed
15730
15731 \begin_layout Plain Layout
15732 labeltag
15733 \end_layout
15734
15735 \end_inset
15736
15737  in the examples above.
15738  Defaults to 
15739 \begin_inset Flex CharStyle:Code
15740 status collapsed
15741
15742 \begin_layout Plain Layout
15743 span
15744 \end_layout
15745
15746 \end_inset
15747
15748 .
15749 \end_layout
15750
15751 \begin_layout Description
15752 \begin_inset Flex CharStyle:Code
15753 status collapsed
15754
15755 \begin_layout Plain Layout
15756 HTMLLabelAttr
15757 \end_layout
15758
15759 \end_inset
15760
15761  [
15762 \begin_inset Flex CharStyle:Code
15763 status collapsed
15764
15765 \begin_layout Plain Layout
15766 string
15767 \end_layout
15768
15769 \end_inset
15770
15771 ] Attributes for the label tag.
15772  Defaults to 
15773 \begin_inset Quotes eld
15774 \end_inset
15775
15776
15777 \begin_inset Flex CharStyle:Code
15778 status collapsed
15779
15780 \begin_layout Plain Layout
15781 class=`layoutname_label'
15782 \end_layout
15783
15784 \end_inset
15785
15786
15787 \begin_inset Quotes erd
15788 \end_inset
15789
15790 .
15791 \end_layout
15792
15793 \begin_layout Description
15794 \begin_inset Flex CharStyle:Code
15795 status collapsed
15796
15797 \begin_layout Plain Layout
15798 HTMLLabelFirst
15799 \end_layout
15800
15801 \end_inset
15802
15803  [
15804 \begin_inset Flex CharStyle:Code
15805 status collapsed
15806
15807 \begin_layout Plain Layout
15808 0,1
15809 \end_layout
15810
15811 \end_inset
15812
15813 ] Meaningful only for list-like environments, this tag controls whether
15814  the label tag is output before or inside the item tag.
15815  This is used, for example, in the description environment, where we want
15816  `
15817 \begin_inset Flex CharStyle:Code
15818 status collapsed
15819
15820 \begin_layout Plain Layout
15821 <dt>\SpecialChar \ldots{}
15822 </dt><dd>\SpecialChar \ldots{}
15823 </dd>
15824 \end_layout
15825
15826 \end_inset
15827
15828 .
15829  Default is 
15830 \begin_inset Flex CharStyle:Code
15831 status collapsed
15832
15833 \begin_layout Plain Layout
15834 0
15835 \end_layout
15836
15837 \end_inset
15838
15839 : The label tag is output inside the item tag.
15840 \end_layout
15841
15842 \begin_layout Description
15843 \begin_inset Flex CharStyle:Code
15844 status collapsed
15845
15846 \begin_layout Plain Layout
15847 HTMLPreamble
15848 \end_layout
15849
15850 \end_inset
15851
15852  Information to be output in the 
15853 \begin_inset Flex CharStyle:Code
15854 status collapsed
15855
15856 \begin_layout Plain Layout
15857 <head>
15858 \end_layout
15859
15860 \end_inset
15861
15862  section when this style is used.
15863  This might, for example, be used to include a 
15864 \begin_inset Flex CharStyle:Code
15865 status collapsed
15866
15867 \begin_layout Plain Layout
15868 <script>
15869 \end_layout
15870
15871 \end_inset
15872
15873  block defining an 
15874 \begin_inset Flex CharStyle:Code
15875 status collapsed
15876
15877 \begin_layout Plain Layout
15878 onclick
15879 \end_layout
15880
15881 \end_inset
15882
15883  handler.
15884 \end_layout
15885
15886 \begin_layout Description
15887 \begin_inset Flex CharStyle:Code
15888 status collapsed
15889
15890 \begin_layout Plain Layout
15891 HTMLStyle
15892 \end_layout
15893
15894 \end_inset
15895
15896  CSS style information to be included when this style is used.
15897  Note that this will automatically be wrapped in a layout-generated 
15898 \begin_inset Flex CharStyle:Code
15899 status collapsed
15900
15901 \begin_layout Plain Layout
15902 <style>
15903 \end_layout
15904
15905 \end_inset
15906
15907  block, so only the CSS itself need be included.
15908 \end_layout
15909
15910 \begin_layout Description
15911 \begin_inset Flex CharStyle:Code
15912 status collapsed
15913
15914 \begin_layout Plain Layout
15915 HTMLTag
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 string
15926 \end_layout
15927
15928 \end_inset
15929
15930 ] The tag to be used for the main label, replacing 
15931 \begin_inset Flex CharStyle:Code
15932 status collapsed
15933
15934 \begin_layout Plain Layout
15935 tag
15936 \end_layout
15937
15938 \end_inset
15939
15940  in the examples above.
15941  Defaults to 
15942 \begin_inset Flex CharStyle:Code
15943 status collapsed
15944
15945 \begin_layout Plain Layout
15946 div
15947 \end_layout
15948
15949 \end_inset
15950
15951 .
15952 \end_layout
15953
15954 \begin_layout Subsection
15955 InsetLayout XHTML
15956 \end_layout
15957
15958 \begin_layout Standard
15959 The XHTML output of insets can also be controlled by information in layout
15960  files.
15961 \begin_inset Foot
15962 status collapsed
15963
15964 \begin_layout Plain Layout
15965 At present, this is true only for 
15966 \begin_inset Quotes eld
15967 \end_inset
15968
15969 text
15970 \begin_inset Quotes erd
15971 \end_inset
15972
15973  insets (insets you can type into) and is not true for 
15974 \begin_inset Quotes eld
15975 \end_inset
15976
15977 command
15978 \begin_inset Quotes erd
15979 \end_inset
15980
15981  insets (insets that are associated with dialog boxes).
15982 \end_layout
15983
15984 \end_inset
15985
15986  Here, too, LyX tries to provide sensible defaults, and it constructs default
15987  CSS style rules.
15988  But everything can be customized.
15989 \end_layout
15990
15991 \begin_layout Standard
15992 The XHTML LyX outputs for an inset has the following form:
15993 \end_layout
15994
15995 \begin_layout LyX-Code
15996 <tag attr=
15997 \begin_inset Quotes erd
15998 \end_inset
15999
16000 value
16001 \begin_inset Quotes erd
16002 \end_inset
16003
16004 >
16005 \end_layout
16006
16007 \begin_layout LyX-Code
16008 <labeltag>Label</labeltag>
16009 \end_layout
16010
16011 \begin_layout LyX-Code
16012 <innertag attr=
16013 \begin_inset Quotes erd
16014 \end_inset
16015
16016 value
16017 \begin_inset Quotes erd
16018 \end_inset
16019
16020 >Contents of the inset.</innertag>
16021 \end_layout
16022
16023 \begin_layout LyX-Code
16024 </tag>
16025 \end_layout
16026
16027 \begin_layout Standard
16028 If the inset permits multiple paragraphs---that is, if 
16029 \begin_inset Flex CharStyle:Code
16030 status collapsed
16031
16032 \begin_layout Plain Layout
16033 MultiPar
16034 \end_layout
16035
16036 \end_inset
16037
16038  is true---then the contents of the inset will itself be output as paragraphs
16039  formatted according to the styles used for those paragraphs (standard,
16040  quote, and the like).
16041  The label tag is of course omitted if the paragraph does not have a label
16042  and, at present, is always 
16043 \begin_inset Flex CharStyle:Code
16044 status collapsed
16045
16046 \begin_layout Plain Layout
16047 span
16048 \end_layout
16049
16050 \end_inset
16051
16052 .
16053  The inner tag is optional and, by default, does not appear.
16054 \end_layout
16055
16056 \begin_layout Standard
16057 The specific tags and attributes output for each inset can be controlled
16058  by means of the following layout tags.
16059 \end_layout
16060
16061 \begin_layout Description
16062 \begin_inset Flex CharStyle:Code
16063 status collapsed
16064
16065 \begin_layout Plain Layout
16066 HTMLAttr
16067 \end_layout
16068
16069 \end_inset
16070
16071  [
16072 \begin_inset Flex CharStyle:Code
16073 status collapsed
16074
16075 \begin_layout Plain Layout
16076 string
16077 \end_layout
16078
16079 \end_inset
16080
16081 ] Specifies attribute information to be output with the main tag.
16082  For example, 
16083 \begin_inset Quotes eld
16084 \end_inset
16085
16086
16087 \begin_inset Flex CharStyle:Code
16088 status collapsed
16089
16090 \begin_layout Plain Layout
16091 class=`myinset' onclick=`\SpecialChar \ldots{}
16092 '
16093 \end_layout
16094
16095 \end_inset
16096
16097
16098 \begin_inset Quotes erd
16099 \end_inset
16100
16101 .
16102  By default, LyX will output 
16103 \begin_inset Quotes eld
16104 \end_inset
16105
16106
16107 \begin_inset Flex CharStyle:Code
16108 status collapsed
16109
16110 \begin_layout Plain Layout
16111 class=`insetname'
16112 \end_layout
16113
16114 \end_inset
16115
16116
16117 \begin_inset Quotes erd
16118 \end_inset
16119
16120 , where 
16121 \begin_inset Flex CharStyle:Code
16122 status collapsed
16123
16124 \begin_layout Plain Layout
16125 insetname
16126 \end_layout
16127
16128 \end_inset
16129
16130  is the LyX name of the inset, made lowercase and with non-alphanumeric
16131  characters converted to underscores, for example: footnote.
16132 \end_layout
16133
16134 \begin_layout Description
16135 \begin_inset Flex CharStyle:Code
16136 status collapsed
16137
16138 \begin_layout Plain Layout
16139 HTMLForceCSS
16140 \end_layout
16141
16142 \end_inset
16143
16144  [
16145 \begin_inset Flex CharStyle:Code
16146 status collapsed
16147
16148 \begin_layout Plain Layout
16149
16150 \emph on
16151 0
16152 \emph default
16153 ,1
16154 \end_layout
16155
16156 \end_inset
16157
16158 ] Whether to output the default CSS information LyX generates for this layout,
16159  even if additional information is explicitly provided via 
16160 \begin_inset Flex CharStyle:Code
16161 status collapsed
16162
16163 \begin_layout Plain Layout
16164 HTMLStyle
16165 \end_layout
16166
16167 \end_inset
16168
16169 .
16170  Setting this to 
16171 \begin_inset Flex CharStyle:Code
16172 status collapsed
16173
16174 \begin_layout Plain Layout
16175 1
16176 \end_layout
16177
16178 \end_inset
16179
16180  allows you to alter or augment the generated CSS, rather than to override
16181  it completely.
16182  Default is 0.
16183 \end_layout
16184
16185 \begin_layout Description
16186 \begin_inset Flex CharStyle:Code
16187 status collapsed
16188
16189 \begin_layout Plain Layout
16190 HTMLInnerAttr
16191 \end_layout
16192
16193 \end_inset
16194
16195  [
16196 \begin_inset Flex CharStyle:Code
16197 status collapsed
16198
16199 \begin_layout Plain Layout
16200 string
16201 \end_layout
16202
16203 \end_inset
16204
16205 ] Attributes for the inner tag.
16206  Defaults to 
16207 \begin_inset Quotes eld
16208 \end_inset
16209
16210
16211 \begin_inset Flex CharStyle:Code
16212 status collapsed
16213
16214 \begin_layout Plain Layout
16215 class=`insetname_inner'
16216 \end_layout
16217
16218 \end_inset
16219
16220
16221 \begin_inset Quotes erd
16222 \end_inset
16223
16224 .
16225 \end_layout
16226
16227 \begin_layout Description
16228 \begin_inset Flex CharStyle:Code
16229 status collapsed
16230
16231 \begin_layout Plain Layout
16232 HTMLInnerTag
16233 \end_layout
16234
16235 \end_inset
16236
16237  [
16238 \begin_inset Flex CharStyle:Code
16239 status collapsed
16240
16241 \begin_layout Plain Layout
16242 string
16243 \end_layout
16244
16245 \end_inset
16246
16247 ] The inner tag, replacing 
16248 \begin_inset Flex CharStyle:Code
16249 status collapsed
16250
16251 \begin_layout Plain Layout
16252 innertag
16253 \end_layout
16254
16255 \end_inset
16256
16257  in the examples above.
16258  By default, there is none.
16259 \end_layout
16260
16261 \begin_layout Description
16262 \begin_inset Flex CharStyle:Code
16263 status collapsed
16264
16265 \begin_layout Plain Layout
16266 HTMLIsBlock
16267 \end_layout
16268
16269 \end_inset
16270
16271  [
16272 \begin_inset Flex CharStyle:Code
16273 status collapsed
16274
16275 \begin_layout Plain Layout
16276 0,
16277 \emph on
16278 1
16279 \end_layout
16280
16281 \end_inset
16282
16283 ] Whether this inset represents a standalone block of text (such as a footnote)
16284  or instead represents material that is included in the surrounding text
16285  (such as a branch).
16286  Defaults to 1.
16287 \end_layout
16288
16289 \begin_layout Description
16290 \begin_inset Flex CharStyle:Code
16291 status collapsed
16292
16293 \begin_layout Plain Layout
16294 HTMLLabel
16295 \end_layout
16296
16297 \end_inset
16298
16299  [
16300 \begin_inset Flex CharStyle:Code
16301 status collapsed
16302
16303 \begin_layout Plain Layout
16304 string
16305 \end_layout
16306
16307 \end_inset
16308
16309 ] A label for this inset, possibly including a reference to a counter.
16310  For example, for footnote, it might be: 
16311 \begin_inset Flex CharStyle:Code
16312 status collapsed
16313
16314 \begin_layout Plain Layout
16315
16316 \backslash
16317 arabic{footnote}
16318 \end_layout
16319
16320 \end_inset
16321
16322 .
16323  This is optional, and there is no default.
16324 \end_layout
16325
16326 \begin_layout Description
16327 \begin_inset Flex CharStyle:Code
16328 status collapsed
16329
16330 \begin_layout Plain Layout
16331 HTMLPreamble
16332 \end_layout
16333
16334 \end_inset
16335
16336  Information to be output in the 
16337 \begin_inset Flex CharStyle:Code
16338 status collapsed
16339
16340 \begin_layout Plain Layout
16341 <head>
16342 \end_layout
16343
16344 \end_inset
16345
16346  section when this style is used.
16347  This might, for example, be used to include a 
16348 \begin_inset Flex CharStyle:Code
16349 status collapsed
16350
16351 \begin_layout Plain Layout
16352 <script>
16353 \end_layout
16354
16355 \end_inset
16356
16357  block defining an 
16358 \begin_inset Flex CharStyle:Code
16359 status collapsed
16360
16361 \begin_layout Plain Layout
16362 onclick
16363 \end_layout
16364
16365 \end_inset
16366
16367  handler.
16368 \end_layout
16369
16370 \begin_layout Description
16371 \begin_inset Flex CharStyle:Code
16372 status collapsed
16373
16374 \begin_layout Plain Layout
16375 HTMLStyle
16376 \end_layout
16377
16378 \end_inset
16379
16380  CSS style information to be included when this style is used.
16381  Note that this will automatically be wrapped in a layout-generated 
16382 \begin_inset Flex CharStyle:Code
16383 status collapsed
16384
16385 \begin_layout Plain Layout
16386 <style>
16387 \end_layout
16388
16389 \end_inset
16390
16391  block, so only the CSS itself need be included.
16392 \end_layout
16393
16394 \begin_layout Description
16395 \begin_inset Flex CharStyle:Code
16396 status collapsed
16397
16398 \begin_layout Plain Layout
16399 HTMLTag
16400 \end_layout
16401
16402 \end_inset
16403
16404  [
16405 \begin_inset Flex CharStyle:Code
16406 status collapsed
16407
16408 \begin_layout Plain Layout
16409 string
16410 \end_layout
16411
16412 \end_inset
16413
16414 ] The tag to be used for the main label, replacing 
16415 \begin_inset Flex CharStyle:Code
16416 status collapsed
16417
16418 \begin_layout Plain Layout
16419 tag
16420 \end_layout
16421
16422 \end_inset
16423
16424  in the examples above.
16425  The default depends upon the setting of 
16426 \begin_inset Flex CharStyle:Code
16427 status collapsed
16428
16429 \begin_layout Plain Layout
16430 MultiPar
16431 \end_layout
16432
16433 \end_inset
16434
16435 : If 
16436 \begin_inset Flex CharStyle:Code
16437 status collapsed
16438
16439 \begin_layout Plain Layout
16440 MultiPar
16441 \end_layout
16442
16443 \end_inset
16444
16445  is true, the default is 
16446 \begin_inset Flex CharStyle:Code
16447 status collapsed
16448
16449 \begin_layout Plain Layout
16450 div
16451 \end_layout
16452
16453 \end_inset
16454
16455 ; if it is false, the default is 
16456 \begin_inset Flex CharStyle:Code
16457 status collapsed
16458
16459 \begin_layout Plain Layout
16460 span
16461 \end_layout
16462
16463 \end_inset
16464
16465 .
16466 \end_layout
16467
16468 \begin_layout Subsection
16469 Float XHTML
16470 \end_layout
16471
16472 \begin_layout Standard
16473 The XHTML output for floats too can be controlled by layout information.
16474  The output has the following form:
16475 \end_layout
16476
16477 \begin_layout LyX-Code
16478 <tag attr=
16479 \begin_inset Quotes erd
16480 \end_inset
16481
16482 value
16483 \begin_inset Quotes erd
16484 \end_inset
16485
16486 >
16487 \end_layout
16488
16489 \begin_layout LyX-Code
16490 Contents of the float.
16491 \end_layout
16492
16493 \begin_layout LyX-Code
16494 </tag>
16495 \end_layout
16496
16497 \begin_layout Standard
16498 The caption, if there is one, is a separate inset and will be output as
16499  such.
16500  Its appearance can be controlled via the InsetLayout for caption insets.
16501  
16502 \end_layout
16503
16504 \begin_layout Description
16505 \begin_inset Flex CharStyle:Code
16506 status collapsed
16507
16508 \begin_layout Plain Layout
16509 HTMLAttr
16510 \end_layout
16511
16512 \end_inset
16513
16514  [
16515 \begin_inset Flex CharStyle:Code
16516 status collapsed
16517
16518 \begin_layout Plain Layout
16519 string
16520 \end_layout
16521
16522 \end_inset
16523
16524 ] Specifies attribute information to be output with the main tag.
16525  For example, 
16526 \begin_inset Quotes eld
16527 \end_inset
16528
16529
16530 \begin_inset Flex CharStyle:Code
16531 status collapsed
16532
16533 \begin_layout Plain Layout
16534 class=`myfloat' onclick=`\SpecialChar \ldots{}
16535 '
16536 \end_layout
16537
16538 \end_inset
16539
16540
16541 \begin_inset Quotes erd
16542 \end_inset
16543
16544 .
16545  By default, LyX will output 
16546 \begin_inset Quotes eld
16547 \end_inset
16548
16549
16550 \begin_inset Flex CharStyle:Code
16551 status collapsed
16552
16553 \begin_layout Plain Layout
16554 class=`float float-floattype'
16555 \end_layout
16556
16557 \end_inset
16558
16559
16560 \begin_inset Quotes erd
16561 \end_inset
16562
16563 , where 
16564 \begin_inset Flex CharStyle:Code
16565 status collapsed
16566
16567 \begin_layout Plain Layout
16568 floattype
16569 \end_layout
16570
16571 \end_inset
16572
16573  is LyX's name for this type of float, as determined by the float delcaration
16574  (see 
16575 \begin_inset CommandInset ref
16576 LatexCommand ref
16577 reference "sub:Floats"
16578
16579 \end_inset
16580
16581 ), though made lowercase and with non-alphanumeric characters converted
16582  to underscores, for example: float-table.
16583 \end_layout
16584
16585 \begin_layout Description
16586 \begin_inset Flex CharStyle:Code
16587 status collapsed
16588
16589 \begin_layout Plain Layout
16590 HTMLStyle
16591 \end_layout
16592
16593 \end_inset
16594
16595  CSS style information to be included when this float is used.
16596  Note that this will automatically be wrapped in a layout-generated 
16597 \begin_inset Flex CharStyle:Code
16598 status collapsed
16599
16600 \begin_layout Plain Layout
16601 <style>
16602 \end_layout
16603
16604 \end_inset
16605
16606  block, so only the CSS itself need be included.
16607 \end_layout
16608
16609 \begin_layout Description
16610 \begin_inset Flex CharStyle:Code
16611 status collapsed
16612
16613 \begin_layout Plain Layout
16614 HTMLTag
16615 \end_layout
16616
16617 \end_inset
16618
16619  [
16620 \begin_inset Flex CharStyle:Code
16621 status collapsed
16622
16623 \begin_layout Plain Layout
16624 string
16625 \end_layout
16626
16627 \end_inset
16628
16629 ] The tag to be used for this float, replacing 
16630 \begin_inset Quotes eld
16631 \end_inset
16632
16633
16634 \begin_inset Flex CharStyle:Code
16635 status collapsed
16636
16637 \begin_layout Plain Layout
16638 tag
16639 \end_layout
16640
16641 \end_inset
16642
16643
16644 \begin_inset Quotes erd
16645 \end_inset
16646
16647  in the example above.
16648  The default is 
16649 \begin_inset Flex CharStyle:Code
16650 status collapsed
16651
16652 \begin_layout Plain Layout
16653 div
16654 \end_layout
16655
16656 \end_inset
16657
16658  and will rarely need changing.
16659 \end_layout
16660
16661 \begin_layout Subsection
16662 LyX-generated CSS
16663 \end_layout
16664
16665 \begin_layout Standard
16666 We have several times mentioned that LyX will generate default CSS style
16667  rules for both insets and paragraph styles, based upon the other layout
16668  information that is provided.
16669  In this section, we shall say a word about which layout information LyX
16670  uses and how.
16671 \end_layout
16672
16673 \begin_layout Standard
16674 At present, LyX auto-generates CSS only for font information, making use
16675  of the 
16676 \begin_inset Flex CharStyle:Code
16677 status collapsed
16678
16679 \begin_layout Plain Layout
16680 Family
16681 \end_layout
16682
16683 \end_inset
16684
16685
16686 \begin_inset Flex CharStyle:Code
16687 status collapsed
16688
16689 \begin_layout Plain Layout
16690 Series
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 Shape
16701 \end_layout
16702
16703 \end_inset
16704
16705 , and 
16706 \begin_inset Flex CharStyle:Code
16707 status collapsed
16708
16709 \begin_layout Plain Layout
16710 Size
16711 \end_layout
16712
16713 \end_inset
16714
16715  specified in the 
16716 \begin_inset Flex CharStyle:Code
16717 status collapsed
16718
16719 \begin_layout Plain Layout
16720 Font
16721 \end_layout
16722
16723 \end_inset
16724
16725  declaration.
16726  (See 
16727 \begin_inset CommandInset ref
16728 LatexCommand ref
16729 reference "sub:Font-description"
16730
16731 \end_inset
16732
16733 .) The translation is mostly straightforward and obvious.
16734  For example, 
16735 \begin_inset Quotes eld
16736 \end_inset
16737
16738
16739 \begin_inset Flex CharStyle:Code
16740 status collapsed
16741
16742 \begin_layout Plain Layout
16743 Family Sans
16744 \end_layout
16745
16746 \end_inset
16747
16748
16749 \begin_inset Quotes erd
16750 \end_inset
16751
16752  becomes 
16753 \begin_inset Quotes eld
16754 \end_inset
16755
16756
16757 \begin_inset Flex CharStyle:Code
16758 status collapsed
16759
16760 \begin_layout Plain Layout
16761 font-family: sans-serif;
16762 \end_layout
16763
16764 \end_inset
16765
16766
16767 \begin_inset Quotes erd
16768 \end_inset
16769
16770 .
16771  The correspondence of LyX sizes and CSS sizes is a little less obvious
16772  but nonetheless intuitive.
16773  See the 
16774 \begin_inset Flex CharStyle:Code
16775 status collapsed
16776
16777 \begin_layout Plain Layout
16778 getSizeCSS()
16779 \end_layout
16780
16781 \end_inset
16782
16783  function in 
16784 \begin_inset Flex URL
16785 status collapsed
16786
16787 \begin_layout Plain Layout
16788
16789 src/FontInfo.cpp
16790 \end_layout
16791
16792 \end_inset
16793
16794  for the details.
16795  
16796 \end_layout
16797
16798 \begin_layout Chapter
16799 Including External Material
16800 \end_layout
16801
16802 \begin_layout Standard
16803 \begin_inset Box Shadowbox
16804 position "t"
16805 hor_pos "c"
16806 has_inner_box 1
16807 inner_pos "t"
16808 use_parbox 0
16809 width "100col%"
16810 special "none"
16811 height "1in"
16812 height_special "totalheight"
16813 status open
16814
16815 \begin_layout Plain Layout
16816 WARNING: This portion of the documentation has not been updated for some
16817  time.
16818  We certainly hope that it is still accurate, but there are no guarantees.
16819 \end_layout
16820
16821 \end_inset
16822
16823
16824 \end_layout
16825
16826 \begin_layout Standard
16827 The use of material from sources external to LyX is covered in detail in
16828  the 
16829 \emph on
16830 Embedded Objects
16831 \emph default
16832  manual.
16833  This part of the manual covers what needs to happen behind the scenes for
16834  new sorts of material to be included.
16835 \end_layout
16836
16837 \begin_layout Section
16838 How does it work?
16839 \end_layout
16840
16841 \begin_layout Standard
16842 The external material feature is based on the concept of a 
16843 \emph on
16844 template
16845 \emph default
16846 .
16847  A template is a specification of how LyX should interface with a certain
16848  kind of material.
16849  As bundled, LyX comes with predefined templates for Xfig figures, various
16850  raster format images, chess diagrams, and LilyPond music notation.
16851  You can check the actual list by using the menu 
16852 \begin_inset Flex CharStyle:MenuItem
16853 status collapsed
16854
16855 \begin_layout Plain Layout
16856 Insert\SpecialChar \menuseparator
16857 File\SpecialChar \menuseparator
16858 External Material
16859 \end_layout
16860
16861 \end_inset
16862
16863 .
16864  Furthermore, it is possible to roll your own template to support a specific
16865  kind of material.
16866  Later we'll describe in more detail what is involved, and hopefully you
16867  will submit all the templates you create so we can include them in a later
16868  LyX version.
16869 \end_layout
16870
16871 \begin_layout Standard
16872 Another basic idea of the external material feature is to distinguish between
16873  the original file that serves as a base for final material and the produced
16874  file that is included in your exported or printed document.
16875  For example, consider the case of a figure produced with 
16876 \begin_inset Flex CharStyle:Code
16877 status collapsed
16878
16879 \begin_layout Plain Layout
16880 Xfig
16881 \end_layout
16882
16883 \end_inset
16884
16885 .
16886  The Xfig application itself works on an original file with the 
16887 \begin_inset Flex CharStyle:Code
16888 status collapsed
16889
16890 \begin_layout Plain Layout
16891 .fig
16892 \end_layout
16893
16894 \end_inset
16895
16896  extension.
16897  Within Xfig, you create and change your figure, and when you are done,
16898  you save the 
16899 \begin_inset Flex CharStyle:Code
16900 status collapsed
16901
16902 \begin_layout Plain Layout
16903 fig
16904 \end_layout
16905
16906 \end_inset
16907
16908 -file.
16909  When you want to include the figure in your document, you invoke 
16910 \begin_inset Flex CharStyle:Code
16911 status collapsed
16912
16913 \begin_layout Plain Layout
16914 transfig
16915 \end_layout
16916
16917 \end_inset
16918
16919  in order to create a PostScript file that can readily be included in your
16920  LaTeX file.
16921  In this case, the 
16922 \begin_inset Flex CharStyle:Code
16923 status collapsed
16924
16925 \begin_layout Plain Layout
16926 .fig
16927 \end_layout
16928
16929 \end_inset
16930
16931  file is the original file, and the PostScript file is the produced file.
16932 \end_layout
16933
16934 \begin_layout Standard
16935 This distinction is important in order to allow updating of the material
16936  while you are in the process of writing the document.
16937  Furthermore, it provides us with the flexibility that is needed to support
16938  multiple export formats.
16939  For instance, in the case of a plain text file, it is not exactly an award-winn
16940 ing idea to include the figure as raw PostScript.
16941  Instead, you'd either prefer to just include a reference to the figure
16942  or try to invoke some graphics to ASCII converter to make the final result
16943  look similar to the real graphics.
16944  The external material management allows you to do this, because it is parametri
16945 zed on the different export formats that LyX supports.
16946 \end_layout
16947
16948 \begin_layout Standard
16949 Besides supporting the production of different products according to the
16950  exported format, it supports tight integration with editing and viewing
16951  applications.
16952  In the case of an Xfig figure, you are able to invoke Xfig on the original
16953  file with a single click from within the external material dialog in LyX,
16954  and also preview the produced PostScript file with Ghostview with another
16955  click.
16956  No more fiddling around with the command line and/or file browsers to locate
16957  and manipulate the original or produced files.
16958  In this way, you are finally able to take full advantage of the many different
16959  applications that are relevant to use when you write your documents, and
16960  ultimately be more productive.
16961 \end_layout
16962
16963 \begin_layout Section
16964 The external template configuration file
16965 \end_layout
16966
16967 \begin_layout Standard
16968 It is relatively easy to add custom external template definitions to LyX.
16969  However, be aware that doing this in an careless manner most probably 
16970 \emph on
16971 will
16972 \emph default
16973  introduce an easily exploitable security hole.
16974  So before you do this, please read the discussion about security in section
16975  
16976 \begin_inset CommandInset ref
16977 LatexCommand ref
16978 reference "sec:Security-discussion"
16979
16980 \end_inset
16981
16982 .
16983 \end_layout
16984
16985 \begin_layout Standard
16986 Having said that, we encourage you to submit any interesting templates that
16987  you create.
16988  
16989 \end_layout
16990
16991 \begin_layout Standard
16992 The external templates are defined in the 
16993 \begin_inset Flex CharStyle:Code
16994 status collapsed
16995
16996 \begin_layout Plain Layout
16997 LyXDir/lib/external_templates
16998 \end_layout
16999
17000 \end_inset
17001
17002  file.
17003  You can place your own version in 
17004 \begin_inset Flex CharStyle:Code
17005 status collapsed
17006
17007 \begin_layout Plain Layout
17008 UserDir/external_templates
17009 \end_layout
17010
17011 \end_inset
17012
17013 .
17014 \end_layout
17015
17016 \begin_layout Standard
17017 A typical template looks like this:
17018 \end_layout
17019
17020 \begin_layout LyX-Code
17021 Template XFig
17022 \end_layout
17023
17024 \begin_layout LyX-Code
17025 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
17026 \end_layout
17027
17028 \begin_layout LyX-Code
17029 HelpText
17030 \end_layout
17031
17032 \begin_layout LyX-Code
17033 An XFig figure.
17034 \end_layout
17035
17036 \begin_layout LyX-Code
17037 HelpTextEnd
17038 \end_layout
17039
17040 \begin_layout LyX-Code
17041 InputFormat fig
17042 \end_layout
17043
17044 \begin_layout LyX-Code
17045 FileFilter "*.fig"
17046 \end_layout
17047
17048 \begin_layout LyX-Code
17049 AutomaticProduction true
17050 \end_layout
17051
17052 \begin_layout LyX-Code
17053 Transform Rotate
17054 \end_layout
17055
17056 \begin_layout LyX-Code
17057 Transform Resize
17058 \end_layout
17059
17060 \begin_layout LyX-Code
17061 Format LaTeX
17062 \end_layout
17063
17064 \begin_layout LyX-Code
17065 TransformCommand Rotate RotationLatexCommand
17066 \end_layout
17067
17068 \begin_layout LyX-Code
17069 TransformCommand Resize ResizeLatexCommand
17070 \end_layout
17071
17072 \begin_layout LyX-Code
17073 Product "$$RotateFront$$ResizeFront
17074 \end_layout
17075
17076 \begin_layout LyX-Code
17077          
17078 \backslash
17079
17080 \backslash
17081 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
17082 \end_layout
17083
17084 \begin_layout LyX-Code
17085          $$ResizeBack$$RotateBack"
17086 \end_layout
17087
17088 \begin_layout LyX-Code
17089 UpdateFormat pstex
17090 \end_layout
17091
17092 \begin_layout LyX-Code
17093 UpdateResult "$$AbsPath$$Basename.pstex_t"
17094 \end_layout
17095
17096 \begin_layout LyX-Code
17097 Requirement "graphicx"
17098 \end_layout
17099
17100 \begin_layout LyX-Code
17101 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
17102 \end_layout
17103
17104 \begin_layout LyX-Code
17105 ReferencedFile latex "$$AbsPath$$Basename.eps"
17106 \end_layout
17107
17108 \begin_layout LyX-Code
17109 ReferencedFile dvi "$$AbsPath$$Basename.eps"
17110 \end_layout
17111
17112 \begin_layout LyX-Code
17113 FormatEnd
17114 \end_layout
17115
17116 \begin_layout LyX-Code
17117 Format PDFLaTeX
17118 \end_layout
17119
17120 \begin_layout LyX-Code
17121 TransformCommand Rotate RotationLatexCommand
17122 \end_layout
17123
17124 \begin_layout LyX-Code
17125 TransformCommand Resize ResizeLatexCommand
17126 \end_layout
17127
17128 \begin_layout LyX-Code
17129 Product "$$RotateFront$$ResizeFront
17130 \end_layout
17131
17132 \begin_layout LyX-Code
17133          
17134 \backslash
17135
17136 \backslash
17137 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
17138 \end_layout
17139
17140 \begin_layout LyX-Code
17141          $$ResizeBack$$RotateBack"
17142 \end_layout
17143
17144 \begin_layout LyX-Code
17145 UpdateFormat pdftex
17146 \end_layout
17147
17148 \begin_layout LyX-Code
17149 UpdateResult "$$AbsPath$$Basename.pdftex_t"
17150 \end_layout
17151
17152 \begin_layout LyX-Code
17153 Requirement "graphicx"
17154 \end_layout
17155
17156 \begin_layout LyX-Code
17157 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
17158 \end_layout
17159
17160 \begin_layout LyX-Code
17161 ReferencedFile latex "$$AbsPath$$Basename.pdf"
17162 \end_layout
17163
17164 \begin_layout LyX-Code
17165 FormatEnd
17166 \end_layout
17167
17168 \begin_layout LyX-Code
17169 Format Ascii
17170 \end_layout
17171
17172 \begin_layout LyX-Code
17173 Product "$$Contents(
17174 \backslash
17175 "$$AbsPath$$Basename.asc
17176 \backslash
17177 ")"
17178 \end_layout
17179
17180 \begin_layout LyX-Code
17181 UpdateFormat asciixfig
17182 \end_layout
17183
17184 \begin_layout LyX-Code
17185 UpdateResult "$$AbsPath$$Basename.asc"
17186 \end_layout
17187
17188 \begin_layout LyX-Code
17189 FormatEnd
17190 \end_layout
17191
17192 \begin_layout LyX-Code
17193 Format DocBook
17194 \end_layout
17195
17196 \begin_layout LyX-Code
17197 Product "<graphic fileref=
17198 \backslash
17199 "$$AbsOrRelPathMaster$$Basename.eps
17200 \backslash
17201 ">
17202 \end_layout
17203
17204 \begin_layout LyX-Code
17205          </graphic>"
17206 \end_layout
17207
17208 \begin_layout LyX-Code
17209 UpdateFormat eps
17210 \end_layout
17211
17212 \begin_layout LyX-Code
17213 UpdateResult "$$AbsPath$$Basename.eps"
17214 \end_layout
17215
17216 \begin_layout LyX-Code
17217 ReferencedFile docbook "$$AbsPath$$Basename.eps"
17218 \end_layout
17219
17220 \begin_layout LyX-Code
17221 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
17222 \end_layout
17223
17224 \begin_layout LyX-Code
17225 FormatEnd
17226 \end_layout
17227
17228 \begin_layout LyX-Code
17229 Product "[XFig: $$FName]"
17230 \end_layout
17231
17232 \begin_layout LyX-Code
17233 FormatEnd
17234 \end_layout
17235
17236 \begin_layout LyX-Code
17237 TemplateEnd
17238 \end_layout
17239
17240 \begin_layout Standard
17241 As you can see, the template is enclosed in 
17242 \begin_inset Flex CharStyle:Code
17243 status collapsed
17244
17245 \begin_layout Plain Layout
17246 Template
17247 \end_layout
17248
17249 \end_inset
17250
17251  \SpecialChar \ldots{}
17252  
17253 \begin_inset Flex CharStyle:Code
17254 status collapsed
17255
17256 \begin_layout Plain Layout
17257 TemplateEnd
17258 \end_layout
17259
17260 \end_inset
17261
17262 .
17263  It contains a header specifying some general settings and, for each supported
17264  primary document file format, a section 
17265 \begin_inset Flex CharStyle:Code
17266 status collapsed
17267
17268 \begin_layout Plain Layout
17269 Format
17270 \end_layout
17271
17272 \end_inset
17273
17274  \SpecialChar \ldots{}
17275  
17276 \begin_inset Flex CharStyle:Code
17277 status collapsed
17278
17279 \begin_layout Plain Layout
17280 FormatEnd
17281 \end_layout
17282
17283 \end_inset
17284
17285 .
17286 \end_layout
17287
17288 \begin_layout Subsection
17289 The template header
17290 \end_layout
17291
17292 \begin_layout Description
17293 \begin_inset Flex CharStyle:Code
17294 status collapsed
17295
17296 \begin_layout Plain Layout
17297 AutomaticProduction
17298 \begin_inset space ~
17299 \end_inset
17300
17301 true|false
17302 \end_layout
17303
17304 \end_inset
17305
17306  Whether the file represented by the template must be generated by LyX.
17307  This command must occur exactly once.
17308 \end_layout
17309
17310 \begin_layout Description
17311 \begin_inset Flex CharStyle:Code
17312 status collapsed
17313
17314 \begin_layout Plain Layout
17315 FileFilter
17316 \begin_inset space ~
17317 \end_inset
17318
17319 <pattern>
17320 \end_layout
17321
17322 \end_inset
17323
17324  A glob pattern that is used in the file dialog to filter out the desired
17325  files.
17326  If there is more than one possible file extension (e.
17327 \begin_inset space \thinspace{}
17328 \end_inset
17329
17330 g.
17331 \begin_inset space \space{}
17332 \end_inset
17333
17334 tgif has 
17335 \begin_inset Flex CharStyle:Code
17336 status collapsed
17337
17338 \begin_layout Plain Layout
17339 .obj
17340 \end_layout
17341
17342 \end_inset
17343
17344  and 
17345 \begin_inset Flex CharStyle:Code
17346 status collapsed
17347
17348 \begin_layout Plain Layout
17349 .tgo
17350 \end_layout
17351
17352 \end_inset
17353
17354 ), use something like 
17355 \begin_inset Flex CharStyle:Code
17356 status collapsed
17357
17358 \begin_layout Plain Layout
17359 "*.{obj,tgo}"
17360 \end_layout
17361
17362 \end_inset
17363
17364 .
17365  This command must occur exactly once.
17366 \end_layout
17367
17368 \begin_layout Description
17369 \begin_inset Flex CharStyle:Code
17370 status collapsed
17371
17372 \begin_layout Plain Layout
17373 GuiName
17374 \begin_inset space ~
17375 \end_inset
17376
17377 <guiname>
17378 \end_layout
17379
17380 \end_inset
17381
17382  The text that is displayed on the button.
17383  This command must occur exactly once.
17384 \end_layout
17385
17386 \begin_layout Description
17387 \begin_inset Flex CharStyle:Code
17388 status collapsed
17389
17390 \begin_layout Plain Layout
17391 HelpText
17392 \begin_inset space ~
17393 \end_inset
17394
17395 <text>
17396 \begin_inset space ~
17397 \end_inset
17398
17399 HelpTextEnd
17400 \end_layout
17401
17402 \end_inset
17403
17404  The help text that is used in the External dialog.
17405  Provide enough information to explain to the user just what the template
17406  can provide him with.
17407  This command must occur exactly once.
17408 \end_layout
17409
17410 \begin_layout Description
17411 \begin_inset Flex CharStyle:Code
17412 status collapsed
17413
17414 \begin_layout Plain Layout
17415 InputFormat
17416 \begin_inset space ~
17417 \end_inset
17418
17419 <format>
17420 \end_layout
17421
17422 \end_inset
17423
17424  The file format of the original file.
17425  This must be the name of a format that is known to LyX (see section 
17426 \begin_inset CommandInset ref
17427 LatexCommand ref
17428 reference "sec:Formats"
17429
17430 \end_inset
17431
17432 ).
17433  Use 
17434 \begin_inset Quotes eld
17435 \end_inset
17436
17437
17438 \begin_inset Flex CharStyle:Code
17439 status collapsed
17440
17441 \begin_layout Plain Layout
17442 *
17443 \end_layout
17444
17445 \end_inset
17446
17447
17448 \begin_inset Quotes erd
17449 \end_inset
17450
17451  if the template can handle original files of more than one format.
17452  LyX will attempt to interrogate the file itself in order to deduce its
17453  format in this case.
17454  This command must occur exactly once.
17455 \end_layout
17456
17457 \begin_layout Description
17458 \begin_inset Flex CharStyle:Code
17459 status collapsed
17460
17461 \begin_layout Plain Layout
17462 Template
17463 \begin_inset space ~
17464 \end_inset
17465
17466 <id>
17467 \end_layout
17468
17469 \end_inset
17470
17471  A unique name for the template.
17472  It must not contain substitution macros (see below).
17473 \end_layout
17474
17475 \begin_layout Description
17476 \begin_inset Flex CharStyle:Code
17477 status collapsed
17478
17479 \begin_layout Plain Layout
17480 Transform
17481 \begin_inset space ~
17482 \end_inset
17483
17484 Rotate|Resize|Clip|Extra
17485 \end_layout
17486
17487 \end_inset
17488
17489  This command specifies which transformations are supported by this template.
17490  It may occur zero or more times.
17491  This command enables the corresponding tabs in the external dialog.
17492  Each 
17493 \begin_inset Flex CharStyle:Code
17494 status collapsed
17495
17496 \begin_layout Plain Layout
17497 Transform
17498 \end_layout
17499
17500 \end_inset
17501
17502  command must have either a corresponding 
17503 \begin_inset Flex CharStyle:Code
17504 status collapsed
17505
17506 \begin_layout Plain Layout
17507 TransformCommand
17508 \end_layout
17509
17510 \end_inset
17511
17512  or a 
17513 \begin_inset Flex CharStyle:Code
17514 status collapsed
17515
17516 \begin_layout Plain Layout
17517 TransformOption
17518 \end_layout
17519
17520 \end_inset
17521
17522  command in the 
17523 \begin_inset Flex CharStyle:Code
17524 status collapsed
17525
17526 \begin_layout Plain Layout
17527 Format
17528 \end_layout
17529
17530 \end_inset
17531
17532  section.
17533  Otherwise the transformation will not be supported by that format.
17534 \end_layout
17535
17536 \begin_layout Subsection
17537 The Format section
17538 \end_layout
17539
17540 \begin_layout Description
17541 \begin_inset Flex CharStyle:Code
17542 status collapsed
17543
17544 \begin_layout Plain Layout
17545 Format
17546 \begin_inset space ~
17547 \end_inset
17548
17549 LaTeX|PDFLaTeX|PlainText|DocBook
17550 \end_layout
17551
17552 \end_inset
17553
17554  The primary document file format that this format definition is for.
17555  Not every template has a sensible representation in all document file formats.
17556  Please define nevertheless a 
17557 \begin_inset Flex CharStyle:Code
17558 status collapsed
17559
17560 \begin_layout Plain Layout
17561 Format
17562 \end_layout
17563
17564 \end_inset
17565
17566  section for all formats.
17567  Use a dummy text when no representation is available.
17568  Then you can at least see a reference to the external material in the exported
17569  document.
17570 \end_layout
17571
17572 \begin_layout Description
17573 \begin_inset Flex CharStyle:Code
17574 status collapsed
17575
17576 \begin_layout Plain Layout
17577 Option
17578 \begin_inset space ~
17579 \end_inset
17580
17581 <name>
17582 \begin_inset space ~
17583 \end_inset
17584
17585 <value>
17586 \end_layout
17587
17588 \end_inset
17589
17590  This command defines an additional macro 
17591 \begin_inset Flex CharStyle:Code
17592 status collapsed
17593
17594 \begin_layout Plain Layout
17595 $$<name>
17596 \end_layout
17597
17598 \end_inset
17599
17600  for substitution in 
17601 \begin_inset Flex CharStyle:Code
17602 status collapsed
17603
17604 \begin_layout Plain Layout
17605 Product
17606 \end_layout
17607
17608 \end_inset
17609
17610 .
17611  
17612 \begin_inset Flex CharStyle:Code
17613 status collapsed
17614
17615 \begin_layout Plain Layout
17616 <value>
17617 \end_layout
17618
17619 \end_inset
17620
17621  itself may contain substitution macros.
17622  The advantage over using 
17623 \begin_inset Flex CharStyle:Code
17624 status collapsed
17625
17626 \begin_layout Plain Layout
17627 <value>
17628 \end_layout
17629
17630 \end_inset
17631
17632  directly in 
17633 \begin_inset Flex CharStyle:Code
17634 status collapsed
17635
17636 \begin_layout Plain Layout
17637 Product
17638 \end_layout
17639
17640 \end_inset
17641
17642  is that the substituted value of 
17643 \begin_inset Flex CharStyle:Code
17644 status collapsed
17645
17646 \begin_layout Plain Layout
17647 $$<name>
17648 \end_layout
17649
17650 \end_inset
17651
17652  is sanitized so that it is a valid optional argument in the document format.
17653  This command may occur zero or more times.
17654 \end_layout
17655
17656 \begin_layout Description
17657 \begin_inset Flex CharStyle:Code
17658 status collapsed
17659
17660 \begin_layout Plain Layout
17661 Product
17662 \begin_inset space ~
17663 \end_inset
17664
17665 <text>
17666 \end_layout
17667
17668 \end_inset
17669
17670  The text that is inserted in the exported document.
17671  This is actually the most important command and can be quite complex.
17672  This command must occur exactly once.
17673 \end_layout
17674
17675 \begin_layout Description
17676 \begin_inset Flex CharStyle:Code
17677 status collapsed
17678
17679 \begin_layout Plain Layout
17680 Preamble
17681 \begin_inset space ~
17682 \end_inset
17683
17684 <name>
17685 \end_layout
17686
17687 \end_inset
17688
17689  This command specifies a preamble snippet that will be included in the
17690  LaTeX preamble.
17691  It has to be defined using 
17692 \begin_inset Flex CharStyle:Code
17693 status collapsed
17694
17695 \begin_layout Plain Layout
17696 PreambleDef
17697 \end_layout
17698
17699 \end_inset
17700
17701  \SpecialChar \ldots{}
17702  
17703 \begin_inset Flex CharStyle:Code
17704 status collapsed
17705
17706 \begin_layout Plain Layout
17707 PreambleDefEnd
17708 \end_layout
17709
17710 \end_inset
17711
17712 .
17713  This command may occur zero or more times.
17714 \end_layout
17715
17716 \begin_layout Description
17717 \begin_inset Flex CharStyle:Code
17718 status collapsed
17719
17720 \begin_layout Plain Layout
17721 ReferencedFile
17722 \begin_inset space ~
17723 \end_inset
17724
17725 <format>
17726 \begin_inset space ~
17727 \end_inset
17728
17729 <filename>
17730 \end_layout
17731
17732 \end_inset
17733
17734  This command denotes files that are created by the conversion process and
17735  are needed for a particular export format.
17736  If the filename is relative, it is interpreted relative to the master document.
17737  This command may be given zero or more times.
17738 \end_layout
17739
17740 \begin_layout Description
17741 \begin_inset Flex CharStyle:Code
17742 status collapsed
17743
17744 \begin_layout Plain Layout
17745 Requirement
17746 \begin_inset space ~
17747 \end_inset
17748
17749 <package>
17750 \end_layout
17751
17752 \end_inset
17753
17754  The name of a required LaTeX package.
17755  The package is included via 
17756 \begin_inset Flex CharStyle:Code
17757 status collapsed
17758
17759 \begin_layout Plain Layout
17760
17761 \backslash
17762 usepackage{}
17763 \end_layout
17764
17765 \end_inset
17766
17767  in the LaTeX preamble.
17768  This command may occur zero or more times.
17769 \end_layout
17770
17771 \begin_layout Description
17772 \begin_inset Flex CharStyle:Code
17773 status collapsed
17774
17775 \begin_layout Plain Layout
17776 TransformCommand
17777 \begin_inset space ~
17778 \end_inset
17779
17780 Rotate
17781 \begin_inset space ~
17782 \end_inset
17783
17784 RotationLatexCommand
17785 \end_layout
17786
17787 \end_inset
17788
17789  This command specifies that the built in LaTeX command should be used for
17790  rotation.
17791  This command may occur once or not at all.
17792 \end_layout
17793
17794 \begin_layout Description
17795 \begin_inset Flex CharStyle:Code
17796 status collapsed
17797
17798 \begin_layout Plain Layout
17799 TransformCommand
17800 \begin_inset space ~
17801 \end_inset
17802
17803 Resize
17804 \begin_inset space ~
17805 \end_inset
17806
17807 ResizeLatexCommand
17808 \end_layout
17809
17810 \end_inset
17811
17812  This command specifies that the built in LaTeX command should be used for
17813  resizing.
17814  This command may occur once or not at all.
17815 \end_layout
17816
17817 \begin_layout Description
17818 \begin_inset Flex CharStyle:Code
17819 status collapsed
17820
17821 \begin_layout Plain Layout
17822 TransformOption
17823 \begin_inset space ~
17824 \end_inset
17825
17826 Rotate
17827 \begin_inset space ~
17828 \end_inset
17829
17830 RotationLatexOption
17831 \end_layout
17832
17833 \end_inset
17834
17835  This command specifies that rotation is done via an optional argument.
17836  This command may occur once or not at all.
17837 \end_layout
17838
17839 \begin_layout Description
17840 \begin_inset Flex CharStyle:Code
17841 status collapsed
17842
17843 \begin_layout Plain Layout
17844 TransformOption
17845 \begin_inset space ~
17846 \end_inset
17847
17848 Resize
17849 \begin_inset space ~
17850 \end_inset
17851
17852 ResizeLatexOption
17853 \end_layout
17854
17855 \end_inset
17856
17857  This command specifies that resizing is done via an optional argument.
17858  This command may occur once or not at all.
17859 \end_layout
17860
17861 \begin_layout Description
17862 \begin_inset Flex CharStyle:Code
17863 status collapsed
17864
17865 \begin_layout Plain Layout
17866 TransformOption
17867 \begin_inset space ~
17868 \end_inset
17869
17870 Clip
17871 \begin_inset space ~
17872 \end_inset
17873
17874 ClipLatexOption
17875 \end_layout
17876
17877 \end_inset
17878
17879  This command specifies that clipping is done via an optional argument.
17880  This command may occur once or not at all.
17881 \end_layout
17882
17883 \begin_layout Description
17884 \begin_inset Flex CharStyle:Code
17885 status collapsed
17886
17887 \begin_layout Plain Layout
17888 TransformOption
17889 \begin_inset space ~
17890 \end_inset
17891
17892 Extra
17893 \begin_inset space ~
17894 \end_inset
17895
17896 ExtraLatexOption
17897 \end_layout
17898
17899 \end_inset
17900
17901  This command specifies that an extra optional argument is used.
17902  This command may occur once or not at all.
17903 \end_layout
17904
17905 \begin_layout Description
17906 \begin_inset Flex CharStyle:Code
17907 status collapsed
17908
17909 \begin_layout Plain Layout
17910 UpdateFormat
17911 \begin_inset space ~
17912 \end_inset
17913
17914 <format>
17915 \end_layout
17916
17917 \end_inset
17918
17919  The file format of the converted file.
17920  This must be the name of a format that is known to LyX (see the 
17921 \begin_inset Flex CharStyle:MenuItem
17922 status collapsed
17923
17924 \begin_layout Plain Layout
17925
17926 \bar under
17927 T
17928 \bar default
17929 ools\SpecialChar \menuseparator
17930
17931 \bar under
17932 P
17933 \bar default
17934 references:Conversion
17935 \end_layout
17936
17937 \end_inset
17938
17939  dialog).
17940  This command must occur exactly once.
17941 \end_layout
17942
17943 \begin_layout Description
17944 \begin_inset Flex CharStyle:Code
17945 status collapsed
17946
17947 \begin_layout Plain Layout
17948 UpdateResult
17949 \begin_inset space ~
17950 \end_inset
17951
17952 <filename>
17953 \end_layout
17954
17955 \end_inset
17956
17957  The file name of the converted file.
17958  The file name must be absolute.
17959  This command must occur exactly once.
17960 \end_layout
17961
17962 \begin_layout Subsection
17963 Preamble definitions
17964 \end_layout
17965
17966 \begin_layout Standard
17967 The external template configuration file may contain additional preamble
17968  definitions enclosed by 
17969 \begin_inset Flex CharStyle:Code
17970 status collapsed
17971
17972 \begin_layout Plain Layout
17973 PreambleDef
17974 \end_layout
17975
17976 \end_inset
17977
17978  \SpecialChar \ldots{}
17979  
17980 \begin_inset Flex CharStyle:Code
17981 status collapsed
17982
17983 \begin_layout Plain Layout
17984 PreambleDefEnd
17985 \end_layout
17986
17987 \end_inset
17988
17989 .
17990  They can be used by the templates in the 
17991 \begin_inset Flex CharStyle:Code
17992 status collapsed
17993
17994 \begin_layout Plain Layout
17995 Format
17996 \end_layout
17997
17998 \end_inset
17999
18000  section.
18001 \end_layout
18002
18003 \begin_layout Section
18004 The substitution mechanism
18005 \end_layout
18006
18007 \begin_layout Standard
18008 When the external material facility invokes an external program, it is done
18009  on the basis of a command defined in the template configuration file.
18010  These commands can contain various macros that are expanded before execution.
18011  Execution always take place in the directory of the containing document.
18012 \end_layout
18013
18014 \begin_layout Standard
18015 Also, whenever external material is to be displayed, the name will be produced
18016  by the substitution mechanism, and most other commands in the template
18017  definition support substitution as well.
18018 \end_layout
18019
18020 \begin_layout Standard
18021 The available macros are the following:
18022 \end_layout
18023
18024 \begin_layout Description
18025 \begin_inset Flex CharStyle:Code
18026 status collapsed
18027
18028 \begin_layout Plain Layout
18029 $$AbsOrRelPathMaster
18030 \end_layout
18031
18032 \end_inset
18033
18034  The file path, absolute or relative to the master LyX document.
18035 \end_layout
18036
18037 \begin_layout Description
18038 \begin_inset Flex CharStyle:Code
18039 status collapsed
18040
18041 \begin_layout Plain Layout
18042 $$AbsOrRelPathParent
18043 \end_layout
18044
18045 \end_inset
18046
18047  The file path, absolute or relative to the LyX document.
18048 \end_layout
18049
18050 \begin_layout Description
18051 \begin_inset Flex CharStyle:Code
18052 status collapsed
18053
18054 \begin_layout Plain Layout
18055 $$AbsPath
18056 \end_layout
18057
18058 \end_inset
18059
18060  The absolute file path.
18061 \end_layout
18062
18063 \begin_layout Description
18064 \begin_inset Flex CharStyle:Code
18065 status collapsed
18066
18067 \begin_layout Plain Layout
18068 $$Basename
18069 \end_layout
18070
18071 \end_inset
18072
18073  The filename without path and without the extension.
18074 \end_layout
18075
18076 \begin_layout Description
18077 \begin_inset Flex CharStyle:Code
18078 status collapsed
18079
18080 \begin_layout Plain Layout
18081 $$Contents(
18082 \begin_inset Quotes eld
18083 \end_inset
18084
18085 filename.ext
18086 \begin_inset Quotes erd
18087 \end_inset
18088
18089 )
18090 \end_layout
18091
18092 \end_inset
18093
18094  This macro will expand to the contents of the file with the name 
18095 \begin_inset Flex CharStyle:Code
18096 status collapsed
18097
18098 \begin_layout Plain Layout
18099 filename.ext
18100 \end_layout
18101
18102 \end_inset
18103
18104 .
18105 \end_layout
18106
18107 \begin_layout Description
18108 \begin_inset Flex CharStyle:Code
18109 status collapsed
18110
18111 \begin_layout Plain Layout
18112 $$Extension
18113 \end_layout
18114
18115 \end_inset
18116
18117  The file extension (including the dot).
18118 \end_layout
18119
18120 \begin_layout Description
18121 \begin_inset Flex CharStyle:Code
18122 status collapsed
18123
18124 \begin_layout Plain Layout
18125 $$FName
18126 \end_layout
18127
18128 \end_inset
18129
18130  The filename of the file specified in the external material dialog.
18131  This is either an absolute name, or it is relative to the LyX document.
18132 \end_layout
18133
18134 \begin_layout Description
18135 \begin_inset Flex CharStyle:Code
18136 status collapsed
18137
18138 \begin_layout Plain Layout
18139 $$FPath
18140 \end_layout
18141
18142 \end_inset
18143
18144  The path part of 
18145 \begin_inset Flex CharStyle:Code
18146 status collapsed
18147
18148 \begin_layout Plain Layout
18149 $$FName
18150 \end_layout
18151
18152 \end_inset
18153
18154  (absolute name or relative to the LyX document).
18155 \end_layout
18156
18157 \begin_layout Description
18158 \begin_inset Flex CharStyle:Code
18159 status collapsed
18160
18161 \begin_layout Plain Layout
18162 $$RelPathMaster
18163 \end_layout
18164
18165 \end_inset
18166
18167  The file path, relative to the master LyX document.
18168 \end_layout
18169
18170 \begin_layout Description
18171 \begin_inset Flex CharStyle:Code
18172 status collapsed
18173
18174 \begin_layout Plain Layout
18175 $$RelPathParent
18176 \end_layout
18177
18178 \end_inset
18179
18180  The file path, relative to the LyX document.
18181 \end_layout
18182
18183 \begin_layout Description
18184 \begin_inset Flex CharStyle:Code
18185 status collapsed
18186
18187 \begin_layout Plain Layout
18188 $$Sysdir
18189 \end_layout
18190
18191 \end_inset
18192
18193  This macro will expand to the absolute path of the system directory.
18194  This is typically used to point to the various helper scripts that are
18195  bundled with LyX.
18196 \end_layout
18197
18198 \begin_layout Description
18199 \begin_inset Flex CharStyle:Code
18200 status collapsed
18201
18202 \begin_layout Plain Layout
18203 $$Tempname
18204 \end_layout
18205
18206 \end_inset
18207
18208  A name and full path to a temporary file which will be automatically deleted
18209  whenever the containing document is closed, or the external material insertion
18210  deleted.
18211 \end_layout
18212
18213 \begin_layout Standard
18214 All path macros contain a trailing directory separator, so you can construct
18215  e.
18216 \begin_inset space \thinspace{}
18217 \end_inset
18218
18219 g.
18220 \begin_inset space \space{}
18221 \end_inset
18222
18223 the absolute filename with 
18224 \begin_inset Flex CharStyle:Code
18225 status collapsed
18226
18227 \begin_layout Plain Layout
18228 $$AbsPath$$Basename$$Extension
18229 \end_layout
18230
18231 \end_inset
18232
18233 .
18234 \end_layout
18235
18236 \begin_layout Standard
18237 The macros above are substituted in all commands unless otherwise noted.
18238  The command 
18239 \begin_inset Flex CharStyle:Code
18240 status collapsed
18241
18242 \begin_layout Plain Layout
18243 Product
18244 \end_layout
18245
18246 \end_inset
18247
18248  supports additionally the following substitutions if they are enabled by
18249  the 
18250 \begin_inset Flex CharStyle:Code
18251 status collapsed
18252
18253 \begin_layout Plain Layout
18254 Transform
18255 \end_layout
18256
18257 \end_inset
18258
18259  and 
18260 \begin_inset Flex CharStyle:Code
18261 status collapsed
18262
18263 \begin_layout Plain Layout
18264 TransformCommand
18265 \end_layout
18266
18267 \end_inset
18268
18269  commands:
18270 \end_layout
18271
18272 \begin_layout Description
18273 \begin_inset Flex CharStyle:Code
18274 status collapsed
18275
18276 \begin_layout Plain Layout
18277 $$ResizeFront
18278 \end_layout
18279
18280 \end_inset
18281
18282  The front part of the resize command.
18283 \end_layout
18284
18285 \begin_layout Description
18286 \begin_inset Flex CharStyle:Code
18287 status collapsed
18288
18289 \begin_layout Plain Layout
18290 $$ResizeBack
18291 \end_layout
18292
18293 \end_inset
18294
18295  The back part of the resize command.
18296 \end_layout
18297
18298 \begin_layout Description
18299 \begin_inset Flex CharStyle:Code
18300 status collapsed
18301
18302 \begin_layout Plain Layout
18303 $$RotateFront
18304 \end_layout
18305
18306 \end_inset
18307
18308  The front part of the rotation command.
18309 \end_layout
18310
18311 \begin_layout Description
18312 \begin_inset Flex CharStyle:Code
18313 status collapsed
18314
18315 \begin_layout Plain Layout
18316 $$RotateBack
18317 \end_layout
18318
18319 \end_inset
18320
18321  The back part of the rotation command.
18322 \end_layout
18323
18324 \begin_layout Standard
18325 The value string of the 
18326 \begin_inset Flex CharStyle:Code
18327 status collapsed
18328
18329 \begin_layout Plain Layout
18330 Option
18331 \end_layout
18332
18333 \end_inset
18334
18335  command supports additionally the following substitutions if they are enabled
18336  by the 
18337 \begin_inset Flex CharStyle:Code
18338 status collapsed
18339
18340 \begin_layout Plain Layout
18341 Transform
18342 \end_layout
18343
18344 \end_inset
18345
18346  and 
18347 \begin_inset Flex CharStyle:Code
18348 status collapsed
18349
18350 \begin_layout Plain Layout
18351 TransformOption
18352 \end_layout
18353
18354 \end_inset
18355
18356  commands:
18357 \end_layout
18358
18359 \begin_layout Description
18360 \begin_inset Flex CharStyle:Code
18361 status collapsed
18362
18363 \begin_layout Plain Layout
18364 $$Clip
18365 \end_layout
18366
18367 \end_inset
18368
18369  The clip option.
18370 \end_layout
18371
18372 \begin_layout Description
18373 \begin_inset Flex CharStyle:Code
18374 status collapsed
18375
18376 \begin_layout Plain Layout
18377 $$Extra
18378 \end_layout
18379
18380 \end_inset
18381
18382  The extra option.
18383 \end_layout
18384
18385 \begin_layout Description
18386 \begin_inset Flex CharStyle:Code
18387 status collapsed
18388
18389 \begin_layout Plain Layout
18390 $$Resize
18391 \end_layout
18392
18393 \end_inset
18394
18395  The resize option.
18396 \end_layout
18397
18398 \begin_layout Description
18399 \begin_inset Flex CharStyle:Code
18400 status collapsed
18401
18402 \begin_layout Plain Layout
18403 $$Rotate
18404 \end_layout
18405
18406 \end_inset
18407
18408  The rotation option.
18409 \end_layout
18410
18411 \begin_layout Standard
18412 You may ask why there are so many path macros.
18413  There are mainly two reasons:
18414 \end_layout
18415
18416 \begin_layout Enumerate
18417 Relative and absolute file names should remain relative or absolute, respectivel
18418 y.
18419  Users may have reasons to prefer either form.
18420  Relative names are useful for portable documents that should work on different
18421  machines, for example.
18422  Absolute names may be required by some programs.
18423 \end_layout
18424
18425 \begin_layout Enumerate
18426 LaTeX treats relative file names differently than LyX and other programs
18427  in nested included files.
18428  For LyX, a relative file name is always relative to the document that contains
18429  the file name.
18430  For LaTeX, it is always relative to the master document.
18431  These two definitions are identical if you have only one document, but
18432  differ if you have a master document that includes part documents.
18433  That means that relative filenames must be transformed when presented to
18434  LaTeX.
18435  Fortunately LyX does this automatically for you if you choose the right
18436  macros.
18437 \end_layout
18438
18439 \begin_layout Standard
18440 So which path macro should be used in new template definitions? The rule
18441  is not difficult:
18442 \end_layout
18443
18444 \begin_layout Itemize
18445 Use 
18446 \begin_inset Flex CharStyle:Code
18447 status collapsed
18448
18449 \begin_layout Plain Layout
18450 $$AbsPath
18451 \end_layout
18452
18453 \end_inset
18454
18455  if an absolute path is required.
18456 \end_layout
18457
18458 \begin_layout Itemize
18459 Use 
18460 \begin_inset Flex CharStyle:Code
18461 status collapsed
18462
18463 \begin_layout Plain Layout
18464 $$AbsOrRelPathMaster
18465 \end_layout
18466
18467 \end_inset
18468
18469  if the substituted string is some kind of LaTeX input.
18470 \end_layout
18471
18472 \begin_layout Itemize
18473 Else use 
18474 \begin_inset Flex CharStyle:Code
18475 status collapsed
18476
18477 \begin_layout Plain Layout
18478 $$AbsOrRelPathParent
18479 \end_layout
18480
18481 \end_inset
18482
18483  in order to preserve the user's choice.
18484 \end_layout
18485
18486 \begin_layout Standard
18487 There are special cases where this rule does not work and e.
18488 \begin_inset space \thinspace{}
18489 \end_inset
18490
18491 g.
18492 \begin_inset space \space{}
18493 \end_inset
18494
18495 relative names are needed, but normally it will work just fine.
18496  One example for such a case is the command 
18497 \begin_inset Flex CharStyle:Code
18498 status collapsed
18499
18500 \begin_layout Plain Layout
18501 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18502 \end_layout
18503
18504 \end_inset
18505
18506  in the XFig template above: We can't use the absolute name because the
18507  copier for 
18508 \begin_inset Flex CharStyle:Code
18509 status collapsed
18510
18511 \begin_layout Plain Layout
18512 .pstex_t
18513 \end_layout
18514
18515 \end_inset
18516
18517  files needs the relative name in order to rewrite the file content.
18518 \end_layout
18519
18520 \begin_layout Section
18521 Security discussion
18522 \begin_inset CommandInset label
18523 LatexCommand label
18524 name "sec:Security-discussion"
18525
18526 \end_inset
18527
18528
18529 \end_layout
18530
18531 \begin_layout Standard
18532 The external material feature interfaces with a lot of external programs
18533  and does so automatically, so we have to consider the security implications
18534  of this.
18535  In particular, since you have the option of including your own filenames
18536  and/or parameter strings and those are expanded into a command, it seems
18537  that it would be possible to create a malicious document which executes
18538  arbitrary commands when a user views or prints the document.
18539  This is something we definitely want to avoid.
18540 \end_layout
18541
18542 \begin_layout Standard
18543 However, since the external program commands are specified in the template
18544  configuration file only, there are no security issues if LyX is properly
18545  configured with safe templates only.
18546  This is so because the external programs are invoked with the 
18547 \begin_inset Flex CharStyle:Code
18548 status collapsed
18549
18550 \begin_layout Plain Layout
18551 execvp
18552 \end_layout
18553
18554 \end_inset
18555
18556 -system call rather than the 
18557 \begin_inset Flex CharStyle:Code
18558 status collapsed
18559
18560 \begin_layout Plain Layout
18561 system
18562 \end_layout
18563
18564 \end_inset
18565
18566  system-call, so it's not possible to execute arbitrary commands from the
18567  filename or parameter section via the shell.
18568 \end_layout
18569
18570 \begin_layout Standard
18571 This also implies that you are restricted in what command strings you can
18572  use in the external material templates.
18573  In particular, pipes and redirection are not readily available.
18574  This has to be so if LyX should remain safe.
18575  If you want to use some of the shell features, you should write a safe
18576  script to do this in a controlled manner, and then invoke the script from
18577  the command string.
18578  
18579 \end_layout
18580
18581 \begin_layout Standard
18582 It is possible to design a template that interacts directly with the shell,
18583  but since this would allow a malicious user to execute arbitrary commands
18584  by writing clever filenames and/or parameters, we generally recommend that
18585  you only use safe scripts that work with the 
18586 \begin_inset Flex CharStyle:Code
18587 status collapsed
18588
18589 \begin_layout Plain Layout
18590 execvp
18591 \end_layout
18592
18593 \end_inset
18594
18595  system call in a controlled manner.
18596  Of course, for use in a controlled environment, it can be tempting to just
18597  fall back to use ordinary shell scripts.
18598  If you do so, be aware that you 
18599 \emph on
18600 will
18601 \emph default
18602  provide an easily exploitable security hole in your system.
18603  Of course it stands to reason that such unsafe templates will never be
18604  included in the standard LyX distribution, although we do encourage people
18605  to submit new templates in the open source tradition.
18606  But LyX as shipped from the official distribution channels will never have
18607  unsafe templates.
18608 \end_layout
18609
18610 \begin_layout Standard
18611 Including external material provides a lot of power, and you have to be
18612  careful not to introduce security hazards with this power.
18613  A subtle error in a single line in an innocent looking script can open
18614  the door to huge security problems.
18615  So if you do not fully understand the issues, we recommend that you consult
18616  a knowledgeable security professional or the LyX development team if you
18617  have any questions about whether a given template is safe or not.
18618  And do this before you use it in an uncontrolled environment.
18619 \end_layout
18620
18621 \end_body
18622 \end_document