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