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