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