]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
b79f15a596fcc54a22d00862b041c90313368dac
[lyx.git] / lib / doc / Customization.lyx
1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
2 \lyxformat 393
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  Language dependent information to be included in the LaTeX preamble when
9420  this style is used.
9421  Note that this will completely override any prior 
9422 \begin_inset Flex CharStyle:Code
9423 status collapsed
9424
9425 \begin_layout Plain Layout
9426 BabelPreamble
9427 \end_layout
9428
9429 \end_inset
9430
9431  declarations.
9432  Must end with 
9433 \begin_inset Quotes eld
9434 \end_inset
9435
9436
9437 \begin_inset Flex CharStyle:Code
9438 status collapsed
9439
9440 \begin_layout Plain Layout
9441 EndBabelPreamble
9442 \end_layout
9443
9444 \end_inset
9445
9446
9447 \begin_inset Quotes erd
9448 \end_inset
9449
9450 .
9451  The contents of this tag will occur once in the LaTeX preamble for each
9452  language used by the document.
9453  Each time, the following substitutions are made:
9454 \end_layout
9455
9456 \begin_deeper
9457 \begin_layout Itemize
9458 \begin_inset Flex CharStyle:Code
9459 status collapsed
9460
9461 \begin_layout Plain Layout
9462 $$lang
9463 \end_layout
9464
9465 \end_inset
9466
9467  is replaced by the language name (as used by the babel package).
9468 \end_layout
9469
9470 \begin_layout Itemize
9471 The 
9472 \begin_inset Quotes eld
9473 \end_inset
9474
9475 Function
9476 \begin_inset Quotes erd
9477 \end_inset
9478
9479  
9480 \begin_inset Flex CharStyle:Code
9481 status collapsed
9482
9483 \begin_layout Plain Layout
9484 _()
9485 \end_layout
9486
9487 \end_inset
9488
9489  replaces its argument by the translation of the argument to the current
9490  language.
9491 \end_layout
9492
9493 \begin_layout Standard
9494 This preamble snippet will only be used if the document contains more than
9495  one language and the babel package is used.
9496 \end_layout
9497
9498 \end_deeper
9499 \begin_layout Description
9500 \begin_inset Flex CharStyle:Code
9501 status collapsed
9502
9503 \begin_layout Plain Layout
9504 BottomSep
9505 \end_layout
9506
9507 \end_inset
9508
9509  [
9510 \begin_inset Flex CharStyle:Code
9511 status collapsed
9512
9513 \begin_layout Plain Layout
9514 float=0
9515 \end_layout
9516
9517 \end_inset
9518
9519 ]
9520 \begin_inset Foot
9521 status collapsed
9522
9523 \begin_layout Plain Layout
9524 Note that a `float' here is a real number, such as: 1.5.
9525 \end_layout
9526
9527 \end_inset
9528
9529  The vertical space with which the last of a chain of paragraphs with this
9530  layout is separated from the following paragraph.
9531  If the next paragraph has another layout, the separations are not simply
9532  added, but the maximum is taken.
9533 \end_layout
9534
9535 \begin_layout Description
9536 \begin_inset Flex CharStyle:Code
9537 status collapsed
9538
9539 \begin_layout Plain Layout
9540 Category
9541 \end_layout
9542
9543 \end_inset
9544
9545  
9546 \begin_inset Flex CharStyle:Code
9547 status collapsed
9548
9549 \begin_layout Plain Layout
9550 [string]
9551 \end_layout
9552
9553 \end_inset
9554
9555  The category for this style.
9556  This is used to group related styles in the Layout combobox on the toolbar.
9557  Any string can be used, but you may want to use existing categories with
9558  your own styles.
9559  
9560 \end_layout
9561
9562 \begin_layout Description
9563 \begin_inset Flex CharStyle:Code
9564 status collapsed
9565
9566 \begin_layout Plain Layout
9567 CommandDepth
9568 \end_layout
9569
9570 \end_inset
9571
9572  Depth of XML command.
9573  Used only with XML-type formats.
9574 \end_layout
9575
9576 \begin_layout Description
9577 \begin_inset Flex CharStyle:Code
9578 status collapsed
9579
9580 \begin_layout Plain Layout
9581 CopyStyle
9582 \end_layout
9583
9584 \end_inset
9585
9586  
9587 \begin_inset CommandInset label
9588 LatexCommand label
9589 name "des:CopyStyle"
9590
9591 \end_inset
9592
9593
9594 \begin_inset Flex CharStyle:Code
9595 status collapsed
9596
9597 \begin_layout Plain Layout
9598 [string]
9599 \end_layout
9600
9601 \end_inset
9602
9603  Copies all the features of an existing style into the current one.
9604  
9605 \end_layout
9606
9607 \begin_layout Description
9608 \begin_inset Flex CharStyle:Code
9609 status collapsed
9610
9611 \begin_layout Plain Layout
9612 DependsOn
9613 \end_layout
9614
9615 \end_inset
9616
9617  The name of a style whose preamble should be output 
9618 \emph on
9619 before
9620 \emph default
9621  this one.
9622  This allows to ensure some ordering of the preamble snippets when macros
9623  definitions depend on one another.
9624 \begin_inset Foot
9625 status collapsed
9626
9627 \begin_layout Plain Layout
9628 Note that, besides that functionality, there is no way to ensure any ordering
9629  of preambles.
9630  The ordering that you see in a given version of LyX may change without
9631  warning in later versions.
9632 \end_layout
9633
9634 \end_inset
9635
9636
9637 \end_layout
9638
9639 \begin_layout Description
9640 \begin_inset Flex CharStyle:Code
9641 status collapsed
9642
9643 \begin_layout Plain Layout
9644 EndLabeltype
9645 \end_layout
9646
9647 \end_inset
9648
9649  [
9650 \begin_inset Flex CharStyle:Code
9651 status collapsed
9652
9653 \begin_layout Plain Layout
9654
9655 \emph on
9656 No_Label
9657 \emph default
9658 , Box, Filled_Box, Static
9659 \end_layout
9660
9661 \end_inset
9662
9663 ] The type of label that stands at the end of the paragraph (or sequence
9664  of paragraphs if 
9665 \begin_inset Flex CharStyle:Code
9666 status collapsed
9667
9668 \begin_layout Plain Layout
9669 LatexType
9670 \end_layout
9671
9672 \end_inset
9673
9674  is 
9675 \begin_inset Flex CharStyle:Code
9676 status collapsed
9677
9678 \begin_layout Plain Layout
9679 Environment
9680 \end_layout
9681
9682 \end_inset
9683
9684
9685 \begin_inset Flex CharStyle:Code
9686 status collapsed
9687
9688 \begin_layout Plain Layout
9689 Item_Environment
9690 \end_layout
9691
9692 \end_inset
9693
9694  or 
9695 \begin_inset Flex CharStyle:Code
9696 status collapsed
9697
9698 \begin_layout Plain Layout
9699 List_Environment
9700 \end_layout
9701
9702 \end_inset
9703
9704 ).
9705  
9706 \begin_inset Flex CharStyle:Code
9707 status collapsed
9708
9709 \begin_layout Plain Layout
9710 No_Label
9711 \end_layout
9712
9713 \end_inset
9714
9715  means 
9716 \begin_inset Quotes eld
9717 \end_inset
9718
9719 nothing
9720 \begin_inset Quotes erd
9721 \end_inset
9722
9723
9724 \begin_inset Flex CharStyle:Code
9725 status collapsed
9726
9727 \begin_layout Plain Layout
9728 Box
9729 \end_layout
9730
9731 \end_inset
9732
9733  (resp.
9734 \begin_inset Flex CharStyle:Code
9735 status collapsed
9736
9737 \begin_layout Plain Layout
9738 \begin_inset space ~
9739 \end_inset
9740
9741 Filled_Box
9742 \end_layout
9743
9744 \end_inset
9745
9746 ) is a white (resp.
9747 \begin_inset space ~
9748 \end_inset
9749
9750 black) square suitable for end of proof markers, 
9751 \begin_inset Flex CharStyle:Code
9752 status collapsed
9753
9754 \begin_layout Plain Layout
9755 Static
9756 \end_layout
9757
9758 \end_inset
9759
9760  is an explicit text string.
9761 \end_layout
9762
9763 \begin_layout Description
9764 \begin_inset Flex CharStyle:Code
9765 status collapsed
9766
9767 \begin_layout Plain Layout
9768 EndLabelString
9769 \end_layout
9770
9771 \end_inset
9772
9773  [
9774 \begin_inset Flex CharStyle:Code
9775 status collapsed
9776
9777 \begin_layout Plain Layout
9778 string=""
9779 \end_layout
9780
9781 \end_inset
9782
9783 ] The string used for a label with a 
9784 \begin_inset Flex CharStyle:Code
9785 status collapsed
9786
9787 \begin_layout Plain Layout
9788 Static
9789 \end_layout
9790
9791 \end_inset
9792
9793  
9794 \begin_inset Flex CharStyle:Code
9795 status collapsed
9796
9797 \begin_layout Plain Layout
9798 EndLabelType
9799 \end_layout
9800
9801 \end_inset
9802
9803 .
9804  
9805 \end_layout
9806
9807 \begin_layout Description
9808 \begin_inset Flex CharStyle:Code
9809 status collapsed
9810
9811 \begin_layout Plain Layout
9812 Fill_Bottom
9813 \end_layout
9814
9815 \end_inset
9816
9817  [
9818 \begin_inset Flex CharStyle:Code
9819 status collapsed
9820
9821 \begin_layout Plain Layout
9822
9823 \emph on
9824 0
9825 \emph default
9826 ,1
9827 \end_layout
9828
9829 \end_inset
9830
9831 ] Similar to 
9832 \begin_inset Flex CharStyle:Code
9833 status collapsed
9834
9835 \begin_layout Plain Layout
9836 Fill_Top
9837 \end_layout
9838
9839 \end_inset
9840
9841 .
9842 \end_layout
9843
9844 \begin_layout Description
9845 \begin_inset Flex CharStyle:Code
9846 status collapsed
9847
9848 \begin_layout Plain Layout
9849 Fill_Top
9850 \end_layout
9851
9852 \end_inset
9853
9854  [
9855 \begin_inset Flex CharStyle:Code
9856 status collapsed
9857
9858 \begin_layout Plain Layout
9859
9860 \emph on
9861 0
9862 \emph default
9863 ,1
9864 \end_layout
9865
9866 \end_inset
9867
9868 ] With this parameter the 
9869 \begin_inset Flex CharStyle:MenuItem
9870 status collapsed
9871
9872 \begin_layout Plain Layout
9873 Fill
9874 \end_layout
9875
9876 \end_inset
9877
9878  value of the 
9879 \begin_inset Quotes eld
9880 \end_inset
9881
9882 Vertical space above
9883 \begin_inset Quotes erd
9884 \end_inset
9885
9886  list of the 
9887 \begin_inset Flex CharStyle:MenuItem
9888 status collapsed
9889
9890 \begin_layout Plain Layout
9891 Edit\SpecialChar \menuseparator
9892 Paragraph
9893 \begin_inset space ~
9894 \end_inset
9895
9896 Settings
9897 \end_layout
9898
9899 \end_inset
9900
9901  dialog can be set when initializing a paragraph with this style.
9902 \begin_inset Foot
9903 status collapsed
9904
9905 \begin_layout Plain Layout
9906
9907 \emph on
9908 Note from Jean-Marc:
9909 \emph default
9910  I'm not sure that this setting has much use, and it should probably be
9911  removed in later versions.
9912 \end_layout
9913
9914 \end_inset
9915
9916  
9917 \end_layout
9918
9919 \begin_layout Description
9920 \begin_inset Flex CharStyle:Code
9921 status collapsed
9922
9923 \begin_layout Plain Layout
9924 Font
9925 \end_layout
9926
9927 \end_inset
9928
9929  The font used for both the text body 
9930 \emph on
9931 and
9932 \emph default
9933  the label.
9934  See section
9935 \begin_inset space ~
9936 \end_inset
9937
9938
9939 \begin_inset CommandInset ref
9940 LatexCommand ref
9941 reference "sub:Font-description"
9942
9943 \end_inset
9944
9945 .
9946  Note that defining this font automatically defines the 
9947 \begin_inset Flex CharStyle:Code
9948 status collapsed
9949
9950 \begin_layout Plain Layout
9951 LabelFont
9952 \end_layout
9953
9954 \end_inset
9955
9956  to the same value.
9957  So you should define this one first if you also want to define 
9958 \begin_inset Flex CharStyle:Code
9959 status collapsed
9960
9961 \begin_layout Plain Layout
9962 LabelFont
9963 \end_layout
9964
9965 \end_inset
9966
9967 .
9968 \end_layout
9969
9970 \begin_layout Description
9971 \begin_inset Flex CharStyle:Code
9972 status collapsed
9973
9974 \begin_layout Plain Layout
9975 FreeSpacing
9976 \end_layout
9977
9978 \end_inset
9979
9980  
9981 \begin_inset CommandInset label
9982 LatexCommand label
9983 name "des:FreeSpacing"
9984
9985 \end_inset
9986
9987 [
9988 \begin_inset Flex CharStyle:Code
9989 status collapsed
9990
9991 \begin_layout Plain Layout
9992
9993 \emph on
9994 0
9995 \end_layout
9996
9997 \end_inset
9998
9999
10000 \begin_inset Flex CharStyle:Code
10001 status collapsed
10002
10003 \begin_layout Plain Layout
10004 1
10005 \end_layout
10006
10007 \end_inset
10008
10009 ] Usually LyX doesn't allow you to insert more than one space between words,
10010  since a space is considered as the separation between two words, not a
10011  character or symbol of its own.
10012  This is a very fine thing but sometimes annoying, for example, when typing
10013  program code or plain LaTeX code.
10014  For this reason, 
10015 \begin_inset Flex CharStyle:Code
10016 status collapsed
10017
10018 \begin_layout Plain Layout
10019 FreeSpacing
10020 \end_layout
10021
10022 \end_inset
10023
10024  can be enabled.
10025  Note that LyX will create protected blanks for the additional blanks when
10026  in another mode than LaTeX-mode.
10027 \end_layout
10028
10029 \begin_layout Description
10030 \begin_inset Flex CharStyle:Code
10031 status collapsed
10032
10033 \begin_layout Plain Layout
10034 HTML*
10035 \end_layout
10036
10037 \end_inset
10038
10039  These tags are used with XHTML output.
10040  See 
10041 \begin_inset CommandInset ref
10042 LatexCommand prettyref
10043 reference "sub:Paragraph-Style-XHTML"
10044
10045 \end_inset
10046
10047 .
10048 \end_layout
10049
10050 \begin_layout Description
10051 \begin_inset Flex CharStyle:Code
10052 status collapsed
10053
10054 \begin_layout Plain Layout
10055 InnerTag
10056 \end_layout
10057
10058 \end_inset
10059
10060  [[FIXME]] (Used only with XML-type formats.)
10061 \end_layout
10062
10063 \begin_layout Description
10064 \begin_inset Flex CharStyle:Code
10065 status collapsed
10066
10067 \begin_layout Plain Layout
10068 InPreamble
10069 \end_layout
10070
10071 \end_inset
10072
10073  
10074 \begin_inset Flex CharStyle:Code
10075 status collapsed
10076
10077 \begin_layout Plain Layout
10078 [1, 0]
10079 \end_layout
10080
10081 \end_inset
10082
10083  If 1, marks the layout as to be included in the document preamble rather
10084  than in the document body.
10085  This is useful for document classes that want such information as the title
10086  and author to appear in the preamble.
10087  Note that this works only for layouts for which the 
10088 \begin_inset Flex CharStyle:Code
10089 status collapsed
10090
10091 \begin_layout Plain Layout
10092 LatexType
10093 \end_layout
10094
10095 \end_inset
10096
10097  is 
10098 \begin_inset Flex CharStyle:Code
10099 status collapsed
10100
10101 \begin_layout Plain Layout
10102 Command
10103 \end_layout
10104
10105 \end_inset
10106
10107 .
10108 \end_layout
10109
10110 \begin_layout Description
10111 \begin_inset Flex CharStyle:Code
10112 status collapsed
10113
10114 \begin_layout Plain Layout
10115 InTitle
10116 \end_layout
10117
10118 \end_inset
10119
10120  
10121 \begin_inset Flex CharStyle:Code
10122 status collapsed
10123
10124 \begin_layout Plain Layout
10125 [1, 0]
10126 \end_layout
10127
10128 \end_inset
10129
10130  If 1, marks the layout as being part of a title block (see also the 
10131 \begin_inset Flex CharStyle:Code
10132 status collapsed
10133
10134 \begin_layout Plain Layout
10135 TitleLatexType
10136 \end_layout
10137
10138 \end_inset
10139
10140  and 
10141 \begin_inset Flex CharStyle:Code
10142 status collapsed
10143
10144 \begin_layout Plain Layout
10145 TitleLatexName
10146 \end_layout
10147
10148 \end_inset
10149
10150  global entries).
10151 \end_layout
10152
10153 \begin_layout Description
10154 \begin_inset Flex CharStyle:Code
10155 status collapsed
10156
10157 \begin_layout Plain Layout
10158 ItemSep
10159 \end_layout
10160
10161 \end_inset
10162
10163  [
10164 \begin_inset Flex CharStyle:Code
10165 status collapsed
10166
10167 \begin_layout Plain Layout
10168 float=0
10169 \end_layout
10170
10171 \end_inset
10172
10173 ] This provides extra space between paragraphs that have the same layout.
10174  If you put other layouts into an environment, each is separated with the
10175  environment's 
10176 \begin_inset Flex CharStyle:Code
10177 status collapsed
10178
10179 \begin_layout Plain Layout
10180 Parsep
10181 \end_layout
10182
10183 \end_inset
10184
10185 .
10186  But the whole items of the environment are additionally separated with
10187  this 
10188 \begin_inset Flex CharStyle:Code
10189 status collapsed
10190
10191 \begin_layout Plain Layout
10192 Itemsep
10193 \end_layout
10194
10195 \end_inset
10196
10197 .
10198  Note that this is a
10199 \emph on
10200  multiplier.
10201 \end_layout
10202
10203 \begin_layout Description
10204 \begin_inset Flex CharStyle:Code
10205 status collapsed
10206
10207 \begin_layout Plain Layout
10208 ItemTag
10209 \end_layout
10210
10211 \end_inset
10212
10213  [[FIXME]] (Used only with XML-type formats.)
10214 \end_layout
10215
10216 \begin_layout Description
10217 \begin_inset Flex CharStyle:Code
10218 status collapsed
10219
10220 \begin_layout Plain Layout
10221 KeepEmpty
10222 \end_layout
10223
10224 \end_inset
10225
10226  
10227 \begin_inset CommandInset label
10228 LatexCommand label
10229 name "des:KeepEmpty"
10230
10231 \end_inset
10232
10233 [
10234 \begin_inset Flex CharStyle:Code
10235 status collapsed
10236
10237 \begin_layout Plain Layout
10238
10239 \emph on
10240 0
10241 \end_layout
10242
10243 \end_inset
10244
10245
10246 \begin_inset Flex CharStyle:Code
10247 status collapsed
10248
10249 \begin_layout Plain Layout
10250 1
10251 \end_layout
10252
10253 \end_inset
10254
10255 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10256  lead to empty LaTeX output.
10257  There are some cases where this could be desirable however: in a letter
10258  template, the required fields can be provided as empty fields, so that
10259  people do not forget them; in some special classes, a layout can be used
10260  as some kind of break, which does not contain actual text.
10261 \end_layout
10262
10263 \begin_layout Description
10264 \begin_inset Flex CharStyle:Code
10265 status collapsed
10266
10267 \begin_layout Plain Layout
10268 LabelBottomsep
10269 \end_layout
10270
10271 \end_inset
10272
10273  [float=0] The vertical space between the label and the text body.
10274  Only used for labels that are above the text body (
10275 \begin_inset Flex CharStyle:Code
10276 status collapsed
10277
10278 \begin_layout Plain Layout
10279 Top_Environment
10280 \end_layout
10281
10282 \end_inset
10283
10284
10285 \begin_inset Flex CharStyle:Code
10286 status collapsed
10287
10288 \begin_layout Plain Layout
10289 Centered_Top_Environment
10290 \end_layout
10291
10292 \end_inset
10293
10294 ).
10295 \end_layout
10296
10297 \begin_layout Description
10298 \begin_inset Flex CharStyle:Code
10299 status collapsed
10300
10301 \begin_layout Plain Layout
10302 LabelCounter
10303 \end_layout
10304
10305 \end_inset
10306
10307  [
10308 \begin_inset Flex CharStyle:Code
10309 status collapsed
10310
10311 \begin_layout Plain Layout
10312 string=""
10313 \end_layout
10314
10315 \end_inset
10316
10317 ]
10318 \begin_inset Newline newline
10319 \end_inset
10320
10321 The name of the counter for automatic numbering.
10322  
10323 \begin_inset Newline newline
10324 \end_inset
10325
10326 This 
10327 \emph on
10328 must
10329 \emph default
10330  be given if 
10331 \begin_inset Flex CharStyle:Code
10332 status collapsed
10333
10334 \begin_layout Plain Layout
10335 LabelType
10336 \end_layout
10337
10338 \end_inset
10339
10340  is 
10341 \begin_inset Flex CharStyle:Code
10342 status collapsed
10343
10344 \begin_layout Plain Layout
10345 Counter
10346 \end_layout
10347
10348 \end_inset
10349
10350 .
10351  In that case, the counter will be stepped each time the layout appears.
10352  
10353 \begin_inset Newline newline
10354 \end_inset
10355
10356 This 
10357 \emph on
10358 may
10359 \emph default
10360  also be given if 
10361 \begin_inset Flex CharStyle:Code
10362 status collapsed
10363
10364 \begin_layout Plain Layout
10365 LabelType
10366 \end_layout
10367
10368 \end_inset
10369
10370  is 
10371 \begin_inset Flex CharStyle:Code
10372 status collapsed
10373
10374 \begin_layout Plain Layout
10375 Enumerate
10376 \end_layout
10377
10378 \end_inset
10379
10380 , though this case is a bit complicated.
10381  Suppose you declare 
10382 \begin_inset Quotes eld
10383 \end_inset
10384
10385
10386 \begin_inset Flex CharStyle:Code
10387 status collapsed
10388
10389 \begin_layout Plain Layout
10390 LabelCounter myenum
10391 \end_layout
10392
10393 \end_inset
10394
10395
10396 \begin_inset Quotes erd
10397 \end_inset
10398
10399 .
10400  Then the actual counters used are 
10401 \begin_inset Flex CharStyle:Code
10402 status collapsed
10403
10404 \begin_layout Plain Layout
10405 myenumi
10406 \end_layout
10407
10408 \end_inset
10409
10410
10411 \begin_inset Flex CharStyle:Code
10412 status collapsed
10413
10414 \begin_layout Plain Layout
10415 myenumii
10416 \end_layout
10417
10418 \end_inset
10419
10420
10421 \begin_inset Flex CharStyle:Code
10422 status collapsed
10423
10424 \begin_layout Plain Layout
10425 myenumiii
10426 \end_layout
10427
10428 \end_inset
10429
10430 , and 
10431 \begin_inset Flex CharStyle:Code
10432 status collapsed
10433
10434 \begin_layout Plain Layout
10435 myenumiv
10436 \end_layout
10437
10438 \end_inset
10439
10440 , much as in LaTeX.
10441  These counters must all be declared separately.
10442 \begin_inset Newline newline
10443 \end_inset
10444
10445 See Section 
10446 \begin_inset CommandInset ref
10447 LatexCommand ref
10448 reference "sub:Counters"
10449
10450 \end_inset
10451
10452  for details on counters.
10453 \end_layout
10454
10455 \begin_layout Description
10456 \begin_inset Flex CharStyle:Code
10457 status collapsed
10458
10459 \begin_layout Plain Layout
10460 LabelFont
10461 \end_layout
10462
10463 \end_inset
10464
10465  The font used for the label.
10466  See section
10467 \begin_inset space ~
10468 \end_inset
10469
10470
10471 \begin_inset CommandInset ref
10472 LatexCommand ref
10473 reference "sub:Font-description"
10474
10475 \end_inset
10476
10477 .
10478 \end_layout
10479
10480 \begin_layout Description
10481 \begin_inset Flex CharStyle:Code
10482 status collapsed
10483
10484 \begin_layout Plain Layout
10485 LabelIndent
10486 \end_layout
10487
10488 \end_inset
10489
10490  Text that indicates how far a label should be indented.
10491 \end_layout
10492
10493 \begin_layout Description
10494 \begin_inset Flex CharStyle:Code
10495 status collapsed
10496
10497 \begin_layout Plain Layout
10498 Labelsep
10499 \end_layout
10500
10501 \end_inset
10502
10503  [
10504 \begin_inset Flex CharStyle:Code
10505 status collapsed
10506
10507 \begin_layout Plain Layout
10508 string=""
10509 \end_layout
10510
10511 \end_inset
10512
10513 ] The horizontal space between the label and the text body.
10514  Only used for labels that are not above the text body.
10515 \end_layout
10516
10517 \begin_layout Description
10518 \begin_inset Flex CharStyle:Code
10519 status collapsed
10520
10521 \begin_layout Plain Layout
10522 LabelString
10523 \end_layout
10524
10525 \end_inset
10526
10527  [
10528 \begin_inset Flex CharStyle:Code
10529 status collapsed
10530
10531 \begin_layout Plain Layout
10532 string=""
10533 \end_layout
10534
10535 \end_inset
10536
10537 ] The string used for a label with a 
10538 \begin_inset Flex CharStyle:Code
10539 status collapsed
10540
10541 \begin_layout Plain Layout
10542 Static
10543 \end_layout
10544
10545 \end_inset
10546
10547  labeltype.
10548  When 
10549 \begin_inset Flex CharStyle:Code
10550 status collapsed
10551
10552 \begin_layout Plain Layout
10553 LabelCounter
10554 \end_layout
10555
10556 \end_inset
10557
10558  is set, this string can be contain the special formatting commands described
10559  in Section 
10560 \begin_inset CommandInset ref
10561 LatexCommand ref
10562 reference "sub:Counters"
10563
10564 \end_inset
10565
10566 .
10567 \begin_inset Foot
10568 status collapsed
10569
10570 \begin_layout Plain Layout
10571 For the sake of backwards compatibility, the string 
10572 \begin_inset Flex CharStyle:Code
10573 status collapsed
10574
10575 \begin_layout Plain Layout
10576 @
10577 \emph on
10578 style-name
10579 \emph default
10580 @
10581 \end_layout
10582
10583 \end_inset
10584
10585  will be replaced by the expanded 
10586 \begin_inset Flex CharStyle:Code
10587 status collapsed
10588
10589 \begin_layout Plain Layout
10590 LabelString
10591 \end_layout
10592
10593 \end_inset
10594
10595  of style 
10596 \begin_inset Flex CharStyle:Code
10597 status collapsed
10598
10599 \begin_layout Plain Layout
10600
10601 \emph on
10602 style-name
10603 \end_layout
10604
10605 \end_inset
10606
10607 .
10608  This feature is now obsolete and should be replaced by the mechanisms of
10609  Section 
10610 \begin_inset CommandInset ref
10611 LatexCommand ref
10612 reference "sub:Counters"
10613
10614 \end_inset
10615
10616 .
10617 \end_layout
10618
10619 \end_inset
10620
10621
10622 \end_layout
10623
10624 \begin_layout Description
10625 \begin_inset Flex CharStyle:Code
10626 status collapsed
10627
10628 \begin_layout Plain Layout
10629 LabelStringAppendix
10630 \end_layout
10631
10632 \end_inset
10633
10634  [
10635 \begin_inset Flex CharStyle:Code
10636 status collapsed
10637
10638 \begin_layout Plain Layout
10639 string=""
10640 \end_layout
10641
10642 \end_inset
10643
10644 ] This is used inside the appendix instead of 
10645 \begin_inset Flex CharStyle:Code
10646 status collapsed
10647
10648 \begin_layout Plain Layout
10649 LabelString
10650 \end_layout
10651
10652 \end_inset
10653
10654 .
10655  Note that every 
10656 \begin_inset Flex CharStyle:Code
10657 status collapsed
10658
10659 \begin_layout Plain Layout
10660 LabelString
10661 \end_layout
10662
10663 \end_inset
10664
10665  statement resets 
10666 \begin_inset Flex CharStyle:Code
10667 status collapsed
10668
10669 \begin_layout Plain Layout
10670 LabelStringAppendix
10671 \end_layout
10672
10673 \end_inset
10674
10675  too.
10676 \end_layout
10677
10678 \begin_layout Description
10679 \begin_inset Flex CharStyle:Code
10680 status collapsed
10681
10682 \begin_layout Plain Layout
10683 LabelTag
10684 \end_layout
10685
10686 \end_inset
10687
10688  [FIXME] (Used only with XML-type formats.)
10689 \end_layout
10690
10691 \begin_layout Description
10692 \begin_inset Flex CharStyle:Code
10693 status collapsed
10694
10695 \begin_layout Plain Layout
10696 LabelType
10697 \end_layout
10698
10699 \end_inset
10700
10701  [
10702 \begin_inset Flex CharStyle:Code
10703 status collapsed
10704
10705 \begin_layout Plain Layout
10706
10707 \emph on
10708 No_Label
10709 \emph default
10710 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10711  Enumerate, Itemize, Bibliography
10712 \end_layout
10713
10714 \end_inset
10715
10716
10717 \end_layout
10718
10719 \begin_deeper
10720 \begin_layout Itemize
10721 \begin_inset Flex CharStyle:Code
10722 status collapsed
10723
10724 \begin_layout Plain Layout
10725 Manual
10726 \end_layout
10727
10728 \end_inset
10729
10730  means the label is the very first word (up to the first real blank).
10731  Use protected spaces (like
10732 \begin_inset space ~
10733 \end_inset
10734
10735 that one) if you want more than one word as the label.
10736  
10737 \end_layout
10738
10739 \begin_layout Itemize
10740 \begin_inset Flex CharStyle:Code
10741 status collapsed
10742
10743 \begin_layout Plain Layout
10744 Static
10745 \end_layout
10746
10747 \end_inset
10748
10749  means the label is simply whatever 
10750 \begin_inset Flex CharStyle:Code
10751 status collapsed
10752
10753 \begin_layout Plain Layout
10754 LabelString
10755 \end_layout
10756
10757 \end_inset
10758
10759  declares it to be.
10760  Note that this really is `static'.
10761 \end_layout
10762
10763 \begin_layout Itemize
10764 \begin_inset Flex CharStyle:Code
10765 status collapsed
10766
10767 \begin_layout Plain Layout
10768 Top_Environment
10769 \end_layout
10770
10771 \end_inset
10772
10773  and 
10774 \begin_inset Flex CharStyle:Code
10775 status collapsed
10776
10777 \begin_layout Plain Layout
10778 Centered_Top_Environment
10779 \end_layout
10780
10781 \end_inset
10782
10783  are special cases of 
10784 \begin_inset Flex CharStyle:Code
10785 status collapsed
10786
10787 \begin_layout Plain Layout
10788 Static
10789 \end_layout
10790
10791 \end_inset
10792
10793 .
10794  The label will be printed above the paragraph, but only at the top of an
10795  environment or the top of a chain of paragraphs with this layout.
10796  This might be used with the 
10797 \begin_inset Flex CharStyle:MenuItem
10798 status collapsed
10799
10800 \begin_layout Plain Layout
10801 Abstract
10802 \end_layout
10803
10804 \end_inset
10805
10806  layout, for example.
10807 \end_layout
10808
10809 \begin_layout Itemize
10810 \begin_inset Flex CharStyle:Code
10811 status collapsed
10812
10813 \begin_layout Plain Layout
10814 Sensitive
10815 \end_layout
10816
10817 \end_inset
10818
10819  is a special case for the caption-labels 
10820 \begin_inset Quotes eld
10821 \end_inset
10822
10823 Figure
10824 \begin_inset Quotes erd
10825 \end_inset
10826
10827  and 
10828 \begin_inset Quotes eld
10829 \end_inset
10830
10831 Table
10832 \begin_inset Quotes erd
10833 \end_inset
10834
10835 .
10836  
10837 \begin_inset Flex CharStyle:Code
10838 status collapsed
10839
10840 \begin_layout Plain Layout
10841 Sensitive
10842 \end_layout
10843
10844 \end_inset
10845
10846  means the (hardcoded) label string depends on the kind of float: It is
10847  hardcoded to be `FloatType N', where N is the value of the counter associated
10848  with the float.
10849 \end_layout
10850
10851 \begin_layout Itemize
10852 The 
10853 \begin_inset Flex CharStyle:Code
10854 status collapsed
10855
10856 \begin_layout Plain Layout
10857 Counter
10858 \end_layout
10859
10860 \end_inset
10861
10862  label type defines automatically numbered labels.
10863  The 
10864 \begin_inset Flex CharStyle:Code
10865 status collapsed
10866
10867 \begin_layout Plain Layout
10868 LabelString
10869 \end_layout
10870
10871 \end_inset
10872
10873  will be expanded to resolve any counter references it contains: For example,
10874  it might be 
10875 \begin_inset Quotes eld
10876 \end_inset
10877
10878
10879 \begin_inset Flex CharStyle:Code
10880 status collapsed
10881
10882 \begin_layout Plain Layout
10883 Section 
10884 \backslash
10885 thechapter.
10886 \backslash
10887 thesection
10888 \end_layout
10889
10890 \end_inset
10891
10892
10893 \begin_inset Quotes erd
10894 \end_inset
10895
10896 .
10897  See Section 
10898 \begin_inset CommandInset ref
10899 LatexCommand ref
10900 reference "sub:Counters"
10901
10902 \end_inset
10903
10904  for more information on counters.
10905 \end_layout
10906
10907 \begin_layout Itemize
10908 \begin_inset Flex CharStyle:Code
10909 status collapsed
10910
10911 \begin_layout Plain Layout
10912 Enumerate
10913 \end_layout
10914
10915 \end_inset
10916
10917  produces the usual sort of enumeration labels.
10918  At present, it is hardcoded to use Arabic numerals, lowercase letters,
10919  small Roman numerals, and uppercase letters for the four possible depths.
10920 \end_layout
10921
10922 \begin_layout Itemize
10923 \begin_inset Flex CharStyle:Code
10924 status collapsed
10925
10926 \begin_layout Plain Layout
10927 Itemize
10928 \end_layout
10929
10930 \end_inset
10931
10932  produces various bullets at the different levels.
10933  It is also hardcoded.
10934 \end_layout
10935
10936 \begin_layout Itemize
10937 \begin_inset Flex CharStyle:Code
10938 status collapsed
10939
10940 \begin_layout Plain Layout
10941 Bibliography
10942 \end_layout
10943
10944 \end_inset
10945
10946  is used internally by LyX and should be used only with 
10947 \begin_inset Flex CharStyle:Code
10948 status collapsed
10949
10950 \begin_layout Plain Layout
10951 LatexType BibEnvironment
10952 \end_layout
10953
10954 \end_inset
10955
10956 .
10957 \end_layout
10958
10959 \end_deeper
10960 \begin_layout Description
10961 \begin_inset Flex CharStyle:Code
10962 status collapsed
10963
10964 \begin_layout Plain Layout
10965 LangPreamble
10966 \end_layout
10967
10968 \end_inset
10969
10970  Like 
10971 \begin_inset Flex CharStyle:Code
10972 status collapsed
10973
10974 \begin_layout Plain Layout
10975 BabelPreamble
10976 \end_layout
10977
10978 \end_inset
10979
10980 , but this preamble snippet occurs independently from the babel package,
10981  and only for the document language.
10982  Must end with 
10983 \begin_inset Quotes eld
10984 \end_inset
10985
10986
10987 \begin_inset Flex CharStyle:Code
10988 status collapsed
10989
10990 \begin_layout Plain Layout
10991 EndLangPreamble
10992 \end_layout
10993
10994 \end_inset
10995
10996
10997 \begin_inset Quotes erd
10998 \end_inset
10999
11000 .
11001 \end_layout
11002
11003 \begin_deeper
11004 \begin_layout Standard
11005 If the style defines text that appears in the typeset document, it may use
11006  
11007 \begin_inset Flex CharStyle:Code
11008 status collapsed
11009
11010 \begin_layout Plain Layout
11011 LangPreamble
11012 \end_layout
11013
11014 \end_inset
11015
11016  and 
11017 \begin_inset Flex CharStyle:Code
11018 status collapsed
11019
11020 \begin_layout Plain Layout
11021 BabelPreamble
11022 \end_layout
11023
11024 \end_inset
11025
11026  to support non-english and even multilanguage documents correctly.
11027  The following excerpt (from the 
11028 \begin_inset Flex CharStyle:Code
11029 status collapsed
11030
11031 \begin_layout Plain Layout
11032 theorems-ams.inc
11033 \end_layout
11034
11035 \end_inset
11036
11037  file) shows how this works:
11038 \end_layout
11039
11040 \begin_layout LyX-Code
11041 Preamble
11042 \end_layout
11043
11044 \begin_layout LyX-Code
11045   
11046 \backslash
11047 theoremstyle{remark}
11048 \end_layout
11049
11050 \begin_layout LyX-Code
11051   
11052 \backslash
11053 newtheorem{claim}[thm]{
11054 \backslash
11055 protect
11056 \backslash
11057 claimname}
11058 \end_layout
11059
11060 \begin_layout LyX-Code
11061 EndPreamble
11062 \end_layout
11063
11064 \begin_layout LyX-Code
11065 LangPreamble
11066 \end_layout
11067
11068 \begin_layout LyX-Code
11069   
11070 \backslash
11071 providecommand{
11072 \backslash
11073 claimname}{_(Claim)}
11074 \end_layout
11075
11076 \begin_layout LyX-Code
11077
11078 \end_layout
11079
11080 \begin_layout LyX-Code
11081 EndLangPreamble
11082 \end_layout
11083
11084 \begin_layout LyX-Code
11085 BabelPreamble
11086 \end_layout
11087
11088 \begin_layout LyX-Code
11089     
11090 \backslash
11091 addto
11092 \backslash
11093 captions$$lang{
11094 \backslash
11095 renewcommand{
11096 \backslash
11097 claimname}{_(Claim)}}
11098 \end_layout
11099
11100 \begin_layout LyX-Code
11101 EndBabelPreamble
11102 \end_layout
11103
11104 \begin_layout Standard
11105 The key to correct translation of the user visible text is the definition
11106  of the command 
11107 \begin_inset Flex CharStyle:Code
11108 status collapsed
11109
11110 \begin_layout Plain Layout
11111
11112 \backslash
11113 claimname
11114 \end_layout
11115
11116 \end_inset
11117
11118  in the language preamble.
11119  This command holds the name of the theorem that will appear in the output.
11120  The 
11121 \begin_inset Flex CharStyle:Code
11122 status collapsed
11123
11124 \begin_layout Plain Layout
11125 BabelPreamble
11126 \end_layout
11127
11128 \end_inset
11129
11130  then uses the commands offered by the babel package to redefine 
11131 \begin_inset Flex CharStyle:Code
11132 status collapsed
11133
11134 \begin_layout Plain Layout
11135
11136 \backslash
11137 claimname
11138 \end_layout
11139
11140 \end_inset
11141
11142  for each used language in multilanguage documents.
11143 \end_layout
11144
11145 \end_deeper
11146 \begin_layout Description
11147 \begin_inset Flex CharStyle:Code
11148 status collapsed
11149
11150 \begin_layout Plain Layout
11151 LatexName
11152 \end_layout
11153
11154 \end_inset
11155
11156  The name of the corresponding LaTeX stuff.
11157  Either the environment or command name.
11158 \end_layout
11159
11160 \begin_layout Description
11161 \begin_inset Flex CharStyle:Code
11162 status collapsed
11163
11164 \begin_layout Plain Layout
11165 LatexParam
11166 \end_layout
11167
11168 \end_inset
11169
11170  An optional parameter for the corresponding 
11171 \begin_inset Flex CharStyle:Code
11172 status collapsed
11173
11174 \begin_layout Plain Layout
11175 LatexName
11176 \end_layout
11177
11178 \end_inset
11179
11180  stuff.
11181  This parameter cannot be changed from within LyX.
11182 \end_layout
11183
11184 \begin_layout Description
11185 \begin_inset Flex CharStyle:Code
11186 status collapsed
11187
11188 \begin_layout Plain Layout
11189 LatexType
11190 \end_layout
11191
11192 \end_inset
11193
11194  
11195 \begin_inset CommandInset label
11196 LatexCommand label
11197 name "des:LatexType"
11198
11199 \end_inset
11200
11201 [
11202 \begin_inset Flex CharStyle:Code
11203 status collapsed
11204
11205 \begin_layout Plain Layout
11206
11207 \emph on
11208 Paragraph
11209 \emph default
11210 , Command, Environment, Item_Environment,
11211 \end_layout
11212
11213 \end_inset
11214
11215  
11216 \begin_inset Flex CharStyle:Code
11217 status collapsed
11218
11219 \begin_layout Plain Layout
11220 List_Environment, Bib_Environment
11221 \end_layout
11222
11223 \end_inset
11224
11225 ] How the layout should be translated into LaTeX.
11226 \begin_inset Foot
11227 status collapsed
11228
11229 \begin_layout Plain Layout
11230 \begin_inset Flex CharStyle:Code
11231 status collapsed
11232
11233 \begin_layout Plain Layout
11234 LatexType
11235 \end_layout
11236
11237 \end_inset
11238
11239  is perhaps a bit misleading, since these rules apply to SGML classes, too.
11240  Visit the SGML class files for specific examples.
11241 \end_layout
11242
11243 \end_inset
11244
11245
11246 \end_layout
11247
11248 \begin_deeper
11249 \begin_layout Itemize
11250 \begin_inset Flex CharStyle:Code
11251 status collapsed
11252
11253 \begin_layout Plain Layout
11254 Paragraph
11255 \end_layout
11256
11257 \end_inset
11258
11259  means nothing special.
11260  
11261 \end_layout
11262
11263 \begin_layout Itemize
11264 \begin_inset Flex CharStyle:Code
11265 status collapsed
11266
11267 \begin_layout Plain Layout
11268 Command
11269 \end_layout
11270
11271 \end_inset
11272
11273  means 
11274 \begin_inset Flex CharStyle:Code
11275 status collapsed
11276
11277 \begin_layout Plain Layout
11278
11279 \backslash
11280
11281 \emph on
11282 LatexName
11283 \emph default
11284 {\SpecialChar \ldots{}
11285 }
11286 \end_layout
11287
11288 \end_inset
11289
11290 .
11291 \end_layout
11292
11293 \begin_layout Itemize
11294 \begin_inset Flex CharStyle:Code
11295 status collapsed
11296
11297 \begin_layout Plain Layout
11298 Environment
11299 \end_layout
11300
11301 \end_inset
11302
11303  means 
11304 \begin_inset Flex CharStyle:Code
11305 status collapsed
11306
11307 \begin_layout Plain Layout
11308
11309 \backslash
11310 begin{
11311 \emph on
11312 LatexName
11313 \emph default
11314 }\SpecialChar \ldots{}
11315
11316 \backslash
11317 end{
11318 \emph on
11319 LatexName
11320 \emph default
11321 }
11322 \end_layout
11323
11324 \end_inset
11325
11326 .
11327  
11328 \end_layout
11329
11330 \begin_layout Itemize
11331 \begin_inset Flex CharStyle:Code
11332 status collapsed
11333
11334 \begin_layout Plain Layout
11335 Item_Environment
11336 \end_layout
11337
11338 \end_inset
11339
11340  is the same as 
11341 \begin_inset Flex CharStyle:Code
11342 status collapsed
11343
11344 \begin_layout Plain Layout
11345 Environment
11346 \end_layout
11347
11348 \end_inset
11349
11350 , except that an 
11351 \begin_inset Flex CharStyle:Code
11352 status collapsed
11353
11354 \begin_layout Plain Layout
11355
11356 \backslash
11357 item
11358 \end_layout
11359
11360 \end_inset
11361
11362  is generated for each paragraph of this environment.
11363  
11364 \end_layout
11365
11366 \begin_layout Itemize
11367 \begin_inset Flex CharStyle:Code
11368 status collapsed
11369
11370 \begin_layout Plain Layout
11371 List_Environment
11372 \end_layout
11373
11374 \end_inset
11375
11376  is the same as 
11377 \begin_inset Flex CharStyle:Code
11378 status collapsed
11379
11380 \begin_layout Plain Layout
11381 Item_Environment
11382 \end_layout
11383
11384 \end_inset
11385
11386 , except that 
11387 \begin_inset Flex CharStyle:Code
11388 status collapsed
11389
11390 \begin_layout Plain Layout
11391 LabelWidthString
11392 \end_layout
11393
11394 \end_inset
11395
11396  is passed as an argument to the environment.
11397  
11398 \begin_inset Flex CharStyle:Code
11399 status collapsed
11400
11401 \begin_layout Plain Layout
11402 LabelWidthString
11403 \end_layout
11404
11405 \end_inset
11406
11407  can be defined in the 
11408 \begin_inset Flex CharStyle:MenuItem
11409 status collapsed
11410
11411 \begin_layout Plain Layout
11412
11413 \bar under
11414 L
11415 \bar default
11416 ayout\SpecialChar \menuseparator
11417
11418 \bar under
11419 P
11420 \bar default
11421 aragraph
11422 \end_layout
11423
11424 \end_inset
11425
11426  dialog.
11427  
11428 \end_layout
11429
11430 \begin_layout Standard
11431 Putting the last few things together, the LaTeX output will be either: 
11432 \end_layout
11433
11434 \begin_layout LyX-Code
11435
11436 \backslash
11437 latexname[latexparam]{\SpecialChar \ldots{}
11438 }
11439 \end_layout
11440
11441 \begin_layout Standard
11442 or: 
11443 \end_layout
11444
11445 \begin_layout LyX-Code
11446
11447 \backslash
11448 begin{latexname}[latexparam] \SpecialChar \ldots{}
11449  
11450 \backslash
11451 end{latexname}.
11452 \end_layout
11453
11454 \begin_layout Standard
11455 depending upon the LaTeX type.
11456 \end_layout
11457
11458 \end_deeper
11459 \begin_layout Description
11460 \begin_inset Flex CharStyle:Code
11461 status collapsed
11462
11463 \begin_layout Plain Layout
11464 LeftMargin
11465 \end_layout
11466
11467 \end_inset
11468
11469  [
11470 \begin_inset Flex CharStyle:Code
11471 status collapsed
11472
11473 \begin_layout Plain Layout
11474 string=""
11475 \end_layout
11476
11477 \end_inset
11478
11479 ] If you put layouts into environments, the leftmargins are not simply added,
11480  but added with a factor 
11481 \begin_inset Formula $\frac{4}{depth+4}$
11482 \end_inset
11483
11484 .
11485  Note that this parameter is also used when the margin is defined as 
11486 \begin_inset Flex CharStyle:Code
11487 status collapsed
11488
11489 \begin_layout Plain Layout
11490 Manual
11491 \end_layout
11492
11493 \end_inset
11494
11495  or 
11496 \begin_inset Flex CharStyle:Code
11497 status collapsed
11498
11499 \begin_layout Plain Layout
11500 Dynamic
11501 \end_layout
11502
11503 \end_inset
11504
11505 .
11506  Then it is added to the manual or dynamic margin.
11507  
11508 \begin_inset Newline newline
11509 \end_inset
11510
11511 The argument is passed as a string.
11512  For example 
11513 \begin_inset Quotes eld
11514 \end_inset
11515
11516
11517 \begin_inset Flex CharStyle:Code
11518 status collapsed
11519
11520 \begin_layout Plain Layout
11521 MM
11522 \end_layout
11523
11524 \end_inset
11525
11526
11527 \begin_inset Quotes erd
11528 \end_inset
11529
11530  means that the paragraph is indented with the width of 
11531 \begin_inset Quotes eld
11532 \end_inset
11533
11534
11535 \begin_inset Flex CharStyle:Code
11536 status collapsed
11537
11538 \begin_layout Plain Layout
11539 MM
11540 \end_layout
11541
11542 \end_inset
11543
11544
11545 \begin_inset Quotes erd
11546 \end_inset
11547
11548  in the normal font.
11549  You can get a negative width by prefixing the string with 
11550 \begin_inset Quotes eld
11551 \end_inset
11552
11553
11554 \begin_inset Flex CharStyle:Code
11555 status collapsed
11556
11557 \begin_layout Plain Layout
11558 -
11559 \end_layout
11560
11561 \end_inset
11562
11563
11564 \begin_inset Quotes erd
11565 \end_inset
11566
11567 .
11568  This way was chosen so that the look is the same with each used screen
11569  font.
11570  
11571 \end_layout
11572
11573 \begin_layout Description
11574 \begin_inset Flex CharStyle:Code
11575 status collapsed
11576
11577 \begin_layout Plain Layout
11578 Margin
11579 \end_layout
11580
11581 \end_inset
11582
11583  [
11584 \begin_inset Flex CharStyle:Code
11585 status collapsed
11586
11587 \begin_layout Plain Layout
11588
11589 \emph on
11590 Static
11591 \emph default
11592 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11593 \end_layout
11594
11595 \end_inset
11596
11597
11598 \begin_inset Newline newline
11599 \end_inset
11600
11601 The kind of margin that the layout has on the left side.
11602  
11603 \begin_inset Flex CharStyle:Code
11604 status collapsed
11605
11606 \begin_layout Plain Layout
11607 Static
11608 \end_layout
11609
11610 \end_inset
11611
11612  just means a fixed margin.
11613  
11614 \begin_inset Flex CharStyle:Code
11615 status collapsed
11616
11617 \begin_layout Plain Layout
11618 Manual
11619 \end_layout
11620
11621 \end_inset
11622
11623  means that the left margin depends on the string entered in the 
11624 \begin_inset Flex CharStyle:MenuItem
11625 status collapsed
11626
11627 \begin_layout Plain Layout
11628 Edit\SpecialChar \menuseparator
11629 Paragraph
11630 \begin_inset space ~
11631 \end_inset
11632
11633 Settings
11634 \end_layout
11635
11636 \end_inset
11637
11638  dialog.
11639  This is used to typeset nice lists without tabulators.
11640  
11641 \begin_inset Flex CharStyle:Code
11642 status collapsed
11643
11644 \begin_layout Plain Layout
11645 Dynamic
11646 \end_layout
11647
11648 \end_inset
11649
11650  means that the margin depends on the size of the label.
11651  This is used for automatic enumerated headlines.
11652  It is obvious that the headline 
11653 \begin_inset Quotes eld
11654 \end_inset
11655
11656 5.4.3.2.1 Very long headline
11657 \begin_inset Quotes erd
11658 \end_inset
11659
11660  must have a wider left margin (as wide as 
11661 \begin_inset Quotes eld
11662 \end_inset
11663
11664 5.4.3.2.1
11665 \begin_inset Quotes erd
11666 \end_inset
11667
11668  plus the space) than 
11669 \begin_inset Quotes eld
11670 \end_inset
11671
11672 3.2 Very long headline
11673 \begin_inset Quotes erd
11674 \end_inset
11675
11676 , even if standard 
11677 \begin_inset Quotes eld
11678 \end_inset
11679
11680 word processors
11681 \begin_inset Quotes erd
11682 \end_inset
11683
11684  are not able to do this.
11685  
11686 \begin_inset Flex CharStyle:Code
11687 status collapsed
11688
11689 \begin_layout Plain Layout
11690 First_Dynamic
11691 \end_layout
11692
11693 \end_inset
11694
11695  is similar, but only the very first row of the paragraph is dynamic, while
11696  the others are static; this is used, for example, for descriptions.
11697  
11698 \begin_inset Flex CharStyle:Code
11699 status collapsed
11700
11701 \begin_layout Plain Layout
11702 Right_Address_Box
11703 \end_layout
11704
11705 \end_inset
11706
11707  means the margin is chosen in a way that the longest row of this paragraph
11708  fits to the right margin.
11709  This is used to typeset an address on the right edge of the page.
11710 \end_layout
11711
11712 \begin_layout Description
11713 \begin_inset Flex CharStyle:Code
11714 status collapsed
11715
11716 \begin_layout Plain Layout
11717 NeedProtect
11718 \end_layout
11719
11720 \end_inset
11721
11722  [
11723 \begin_inset Flex CharStyle:Code
11724 status collapsed
11725
11726 \begin_layout Plain Layout
11727
11728 \emph on
11729 0
11730 \end_layout
11731
11732 \end_inset
11733
11734 ,
11735 \begin_inset Flex CharStyle:Code
11736 status collapsed
11737
11738 \begin_layout Plain Layout
11739 1
11740 \end_layout
11741
11742 \end_inset
11743
11744 ] Whether fragile commands in this layout should be 
11745 \begin_inset Flex CharStyle:Code
11746 status collapsed
11747
11748 \begin_layout Plain Layout
11749
11750 \backslash
11751 protect
11752 \end_layout
11753
11754 \end_inset
11755
11756 'ed.
11757  (Note: This is 
11758 \emph on
11759 not
11760 \emph default
11761  whether this command should itself be protected.)
11762 \end_layout
11763
11764 \begin_layout Description
11765 \begin_inset Flex CharStyle:Code
11766 status collapsed
11767
11768 \begin_layout Plain Layout
11769 Newline
11770 \end_layout
11771
11772 \end_inset
11773
11774  [
11775 \begin_inset Flex CharStyle:Code
11776 status collapsed
11777
11778 \begin_layout Plain Layout
11779 0
11780 \end_layout
11781
11782 \end_inset
11783
11784
11785 \begin_inset Flex CharStyle:Code
11786 status collapsed
11787
11788 \begin_layout Plain Layout
11789
11790 \emph on
11791 1
11792 \end_layout
11793
11794 \end_inset
11795
11796 ] Whether newlines are translated into LaTeX newlines (
11797 \begin_inset Flex CharStyle:Code
11798 status collapsed
11799
11800 \begin_layout Plain Layout
11801
11802 \backslash
11803
11804 \backslash
11805
11806 \end_layout
11807
11808 \end_inset
11809
11810 ) or not.
11811  The translation can be switched off to allow more comfortable LaTeX editing
11812  inside LyX.
11813 \end_layout
11814
11815 \begin_layout Description
11816 \begin_inset Flex CharStyle:Code
11817 status collapsed
11818
11819 \begin_layout Plain Layout
11820 NextNoIndent
11821 \end_layout
11822
11823 \end_inset
11824
11825  [
11826 \begin_inset Flex CharStyle:Code
11827 status collapsed
11828
11829 \begin_layout Plain Layout
11830 1
11831 \end_layout
11832
11833 \end_inset
11834
11835
11836 \begin_inset Flex CharStyle:Code
11837 status collapsed
11838
11839 \begin_layout Plain Layout
11840
11841 \emph on
11842 0
11843 \end_layout
11844
11845 \end_inset
11846
11847 ] Whether the following Paragraph is allowed to indent its very first row.
11848  
11849 \begin_inset Flex CharStyle:Code
11850 status collapsed
11851
11852 \begin_layout Plain Layout
11853 1
11854 \end_layout
11855
11856 \end_inset
11857
11858  means that it is not allowed to do so; 
11859 \begin_inset Flex CharStyle:Code
11860 status collapsed
11861
11862 \begin_layout Plain Layout
11863 0
11864 \end_layout
11865
11866 \end_inset
11867
11868  means it could do so if it wants to.
11869 \end_layout
11870
11871 \begin_layout Description
11872 \begin_inset Flex CharStyle:Code
11873 status collapsed
11874
11875 \begin_layout Plain Layout
11876 ObsoletedBy
11877 \end_layout
11878
11879 \end_inset
11880
11881  Name of a layout that has replaced this layout.
11882  This is used to rename a layout, while keeping backward compatibility.
11883 \end_layout
11884
11885 \begin_layout Description
11886 \begin_inset Flex CharStyle:Code
11887 status collapsed
11888
11889 \begin_layout Plain Layout
11890 OptionalArgs
11891 \end_layout
11892
11893 \end_inset
11894
11895  [
11896 \begin_inset Flex CharStyle:Code
11897 status collapsed
11898
11899 \begin_layout Plain Layout
11900 int=0
11901 \end_layout
11902
11903 \end_inset
11904
11905 ] The number of optional arguments that can be used with this layout.
11906  This is useful for things like section headings, and only makes sense with
11907  LaTeX.
11908  Note that, on output, the optional arguments will all precede any required
11909  arguments (see below).
11910  So one can have constructs like:
11911 \end_layout
11912
11913 \begin_deeper
11914 \begin_layout LyX-Code
11915
11916 \backslash
11917 mycmd[opt1]{req1}{contents of paragraph}
11918 \end_layout
11919
11920 \begin_layout Standard
11921 but one cannot have things like: 
11922 \end_layout
11923
11924 \begin_layout LyX-Code
11925
11926 \backslash
11927 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11928 \end_layout
11929
11930 \begin_layout Standard
11931 at least, not without ERT (with which you can have anything).
11932  
11933 \end_layout
11934
11935 \end_deeper
11936 \begin_layout Description
11937 \begin_inset Flex CharStyle:Code
11938 status collapsed
11939
11940 \begin_layout Plain Layout
11941 ParIndent
11942 \end_layout
11943
11944 \end_inset
11945
11946  [
11947 \begin_inset Flex CharStyle:Code
11948 status collapsed
11949
11950 \begin_layout Plain Layout
11951 string=""
11952 \end_layout
11953
11954 \end_inset
11955
11956 ] The indent of the very first line of a paragraph.
11957  The 
11958 \begin_inset Flex CharStyle:Code
11959 status collapsed
11960
11961 \begin_layout Plain Layout
11962 Parindent
11963 \end_layout
11964
11965 \end_inset
11966
11967  will be fixed for a certain layout.
11968  The exception is Standard layout, since the indentation of a Standard layout
11969  paragraph can be prohibited with 
11970 \begin_inset Flex CharStyle:Code
11971 status collapsed
11972
11973 \begin_layout Plain Layout
11974 NextNoIndent
11975 \end_layout
11976
11977 \end_inset
11978
11979 .
11980  Also, Standard layout paragraphs inside environments use the 
11981 \begin_inset Flex CharStyle:Code
11982 status collapsed
11983
11984 \begin_layout Plain Layout
11985 Parindent
11986 \end_layout
11987
11988 \end_inset
11989
11990  of the environment, not their native one.
11991  For example, Standard paragraphs inside an enumeration are not indented.
11992 \end_layout
11993
11994 \begin_layout Description
11995 \begin_inset Flex CharStyle:Code
11996 status collapsed
11997
11998 \begin_layout Plain Layout
11999 Parsep
12000 \end_layout
12001
12002 \end_inset
12003
12004  [
12005 \begin_inset Flex CharStyle:Code
12006 status collapsed
12007
12008 \begin_layout Plain Layout
12009 float=0
12010 \end_layout
12011
12012 \end_inset
12013
12014 ] The vertical space between two paragraphs of this layout.
12015 \end_layout
12016
12017 \begin_layout Description
12018 \begin_inset Flex CharStyle:Code
12019 status collapsed
12020
12021 \begin_layout Plain Layout
12022 Parskip
12023 \end_layout
12024
12025 \end_inset
12026
12027  [
12028 \begin_inset Flex CharStyle:Code
12029 status collapsed
12030
12031 \begin_layout Plain Layout
12032 float=0
12033 \end_layout
12034
12035 \end_inset
12036
12037 ] LyX allows the user to choose either 
12038 \begin_inset Quotes eld
12039 \end_inset
12040
12041 indent
12042 \begin_inset Quotes erd
12043 \end_inset
12044
12045  or 
12046 \begin_inset Quotes eld
12047 \end_inset
12048
12049 skip
12050 \begin_inset Quotes erd
12051 \end_inset
12052
12053  to typeset a document.
12054  When 
12055 \begin_inset Quotes eld
12056 \end_inset
12057
12058 indent
12059 \begin_inset Quotes erd
12060 \end_inset
12061
12062  is chosen, this value is completely ignored.
12063  When 
12064 \begin_inset Quotes eld
12065 \end_inset
12066
12067 skip
12068 \begin_inset Quotes erd
12069 \end_inset
12070
12071  is chosen, the parindent of a LaTeXtype 
12072 \begin_inset Quotes eld
12073 \end_inset
12074
12075 Paragraph
12076 \begin_inset Quotes erd
12077 \end_inset
12078
12079  layout is ignored and all paragraphs are separated by this parskip argument.
12080  The vertical space is calculated with 
12081 \begin_inset Flex CharStyle:Code
12082 status collapsed
12083
12084 \begin_layout Plain Layout
12085 value
12086 \begin_inset space ~
12087 \end_inset
12088
12089 * DefaultHeight
12090 \end_layout
12091
12092 \end_inset
12093
12094  where 
12095 \begin_inset Flex CharStyle:Code
12096 status collapsed
12097
12098 \begin_layout Plain Layout
12099 DefaultHeight
12100 \end_layout
12101
12102 \end_inset
12103
12104  is the height of a row with the normal font.
12105  This way, the look stays the same with different screen fonts.
12106 \end_layout
12107
12108 \begin_layout Description
12109 \begin_inset Flex CharStyle:Code
12110 status collapsed
12111
12112 \begin_layout Plain Layout
12113 PassThru
12114 \end_layout
12115
12116 \end_inset
12117
12118  
12119 \begin_inset CommandInset label
12120 LatexCommand label
12121 name "des:PathThru"
12122
12123 \end_inset
12124
12125 [
12126 \begin_inset Flex CharStyle:Code
12127 status collapsed
12128
12129 \begin_layout Plain Layout
12130
12131 \emph on
12132 0
12133 \end_layout
12134
12135 \end_inset
12136
12137
12138 \begin_inset Flex CharStyle:Code
12139 status collapsed
12140
12141 \begin_layout Plain Layout
12142 1
12143 \end_layout
12144
12145 \end_inset
12146
12147 ] Whether the contents of this paragraph should be output in raw form, meaning
12148  without special translations that LaTeX would require.
12149 \end_layout
12150
12151 \begin_layout Description
12152 \begin_inset Flex CharStyle:Code
12153 status collapsed
12154
12155 \begin_layout Plain Layout
12156 Preamble
12157 \end_layout
12158
12159 \end_inset
12160
12161  
12162 \begin_inset CommandInset label
12163 LatexCommand label
12164 name "des:Preamble"
12165
12166 \end_inset
12167
12168 Information to be included in the LaTeX preamble when this style is used.
12169  Used to define macros, load packages, etc., required by this particular
12170  style.
12171  Must end with 
12172 \begin_inset Quotes eld
12173 \end_inset
12174
12175
12176 \begin_inset Flex CharStyle:Code
12177 status collapsed
12178
12179 \begin_layout Plain Layout
12180 EndPreamble
12181 \end_layout
12182
12183 \end_inset
12184
12185
12186 \begin_inset Quotes erd
12187 \end_inset
12188
12189 .
12190 \end_layout
12191
12192 \begin_layout Description
12193 \begin_inset Flex CharStyle:Code
12194 status collapsed
12195
12196 \begin_layout Plain Layout
12197 RefPrefix
12198 \end_layout
12199
12200 \end_inset
12201
12202  [
12203 \begin_inset Flex CharStyle:Code
12204 status collapsed
12205
12206 \begin_layout Plain Layout
12207 string
12208 \end_layout
12209
12210 \end_inset
12211
12212 ] The prefix to use when creating labels referring to paragraphs of this
12213  type.
12214  This allows the use of formatted references.
12215 \end_layout
12216
12217 \begin_layout Description
12218 \begin_inset Flex CharStyle:Code
12219 status collapsed
12220
12221 \begin_layout Plain Layout
12222 RequiredArgs
12223 \end_layout
12224
12225 \end_inset
12226
12227  [
12228 \begin_inset Flex CharStyle:Code
12229 status collapsed
12230
12231 \begin_layout Plain Layout
12232 int=0
12233 \end_layout
12234
12235 \end_inset
12236
12237 ] The number of required arguments that the LaTeX command or environment
12238  corresponding to this layout expects.
12239  In the case of a command, these are required arguments 
12240 \emph on
12241 other than
12242 \emph default
12243  that associated with the content of the paragraph itself.
12244  These do not actually have to be provided: LyX will output empty arguments
12245  if necessary.
12246  Note that optional arguments will be output before required arguments.
12247  See the discussion of the 
12248 \begin_inset Flex CharStyle:Code
12249 status collapsed
12250
12251 \begin_layout Plain Layout
12252 OptionalArgs
12253 \end_layout
12254
12255 \end_inset
12256
12257  tag above for more information.
12258 \end_layout
12259
12260 \begin_layout Description
12261 \begin_inset Flex CharStyle:Code
12262 status collapsed
12263
12264 \begin_layout Plain Layout
12265 Requires 
12266 \end_layout
12267
12268 \end_inset
12269
12270  [
12271 \begin_inset Flex CharStyle:Code
12272 status collapsed
12273
12274 \begin_layout Plain Layout
12275 string
12276 \end_layout
12277
12278 \end_inset
12279
12280
12281 \begin_inset CommandInset label
12282 LatexCommand label
12283 name "des:Requires"
12284
12285 \end_inset
12286
12287 Whether the layout requires the feature 
12288 \begin_inset Flex CharStyle:Code
12289 status collapsed
12290
12291 \begin_layout Plain Layout
12292 string
12293 \end_layout
12294
12295 \end_inset
12296
12297 .
12298  See the description of 
12299 \begin_inset Flex CharStyle:Code
12300 status collapsed
12301
12302 \begin_layout Plain Layout
12303 Provides
12304 \end_layout
12305
12306 \end_inset
12307
12308  above (page 
12309 \begin_inset CommandInset ref
12310 LatexCommand pageref
12311 reference "des:FreeSpacing"
12312
12313 \end_inset
12314
12315 ) for information on `features'.
12316  
12317 \end_layout
12318
12319 \begin_layout Description
12320 \begin_inset Flex CharStyle:Code
12321 status collapsed
12322
12323 \begin_layout Plain Layout
12324 RightMargin
12325 \end_layout
12326
12327 \end_inset
12328
12329  [
12330 \begin_inset Flex CharStyle:Code
12331 status collapsed
12332
12333 \begin_layout Plain Layout
12334 string=""
12335 \end_layout
12336
12337 \end_inset
12338
12339 ] Similar to 
12340 \begin_inset Flex CharStyle:Code
12341 status collapsed
12342
12343 \begin_layout Plain Layout
12344 LeftMargin
12345 \end_layout
12346
12347 \end_inset
12348
12349 .
12350 \end_layout
12351
12352 \begin_layout Description
12353 \begin_inset Flex CharStyle:Code
12354 status collapsed
12355
12356 \begin_layout Plain Layout
12357 Spacing
12358 \end_layout
12359
12360 \end_inset
12361
12362  [
12363 \begin_inset Flex CharStyle:Code
12364 status collapsed
12365
12366 \begin_layout Plain Layout
12367
12368 \emph on
12369 single
12370 \emph default
12371 , onehalf, double, other
12372 \end_layout
12373
12374 \end_inset
12375
12376  
12377 \emph on
12378 value
12379 \emph default
12380 ] This defines what the default spacing should be in the layout.
12381  The arguments 
12382 \begin_inset Flex CharStyle:Code
12383 status collapsed
12384
12385 \begin_layout Plain Layout
12386 single
12387 \end_layout
12388
12389 \end_inset
12390
12391
12392 \begin_inset Flex CharStyle:Code
12393 status collapsed
12394
12395 \begin_layout Plain Layout
12396 onehalf
12397 \end_layout
12398
12399 \end_inset
12400
12401  and 
12402 \begin_inset Flex CharStyle:Code
12403 status collapsed
12404
12405 \begin_layout Plain Layout
12406 double
12407 \end_layout
12408
12409 \end_inset
12410
12411  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12412  If you specify the argument 
12413 \begin_inset Flex CharStyle:Code
12414 status collapsed
12415
12416 \begin_layout Plain Layout
12417 other
12418 \end_layout
12419
12420 \end_inset
12421
12422 , then you should also provide a numerical argument which will be the actual
12423  multiplier value.
12424  Note that, contrary to other parameters, 
12425 \begin_inset Flex CharStyle:Code
12426 status collapsed
12427
12428 \begin_layout Plain Layout
12429 Spacing
12430 \end_layout
12431
12432 \end_inset
12433
12434  implies the generation of specific LaTeX code, using the package 
12435 \family roman
12436
12437 \begin_inset Flex CharStyle:Code
12438 status collapsed
12439
12440 \begin_layout Plain Layout
12441 setspace.sty
12442 \end_layout
12443
12444 \end_inset
12445
12446 .
12447 \end_layout
12448
12449 \begin_layout Description
12450 \begin_inset Flex CharStyle:Code
12451 status collapsed
12452
12453 \begin_layout Plain Layout
12454 Spellcheck
12455 \end_layout
12456
12457 \end_inset
12458
12459  [
12460 \begin_inset Flex CharStyle:Code
12461 status collapsed
12462
12463 \begin_layout Plain Layout
12464 0
12465 \end_layout
12466
12467 \end_inset
12468
12469 ,
12470 \begin_inset Flex CharStyle:Code
12471 status collapsed
12472
12473 \begin_layout Plain Layout
12474
12475 \emph on
12476 1
12477 \end_layout
12478
12479 \end_inset
12480
12481 ] Spellcheck paragraphs of this style.
12482  Default is true.
12483 \end_layout
12484
12485 \begin_layout Description
12486 \begin_inset Flex CharStyle:Code
12487 status collapsed
12488
12489 \begin_layout Plain Layout
12490 TextFont
12491 \end_layout
12492
12493 \end_inset
12494
12495  The font used for the text body .
12496  See section 
12497 \begin_inset CommandInset ref
12498 LatexCommand ref
12499 reference "sub:Font-description"
12500
12501 \end_inset
12502
12503 .
12504 \end_layout
12505
12506 \begin_layout Description
12507 \begin_inset Flex CharStyle:Code
12508 status collapsed
12509
12510 \begin_layout Plain Layout
12511 TocLevel
12512 \end_layout
12513
12514 \end_inset
12515
12516
12517 \series medium
12518  
12519 \begin_inset Flex CharStyle:Code
12520 status collapsed
12521
12522 \begin_layout Plain Layout
12523
12524 \series medium
12525 [int]
12526 \end_layout
12527
12528 \end_inset
12529
12530
12531 \series default
12532  The level of the style in the table of contents.
12533  This is used for automatic numbering of section headings.
12534 \end_layout
12535
12536 \begin_layout Description
12537 \begin_inset Flex CharStyle:Code
12538 status collapsed
12539
12540 \begin_layout Plain Layout
12541 TopSep
12542 \end_layout
12543
12544 \end_inset
12545
12546  [
12547 \begin_inset Flex CharStyle:Code
12548 status collapsed
12549
12550 \begin_layout Plain Layout
12551 float=0
12552 \end_layout
12553
12554 \end_inset
12555
12556 ] The vertical space with which the very first of a chain of paragraphs
12557  with this layout is separated from the previous paragraph.
12558  If the previous paragraph has another layout, the separations are not simply
12559  added, but the maximum is taken.
12560 \end_layout
12561
12562 \begin_layout Subsection
12563 Floats
12564 \begin_inset CommandInset label
12565 LatexCommand label
12566 name "sub:Floats"
12567
12568 \end_inset
12569
12570
12571 \end_layout
12572
12573 \begin_layout Standard
12574 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12575  define the floats (
12576 \begin_inset Flex CharStyle:MenuItem
12577 status collapsed
12578
12579 \begin_layout Plain Layout
12580 figure
12581 \end_layout
12582
12583 \end_inset
12584
12585
12586 \begin_inset Flex CharStyle:MenuItem
12587 status collapsed
12588
12589 \begin_layout Plain Layout
12590 table
12591 \end_layout
12592
12593 \end_inset
12594
12595 , \SpecialChar \ldots{}
12596 ) in the text class itself.
12597  Standard floats are included in the file 
12598 \begin_inset Flex CharStyle:Code
12599 status collapsed
12600
12601 \begin_layout Plain Layout
12602 stdfloats.inc
12603 \end_layout
12604
12605 \end_inset
12606
12607 , so you may have to do no more than add
12608 \end_layout
12609
12610 \begin_layout LyX-Code
12611 Input stdfloats.inc
12612 \end_layout
12613
12614 \begin_layout Standard
12615 to your layout file.
12616  If you want to implement a text class that proposes some other float types
12617  (like the AGU class bundled with LyX), the information below will hopefully
12618  help you:
12619 \end_layout
12620
12621 \begin_layout Description
12622 \begin_inset Flex CharStyle:Code
12623 status collapsed
12624
12625 \begin_layout Plain Layout
12626 Extension
12627 \end_layout
12628
12629 \end_inset
12630
12631  [
12632 \begin_inset Flex CharStyle:Code
12633 status collapsed
12634
12635 \begin_layout Plain Layout
12636 string
12637 \end_layout
12638
12639 \end_inset
12640
12641 =
12642 \begin_inset Quotes erd
12643 \end_inset
12644
12645
12646 \begin_inset Quotes erd
12647 \end_inset
12648
12649 ] The file name extension of an auxiliary file for the list of figures (or
12650  whatever).
12651  LaTeX writes the captions to this file.
12652 \end_layout
12653
12654 \begin_layout Description
12655 \begin_inset Flex CharStyle:Code
12656 status collapsed
12657
12658 \begin_layout Plain Layout
12659 GuiName
12660 \end_layout
12661
12662 \end_inset
12663
12664  [
12665 \begin_inset Flex CharStyle:Code
12666 status collapsed
12667
12668 \begin_layout Plain Layout
12669 string
12670 \end_layout
12671
12672 \end_inset
12673
12674 =
12675 \begin_inset Quotes erd
12676 \end_inset
12677
12678
12679 \begin_inset Quotes erd
12680 \end_inset
12681
12682 ] The string that will be used in the menus and also for the caption.
12683  This is translated to the current language if babel is used.
12684 \end_layout
12685
12686 \begin_layout Description
12687 \begin_inset Flex CharStyle:Code
12688 status collapsed
12689
12690 \begin_layout Plain Layout
12691 HTML*
12692 \end_layout
12693
12694 \end_inset
12695
12696  These are used for XHTML output.
12697  See 
12698 \begin_inset CommandInset ref
12699 LatexCommand ref
12700 reference "sec:Tags-for-XHTML"
12701
12702 \end_inset
12703
12704 .
12705 \end_layout
12706
12707 \begin_layout Description
12708 \begin_inset Flex CharStyle:Code
12709 status collapsed
12710
12711 \begin_layout Plain Layout
12712 ListCommand
12713 \end_layout
12714
12715 \end_inset
12716
12717  [
12718 \begin_inset Flex CharStyle:Code
12719 status collapsed
12720
12721 \begin_layout Plain Layout
12722 string
12723 \end_layout
12724
12725 \end_inset
12726
12727 =
12728 \begin_inset Quotes erd
12729 \end_inset
12730
12731
12732 \begin_inset Quotes erd
12733 \end_inset
12734
12735 ] The command used to generate a list of floats of this type; the leading
12736  `
12737 \backslash
12738 ' should be omitted.
12739  This 
12740 \emph on
12741 must
12742 \emph default
12743  be given if 
12744 \begin_inset Flex CharStyle:Code
12745 status collapsed
12746
12747 \begin_layout Plain Layout
12748 NeedsFloatPkg
12749 \end_layout
12750
12751 \end_inset
12752
12753  is false, since there is no standard way to generate this command.
12754  It is ignored if 
12755 \begin_inset Flex CharStyle:Code
12756 status collapsed
12757
12758 \begin_layout Plain Layout
12759 NeedsFloatPkg
12760 \end_layout
12761
12762 \end_inset
12763
12764  is true, since in that case there is a standard way.
12765 \end_layout
12766
12767 \begin_layout Description
12768 \begin_inset Flex CharStyle:Code
12769 status collapsed
12770
12771 \begin_layout Plain Layout
12772 ListName
12773 \end_layout
12774
12775 \end_inset
12776
12777  [
12778 \begin_inset Flex CharStyle:Code
12779 status collapsed
12780
12781 \begin_layout Plain Layout
12782 string
12783 \end_layout
12784
12785 \end_inset
12786
12787 =
12788 \begin_inset Quotes erd
12789 \end_inset
12790
12791
12792 \begin_inset Quotes erd
12793 \end_inset
12794
12795 ] A title for a list of floats of this kind (list of figures, tables, or
12796  whatever).
12797  It is used for the screen label within LyX; it is passed to LaTeX for use
12798  as the title there; and it is used as the title in XHTML output.
12799  It will be translated to the document language.
12800 \end_layout
12801
12802 \begin_layout Description
12803 \begin_inset Flex CharStyle:Code
12804 status collapsed
12805
12806 \begin_layout Plain Layout
12807 NeedsFloatPkg
12808 \end_layout
12809
12810 \end_inset
12811
12812  [
12813 \begin_inset Flex CharStyle:Code
12814 status open
12815
12816 \begin_layout Plain Layout
12817 0
12818 \end_layout
12819
12820 \end_inset
12821
12822
12823 \begin_inset Flex CharStyle:Code
12824 status collapsed
12825
12826 \begin_layout Plain Layout
12827
12828 \emph on
12829 1
12830 \end_layout
12831
12832 \end_inset
12833
12834 ] Indicates whether the float is already defined in the document class or
12835  if we instead need to load 
12836 \begin_inset Flex CharStyle:Code
12837 status collapsed
12838
12839 \begin_layout Plain Layout
12840 float.sty
12841 \end_layout
12842
12843 \end_inset
12844
12845  and use what it provides.
12846  The default is 
12847 \begin_inset Flex CharStyle:Code
12848 status collapsed
12849
12850 \begin_layout Plain Layout
12851 1
12852 \end_layout
12853
12854 \end_inset
12855
12856 , which means: use 
12857 \begin_inset Flex CharStyle:Code
12858 status collapsed
12859
12860 \begin_layout Plain Layout
12861 float.sty
12862 \end_layout
12863
12864 \end_inset
12865
12866 .
12867  It should be set to 
12868 \begin_inset Flex CharStyle:Code
12869 status collapsed
12870
12871 \begin_layout Plain Layout
12872 0
12873 \end_layout
12874
12875 \end_inset
12876
12877  if the float is already defined by the LaTeX document class.
12878 \end_layout
12879
12880 \begin_layout Description
12881 \begin_inset Flex CharStyle:Code
12882 status collapsed
12883
12884 \begin_layout Plain Layout
12885 NumberWithin
12886 \end_layout
12887
12888 \end_inset
12889
12890  [
12891 \begin_inset Flex CharStyle:Code
12892 status collapsed
12893
12894 \begin_layout Plain Layout
12895 string
12896 \end_layout
12897
12898 \end_inset
12899
12900 =
12901 \begin_inset Quotes erd
12902 \end_inset
12903
12904
12905 \begin_inset Quotes erd
12906 \end_inset
12907
12908 ] This (optional) argument determines whether floats of this class will
12909  be numbered within some sectional unit of the document.
12910  For example, if within is equal to 
12911 \begin_inset Flex CharStyle:Code
12912 status collapsed
12913
12914 \begin_layout Plain Layout
12915 chapter
12916 \end_layout
12917
12918 \end_inset
12919
12920 , the floats will be numbered within chapters.
12921  
12922 \end_layout
12923
12924 \begin_layout Description
12925 \begin_inset Flex CharStyle:Code
12926 status collapsed
12927
12928 \begin_layout Plain Layout
12929 Placement
12930 \end_layout
12931
12932 \end_inset
12933
12934  [
12935 \begin_inset Flex CharStyle:Code
12936 status collapsed
12937
12938 \begin_layout Plain Layout
12939 string
12940 \end_layout
12941
12942 \end_inset
12943
12944 =
12945 \begin_inset Quotes erd
12946 \end_inset
12947
12948
12949 \begin_inset Quotes erd
12950 \end_inset
12951
12952 ] The default placement for the given class of floats.
12953  The string should be as in standard LaTeX: 
12954 \begin_inset Flex CharStyle:Code
12955 status collapsed
12956
12957 \begin_layout Plain Layout
12958 t
12959 \end_layout
12960
12961 \end_inset
12962
12963
12964 \begin_inset Flex CharStyle:Code
12965 status collapsed
12966
12967 \begin_layout Plain Layout
12968 b
12969 \end_layout
12970
12971 \end_inset
12972
12973
12974 \begin_inset Flex CharStyle:Code
12975 status collapsed
12976
12977 \begin_layout Plain Layout
12978 p
12979 \end_layout
12980
12981 \end_inset
12982
12983  and 
12984 \begin_inset Flex CharStyle:Code
12985 status collapsed
12986
12987 \begin_layout Plain Layout
12988 h
12989 \end_layout
12990
12991 \end_inset
12992
12993  for top, bottom, page, and here, respectively.
12994 \begin_inset Foot
12995 status collapsed
12996
12997 \begin_layout Plain Layout
12998 Note that the order of these letters in the string is irrelevant, like in
12999  LaTeX.
13000 \end_layout
13001
13002 \end_inset
13003
13004  On top of that there is a new type, 
13005 \begin_inset Flex CharStyle:Code
13006 status collapsed
13007
13008 \begin_layout Plain Layout
13009 H
13010 \end_layout
13011
13012 \end_inset
13013
13014 , which does not really correspond to a float, since it means: put it 
13015 \begin_inset Quotes eld
13016 \end_inset
13017
13018 here
13019 \begin_inset Quotes erd
13020 \end_inset
13021
13022  and nowhere else.
13023  Note however that the 
13024 \begin_inset Flex CharStyle:Code
13025 status collapsed
13026
13027 \begin_layout Plain Layout
13028 H
13029 \end_layout
13030
13031 \end_inset
13032
13033  specifier is special and, because of implementation details, cannot be
13034  used in non-built in float types.
13035  If you do not understand what this means, just use 
13036 \begin_inset Quotes eld
13037 \end_inset
13038
13039
13040 \begin_inset Flex CharStyle:Code
13041 status collapsed
13042
13043 \begin_layout Plain Layout
13044 tbp
13045 \end_layout
13046
13047 \end_inset
13048
13049
13050 \begin_inset Quotes erd
13051 \end_inset
13052
13053 .
13054 \end_layout
13055
13056 \begin_layout Description
13057 \begin_inset Flex CharStyle:Code
13058 status collapsed
13059
13060 \begin_layout Plain Layout
13061 RefPrefix
13062 \end_layout
13063
13064 \end_inset
13065
13066  [
13067 \begin_inset Flex CharStyle:Code
13068 status collapsed
13069
13070 \begin_layout Plain Layout
13071 string
13072 \end_layout
13073
13074 \end_inset
13075
13076 ] The prefix to use when creating labels referring to floats of this type.
13077  This allows the use of formatted references.
13078 \end_layout
13079
13080 \begin_layout Description
13081 \begin_inset Flex CharStyle:Code
13082 status collapsed
13083
13084 \begin_layout Plain Layout
13085 Style
13086 \end_layout
13087
13088 \end_inset
13089
13090  [
13091 \begin_inset Flex CharStyle:Code
13092 status collapsed
13093
13094 \begin_layout Plain Layout
13095 string
13096 \end_layout
13097
13098 \end_inset
13099
13100 =
13101 \begin_inset Quotes erd
13102 \end_inset
13103
13104
13105 \begin_inset Quotes erd
13106 \end_inset
13107
13108 ] The style used when defining the float using 
13109 \begin_inset Flex CharStyle:Code
13110 status collapsed
13111
13112 \begin_layout Plain Layout
13113
13114 \backslash
13115 newfloat
13116 \end_layout
13117
13118 \end_inset
13119
13120 .
13121 \end_layout
13122
13123 \begin_layout Description
13124 \begin_inset Flex CharStyle:Code
13125 status collapsed
13126
13127 \begin_layout Plain Layout
13128 Type
13129 \end_layout
13130
13131 \end_inset
13132
13133  [
13134 \begin_inset Flex CharStyle:Code
13135 status collapsed
13136
13137 \begin_layout Plain Layout
13138 string
13139 \end_layout
13140
13141 \end_inset
13142
13143 =
13144 \begin_inset Quotes erd
13145 \end_inset
13146
13147
13148 \begin_inset Quotes erd
13149 \end_inset
13150
13151 ] The 
13152 \begin_inset Quotes eld
13153 \end_inset
13154
13155 type
13156 \begin_inset Quotes erd
13157 \end_inset
13158
13159  of the new class of floats, like program or algorithm.
13160  After the appropriate 
13161 \begin_inset Flex CharStyle:Code
13162 status collapsed
13163
13164 \begin_layout Plain Layout
13165
13166 \backslash
13167 newfloat
13168 \end_layout
13169
13170 \end_inset
13171
13172 , commands such as 
13173 \begin_inset Flex CharStyle:Code
13174 status collapsed
13175
13176 \begin_layout Plain Layout
13177
13178 \backslash
13179 begin{program}
13180 \end_layout
13181
13182 \end_inset
13183
13184  or 
13185 \begin_inset Flex CharStyle:Code
13186 status collapsed
13187
13188 \begin_layout Plain Layout
13189
13190 \backslash
13191 end{algorithm*}
13192 \end_layout
13193
13194 \end_inset
13195
13196  will be available.
13197 \end_layout
13198
13199 \begin_layout Standard
13200 Note that defining a float with type 
13201 \begin_inset Flex CharStyle:Code
13202 status collapsed
13203
13204 \begin_layout Plain Layout
13205
13206 \emph on
13207 type
13208 \end_layout
13209
13210 \end_inset
13211
13212  automatically defines the corresponding counter with name 
13213 \begin_inset Flex CharStyle:Code
13214 status collapsed
13215
13216 \begin_layout Plain Layout
13217
13218 \emph on
13219 type
13220 \end_layout
13221
13222 \end_inset
13223
13224 .
13225 \end_layout
13226
13227 \begin_layout Subsection
13228 Flex insets and InsetLayout
13229 \begin_inset CommandInset label
13230 LatexCommand label
13231 name "sub:Flex-insets-and"
13232
13233 \end_inset
13234
13235
13236 \end_layout
13237
13238 \begin_layout Standard
13239 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13240  these are called Flex insets.
13241  
13242 \end_layout
13243
13244 \begin_layout Standard
13245 Flex insets come in three different kinds: 
13246 \end_layout
13247
13248 \begin_layout Itemize
13249 character style (
13250 \begin_inset Flex CharStyle:Code
13251 status collapsed
13252
13253 \begin_layout Plain Layout
13254 CharStyle
13255 \end_layout
13256
13257 \end_inset
13258
13259 ): These define semantic markup corresponding to such LaTeX commands as
13260  
13261 \begin_inset Flex CharStyle:Code
13262 status collapsed
13263
13264 \begin_layout Plain Layout
13265
13266 \backslash
13267 noun
13268 \end_layout
13269
13270 \end_inset
13271
13272  and 
13273 \begin_inset Flex CharStyle:Code
13274 status collapsed
13275
13276 \begin_layout Plain Layout
13277
13278 \backslash
13279 code
13280 \end_layout
13281
13282 \end_inset
13283
13284 .
13285 \end_layout
13286
13287 \begin_layout Itemize
13288 user custom (
13289 \begin_inset Flex CharStyle:Code
13290 status collapsed
13291
13292 \begin_layout Plain Layout
13293 Custom
13294 \end_layout
13295
13296 \end_inset
13297
13298 ): These can be used to define custom collapsible insets, similar to TeX
13299  code, footnote, and the like.
13300  An obvious example is an endnote inset, which is defined in the 
13301 \begin_inset Flex CharStyle:Code
13302 status collapsed
13303
13304 \begin_layout Plain Layout
13305 endnote
13306 \end_layout
13307
13308 \end_inset
13309
13310  module.
13311 \end_layout
13312
13313 \begin_layout Itemize
13314 XML elements (
13315 \begin_inset Flex CharStyle:Code
13316 status collapsed
13317
13318 \begin_layout Plain Layout
13319 Element
13320 \end_layout
13321
13322 \end_inset
13323
13324 ): For use with DocBook classes.
13325 \end_layout
13326
13327 \begin_layout Standard
13328 Flex insets are defined using the 
13329 \begin_inset Flex CharStyle:Code
13330 status collapsed
13331
13332 \begin_layout Plain Layout
13333 InsetLayout
13334 \end_layout
13335
13336 \end_inset
13337
13338  tag, which shall be explained in a moment.
13339 \end_layout
13340
13341 \begin_layout Standard
13342 The 
13343 \begin_inset Flex CharStyle:Code
13344 status collapsed
13345
13346 \begin_layout Plain Layout
13347 InsetLayout
13348 \end_layout
13349
13350 \end_inset
13351
13352  tag also serves another function: It can be used to customize the general
13353  layout of many different types of insets.
13354  Currently, 
13355 \begin_inset Flex CharStyle:Code
13356 status collapsed
13357
13358 \begin_layout Plain Layout
13359 InsetLayout
13360 \end_layout
13361
13362 \end_inset
13363
13364  can be used to customize the layout parameters for footnotes, marginal
13365  notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13366  boxes, tables, algorithms, URLs, and optional arguments, as well as to
13367  define Flex insets.
13368 \end_layout
13369
13370 \begin_layout Standard
13371 The 
13372 \begin_inset Flex CharStyle:Code
13373 status collapsed
13374
13375 \begin_layout Plain Layout
13376 InsetLayout
13377 \end_layout
13378
13379 \end_inset
13380
13381  definition must begin with a line of the form:
13382 \end_layout
13383
13384 \begin_layout LyX-Code
13385 InsetLayout <Type>
13386 \end_layout
13387
13388 \begin_layout Standard
13389 Here 
13390 \begin_inset Flex CharStyle:Code
13391 status collapsed
13392
13393 \begin_layout Plain Layout
13394 <Type>
13395 \end_layout
13396
13397 \end_inset
13398
13399  indicates the inset whose layout is being defined, and here there are two
13400  cases.
13401 \end_layout
13402
13403 \begin_layout Enumerate
13404 The layout for a pre-existing inset is being modified.
13405  In this case, can be 
13406 \begin_inset Flex CharStyle:Code
13407 status collapsed
13408
13409 \begin_layout Plain Layout
13410 <Type>
13411 \end_layout
13412
13413 \end_inset
13414
13415  any one of the following: 
13416 \begin_inset Flex CharStyle:Code
13417 status collapsed
13418
13419 \begin_layout Plain Layout
13420 Algorithm
13421 \end_layout
13422
13423 \end_inset
13424
13425
13426 \begin_inset Flex CharStyle:Code
13427 status collapsed
13428
13429 \begin_layout Plain Layout
13430 Branch
13431 \end_layout
13432
13433 \end_inset
13434
13435
13436 \begin_inset Flex CharStyle:Code
13437 status collapsed
13438
13439 \begin_layout Plain Layout
13440 Box
13441 \end_layout
13442
13443 \end_inset
13444
13445
13446 \begin_inset Flex CharStyle:Code
13447 status collapsed
13448
13449 \begin_layout Plain Layout
13450 Box:shaded
13451 \end_layout
13452
13453 \end_inset
13454
13455
13456 \begin_inset Flex CharStyle:Code
13457 status collapsed
13458
13459 \begin_layout Plain Layout
13460 ERT
13461 \end_layout
13462
13463 \end_inset
13464
13465
13466 \begin_inset Flex CharStyle:Code
13467 status collapsed
13468
13469 \begin_layout Plain Layout
13470 Figure
13471 \end_layout
13472
13473 \end_inset
13474
13475
13476 \begin_inset Flex CharStyle:Code
13477 status collapsed
13478
13479 \begin_layout Plain Layout
13480 Foot
13481 \end_layout
13482
13483 \end_inset
13484
13485
13486 \begin_inset Flex CharStyle:Code
13487 status collapsed
13488
13489 \begin_layout Plain Layout
13490 Index
13491 \end_layout
13492
13493 \end_inset
13494
13495
13496 \begin_inset Flex CharStyle:Code
13497 status collapsed
13498
13499 \begin_layout Plain Layout
13500 Info
13501 \end_layout
13502
13503 \end_inset
13504
13505
13506 \begin_inset Flex CharStyle:Code
13507 status collapsed
13508
13509 \begin_layout Plain Layout
13510 Info:menu
13511 \end_layout
13512
13513 \end_inset
13514
13515
13516 \begin_inset Flex CharStyle:Code
13517 status collapsed
13518
13519 \begin_layout Plain Layout
13520 Info:shortcut
13521 \end_layout
13522
13523 \end_inset
13524
13525
13526 \begin_inset Flex CharStyle:Code
13527 status collapsed
13528
13529 \begin_layout Plain Layout
13530 Info:shortcuts
13531 \end_layout
13532
13533 \end_inset
13534
13535
13536 \begin_inset Flex CharStyle:Code
13537 status collapsed
13538
13539 \begin_layout Plain Layout
13540 Listings
13541 \end_layout
13542
13543 \end_inset
13544
13545
13546 \begin_inset Flex CharStyle:Code
13547 status collapsed
13548
13549 \begin_layout Plain Layout
13550 Marginal
13551 \end_layout
13552
13553 \end_inset
13554
13555
13556 \begin_inset Flex CharStyle:Code
13557 status collapsed
13558
13559 \begin_layout Plain Layout
13560 Note:Comment
13561 \end_layout
13562
13563 \end_inset
13564
13565
13566 \begin_inset Flex CharStyle:Code
13567 status collapsed
13568
13569 \begin_layout Plain Layout
13570 Note:Note
13571 \end_layout
13572
13573 \end_inset
13574
13575
13576 \begin_inset Flex CharStyle:Code
13577 status collapsed
13578
13579 \begin_layout Plain Layout
13580 Note:GreyedOut
13581 \end_layout
13582
13583 \end_inset
13584
13585
13586 \begin_inset Flex CharStyle:Code
13587 status collapsed
13588
13589 \begin_layout Plain Layout
13590 OptArg
13591 \end_layout
13592
13593 \end_inset
13594
13595
13596 \begin_inset Flex CharStyle:Code
13597 status collapsed
13598
13599 \begin_layout Plain Layout
13600 Table
13601 \end_layout
13602
13603 \end_inset
13604
13605 , or 
13606 \begin_inset Flex CharStyle:Code
13607 status collapsed
13608
13609 \begin_layout Plain Layout
13610 URL
13611 \end_layout
13612
13613 \end_inset
13614
13615 .
13616 \end_layout
13617
13618 \begin_layout Enumerate
13619 The layout for a Flex inset is being defined.
13620  In this case, 
13621 \begin_inset Flex CharStyle:Code
13622 status collapsed
13623
13624 \begin_layout Plain Layout
13625 <Type>
13626 \end_layout
13627
13628 \end_inset
13629
13630  can be any valid identifier not used by a pre-existing inset.
13631  Note that the definition of a flex inset 
13632 \emph on
13633 must 
13634 \emph default
13635 also include a 
13636 \begin_inset Flex CharStyle:Code
13637 status collapsed
13638
13639 \begin_layout Plain Layout
13640 LyXType
13641 \end_layout
13642
13643 \end_inset
13644
13645  entry, declaring which type of inset this is.
13646 \end_layout
13647
13648 \begin_layout Standard
13649 The 
13650 \begin_inset Flex CharStyle:Code
13651 status collapsed
13652
13653 \begin_layout Plain Layout
13654 InsetLayout
13655 \end_layout
13656
13657 \end_inset
13658
13659  definition can contain the following entries:
13660 \end_layout
13661
13662 \begin_layout Description
13663 \begin_inset Flex CharStyle:Code
13664 status collapsed
13665
13666 \begin_layout Plain Layout
13667 BgColor
13668 \end_layout
13669
13670 \end_inset
13671
13672  The color for the inset's background.
13673  The valid colors are defined in 
13674 \begin_inset Flex CharStyle:Code
13675 status collapsed
13676
13677 \begin_layout Plain Layout
13678 src/ColorCode.h
13679 \end_layout
13680
13681 \end_inset
13682
13683 .
13684 \end_layout
13685
13686 \begin_layout Description
13687 \begin_inset Flex CharStyle:Code
13688 status collapsed
13689
13690 \begin_layout Plain Layout
13691 ContentAsLabel
13692 \end_layout
13693
13694 \end_inset
13695
13696  [
13697 \begin_inset Flex CharStyle:Code
13698 status collapsed
13699
13700 \begin_layout Plain Layout
13701
13702 \emph on
13703 0
13704 \end_layout
13705
13706 \end_inset
13707
13708 ,
13709 \begin_inset Flex CharStyle:Code
13710 status collapsed
13711
13712 \begin_layout Plain Layout
13713 1
13714 \end_layout
13715
13716 \end_inset
13717
13718 ] Whether to use the content of the inset as the label, when the inset is
13719  closed.
13720  Default is false.
13721 \end_layout
13722
13723 \begin_layout Description
13724 \begin_inset Flex CharStyle:Code
13725 status collapsed
13726
13727 \begin_layout Plain Layout
13728 CopyStyle
13729 \end_layout
13730
13731 \end_inset
13732
13733  As with paragraph styles (see page 
13734 \begin_inset CommandInset ref
13735 LatexCommand ref
13736 reference "des:CopyStyle"
13737
13738 \end_inset
13739
13740 ).
13741 \end_layout
13742
13743 \begin_layout Description
13744 \begin_inset Flex CharStyle:Code
13745 status collapsed
13746
13747 \begin_layout Plain Layout
13748 CustomPars
13749 \end_layout
13750
13751 \end_inset
13752
13753  [
13754 \begin_inset Flex CharStyle:Code
13755 status collapsed
13756
13757 \begin_layout Plain Layout
13758
13759 \emph on
13760 0
13761 \end_layout
13762
13763 \end_inset
13764
13765 ,
13766 \begin_inset Flex CharStyle:Code
13767 status collapsed
13768
13769 \begin_layout Plain Layout
13770 1
13771 \end_layout
13772
13773 \end_inset
13774
13775 ] Indicates whether the user may employ the Paragraph Settings dialog to
13776  customize the paragraph.
13777 \end_layout
13778
13779 \begin_layout Description
13780 \begin_inset Flex CharStyle:Code
13781 status collapsed
13782
13783 \begin_layout Plain Layout
13784 Decoration
13785 \end_layout
13786
13787 \end_inset
13788
13789  can be 
13790 \begin_inset Flex CharStyle:Code
13791 status collapsed
13792
13793 \begin_layout Plain Layout
13794 Classic
13795 \end_layout
13796
13797 \end_inset
13798
13799
13800 \begin_inset Flex CharStyle:Code
13801 status collapsed
13802
13803 \begin_layout Plain Layout
13804 Minimalistic
13805 \end_layout
13806
13807 \end_inset
13808
13809 , or 
13810 \begin_inset Flex CharStyle:Code
13811 status collapsed
13812
13813 \begin_layout Plain Layout
13814 Conglomerate
13815 \end_layout
13816
13817 \end_inset
13818
13819 , describing the rendering style used for the inset's frame and buttons.
13820  Footnotes generally use 
13821 \begin_inset Flex CharStyle:Code
13822 status collapsed
13823
13824 \begin_layout Plain Layout
13825 Classic
13826 \end_layout
13827
13828 \end_inset
13829
13830 , ERT insets generally 
13831 \begin_inset Flex CharStyle:Code
13832 status collapsed
13833
13834 \begin_layout Plain Layout
13835 Minimalistic
13836 \end_layout
13837
13838 \end_inset
13839
13840 , and character styles 
13841 \begin_inset Flex CharStyle:Code
13842 status collapsed
13843
13844 \begin_layout Plain Layout
13845 Conglomerate
13846 \end_layout
13847
13848 \end_inset
13849
13850 .
13851 \end_layout
13852
13853 \begin_layout Description
13854 \begin_inset Flex CharStyle:Code
13855 status collapsed
13856
13857 \begin_layout Plain Layout
13858 End
13859 \end_layout
13860
13861 \end_inset
13862
13863  Required at the end of the InsetLayout declarations.
13864 \end_layout
13865
13866 \begin_layout Description
13867 \begin_inset Flex CharStyle:Code
13868 status collapsed
13869
13870 \begin_layout Plain Layout
13871 Font
13872 \end_layout
13873
13874 \end_inset
13875
13876  The font used for both the text body 
13877 \emph on
13878 and
13879 \emph default
13880  the label.
13881  See section
13882 \begin_inset space ~
13883 \end_inset
13884
13885
13886 \begin_inset CommandInset ref
13887 LatexCommand ref
13888 reference "sub:Font-description"
13889
13890 \end_inset
13891
13892 .
13893  Note that defining this font automatically defines the 
13894 \begin_inset Flex CharStyle:Code
13895 status collapsed
13896
13897 \begin_layout Plain Layout
13898 LabelFont
13899 \end_layout
13900
13901 \end_inset
13902
13903  to the same value, so define this first and define 
13904 \begin_inset Flex CharStyle:Code
13905 status collapsed
13906
13907 \begin_layout Plain Layout
13908 LabelFont
13909 \end_layout
13910
13911 \end_inset
13912
13913  later if you want them to be different.
13914 \end_layout
13915
13916 \begin_layout Description
13917 \begin_inset Flex CharStyle:Code
13918 status collapsed
13919
13920 \begin_layout Plain Layout
13921 ForceLTR
13922 \end_layout
13923
13924 \end_inset
13925
13926  Force the 
13927 \begin_inset Quotes eld
13928 \end_inset
13929
13930 latex
13931 \begin_inset Quotes erd
13932 \end_inset
13933
13934  language, leading to Left-to-Right (latin) output, e.
13935 \begin_inset space \thinspace{}
13936 \end_inset
13937
13938 g.
13939 \begin_inset space \space{}
13940 \end_inset
13941
13942 in TeX code or URL.
13943  A kludge.
13944 \end_layout
13945
13946 \begin_layout Description
13947 \begin_inset Flex CharStyle:Code
13948 status collapsed
13949
13950 \begin_layout Plain Layout
13951 ForcePlain
13952 \end_layout
13953
13954 \end_inset
13955
13956  [
13957 \begin_inset Flex CharStyle:Code
13958 status collapsed
13959
13960 \begin_layout Plain Layout
13961
13962 \emph on
13963 0
13964 \end_layout
13965
13966 \end_inset
13967
13968 ,
13969 \begin_inset Flex CharStyle:Code
13970 status collapsed
13971
13972 \begin_layout Plain Layout
13973 1
13974 \end_layout
13975
13976 \end_inset
13977
13978 ] Indicates whether the PlainLayout should be used or, instead, the user
13979  can change the paragraph style used in the inset.
13980  Default is false.
13981 \end_layout
13982
13983 \begin_layout Description
13984 \begin_inset Flex CharStyle:Code
13985 status collapsed
13986
13987 \begin_layout Plain Layout
13988 FreeSpacing
13989 \end_layout
13990
13991 \end_inset
13992
13993  As with paragraph styles (see page 
13994 \begin_inset CommandInset ref
13995 LatexCommand pageref
13996 reference "des:FreeSpacing"
13997
13998 \end_inset
13999
14000 ).
14001  Default is false.
14002 \end_layout
14003
14004 \begin_layout Description
14005 \begin_inset Flex CharStyle:Code
14006 status collapsed
14007
14008 \begin_layout Plain Layout
14009 HTML*
14010 \end_layout
14011
14012 \end_inset
14013
14014  These tags control XHTML output.
14015  See 
14016 \end_layout
14017
14018 \begin_layout Description
14019 \begin_inset Flex CharStyle:Code
14020 status collapsed
14021
14022 \begin_layout Plain Layout
14023 InToc
14024 \end_layout
14025
14026 \end_inset
14027
14028  [
14029 \begin_inset Flex CharStyle:Code
14030 status collapsed
14031
14032 \begin_layout Plain Layout
14033
14034 \emph on
14035 0
14036 \end_layout
14037
14038 \end_inset
14039
14040 ,
14041 \begin_inset Flex CharStyle:Code
14042 status collapsed
14043
14044 \begin_layout Plain Layout
14045 1
14046 \end_layout
14047
14048 \end_inset
14049
14050 ] Whether to include the contents of this inset in the strings generated
14051  for the `Outline' pane.
14052  One would not, for example, want the content of a footnote in a section
14053  header to be included in the TOC displayed in the outline, but one would
14054  normally want the content of a character style displayed.
14055  Default is false: not to include.
14056 \end_layout
14057
14058 \begin_layout Description
14059 \begin_inset Flex CharStyle:Code
14060 status collapsed
14061
14062 \begin_layout Plain Layout
14063 KeepEmpty
14064 \end_layout
14065
14066 \end_inset
14067
14068  As with paragraph styles (see page 
14069 \begin_inset CommandInset ref
14070 LatexCommand pageref
14071 reference "des:KeepEmpty"
14072
14073 \end_inset
14074
14075 ).
14076  Default is false.
14077 \end_layout
14078
14079 \begin_layout Description
14080 \begin_inset Flex CharStyle:Code
14081 status collapsed
14082
14083 \begin_layout Plain Layout
14084 LabelFont
14085 \end_layout
14086
14087 \end_inset
14088
14089  The font used for the label.
14090  See section
14091 \begin_inset space ~
14092 \end_inset
14093
14094
14095 \begin_inset CommandInset ref
14096 LatexCommand ref
14097 reference "sub:Font-description"
14098
14099 \end_inset
14100
14101 .
14102  Note that this definition can never appear before 
14103 \begin_inset Flex CharStyle:Code
14104 status collapsed
14105
14106 \begin_layout Plain Layout
14107 Font
14108 \end_layout
14109
14110 \end_inset
14111
14112 , lest it be ineffective.
14113 \end_layout
14114
14115 \begin_layout Description
14116 \begin_inset Flex CharStyle:Code
14117 status collapsed
14118
14119 \begin_layout Plain Layout
14120 LabelString
14121 \end_layout
14122
14123 \end_inset
14124
14125  What will be displayed on the button or elsewhere as the inset label.
14126  Some inset types (TeX code and Branch) modify this label on the fly.
14127 \end_layout
14128
14129 \begin_layout Description
14130 \begin_inset Flex CharStyle:Code
14131 status collapsed
14132
14133 \begin_layout Plain Layout
14134 LatexName
14135 \end_layout
14136
14137 \end_inset
14138
14139  The name of the corresponding LaTeX stuff.
14140  Either the environment or command name.
14141 \end_layout
14142
14143 \begin_layout Description
14144 \begin_inset Flex CharStyle:Code
14145 status collapsed
14146
14147 \begin_layout Plain Layout
14148 LatexParam
14149 \end_layout
14150
14151 \end_inset
14152
14153  The optional parameter for the corresponding 
14154 \begin_inset Flex CharStyle:Code
14155 status collapsed
14156
14157 \begin_layout Plain Layout
14158 LatexName
14159 \end_layout
14160
14161 \end_inset
14162
14163  stuff, including possible bracket pairs like 
14164 \begin_inset Flex CharStyle:Code
14165 status collapsed
14166
14167 \begin_layout Plain Layout
14168 []
14169 \end_layout
14170
14171 \end_inset
14172
14173 .
14174  This parameter cannot be changed from within LyX.
14175 \end_layout
14176
14177 \begin_layout Description
14178 \begin_inset Flex CharStyle:Code
14179 status collapsed
14180
14181 \begin_layout Plain Layout
14182 LatexType
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:LatexType"
14191
14192 \end_inset
14193
14194 ).
14195 \end_layout
14196
14197 \begin_layout Description
14198 \begin_inset Flex CharStyle:Code
14199 status collapsed
14200
14201 \begin_layout Plain Layout
14202 LyxType
14203 \end_layout
14204
14205 \end_inset
14206
14207  Can be 
14208 \begin_inset Flex CharStyle:Code
14209 status collapsed
14210
14211 \begin_layout Plain Layout
14212 charstyle
14213 \end_layout
14214
14215 \end_inset
14216
14217
14218 \begin_inset Flex CharStyle:Code
14219 status collapsed
14220
14221 \begin_layout Plain Layout
14222 custom
14223 \end_layout
14224
14225 \end_inset
14226
14227
14228 \begin_inset Flex CharStyle:Code
14229 status collapsed
14230
14231 \begin_layout Plain Layout
14232 element
14233 \end_layout
14234
14235 \end_inset
14236
14237 , or 
14238 \begin_inset Flex CharStyle:Code
14239 status collapsed
14240
14241 \begin_layout Plain Layout
14242 end
14243 \end_layout
14244
14245 \end_inset
14246
14247  (indicating a dummy definition ending definitions of charstyles, etc).
14248  This entry is required in and is only meaningful for Flex insets.
14249  Among other things, it determines on which menu this inset will appear.
14250  Setting 
14251 \begin_inset Flex CharStyle:Code
14252 status collapsed
14253
14254 \begin_layout Plain Layout
14255 LyXType
14256 \end_layout
14257
14258 \end_inset
14259
14260  to 
14261 \begin_inset Flex CharStyle:Code
14262 status collapsed
14263
14264 \begin_layout Plain Layout
14265 charstyle
14266 \end_layout
14267
14268 \end_inset
14269
14270  will set 
14271 \begin_inset Flex CharStyle:Code
14272 status collapsed
14273
14274 \begin_layout Plain Layout
14275 MultiPar
14276 \end_layout
14277
14278 \end_inset
14279
14280  to false.
14281  
14282 \begin_inset Flex CharStyle:Code
14283 status collapsed
14284
14285 \begin_layout Plain Layout
14286 MultiPar
14287 \end_layout
14288
14289 \end_inset
14290
14291  can be set to true for charstyle insets, if you wish, by setting it 
14292 \emph on
14293 after
14294 \emph default
14295  you set the 
14296 \begin_inset Flex CharStyle:Code
14297 status collapsed
14298
14299 \begin_layout Plain Layout
14300 LyXType
14301 \end_layout
14302
14303 \end_inset
14304
14305 .
14306 \end_layout
14307
14308 \begin_layout Description
14309 \begin_inset Flex CharStyle:Code
14310 status collapsed
14311
14312 \begin_layout Plain Layout
14313 MultiPar
14314 \end_layout
14315
14316 \end_inset
14317
14318  [
14319 \begin_inset Flex CharStyle:Code
14320 status collapsed
14321
14322 \begin_layout Plain Layout
14323
14324 \emph on
14325 0
14326 \end_layout
14327
14328 \end_inset
14329
14330 ,
14331 \begin_inset Flex CharStyle:Code
14332 status collapsed
14333
14334 \begin_layout Plain Layout
14335 1
14336 \end_layout
14337
14338 \end_inset
14339
14340 ] Whether multiple paragraphs are permitted in this inset.
14341  This will also set 
14342 \begin_inset Flex CharStyle:Code
14343 status collapsed
14344
14345 \begin_layout Plain Layout
14346 CustomPars
14347 \end_layout
14348
14349 \end_inset
14350
14351  to the same value and 
14352 \begin_inset Flex CharStyle:Code
14353 status collapsed
14354
14355 \begin_layout Plain Layout
14356 ForcePlain
14357 \end_layout
14358
14359 \end_inset
14360
14361  to the opposite value.
14362  These can be reset to other values, if they are used 
14363 \emph on
14364 after
14365 \emph default
14366  
14367 \begin_inset Flex CharStyle:Code
14368 status collapsed
14369
14370 \begin_layout Plain Layout
14371 MultiPar
14372 \end_layout
14373
14374 \end_inset
14375
14376 .
14377  Default is true.
14378 \end_layout
14379
14380 \begin_layout Description
14381 \begin_inset Flex CharStyle:Code
14382 status collapsed
14383
14384 \begin_layout Plain Layout
14385 NeedProtect
14386 \end_layout
14387
14388 \end_inset
14389
14390  [
14391 \begin_inset Flex CharStyle:Code
14392 status collapsed
14393
14394 \begin_layout Plain Layout
14395
14396 \emph on
14397 0
14398 \end_layout
14399
14400 \end_inset
14401
14402 ,
14403 \begin_inset Flex CharStyle:Code
14404 status collapsed
14405
14406 \begin_layout Plain Layout
14407 1
14408 \end_layout
14409
14410 \end_inset
14411
14412 ] Whether fragile commands in this layout should be 
14413 \begin_inset Flex CharStyle:Code
14414 status collapsed
14415
14416 \begin_layout Plain Layout
14417
14418 \backslash
14419 protect
14420 \end_layout
14421
14422 \end_inset
14423
14424 'ed.
14425  (Note: This is 
14426 \emph on
14427 not
14428 \emph default
14429  whether the command should itself be protected.) Default is false.
14430 \end_layout
14431
14432 \begin_layout Description
14433 \begin_inset Flex CharStyle:Code
14434 status collapsed
14435
14436 \begin_layout Plain Layout
14437 PassThru
14438 \end_layout
14439
14440 \end_inset
14441
14442  [
14443 \begin_inset Flex CharStyle:Code
14444 status collapsed
14445
14446 \begin_layout Plain Layout
14447
14448 \emph on
14449 0
14450 \end_layout
14451
14452 \end_inset
14453
14454 ,
14455 \begin_inset Flex CharStyle:Code
14456 status collapsed
14457
14458 \begin_layout Plain Layout
14459 1
14460 \end_layout
14461
14462 \end_inset
14463
14464 ] As with paragraph styles (see page 
14465 \begin_inset CommandInset ref
14466 LatexCommand pageref
14467 reference "des:PathThru"
14468
14469 \end_inset
14470
14471 ).
14472  Default is false.
14473 \end_layout
14474
14475 \begin_layout Description
14476 \begin_inset Flex CharStyle:Code
14477 status collapsed
14478
14479 \begin_layout Plain Layout
14480 Preamble
14481 \end_layout
14482
14483 \end_inset
14484
14485  As with paragraph styles (see page 
14486 \begin_inset CommandInset ref
14487 LatexCommand pageref
14488 reference "des:Preamble"
14489
14490 \end_inset
14491
14492 ).
14493 \end_layout
14494
14495 \begin_layout Description
14496 \begin_inset Flex CharStyle:Code
14497 status collapsed
14498
14499 \begin_layout Plain Layout
14500 RefPrefix
14501 \end_layout
14502
14503 \end_inset
14504
14505  [
14506 \begin_inset Flex CharStyle:Code
14507 status collapsed
14508
14509 \begin_layout Plain Layout
14510 string
14511 \end_layout
14512
14513 \end_inset
14514
14515 ] The prefix to use when creating labels referring to insets of this type.
14516  This allows the use of formatted references.
14517 \end_layout
14518
14519 \begin_layout Description
14520 \begin_inset Flex CharStyle:Code
14521 status collapsed
14522
14523 \begin_layout Plain Layout
14524 Requires
14525 \end_layout
14526
14527 \end_inset
14528
14529  [
14530 \begin_inset Flex CharStyle:Code
14531 status collapsed
14532
14533 \begin_layout Plain Layout
14534 string
14535 \end_layout
14536
14537 \end_inset
14538
14539 ] As with paragraph styles (see page 
14540 \begin_inset CommandInset ref
14541 LatexCommand pageref
14542 reference "des:Requires"
14543
14544 \end_inset
14545
14546 ).
14547 \end_layout
14548
14549 \begin_layout Description
14550 \begin_inset Flex CharStyle:Code
14551 status collapsed
14552
14553 \begin_layout Plain Layout
14554 Spellcheck
14555 \end_layout
14556
14557 \end_inset
14558
14559  [
14560 \begin_inset Flex CharStyle:Code
14561 status collapsed
14562
14563 \begin_layout Plain Layout
14564 0
14565 \end_layout
14566
14567 \end_inset
14568
14569 ,
14570 \begin_inset Flex CharStyle:Code
14571 status collapsed
14572
14573 \begin_layout Plain Layout
14574
14575 \emph on
14576 1
14577 \end_layout
14578
14579 \end_inset
14580
14581 ] Spellcheck the contents of this inset.
14582  Default is true.
14583 \end_layout
14584
14585 \begin_layout Subsection
14586 Counters
14587 \begin_inset CommandInset label
14588 LatexCommand label
14589 name "sub:Counters"
14590
14591 \end_inset
14592
14593
14594 \end_layout
14595
14596 \begin_layout Standard
14597 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14598  counters (
14599 \begin_inset Flex CharStyle:MenuItem
14600 status collapsed
14601
14602 \begin_layout Plain Layout
14603 chapter
14604 \end_layout
14605
14606 \end_inset
14607
14608
14609 \begin_inset Flex CharStyle:MenuItem
14610 status collapsed
14611
14612 \begin_layout Plain Layout
14613 figure
14614 \end_layout
14615
14616 \end_inset
14617
14618 , \SpecialChar \ldots{}
14619 ) in the text class itself.
14620  The standard counters are defined in the file 
14621 \begin_inset Flex CharStyle:Code
14622 status collapsed
14623
14624 \begin_layout Plain Layout
14625 stdcounters.inc
14626 \end_layout
14627
14628 \end_inset
14629
14630 , so you may have to do no more than add
14631 \end_layout
14632
14633 \begin_layout LyX-Code
14634 Input stdcounters.inc
14635 \end_layout
14636
14637 \begin_layout Standard
14638 to your layout file to get them to work.
14639  But if you want to define custom counters, then you can do so.
14640  The counter declaration must begin with:
14641 \end_layout
14642
14643 \begin_layout LyX-Code
14644 Counter CounterName
14645 \end_layout
14646
14647 \begin_layout Standard
14648 where of course `
14649 \begin_inset Flex CharStyle:Code
14650 status collapsed
14651
14652 \begin_layout Plain Layout
14653 CounterName
14654 \end_layout
14655
14656 \end_inset
14657
14658 ' is replaced by the name of the counter.
14659  And it must end with 
14660 \begin_inset Quotes eld
14661 \end_inset
14662
14663
14664 \begin_inset Flex CharStyle:Code
14665 status collapsed
14666
14667 \begin_layout Plain Layout
14668 End
14669 \end_layout
14670
14671 \end_inset
14672
14673
14674 \begin_inset Quotes erd
14675 \end_inset
14676
14677 .
14678  The following parameters can also be used:
14679 \end_layout
14680
14681 \begin_layout Description
14682 \begin_inset Flex CharStyle:Code
14683 status collapsed
14684
14685 \begin_layout Plain Layout
14686 LabelString
14687 \end_layout
14688
14689 \end_inset
14690
14691  [
14692 \begin_inset Flex CharStyle:Code
14693 status collapsed
14694
14695 \begin_layout Plain Layout
14696 string
14697 \end_layout
14698
14699 \end_inset
14700
14701 =
14702 \begin_inset Quotes erd
14703 \end_inset
14704
14705
14706 \begin_inset Quotes erd
14707 \end_inset
14708
14709 ] When defined, this string defines how the counter is displayed.
14710  Setting this value sets 
14711 \begin_inset Flex CharStyle:Code
14712 status collapsed
14713
14714 \begin_layout Plain Layout
14715 LabelStringAppendix
14716 \end_layout
14717
14718 \end_inset
14719
14720  to the same value.
14721  The following special constructs can be used in the string:
14722 \end_layout
14723
14724 \begin_deeper
14725 \begin_layout Itemize
14726 \begin_inset Flex CharStyle:Code
14727 status collapsed
14728
14729 \begin_layout Plain Layout
14730
14731 \backslash
14732 thecounter
14733 \end_layout
14734
14735 \end_inset
14736
14737  will be replaced by the expansion of the 
14738 \begin_inset Flex CharStyle:Code
14739 status collapsed
14740
14741 \begin_layout Plain Layout
14742 LabelString
14743 \end_layout
14744
14745 \end_inset
14746
14747  (or 
14748 \begin_inset Flex CharStyle:Code
14749 status collapsed
14750
14751 \begin_layout Plain Layout
14752 LabelStringAppendix
14753 \end_layout
14754
14755 \end_inset
14756
14757 ) of the counter 
14758 \begin_inset Flex CharStyle:Code
14759 status collapsed
14760
14761 \begin_layout Plain Layout
14762 counter
14763 \end_layout
14764
14765 \end_inset
14766
14767 .
14768  
14769 \end_layout
14770
14771 \begin_layout Itemize
14772 counter values can be expressed using LaTeX-like macros 
14773 \begin_inset Flex CharStyle:Code
14774 status collapsed
14775
14776 \begin_layout Plain Layout
14777
14778 \backslash
14779
14780 \emph on
14781 numbertype
14782 \emph default
14783 {
14784 \emph on
14785 counter
14786 \emph default
14787 }
14788 \end_layout
14789
14790 \end_inset
14791
14792 , where 
14793 \begin_inset Flex CharStyle:Code
14794 status collapsed
14795
14796 \begin_layout Plain Layout
14797
14798 \emph on
14799 numbertype
14800 \end_layout
14801
14802 \end_inset
14803
14804  can be:
14805 \begin_inset Foot
14806 status collapsed
14807
14808 \begin_layout Plain Layout
14809
14810 \family roman
14811 \series medium
14812 \shape up
14813 \size normal
14814 \emph off
14815 \bar no
14816 \noun off
14817 \color none
14818 Actually, the situation is a bit more complicated: any
14819 \family default
14820 \series default
14821 \shape default
14822 \emph default
14823 \bar default
14824  
14825 \size default
14826 \emph on
14827 \noun default
14828 \color inherit
14829 numbertype
14830 \family roman
14831 \series medium
14832 \shape up
14833 \size normal
14834 \emph off
14835 \bar no
14836 \noun off
14837  other than those described below will produce arabic numerals.
14838  It would not be surprising to see this change in the future.
14839 \end_layout
14840
14841 \end_inset
14842
14843  
14844 \begin_inset Flex CharStyle:Code
14845 status collapsed
14846
14847 \begin_layout Plain Layout
14848 arabic
14849 \end_layout
14850
14851 \end_inset
14852
14853 : 1, 2, 3,\SpecialChar \ldots{}
14854
14855 \begin_inset Flex CharStyle:Code
14856 status collapsed
14857
14858 \begin_layout Plain Layout
14859 alph
14860 \end_layout
14861
14862 \end_inset
14863
14864  for lower-case letters: a, b, c, \SpecialChar \ldots{}
14865
14866 \begin_inset Flex CharStyle:Code
14867 status collapsed
14868
14869 \begin_layout Plain Layout
14870 Alph
14871 \end_layout
14872
14873 \end_inset
14874
14875  for upper-case letters: A, B, C, \SpecialChar \ldots{}
14876
14877 \begin_inset Flex CharStyle:Code
14878 status collapsed
14879
14880 \begin_layout Plain Layout
14881 roman
14882 \end_layout
14883
14884 \end_inset
14885
14886  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
14887
14888 \begin_inset Flex CharStyle:Code
14889 status collapsed
14890
14891 \begin_layout Plain Layout
14892 Roman
14893 \end_layout
14894
14895 \end_inset
14896
14897  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
14898
14899 \begin_inset Flex CharStyle:Code
14900 status collapsed
14901
14902 \begin_layout Plain Layout
14903 hebrew
14904 \end_layout
14905
14906 \end_inset
14907
14908  for hebrew numerals.
14909 \end_layout
14910
14911 \end_deeper
14912 \begin_layout Standard
14913 If LabelString is not defined, a default value is constructed as follows:
14914  if the counter has a master counter 
14915 \begin_inset Flex CharStyle:Code
14916 status collapsed
14917
14918 \begin_layout Plain Layout
14919 master
14920 \end_layout
14921
14922 \end_inset
14923
14924  (defined via 
14925 \begin_inset Flex CharStyle:Code
14926 status collapsed
14927
14928 \begin_layout Plain Layout
14929 Within
14930 \end_layout
14931
14932 \end_inset
14933
14934 ), the string 
14935 \begin_inset Flex CharStyle:Code
14936 status collapsed
14937
14938 \begin_layout Plain Layout
14939
14940 \backslash
14941 themaster.
14942 \backslash
14943 arabic{counter}
14944 \end_layout
14945
14946 \end_inset
14947
14948  is used; otherwise the string 
14949 \begin_inset Flex CharStyle:Code
14950 status collapsed
14951
14952 \begin_layout Plain Layout
14953
14954 \backslash
14955 arabic{counter}
14956 \end_layout
14957
14958 \end_inset
14959
14960  is used.
14961 \end_layout
14962
14963 \begin_layout Description
14964 \begin_inset Flex CharStyle:Code
14965 status collapsed
14966
14967 \begin_layout Plain Layout
14968 LabelStringAppendix
14969 \end_layout
14970
14971 \end_inset
14972
14973  [
14974 \begin_inset Flex CharStyle:Code
14975 status collapsed
14976
14977 \begin_layout Plain Layout
14978 string
14979 \end_layout
14980
14981 \end_inset
14982
14983 =
14984 \begin_inset Quotes erd
14985 \end_inset
14986
14987
14988 \begin_inset Quotes erd
14989 \end_inset
14990
14991 ] Same as 
14992 \begin_inset Flex CharStyle:Code
14993 status collapsed
14994
14995 \begin_layout Plain Layout
14996 LabelString
14997 \end_layout
14998
14999 \end_inset
15000
15001 , but for use in the Appendix.
15002 \end_layout
15003
15004 \begin_layout Description
15005 \begin_inset Flex CharStyle:Code
15006 status collapsed
15007
15008 \begin_layout Plain Layout
15009 PrettyFormat
15010 \end_layout
15011
15012 \end_inset
15013
15014  [
15015 \begin_inset Flex CharStyle:Code
15016 status collapsed
15017
15018 \begin_layout Plain Layout
15019 string
15020 \end_layout
15021
15022 \end_inset
15023
15024 =
15025 \begin_inset Quotes erd
15026 \end_inset
15027
15028
15029 \begin_inset Quotes erd
15030 \end_inset
15031
15032 ] A format for use with formatted references to this counter.
15033  For example, one might want to have references to section numbers appear
15034  as 
15035 \begin_inset Quotes eld
15036 \end_inset
15037
15038 Section 2.4
15039 \begin_inset Quotes erd
15040 \end_inset
15041
15042 .
15043  The string should contain 
15044 \begin_inset Quotes eld
15045 \end_inset
15046
15047 ##
15048 \begin_inset Quotes erd
15049 \end_inset
15050
15051 .
15052  This will be replaced by the counter number itself.
15053  So, for sections, it would be: Section ##.
15054 \end_layout
15055
15056 \begin_layout Description
15057 \begin_inset Flex CharStyle:Code
15058 status collapsed
15059
15060 \begin_layout Plain Layout
15061 Within
15062 \end_layout
15063
15064 \end_inset
15065
15066  [
15067 \begin_inset Flex CharStyle:Code
15068 status collapsed
15069
15070 \begin_layout Plain Layout
15071 string
15072 \end_layout
15073
15074 \end_inset
15075
15076 =
15077 \begin_inset Quotes erd
15078 \end_inset
15079
15080
15081 \begin_inset Quotes erd
15082 \end_inset
15083
15084 ] If this is set to the name of another counter, the present counter will
15085  be reset every time the other one is increased.
15086  For example, 
15087 \begin_inset Flex CharStyle:Code
15088 status collapsed
15089
15090 \begin_layout Plain Layout
15091 subsection
15092 \end_layout
15093
15094 \end_inset
15095
15096  is numbered inside 
15097 \begin_inset Flex CharStyle:Code
15098 status collapsed
15099
15100 \begin_layout Plain Layout
15101 section
15102 \end_layout
15103
15104 \end_inset
15105
15106 .
15107 \end_layout
15108
15109 \begin_layout Subsection
15110 Font description
15111 \begin_inset CommandInset label
15112 LatexCommand label
15113 name "sub:Font-description"
15114
15115 \end_inset
15116
15117
15118 \end_layout
15119
15120 \begin_layout Standard
15121 A font description looks like this:
15122 \end_layout
15123
15124 \begin_layout LyX-Code
15125 Font 
15126 \family roman
15127 \emph on
15128 or
15129 \family default
15130 \emph default
15131  LabelFont
15132 \end_layout
15133
15134 \begin_layout LyX-Code
15135  ...
15136 \end_layout
15137
15138 \begin_layout LyX-Code
15139 EndFont
15140 \end_layout
15141
15142 \begin_layout Standard
15143 The following commands are available:
15144 \end_layout
15145
15146 \begin_layout Description
15147 \begin_inset Flex CharStyle:Code
15148 status collapsed
15149
15150 \begin_layout Plain Layout
15151 Color
15152 \end_layout
15153
15154 \end_inset
15155
15156  [
15157 \begin_inset Flex CharStyle:Code
15158 status collapsed
15159
15160 \begin_layout Plain Layout
15161
15162 \emph on
15163 none
15164 \end_layout
15165
15166 \end_inset
15167
15168
15169 \begin_inset Flex CharStyle:Code
15170 status collapsed
15171
15172 \begin_layout Plain Layout
15173 black
15174 \end_layout
15175
15176 \end_inset
15177
15178
15179 \begin_inset Flex CharStyle:Code
15180 status collapsed
15181
15182 \begin_layout Plain Layout
15183 white
15184 \end_layout
15185
15186 \end_inset
15187
15188
15189 \begin_inset Flex CharStyle:Code
15190 status collapsed
15191
15192 \begin_layout Plain Layout
15193 red
15194 \end_layout
15195
15196 \end_inset
15197
15198
15199 \begin_inset Flex CharStyle:Code
15200 status collapsed
15201
15202 \begin_layout Plain Layout
15203 green
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 blue
15214 \end_layout
15215
15216 \end_inset
15217
15218
15219 \begin_inset Flex CharStyle:Code
15220 status collapsed
15221
15222 \begin_layout Plain Layout
15223 cyan
15224 \end_layout
15225
15226 \end_inset
15227
15228
15229 \begin_inset Flex CharStyle:Code
15230 status collapsed
15231
15232 \begin_layout Plain Layout
15233 magenta
15234 \end_layout
15235
15236 \end_inset
15237
15238
15239 \begin_inset Flex CharStyle:Code
15240 status collapsed
15241
15242 \begin_layout Plain Layout
15243 yellow
15244 \end_layout
15245
15246 \end_inset
15247
15248 ]
15249 \end_layout
15250
15251 \begin_layout Description
15252 \begin_inset Flex CharStyle:Code
15253 status collapsed
15254
15255 \begin_layout Plain Layout
15256 Family
15257 \end_layout
15258
15259 \end_inset
15260
15261  [
15262 \begin_inset Flex CharStyle:Code
15263 status collapsed
15264
15265 \begin_layout Plain Layout
15266
15267 \emph on
15268 Roman
15269 \end_layout
15270
15271 \end_inset
15272
15273
15274 \begin_inset Flex CharStyle:Code
15275 status collapsed
15276
15277 \begin_layout Plain Layout
15278 Sans
15279 \end_layout
15280
15281 \end_inset
15282
15283
15284 \begin_inset Flex CharStyle:Code
15285 status collapsed
15286
15287 \begin_layout Plain Layout
15288 Typewriter
15289 \end_layout
15290
15291 \end_inset
15292
15293
15294 \end_layout
15295
15296 \begin_layout Description
15297 \begin_inset Flex CharStyle:Code
15298 status collapsed
15299
15300 \begin_layout Plain Layout
15301 Misc
15302 \end_layout
15303
15304 \end_inset
15305
15306  [
15307 \begin_inset Flex CharStyle:Code
15308 status collapsed
15309
15310 \begin_layout Plain Layout
15311 string
15312 \end_layout
15313
15314 \end_inset
15315
15316 ] Valid arguments are: 
15317 \begin_inset Flex CharStyle:Code
15318 status collapsed
15319
15320 \begin_layout Plain Layout
15321 emph
15322 \end_layout
15323
15324 \end_inset
15325
15326
15327 \begin_inset Flex CharStyle:Code
15328 status collapsed
15329
15330 \begin_layout Plain Layout
15331 noun
15332 \end_layout
15333
15334 \end_inset
15335
15336
15337 \begin_inset Flex CharStyle:Code
15338 status collapsed
15339
15340 \begin_layout Plain Layout
15341 underbar
15342 \end_layout
15343
15344 \end_inset
15345
15346
15347 \begin_inset Flex CharStyle:Code
15348 status collapsed
15349
15350 \begin_layout Plain Layout
15351 no_emph
15352 \end_layout
15353
15354 \end_inset
15355
15356
15357 \begin_inset Flex CharStyle:Code
15358 status collapsed
15359
15360 \begin_layout Plain Layout
15361 no_noun
15362 \end_layout
15363
15364 \end_inset
15365
15366  and 
15367 \begin_inset Flex CharStyle:Code
15368 status collapsed
15369
15370 \begin_layout Plain Layout
15371 no_bar
15372 \end_layout
15373
15374 \end_inset
15375
15376 .
15377  Each of these turns on or off the corresponding attribute.
15378  For example, 
15379 \begin_inset Flex CharStyle:Code
15380 status collapsed
15381
15382 \begin_layout Plain Layout
15383 emph
15384 \end_layout
15385
15386 \end_inset
15387
15388  turns on emphasis, and 
15389 \begin_inset Flex CharStyle:Code
15390 status collapsed
15391
15392 \begin_layout Plain Layout
15393 no_emph
15394 \end_layout
15395
15396 \end_inset
15397
15398  turns it off.
15399  
15400 \begin_inset Newline newline
15401 \end_inset
15402
15403 If the latter seems puzzling, remember that the font settings for the present
15404  context are generally inherited from the surrounding context.
15405  So 
15406 \begin_inset Flex CharStyle:Code
15407 status collapsed
15408
15409 \begin_layout Plain Layout
15410 no_emph
15411 \end_layout
15412
15413 \end_inset
15414
15415  would turn off the emphasis that was anyway in effect, say, in a theorem
15416  environment.
15417 \end_layout
15418
15419 \begin_layout Description
15420 \begin_inset Flex CharStyle:Code
15421 status collapsed
15422
15423 \begin_layout Plain Layout
15424 Series
15425 \end_layout
15426
15427 \end_inset
15428
15429  [
15430 \begin_inset Flex CharStyle:Code
15431 status collapsed
15432
15433 \begin_layout Plain Layout
15434
15435 \emph on
15436 Medium
15437 \end_layout
15438
15439 \end_inset
15440
15441
15442 \begin_inset Flex CharStyle:Code
15443 status collapsed
15444
15445 \begin_layout Plain Layout
15446 Bold
15447 \end_layout
15448
15449 \end_inset
15450
15451
15452 \end_layout
15453
15454 \begin_layout Description
15455 \begin_inset Flex CharStyle:Code
15456 status collapsed
15457
15458 \begin_layout Plain Layout
15459 Shape
15460 \end_layout
15461
15462 \end_inset
15463
15464  [
15465 \begin_inset Flex CharStyle:Code
15466 status collapsed
15467
15468 \begin_layout Plain Layout
15469
15470 \emph on
15471 Up
15472 \end_layout
15473
15474 \end_inset
15475
15476
15477 \begin_inset Flex CharStyle:Code
15478 status collapsed
15479
15480 \begin_layout Plain Layout
15481 Italic
15482 \end_layout
15483
15484 \end_inset
15485
15486
15487 \begin_inset Flex CharStyle:Code
15488 status collapsed
15489
15490 \begin_layout Plain Layout
15491 SmallCaps
15492 \end_layout
15493
15494 \end_inset
15495
15496
15497 \begin_inset Flex CharStyle:Code
15498 status collapsed
15499
15500 \begin_layout Plain Layout
15501 Slanted
15502 \end_layout
15503
15504 \end_inset
15505
15506
15507 \end_layout
15508
15509 \begin_layout Description
15510 \begin_inset Flex CharStyle:Code
15511 status collapsed
15512
15513 \begin_layout Plain Layout
15514 Size
15515 \end_layout
15516
15517 \end_inset
15518
15519  [
15520 \begin_inset Flex CharStyle:Code
15521 status collapsed
15522
15523 \begin_layout Plain Layout
15524 tiny
15525 \end_layout
15526
15527 \end_inset
15528
15529
15530 \begin_inset Flex CharStyle:Code
15531 status collapsed
15532
15533 \begin_layout Plain Layout
15534 small
15535 \end_layout
15536
15537 \end_inset
15538
15539
15540 \begin_inset Flex CharStyle:Code
15541 status collapsed
15542
15543 \begin_layout Plain Layout
15544
15545 \emph on
15546 normal
15547 \end_layout
15548
15549 \end_inset
15550
15551
15552 \begin_inset Flex CharStyle:Code
15553 status collapsed
15554
15555 \begin_layout Plain Layout
15556 large
15557 \end_layout
15558
15559 \end_inset
15560
15561
15562 \begin_inset Flex CharStyle:Code
15563 status collapsed
15564
15565 \begin_layout Plain Layout
15566 larger
15567 \end_layout
15568
15569 \end_inset
15570
15571
15572 \begin_inset Flex CharStyle:Code
15573 status collapsed
15574
15575 \begin_layout Plain Layout
15576 largest
15577 \end_layout
15578
15579 \end_inset
15580
15581
15582 \begin_inset Flex CharStyle:Code
15583 status collapsed
15584
15585 \begin_layout Plain Layout
15586 huge
15587 \end_layout
15588
15589 \end_inset
15590
15591
15592 \begin_inset Flex CharStyle:Code
15593 status collapsed
15594
15595 \begin_layout Plain Layout
15596 giant
15597 \end_layout
15598
15599 \end_inset
15600
15601 ]
15602 \end_layout
15603
15604 \begin_layout Subsection
15605 \begin_inset CommandInset label
15606 LatexCommand label
15607 name "sub:Citation-format-description"
15608
15609 \end_inset
15610
15611 Citation format description
15612 \end_layout
15613
15614 \begin_layout Standard
15615 The 
15616 \begin_inset Flex CharStyle:Code
15617 status collapsed
15618
15619 \begin_layout Plain Layout
15620 CiteFormat
15621 \end_layout
15622
15623 \end_inset
15624
15625  blocks are used to describe how bibliographic information should be displayed,
15626  both within LyX itself (in the citation dialog and in tooltips, for example)
15627  and in XHTML output.
15628  Such a block might look like this:
15629 \end_layout
15630
15631 \begin_layout LyX-Code
15632 CiteFormat
15633 \end_layout
15634
15635 \begin_layout LyX-Code
15636  article ...
15637 \end_layout
15638
15639 \begin_layout LyX-Code
15640  book ...
15641 \end_layout
15642
15643 \begin_layout LyX-Code
15644 End
15645 \end_layout
15646
15647 \begin_layout Standard
15648 The individual lines define how the bibliographic information associated
15649  with an article or book, respectively, is to be displayed, and such a definitio
15650 n can be given for any `entry type' that might be present in a BibTeX file.
15651  LyX defines a default format in the source code that will be used if no
15652  specific definition has been given.
15653  LyX predefines several formats in the file 
15654 \begin_inset Flex CharStyle:Code
15655 status collapsed
15656
15657 \begin_layout Plain Layout
15658 stdciteformats.inc
15659 \end_layout
15660
15661 \end_inset
15662
15663 , which is included in most of LyX's document classes.
15664 \end_layout
15665
15666 \begin_layout Standard
15667 The definitions use a simple language that allows BibTeX keys to be replaced
15668  with their values.
15669  Keys should be enclosed in % signs, e.g.: 
15670 \begin_inset Flex CharStyle:Code
15671 status collapsed
15672
15673 \begin_layout Plain Layout
15674 %author%
15675 \end_layout
15676
15677 \end_inset
15678
15679 .
15680  So a simple definition might look like this:
15681 \end_layout
15682
15683 \begin_layout LyX-Code
15684 misc %author%, 
15685 \begin_inset Quotes eld
15686 \end_inset
15687
15688 %title
15689 \begin_inset Quotes erd
15690 \end_inset
15691
15692 .
15693 \end_layout
15694
15695 \begin_layout Standard
15696 This would print the author, followed by a comma, followed by the title,
15697  in quotes, followed by a period.
15698 \end_layout
15699
15700 \begin_layout Standard
15701 Of course, sometimes you may want to print a key only if it exists.
15702  This can be done by using a conditional construction, such as: 
15703 \begin_inset Flex CharStyle:Code
15704 status collapsed
15705
15706 \begin_layout Plain Layout
15707 {%volume%[[vol.
15708 \begin_inset space ~
15709 \end_inset
15710
15711 %volume%]]}
15712 \end_layout
15713
15714 \end_inset
15715
15716 .
15717  This says: If the 
15718 \begin_inset Flex CharStyle:Code
15719 status collapsed
15720
15721 \begin_layout Plain Layout
15722 volume
15723 \end_layout
15724
15725 \end_inset
15726
15727  key exists, then print 
15728 \begin_inset Quotes eld
15729 \end_inset
15730
15731 vol.
15732 \begin_inset space ~
15733 \end_inset
15734
15735
15736 \begin_inset Quotes erd
15737 \end_inset
15738
15739  followed by the volume key.
15740  It is also possible to have an else clause in the conditional, such as:
15741  
15742 \begin_inset Flex CharStyle:Code
15743 status collapsed
15744
15745 \begin_layout Plain Layout
15746 {%author%[[%author%]][[%editor%, ed.]]}
15747 \end_layout
15748
15749 \end_inset
15750
15751 .
15752  Here, the 
15753 \begin_inset Flex CharStyle:Code
15754 status collapsed
15755
15756 \begin_layout Plain Layout
15757 author
15758 \end_layout
15759
15760 \end_inset
15761
15762  key is printed if it exists; otherwise, the editor key is printed, followed
15763  by 
15764 \begin_inset Quotes eld
15765 \end_inset
15766
15767 ,
15768 \begin_inset space ~
15769 \end_inset
15770
15771 ed.
15772 \begin_inset Quotes erd
15773 \end_inset
15774
15775  Note that the key is again enclosed in % signs; the entire conditional
15776  is enclosed in braces; and the if and else clauses are enclosed in double
15777  brackets, 
15778 \begin_inset Quotes eld
15779 \end_inset
15780
15781 [[
15782 \begin_inset Quotes eld
15783 \end_inset
15784
15785  and 
15786 \begin_inset Quotes eld
15787 \end_inset
15788
15789 ]]
15790 \begin_inset Quotes erd
15791 \end_inset
15792
15793 .
15794  There must be no space between any of these.
15795 \end_layout
15796
15797 \begin_layout Standard
15798 There is one other piece of syntax available in definitions, which looks
15799  like this: 
15800 \begin_inset Flex CharStyle:Code
15801 status collapsed
15802
15803 \begin_layout Plain Layout
15804 {!<i>!}
15805 \end_layout
15806
15807 \end_inset
15808
15809 .
15810  This defines a piece of formatting information that is to be used when
15811  creating 
15812 \begin_inset Quotes eld
15813 \end_inset
15814
15815 rich text
15816 \begin_inset Quotes erd
15817 \end_inset
15818
15819 .
15820  Obviously, we do not want to output HTML tags when writing plain text,
15821  so they should be wrapped in 
15822 \begin_inset Quotes eld
15823 \end_inset
15824
15825 {!
15826 \begin_inset Quotes erd
15827 \end_inset
15828
15829  and 
15830 \begin_inset Quotes eld
15831 \end_inset
15832
15833 !}
15834 \begin_inset Quotes erd
15835 \end_inset
15836
15837 .
15838 \end_layout
15839
15840 \begin_layout Standard
15841 Two special sorts of definitions are also possible in a 
15842 \begin_inset Flex CharStyle:Code
15843 status collapsed
15844
15845 \begin_layout Plain Layout
15846 CiteFormat
15847 \end_layout
15848
15849 \end_inset
15850
15851  block.
15852  An example of the first would be:
15853 \end_layout
15854
15855 \begin_layout LyX-Code
15856 !quotetitle 
15857 \begin_inset Quotes eld
15858 \end_inset
15859
15860 %title%
15861 \begin_inset Quotes erd
15862 \end_inset
15863
15864
15865 \end_layout
15866
15867 \begin_layout Standard
15868 This is an abbreviation, or macro, and it can be used by treating it as
15869  if it were a key: 
15870 \begin_inset Flex CharStyle:Code
15871 status collapsed
15872
15873 \begin_layout Plain Layout
15874 %!quotetitle%
15875 \end_layout
15876
15877 \end_inset
15878
15879 .
15880  LyX will treat 
15881 \begin_inset Flex CharStyle:Code
15882 status collapsed
15883
15884 \begin_layout Plain Layout
15885 %!quotetitle%
15886 \end_layout
15887
15888 \end_inset
15889
15890  exactly as it would treat its definition.
15891  So, let us issue the obvious 
15892 \emph on
15893 warning
15894 \emph default
15895 .
15896  Do not do this:
15897 \end_layout
15898
15899 \begin_layout LyX-Code
15900 !funfun %funfun%
15901 \end_layout
15902
15903 \begin_layout Standard
15904 or anything like it.
15905  LyX shouldn't go into an infinite loop, but it may go into a long one before
15906  it gives up.
15907 \end_layout
15908
15909 \begin_layout Standard
15910 The second sort of special definition might look like this:
15911 \end_layout
15912
15913 \begin_layout LyX-Code
15914 _pptext pp.
15915 \end_layout
15916
15917 \begin_layout Standard
15918 This defines a translatable piece of text, which allows relevant parts of
15919  the bibliography to be translated.
15920  It can be included in a definition by treating it as a key: 
15921 \begin_inset Flex CharStyle:Code
15922 status collapsed
15923
15924 \begin_layout Plain Layout
15925 %_pptext%
15926 \end_layout
15927
15928 \end_inset
15929
15930 .
15931  Several of these are predefined in 
15932 \begin_inset Flex CharStyle:Code
15933 status collapsed
15934
15935 \begin_layout Plain Layout
15936 stdciteformats.inc
15937 \end_layout
15938
15939 \end_inset
15940
15941 .
15942  Note that these are not macros, in the sense just defined.
15943  They will not be expanded.
15944 \end_layout
15945
15946 \begin_layout Standard
15947 So here then is an example that use all these features:
15948 \end_layout
15949
15950 \begin_layout LyX-Code
15951 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
15952 \end_layout
15953
15954 \begin_layout Standard
15955 The defines a macro that prints the author, followed by a comma, if the
15956  
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 defined, or else prints the name of the editor, followed by the
15967  
15968 \begin_inset Flex CharStyle:Code
15969 status collapsed
15970
15971 \begin_layout Plain Layout
15972 _edtext
15973 \end_layout
15974
15975 \end_inset
15976
15977  or its translation (it is by default 
15978 \begin_inset Quotes eld
15979 \end_inset
15980
15981 ed.
15982 \begin_inset Quotes erd
15983 \end_inset
15984
15985 ), if the 
15986 \begin_inset Flex CharStyle:Code
15987 status collapsed
15988
15989 \begin_layout Plain Layout
15990 editor
15991 \end_layout
15992
15993 \end_inset
15994
15995  key is defined.
15996  Note that this is in fact defined in 
15997 \begin_inset Flex CharStyle:Code
15998 status collapsed
15999
16000 \begin_layout Plain Layout
16001 stdciteformats.inc
16002 \end_layout
16003
16004 \end_inset
16005
16006 , so you can use it in your own definitions, or re-definitions, if you load
16007  that file first.
16008 \end_layout
16009
16010 \begin_layout Section
16011 \begin_inset CommandInset label
16012 LatexCommand label
16013 name "sec:Tags-for-XHTML"
16014
16015 \end_inset
16016
16017 Tags for XHTML output
16018 \end_layout
16019
16020 \begin_layout Standard
16021 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16022  by layout information.
16023  In general, LyX provides sensible defaults and, as mentioned earlier, it
16024  will even construct default CSS style rules from the other layout tags.
16025  For example, LyX will attempt to use the information provided in the 
16026 \begin_inset Flex CharStyle:Code
16027 status collapsed
16028
16029 \begin_layout Plain Layout
16030 Font
16031 \end_layout
16032
16033 \end_inset
16034
16035  declaration for the Chapter style to write CSS that will appropriately
16036  format chapter headings.
16037 \end_layout
16038
16039 \begin_layout Standard
16040 In many cases, then, you may not have to do anything at all to get acceptable
16041  XHTML output for your own environments, custom insets, and so forth.
16042  But in some cases you will, and so LyX provides a number of layout tags
16043  that can be used to customize the XHTML and CSS that are generated.
16044 \end_layout
16045
16046 \begin_layout Standard
16047 Note that there are two tags, 
16048 \begin_inset Flex CharStyle:Code
16049 status collapsed
16050
16051 \begin_layout Plain Layout
16052 HTMLPreamble
16053 \end_layout
16054
16055 \end_inset
16056
16057  and 
16058 \begin_inset Flex CharStyle:Code
16059 status collapsed
16060
16061 \begin_layout Plain Layout
16062 AddToHTMLPreamble
16063 \end_layout
16064
16065 \end_inset
16066
16067  that may appear outside style and inset declarations.
16068  See 
16069 \begin_inset CommandInset ref
16070 LatexCommand prettyref
16071 reference "sub:General-text-class"
16072
16073 \end_inset
16074
16075  for details on these.
16076 \end_layout
16077
16078 \begin_layout Subsection
16079 \begin_inset CommandInset label
16080 LatexCommand label
16081 name "sub:Paragraph-Style-XHTML"
16082
16083 \end_inset
16084
16085 Paragraph styles
16086 \end_layout
16087
16088 \begin_layout Standard
16089 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16090  dealing with a normal paragraph, a command, or an environment, where this
16091  is itself determined by the contents of the corresponding 
16092 \begin_inset Flex CharStyle:Code
16093 status collapsed
16094
16095 \begin_layout Plain Layout
16096 LaTeXType
16097 \end_layout
16098
16099 \end_inset
16100
16101  tag.
16102  
16103 \end_layout
16104
16105 \begin_layout Standard
16106 For a command or normal paragraph, the output XHTML has the following form:
16107 \end_layout
16108
16109 \begin_layout LyX-Code
16110 <tag attr=
16111 \begin_inset Quotes erd
16112 \end_inset
16113
16114 value
16115 \begin_inset Quotes erd
16116 \end_inset
16117
16118 >
16119 \end_layout
16120
16121 \begin_layout LyX-Code
16122 <labeltag attr=
16123 \begin_inset Quotes erd
16124 \end_inset
16125
16126 value
16127 \begin_inset Quotes erd
16128 \end_inset
16129
16130 >Label</labeltag>
16131 \end_layout
16132
16133 \begin_layout LyX-Code
16134 Contents of the paragraph.
16135 \end_layout
16136
16137 \begin_layout LyX-Code
16138 </tag>
16139 \end_layout
16140
16141 \begin_layout Standard
16142 The label tags are of course omitted if the paragraph does not have a label.
16143 \end_layout
16144
16145 \begin_layout Standard
16146 For an environment that is not some sort of list, the XHTML takes this form:
16147 \end_layout
16148
16149 \begin_layout LyX-Code
16150 <tag attr=
16151 \begin_inset Quotes erd
16152 \end_inset
16153
16154 value
16155 \begin_inset Quotes erd
16156 \end_inset
16157
16158 >
16159 \end_layout
16160
16161 \begin_layout LyX-Code
16162 <itemtag attr=
16163 \begin_inset Quotes erd
16164 \end_inset
16165
16166 value
16167 \begin_inset Quotes erd
16168 \end_inset
16169
16170 ><labeltag attr=
16171 \begin_inset Quotes erd
16172 \end_inset
16173
16174 value
16175 \begin_inset Quotes erd
16176 \end_inset
16177
16178 >Environment Label</labeltag>First paragraph.</itemtag>
16179 \end_layout
16180
16181 \begin_layout LyX-Code
16182 <itemtag>Second paragraph.</itemtag>
16183 \end_layout
16184
16185 \begin_layout LyX-Code
16186 </tag>
16187 \end_layout
16188
16189 \begin_layout Standard
16190 Note that the label is output only for the first paragraph, as it should
16191  be for a theorem, for example.
16192  
16193 \end_layout
16194
16195 \begin_layout Standard
16196 For a list, we have one of these forms:
16197 \end_layout
16198
16199 \begin_layout LyX-Code
16200 <tag attr=
16201 \begin_inset Quotes erd
16202 \end_inset
16203
16204 value
16205 \begin_inset Quotes erd
16206 \end_inset
16207
16208 >
16209 \end_layout
16210
16211 \begin_layout LyX-Code
16212 <itemtag attr=
16213 \begin_inset Quotes erd
16214 \end_inset
16215
16216 value
16217 \begin_inset Quotes erd
16218 \end_inset
16219
16220 ><labeltag attr=
16221 \begin_inset Quotes erd
16222 \end_inset
16223
16224 value
16225 \begin_inset Quotes erd
16226 \end_inset
16227
16228 >List Label</labeltag>First item.</itemtag>
16229 \end_layout
16230
16231 \begin_layout LyX-Code
16232 <itemtag attr=
16233 \begin_inset Quotes erd
16234 \end_inset
16235
16236 value
16237 \begin_inset Quotes erd
16238 \end_inset
16239
16240 ><labeltag attr=
16241 \begin_inset Quotes erd
16242 \end_inset
16243
16244 value
16245 \begin_inset Quotes erd
16246 \end_inset
16247
16248 >List Label</labeltag>Second item.</itemtag>
16249 \end_layout
16250
16251 \begin_layout LyX-Code
16252 </tag>
16253 \end_layout
16254
16255 \begin_layout LyX-Code
16256
16257 \end_layout
16258
16259 \begin_layout LyX-Code
16260 <tag attr=
16261 \begin_inset Quotes erd
16262 \end_inset
16263
16264 value
16265 \begin_inset Quotes erd
16266 \end_inset
16267
16268 >
16269 \end_layout
16270
16271 \begin_layout LyX-Code
16272 <labeltag attr=
16273 \begin_inset Quotes erd
16274 \end_inset
16275
16276 value
16277 \begin_inset Quotes erd
16278 \end_inset
16279
16280 >List Label</labeltag><itemtag attr=
16281 \begin_inset Quotes erd
16282 \end_inset
16283
16284 value
16285 \begin_inset Quotes erd
16286 \end_inset
16287
16288 >First item.</itemtag>
16289 \end_layout
16290
16291 \begin_layout LyX-Code
16292 <labeltag attr=
16293 \begin_inset Quotes erd
16294 \end_inset
16295
16296 value
16297 \begin_inset Quotes erd
16298 \end_inset
16299
16300 >List Label</labeltag><itemtag attr=
16301 \begin_inset Quotes erd
16302 \end_inset
16303
16304 value
16305 \begin_inset Quotes erd
16306 \end_inset
16307
16308 >Second item.</itemtag>
16309 \end_layout
16310
16311 \begin_layout LyX-Code
16312 </tag>
16313 \end_layout
16314
16315 \begin_layout Standard
16316 Note the different orders of 
16317 \begin_inset Flex CharStyle:Code
16318 status collapsed
16319
16320 \begin_layout Plain Layout
16321 labeltag
16322 \end_layout
16323
16324 \end_inset
16325
16326  and 
16327 \begin_inset Flex CharStyle:Code
16328 status collapsed
16329
16330 \begin_layout Plain Layout
16331 itemtag
16332 \end_layout
16333
16334 \end_inset
16335
16336 .
16337  Which order we get depends upon the setting of 
16338 \begin_inset Flex CharStyle:Code
16339 status collapsed
16340
16341 \begin_layout Plain Layout
16342 HTMLLabelFirst
16343 \end_layout
16344
16345 \end_inset
16346
16347 : If 
16348 \begin_inset Flex CharStyle:Code
16349 status collapsed
16350
16351 \begin_layout Plain Layout
16352 HTMLLabelFirst
16353 \end_layout
16354
16355 \end_inset
16356
16357  is false (the default), you get the first of these, with the label within
16358  the item; if true, you get the second, with the label outside the item.
16359 \end_layout
16360
16361 \begin_layout Standard
16362 The specific tags and attributes output for each paragraph type can be controlle
16363 d by means of the layout tags we are about to describe.
16364  As mentioned earlier, however, LyX uses sensible defaults for many of these,
16365  so you often may not need to do very much to get good XHTML output.
16366  Think of the available tags as there so you can tweak things to your liking.
16367 \end_layout
16368
16369 \begin_layout Description
16370 \begin_inset Flex CharStyle:Code
16371 status collapsed
16372
16373 \begin_layout Plain Layout
16374 HTMLAttr
16375 \end_layout
16376
16377 \end_inset
16378
16379  [
16380 \begin_inset Flex CharStyle:Code
16381 status collapsed
16382
16383 \begin_layout Plain Layout
16384 string
16385 \end_layout
16386
16387 \end_inset
16388
16389 ] Specifies attribute information to be output with the main tag.
16390  For example, 
16391 \begin_inset Quotes eld
16392 \end_inset
16393
16394
16395 \begin_inset Flex CharStyle:Code
16396 status collapsed
16397
16398 \begin_layout Plain Layout
16399 class=`mydiv'
16400 \end_layout
16401
16402 \end_inset
16403
16404
16405 \begin_inset Quotes erd
16406 \end_inset
16407
16408 .
16409  By default, LyX will output 
16410 \begin_inset Quotes eld
16411 \end_inset
16412
16413
16414 \begin_inset Flex CharStyle:Code
16415 status collapsed
16416
16417 \begin_layout Plain Layout
16418 class=`layoutname'
16419 \end_layout
16420
16421 \end_inset
16422
16423
16424 \begin_inset Quotes erd
16425 \end_inset
16426
16427 , where 
16428 \begin_inset Flex CharStyle:Code
16429 status collapsed
16430
16431 \begin_layout Plain Layout
16432 layoutname
16433 \end_layout
16434
16435 \end_inset
16436
16437  is the LyX name of the layout, made lowercase, for example: chapter.
16438 \end_layout
16439
16440 \begin_layout Description
16441 \begin_inset Flex CharStyle:Code
16442 status collapsed
16443
16444 \begin_layout Plain Layout
16445 HTMLForceCSS
16446 \end_layout
16447
16448 \end_inset
16449
16450  [
16451 \begin_inset Flex CharStyle:Code
16452 status collapsed
16453
16454 \begin_layout Plain Layout
16455
16456 \emph on
16457 0
16458 \emph default
16459 ,1
16460 \end_layout
16461
16462 \end_inset
16463
16464 ] Whether to output the default CSS information LyX generates for this layout,
16465  even if additional information is explicitly provided via 
16466 \begin_inset Flex CharStyle:Code
16467 status collapsed
16468
16469 \begin_layout Plain Layout
16470 HTMLStyle
16471 \end_layout
16472
16473 \end_inset
16474
16475 .
16476  Setting this to 
16477 \begin_inset Flex CharStyle:Code
16478 status collapsed
16479
16480 \begin_layout Plain Layout
16481 1
16482 \end_layout
16483
16484 \end_inset
16485
16486  allows you to alter or augment the generated CSS, rather than to override
16487  it completely.
16488  Default is 
16489 \begin_inset Flex CharStyle:Code
16490 status collapsed
16491
16492 \begin_layout Plain Layout
16493 0
16494 \end_layout
16495
16496 \end_inset
16497
16498 .
16499 \end_layout
16500
16501 \begin_layout Description
16502 \begin_inset Flex CharStyle:Code
16503 status collapsed
16504
16505 \begin_layout Plain Layout
16506 HTMLItem
16507 \end_layout
16508
16509 \end_inset
16510
16511  [
16512 \begin_inset Flex CharStyle:Code
16513 status collapsed
16514
16515 \begin_layout Plain Layout
16516 string
16517 \end_layout
16518
16519 \end_inset
16520
16521 ] The tag to be used for individual paragraphs of environments, replacing
16522  
16523 \begin_inset Flex CharStyle:Code
16524 status collapsed
16525
16526 \begin_layout Plain Layout
16527 itemtag
16528 \end_layout
16529
16530 \end_inset
16531
16532  in the examples above.
16533  Defaults to 
16534 \begin_inset Flex CharStyle:Code
16535 status collapsed
16536
16537 \begin_layout Plain Layout
16538 div
16539 \end_layout
16540
16541 \end_inset
16542
16543 .
16544 \end_layout
16545
16546 \begin_layout Description
16547 \begin_inset Flex CharStyle:Code
16548 status collapsed
16549
16550 \begin_layout Plain Layout
16551 HTMLItemAttr
16552 \end_layout
16553
16554 \end_inset
16555
16556  [
16557 \begin_inset Flex CharStyle:Code
16558 status collapsed
16559
16560 \begin_layout Plain Layout
16561 string
16562 \end_layout
16563
16564 \end_inset
16565
16566 ] Attributes for the item tag.
16567  Defaults to 
16568 \begin_inset Quotes eld
16569 \end_inset
16570
16571
16572 \begin_inset Flex CharStyle:Code
16573 status collapsed
16574
16575 \begin_layout Plain Layout
16576 class=`layoutname_item'
16577 \end_layout
16578
16579 \end_inset
16580
16581
16582 \begin_inset Quotes erd
16583 \end_inset
16584
16585 .
16586 \end_layout
16587
16588 \begin_layout Description
16589 \begin_inset Flex CharStyle:Code
16590 status collapsed
16591
16592 \begin_layout Plain Layout
16593 HTMLLabel
16594 \end_layout
16595
16596 \end_inset
16597
16598  [
16599 \begin_inset Flex CharStyle:Code
16600 status collapsed
16601
16602 \begin_layout Plain Layout
16603 string
16604 \end_layout
16605
16606 \end_inset
16607
16608 ] The tag to be used for paragraph and item labels, replacing 
16609 \begin_inset Flex CharStyle:Code
16610 status collapsed
16611
16612 \begin_layout Plain Layout
16613 labeltag
16614 \end_layout
16615
16616 \end_inset
16617
16618  in the examples above.
16619  Defaults to 
16620 \begin_inset Flex CharStyle:Code
16621 status collapsed
16622
16623 \begin_layout Plain Layout
16624 span
16625 \end_layout
16626
16627 \end_inset
16628
16629 .
16630 \end_layout
16631
16632 \begin_layout Description
16633 \begin_inset Flex CharStyle:Code
16634 status collapsed
16635
16636 \begin_layout Plain Layout
16637 HTMLLabelAttr
16638 \end_layout
16639
16640 \end_inset
16641
16642  [
16643 \begin_inset Flex CharStyle:Code
16644 status collapsed
16645
16646 \begin_layout Plain Layout
16647 string
16648 \end_layout
16649
16650 \end_inset
16651
16652 ] Attributes for the label tag.
16653  Defaults to 
16654 \begin_inset Quotes eld
16655 \end_inset
16656
16657
16658 \begin_inset Flex CharStyle:Code
16659 status collapsed
16660
16661 \begin_layout Plain Layout
16662 class=`layoutname_label'
16663 \end_layout
16664
16665 \end_inset
16666
16667
16668 \begin_inset Quotes erd
16669 \end_inset
16670
16671 .
16672 \end_layout
16673
16674 \begin_layout Description
16675 \begin_inset Flex CharStyle:Code
16676 status collapsed
16677
16678 \begin_layout Plain Layout
16679 HTMLLabelFirst
16680 \end_layout
16681
16682 \end_inset
16683
16684  [
16685 \begin_inset Flex CharStyle:Code
16686 status collapsed
16687
16688 \begin_layout Plain Layout
16689
16690 \emph on
16691 0
16692 \emph default
16693 ,1
16694 \end_layout
16695
16696 \end_inset
16697
16698 ] Meaningful only for list-like environments, this tag controls whether
16699  the label tag is output before or inside the item tag.
16700  This is used, for example, in the description environment, where we want
16701  `
16702 \begin_inset Flex CharStyle:Code
16703 status collapsed
16704
16705 \begin_layout Plain Layout
16706 <dt>\SpecialChar \ldots{}
16707 </dt><dd>\SpecialChar \ldots{}
16708 </dd>
16709 \end_layout
16710
16711 \end_inset
16712
16713 .
16714  Default is 
16715 \begin_inset Flex CharStyle:Code
16716 status collapsed
16717
16718 \begin_layout Plain Layout
16719 0
16720 \end_layout
16721
16722 \end_inset
16723
16724 : The label tag is output inside the item tag.
16725 \end_layout
16726
16727 \begin_layout Description
16728 \begin_inset Flex CharStyle:Code
16729 status collapsed
16730
16731 \begin_layout Plain Layout
16732 HTMLPreamble
16733 \end_layout
16734
16735 \end_inset
16736
16737  Information to be output in the 
16738 \begin_inset Flex CharStyle:Code
16739 status collapsed
16740
16741 \begin_layout Plain Layout
16742 <head>
16743 \end_layout
16744
16745 \end_inset
16746
16747  section when this style is used.
16748  This might, for example, be used to include a 
16749 \begin_inset Flex CharStyle:Code
16750 status collapsed
16751
16752 \begin_layout Plain Layout
16753 <script>
16754 \end_layout
16755
16756 \end_inset
16757
16758  block defining an 
16759 \begin_inset Flex CharStyle:Code
16760 status collapsed
16761
16762 \begin_layout Plain Layout
16763 onclick
16764 \end_layout
16765
16766 \end_inset
16767
16768  handler.
16769 \end_layout
16770
16771 \begin_layout Description
16772 \begin_inset Flex CharStyle:Code
16773 status collapsed
16774
16775 \begin_layout Plain Layout
16776 HTMLStyle
16777 \end_layout
16778
16779 \end_inset
16780
16781  CSS style information to be included when this style is used.
16782  Note that this will automatically be wrapped in a layout-generated 
16783 \begin_inset Flex CharStyle:Code
16784 status collapsed
16785
16786 \begin_layout Plain Layout
16787 <style>
16788 \end_layout
16789
16790 \end_inset
16791
16792  block, so only the CSS itself need be included.
16793 \end_layout
16794
16795 \begin_layout Description
16796 \begin_inset Flex CharStyle:Code
16797 status collapsed
16798
16799 \begin_layout Plain Layout
16800 HTMLTag
16801 \end_layout
16802
16803 \end_inset
16804
16805  [
16806 \begin_inset Flex CharStyle:Code
16807 status collapsed
16808
16809 \begin_layout Plain Layout
16810 string
16811 \end_layout
16812
16813 \end_inset
16814
16815 ] The tag to be used for the main label, replacing 
16816 \begin_inset Flex CharStyle:Code
16817 status collapsed
16818
16819 \begin_layout Plain Layout
16820 tag
16821 \end_layout
16822
16823 \end_inset
16824
16825  in the examples above.
16826  Defaults to 
16827 \begin_inset Flex CharStyle:Code
16828 status collapsed
16829
16830 \begin_layout Plain Layout
16831 div
16832 \end_layout
16833
16834 \end_inset
16835
16836 .
16837 \end_layout
16838
16839 \begin_layout Description
16840 \begin_inset Flex CharStyle:Code
16841 status collapsed
16842
16843 \begin_layout Plain Layout
16844 HTMLTitle
16845 \end_layout
16846
16847 \end_inset
16848
16849  [
16850 \begin_inset Flex CharStyle:Code
16851 status collapsed
16852
16853 \begin_layout Plain Layout
16854
16855 \emph on
16856 0
16857 \emph default
16858 ,1
16859 \end_layout
16860
16861 \end_inset
16862
16863 ] Marks this style as the one to be used to generate the 
16864 \begin_inset Flex CharStyle:Code
16865 status collapsed
16866
16867 \begin_layout Plain Layout
16868 <title>
16869 \end_layout
16870
16871 \end_inset
16872
16873  tag for the XHTML file.
16874  By default, it is false.
16875  The 
16876 \begin_inset Flex CharStyle:Code
16877 status collapsed
16878
16879 \begin_layout Plain Layout
16880 stdtitle.inc
16881 \end_layout
16882
16883 \end_inset
16884
16885  file sets it to true for the 
16886 \begin_inset Flex CharStyle:Code
16887 status collapsed
16888
16889 \begin_layout Plain Layout
16890 title
16891 \end_layout
16892
16893 \end_inset
16894
16895  environment.
16896  
16897 \end_layout
16898
16899 \begin_layout Subsection
16900 InsetLayout XHTML
16901 \end_layout
16902
16903 \begin_layout Standard
16904 The XHTML output of insets can also be controlled by information in layout
16905  files.
16906 \begin_inset Foot
16907 status collapsed
16908
16909 \begin_layout Plain Layout
16910 At present, this is true only for 
16911 \begin_inset Quotes eld
16912 \end_inset
16913
16914 text
16915 \begin_inset Quotes erd
16916 \end_inset
16917
16918  insets (insets you can type into) and is not true for 
16919 \begin_inset Quotes eld
16920 \end_inset
16921
16922 command
16923 \begin_inset Quotes erd
16924 \end_inset
16925
16926  insets (insets that are associated with dialog boxes).
16927 \end_layout
16928
16929 \end_inset
16930
16931  Here, too, LyX tries to provide sensible defaults, and it constructs default
16932  CSS style rules.
16933  But everything can be customized.
16934 \end_layout
16935
16936 \begin_layout Standard
16937 The XHTML LyX outputs for an inset has the following form:
16938 \end_layout
16939
16940 \begin_layout LyX-Code
16941 <tag attr=
16942 \begin_inset Quotes erd
16943 \end_inset
16944
16945 value
16946 \begin_inset Quotes erd
16947 \end_inset
16948
16949 >
16950 \end_layout
16951
16952 \begin_layout LyX-Code
16953 <labeltag>Label</labeltag>
16954 \end_layout
16955
16956 \begin_layout LyX-Code
16957 <innertag attr=
16958 \begin_inset Quotes erd
16959 \end_inset
16960
16961 value
16962 \begin_inset Quotes erd
16963 \end_inset
16964
16965 >Contents of the inset.</innertag>
16966 \end_layout
16967
16968 \begin_layout LyX-Code
16969 </tag>
16970 \end_layout
16971
16972 \begin_layout Standard
16973 If the inset permits multiple paragraphs---that is, if 
16974 \begin_inset Flex CharStyle:Code
16975 status collapsed
16976
16977 \begin_layout Plain Layout
16978 MultiPar
16979 \end_layout
16980
16981 \end_inset
16982
16983  is true---then the contents of the inset will itself be output as paragraphs
16984  formatted according to the styles used for those paragraphs (standard,
16985  quote, and the like).
16986  The label tag is of course omitted if the paragraph does not have a label
16987  and, at present, is always 
16988 \begin_inset Flex CharStyle:Code
16989 status collapsed
16990
16991 \begin_layout Plain Layout
16992 span
16993 \end_layout
16994
16995 \end_inset
16996
16997 .
16998  The inner tag is optional and, by default, does not appear.
16999 \end_layout
17000
17001 \begin_layout Standard
17002 The specific tags and attributes output for each inset can be controlled
17003  by means of the following layout tags.
17004 \end_layout
17005
17006 \begin_layout Description
17007 \begin_inset Flex CharStyle:Code
17008 status collapsed
17009
17010 \begin_layout Plain Layout
17011 HTMLAttr
17012 \end_layout
17013
17014 \end_inset
17015
17016  [
17017 \begin_inset Flex CharStyle:Code
17018 status collapsed
17019
17020 \begin_layout Plain Layout
17021 string
17022 \end_layout
17023
17024 \end_inset
17025
17026 ] Specifies attribute information to be output with the main tag.
17027  For example, 
17028 \begin_inset Quotes eld
17029 \end_inset
17030
17031
17032 \begin_inset Flex CharStyle:Code
17033 status collapsed
17034
17035 \begin_layout Plain Layout
17036 class=`myinset' onclick=`\SpecialChar \ldots{}
17037 '
17038 \end_layout
17039
17040 \end_inset
17041
17042
17043 \begin_inset Quotes erd
17044 \end_inset
17045
17046 .
17047  By default, LyX will output 
17048 \begin_inset Quotes eld
17049 \end_inset
17050
17051
17052 \begin_inset Flex CharStyle:Code
17053 status collapsed
17054
17055 \begin_layout Plain Layout
17056 class=`insetname'
17057 \end_layout
17058
17059 \end_inset
17060
17061
17062 \begin_inset Quotes erd
17063 \end_inset
17064
17065 , where 
17066 \begin_inset Flex CharStyle:Code
17067 status collapsed
17068
17069 \begin_layout Plain Layout
17070 insetname
17071 \end_layout
17072
17073 \end_inset
17074
17075  is the LyX name of the inset, made lowercase and with non-alphanumeric
17076  characters converted to underscores, for example: footnote.
17077 \end_layout
17078
17079 \begin_layout Description
17080 \begin_inset Flex CharStyle:Code
17081 status collapsed
17082
17083 \begin_layout Plain Layout
17084 HTMLForceCSS
17085 \end_layout
17086
17087 \end_inset
17088
17089  [
17090 \begin_inset Flex CharStyle:Code
17091 status collapsed
17092
17093 \begin_layout Plain Layout
17094
17095 \emph on
17096 0
17097 \emph default
17098 ,1
17099 \end_layout
17100
17101 \end_inset
17102
17103 ] Whether to output the default CSS information LyX generates for this layout,
17104  even if additional information is explicitly provided via 
17105 \begin_inset Flex CharStyle:Code
17106 status collapsed
17107
17108 \begin_layout Plain Layout
17109 HTMLStyle
17110 \end_layout
17111
17112 \end_inset
17113
17114 .
17115  Setting this to 
17116 \begin_inset Flex CharStyle:Code
17117 status collapsed
17118
17119 \begin_layout Plain Layout
17120 1
17121 \end_layout
17122
17123 \end_inset
17124
17125  allows you to alter or augment the generated CSS, rather than to override
17126  it completely.
17127  Default is 0.
17128 \end_layout
17129
17130 \begin_layout Description
17131 \begin_inset Flex CharStyle:Code
17132 status collapsed
17133
17134 \begin_layout Plain Layout
17135 HTMLInnerAttr
17136 \end_layout
17137
17138 \end_inset
17139
17140  [
17141 \begin_inset Flex CharStyle:Code
17142 status collapsed
17143
17144 \begin_layout Plain Layout
17145 string
17146 \end_layout
17147
17148 \end_inset
17149
17150 ] Attributes for the inner tag.
17151  Defaults to 
17152 \begin_inset Quotes eld
17153 \end_inset
17154
17155
17156 \begin_inset Flex CharStyle:Code
17157 status collapsed
17158
17159 \begin_layout Plain Layout
17160 class=`insetname_inner'
17161 \end_layout
17162
17163 \end_inset
17164
17165
17166 \begin_inset Quotes erd
17167 \end_inset
17168
17169 .
17170 \end_layout
17171
17172 \begin_layout Description
17173 \begin_inset Flex CharStyle:Code
17174 status collapsed
17175
17176 \begin_layout Plain Layout
17177 HTMLInnerTag
17178 \end_layout
17179
17180 \end_inset
17181
17182  [
17183 \begin_inset Flex CharStyle:Code
17184 status collapsed
17185
17186 \begin_layout Plain Layout
17187 string
17188 \end_layout
17189
17190 \end_inset
17191
17192 ] The inner tag, replacing 
17193 \begin_inset Flex CharStyle:Code
17194 status collapsed
17195
17196 \begin_layout Plain Layout
17197 innertag
17198 \end_layout
17199
17200 \end_inset
17201
17202  in the examples above.
17203  By default, there is none.
17204 \end_layout
17205
17206 \begin_layout Description
17207 \begin_inset Flex CharStyle:Code
17208 status collapsed
17209
17210 \begin_layout Plain Layout
17211 HTMLIsBlock
17212 \end_layout
17213
17214 \end_inset
17215
17216  [
17217 \begin_inset Flex CharStyle:Code
17218 status collapsed
17219
17220 \begin_layout Plain Layout
17221 0,
17222 \emph on
17223 1
17224 \end_layout
17225
17226 \end_inset
17227
17228 ] Whether this inset represents a standalone block of text (such as a footnote)
17229  or instead represents material that is included in the surrounding text
17230  (such as a branch).
17231  Defaults to 1.
17232 \end_layout
17233
17234 \begin_layout Description
17235 \begin_inset Flex CharStyle:Code
17236 status collapsed
17237
17238 \begin_layout Plain Layout
17239 HTMLLabel
17240 \end_layout
17241
17242 \end_inset
17243
17244  [
17245 \begin_inset Flex CharStyle:Code
17246 status collapsed
17247
17248 \begin_layout Plain Layout
17249 string
17250 \end_layout
17251
17252 \end_inset
17253
17254 ] A label for this inset, possibly including a reference to a counter.
17255  For example, for footnote, it might be: 
17256 \begin_inset Flex CharStyle:Code
17257 status collapsed
17258
17259 \begin_layout Plain Layout
17260
17261 \backslash
17262 arabic{footnote}
17263 \end_layout
17264
17265 \end_inset
17266
17267 .
17268  This is optional, and there is no default.
17269 \end_layout
17270
17271 \begin_layout Description
17272 \begin_inset Flex CharStyle:Code
17273 status collapsed
17274
17275 \begin_layout Plain Layout
17276 HTMLPreamble
17277 \end_layout
17278
17279 \end_inset
17280
17281  Information to be output in the 
17282 \begin_inset Flex CharStyle:Code
17283 status collapsed
17284
17285 \begin_layout Plain Layout
17286 <head>
17287 \end_layout
17288
17289 \end_inset
17290
17291  section when this style is used.
17292  This might, for example, be used to include a 
17293 \begin_inset Flex CharStyle:Code
17294 status collapsed
17295
17296 \begin_layout Plain Layout
17297 <script>
17298 \end_layout
17299
17300 \end_inset
17301
17302  block defining an 
17303 \begin_inset Flex CharStyle:Code
17304 status collapsed
17305
17306 \begin_layout Plain Layout
17307 onclick
17308 \end_layout
17309
17310 \end_inset
17311
17312  handler.
17313 \end_layout
17314
17315 \begin_layout Description
17316 \begin_inset Flex CharStyle:Code
17317 status collapsed
17318
17319 \begin_layout Plain Layout
17320 HTMLStyle
17321 \end_layout
17322
17323 \end_inset
17324
17325  CSS style information to be included when this style is used.
17326  Note that this will automatically be wrapped in a layout-generated 
17327 \begin_inset Flex CharStyle:Code
17328 status collapsed
17329
17330 \begin_layout Plain Layout
17331 <style>
17332 \end_layout
17333
17334 \end_inset
17335
17336  block, so only the CSS itself need be included.
17337 \end_layout
17338
17339 \begin_layout Description
17340 \begin_inset Flex CharStyle:Code
17341 status collapsed
17342
17343 \begin_layout Plain Layout
17344 HTMLTag
17345 \end_layout
17346
17347 \end_inset
17348
17349  [
17350 \begin_inset Flex CharStyle:Code
17351 status collapsed
17352
17353 \begin_layout Plain Layout
17354 string
17355 \end_layout
17356
17357 \end_inset
17358
17359 ] The tag to be used for the main label, replacing 
17360 \begin_inset Flex CharStyle:Code
17361 status collapsed
17362
17363 \begin_layout Plain Layout
17364 tag
17365 \end_layout
17366
17367 \end_inset
17368
17369  in the examples above.
17370  The default depends upon the setting of 
17371 \begin_inset Flex CharStyle:Code
17372 status collapsed
17373
17374 \begin_layout Plain Layout
17375 MultiPar
17376 \end_layout
17377
17378 \end_inset
17379
17380 : If 
17381 \begin_inset Flex CharStyle:Code
17382 status collapsed
17383
17384 \begin_layout Plain Layout
17385 MultiPar
17386 \end_layout
17387
17388 \end_inset
17389
17390  is true, the default is 
17391 \begin_inset Flex CharStyle:Code
17392 status collapsed
17393
17394 \begin_layout Plain Layout
17395 div
17396 \end_layout
17397
17398 \end_inset
17399
17400 ; if it is false, the default is 
17401 \begin_inset Flex CharStyle:Code
17402 status collapsed
17403
17404 \begin_layout Plain Layout
17405 span
17406 \end_layout
17407
17408 \end_inset
17409
17410 .
17411 \end_layout
17412
17413 \begin_layout Subsection
17414 Float XHTML
17415 \end_layout
17416
17417 \begin_layout Standard
17418 The XHTML output for floats too can be controlled by layout information.
17419  The output has the following form:
17420 \end_layout
17421
17422 \begin_layout LyX-Code
17423 <tag attr=
17424 \begin_inset Quotes erd
17425 \end_inset
17426
17427 value
17428 \begin_inset Quotes erd
17429 \end_inset
17430
17431 >
17432 \end_layout
17433
17434 \begin_layout LyX-Code
17435 Contents of the float.
17436 \end_layout
17437
17438 \begin_layout LyX-Code
17439 </tag>
17440 \end_layout
17441
17442 \begin_layout Standard
17443 The caption, if there is one, is a separate inset and will be output as
17444  such.
17445  Its appearance can be controlled via the InsetLayout for caption insets.
17446  
17447 \end_layout
17448
17449 \begin_layout Description
17450 \begin_inset Flex CharStyle:Code
17451 status collapsed
17452
17453 \begin_layout Plain Layout
17454 HTMLAttr
17455 \end_layout
17456
17457 \end_inset
17458
17459  [
17460 \begin_inset Flex CharStyle:Code
17461 status collapsed
17462
17463 \begin_layout Plain Layout
17464 string
17465 \end_layout
17466
17467 \end_inset
17468
17469 ] Specifies attribute information to be output with the main tag.
17470  For example, 
17471 \begin_inset Quotes eld
17472 \end_inset
17473
17474
17475 \begin_inset Flex CharStyle:Code
17476 status collapsed
17477
17478 \begin_layout Plain Layout
17479 class=`myfloat' onclick=`\SpecialChar \ldots{}
17480 '
17481 \end_layout
17482
17483 \end_inset
17484
17485
17486 \begin_inset Quotes erd
17487 \end_inset
17488
17489 .
17490  By default, LyX will output 
17491 \begin_inset Quotes eld
17492 \end_inset
17493
17494
17495 \begin_inset Flex CharStyle:Code
17496 status collapsed
17497
17498 \begin_layout Plain Layout
17499 class=`float float-floattype'
17500 \end_layout
17501
17502 \end_inset
17503
17504
17505 \begin_inset Quotes erd
17506 \end_inset
17507
17508 , where 
17509 \begin_inset Flex CharStyle:Code
17510 status collapsed
17511
17512 \begin_layout Plain Layout
17513 floattype
17514 \end_layout
17515
17516 \end_inset
17517
17518  is LyX's name for this type of float, as determined by the float delcaration
17519  (see 
17520 \begin_inset CommandInset ref
17521 LatexCommand ref
17522 reference "sub:Floats"
17523
17524 \end_inset
17525
17526 ), though made lowercase and with non-alphanumeric characters converted
17527  to underscores, for example: float-table.
17528 \end_layout
17529
17530 \begin_layout Description
17531 \begin_inset Flex CharStyle:Code
17532 status collapsed
17533
17534 \begin_layout Plain Layout
17535 HTMLStyle
17536 \end_layout
17537
17538 \end_inset
17539
17540  CSS style information to be included when this float is used.
17541  Note that this will automatically be wrapped in a layout-generated 
17542 \begin_inset Flex CharStyle:Code
17543 status collapsed
17544
17545 \begin_layout Plain Layout
17546 <style>
17547 \end_layout
17548
17549 \end_inset
17550
17551  block, so only the CSS itself need be included.
17552 \end_layout
17553
17554 \begin_layout Description
17555 \begin_inset Flex CharStyle:Code
17556 status collapsed
17557
17558 \begin_layout Plain Layout
17559 HTMLTag
17560 \end_layout
17561
17562 \end_inset
17563
17564  [
17565 \begin_inset Flex CharStyle:Code
17566 status collapsed
17567
17568 \begin_layout Plain Layout
17569 string
17570 \end_layout
17571
17572 \end_inset
17573
17574 ] The tag to be used for this float, replacing 
17575 \begin_inset Quotes eld
17576 \end_inset
17577
17578
17579 \begin_inset Flex CharStyle:Code
17580 status collapsed
17581
17582 \begin_layout Plain Layout
17583 tag
17584 \end_layout
17585
17586 \end_inset
17587
17588
17589 \begin_inset Quotes erd
17590 \end_inset
17591
17592  in the example above.
17593  The default is 
17594 \begin_inset Flex CharStyle:Code
17595 status collapsed
17596
17597 \begin_layout Plain Layout
17598 div
17599 \end_layout
17600
17601 \end_inset
17602
17603  and will rarely need changing.
17604 \end_layout
17605
17606 \begin_layout Subsection
17607 Bibliography formatting
17608 \end_layout
17609
17610 \begin_layout Standard
17611 The bibliography can be formatted using 
17612 \begin_inset Flex CharStyle:Code
17613 status collapsed
17614
17615 \begin_layout Plain Layout
17616 CiteFormat
17617 \end_layout
17618
17619 \end_inset
17620
17621  blocks.
17622  See Section 
17623 \begin_inset CommandInset ref
17624 LatexCommand ref
17625 reference "sub:Citation-format-description"
17626
17627 \end_inset
17628
17629  for the details.
17630 \end_layout
17631
17632 \begin_layout Subsection
17633 LyX-generated CSS
17634 \end_layout
17635
17636 \begin_layout Standard
17637 We have several times mentioned that LyX will generate default CSS style
17638  rules for both insets and paragraph styles, based upon the other layout
17639  information that is provided.
17640  In this section, we shall say a word about which layout information LyX
17641  uses and how.
17642 \end_layout
17643
17644 \begin_layout Standard
17645 At present, LyX auto-generates CSS only for font information, making use
17646  of the 
17647 \begin_inset Flex CharStyle:Code
17648 status collapsed
17649
17650 \begin_layout Plain Layout
17651 Family
17652 \end_layout
17653
17654 \end_inset
17655
17656
17657 \begin_inset Flex CharStyle:Code
17658 status collapsed
17659
17660 \begin_layout Plain Layout
17661 Series
17662 \end_layout
17663
17664 \end_inset
17665
17666
17667 \begin_inset Flex CharStyle:Code
17668 status collapsed
17669
17670 \begin_layout Plain Layout
17671 Shape
17672 \end_layout
17673
17674 \end_inset
17675
17676 , and 
17677 \begin_inset Flex CharStyle:Code
17678 status collapsed
17679
17680 \begin_layout Plain Layout
17681 Size
17682 \end_layout
17683
17684 \end_inset
17685
17686  specified in the 
17687 \begin_inset Flex CharStyle:Code
17688 status collapsed
17689
17690 \begin_layout Plain Layout
17691 Font
17692 \end_layout
17693
17694 \end_inset
17695
17696  declaration.
17697  (See 
17698 \begin_inset CommandInset ref
17699 LatexCommand ref
17700 reference "sub:Font-description"
17701
17702 \end_inset
17703
17704 .) The translation is mostly straightforward and obvious.
17705  For example, 
17706 \begin_inset Quotes eld
17707 \end_inset
17708
17709
17710 \begin_inset Flex CharStyle:Code
17711 status collapsed
17712
17713 \begin_layout Plain Layout
17714 Family Sans
17715 \end_layout
17716
17717 \end_inset
17718
17719
17720 \begin_inset Quotes erd
17721 \end_inset
17722
17723  becomes 
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 font-family: sans-serif;
17733 \end_layout
17734
17735 \end_inset
17736
17737
17738 \begin_inset Quotes erd
17739 \end_inset
17740
17741 .
17742  The correspondence of LyX sizes and CSS sizes is a little less obvious
17743  but nonetheless intuitive.
17744  See the 
17745 \begin_inset Flex CharStyle:Code
17746 status collapsed
17747
17748 \begin_layout Plain Layout
17749 getSizeCSS()
17750 \end_layout
17751
17752 \end_inset
17753
17754  function in 
17755 \begin_inset Flex URL
17756 status collapsed
17757
17758 \begin_layout Plain Layout
17759
17760 src/FontInfo.cpp
17761 \end_layout
17762
17763 \end_inset
17764
17765  for the details.
17766  
17767 \end_layout
17768
17769 \begin_layout Chapter
17770 Including External Material
17771 \end_layout
17772
17773 \begin_layout Standard
17774 \begin_inset Box Shadowbox
17775 position "t"
17776 hor_pos "c"
17777 has_inner_box 1
17778 inner_pos "t"
17779 use_parbox 0
17780 width "100col%"
17781 special "none"
17782 height "1in"
17783 height_special "totalheight"
17784 status open
17785
17786 \begin_layout Plain Layout
17787 WARNING: This portion of the documentation has not been updated for some
17788  time.
17789  We certainly hope that it is still accurate, but there are no guarantees.
17790 \end_layout
17791
17792 \end_inset
17793
17794
17795 \end_layout
17796
17797 \begin_layout Standard
17798 The use of material from sources external to LyX is covered in detail in
17799  the 
17800 \emph on
17801 Embedded Objects
17802 \emph default
17803  manual.
17804  This part of the manual covers what needs to happen behind the scenes for
17805  new sorts of material to be included.
17806 \end_layout
17807
17808 \begin_layout Section
17809 How does it work?
17810 \end_layout
17811
17812 \begin_layout Standard
17813 The external material feature is based on the concept of a 
17814 \emph on
17815 template
17816 \emph default
17817 .
17818  A template is a specification of how LyX should interface with a certain
17819  kind of material.
17820  As bundled, LyX comes with predefined templates for Xfig figures, various
17821  raster format images, chess diagrams, and LilyPond music notation.
17822  You can check the actual list by using the menu 
17823 \begin_inset Flex CharStyle:MenuItem
17824 status collapsed
17825
17826 \begin_layout Plain Layout
17827 Insert\SpecialChar \menuseparator
17828 File\SpecialChar \menuseparator
17829 External Material
17830 \end_layout
17831
17832 \end_inset
17833
17834 .
17835  Furthermore, it is possible to roll your own template to support a specific
17836  kind of material.
17837  Later we'll describe in more detail what is involved, and hopefully you
17838  will submit all the templates you create so we can include them in a later
17839  LyX version.
17840 \end_layout
17841
17842 \begin_layout Standard
17843 Another basic idea of the external material feature is to distinguish between
17844  the original file that serves as a base for final material and the produced
17845  file that is included in your exported or printed document.
17846  For example, consider the case of a figure produced with 
17847 \begin_inset Flex CharStyle:Code
17848 status collapsed
17849
17850 \begin_layout Plain Layout
17851 Xfig
17852 \end_layout
17853
17854 \end_inset
17855
17856 .
17857  The Xfig application itself works on an original file with the 
17858 \begin_inset Flex CharStyle:Code
17859 status collapsed
17860
17861 \begin_layout Plain Layout
17862 .fig
17863 \end_layout
17864
17865 \end_inset
17866
17867  extension.
17868  Within Xfig, you create and change your figure, and when you are done,
17869  you save the 
17870 \begin_inset Flex CharStyle:Code
17871 status collapsed
17872
17873 \begin_layout Plain Layout
17874 fig
17875 \end_layout
17876
17877 \end_inset
17878
17879 -file.
17880  When you want to include the figure in your document, you invoke 
17881 \begin_inset Flex CharStyle:Code
17882 status collapsed
17883
17884 \begin_layout Plain Layout
17885 transfig
17886 \end_layout
17887
17888 \end_inset
17889
17890  in order to create a PostScript file that can readily be included in your
17891  LaTeX file.
17892  In this case, the 
17893 \begin_inset Flex CharStyle:Code
17894 status collapsed
17895
17896 \begin_layout Plain Layout
17897 .fig
17898 \end_layout
17899
17900 \end_inset
17901
17902  file is the original file, and the PostScript file is the produced file.
17903 \end_layout
17904
17905 \begin_layout Standard
17906 This distinction is important in order to allow updating of the material
17907  while you are in the process of writing the document.
17908  Furthermore, it provides us with the flexibility that is needed to support
17909  multiple export formats.
17910  For instance, in the case of a plain text file, it is not exactly an award-winn
17911 ing idea to include the figure as raw PostScript.
17912  Instead, you'd either prefer to just include a reference to the figure
17913  or try to invoke some graphics to ASCII converter to make the final result
17914  look similar to the real graphics.
17915  The external material management allows you to do this, because it is parametri
17916 zed on the different export formats that LyX supports.
17917 \end_layout
17918
17919 \begin_layout Standard
17920 Besides supporting the production of different products according to the
17921  exported format, it supports tight integration with editing and viewing
17922  applications.
17923  In the case of an Xfig figure, you are able to invoke Xfig on the original
17924  file with a single click from within the external material dialog in LyX,
17925  and also preview the produced PostScript file with Ghostview with another
17926  click.
17927  No more fiddling around with the command line and/or file browsers to locate
17928  and manipulate the original or produced files.
17929  In this way, you are finally able to take full advantage of the many different
17930  applications that are relevant to use when you write your documents, and
17931  ultimately be more productive.
17932 \end_layout
17933
17934 \begin_layout Section
17935 The external template configuration file
17936 \end_layout
17937
17938 \begin_layout Standard
17939 It is relatively easy to add custom external template definitions to LyX.
17940  However, be aware that doing this in an careless manner most probably 
17941 \emph on
17942 will
17943 \emph default
17944  introduce an easily exploitable security hole.
17945  So before you do this, please read the discussion about security in section
17946  
17947 \begin_inset CommandInset ref
17948 LatexCommand ref
17949 reference "sec:Security-discussion"
17950
17951 \end_inset
17952
17953 .
17954 \end_layout
17955
17956 \begin_layout Standard
17957 Having said that, we encourage you to submit any interesting templates that
17958  you create.
17959  
17960 \end_layout
17961
17962 \begin_layout Standard
17963 The external templates are defined in the 
17964 \begin_inset Flex CharStyle:Code
17965 status collapsed
17966
17967 \begin_layout Plain Layout
17968 LyXDir/lib/external_templates
17969 \end_layout
17970
17971 \end_inset
17972
17973  file.
17974  You can place your own version in 
17975 \begin_inset Flex CharStyle:Code
17976 status collapsed
17977
17978 \begin_layout Plain Layout
17979 UserDir/external_templates
17980 \end_layout
17981
17982 \end_inset
17983
17984 .
17985 \end_layout
17986
17987 \begin_layout Standard
17988 A typical template looks like this:
17989 \end_layout
17990
17991 \begin_layout LyX-Code
17992 Template XFig
17993 \end_layout
17994
17995 \begin_layout LyX-Code
17996 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
17997 \end_layout
17998
17999 \begin_layout LyX-Code
18000 HelpText
18001 \end_layout
18002
18003 \begin_layout LyX-Code
18004 An XFig figure.
18005 \end_layout
18006
18007 \begin_layout LyX-Code
18008 HelpTextEnd
18009 \end_layout
18010
18011 \begin_layout LyX-Code
18012 InputFormat fig
18013 \end_layout
18014
18015 \begin_layout LyX-Code
18016 FileFilter "*.fig"
18017 \end_layout
18018
18019 \begin_layout LyX-Code
18020 AutomaticProduction true
18021 \end_layout
18022
18023 \begin_layout LyX-Code
18024 Transform Rotate
18025 \end_layout
18026
18027 \begin_layout LyX-Code
18028 Transform Resize
18029 \end_layout
18030
18031 \begin_layout LyX-Code
18032 Format LaTeX
18033 \end_layout
18034
18035 \begin_layout LyX-Code
18036 TransformCommand Rotate RotationLatexCommand
18037 \end_layout
18038
18039 \begin_layout LyX-Code
18040 TransformCommand Resize ResizeLatexCommand
18041 \end_layout
18042
18043 \begin_layout LyX-Code
18044 Product "$$RotateFront$$ResizeFront
18045 \end_layout
18046
18047 \begin_layout LyX-Code
18048          
18049 \backslash
18050
18051 \backslash
18052 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18053 \end_layout
18054
18055 \begin_layout LyX-Code
18056          $$ResizeBack$$RotateBack"
18057 \end_layout
18058
18059 \begin_layout LyX-Code
18060 UpdateFormat pstex
18061 \end_layout
18062
18063 \begin_layout LyX-Code
18064 UpdateResult "$$AbsPath$$Basename.pstex_t"
18065 \end_layout
18066
18067 \begin_layout LyX-Code
18068 Requirement "graphicx"
18069 \end_layout
18070
18071 \begin_layout LyX-Code
18072 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18073 \end_layout
18074
18075 \begin_layout LyX-Code
18076 ReferencedFile latex "$$AbsPath$$Basename.eps"
18077 \end_layout
18078
18079 \begin_layout LyX-Code
18080 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18081 \end_layout
18082
18083 \begin_layout LyX-Code
18084 FormatEnd
18085 \end_layout
18086
18087 \begin_layout LyX-Code
18088 Format PDFLaTeX
18089 \end_layout
18090
18091 \begin_layout LyX-Code
18092 TransformCommand Rotate RotationLatexCommand
18093 \end_layout
18094
18095 \begin_layout LyX-Code
18096 TransformCommand Resize ResizeLatexCommand
18097 \end_layout
18098
18099 \begin_layout LyX-Code
18100 Product "$$RotateFront$$ResizeFront
18101 \end_layout
18102
18103 \begin_layout LyX-Code
18104          
18105 \backslash
18106
18107 \backslash
18108 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18109 \end_layout
18110
18111 \begin_layout LyX-Code
18112          $$ResizeBack$$RotateBack"
18113 \end_layout
18114
18115 \begin_layout LyX-Code
18116 UpdateFormat pdftex
18117 \end_layout
18118
18119 \begin_layout LyX-Code
18120 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18121 \end_layout
18122
18123 \begin_layout LyX-Code
18124 Requirement "graphicx"
18125 \end_layout
18126
18127 \begin_layout LyX-Code
18128 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18129 \end_layout
18130
18131 \begin_layout LyX-Code
18132 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18133 \end_layout
18134
18135 \begin_layout LyX-Code
18136 FormatEnd
18137 \end_layout
18138
18139 \begin_layout LyX-Code
18140 Format Ascii
18141 \end_layout
18142
18143 \begin_layout LyX-Code
18144 Product "$$Contents(
18145 \backslash
18146 "$$AbsPath$$Basename.asc
18147 \backslash
18148 ")"
18149 \end_layout
18150
18151 \begin_layout LyX-Code
18152 UpdateFormat asciixfig
18153 \end_layout
18154
18155 \begin_layout LyX-Code
18156 UpdateResult "$$AbsPath$$Basename.asc"
18157 \end_layout
18158
18159 \begin_layout LyX-Code
18160 FormatEnd
18161 \end_layout
18162
18163 \begin_layout LyX-Code
18164 Format DocBook
18165 \end_layout
18166
18167 \begin_layout LyX-Code
18168 Product "<graphic fileref=
18169 \backslash
18170 "$$AbsOrRelPathMaster$$Basename.eps
18171 \backslash
18172 ">
18173 \end_layout
18174
18175 \begin_layout LyX-Code
18176          </graphic>"
18177 \end_layout
18178
18179 \begin_layout LyX-Code
18180 UpdateFormat eps
18181 \end_layout
18182
18183 \begin_layout LyX-Code
18184 UpdateResult "$$AbsPath$$Basename.eps"
18185 \end_layout
18186
18187 \begin_layout LyX-Code
18188 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18189 \end_layout
18190
18191 \begin_layout LyX-Code
18192 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18193 \end_layout
18194
18195 \begin_layout LyX-Code
18196 FormatEnd
18197 \end_layout
18198
18199 \begin_layout LyX-Code
18200 Product "[XFig: $$FName]"
18201 \end_layout
18202
18203 \begin_layout LyX-Code
18204 FormatEnd
18205 \end_layout
18206
18207 \begin_layout LyX-Code
18208 TemplateEnd
18209 \end_layout
18210
18211 \begin_layout Standard
18212 As you can see, the template is enclosed in 
18213 \begin_inset Flex CharStyle:Code
18214 status collapsed
18215
18216 \begin_layout Plain Layout
18217 Template
18218 \end_layout
18219
18220 \end_inset
18221
18222  \SpecialChar \ldots{}
18223  
18224 \begin_inset Flex CharStyle:Code
18225 status collapsed
18226
18227 \begin_layout Plain Layout
18228 TemplateEnd
18229 \end_layout
18230
18231 \end_inset
18232
18233 .
18234  It contains a header specifying some general settings and, for each supported
18235  primary document file format, a section 
18236 \begin_inset Flex CharStyle:Code
18237 status collapsed
18238
18239 \begin_layout Plain Layout
18240 Format
18241 \end_layout
18242
18243 \end_inset
18244
18245  \SpecialChar \ldots{}
18246  
18247 \begin_inset Flex CharStyle:Code
18248 status collapsed
18249
18250 \begin_layout Plain Layout
18251 FormatEnd
18252 \end_layout
18253
18254 \end_inset
18255
18256 .
18257 \end_layout
18258
18259 \begin_layout Subsection
18260 The template header
18261 \end_layout
18262
18263 \begin_layout Description
18264 \begin_inset Flex CharStyle:Code
18265 status collapsed
18266
18267 \begin_layout Plain Layout
18268 AutomaticProduction
18269 \begin_inset space ~
18270 \end_inset
18271
18272 true|false
18273 \end_layout
18274
18275 \end_inset
18276
18277  Whether the file represented by the template must be generated by LyX.
18278  This command must occur exactly once.
18279 \end_layout
18280
18281 \begin_layout Description
18282 \begin_inset Flex CharStyle:Code
18283 status collapsed
18284
18285 \begin_layout Plain Layout
18286 FileFilter
18287 \begin_inset space ~
18288 \end_inset
18289
18290 <pattern>
18291 \end_layout
18292
18293 \end_inset
18294
18295  A glob pattern that is used in the file dialog to filter out the desired
18296  files.
18297  If there is more than one possible file extension (e.
18298 \begin_inset space \thinspace{}
18299 \end_inset
18300
18301 g.
18302 \begin_inset space \space{}
18303 \end_inset
18304
18305 tgif has 
18306 \begin_inset Flex CharStyle:Code
18307 status collapsed
18308
18309 \begin_layout Plain Layout
18310 .obj
18311 \end_layout
18312
18313 \end_inset
18314
18315  and 
18316 \begin_inset Flex CharStyle:Code
18317 status collapsed
18318
18319 \begin_layout Plain Layout
18320 .tgo
18321 \end_layout
18322
18323 \end_inset
18324
18325 ), use something like 
18326 \begin_inset Flex CharStyle:Code
18327 status collapsed
18328
18329 \begin_layout Plain Layout
18330 "*.{obj,tgo}"
18331 \end_layout
18332
18333 \end_inset
18334
18335 .
18336  This command must occur exactly once.
18337 \end_layout
18338
18339 \begin_layout Description
18340 \begin_inset Flex CharStyle:Code
18341 status collapsed
18342
18343 \begin_layout Plain Layout
18344 GuiName
18345 \begin_inset space ~
18346 \end_inset
18347
18348 <guiname>
18349 \end_layout
18350
18351 \end_inset
18352
18353  The text that is displayed on the button.
18354  This command must occur exactly once.
18355 \end_layout
18356
18357 \begin_layout Description
18358 \begin_inset Flex CharStyle:Code
18359 status collapsed
18360
18361 \begin_layout Plain Layout
18362 HelpText
18363 \begin_inset space ~
18364 \end_inset
18365
18366 <text>
18367 \begin_inset space ~
18368 \end_inset
18369
18370 HelpTextEnd
18371 \end_layout
18372
18373 \end_inset
18374
18375  The help text that is used in the External dialog.
18376  Provide enough information to explain to the user just what the template
18377  can provide him with.
18378  This command must occur exactly once.
18379 \end_layout
18380
18381 \begin_layout Description
18382 \begin_inset Flex CharStyle:Code
18383 status collapsed
18384
18385 \begin_layout Plain Layout
18386 InputFormat
18387 \begin_inset space ~
18388 \end_inset
18389
18390 <format>
18391 \end_layout
18392
18393 \end_inset
18394
18395  The file format of the original file.
18396  This must be the name of a format that is known to LyX (see section 
18397 \begin_inset CommandInset ref
18398 LatexCommand ref
18399 reference "sec:Formats"
18400
18401 \end_inset
18402
18403 ).
18404  Use 
18405 \begin_inset Quotes eld
18406 \end_inset
18407
18408
18409 \begin_inset Flex CharStyle:Code
18410 status collapsed
18411
18412 \begin_layout Plain Layout
18413 *
18414 \end_layout
18415
18416 \end_inset
18417
18418
18419 \begin_inset Quotes erd
18420 \end_inset
18421
18422  if the template can handle original files of more than one format.
18423  LyX will attempt to interrogate the file itself in order to deduce its
18424  format in this case.
18425  This command must occur exactly once.
18426 \end_layout
18427
18428 \begin_layout Description
18429 \begin_inset Flex CharStyle:Code
18430 status collapsed
18431
18432 \begin_layout Plain Layout
18433 Template
18434 \begin_inset space ~
18435 \end_inset
18436
18437 <id>
18438 \end_layout
18439
18440 \end_inset
18441
18442  A unique name for the template.
18443  It must not contain substitution macros (see below).
18444 \end_layout
18445
18446 \begin_layout Description
18447 \begin_inset Flex CharStyle:Code
18448 status collapsed
18449
18450 \begin_layout Plain Layout
18451 Transform
18452 \begin_inset space ~
18453 \end_inset
18454
18455 Rotate|Resize|Clip|Extra
18456 \end_layout
18457
18458 \end_inset
18459
18460  This command specifies which transformations are supported by this template.
18461  It may occur zero or more times.
18462  This command enables the corresponding tabs in the external dialog.
18463  Each 
18464 \begin_inset Flex CharStyle:Code
18465 status collapsed
18466
18467 \begin_layout Plain Layout
18468 Transform
18469 \end_layout
18470
18471 \end_inset
18472
18473  command must have either a corresponding 
18474 \begin_inset Flex CharStyle:Code
18475 status collapsed
18476
18477 \begin_layout Plain Layout
18478 TransformCommand
18479 \end_layout
18480
18481 \end_inset
18482
18483  or a 
18484 \begin_inset Flex CharStyle:Code
18485 status collapsed
18486
18487 \begin_layout Plain Layout
18488 TransformOption
18489 \end_layout
18490
18491 \end_inset
18492
18493  command in the 
18494 \begin_inset Flex CharStyle:Code
18495 status collapsed
18496
18497 \begin_layout Plain Layout
18498 Format
18499 \end_layout
18500
18501 \end_inset
18502
18503  section.
18504  Otherwise the transformation will not be supported by that format.
18505 \end_layout
18506
18507 \begin_layout Subsection
18508 The Format section
18509 \end_layout
18510
18511 \begin_layout Description
18512 \begin_inset Flex CharStyle:Code
18513 status collapsed
18514
18515 \begin_layout Plain Layout
18516 Format
18517 \begin_inset space ~
18518 \end_inset
18519
18520 LaTeX|PDFLaTeX|PlainText|DocBook
18521 \end_layout
18522
18523 \end_inset
18524
18525  The primary document file format that this format definition is for.
18526  Not every template has a sensible representation in all document file formats.
18527  Please define nevertheless a 
18528 \begin_inset Flex CharStyle:Code
18529 status collapsed
18530
18531 \begin_layout Plain Layout
18532 Format
18533 \end_layout
18534
18535 \end_inset
18536
18537  section for all formats.
18538  Use a dummy text when no representation is available.
18539  Then you can at least see a reference to the external material in the exported
18540  document.
18541 \end_layout
18542
18543 \begin_layout Description
18544 \begin_inset Flex CharStyle:Code
18545 status collapsed
18546
18547 \begin_layout Plain Layout
18548 Option
18549 \begin_inset space ~
18550 \end_inset
18551
18552 <name>
18553 \begin_inset space ~
18554 \end_inset
18555
18556 <value>
18557 \end_layout
18558
18559 \end_inset
18560
18561  This command defines an additional macro 
18562 \begin_inset Flex CharStyle:Code
18563 status collapsed
18564
18565 \begin_layout Plain Layout
18566 $$<name>
18567 \end_layout
18568
18569 \end_inset
18570
18571  for substitution in 
18572 \begin_inset Flex CharStyle:Code
18573 status collapsed
18574
18575 \begin_layout Plain Layout
18576 Product
18577 \end_layout
18578
18579 \end_inset
18580
18581 .
18582  
18583 \begin_inset Flex CharStyle:Code
18584 status collapsed
18585
18586 \begin_layout Plain Layout
18587 <value>
18588 \end_layout
18589
18590 \end_inset
18591
18592  itself may contain substitution macros.
18593  The advantage over using 
18594 \begin_inset Flex CharStyle:Code
18595 status collapsed
18596
18597 \begin_layout Plain Layout
18598 <value>
18599 \end_layout
18600
18601 \end_inset
18602
18603  directly in 
18604 \begin_inset Flex CharStyle:Code
18605 status collapsed
18606
18607 \begin_layout Plain Layout
18608 Product
18609 \end_layout
18610
18611 \end_inset
18612
18613  is that the substituted value of 
18614 \begin_inset Flex CharStyle:Code
18615 status collapsed
18616
18617 \begin_layout Plain Layout
18618 $$<name>
18619 \end_layout
18620
18621 \end_inset
18622
18623  is sanitized so that it is a valid optional argument in the document format.
18624  This command may occur zero or more times.
18625 \end_layout
18626
18627 \begin_layout Description
18628 \begin_inset Flex CharStyle:Code
18629 status collapsed
18630
18631 \begin_layout Plain Layout
18632 Product
18633 \begin_inset space ~
18634 \end_inset
18635
18636 <text>
18637 \end_layout
18638
18639 \end_inset
18640
18641  The text that is inserted in the exported document.
18642  This is actually the most important command and can be quite complex.
18643  This command must occur exactly once.
18644 \end_layout
18645
18646 \begin_layout Description
18647 \begin_inset Flex CharStyle:Code
18648 status collapsed
18649
18650 \begin_layout Plain Layout
18651 Preamble
18652 \begin_inset space ~
18653 \end_inset
18654
18655 <name>
18656 \end_layout
18657
18658 \end_inset
18659
18660  This command specifies a preamble snippet that will be included in the
18661  LaTeX preamble.
18662  It has to be defined using 
18663 \begin_inset Flex CharStyle:Code
18664 status collapsed
18665
18666 \begin_layout Plain Layout
18667 PreambleDef
18668 \end_layout
18669
18670 \end_inset
18671
18672  \SpecialChar \ldots{}
18673  
18674 \begin_inset Flex CharStyle:Code
18675 status collapsed
18676
18677 \begin_layout Plain Layout
18678 PreambleDefEnd
18679 \end_layout
18680
18681 \end_inset
18682
18683 .
18684  This command may occur zero or more times.
18685 \end_layout
18686
18687 \begin_layout Description
18688 \begin_inset Flex CharStyle:Code
18689 status collapsed
18690
18691 \begin_layout Plain Layout
18692 ReferencedFile
18693 \begin_inset space ~
18694 \end_inset
18695
18696 <format>
18697 \begin_inset space ~
18698 \end_inset
18699
18700 <filename>
18701 \end_layout
18702
18703 \end_inset
18704
18705  This command denotes files that are created by the conversion process and
18706  are needed for a particular export format.
18707  If the filename is relative, it is interpreted relative to the master document.
18708  This command may be given zero or more times.
18709 \end_layout
18710
18711 \begin_layout Description
18712 \begin_inset Flex CharStyle:Code
18713 status collapsed
18714
18715 \begin_layout Plain Layout
18716 Requirement
18717 \begin_inset space ~
18718 \end_inset
18719
18720 <package>
18721 \end_layout
18722
18723 \end_inset
18724
18725  The name of a required LaTeX package.
18726  The package is included via 
18727 \begin_inset Flex CharStyle:Code
18728 status collapsed
18729
18730 \begin_layout Plain Layout
18731
18732 \backslash
18733 usepackage{}
18734 \end_layout
18735
18736 \end_inset
18737
18738  in the LaTeX preamble.
18739  This command may occur zero or more times.
18740 \end_layout
18741
18742 \begin_layout Description
18743 \begin_inset Flex CharStyle:Code
18744 status collapsed
18745
18746 \begin_layout Plain Layout
18747 TransformCommand
18748 \begin_inset space ~
18749 \end_inset
18750
18751 Rotate
18752 \begin_inset space ~
18753 \end_inset
18754
18755 RotationLatexCommand
18756 \end_layout
18757
18758 \end_inset
18759
18760  This command specifies that the built in LaTeX command should be used for
18761  rotation.
18762  This command may occur once or not at all.
18763 \end_layout
18764
18765 \begin_layout Description
18766 \begin_inset Flex CharStyle:Code
18767 status collapsed
18768
18769 \begin_layout Plain Layout
18770 TransformCommand
18771 \begin_inset space ~
18772 \end_inset
18773
18774 Resize
18775 \begin_inset space ~
18776 \end_inset
18777
18778 ResizeLatexCommand
18779 \end_layout
18780
18781 \end_inset
18782
18783  This command specifies that the built in LaTeX command should be used for
18784  resizing.
18785  This command may occur once or not at all.
18786 \end_layout
18787
18788 \begin_layout Description
18789 \begin_inset Flex CharStyle:Code
18790 status collapsed
18791
18792 \begin_layout Plain Layout
18793 TransformOption
18794 \begin_inset space ~
18795 \end_inset
18796
18797 Rotate
18798 \begin_inset space ~
18799 \end_inset
18800
18801 RotationLatexOption
18802 \end_layout
18803
18804 \end_inset
18805
18806  This command specifies that rotation is done via an optional argument.
18807  This command may occur once or not at all.
18808 \end_layout
18809
18810 \begin_layout Description
18811 \begin_inset Flex CharStyle:Code
18812 status collapsed
18813
18814 \begin_layout Plain Layout
18815 TransformOption
18816 \begin_inset space ~
18817 \end_inset
18818
18819 Resize
18820 \begin_inset space ~
18821 \end_inset
18822
18823 ResizeLatexOption
18824 \end_layout
18825
18826 \end_inset
18827
18828  This command specifies that resizing is done via an optional argument.
18829  This command may occur once or not at all.
18830 \end_layout
18831
18832 \begin_layout Description
18833 \begin_inset Flex CharStyle:Code
18834 status collapsed
18835
18836 \begin_layout Plain Layout
18837 TransformOption
18838 \begin_inset space ~
18839 \end_inset
18840
18841 Clip
18842 \begin_inset space ~
18843 \end_inset
18844
18845 ClipLatexOption
18846 \end_layout
18847
18848 \end_inset
18849
18850  This command specifies that clipping is done via an optional argument.
18851  This command may occur once or not at all.
18852 \end_layout
18853
18854 \begin_layout Description
18855 \begin_inset Flex CharStyle:Code
18856 status collapsed
18857
18858 \begin_layout Plain Layout
18859 TransformOption
18860 \begin_inset space ~
18861 \end_inset
18862
18863 Extra
18864 \begin_inset space ~
18865 \end_inset
18866
18867 ExtraLatexOption
18868 \end_layout
18869
18870 \end_inset
18871
18872  This command specifies that an extra optional argument is used.
18873  This command may occur once or not at all.
18874 \end_layout
18875
18876 \begin_layout Description
18877 \begin_inset Flex CharStyle:Code
18878 status collapsed
18879
18880 \begin_layout Plain Layout
18881 UpdateFormat
18882 \begin_inset space ~
18883 \end_inset
18884
18885 <format>
18886 \end_layout
18887
18888 \end_inset
18889
18890  The file format of the converted file.
18891  This must be the name of a format that is known to LyX (see the 
18892 \begin_inset Flex CharStyle:MenuItem
18893 status collapsed
18894
18895 \begin_layout Plain Layout
18896
18897 \bar under
18898 T
18899 \bar default
18900 ools\SpecialChar \menuseparator
18901
18902 \bar under
18903 P
18904 \bar default
18905 references:Conversion
18906 \end_layout
18907
18908 \end_inset
18909
18910  dialog).
18911  This command must occur exactly once.
18912 \end_layout
18913
18914 \begin_layout Description
18915 \begin_inset Flex CharStyle:Code
18916 status collapsed
18917
18918 \begin_layout Plain Layout
18919 UpdateResult
18920 \begin_inset space ~
18921 \end_inset
18922
18923 <filename>
18924 \end_layout
18925
18926 \end_inset
18927
18928  The file name of the converted file.
18929  The file name must be absolute.
18930  This command must occur exactly once.
18931 \end_layout
18932
18933 \begin_layout Subsection
18934 Preamble definitions
18935 \end_layout
18936
18937 \begin_layout Standard
18938 The external template configuration file may contain additional preamble
18939  definitions enclosed by 
18940 \begin_inset Flex CharStyle:Code
18941 status collapsed
18942
18943 \begin_layout Plain Layout
18944 PreambleDef
18945 \end_layout
18946
18947 \end_inset
18948
18949  \SpecialChar \ldots{}
18950  
18951 \begin_inset Flex CharStyle:Code
18952 status collapsed
18953
18954 \begin_layout Plain Layout
18955 PreambleDefEnd
18956 \end_layout
18957
18958 \end_inset
18959
18960 .
18961  They can be used by the templates in the 
18962 \begin_inset Flex CharStyle:Code
18963 status collapsed
18964
18965 \begin_layout Plain Layout
18966 Format
18967 \end_layout
18968
18969 \end_inset
18970
18971  section.
18972 \end_layout
18973
18974 \begin_layout Section
18975 The substitution mechanism
18976 \end_layout
18977
18978 \begin_layout Standard
18979 When the external material facility invokes an external program, it is done
18980  on the basis of a command defined in the template configuration file.
18981  These commands can contain various macros that are expanded before execution.
18982  Execution always take place in the directory of the containing document.
18983 \end_layout
18984
18985 \begin_layout Standard
18986 Also, whenever external material is to be displayed, the name will be produced
18987  by the substitution mechanism, and most other commands in the template
18988  definition support substitution as well.
18989 \end_layout
18990
18991 \begin_layout Standard
18992 The available macros are the following:
18993 \end_layout
18994
18995 \begin_layout Description
18996 \begin_inset Flex CharStyle:Code
18997 status collapsed
18998
18999 \begin_layout Plain Layout
19000 $$AbsOrRelPathMaster
19001 \end_layout
19002
19003 \end_inset
19004
19005  The file path, absolute or relative to the master LyX document.
19006 \end_layout
19007
19008 \begin_layout Description
19009 \begin_inset Flex CharStyle:Code
19010 status collapsed
19011
19012 \begin_layout Plain Layout
19013 $$AbsOrRelPathParent
19014 \end_layout
19015
19016 \end_inset
19017
19018  The file path, absolute or relative to the LyX document.
19019 \end_layout
19020
19021 \begin_layout Description
19022 \begin_inset Flex CharStyle:Code
19023 status collapsed
19024
19025 \begin_layout Plain Layout
19026 $$AbsPath
19027 \end_layout
19028
19029 \end_inset
19030
19031  The absolute file path.
19032 \end_layout
19033
19034 \begin_layout Description
19035 \begin_inset Flex CharStyle:Code
19036 status collapsed
19037
19038 \begin_layout Plain Layout
19039 $$Basename
19040 \end_layout
19041
19042 \end_inset
19043
19044  The filename without path and without the extension.
19045 \end_layout
19046
19047 \begin_layout Description
19048 \begin_inset Flex CharStyle:Code
19049 status collapsed
19050
19051 \begin_layout Plain Layout
19052 $$Contents(
19053 \begin_inset Quotes eld
19054 \end_inset
19055
19056 filename.ext
19057 \begin_inset Quotes erd
19058 \end_inset
19059
19060 )
19061 \end_layout
19062
19063 \end_inset
19064
19065  This macro will expand to the contents of the file with the name 
19066 \begin_inset Flex CharStyle:Code
19067 status collapsed
19068
19069 \begin_layout Plain Layout
19070 filename.ext
19071 \end_layout
19072
19073 \end_inset
19074
19075 .
19076 \end_layout
19077
19078 \begin_layout Description
19079 \begin_inset Flex CharStyle:Code
19080 status collapsed
19081
19082 \begin_layout Plain Layout
19083 $$Extension
19084 \end_layout
19085
19086 \end_inset
19087
19088  The file extension (including the dot).
19089 \end_layout
19090
19091 \begin_layout Description
19092 \begin_inset Flex CharStyle:Code
19093 status collapsed
19094
19095 \begin_layout Plain Layout
19096 $$FName
19097 \end_layout
19098
19099 \end_inset
19100
19101  The filename of the file specified in the external material dialog.
19102  This is either an absolute name, or it is relative to the LyX document.
19103 \end_layout
19104
19105 \begin_layout Description
19106 \begin_inset Flex CharStyle:Code
19107 status collapsed
19108
19109 \begin_layout Plain Layout
19110 $$FPath
19111 \end_layout
19112
19113 \end_inset
19114
19115  The path part of 
19116 \begin_inset Flex CharStyle:Code
19117 status collapsed
19118
19119 \begin_layout Plain Layout
19120 $$FName
19121 \end_layout
19122
19123 \end_inset
19124
19125  (absolute name or relative to the LyX document).
19126 \end_layout
19127
19128 \begin_layout Description
19129 \begin_inset Flex CharStyle:Code
19130 status collapsed
19131
19132 \begin_layout Plain Layout
19133 $$RelPathMaster
19134 \end_layout
19135
19136 \end_inset
19137
19138  The file path, relative to the master LyX document.
19139 \end_layout
19140
19141 \begin_layout Description
19142 \begin_inset Flex CharStyle:Code
19143 status collapsed
19144
19145 \begin_layout Plain Layout
19146 $$RelPathParent
19147 \end_layout
19148
19149 \end_inset
19150
19151  The file path, relative to the LyX document.
19152 \end_layout
19153
19154 \begin_layout Description
19155 \begin_inset Flex CharStyle:Code
19156 status collapsed
19157
19158 \begin_layout Plain Layout
19159 $$Sysdir
19160 \end_layout
19161
19162 \end_inset
19163
19164  This macro will expand to the absolute path of the system directory.
19165  This is typically used to point to the various helper scripts that are
19166  bundled with LyX.
19167 \end_layout
19168
19169 \begin_layout Description
19170 \begin_inset Flex CharStyle:Code
19171 status collapsed
19172
19173 \begin_layout Plain Layout
19174 $$Tempname
19175 \end_layout
19176
19177 \end_inset
19178
19179  A name and full path to a temporary file which will be automatically deleted
19180  whenever the containing document is closed, or the external material insertion
19181  deleted.
19182 \end_layout
19183
19184 \begin_layout Standard
19185 All path macros contain a trailing directory separator, so you can construct
19186  e.
19187 \begin_inset space \thinspace{}
19188 \end_inset
19189
19190 g.
19191 \begin_inset space \space{}
19192 \end_inset
19193
19194 the absolute filename with 
19195 \begin_inset Flex CharStyle:Code
19196 status collapsed
19197
19198 \begin_layout Plain Layout
19199 $$AbsPath$$Basename$$Extension
19200 \end_layout
19201
19202 \end_inset
19203
19204 .
19205 \end_layout
19206
19207 \begin_layout Standard
19208 The macros above are substituted in all commands unless otherwise noted.
19209  The command 
19210 \begin_inset Flex CharStyle:Code
19211 status collapsed
19212
19213 \begin_layout Plain Layout
19214 Product
19215 \end_layout
19216
19217 \end_inset
19218
19219  supports additionally the following substitutions if they are enabled by
19220  the 
19221 \begin_inset Flex CharStyle:Code
19222 status collapsed
19223
19224 \begin_layout Plain Layout
19225 Transform
19226 \end_layout
19227
19228 \end_inset
19229
19230  and 
19231 \begin_inset Flex CharStyle:Code
19232 status collapsed
19233
19234 \begin_layout Plain Layout
19235 TransformCommand
19236 \end_layout
19237
19238 \end_inset
19239
19240  commands:
19241 \end_layout
19242
19243 \begin_layout Description
19244 \begin_inset Flex CharStyle:Code
19245 status collapsed
19246
19247 \begin_layout Plain Layout
19248 $$ResizeFront
19249 \end_layout
19250
19251 \end_inset
19252
19253  The front part of the resize command.
19254 \end_layout
19255
19256 \begin_layout Description
19257 \begin_inset Flex CharStyle:Code
19258 status collapsed
19259
19260 \begin_layout Plain Layout
19261 $$ResizeBack
19262 \end_layout
19263
19264 \end_inset
19265
19266  The back part of the resize command.
19267 \end_layout
19268
19269 \begin_layout Description
19270 \begin_inset Flex CharStyle:Code
19271 status collapsed
19272
19273 \begin_layout Plain Layout
19274 $$RotateFront
19275 \end_layout
19276
19277 \end_inset
19278
19279  The front part of the rotation command.
19280 \end_layout
19281
19282 \begin_layout Description
19283 \begin_inset Flex CharStyle:Code
19284 status collapsed
19285
19286 \begin_layout Plain Layout
19287 $$RotateBack
19288 \end_layout
19289
19290 \end_inset
19291
19292  The back part of the rotation command.
19293 \end_layout
19294
19295 \begin_layout Standard
19296 The value string of the 
19297 \begin_inset Flex CharStyle:Code
19298 status collapsed
19299
19300 \begin_layout Plain Layout
19301 Option
19302 \end_layout
19303
19304 \end_inset
19305
19306  command supports additionally the following substitutions if they are enabled
19307  by the 
19308 \begin_inset Flex CharStyle:Code
19309 status collapsed
19310
19311 \begin_layout Plain Layout
19312 Transform
19313 \end_layout
19314
19315 \end_inset
19316
19317  and 
19318 \begin_inset Flex CharStyle:Code
19319 status collapsed
19320
19321 \begin_layout Plain Layout
19322 TransformOption
19323 \end_layout
19324
19325 \end_inset
19326
19327  commands:
19328 \end_layout
19329
19330 \begin_layout Description
19331 \begin_inset Flex CharStyle:Code
19332 status collapsed
19333
19334 \begin_layout Plain Layout
19335 $$Clip
19336 \end_layout
19337
19338 \end_inset
19339
19340  The clip option.
19341 \end_layout
19342
19343 \begin_layout Description
19344 \begin_inset Flex CharStyle:Code
19345 status collapsed
19346
19347 \begin_layout Plain Layout
19348 $$Extra
19349 \end_layout
19350
19351 \end_inset
19352
19353  The extra option.
19354 \end_layout
19355
19356 \begin_layout Description
19357 \begin_inset Flex CharStyle:Code
19358 status collapsed
19359
19360 \begin_layout Plain Layout
19361 $$Resize
19362 \end_layout
19363
19364 \end_inset
19365
19366  The resize option.
19367 \end_layout
19368
19369 \begin_layout Description
19370 \begin_inset Flex CharStyle:Code
19371 status collapsed
19372
19373 \begin_layout Plain Layout
19374 $$Rotate
19375 \end_layout
19376
19377 \end_inset
19378
19379  The rotation option.
19380 \end_layout
19381
19382 \begin_layout Standard
19383 You may ask why there are so many path macros.
19384  There are mainly two reasons:
19385 \end_layout
19386
19387 \begin_layout Enumerate
19388 Relative and absolute file names should remain relative or absolute, respectivel
19389 y.
19390  Users may have reasons to prefer either form.
19391  Relative names are useful for portable documents that should work on different
19392  machines, for example.
19393  Absolute names may be required by some programs.
19394 \end_layout
19395
19396 \begin_layout Enumerate
19397 LaTeX treats relative file names differently than LyX and other programs
19398  in nested included files.
19399  For LyX, a relative file name is always relative to the document that contains
19400  the file name.
19401  For LaTeX, it is always relative to the master document.
19402  These two definitions are identical if you have only one document, but
19403  differ if you have a master document that includes part documents.
19404  That means that relative filenames must be transformed when presented to
19405  LaTeX.
19406  Fortunately LyX does this automatically for you if you choose the right
19407  macros.
19408 \end_layout
19409
19410 \begin_layout Standard
19411 So which path macro should be used in new template definitions? The rule
19412  is not difficult:
19413 \end_layout
19414
19415 \begin_layout Itemize
19416 Use 
19417 \begin_inset Flex CharStyle:Code
19418 status collapsed
19419
19420 \begin_layout Plain Layout
19421 $$AbsPath
19422 \end_layout
19423
19424 \end_inset
19425
19426  if an absolute path is required.
19427 \end_layout
19428
19429 \begin_layout Itemize
19430 Use 
19431 \begin_inset Flex CharStyle:Code
19432 status collapsed
19433
19434 \begin_layout Plain Layout
19435 $$AbsOrRelPathMaster
19436 \end_layout
19437
19438 \end_inset
19439
19440  if the substituted string is some kind of LaTeX input.
19441 \end_layout
19442
19443 \begin_layout Itemize
19444 Else use 
19445 \begin_inset Flex CharStyle:Code
19446 status collapsed
19447
19448 \begin_layout Plain Layout
19449 $$AbsOrRelPathParent
19450 \end_layout
19451
19452 \end_inset
19453
19454  in order to preserve the user's choice.
19455 \end_layout
19456
19457 \begin_layout Standard
19458 There are special cases where this rule does not work and e.
19459 \begin_inset space \thinspace{}
19460 \end_inset
19461
19462 g.
19463 \begin_inset space \space{}
19464 \end_inset
19465
19466 relative names are needed, but normally it will work just fine.
19467  One example for such a case is the command 
19468 \begin_inset Flex CharStyle:Code
19469 status collapsed
19470
19471 \begin_layout Plain Layout
19472 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19473 \end_layout
19474
19475 \end_inset
19476
19477  in the XFig template above: We can't use the absolute name because the
19478  copier for 
19479 \begin_inset Flex CharStyle:Code
19480 status collapsed
19481
19482 \begin_layout Plain Layout
19483 .pstex_t
19484 \end_layout
19485
19486 \end_inset
19487
19488  files needs the relative name in order to rewrite the file content.
19489 \end_layout
19490
19491 \begin_layout Section
19492 Security discussion
19493 \begin_inset CommandInset label
19494 LatexCommand label
19495 name "sec:Security-discussion"
19496
19497 \end_inset
19498
19499
19500 \end_layout
19501
19502 \begin_layout Standard
19503 The external material feature interfaces with a lot of external programs
19504  and does so automatically, so we have to consider the security implications
19505  of this.
19506  In particular, since you have the option of including your own filenames
19507  and/or parameter strings and those are expanded into a command, it seems
19508  that it would be possible to create a malicious document which executes
19509  arbitrary commands when a user views or prints the document.
19510  This is something we definitely want to avoid.
19511 \end_layout
19512
19513 \begin_layout Standard
19514 However, since the external program commands are specified in the template
19515  configuration file only, there are no security issues if LyX is properly
19516  configured with safe templates only.
19517  This is so because the external programs are invoked with the 
19518 \begin_inset Flex CharStyle:Code
19519 status collapsed
19520
19521 \begin_layout Plain Layout
19522 execvp
19523 \end_layout
19524
19525 \end_inset
19526
19527 -system call rather than the 
19528 \begin_inset Flex CharStyle:Code
19529 status collapsed
19530
19531 \begin_layout Plain Layout
19532 system
19533 \end_layout
19534
19535 \end_inset
19536
19537  system-call, so it's not possible to execute arbitrary commands from the
19538  filename or parameter section via the shell.
19539 \end_layout
19540
19541 \begin_layout Standard
19542 This also implies that you are restricted in what command strings you can
19543  use in the external material templates.
19544  In particular, pipes and redirection are not readily available.
19545  This has to be so if LyX should remain safe.
19546  If you want to use some of the shell features, you should write a safe
19547  script to do this in a controlled manner, and then invoke the script from
19548  the command string.
19549  
19550 \end_layout
19551
19552 \begin_layout Standard
19553 It is possible to design a template that interacts directly with the shell,
19554  but since this would allow a malicious user to execute arbitrary commands
19555  by writing clever filenames and/or parameters, we generally recommend that
19556  you only use safe scripts that work with the 
19557 \begin_inset Flex CharStyle:Code
19558 status collapsed
19559
19560 \begin_layout Plain Layout
19561 execvp
19562 \end_layout
19563
19564 \end_inset
19565
19566  system call in a controlled manner.
19567  Of course, for use in a controlled environment, it can be tempting to just
19568  fall back to use ordinary shell scripts.
19569  If you do so, be aware that you 
19570 \emph on
19571 will
19572 \emph default
19573  provide an easily exploitable security hole in your system.
19574  Of course it stands to reason that such unsafe templates will never be
19575  included in the standard LyX distribution, although we do encourage people
19576  to submit new templates in the open source tradition.
19577  But LyX as shipped from the official distribution channels will never have
19578  unsafe templates.
19579 \end_layout
19580
19581 \begin_layout Standard
19582 Including external material provides a lot of power, and you have to be
19583  careful not to introduce security hazards with this power.
19584  A subtle error in a single line in an innocent looking script can open
19585  the door to huge security problems.
19586  So if you do not fully understand the issues, we recommend that you consult
19587  a knowledgeable security professional or the LyX development team if you
19588  have any questions about whether a given template is safe or not.
19589  And do this before you use it in an uncontrolled environment.
19590 \end_layout
19591
19592 \end_body
19593 \end_document