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