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