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