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