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