]> git.lyx.org Git - features.git/blob - lib/doc/Customization.lyx
Accept earlier changes.
[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  may be be any valid identifier not used by a pre-existing inset.
13997  The identifier may include spaces, but in that case the whole thing must
13998  be wrapped in quotes.
13999  It may also include a namespace identifier, preceding a colon, such as
14000  
14001 \begin_inset Quotes eld
14002 \end_inset
14003
14004
14005 \begin_inset Flex Code
14006 status collapsed
14007
14008 \begin_layout Plain Layout
14009 Flex:Code
14010 \end_layout
14011
14012 \end_inset
14013
14014
14015 \begin_inset Quotes erd
14016 \end_inset
14017
14018 .
14019  Note that the definition of a flex inset 
14020 \emph on
14021 must 
14022 \emph default
14023 also include a 
14024 \begin_inset Flex Code
14025 status collapsed
14026
14027 \begin_layout Plain Layout
14028 LyXType
14029 \end_layout
14030
14031 \end_inset
14032
14033  entry, declaring which type of inset it defines.
14034 \end_layout
14035
14036 \begin_layout Standard
14037 The 
14038 \begin_inset Flex Code
14039 status collapsed
14040
14041 \begin_layout Plain Layout
14042 InsetLayout
14043 \end_layout
14044
14045 \end_inset
14046
14047  definition can contain the following entries:
14048 \end_layout
14049
14050 \begin_layout Description
14051 \begin_inset Flex Code
14052 status collapsed
14053
14054 \begin_layout Plain Layout
14055 BgColor
14056 \end_layout
14057
14058 \end_inset
14059
14060  The color for the inset's background.
14061  The valid colors are defined in 
14062 \begin_inset Flex Code
14063 status collapsed
14064
14065 \begin_layout Plain Layout
14066 src/ColorCode.h
14067 \end_layout
14068
14069 \end_inset
14070
14071 .
14072 \end_layout
14073
14074 \begin_layout Description
14075 \begin_inset Flex Code
14076 status collapsed
14077
14078 \begin_layout Plain Layout
14079 ContentAsLabel
14080 \end_layout
14081
14082 \end_inset
14083
14084  [
14085 \begin_inset Flex Code
14086 status collapsed
14087
14088 \begin_layout Plain Layout
14089
14090 \emph on
14091 0
14092 \end_layout
14093
14094 \end_inset
14095
14096 ,
14097 \begin_inset Flex Code
14098 status collapsed
14099
14100 \begin_layout Plain Layout
14101 1
14102 \end_layout
14103
14104 \end_inset
14105
14106 ] Whether to use the content of the inset as the label, when the inset is
14107  closed.
14108  Default is false.
14109 \end_layout
14110
14111 \begin_layout Description
14112 \begin_inset Flex Code
14113 status collapsed
14114
14115 \begin_layout Plain Layout
14116 CopyStyle
14117 \end_layout
14118
14119 \end_inset
14120
14121  As with paragraph styles (see page 
14122 \begin_inset CommandInset ref
14123 LatexCommand ref
14124 reference "des:CopyStyle"
14125
14126 \end_inset
14127
14128 ).
14129 \end_layout
14130
14131 \begin_layout Description
14132 \begin_inset Flex Code
14133 status collapsed
14134
14135 \begin_layout Plain Layout
14136 CustomPars
14137 \end_layout
14138
14139 \end_inset
14140
14141  [
14142 \begin_inset Flex Code
14143 status collapsed
14144
14145 \begin_layout Plain Layout
14146
14147 \emph on
14148 0
14149 \end_layout
14150
14151 \end_inset
14152
14153 ,
14154 \begin_inset Flex Code
14155 status collapsed
14156
14157 \begin_layout Plain Layout
14158 1
14159 \end_layout
14160
14161 \end_inset
14162
14163 ] Indicates whether the user may employ the Paragraph Settings dialog to
14164  customize the paragraph.
14165 \end_layout
14166
14167 \begin_layout Description
14168 \begin_inset Flex Code
14169 status collapsed
14170
14171 \begin_layout Plain Layout
14172 Decoration
14173 \end_layout
14174
14175 \end_inset
14176
14177  can be 
14178 \begin_inset Flex Code
14179 status collapsed
14180
14181 \begin_layout Plain Layout
14182 Classic
14183 \end_layout
14184
14185 \end_inset
14186
14187
14188 \begin_inset Flex Code
14189 status collapsed
14190
14191 \begin_layout Plain Layout
14192 Minimalistic
14193 \end_layout
14194
14195 \end_inset
14196
14197 , or 
14198 \begin_inset Flex Code
14199 status collapsed
14200
14201 \begin_layout Plain Layout
14202 Conglomerate
14203 \end_layout
14204
14205 \end_inset
14206
14207 , describing the rendering style used for the inset's frame and buttons.
14208  Footnotes generally use 
14209 \begin_inset Flex Code
14210 status collapsed
14211
14212 \begin_layout Plain Layout
14213 Classic
14214 \end_layout
14215
14216 \end_inset
14217
14218 , ERT insets generally 
14219 \begin_inset Flex Code
14220 status collapsed
14221
14222 \begin_layout Plain Layout
14223 Minimalistic
14224 \end_layout
14225
14226 \end_inset
14227
14228 , and character styles 
14229 \begin_inset Flex Code
14230 status collapsed
14231
14232 \begin_layout Plain Layout
14233 Conglomerate
14234 \end_layout
14235
14236 \end_inset
14237
14238 .
14239 \end_layout
14240
14241 \begin_layout Description
14242 \begin_inset Flex Code
14243 status collapsed
14244
14245 \begin_layout Plain Layout
14246 Display
14247 \end_layout
14248
14249 \end_inset
14250
14251  [
14252 \begin_inset Flex Code
14253 status collapsed
14254
14255 \begin_layout Plain Layout
14256 0
14257 \end_layout
14258
14259 \end_inset
14260
14261 ,
14262 \begin_inset Flex Code
14263 status collapsed
14264
14265 \begin_layout Plain Layout
14266
14267 \emph on
14268 1
14269 \end_layout
14270
14271 \end_inset
14272
14273 ] Only useful if 
14274 \begin_inset Flex Code
14275 status collapsed
14276
14277 \begin_layout Plain Layout
14278 LatexType
14279 \end_layout
14280
14281 \end_inset
14282
14283  is 
14284 \begin_inset Flex Code
14285 status collapsed
14286
14287 \begin_layout Plain Layout
14288 Environment
14289 \end_layout
14290
14291 \end_inset
14292
14293 .
14294  Indicates whether the environment will stand on its own in LaTeX output
14295  or will appear inline with the surrounding text.
14296  If set to false, it is supposed that the LaTeX environment ignores white
14297  space (including one newline character) after the 
14298 \begin_inset Flex Code
14299 status collapsed
14300
14301 \begin_layout Plain Layout
14302
14303 \backslash
14304 begin{
14305 \emph on
14306 LatexName
14307 \emph default
14308 }
14309 \end_layout
14310
14311 \end_inset
14312
14313  and 
14314 \begin_inset Flex Code
14315 status collapsed
14316
14317 \begin_layout Plain Layout
14318
14319 \backslash
14320 end{
14321 \emph on
14322 LatexName
14323 \emph default
14324 }
14325 \end_layout
14326
14327 \end_inset
14328
14329  tags.
14330  Default is true.
14331 \end_layout
14332
14333 \begin_layout Description
14334 \begin_inset Flex Code
14335 status collapsed
14336
14337 \begin_layout Plain Layout
14338 End
14339 \end_layout
14340
14341 \end_inset
14342
14343  Required at the end of the InsetLayout declarations.
14344 \end_layout
14345
14346 \begin_layout Description
14347 \begin_inset Flex Code
14348 status collapsed
14349
14350 \begin_layout Plain Layout
14351 Font
14352 \end_layout
14353
14354 \end_inset
14355
14356  The font used for both the text body 
14357 \emph on
14358 and
14359 \emph default
14360  the label.
14361  See section
14362 \begin_inset space ~
14363 \end_inset
14364
14365
14366 \begin_inset CommandInset ref
14367 LatexCommand ref
14368 reference "sub:Font-description"
14369
14370 \end_inset
14371
14372 .
14373  Note that defining this font automatically defines the 
14374 \begin_inset Flex Code
14375 status collapsed
14376
14377 \begin_layout Plain Layout
14378 LabelFont
14379 \end_layout
14380
14381 \end_inset
14382
14383  to the same value, so define this first and define 
14384 \begin_inset Flex Code
14385 status collapsed
14386
14387 \begin_layout Plain Layout
14388 LabelFont
14389 \end_layout
14390
14391 \end_inset
14392
14393  later if you want them to be different.
14394 \end_layout
14395
14396 \begin_layout Description
14397 \begin_inset Flex Code
14398 status collapsed
14399
14400 \begin_layout Plain Layout
14401 ForceLTR
14402 \end_layout
14403
14404 \end_inset
14405
14406  Force the 
14407 \begin_inset Quotes eld
14408 \end_inset
14409
14410 latex
14411 \begin_inset Quotes erd
14412 \end_inset
14413
14414  language, leading to Left-to-Right (latin) output, e.
14415 \begin_inset space \thinspace{}
14416 \end_inset
14417
14418 g.
14419 \begin_inset space \space{}
14420 \end_inset
14421
14422 in TeX code or URL.
14423  A kludge.
14424 \end_layout
14425
14426 \begin_layout Description
14427 \begin_inset Flex Code
14428 status collapsed
14429
14430 \begin_layout Plain Layout
14431 ForcePlain
14432 \end_layout
14433
14434 \end_inset
14435
14436  [
14437 \begin_inset Flex Code
14438 status collapsed
14439
14440 \begin_layout Plain Layout
14441
14442 \emph on
14443 0
14444 \end_layout
14445
14446 \end_inset
14447
14448 ,
14449 \begin_inset Flex Code
14450 status collapsed
14451
14452 \begin_layout Plain Layout
14453 1
14454 \end_layout
14455
14456 \end_inset
14457
14458 ] Indicates whether the 
14459 \begin_inset Flex Code
14460 status collapsed
14461
14462 \begin_layout Plain Layout
14463 PlainLayout
14464 \end_layout
14465
14466 \end_inset
14467
14468  should be used or, instead, the user can change the paragraph style used
14469  in the inset.
14470  Default is false.
14471 \end_layout
14472
14473 \begin_layout Description
14474 \begin_inset Flex Code
14475 status collapsed
14476
14477 \begin_layout Plain Layout
14478 FreeSpacing
14479 \end_layout
14480
14481 \end_inset
14482
14483  As with paragraph styles (see page 
14484 \begin_inset CommandInset ref
14485 LatexCommand pageref
14486 reference "des:FreeSpacing"
14487
14488 \end_inset
14489
14490 ).
14491  Default is false.
14492 \end_layout
14493
14494 \begin_layout Description
14495 \begin_inset Flex Code
14496 status collapsed
14497
14498 \begin_layout Plain Layout
14499 HTML*
14500 \end_layout
14501
14502 \end_inset
14503
14504  These tags control XHTML output.
14505  See section 
14506 \begin_inset CommandInset ref
14507 LatexCommand ref
14508 reference "sec:Tags-for-XHTML"
14509
14510 \end_inset
14511
14512 .
14513 \end_layout
14514
14515 \begin_layout Description
14516 \begin_inset Flex Code
14517 status collapsed
14518
14519 \begin_layout Plain Layout
14520 InToc
14521 \end_layout
14522
14523 \end_inset
14524
14525  [
14526 \begin_inset Flex Code
14527 status collapsed
14528
14529 \begin_layout Plain Layout
14530
14531 \emph on
14532 0
14533 \end_layout
14534
14535 \end_inset
14536
14537 ,
14538 \begin_inset Flex Code
14539 status collapsed
14540
14541 \begin_layout Plain Layout
14542 1
14543 \end_layout
14544
14545 \end_inset
14546
14547 ] Whether to include the contents of this inset in the strings generated
14548  for the `Outline' pane.
14549  One would not, for example, want the content of a footnote in a section
14550  header to be included in the TOC displayed in the outline, but one would
14551  normally want the content of a character style displayed.
14552  Default is false: not to include.
14553 \end_layout
14554
14555 \begin_layout Description
14556 \begin_inset Flex Code
14557 status collapsed
14558
14559 \begin_layout Plain Layout
14560 KeepEmpty
14561 \end_layout
14562
14563 \end_inset
14564
14565  As with paragraph styles (see page 
14566 \begin_inset CommandInset ref
14567 LatexCommand pageref
14568 reference "des:KeepEmpty"
14569
14570 \end_inset
14571
14572 ).
14573  Default is false.
14574 \end_layout
14575
14576 \begin_layout Description
14577 \begin_inset Flex Code
14578 status collapsed
14579
14580 \begin_layout Plain Layout
14581 LabelFont
14582 \end_layout
14583
14584 \end_inset
14585
14586  The font used for the label.
14587  See section
14588 \begin_inset space ~
14589 \end_inset
14590
14591
14592 \begin_inset CommandInset ref
14593 LatexCommand ref
14594 reference "sub:Font-description"
14595
14596 \end_inset
14597
14598 .
14599  Note that this definition can never appear before 
14600 \begin_inset Flex Code
14601 status collapsed
14602
14603 \begin_layout Plain Layout
14604 Font
14605 \end_layout
14606
14607 \end_inset
14608
14609 , lest it be ineffective.
14610 \end_layout
14611
14612 \begin_layout Description
14613 \begin_inset Flex Code
14614 status collapsed
14615
14616 \begin_layout Plain Layout
14617 LabelString
14618 \end_layout
14619
14620 \end_inset
14621
14622  What will be displayed on the button or elsewhere as the inset label.
14623  Some inset types (
14624 \begin_inset Flex Code
14625 status collapsed
14626
14627 \begin_layout Plain Layout
14628 TeX code
14629 \end_layout
14630
14631 \end_inset
14632
14633  and 
14634 \begin_inset Flex Code
14635 status collapsed
14636
14637 \begin_layout Plain Layout
14638 Branch
14639 \end_layout
14640
14641 \end_inset
14642
14643 ) modify this label on the fly.
14644 \end_layout
14645
14646 \begin_layout Description
14647 \begin_inset Flex Code
14648 status collapsed
14649
14650 \begin_layout Plain Layout
14651 LatexName
14652 \end_layout
14653
14654 \end_inset
14655
14656  The name of the corresponding LaTeX stuff.
14657  Either the environment or command name.
14658 \end_layout
14659
14660 \begin_layout Description
14661 \begin_inset Flex Code
14662 status collapsed
14663
14664 \begin_layout Plain Layout
14665 LatexParam
14666 \end_layout
14667
14668 \end_inset
14669
14670  The optional parameter for the corresponding 
14671 \begin_inset Flex Code
14672 status collapsed
14673
14674 \begin_layout Plain Layout
14675 LatexName
14676 \end_layout
14677
14678 \end_inset
14679
14680  stuff, including possible bracket pairs like 
14681 \begin_inset Flex Code
14682 status collapsed
14683
14684 \begin_layout Plain Layout
14685 []
14686 \end_layout
14687
14688 \end_inset
14689
14690 .
14691  This parameter cannot be changed from within LyX.
14692 \end_layout
14693
14694 \begin_layout Description
14695 \begin_inset Flex Code
14696 status collapsed
14697
14698 \begin_layout Plain Layout
14699 LatexType
14700 \end_layout
14701
14702 \end_inset
14703
14704  As with paragraph styles (see page 
14705 \begin_inset CommandInset ref
14706 LatexCommand pageref
14707 reference "des:LatexType"
14708
14709 \end_inset
14710
14711 ).
14712 \end_layout
14713
14714 \begin_layout Description
14715 \begin_inset Flex Code
14716 status collapsed
14717
14718 \begin_layout Plain Layout
14719 LyxType
14720 \end_layout
14721
14722 \end_inset
14723
14724  Can be 
14725 \begin_inset Flex Code
14726 status collapsed
14727
14728 \begin_layout Plain Layout
14729 charstyle
14730 \end_layout
14731
14732 \end_inset
14733
14734
14735 \begin_inset Flex Code
14736 status collapsed
14737
14738 \begin_layout Plain Layout
14739 custom
14740 \end_layout
14741
14742 \end_inset
14743
14744
14745 \begin_inset Flex Code
14746 status collapsed
14747
14748 \begin_layout Plain Layout
14749 element
14750 \end_layout
14751
14752 \end_inset
14753
14754 , or 
14755 \begin_inset Flex Code
14756 status collapsed
14757
14758 \begin_layout Plain Layout
14759 end
14760 \end_layout
14761
14762 \end_inset
14763
14764  (indicating a dummy definition ending definitions of charstyles, etc).
14765  This entry is required in and is only meaningful for Flex insets.
14766  Among other things, it determines on which menu this inset will appear.
14767  Setting 
14768 \begin_inset Flex Code
14769 status collapsed
14770
14771 \begin_layout Plain Layout
14772 LyXType
14773 \end_layout
14774
14775 \end_inset
14776
14777  to 
14778 \begin_inset Flex Code
14779 status collapsed
14780
14781 \begin_layout Plain Layout
14782 charstyle
14783 \end_layout
14784
14785 \end_inset
14786
14787  will set 
14788 \begin_inset Flex Code
14789 status collapsed
14790
14791 \begin_layout Plain Layout
14792 MultiPar
14793 \end_layout
14794
14795 \end_inset
14796
14797  to false.
14798  
14799 \begin_inset Flex Code
14800 status collapsed
14801
14802 \begin_layout Plain Layout
14803 MultiPar
14804 \end_layout
14805
14806 \end_inset
14807
14808  can be set to true for charstyle insets, if you wish, by setting it 
14809 \emph on
14810 after
14811 \emph default
14812  you set the 
14813 \begin_inset Flex Code
14814 status collapsed
14815
14816 \begin_layout Plain Layout
14817 LyXType
14818 \end_layout
14819
14820 \end_inset
14821
14822 .
14823 \end_layout
14824
14825 \begin_layout Description
14826 \begin_inset Flex Code
14827 status collapsed
14828
14829 \begin_layout Plain Layout
14830 MultiPar
14831 \end_layout
14832
14833 \end_inset
14834
14835  [
14836 \begin_inset Flex Code
14837 status collapsed
14838
14839 \begin_layout Plain Layout
14840
14841 \emph on
14842 0
14843 \end_layout
14844
14845 \end_inset
14846
14847 ,
14848 \begin_inset Flex Code
14849 status collapsed
14850
14851 \begin_layout Plain Layout
14852 1
14853 \end_layout
14854
14855 \end_inset
14856
14857 ] Whether multiple paragraphs are permitted in this inset.
14858  This will also set 
14859 \begin_inset Flex Code
14860 status collapsed
14861
14862 \begin_layout Plain Layout
14863 CustomPars
14864 \end_layout
14865
14866 \end_inset
14867
14868  to the same value and 
14869 \begin_inset Flex Code
14870 status collapsed
14871
14872 \begin_layout Plain Layout
14873 ForcePlain
14874 \end_layout
14875
14876 \end_inset
14877
14878  to the opposite value.
14879  These can be reset to other values, if they are used 
14880 \emph on
14881 after
14882 \emph default
14883  
14884 \begin_inset Flex Code
14885 status collapsed
14886
14887 \begin_layout Plain Layout
14888 MultiPar
14889 \end_layout
14890
14891 \end_inset
14892
14893 .
14894  Default is true.
14895 \end_layout
14896
14897 \begin_layout Description
14898 \begin_inset Flex Code
14899 status collapsed
14900
14901 \begin_layout Plain Layout
14902 NeedProtect
14903 \end_layout
14904
14905 \end_inset
14906
14907  [
14908 \begin_inset Flex Code
14909 status collapsed
14910
14911 \begin_layout Plain Layout
14912
14913 \emph on
14914 0
14915 \end_layout
14916
14917 \end_inset
14918
14919 ,
14920 \begin_inset Flex Code
14921 status collapsed
14922
14923 \begin_layout Plain Layout
14924 1
14925 \end_layout
14926
14927 \end_inset
14928
14929 ] Whether fragile commands in this inset should be 
14930 \begin_inset Flex Code
14931 status collapsed
14932
14933 \begin_layout Plain Layout
14934
14935 \backslash
14936 protect
14937 \end_layout
14938
14939 \end_inset
14940
14941 'ed.
14942  (Note: This is 
14943 \emph on
14944 not
14945 \emph default
14946  whether the command should itself be protected.) Default is false.
14947 \end_layout
14948
14949 \begin_layout Description
14950 \begin_inset Flex Code
14951 status collapsed
14952
14953 \begin_layout Plain Layout
14954 ParbreakIsNewline
14955 \end_layout
14956
14957 \end_inset
14958
14959  [
14960 \begin_inset Flex Code
14961 status collapsed
14962
14963 \begin_layout Plain Layout
14964
14965 \emph on
14966 0
14967 \end_layout
14968
14969 \end_inset
14970
14971
14972 \begin_inset Flex Code
14973 status collapsed
14974
14975 \begin_layout Plain Layout
14976 1
14977 \end_layout
14978
14979 \end_inset
14980
14981 ] As with paragraph styles (see page 
14982 \begin_inset CommandInset ref
14983 LatexCommand pageref
14984 reference "des:ParbreakIsNewline"
14985
14986 \end_inset
14987
14988 ).
14989  Default is false.
14990 \end_layout
14991
14992 \begin_layout Description
14993 \begin_inset Flex Code
14994 status collapsed
14995
14996 \begin_layout Plain Layout
14997 PassThru
14998 \end_layout
14999
15000 \end_inset
15001
15002  [
15003 \begin_inset Flex Code
15004 status collapsed
15005
15006 \begin_layout Plain Layout
15007
15008 \emph on
15009 0
15010 \end_layout
15011
15012 \end_inset
15013
15014 ,
15015 \begin_inset Flex Code
15016 status collapsed
15017
15018 \begin_layout Plain Layout
15019 1
15020 \end_layout
15021
15022 \end_inset
15023
15024 ] As with paragraph styles (see page 
15025 \begin_inset CommandInset ref
15026 LatexCommand pageref
15027 reference "des:PassThru"
15028
15029 \end_inset
15030
15031 ).
15032  Default is false.
15033 \end_layout
15034
15035 \begin_layout Description
15036 \begin_inset Flex Code
15037 status collapsed
15038
15039 \begin_layout Plain Layout
15040 Preamble
15041 \end_layout
15042
15043 \end_inset
15044
15045  As with paragraph styles (see page 
15046 \begin_inset CommandInset ref
15047 LatexCommand pageref
15048 reference "des:Preamble"
15049
15050 \end_inset
15051
15052 ).
15053 \end_layout
15054
15055 \begin_layout Description
15056 \begin_inset Flex Code
15057 status collapsed
15058
15059 \begin_layout Plain Layout
15060 RefPrefix
15061 \end_layout
15062
15063 \end_inset
15064
15065  [
15066 \begin_inset Flex Code
15067 status collapsed
15068
15069 \begin_layout Plain Layout
15070 string
15071 \end_layout
15072
15073 \end_inset
15074
15075 ] The prefix to use when creating labels referring to insets of this type.
15076  This allows the use of formatted references.
15077 \end_layout
15078
15079 \begin_layout Description
15080 \begin_inset Flex Code
15081 status collapsed
15082
15083 \begin_layout Plain Layout
15084 Requires
15085 \end_layout
15086
15087 \end_inset
15088
15089  [
15090 \begin_inset Flex Code
15091 status collapsed
15092
15093 \begin_layout Plain Layout
15094 string
15095 \end_layout
15096
15097 \end_inset
15098
15099 ] As with paragraph styles (see page 
15100 \begin_inset CommandInset ref
15101 LatexCommand pageref
15102 reference "des:Requires"
15103
15104 \end_inset
15105
15106 ).
15107 \end_layout
15108
15109 \begin_layout Description
15110 \begin_inset Flex Code
15111 status collapsed
15112
15113 \begin_layout Plain Layout
15114 ResetsFont
15115 \end_layout
15116
15117 \end_inset
15118
15119  [
15120 \begin_inset Flex Code
15121 status collapsed
15122
15123 \begin_layout Plain Layout
15124 0
15125 \end_layout
15126
15127 \end_inset
15128
15129 ,
15130 \begin_inset Flex Code
15131 status collapsed
15132
15133 \begin_layout Plain Layout
15134
15135 \emph on
15136 1
15137 \end_layout
15138
15139 \end_inset
15140
15141 ] Whether this inset should use the font of its surrounding environment
15142  or uses its own.
15143  Default is true: uses its own.
15144 \end_layout
15145
15146 \begin_layout Description
15147 \begin_inset Flex Code
15148 status collapsed
15149
15150 \begin_layout Plain Layout
15151 Spellcheck
15152 \end_layout
15153
15154 \end_inset
15155
15156  [
15157 \begin_inset Flex Code
15158 status collapsed
15159
15160 \begin_layout Plain Layout
15161 0
15162 \end_layout
15163
15164 \end_inset
15165
15166 ,
15167 \begin_inset Flex Code
15168 status collapsed
15169
15170 \begin_layout Plain Layout
15171
15172 \emph on
15173 1
15174 \end_layout
15175
15176 \end_inset
15177
15178 ] Spellcheck the contents of this inset.
15179  Default is true.
15180 \end_layout
15181
15182 \begin_layout Subsection
15183 Counters
15184 \begin_inset CommandInset label
15185 LatexCommand label
15186 name "sub:Counters"
15187
15188 \end_inset
15189
15190
15191 \end_layout
15192
15193 \begin_layout Standard
15194 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15195  counters (
15196 \begin_inset Flex MenuItem
15197 status collapsed
15198
15199 \begin_layout Plain Layout
15200 chapter
15201 \end_layout
15202
15203 \end_inset
15204
15205
15206 \begin_inset Flex MenuItem
15207 status collapsed
15208
15209 \begin_layout Plain Layout
15210 figure
15211 \end_layout
15212
15213 \end_inset
15214
15215 , \SpecialChar \ldots{}
15216 ) in the text class itself.
15217  The standard counters are defined in the file 
15218 \begin_inset Flex Code
15219 status collapsed
15220
15221 \begin_layout Plain Layout
15222 stdcounters.inc
15223 \end_layout
15224
15225 \end_inset
15226
15227 , so you may have to do no more than add
15228 \end_layout
15229
15230 \begin_layout LyX-Code
15231 Input stdcounters.inc
15232 \end_layout
15233
15234 \begin_layout Standard
15235 to your layout file to get them to work.
15236  But if you want to define custom counters, then you can do so.
15237  The counter declaration must begin with:
15238 \end_layout
15239
15240 \begin_layout LyX-Code
15241 Counter CounterName
15242 \end_layout
15243
15244 \begin_layout Standard
15245 where of course `
15246 \begin_inset Flex Code
15247 status collapsed
15248
15249 \begin_layout Plain Layout
15250 CounterName
15251 \end_layout
15252
15253 \end_inset
15254
15255 ' is replaced by the name of the counter.
15256  And it must end with 
15257 \begin_inset Quotes eld
15258 \end_inset
15259
15260
15261 \begin_inset Flex Code
15262 status collapsed
15263
15264 \begin_layout Plain Layout
15265 End
15266 \end_layout
15267
15268 \end_inset
15269
15270
15271 \begin_inset Quotes erd
15272 \end_inset
15273
15274 .
15275  The following parameters can also be used:
15276 \end_layout
15277
15278 \begin_layout Description
15279 \begin_inset Flex Code
15280 status collapsed
15281
15282 \begin_layout Plain Layout
15283 LabelString
15284 \end_layout
15285
15286 \end_inset
15287
15288  [
15289 \begin_inset Flex Code
15290 status collapsed
15291
15292 \begin_layout Plain Layout
15293 string
15294 \end_layout
15295
15296 \end_inset
15297
15298 =
15299 \begin_inset Quotes erd
15300 \end_inset
15301
15302
15303 \begin_inset Quotes erd
15304 \end_inset
15305
15306 ] When defined, this string defines how the counter is displayed.
15307  Setting this value sets 
15308 \begin_inset Flex Code
15309 status collapsed
15310
15311 \begin_layout Plain Layout
15312 LabelStringAppendix
15313 \end_layout
15314
15315 \end_inset
15316
15317  to the same value.
15318  The following special constructs can be used in the string:
15319 \end_layout
15320
15321 \begin_deeper
15322 \begin_layout Itemize
15323 \begin_inset Flex Code
15324 status collapsed
15325
15326 \begin_layout Plain Layout
15327
15328 \backslash
15329 thecounter
15330 \end_layout
15331
15332 \end_inset
15333
15334  will be replaced by the expansion of the 
15335 \begin_inset Flex Code
15336 status collapsed
15337
15338 \begin_layout Plain Layout
15339 LabelString
15340 \end_layout
15341
15342 \end_inset
15343
15344  (or 
15345 \begin_inset Flex Code
15346 status collapsed
15347
15348 \begin_layout Plain Layout
15349 LabelStringAppendix
15350 \end_layout
15351
15352 \end_inset
15353
15354 ) of the counter 
15355 \begin_inset Flex Code
15356 status collapsed
15357
15358 \begin_layout Plain Layout
15359 counter
15360 \end_layout
15361
15362 \end_inset
15363
15364 .
15365  
15366 \end_layout
15367
15368 \begin_layout Itemize
15369 counter values can be expressed using LaTeX-like macros 
15370 \begin_inset Flex Code
15371 status collapsed
15372
15373 \begin_layout Plain Layout
15374
15375 \backslash
15376
15377 \emph on
15378 numbertype
15379 \emph default
15380 {
15381 \emph on
15382 counter
15383 \emph default
15384 }
15385 \end_layout
15386
15387 \end_inset
15388
15389 , where 
15390 \begin_inset Flex Code
15391 status collapsed
15392
15393 \begin_layout Plain Layout
15394
15395 \emph on
15396 numbertype
15397 \end_layout
15398
15399 \end_inset
15400
15401  can be:
15402 \begin_inset Foot
15403 status collapsed
15404
15405 \begin_layout Plain Layout
15406
15407 \family roman
15408 \series medium
15409 \shape up
15410 \size normal
15411 \emph off
15412 \bar no
15413 \noun off
15414 \color none
15415 Actually, the situation is a bit more complicated: any
15416 \family default
15417 \series default
15418 \shape default
15419 \emph default
15420 \bar default
15421  
15422 \size default
15423 \emph on
15424 \noun default
15425 \color inherit
15426 numbertype
15427 \family roman
15428 \series medium
15429 \shape up
15430 \size normal
15431 \emph off
15432 \bar no
15433 \noun off
15434  other than those described below will produce arabic numerals.
15435  It would not be surprising to see this change in the future.
15436 \end_layout
15437
15438 \end_inset
15439
15440  
15441 \begin_inset Flex Code
15442 status collapsed
15443
15444 \begin_layout Plain Layout
15445 arabic
15446 \end_layout
15447
15448 \end_inset
15449
15450 : 1, 2, 3,\SpecialChar \ldots{}
15451
15452 \begin_inset Flex Code
15453 status collapsed
15454
15455 \begin_layout Plain Layout
15456 alph
15457 \end_layout
15458
15459 \end_inset
15460
15461  for lower-case letters: a, b, c, \SpecialChar \ldots{}
15462
15463 \begin_inset Flex Code
15464 status collapsed
15465
15466 \begin_layout Plain Layout
15467 Alph
15468 \end_layout
15469
15470 \end_inset
15471
15472  for upper-case letters: A, B, C, \SpecialChar \ldots{}
15473
15474 \begin_inset Flex Code
15475 status collapsed
15476
15477 \begin_layout Plain Layout
15478 roman
15479 \end_layout
15480
15481 \end_inset
15482
15483  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15484
15485 \begin_inset Flex Code
15486 status collapsed
15487
15488 \begin_layout Plain Layout
15489 Roman
15490 \end_layout
15491
15492 \end_inset
15493
15494  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15495
15496 \begin_inset Flex Code
15497 status collapsed
15498
15499 \begin_layout Plain Layout
15500 hebrew
15501 \end_layout
15502
15503 \end_inset
15504
15505  for hebrew numerals.
15506 \end_layout
15507
15508 \end_deeper
15509 \begin_layout Standard
15510 If LabelString is not defined, a default value is constructed as follows:
15511  if the counter has a master counter 
15512 \begin_inset Flex Code
15513 status collapsed
15514
15515 \begin_layout Plain Layout
15516 master
15517 \end_layout
15518
15519 \end_inset
15520
15521  (defined via 
15522 \begin_inset Flex Code
15523 status collapsed
15524
15525 \begin_layout Plain Layout
15526 Within
15527 \end_layout
15528
15529 \end_inset
15530
15531 ), the string 
15532 \begin_inset Flex Code
15533 status collapsed
15534
15535 \begin_layout Plain Layout
15536
15537 \backslash
15538 themaster.
15539 \backslash
15540 arabic{counter}
15541 \end_layout
15542
15543 \end_inset
15544
15545  is used; otherwise the string 
15546 \begin_inset Flex Code
15547 status collapsed
15548
15549 \begin_layout Plain Layout
15550
15551 \backslash
15552 arabic{counter}
15553 \end_layout
15554
15555 \end_inset
15556
15557  is used.
15558 \end_layout
15559
15560 \begin_layout Description
15561 \begin_inset Flex Code
15562 status collapsed
15563
15564 \begin_layout Plain Layout
15565 LabelStringAppendix
15566 \end_layout
15567
15568 \end_inset
15569
15570  [
15571 \begin_inset Flex Code
15572 status collapsed
15573
15574 \begin_layout Plain Layout
15575 string
15576 \end_layout
15577
15578 \end_inset
15579
15580 =
15581 \begin_inset Quotes erd
15582 \end_inset
15583
15584
15585 \begin_inset Quotes erd
15586 \end_inset
15587
15588 ] Same as 
15589 \begin_inset Flex Code
15590 status collapsed
15591
15592 \begin_layout Plain Layout
15593 LabelString
15594 \end_layout
15595
15596 \end_inset
15597
15598 , but for use in the Appendix.
15599 \end_layout
15600
15601 \begin_layout Description
15602 \begin_inset Flex Code
15603 status collapsed
15604
15605 \begin_layout Plain Layout
15606 PrettyFormat
15607 \end_layout
15608
15609 \end_inset
15610
15611  [
15612 \begin_inset Flex Code
15613 status collapsed
15614
15615 \begin_layout Plain Layout
15616 string
15617 \end_layout
15618
15619 \end_inset
15620
15621 =
15622 \begin_inset Quotes erd
15623 \end_inset
15624
15625
15626 \begin_inset Quotes erd
15627 \end_inset
15628
15629 ] A format for use with formatted references to this counter.
15630  For example, one might want to have references to section numbers appear
15631  as 
15632 \begin_inset Quotes eld
15633 \end_inset
15634
15635 Section 2.4
15636 \begin_inset Quotes erd
15637 \end_inset
15638
15639 .
15640  The string should contain 
15641 \begin_inset Quotes eld
15642 \end_inset
15643
15644 ##
15645 \begin_inset Quotes erd
15646 \end_inset
15647
15648 .
15649  This will be replaced by the counter number itself.
15650  So, for sections, it would be: Section ##.
15651 \end_layout
15652
15653 \begin_layout Description
15654 \begin_inset Flex Code
15655 status collapsed
15656
15657 \begin_layout Plain Layout
15658 Within
15659 \end_layout
15660
15661 \end_inset
15662
15663  [
15664 \begin_inset Flex Code
15665 status collapsed
15666
15667 \begin_layout Plain Layout
15668 string
15669 \end_layout
15670
15671 \end_inset
15672
15673 =
15674 \begin_inset Quotes erd
15675 \end_inset
15676
15677
15678 \begin_inset Quotes erd
15679 \end_inset
15680
15681 ] If this is set to the name of another counter, the present counter will
15682  be reset every time the other one is increased.
15683  For example, 
15684 \begin_inset Flex Code
15685 status collapsed
15686
15687 \begin_layout Plain Layout
15688 subsection
15689 \end_layout
15690
15691 \end_inset
15692
15693  is numbered inside 
15694 \begin_inset Flex Code
15695 status collapsed
15696
15697 \begin_layout Plain Layout
15698 section
15699 \end_layout
15700
15701 \end_inset
15702
15703 .
15704 \end_layout
15705
15706 \begin_layout Subsection
15707 Font description
15708 \begin_inset CommandInset label
15709 LatexCommand label
15710 name "sub:Font-description"
15711
15712 \end_inset
15713
15714
15715 \end_layout
15716
15717 \begin_layout Standard
15718 A font description looks like this:
15719 \end_layout
15720
15721 \begin_layout LyX-Code
15722 Font 
15723 \family roman
15724 \emph on
15725 or
15726 \family default
15727 \emph default
15728  LabelFont
15729 \end_layout
15730
15731 \begin_layout LyX-Code
15732  ...
15733 \end_layout
15734
15735 \begin_layout LyX-Code
15736 EndFont
15737 \end_layout
15738
15739 \begin_layout Standard
15740 The following commands are available:
15741 \end_layout
15742
15743 \begin_layout Description
15744 \begin_inset Flex Code
15745 status collapsed
15746
15747 \begin_layout Plain Layout
15748 Color
15749 \end_layout
15750
15751 \end_inset
15752
15753  [
15754 \begin_inset Flex Code
15755 status collapsed
15756
15757 \begin_layout Plain Layout
15758
15759 \emph on
15760 none
15761 \end_layout
15762
15763 \end_inset
15764
15765
15766 \begin_inset Flex Code
15767 status collapsed
15768
15769 \begin_layout Plain Layout
15770 black
15771 \end_layout
15772
15773 \end_inset
15774
15775
15776 \begin_inset Flex Code
15777 status collapsed
15778
15779 \begin_layout Plain Layout
15780 white
15781 \end_layout
15782
15783 \end_inset
15784
15785
15786 \begin_inset Flex Code
15787 status collapsed
15788
15789 \begin_layout Plain Layout
15790 red
15791 \end_layout
15792
15793 \end_inset
15794
15795
15796 \begin_inset Flex Code
15797 status collapsed
15798
15799 \begin_layout Plain Layout
15800 green
15801 \end_layout
15802
15803 \end_inset
15804
15805
15806 \begin_inset Flex Code
15807 status collapsed
15808
15809 \begin_layout Plain Layout
15810 blue
15811 \end_layout
15812
15813 \end_inset
15814
15815
15816 \begin_inset Flex Code
15817 status collapsed
15818
15819 \begin_layout Plain Layout
15820 cyan
15821 \end_layout
15822
15823 \end_inset
15824
15825
15826 \begin_inset Flex Code
15827 status collapsed
15828
15829 \begin_layout Plain Layout
15830 magenta
15831 \end_layout
15832
15833 \end_inset
15834
15835
15836 \begin_inset Flex Code
15837 status collapsed
15838
15839 \begin_layout Plain Layout
15840 yellow
15841 \end_layout
15842
15843 \end_inset
15844
15845 ]
15846 \end_layout
15847
15848 \begin_layout Description
15849 \begin_inset Flex Code
15850 status collapsed
15851
15852 \begin_layout Plain Layout
15853 Family
15854 \end_layout
15855
15856 \end_inset
15857
15858  [
15859 \begin_inset Flex Code
15860 status collapsed
15861
15862 \begin_layout Plain Layout
15863
15864 \emph on
15865 Roman
15866 \end_layout
15867
15868 \end_inset
15869
15870
15871 \begin_inset Flex Code
15872 status collapsed
15873
15874 \begin_layout Plain Layout
15875 Sans
15876 \end_layout
15877
15878 \end_inset
15879
15880
15881 \begin_inset Flex Code
15882 status collapsed
15883
15884 \begin_layout Plain Layout
15885 Typewriter
15886 \end_layout
15887
15888 \end_inset
15889
15890
15891 \end_layout
15892
15893 \begin_layout Description
15894 \begin_inset Flex Code
15895 status collapsed
15896
15897 \begin_layout Plain Layout
15898 Misc
15899 \end_layout
15900
15901 \end_inset
15902
15903  [
15904 \begin_inset Flex Code
15905 status collapsed
15906
15907 \begin_layout Plain Layout
15908 string
15909 \end_layout
15910
15911 \end_inset
15912
15913 ] Valid arguments are: 
15914 \begin_inset Flex Code
15915 status collapsed
15916
15917 \begin_layout Plain Layout
15918 emph
15919 \end_layout
15920
15921 \end_inset
15922
15923
15924 \begin_inset Flex Code
15925 status collapsed
15926
15927 \begin_layout Plain Layout
15928 noun
15929 \end_layout
15930
15931 \end_inset
15932
15933
15934 \begin_inset Flex Code
15935 status collapsed
15936
15937 \begin_layout Plain Layout
15938 underbar
15939 \end_layout
15940
15941 \end_inset
15942
15943
15944 \begin_inset Flex Code
15945 status collapsed
15946
15947 \begin_layout Plain Layout
15948 no_emph
15949 \end_layout
15950
15951 \end_inset
15952
15953
15954 \begin_inset Flex Code
15955 status collapsed
15956
15957 \begin_layout Plain Layout
15958 no_noun
15959 \end_layout
15960
15961 \end_inset
15962
15963  and 
15964 \begin_inset Flex Code
15965 status collapsed
15966
15967 \begin_layout Plain Layout
15968 no_bar
15969 \end_layout
15970
15971 \end_inset
15972
15973 .
15974  Each of these turns on or off the corresponding attribute.
15975  For example, 
15976 \begin_inset Flex Code
15977 status collapsed
15978
15979 \begin_layout Plain Layout
15980 emph
15981 \end_layout
15982
15983 \end_inset
15984
15985  turns on emphasis, and 
15986 \begin_inset Flex Code
15987 status collapsed
15988
15989 \begin_layout Plain Layout
15990 no_emph
15991 \end_layout
15992
15993 \end_inset
15994
15995  turns it off.
15996  
15997 \begin_inset Newline newline
15998 \end_inset
15999
16000 If the latter seems puzzling, remember that the font settings for the present
16001  context are generally inherited from the surrounding context.
16002  So 
16003 \begin_inset Flex Code
16004 status collapsed
16005
16006 \begin_layout Plain Layout
16007 no_emph
16008 \end_layout
16009
16010 \end_inset
16011
16012  would turn off the emphasis that was anyway in effect, say, in a theorem
16013  environment.
16014 \end_layout
16015
16016 \begin_layout Description
16017 \begin_inset Flex Code
16018 status collapsed
16019
16020 \begin_layout Plain Layout
16021 Series
16022 \end_layout
16023
16024 \end_inset
16025
16026  [
16027 \begin_inset Flex Code
16028 status collapsed
16029
16030 \begin_layout Plain Layout
16031
16032 \emph on
16033 Medium
16034 \end_layout
16035
16036 \end_inset
16037
16038
16039 \begin_inset Flex Code
16040 status collapsed
16041
16042 \begin_layout Plain Layout
16043 Bold
16044 \end_layout
16045
16046 \end_inset
16047
16048
16049 \end_layout
16050
16051 \begin_layout Description
16052 \begin_inset Flex Code
16053 status collapsed
16054
16055 \begin_layout Plain Layout
16056 Shape
16057 \end_layout
16058
16059 \end_inset
16060
16061  [
16062 \begin_inset Flex Code
16063 status collapsed
16064
16065 \begin_layout Plain Layout
16066
16067 \emph on
16068 Up
16069 \end_layout
16070
16071 \end_inset
16072
16073
16074 \begin_inset Flex Code
16075 status collapsed
16076
16077 \begin_layout Plain Layout
16078 Italic
16079 \end_layout
16080
16081 \end_inset
16082
16083
16084 \begin_inset Flex Code
16085 status collapsed
16086
16087 \begin_layout Plain Layout
16088 SmallCaps
16089 \end_layout
16090
16091 \end_inset
16092
16093
16094 \begin_inset Flex Code
16095 status collapsed
16096
16097 \begin_layout Plain Layout
16098 Slanted
16099 \end_layout
16100
16101 \end_inset
16102
16103
16104 \end_layout
16105
16106 \begin_layout Description
16107 \begin_inset Flex Code
16108 status collapsed
16109
16110 \begin_layout Plain Layout
16111 Size
16112 \end_layout
16113
16114 \end_inset
16115
16116  [
16117 \begin_inset Flex Code
16118 status collapsed
16119
16120 \begin_layout Plain Layout
16121 tiny
16122 \end_layout
16123
16124 \end_inset
16125
16126
16127 \begin_inset Flex Code
16128 status collapsed
16129
16130 \begin_layout Plain Layout
16131 small
16132 \end_layout
16133
16134 \end_inset
16135
16136
16137 \begin_inset Flex Code
16138 status collapsed
16139
16140 \begin_layout Plain Layout
16141
16142 \emph on
16143 normal
16144 \end_layout
16145
16146 \end_inset
16147
16148
16149 \begin_inset Flex Code
16150 status collapsed
16151
16152 \begin_layout Plain Layout
16153 large
16154 \end_layout
16155
16156 \end_inset
16157
16158
16159 \begin_inset Flex Code
16160 status collapsed
16161
16162 \begin_layout Plain Layout
16163 larger
16164 \end_layout
16165
16166 \end_inset
16167
16168
16169 \begin_inset Flex Code
16170 status collapsed
16171
16172 \begin_layout Plain Layout
16173 largest
16174 \end_layout
16175
16176 \end_inset
16177
16178
16179 \begin_inset Flex Code
16180 status collapsed
16181
16182 \begin_layout Plain Layout
16183 huge
16184 \end_layout
16185
16186 \end_inset
16187
16188
16189 \begin_inset Flex Code
16190 status collapsed
16191
16192 \begin_layout Plain Layout
16193 giant
16194 \end_layout
16195
16196 \end_inset
16197
16198 ]
16199 \end_layout
16200
16201 \begin_layout Subsection
16202 \begin_inset CommandInset label
16203 LatexCommand label
16204 name "sub:Citation-format-description"
16205
16206 \end_inset
16207
16208 Citation format description
16209 \end_layout
16210
16211 \begin_layout Standard
16212 The 
16213 \begin_inset Flex Code
16214 status collapsed
16215
16216 \begin_layout Plain Layout
16217 CiteFormat
16218 \end_layout
16219
16220 \end_inset
16221
16222  blocks are used to describe how bibliographic information should be displayed,
16223  both within LyX itself (in the citation dialog and in tooltips, for example)
16224  and in XHTML output.
16225  Such a block might look like this:
16226 \end_layout
16227
16228 \begin_layout LyX-Code
16229 CiteFormat
16230 \end_layout
16231
16232 \begin_layout LyX-Code
16233  article ...
16234 \end_layout
16235
16236 \begin_layout LyX-Code
16237  book ...
16238 \end_layout
16239
16240 \begin_layout LyX-Code
16241 End
16242 \end_layout
16243
16244 \begin_layout Standard
16245 The individual lines define how the bibliographic information associated
16246  with an article or book, respectively, is to be displayed, and such a definitio
16247 n can be given for any `entry type' that might be present in a BibTeX file.
16248  LyX defines a default format in the source code that will be used if no
16249  specific definition has been given.
16250  LyX predefines several formats in the file 
16251 \begin_inset Flex Code
16252 status collapsed
16253
16254 \begin_layout Plain Layout
16255 stdciteformats.inc
16256 \end_layout
16257
16258 \end_inset
16259
16260 , which is included in most of LyX's document classes.
16261 \end_layout
16262
16263 \begin_layout Standard
16264 The definitions use a simple language that allows BibTeX keys to be replaced
16265  with their values.
16266  Keys should be enclosed in 
16267 \begin_inset Flex Code
16268 status collapsed
16269
16270 \begin_layout Plain Layout
16271 %
16272 \end_layout
16273
16274 \end_inset
16275
16276  signs, e.g.: 
16277 \begin_inset Flex Code
16278 status collapsed
16279
16280 \begin_layout Plain Layout
16281 %author%
16282 \end_layout
16283
16284 \end_inset
16285
16286 .
16287  So a simple definition might look like this:
16288 \end_layout
16289
16290 \begin_layout LyX-Code
16291 misc %author%, 
16292 \begin_inset Quotes eld
16293 \end_inset
16294
16295 %title
16296 \begin_inset Quotes erd
16297 \end_inset
16298
16299 .
16300 \end_layout
16301
16302 \begin_layout Standard
16303 This would print the author, followed by a comma, followed by the title,
16304  in quotes, followed by a period.
16305 \end_layout
16306
16307 \begin_layout Standard
16308 Of course, sometimes you may want to print a key only if it exists.
16309  This can be done by using a conditional construction, such as: 
16310 \begin_inset Flex Code
16311 status collapsed
16312
16313 \begin_layout Plain Layout
16314 {%volume%[[vol.
16315 \begin_inset space ~
16316 \end_inset
16317
16318 %volume%]]}
16319 \end_layout
16320
16321 \end_inset
16322
16323 .
16324  This says: If the 
16325 \begin_inset Flex Code
16326 status collapsed
16327
16328 \begin_layout Plain Layout
16329 volume
16330 \end_layout
16331
16332 \end_inset
16333
16334  key exists, then print 
16335 \begin_inset Quotes eld
16336 \end_inset
16337
16338 vol.
16339 \begin_inset space ~
16340 \end_inset
16341
16342
16343 \begin_inset Quotes erd
16344 \end_inset
16345
16346  followed by the volume key.
16347  It is also possible to have an else clause in the conditional, such as:
16348  
16349 \begin_inset Flex Code
16350 status collapsed
16351
16352 \begin_layout Plain Layout
16353 {%author%[[%author%]][[%editor%, ed.]]}
16354 \end_layout
16355
16356 \end_inset
16357
16358 .
16359  Here, the 
16360 \begin_inset Flex Code
16361 status collapsed
16362
16363 \begin_layout Plain Layout
16364 author
16365 \end_layout
16366
16367 \end_inset
16368
16369  key is printed if it exists; otherwise, the editor key is printed, followed
16370  by 
16371 \begin_inset Quotes eld
16372 \end_inset
16373
16374 ,
16375 \begin_inset space ~
16376 \end_inset
16377
16378 ed.
16379 \begin_inset Quotes erd
16380 \end_inset
16381
16382  Note that the key is again enclosed in 
16383 \begin_inset Flex Code
16384 status collapsed
16385
16386 \begin_layout Plain Layout
16387 %
16388 \end_layout
16389
16390 \end_inset
16391
16392  signs; the entire conditional is enclosed in braces; and the if and else
16393  clauses are enclosed in double brackets, 
16394 \begin_inset Quotes eld
16395 \end_inset
16396
16397
16398 \begin_inset Flex Code
16399 status collapsed
16400
16401 \begin_layout Plain Layout
16402 [[
16403 \end_layout
16404
16405 \end_inset
16406
16407
16408 \begin_inset Quotes eld
16409 \end_inset
16410
16411  and 
16412 \begin_inset Quotes eld
16413 \end_inset
16414
16415
16416 \begin_inset Flex Code
16417 status collapsed
16418
16419 \begin_layout Plain Layout
16420 ]]
16421 \end_layout
16422
16423 \end_inset
16424
16425
16426 \begin_inset Quotes erd
16427 \end_inset
16428
16429 .
16430  There must be no space between any of these.
16431 \end_layout
16432
16433 \begin_layout Standard
16434 There is one other piece of syntax available in definitions, which looks
16435  like this: 
16436 \begin_inset Flex Code
16437 status collapsed
16438
16439 \begin_layout Plain Layout
16440 {!<i>!}
16441 \end_layout
16442
16443 \end_inset
16444
16445 .
16446  This defines a piece of formatting information that is to be used when
16447  creating 
16448 \begin_inset Quotes eld
16449 \end_inset
16450
16451 rich text
16452 \begin_inset Quotes erd
16453 \end_inset
16454
16455 .
16456  Obviously, we do not want to output HTML tags when writing plain text,
16457  so they should be wrapped in 
16458 \begin_inset Quotes eld
16459 \end_inset
16460
16461 {!
16462 \begin_inset Quotes erd
16463 \end_inset
16464
16465  and 
16466 \begin_inset Quotes eld
16467 \end_inset
16468
16469 !}
16470 \begin_inset Quotes erd
16471 \end_inset
16472
16473 .
16474 \end_layout
16475
16476 \begin_layout Standard
16477 Two special sorts of definitions are also possible in a 
16478 \begin_inset Flex Code
16479 status collapsed
16480
16481 \begin_layout Plain Layout
16482 CiteFormat
16483 \end_layout
16484
16485 \end_inset
16486
16487  block.
16488  An example of the first would be:
16489 \end_layout
16490
16491 \begin_layout LyX-Code
16492 !quotetitle 
16493 \begin_inset Quotes eld
16494 \end_inset
16495
16496 %title%
16497 \begin_inset Quotes erd
16498 \end_inset
16499
16500
16501 \end_layout
16502
16503 \begin_layout Standard
16504 This is an abbreviation, or macro, and it can be used by treating it as
16505  if it were a key: 
16506 \begin_inset Flex Code
16507 status collapsed
16508
16509 \begin_layout Plain Layout
16510 %!quotetitle%
16511 \end_layout
16512
16513 \end_inset
16514
16515 .
16516  LyX will treat 
16517 \begin_inset Flex Code
16518 status collapsed
16519
16520 \begin_layout Plain Layout
16521 %!quotetitle%
16522 \end_layout
16523
16524 \end_inset
16525
16526  exactly as it would treat its definition.
16527  So, let us issue the obvious 
16528 \emph on
16529 warning
16530 \emph default
16531 .
16532  Do not do this:
16533 \end_layout
16534
16535 \begin_layout LyX-Code
16536 !funfun %funfun%
16537 \end_layout
16538
16539 \begin_layout Standard
16540 or anything like it.
16541  LyX shouldn't go into an infinite loop, but it may go into a long one before
16542  it gives up.
16543 \end_layout
16544
16545 \begin_layout Standard
16546 The second sort of special definition might look like this:
16547 \end_layout
16548
16549 \begin_layout LyX-Code
16550 _pptext pp.
16551 \end_layout
16552
16553 \begin_layout Standard
16554 This defines a translatable piece of text, which allows relevant parts of
16555  the bibliography to be translated.
16556  It can be included in a definition by treating it as a key: 
16557 \begin_inset Flex Code
16558 status collapsed
16559
16560 \begin_layout Plain Layout
16561 %_pptext%
16562 \end_layout
16563
16564 \end_inset
16565
16566 .
16567  Several of these are predefined in 
16568 \begin_inset Flex Code
16569 status collapsed
16570
16571 \begin_layout Plain Layout
16572 stdciteformats.inc
16573 \end_layout
16574
16575 \end_inset
16576
16577 .
16578  Note that these are not macros, in the sense just defined.
16579  They will not be expanded.
16580 \end_layout
16581
16582 \begin_layout Standard
16583 So here then is an example that use all these features:
16584 \end_layout
16585
16586 \begin_layout LyX-Code
16587 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16588 \end_layout
16589
16590 \begin_layout Standard
16591 This defines a macro that prints the author, followed by a comma, if the
16592  
16593 \begin_inset Flex Code
16594 status collapsed
16595
16596 \begin_layout Plain Layout
16597 author
16598 \end_layout
16599
16600 \end_inset
16601
16602  key is defined, or else prints the name of the editor, followed by the
16603  
16604 \begin_inset Flex Code
16605 status collapsed
16606
16607 \begin_layout Plain Layout
16608 _edtext
16609 \end_layout
16610
16611 \end_inset
16612
16613  or its translation (it is by default 
16614 \begin_inset Quotes eld
16615 \end_inset
16616
16617 ed.
16618 \begin_inset Quotes erd
16619 \end_inset
16620
16621 ), if the 
16622 \begin_inset Flex Code
16623 status collapsed
16624
16625 \begin_layout Plain Layout
16626 editor
16627 \end_layout
16628
16629 \end_inset
16630
16631  key is defined.
16632  Note that this is in fact defined in 
16633 \begin_inset Flex Code
16634 status collapsed
16635
16636 \begin_layout Plain Layout
16637 stdciteformats.inc
16638 \end_layout
16639
16640 \end_inset
16641
16642 , so you can use it in your own definitions, or re-definitions, if you load
16643  that file first.
16644 \end_layout
16645
16646 \begin_layout Section
16647 \begin_inset CommandInset label
16648 LatexCommand label
16649 name "sec:Tags-for-XHTML"
16650
16651 \end_inset
16652
16653 Tags for XHTML output
16654 \end_layout
16655
16656 \begin_layout Standard
16657 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16658  by layout information.
16659  In general, LyX provides sensible defaults and, as mentioned earlier, it
16660  will even construct default CSS style rules from the other layout tags.
16661  For example, LyX will attempt to use the information provided in the 
16662 \begin_inset Flex Code
16663 status collapsed
16664
16665 \begin_layout Plain Layout
16666 Font
16667 \end_layout
16668
16669 \end_inset
16670
16671  declaration for the Chapter style to write CSS that will appropriately
16672  format chapter headings.
16673 \end_layout
16674
16675 \begin_layout Standard
16676 In many cases, then, you may not have to do anything at all to get acceptable
16677  XHTML output for your own environments, custom insets, and so forth.
16678  But in some cases you will, and so LyX provides a number of layout tags
16679  that can be used to customize the XHTML and CSS that are generated.
16680 \end_layout
16681
16682 \begin_layout Standard
16683 Note that there are two tags, 
16684 \begin_inset Flex Code
16685 status collapsed
16686
16687 \begin_layout Plain Layout
16688 HTMLPreamble
16689 \end_layout
16690
16691 \end_inset
16692
16693  and 
16694 \begin_inset Flex Code
16695 status collapsed
16696
16697 \begin_layout Plain Layout
16698 AddToHTMLPreamble
16699 \end_layout
16700
16701 \end_inset
16702
16703  that may appear outside style and inset declarations.
16704  See 
16705 \begin_inset CommandInset ref
16706 LatexCommand ref
16707 reference "sub:General-text-class"
16708
16709 \end_inset
16710
16711  for details on these.
16712 \end_layout
16713
16714 \begin_layout Subsection
16715 \begin_inset CommandInset label
16716 LatexCommand label
16717 name "sub:Paragraph-Style-XHTML"
16718
16719 \end_inset
16720
16721 Paragraph styles
16722 \end_layout
16723
16724 \begin_layout Standard
16725 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16726  dealing with a normal paragraph, a command, or an environment, where this
16727  is itself determined by the contents of the corresponding 
16728 \begin_inset Flex Code
16729 status collapsed
16730
16731 \begin_layout Plain Layout
16732 LaTeXType
16733 \end_layout
16734
16735 \end_inset
16736
16737  tag.
16738  
16739 \end_layout
16740
16741 \begin_layout Standard
16742 For a command or normal paragraph, the output XHTML has the following form:
16743 \end_layout
16744
16745 \begin_layout LyX-Code
16746 <tag attr=
16747 \begin_inset Quotes erd
16748 \end_inset
16749
16750 value
16751 \begin_inset Quotes erd
16752 \end_inset
16753
16754 >
16755 \end_layout
16756
16757 \begin_layout LyX-Code
16758 <labeltag attr=
16759 \begin_inset Quotes erd
16760 \end_inset
16761
16762 value
16763 \begin_inset Quotes erd
16764 \end_inset
16765
16766 >Label</labeltag>
16767 \end_layout
16768
16769 \begin_layout LyX-Code
16770 Contents of the paragraph.
16771 \end_layout
16772
16773 \begin_layout LyX-Code
16774 </tag>
16775 \end_layout
16776
16777 \begin_layout Standard
16778 The label tags are of course omitted if the paragraph does not have a label.
16779 \end_layout
16780
16781 \begin_layout Standard
16782 For an environment that is not some sort of list, the XHTML takes this form:
16783 \end_layout
16784
16785 \begin_layout LyX-Code
16786 <tag attr=
16787 \begin_inset Quotes erd
16788 \end_inset
16789
16790 value
16791 \begin_inset Quotes erd
16792 \end_inset
16793
16794 >
16795 \end_layout
16796
16797 \begin_layout LyX-Code
16798 <itemtag attr=
16799 \begin_inset Quotes erd
16800 \end_inset
16801
16802 value
16803 \begin_inset Quotes erd
16804 \end_inset
16805
16806 ><labeltag attr=
16807 \begin_inset Quotes erd
16808 \end_inset
16809
16810 value
16811 \begin_inset Quotes erd
16812 \end_inset
16813
16814 >Environment Label</labeltag>First paragraph.</itemtag>
16815 \end_layout
16816
16817 \begin_layout LyX-Code
16818 <itemtag>Second paragraph.</itemtag>
16819 \end_layout
16820
16821 \begin_layout LyX-Code
16822 </tag>
16823 \end_layout
16824
16825 \begin_layout Standard
16826 Note that the label is output only for the first paragraph, as it should
16827  be for a theorem, for example.
16828  
16829 \end_layout
16830
16831 \begin_layout Standard
16832 For a list, we have one of these forms:
16833 \end_layout
16834
16835 \begin_layout LyX-Code
16836 <tag attr=
16837 \begin_inset Quotes erd
16838 \end_inset
16839
16840 value
16841 \begin_inset Quotes erd
16842 \end_inset
16843
16844 >
16845 \end_layout
16846
16847 \begin_layout LyX-Code
16848 <itemtag attr=
16849 \begin_inset Quotes erd
16850 \end_inset
16851
16852 value
16853 \begin_inset Quotes erd
16854 \end_inset
16855
16856 ><labeltag attr=
16857 \begin_inset Quotes erd
16858 \end_inset
16859
16860 value
16861 \begin_inset Quotes erd
16862 \end_inset
16863
16864 >List Label</labeltag>First item.</itemtag>
16865 \end_layout
16866
16867 \begin_layout LyX-Code
16868 <itemtag attr=
16869 \begin_inset Quotes erd
16870 \end_inset
16871
16872 value
16873 \begin_inset Quotes erd
16874 \end_inset
16875
16876 ><labeltag attr=
16877 \begin_inset Quotes erd
16878 \end_inset
16879
16880 value
16881 \begin_inset Quotes erd
16882 \end_inset
16883
16884 >List Label</labeltag>Second item.</itemtag>
16885 \end_layout
16886
16887 \begin_layout LyX-Code
16888 </tag>
16889 \end_layout
16890
16891 \begin_layout LyX-Code
16892
16893 \end_layout
16894
16895 \begin_layout LyX-Code
16896 <tag attr=
16897 \begin_inset Quotes erd
16898 \end_inset
16899
16900 value
16901 \begin_inset Quotes erd
16902 \end_inset
16903
16904 >
16905 \end_layout
16906
16907 \begin_layout LyX-Code
16908 <labeltag attr=
16909 \begin_inset Quotes erd
16910 \end_inset
16911
16912 value
16913 \begin_inset Quotes erd
16914 \end_inset
16915
16916 >List Label</labeltag><itemtag attr=
16917 \begin_inset Quotes erd
16918 \end_inset
16919
16920 value
16921 \begin_inset Quotes erd
16922 \end_inset
16923
16924 >First item.</itemtag>
16925 \end_layout
16926
16927 \begin_layout LyX-Code
16928 <labeltag attr=
16929 \begin_inset Quotes erd
16930 \end_inset
16931
16932 value
16933 \begin_inset Quotes erd
16934 \end_inset
16935
16936 >List Label</labeltag><itemtag attr=
16937 \begin_inset Quotes erd
16938 \end_inset
16939
16940 value
16941 \begin_inset Quotes erd
16942 \end_inset
16943
16944 >Second item.</itemtag>
16945 \end_layout
16946
16947 \begin_layout LyX-Code
16948 </tag>
16949 \end_layout
16950
16951 \begin_layout Standard
16952 Note the different orders of 
16953 \begin_inset Flex Code
16954 status collapsed
16955
16956 \begin_layout Plain Layout
16957 labeltag
16958 \end_layout
16959
16960 \end_inset
16961
16962  and 
16963 \begin_inset Flex Code
16964 status collapsed
16965
16966 \begin_layout Plain Layout
16967 itemtag
16968 \end_layout
16969
16970 \end_inset
16971
16972 .
16973  Which order we get depends upon the setting of 
16974 \begin_inset Flex Code
16975 status collapsed
16976
16977 \begin_layout Plain Layout
16978 HTMLLabelFirst
16979 \end_layout
16980
16981 \end_inset
16982
16983 : If 
16984 \begin_inset Flex Code
16985 status collapsed
16986
16987 \begin_layout Plain Layout
16988 HTMLLabelFirst
16989 \end_layout
16990
16991 \end_inset
16992
16993  is false (the default), you get the first of these, with the label within
16994  the item; if true, you get the second, with the label outside the item.
16995 \end_layout
16996
16997 \begin_layout Standard
16998 The specific tags and attributes output for each paragraph type can be controlle
16999 d by means of the layout tags we are about to describe.
17000  As mentioned earlier, however, LyX uses sensible defaults for many of these,
17001  so you often may not need to do very much to get good XHTML output.
17002  Think of the available tags as there so you can tweak things to your liking.
17003 \end_layout
17004
17005 \begin_layout Description
17006 \begin_inset Flex Code
17007 status collapsed
17008
17009 \begin_layout Plain Layout
17010 HTMLAttr
17011 \end_layout
17012
17013 \end_inset
17014
17015  [
17016 \begin_inset Flex Code
17017 status collapsed
17018
17019 \begin_layout Plain Layout
17020 string
17021 \end_layout
17022
17023 \end_inset
17024
17025 ] Specifies attribute information to be output with the main tag.
17026  For example, 
17027 \begin_inset Quotes eld
17028 \end_inset
17029
17030
17031 \begin_inset Flex Code
17032 status collapsed
17033
17034 \begin_layout Plain Layout
17035 class=`mydiv'
17036 \end_layout
17037
17038 \end_inset
17039
17040
17041 \begin_inset Quotes erd
17042 \end_inset
17043
17044 .
17045  By default, LyX will output 
17046 \begin_inset Quotes eld
17047 \end_inset
17048
17049
17050 \begin_inset Flex Code
17051 status collapsed
17052
17053 \begin_layout Plain Layout
17054 class=`layoutname'
17055 \end_layout
17056
17057 \end_inset
17058
17059
17060 \begin_inset Quotes erd
17061 \end_inset
17062
17063 , where 
17064 \begin_inset Flex Code
17065 status collapsed
17066
17067 \begin_layout Plain Layout
17068 layoutname
17069 \end_layout
17070
17071 \end_inset
17072
17073  is the LyX name of the layout, made lowercase, for example: chapter.
17074  This should 
17075 \emph on
17076 not
17077 \emph default
17078  contain any style information.
17079  Use 
17080 \begin_inset Flex Code
17081 status collapsed
17082
17083 \begin_layout Plain Layout
17084 HTMLStyle
17085 \end_layout
17086
17087 \end_inset
17088
17089  for that purpose.
17090 \end_layout
17091
17092 \begin_layout Description
17093 \begin_inset Flex Code
17094 status collapsed
17095
17096 \begin_layout Plain Layout
17097 HTMLForceCSS
17098 \end_layout
17099
17100 \end_inset
17101
17102  [
17103 \begin_inset Flex Code
17104 status collapsed
17105
17106 \begin_layout Plain Layout
17107
17108 \emph on
17109 0
17110 \emph default
17111 ,1
17112 \end_layout
17113
17114 \end_inset
17115
17116 ] Whether to output the default CSS information LyX generates for this layout,
17117  even if additional information is explicitly provided via 
17118 \begin_inset Flex Code
17119 status collapsed
17120
17121 \begin_layout Plain Layout
17122 HTMLStyle
17123 \end_layout
17124
17125 \end_inset
17126
17127 .
17128  Setting this to 
17129 \begin_inset Flex Code
17130 status collapsed
17131
17132 \begin_layout Plain Layout
17133 1
17134 \end_layout
17135
17136 \end_inset
17137
17138  allows you to alter or augment the generated CSS, rather than to override
17139  it completely.
17140  Default is 
17141 \begin_inset Flex Code
17142 status collapsed
17143
17144 \begin_layout Plain Layout
17145 0
17146 \end_layout
17147
17148 \end_inset
17149
17150 .
17151 \end_layout
17152
17153 \begin_layout Description
17154 \begin_inset Flex Code
17155 status collapsed
17156
17157 \begin_layout Plain Layout
17158 HTMLItem
17159 \end_layout
17160
17161 \end_inset
17162
17163  [
17164 \begin_inset Flex Code
17165 status collapsed
17166
17167 \begin_layout Plain Layout
17168 string
17169 \end_layout
17170
17171 \end_inset
17172
17173 ] The tag to be used for individual paragraphs of environments, replacing
17174  
17175 \begin_inset Flex Code
17176 status collapsed
17177
17178 \begin_layout Plain Layout
17179 itemtag
17180 \end_layout
17181
17182 \end_inset
17183
17184  in the examples above.
17185  Defaults to 
17186 \begin_inset Flex Code
17187 status collapsed
17188
17189 \begin_layout Plain Layout
17190 div
17191 \end_layout
17192
17193 \end_inset
17194
17195 .
17196 \end_layout
17197
17198 \begin_layout Description
17199 \begin_inset Flex Code
17200 status collapsed
17201
17202 \begin_layout Plain Layout
17203 HTMLItemAttr
17204 \end_layout
17205
17206 \end_inset
17207
17208  [
17209 \begin_inset Flex Code
17210 status collapsed
17211
17212 \begin_layout Plain Layout
17213 string
17214 \end_layout
17215
17216 \end_inset
17217
17218 ] Attributes for the item tag.
17219  Defaults to 
17220 \begin_inset Quotes eld
17221 \end_inset
17222
17223
17224 \begin_inset Flex Code
17225 status collapsed
17226
17227 \begin_layout Plain Layout
17228 class=`layoutname_item'
17229 \end_layout
17230
17231 \end_inset
17232
17233
17234 \begin_inset Quotes erd
17235 \end_inset
17236
17237 .
17238  This should 
17239 \emph on
17240 not
17241 \emph default
17242  contain any style information.
17243  Use 
17244 \begin_inset Flex Code
17245 status collapsed
17246
17247 \begin_layout Plain Layout
17248 HTMLStyle
17249 \end_layout
17250
17251 \end_inset
17252
17253  for that purpose.
17254 \end_layout
17255
17256 \begin_layout Description
17257 \begin_inset Flex Code
17258 status collapsed
17259
17260 \begin_layout Plain Layout
17261 HTMLLabel
17262 \end_layout
17263
17264 \end_inset
17265
17266  [
17267 \begin_inset Flex Code
17268 status collapsed
17269
17270 \begin_layout Plain Layout
17271 string
17272 \end_layout
17273
17274 \end_inset
17275
17276 ] The tag to be used for paragraph and item labels, replacing 
17277 \begin_inset Flex Code
17278 status collapsed
17279
17280 \begin_layout Plain Layout
17281 labeltag
17282 \end_layout
17283
17284 \end_inset
17285
17286  in the examples above.
17287  Defaults to 
17288 \begin_inset Flex Code
17289 status collapsed
17290
17291 \begin_layout Plain Layout
17292 span
17293 \end_layout
17294
17295 \end_inset
17296
17297 , unless 
17298 \begin_inset Flex Code
17299 status collapsed
17300
17301 \begin_layout Plain Layout
17302 LabelType
17303 \end_layout
17304
17305 \end_inset
17306
17307  is either 
17308 \begin_inset Flex Code
17309 status collapsed
17310
17311 \begin_layout Plain Layout
17312 Top_Environment
17313 \end_layout
17314
17315 \end_inset
17316
17317  or 
17318 \begin_inset Flex Code
17319 status collapsed
17320
17321 \begin_layout Plain Layout
17322 Centered_Top_Environment
17323 \end_layout
17324
17325 \end_inset
17326
17327 , in which case it defaults to 
17328 \begin_inset Flex Code
17329 status collapsed
17330
17331 \begin_layout Plain Layout
17332 div
17333 \end_layout
17334
17335 \end_inset
17336
17337 .
17338 \end_layout
17339
17340 \begin_layout Description
17341 \begin_inset Flex Code
17342 status collapsed
17343
17344 \begin_layout Plain Layout
17345 HTMLLabelAttr
17346 \end_layout
17347
17348 \end_inset
17349
17350  [
17351 \begin_inset Flex Code
17352 status collapsed
17353
17354 \begin_layout Plain Layout
17355 string
17356 \end_layout
17357
17358 \end_inset
17359
17360 ] Attributes for the label tag.
17361  Defaults to 
17362 \begin_inset Quotes eld
17363 \end_inset
17364
17365
17366 \begin_inset Flex Code
17367 status collapsed
17368
17369 \begin_layout Plain Layout
17370 class=`layoutname_label'
17371 \end_layout
17372
17373 \end_inset
17374
17375
17376 \begin_inset Quotes erd
17377 \end_inset
17378
17379 .
17380  This should 
17381 \emph on
17382 not
17383 \emph default
17384  contain any style information.
17385  Use 
17386 \begin_inset Flex Code
17387 status collapsed
17388
17389 \begin_layout Plain Layout
17390 HTMLStyle
17391 \end_layout
17392
17393 \end_inset
17394
17395  for that purpose.
17396 \end_layout
17397
17398 \begin_layout Description
17399 \begin_inset Flex Code
17400 status collapsed
17401
17402 \begin_layout Plain Layout
17403 HTMLLabelFirst
17404 \end_layout
17405
17406 \end_inset
17407
17408  [
17409 \begin_inset Flex Code
17410 status collapsed
17411
17412 \begin_layout Plain Layout
17413
17414 \emph on
17415 0
17416 \emph default
17417 ,1
17418 \end_layout
17419
17420 \end_inset
17421
17422 ] Meaningful only for list-like environments, this tag controls whether
17423  the label tag is output before or inside the item tag.
17424  This is used, for example, in the description environment, where we want
17425  `
17426 \begin_inset Flex Code
17427 status collapsed
17428
17429 \begin_layout Plain Layout
17430 <dt>\SpecialChar \ldots{}
17431 </dt><dd>\SpecialChar \ldots{}
17432 </dd>
17433 \end_layout
17434
17435 \end_inset
17436
17437 .
17438  Default is 
17439 \begin_inset Flex Code
17440 status collapsed
17441
17442 \begin_layout Plain Layout
17443 0
17444 \end_layout
17445
17446 \end_inset
17447
17448 : The label tag is output inside the item tag.
17449 \end_layout
17450
17451 \begin_layout Description
17452 \begin_inset Flex Code
17453 status collapsed
17454
17455 \begin_layout Plain Layout
17456 HTMLPreamble
17457 \end_layout
17458
17459 \end_inset
17460
17461  Information to be output in the 
17462 \begin_inset Flex Code
17463 status collapsed
17464
17465 \begin_layout Plain Layout
17466 <head>
17467 \end_layout
17468
17469 \end_inset
17470
17471  section when this style is used.
17472  This might, for example, be used to include a 
17473 \begin_inset Flex Code
17474 status collapsed
17475
17476 \begin_layout Plain Layout
17477 <script>
17478 \end_layout
17479
17480 \end_inset
17481
17482  block defining an 
17483 \begin_inset Flex Code
17484 status collapsed
17485
17486 \begin_layout Plain Layout
17487 onclick
17488 \end_layout
17489
17490 \end_inset
17491
17492  handler.
17493 \end_layout
17494
17495 \begin_layout Description
17496 \begin_inset Flex Code
17497 status collapsed
17498
17499 \begin_layout Plain Layout
17500 HTMLStyle
17501 \end_layout
17502
17503 \end_inset
17504
17505  CSS style information to be included when this style is used.
17506  Note that this will automatically be wrapped in a layout-generated 
17507 \begin_inset Flex Code
17508 status collapsed
17509
17510 \begin_layout Plain Layout
17511 <style>
17512 \end_layout
17513
17514 \end_inset
17515
17516  block, so only the CSS itself need be included.
17517 \end_layout
17518
17519 \begin_layout Description
17520 \begin_inset Flex Code
17521 status collapsed
17522
17523 \begin_layout Plain Layout
17524 HTMLTag
17525 \end_layout
17526
17527 \end_inset
17528
17529  [
17530 \begin_inset Flex Code
17531 status collapsed
17532
17533 \begin_layout Plain Layout
17534 string
17535 \end_layout
17536
17537 \end_inset
17538
17539 ] The tag to be used for the main label, replacing 
17540 \begin_inset Flex Code
17541 status collapsed
17542
17543 \begin_layout Plain Layout
17544 tag
17545 \end_layout
17546
17547 \end_inset
17548
17549  in the examples above.
17550  Defaults to 
17551 \begin_inset Flex Code
17552 status collapsed
17553
17554 \begin_layout Plain Layout
17555 div
17556 \end_layout
17557
17558 \end_inset
17559
17560 .
17561 \end_layout
17562
17563 \begin_layout Description
17564 \begin_inset Flex Code
17565 status collapsed
17566
17567 \begin_layout Plain Layout
17568 HTMLTitle
17569 \end_layout
17570
17571 \end_inset
17572
17573  [
17574 \begin_inset Flex Code
17575 status collapsed
17576
17577 \begin_layout Plain Layout
17578
17579 \emph on
17580 0
17581 \emph default
17582 ,1
17583 \end_layout
17584
17585 \end_inset
17586
17587 ] Marks this style as the one to be used to generate the 
17588 \begin_inset Flex Code
17589 status collapsed
17590
17591 \begin_layout Plain Layout
17592 <title>
17593 \end_layout
17594
17595 \end_inset
17596
17597  tag for the XHTML file.
17598  By default, it is false.
17599  The 
17600 \begin_inset Flex Code
17601 status collapsed
17602
17603 \begin_layout Plain Layout
17604 stdtitle.inc
17605 \end_layout
17606
17607 \end_inset
17608
17609  file sets it to true for the 
17610 \begin_inset Flex Code
17611 status collapsed
17612
17613 \begin_layout Plain Layout
17614 title
17615 \end_layout
17616
17617 \end_inset
17618
17619  environment.
17620  
17621 \end_layout
17622
17623 \begin_layout Subsection
17624 InsetLayout XHTML
17625 \end_layout
17626
17627 \begin_layout Standard
17628 The XHTML output of insets can also be controlled by information in layout
17629  files.
17630 \begin_inset Foot
17631 status collapsed
17632
17633 \begin_layout Plain Layout
17634 At present, this is true only for 
17635 \begin_inset Quotes eld
17636 \end_inset
17637
17638 text
17639 \begin_inset Quotes erd
17640 \end_inset
17641
17642  insets (insets you can type into) and is not true for 
17643 \begin_inset Quotes eld
17644 \end_inset
17645
17646 command
17647 \begin_inset Quotes erd
17648 \end_inset
17649
17650  insets (insets that are associated with dialog boxes).
17651 \end_layout
17652
17653 \end_inset
17654
17655  Here, too, LyX tries to provide sensible defaults, and it constructs default
17656  CSS style rules.
17657  But everything can be customized.
17658 \end_layout
17659
17660 \begin_layout Standard
17661 The XHTML LyX outputs for an inset has the following form:
17662 \end_layout
17663
17664 \begin_layout LyX-Code
17665 <tag attr=
17666 \begin_inset Quotes erd
17667 \end_inset
17668
17669 value
17670 \begin_inset Quotes erd
17671 \end_inset
17672
17673 >
17674 \end_layout
17675
17676 \begin_layout LyX-Code
17677 <labeltag>Label</labeltag>
17678 \end_layout
17679
17680 \begin_layout LyX-Code
17681 <innertag attr=
17682 \begin_inset Quotes erd
17683 \end_inset
17684
17685 value
17686 \begin_inset Quotes erd
17687 \end_inset
17688
17689 >Contents of the inset.</innertag>
17690 \end_layout
17691
17692 \begin_layout LyX-Code
17693 </tag>
17694 \end_layout
17695
17696 \begin_layout Standard
17697 If the inset permits multiple paragraphs---that is, if 
17698 \begin_inset Flex Code
17699 status collapsed
17700
17701 \begin_layout Plain Layout
17702 MultiPar
17703 \end_layout
17704
17705 \end_inset
17706
17707  is true---then the contents of the inset will itself be output as paragraphs
17708  formatted according to the styles used for those paragraphs (standard,
17709  quote, and the like).
17710  The label tag is of course omitted if the paragraph does not have a label
17711  and, at present, is always 
17712 \begin_inset Flex Code
17713 status collapsed
17714
17715 \begin_layout Plain Layout
17716 span
17717 \end_layout
17718
17719 \end_inset
17720
17721 .
17722  The inner tag is optional and, by default, does not appear.
17723 \end_layout
17724
17725 \begin_layout Standard
17726 The specific tags and attributes output for each inset can be controlled
17727  by means of the following layout tags.
17728 \end_layout
17729
17730 \begin_layout Description
17731 \begin_inset Flex Code
17732 status collapsed
17733
17734 \begin_layout Plain Layout
17735 HTMLAttr
17736 \end_layout
17737
17738 \end_inset
17739
17740  [
17741 \begin_inset Flex Code
17742 status collapsed
17743
17744 \begin_layout Plain Layout
17745 string
17746 \end_layout
17747
17748 \end_inset
17749
17750 ] Specifies attribute information to be output with the main tag.
17751  For example, 
17752 \begin_inset Quotes eld
17753 \end_inset
17754
17755
17756 \begin_inset Flex Code
17757 status collapsed
17758
17759 \begin_layout Plain Layout
17760 class=`myinset' onclick=`\SpecialChar \ldots{}
17761 '
17762 \end_layout
17763
17764 \end_inset
17765
17766
17767 \begin_inset Quotes erd
17768 \end_inset
17769
17770 .
17771  By default, LyX will output 
17772 \begin_inset Quotes eld
17773 \end_inset
17774
17775
17776 \begin_inset Flex Code
17777 status collapsed
17778
17779 \begin_layout Plain Layout
17780 class=`insetname'
17781 \end_layout
17782
17783 \end_inset
17784
17785
17786 \begin_inset Quotes erd
17787 \end_inset
17788
17789 , where 
17790 \begin_inset Flex Code
17791 status collapsed
17792
17793 \begin_layout Plain Layout
17794 insetname
17795 \end_layout
17796
17797 \end_inset
17798
17799  is the LyX name of the inset, made lowercase and with non-alphanumeric
17800  characters converted to underscores, for example: footnote.
17801 \end_layout
17802
17803 \begin_layout Description
17804 \begin_inset Flex Code
17805 status collapsed
17806
17807 \begin_layout Plain Layout
17808 HTMLForceCSS
17809 \end_layout
17810
17811 \end_inset
17812
17813  [
17814 \begin_inset Flex Code
17815 status collapsed
17816
17817 \begin_layout Plain Layout
17818
17819 \emph on
17820 0
17821 \emph default
17822 ,1
17823 \end_layout
17824
17825 \end_inset
17826
17827 ] Whether to output the default CSS information LyX generates for this layout,
17828  even if additional information is explicitly provided via 
17829 \begin_inset Flex Code
17830 status collapsed
17831
17832 \begin_layout Plain Layout
17833 HTMLStyle
17834 \end_layout
17835
17836 \end_inset
17837
17838 .
17839  Setting this to 
17840 \begin_inset Flex Code
17841 status collapsed
17842
17843 \begin_layout Plain Layout
17844 1
17845 \end_layout
17846
17847 \end_inset
17848
17849  allows you to alter or augment the generated CSS, rather than to override
17850  it completely.
17851  Default is 0.
17852 \end_layout
17853
17854 \begin_layout Description
17855 \begin_inset Flex Code
17856 status collapsed
17857
17858 \begin_layout Plain Layout
17859 HTMLInnerAttr
17860 \end_layout
17861
17862 \end_inset
17863
17864  [
17865 \begin_inset Flex Code
17866 status collapsed
17867
17868 \begin_layout Plain Layout
17869 string
17870 \end_layout
17871
17872 \end_inset
17873
17874 ] Attributes for the inner tag.
17875  Defaults to 
17876 \begin_inset Quotes eld
17877 \end_inset
17878
17879
17880 \begin_inset Flex Code
17881 status collapsed
17882
17883 \begin_layout Plain Layout
17884 class=`insetname_inner'
17885 \end_layout
17886
17887 \end_inset
17888
17889
17890 \begin_inset Quotes erd
17891 \end_inset
17892
17893 .
17894 \end_layout
17895
17896 \begin_layout Description
17897 \begin_inset Flex Code
17898 status collapsed
17899
17900 \begin_layout Plain Layout
17901 HTMLInnerTag
17902 \end_layout
17903
17904 \end_inset
17905
17906  [
17907 \begin_inset Flex Code
17908 status collapsed
17909
17910 \begin_layout Plain Layout
17911 string
17912 \end_layout
17913
17914 \end_inset
17915
17916 ] The inner tag, replacing 
17917 \begin_inset Flex Code
17918 status collapsed
17919
17920 \begin_layout Plain Layout
17921 innertag
17922 \end_layout
17923
17924 \end_inset
17925
17926  in the examples above.
17927  By default, there is none.
17928 \end_layout
17929
17930 \begin_layout Description
17931 \begin_inset Flex Code
17932 status collapsed
17933
17934 \begin_layout Plain Layout
17935 HTMLIsBlock
17936 \end_layout
17937
17938 \end_inset
17939
17940  [
17941 \begin_inset Flex Code
17942 status collapsed
17943
17944 \begin_layout Plain Layout
17945 0,
17946 \emph on
17947 1
17948 \end_layout
17949
17950 \end_inset
17951
17952 ] Whether this inset represents a standalone block of text (such as a footnote)
17953  or instead represents material that is included in the surrounding text
17954  (such as a branch).
17955  Defaults to 1.
17956 \end_layout
17957
17958 \begin_layout Description
17959 \begin_inset Flex Code
17960 status collapsed
17961
17962 \begin_layout Plain Layout
17963 HTMLLabel
17964 \end_layout
17965
17966 \end_inset
17967
17968  [
17969 \begin_inset Flex Code
17970 status collapsed
17971
17972 \begin_layout Plain Layout
17973 string
17974 \end_layout
17975
17976 \end_inset
17977
17978 ] A label for this inset, possibly including a reference to a counter.
17979  For example, for footnote, it might be: 
17980 \begin_inset Flex Code
17981 status collapsed
17982
17983 \begin_layout Plain Layout
17984
17985 \backslash
17986 arabic{footnote}
17987 \end_layout
17988
17989 \end_inset
17990
17991 .
17992  This is optional, and there is no default.
17993 \end_layout
17994
17995 \begin_layout Description
17996 \begin_inset Flex Code
17997 status collapsed
17998
17999 \begin_layout Plain Layout
18000 HTMLPreamble
18001 \end_layout
18002
18003 \end_inset
18004
18005  Information to be output in the 
18006 \begin_inset Flex Code
18007 status collapsed
18008
18009 \begin_layout Plain Layout
18010 <head>
18011 \end_layout
18012
18013 \end_inset
18014
18015  section when this style is used.
18016  This might, for example, be used to include a 
18017 \begin_inset Flex Code
18018 status collapsed
18019
18020 \begin_layout Plain Layout
18021 <script>
18022 \end_layout
18023
18024 \end_inset
18025
18026  block defining an 
18027 \begin_inset Flex Code
18028 status collapsed
18029
18030 \begin_layout Plain Layout
18031 onclick
18032 \end_layout
18033
18034 \end_inset
18035
18036  handler.
18037 \end_layout
18038
18039 \begin_layout Description
18040 \begin_inset Flex Code
18041 status collapsed
18042
18043 \begin_layout Plain Layout
18044 HTMLStyle
18045 \end_layout
18046
18047 \end_inset
18048
18049  CSS style information to be included when this style is used.
18050  Note that this will automatically be wrapped in a layout-generated 
18051 \begin_inset Flex Code
18052 status collapsed
18053
18054 \begin_layout Plain Layout
18055 <style>
18056 \end_layout
18057
18058 \end_inset
18059
18060  block, so only the CSS itself need be included.
18061 \end_layout
18062
18063 \begin_layout Description
18064 \begin_inset Flex Code
18065 status collapsed
18066
18067 \begin_layout Plain Layout
18068 HTMLTag
18069 \end_layout
18070
18071 \end_inset
18072
18073  [
18074 \begin_inset Flex Code
18075 status collapsed
18076
18077 \begin_layout Plain Layout
18078 string
18079 \end_layout
18080
18081 \end_inset
18082
18083 ] The tag to be used for the main label, replacing 
18084 \begin_inset Flex Code
18085 status collapsed
18086
18087 \begin_layout Plain Layout
18088 tag
18089 \end_layout
18090
18091 \end_inset
18092
18093  in the examples above.
18094  The default depends upon the setting of 
18095 \begin_inset Flex Code
18096 status collapsed
18097
18098 \begin_layout Plain Layout
18099 MultiPar
18100 \end_layout
18101
18102 \end_inset
18103
18104 : If 
18105 \begin_inset Flex Code
18106 status collapsed
18107
18108 \begin_layout Plain Layout
18109 MultiPar
18110 \end_layout
18111
18112 \end_inset
18113
18114  is true, the default is 
18115 \begin_inset Flex Code
18116 status collapsed
18117
18118 \begin_layout Plain Layout
18119 div
18120 \end_layout
18121
18122 \end_inset
18123
18124 ; if it is false, the default is 
18125 \begin_inset Flex Code
18126 status collapsed
18127
18128 \begin_layout Plain Layout
18129 span
18130 \end_layout
18131
18132 \end_inset
18133
18134 .
18135 \end_layout
18136
18137 \begin_layout Subsection
18138 Float XHTML
18139 \end_layout
18140
18141 \begin_layout Standard
18142 The XHTML output for floats too can be controlled by layout information.
18143  The output has the following form:
18144 \end_layout
18145
18146 \begin_layout LyX-Code
18147 <tag attr=
18148 \begin_inset Quotes erd
18149 \end_inset
18150
18151 value
18152 \begin_inset Quotes erd
18153 \end_inset
18154
18155 >
18156 \end_layout
18157
18158 \begin_layout LyX-Code
18159 Contents of the float.
18160 \end_layout
18161
18162 \begin_layout LyX-Code
18163 </tag>
18164 \end_layout
18165
18166 \begin_layout Standard
18167 The caption, if there is one, is a separate inset and will be output as
18168  such.
18169  Its appearance can be controlled via the InsetLayout for caption insets.
18170  
18171 \end_layout
18172
18173 \begin_layout Description
18174 \begin_inset Flex Code
18175 status collapsed
18176
18177 \begin_layout Plain Layout
18178 HTMLAttr
18179 \end_layout
18180
18181 \end_inset
18182
18183  [
18184 \begin_inset Flex Code
18185 status collapsed
18186
18187 \begin_layout Plain Layout
18188 string
18189 \end_layout
18190
18191 \end_inset
18192
18193 ] Specifies attribute information to be output with the main tag.
18194  For example, 
18195 \begin_inset Quotes eld
18196 \end_inset
18197
18198
18199 \begin_inset Flex Code
18200 status collapsed
18201
18202 \begin_layout Plain Layout
18203 class=`myfloat' onclick=`\SpecialChar \ldots{}
18204 '
18205 \end_layout
18206
18207 \end_inset
18208
18209
18210 \begin_inset Quotes erd
18211 \end_inset
18212
18213 .
18214  By default, LyX will output 
18215 \begin_inset Quotes eld
18216 \end_inset
18217
18218
18219 \begin_inset Flex Code
18220 status collapsed
18221
18222 \begin_layout Plain Layout
18223 class=`float float-floattype'
18224 \end_layout
18225
18226 \end_inset
18227
18228
18229 \begin_inset Quotes erd
18230 \end_inset
18231
18232 , where 
18233 \begin_inset Flex Code
18234 status collapsed
18235
18236 \begin_layout Plain Layout
18237 floattype
18238 \end_layout
18239
18240 \end_inset
18241
18242  is LyX's name for this type of float, as determined by the float declaration
18243  (see 
18244 \begin_inset CommandInset ref
18245 LatexCommand ref
18246 reference "sub:Floats"
18247
18248 \end_inset
18249
18250 ), though made lowercase and with non-alphanumeric characters converted
18251  to underscores, for example: float-table.
18252 \end_layout
18253
18254 \begin_layout Description
18255 \begin_inset Flex Code
18256 status collapsed
18257
18258 \begin_layout Plain Layout
18259 HTMLStyle
18260 \end_layout
18261
18262 \end_inset
18263
18264  CSS style information to be included when this float is used.
18265  Note that this will automatically be wrapped in a layout-generated 
18266 \begin_inset Flex Code
18267 status collapsed
18268
18269 \begin_layout Plain Layout
18270 <style>
18271 \end_layout
18272
18273 \end_inset
18274
18275  block, so only the CSS itself need be included.
18276 \end_layout
18277
18278 \begin_layout Description
18279 \begin_inset Flex Code
18280 status collapsed
18281
18282 \begin_layout Plain Layout
18283 HTMLTag
18284 \end_layout
18285
18286 \end_inset
18287
18288  [
18289 \begin_inset Flex Code
18290 status collapsed
18291
18292 \begin_layout Plain Layout
18293 string
18294 \end_layout
18295
18296 \end_inset
18297
18298 ] The tag to be used for this float, replacing 
18299 \begin_inset Quotes eld
18300 \end_inset
18301
18302
18303 \begin_inset Flex Code
18304 status collapsed
18305
18306 \begin_layout Plain Layout
18307 tag
18308 \end_layout
18309
18310 \end_inset
18311
18312
18313 \begin_inset Quotes erd
18314 \end_inset
18315
18316  in the example above.
18317  The default is 
18318 \begin_inset Flex Code
18319 status collapsed
18320
18321 \begin_layout Plain Layout
18322 div
18323 \end_layout
18324
18325 \end_inset
18326
18327  and will rarely need changing.
18328 \end_layout
18329
18330 \begin_layout Subsection
18331 Bibliography formatting
18332 \end_layout
18333
18334 \begin_layout Standard
18335 The bibliography can be formatted using 
18336 \begin_inset Flex Code
18337 status collapsed
18338
18339 \begin_layout Plain Layout
18340 CiteFormat
18341 \end_layout
18342
18343 \end_inset
18344
18345  blocks.
18346  See Section 
18347 \begin_inset CommandInset ref
18348 LatexCommand ref
18349 reference "sub:Citation-format-description"
18350
18351 \end_inset
18352
18353  for the details.
18354 \end_layout
18355
18356 \begin_layout Subsection
18357 LyX-generated CSS
18358 \end_layout
18359
18360 \begin_layout Standard
18361 We have several times mentioned that LyX will generate default CSS style
18362  rules for both insets and paragraph styles, based upon the other layout
18363  information that is provided.
18364  In this section, we shall say a word about which layout information LyX
18365  uses and how.
18366 \end_layout
18367
18368 \begin_layout Standard
18369 At present, LyX auto-generates CSS only for font information, making use
18370  of the 
18371 \begin_inset Flex Code
18372 status collapsed
18373
18374 \begin_layout Plain Layout
18375 Family
18376 \end_layout
18377
18378 \end_inset
18379
18380
18381 \begin_inset Flex Code
18382 status collapsed
18383
18384 \begin_layout Plain Layout
18385 Series
18386 \end_layout
18387
18388 \end_inset
18389
18390
18391 \begin_inset Flex Code
18392 status collapsed
18393
18394 \begin_layout Plain Layout
18395 Shape
18396 \end_layout
18397
18398 \end_inset
18399
18400 , and 
18401 \begin_inset Flex Code
18402 status collapsed
18403
18404 \begin_layout Plain Layout
18405 Size
18406 \end_layout
18407
18408 \end_inset
18409
18410  specified in the 
18411 \begin_inset Flex Code
18412 status collapsed
18413
18414 \begin_layout Plain Layout
18415 Font
18416 \end_layout
18417
18418 \end_inset
18419
18420  declaration.
18421  (See 
18422 \begin_inset CommandInset ref
18423 LatexCommand ref
18424 reference "sub:Font-description"
18425
18426 \end_inset
18427
18428 .) The translation is mostly straightforward and obvious.
18429  For example, 
18430 \begin_inset Quotes eld
18431 \end_inset
18432
18433
18434 \begin_inset Flex Code
18435 status collapsed
18436
18437 \begin_layout Plain Layout
18438 Family Sans
18439 \end_layout
18440
18441 \end_inset
18442
18443
18444 \begin_inset Quotes erd
18445 \end_inset
18446
18447  becomes 
18448 \begin_inset Quotes eld
18449 \end_inset
18450
18451
18452 \begin_inset Flex Code
18453 status collapsed
18454
18455 \begin_layout Plain Layout
18456 font-family: sans-serif;
18457 \end_layout
18458
18459 \end_inset
18460
18461
18462 \begin_inset Quotes erd
18463 \end_inset
18464
18465 .
18466  The correspondence of LyX sizes and CSS sizes is a little less obvious
18467  but nonetheless intuitive.
18468  See the 
18469 \begin_inset Flex Code
18470 status collapsed
18471
18472 \begin_layout Plain Layout
18473 getSizeCSS()
18474 \end_layout
18475
18476 \end_inset
18477
18478  function in 
18479 \begin_inset Flex URL
18480 status collapsed
18481
18482 \begin_layout Plain Layout
18483
18484 src/FontInfo.cpp
18485 \end_layout
18486
18487 \end_inset
18488
18489  for the details.
18490  
18491 \end_layout
18492
18493 \begin_layout Chapter
18494 Including External Material
18495 \end_layout
18496
18497 \begin_layout Standard
18498 \begin_inset Box Shadowbox
18499 position "t"
18500 hor_pos "c"
18501 has_inner_box 1
18502 inner_pos "t"
18503 use_parbox 0
18504 use_makebox 0
18505 width "100col%"
18506 special "none"
18507 height "1in"
18508 height_special "totalheight"
18509 status open
18510
18511 \begin_layout Plain Layout
18512 WARNING: This portion of the documentation has not been updated for some
18513  time.
18514  We certainly hope that it is still accurate, but there are no guarantees.
18515 \end_layout
18516
18517 \end_inset
18518
18519
18520 \end_layout
18521
18522 \begin_layout Standard
18523 The use of material from sources external to LyX is covered in detail in
18524  the 
18525 \emph on
18526 Embedded Objects
18527 \emph default
18528  manual.
18529  This part of the manual covers what needs to happen behind the scenes for
18530  new sorts of material to be included.
18531 \end_layout
18532
18533 \begin_layout Section
18534 How does it work?
18535 \end_layout
18536
18537 \begin_layout Standard
18538 The external material feature is based on the concept of a 
18539 \emph on
18540 template
18541 \emph default
18542 .
18543  A template is a specification of how LyX should interface with a certain
18544  kind of material.
18545  As bundled, LyX comes with predefined templates for Xfig figures, various
18546  raster format images, chess diagrams, and LilyPond music notation.
18547  You can check the actual list by using the menu 
18548 \begin_inset Flex MenuItem
18549 status collapsed
18550
18551 \begin_layout Plain Layout
18552 Insert\SpecialChar \menuseparator
18553 File\SpecialChar \menuseparator
18554 External Material
18555 \end_layout
18556
18557 \end_inset
18558
18559 .
18560  Furthermore, it is possible to roll your own template to support a specific
18561  kind of material.
18562  Later we'll describe in more detail what is involved, and hopefully you
18563  will submit all the templates you create so we can include them in a later
18564  LyX version.
18565 \end_layout
18566
18567 \begin_layout Standard
18568 Another basic idea of the external material feature is to distinguish between
18569  the original file that serves as a base for final material and the produced
18570  file that is included in your exported or printed document.
18571  For example, consider the case of a figure produced with 
18572 \begin_inset Flex Code
18573 status collapsed
18574
18575 \begin_layout Plain Layout
18576 Xfig
18577 \end_layout
18578
18579 \end_inset
18580
18581 .
18582  The Xfig application itself works on an original file with the 
18583 \begin_inset Flex Code
18584 status collapsed
18585
18586 \begin_layout Plain Layout
18587 .fig
18588 \end_layout
18589
18590 \end_inset
18591
18592  extension.
18593  Within Xfig, you create and change your figure, and when you are done,
18594  you save the 
18595 \begin_inset Flex Code
18596 status collapsed
18597
18598 \begin_layout Plain Layout
18599 fig
18600 \end_layout
18601
18602 \end_inset
18603
18604 -file.
18605  When you want to include the figure in your document, you invoke 
18606 \begin_inset Flex Code
18607 status collapsed
18608
18609 \begin_layout Plain Layout
18610 transfig
18611 \end_layout
18612
18613 \end_inset
18614
18615  in order to create a PostScript file that can readily be included in your
18616  LaTeX file.
18617  In this case, the 
18618 \begin_inset Flex Code
18619 status collapsed
18620
18621 \begin_layout Plain Layout
18622 .fig
18623 \end_layout
18624
18625 \end_inset
18626
18627  file is the original file, and the PostScript file is the produced file.
18628 \end_layout
18629
18630 \begin_layout Standard
18631 This distinction is important in order to allow updating of the material
18632  while you are in the process of writing the document.
18633  Furthermore, it provides us with the flexibility that is needed to support
18634  multiple export formats.
18635  For instance, in the case of a plain text file, it is not exactly an award-winn
18636 ing idea to include the figure as raw PostScript.
18637  Instead, you'd either prefer to just include a reference to the figure
18638  or try to invoke some graphics to ASCII converter to make the final result
18639  look similar to the real graphics.
18640  The external material management allows you to do this, because it is parametri
18641 zed on the different export formats that LyX supports.
18642 \end_layout
18643
18644 \begin_layout Standard
18645 Besides supporting the production of different products according to the
18646  exported format, it supports tight integration with editing and viewing
18647  applications.
18648  In the case of an Xfig figure, you are able to invoke Xfig on the original
18649  file with a single click from within the external material dialog in LyX,
18650  and also preview the produced PostScript file with Ghostview with another
18651  click.
18652  No more fiddling around with the command line and/or file browsers to locate
18653  and manipulate the original or produced files.
18654  In this way, you are finally able to take full advantage of the many different
18655  applications that are relevant to use when you write your documents, and
18656  ultimately be more productive.
18657 \end_layout
18658
18659 \begin_layout Section
18660 The external template configuration file
18661 \end_layout
18662
18663 \begin_layout Standard
18664 It is relatively easy to add custom external template definitions to LyX.
18665  However, be aware that doing this in an careless manner most probably 
18666 \emph on
18667 will
18668 \emph default
18669  introduce an easily exploitable security hole.
18670  So before you do this, please read the discussion about security in section
18671  
18672 \begin_inset CommandInset ref
18673 LatexCommand ref
18674 reference "sec:Security-discussion"
18675
18676 \end_inset
18677
18678 .
18679 \end_layout
18680
18681 \begin_layout Standard
18682 Having said that, we encourage you to submit any interesting templates that
18683  you create.
18684  
18685 \end_layout
18686
18687 \begin_layout Standard
18688 The external templates are defined in the 
18689 \begin_inset Flex Code
18690 status collapsed
18691
18692 \begin_layout Plain Layout
18693 LyXDir/lib/external_templates
18694 \end_layout
18695
18696 \end_inset
18697
18698  file.
18699  You can place your own version in 
18700 \begin_inset Flex Code
18701 status collapsed
18702
18703 \begin_layout Plain Layout
18704 UserDir/external_templates
18705 \end_layout
18706
18707 \end_inset
18708
18709 .
18710 \end_layout
18711
18712 \begin_layout Standard
18713 A typical template looks like this:
18714 \end_layout
18715
18716 \begin_layout LyX-Code
18717 Template XFig
18718 \end_layout
18719
18720 \begin_layout LyX-Code
18721 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18722 \end_layout
18723
18724 \begin_layout LyX-Code
18725 HelpText
18726 \end_layout
18727
18728 \begin_layout LyX-Code
18729 An XFig figure.
18730 \end_layout
18731
18732 \begin_layout LyX-Code
18733 HelpTextEnd
18734 \end_layout
18735
18736 \begin_layout LyX-Code
18737 InputFormat fig
18738 \end_layout
18739
18740 \begin_layout LyX-Code
18741 FileFilter "*.fig"
18742 \end_layout
18743
18744 \begin_layout LyX-Code
18745 AutomaticProduction true
18746 \end_layout
18747
18748 \begin_layout LyX-Code
18749 Transform Rotate
18750 \end_layout
18751
18752 \begin_layout LyX-Code
18753 Transform Resize
18754 \end_layout
18755
18756 \begin_layout LyX-Code
18757 Format LaTeX
18758 \end_layout
18759
18760 \begin_layout LyX-Code
18761 TransformCommand Rotate RotationLatexCommand
18762 \end_layout
18763
18764 \begin_layout LyX-Code
18765 TransformCommand Resize ResizeLatexCommand
18766 \end_layout
18767
18768 \begin_layout LyX-Code
18769 Product "$$RotateFront$$ResizeFront
18770 \end_layout
18771
18772 \begin_layout LyX-Code
18773          
18774 \backslash
18775
18776 \backslash
18777 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18778 \end_layout
18779
18780 \begin_layout LyX-Code
18781          $$ResizeBack$$RotateBack"
18782 \end_layout
18783
18784 \begin_layout LyX-Code
18785 UpdateFormat pstex
18786 \end_layout
18787
18788 \begin_layout LyX-Code
18789 UpdateResult "$$AbsPath$$Basename.pstex_t"
18790 \end_layout
18791
18792 \begin_layout LyX-Code
18793 Requirement "graphicx"
18794 \end_layout
18795
18796 \begin_layout LyX-Code
18797 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18798 \end_layout
18799
18800 \begin_layout LyX-Code
18801 ReferencedFile latex "$$AbsPath$$Basename.eps"
18802 \end_layout
18803
18804 \begin_layout LyX-Code
18805 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18806 \end_layout
18807
18808 \begin_layout LyX-Code
18809 FormatEnd
18810 \end_layout
18811
18812 \begin_layout LyX-Code
18813 Format PDFLaTeX
18814 \end_layout
18815
18816 \begin_layout LyX-Code
18817 TransformCommand Rotate RotationLatexCommand
18818 \end_layout
18819
18820 \begin_layout LyX-Code
18821 TransformCommand Resize ResizeLatexCommand
18822 \end_layout
18823
18824 \begin_layout LyX-Code
18825 Product "$$RotateFront$$ResizeFront
18826 \end_layout
18827
18828 \begin_layout LyX-Code
18829          
18830 \backslash
18831
18832 \backslash
18833 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18834 \end_layout
18835
18836 \begin_layout LyX-Code
18837          $$ResizeBack$$RotateBack"
18838 \end_layout
18839
18840 \begin_layout LyX-Code
18841 UpdateFormat pdftex
18842 \end_layout
18843
18844 \begin_layout LyX-Code
18845 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18846 \end_layout
18847
18848 \begin_layout LyX-Code
18849 Requirement "graphicx"
18850 \end_layout
18851
18852 \begin_layout LyX-Code
18853 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18854 \end_layout
18855
18856 \begin_layout LyX-Code
18857 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18858 \end_layout
18859
18860 \begin_layout LyX-Code
18861 FormatEnd
18862 \end_layout
18863
18864 \begin_layout LyX-Code
18865 Format Ascii
18866 \end_layout
18867
18868 \begin_layout LyX-Code
18869 Product "$$Contents(
18870 \backslash
18871 "$$AbsPath$$Basename.asc
18872 \backslash
18873 ")"
18874 \end_layout
18875
18876 \begin_layout LyX-Code
18877 UpdateFormat asciixfig
18878 \end_layout
18879
18880 \begin_layout LyX-Code
18881 UpdateResult "$$AbsPath$$Basename.asc"
18882 \end_layout
18883
18884 \begin_layout LyX-Code
18885 FormatEnd
18886 \end_layout
18887
18888 \begin_layout LyX-Code
18889 Format DocBook
18890 \end_layout
18891
18892 \begin_layout LyX-Code
18893 Product "<graphic fileref=
18894 \backslash
18895 "$$AbsOrRelPathMaster$$Basename.eps
18896 \backslash
18897 ">
18898 \end_layout
18899
18900 \begin_layout LyX-Code
18901          </graphic>"
18902 \end_layout
18903
18904 \begin_layout LyX-Code
18905 UpdateFormat eps
18906 \end_layout
18907
18908 \begin_layout LyX-Code
18909 UpdateResult "$$AbsPath$$Basename.eps"
18910 \end_layout
18911
18912 \begin_layout LyX-Code
18913 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18914 \end_layout
18915
18916 \begin_layout LyX-Code
18917 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18918 \end_layout
18919
18920 \begin_layout LyX-Code
18921 FormatEnd
18922 \end_layout
18923
18924 \begin_layout LyX-Code
18925 Product "[XFig: $$FName]"
18926 \end_layout
18927
18928 \begin_layout LyX-Code
18929 FormatEnd
18930 \end_layout
18931
18932 \begin_layout LyX-Code
18933 TemplateEnd
18934 \end_layout
18935
18936 \begin_layout Standard
18937 As you can see, the template is enclosed in 
18938 \begin_inset Flex Code
18939 status collapsed
18940
18941 \begin_layout Plain Layout
18942 Template
18943 \end_layout
18944
18945 \end_inset
18946
18947  \SpecialChar \ldots{}
18948  
18949 \begin_inset Flex Code
18950 status collapsed
18951
18952 \begin_layout Plain Layout
18953 TemplateEnd
18954 \end_layout
18955
18956 \end_inset
18957
18958 .
18959  It contains a header specifying some general settings and, for each supported
18960  primary document file format, a section 
18961 \begin_inset Flex Code
18962 status collapsed
18963
18964 \begin_layout Plain Layout
18965 Format
18966 \end_layout
18967
18968 \end_inset
18969
18970  \SpecialChar \ldots{}
18971  
18972 \begin_inset Flex Code
18973 status collapsed
18974
18975 \begin_layout Plain Layout
18976 FormatEnd
18977 \end_layout
18978
18979 \end_inset
18980
18981 .
18982 \end_layout
18983
18984 \begin_layout Subsection
18985 The template header
18986 \end_layout
18987
18988 \begin_layout Description
18989 \begin_inset Flex Code
18990 status collapsed
18991
18992 \begin_layout Plain Layout
18993 AutomaticProduction
18994 \begin_inset space ~
18995 \end_inset
18996
18997 true|false
18998 \end_layout
18999
19000 \end_inset
19001
19002  Whether the file represented by the template must be generated by LyX.
19003  This command must occur exactly once.
19004 \end_layout
19005
19006 \begin_layout Description
19007 \begin_inset Flex Code
19008 status collapsed
19009
19010 \begin_layout Plain Layout
19011 FileFilter
19012 \begin_inset space ~
19013 \end_inset
19014
19015 <pattern>
19016 \end_layout
19017
19018 \end_inset
19019
19020  A glob pattern that is used in the file dialog to filter out the desired
19021  files.
19022  If there is more than one possible file extension (e.
19023 \begin_inset space \thinspace{}
19024 \end_inset
19025
19026 g.
19027 \begin_inset space \space{}
19028 \end_inset
19029
19030 tgif has 
19031 \begin_inset Flex Code
19032 status collapsed
19033
19034 \begin_layout Plain Layout
19035 .obj
19036 \end_layout
19037
19038 \end_inset
19039
19040  and 
19041 \begin_inset Flex Code
19042 status collapsed
19043
19044 \begin_layout Plain Layout
19045 .tgo
19046 \end_layout
19047
19048 \end_inset
19049
19050 ), use something like 
19051 \begin_inset Flex Code
19052 status collapsed
19053
19054 \begin_layout Plain Layout
19055 "*.{obj,tgo}"
19056 \end_layout
19057
19058 \end_inset
19059
19060 .
19061  This command must occur exactly once.
19062 \end_layout
19063
19064 \begin_layout Description
19065 \begin_inset Flex Code
19066 status collapsed
19067
19068 \begin_layout Plain Layout
19069 GuiName
19070 \begin_inset space ~
19071 \end_inset
19072
19073 <guiname>
19074 \end_layout
19075
19076 \end_inset
19077
19078  The text that is displayed on the button.
19079  This command must occur exactly once.
19080 \end_layout
19081
19082 \begin_layout Description
19083 \begin_inset Flex Code
19084 status collapsed
19085
19086 \begin_layout Plain Layout
19087 HelpText
19088 \begin_inset space ~
19089 \end_inset
19090
19091 <text>
19092 \begin_inset space ~
19093 \end_inset
19094
19095 HelpTextEnd
19096 \end_layout
19097
19098 \end_inset
19099
19100  The help text that is used in the External dialog.
19101  Provide enough information to explain to the user just what the template
19102  can provide him with.
19103  This command must occur exactly once.
19104 \end_layout
19105
19106 \begin_layout Description
19107 \begin_inset Flex Code
19108 status collapsed
19109
19110 \begin_layout Plain Layout
19111 InputFormat
19112 \begin_inset space ~
19113 \end_inset
19114
19115 <format>
19116 \end_layout
19117
19118 \end_inset
19119
19120  The file format of the original file.
19121  This must be the name of a format that is known to LyX (see section
19122 \begin_inset space ~
19123 \end_inset
19124
19125
19126 \begin_inset CommandInset ref
19127 LatexCommand ref
19128 reference "sec:Formats"
19129
19130 \end_inset
19131
19132 ).
19133  Use 
19134 \begin_inset Quotes eld
19135 \end_inset
19136
19137
19138 \begin_inset Flex Code
19139 status collapsed
19140
19141 \begin_layout Plain Layout
19142 *
19143 \end_layout
19144
19145 \end_inset
19146
19147
19148 \begin_inset Quotes erd
19149 \end_inset
19150
19151  if the template can handle original files of more than one format.
19152  LyX will attempt to interrogate the file itself in order to deduce its
19153  format in this case.
19154  This command must occur exactly once.
19155 \end_layout
19156
19157 \begin_layout Description
19158 \begin_inset Flex Code
19159 status collapsed
19160
19161 \begin_layout Plain Layout
19162 Template
19163 \begin_inset space ~
19164 \end_inset
19165
19166 <id>
19167 \end_layout
19168
19169 \end_inset
19170
19171  A unique name for the template.
19172  It must not contain substitution macros (see below).
19173 \end_layout
19174
19175 \begin_layout Description
19176 \begin_inset Flex Code
19177 status collapsed
19178
19179 \begin_layout Plain Layout
19180 Transform
19181 \begin_inset space ~
19182 \end_inset
19183
19184 Rotate|Resize|Clip|Extra
19185 \end_layout
19186
19187 \end_inset
19188
19189  This command specifies which transformations are supported by this template.
19190  It may occur zero or more times.
19191  This command enables the corresponding tabs in the external dialog.
19192  Each 
19193 \begin_inset Flex Code
19194 status collapsed
19195
19196 \begin_layout Plain Layout
19197 Transform
19198 \end_layout
19199
19200 \end_inset
19201
19202  command must have either a corresponding 
19203 \begin_inset Flex Code
19204 status collapsed
19205
19206 \begin_layout Plain Layout
19207 TransformCommand
19208 \end_layout
19209
19210 \end_inset
19211
19212  or a 
19213 \begin_inset Flex Code
19214 status collapsed
19215
19216 \begin_layout Plain Layout
19217 TransformOption
19218 \end_layout
19219
19220 \end_inset
19221
19222  command in the 
19223 \begin_inset Flex Code
19224 status collapsed
19225
19226 \begin_layout Plain Layout
19227 Format
19228 \end_layout
19229
19230 \end_inset
19231
19232  section.
19233  Otherwise the transformation will not be supported by that format.
19234 \end_layout
19235
19236 \begin_layout Subsection
19237 The Format section
19238 \end_layout
19239
19240 \begin_layout Description
19241 \begin_inset Flex Code
19242 status collapsed
19243
19244 \begin_layout Plain Layout
19245 Format
19246 \begin_inset space ~
19247 \end_inset
19248
19249 LaTeX|PDFLaTeX|PlainText|DocBook
19250 \end_layout
19251
19252 \end_inset
19253
19254  The primary document file format that this format definition is for.
19255  Not every template has a sensible representation in all document file formats.
19256  Please define nevertheless a 
19257 \begin_inset Flex Code
19258 status collapsed
19259
19260 \begin_layout Plain Layout
19261 Format
19262 \end_layout
19263
19264 \end_inset
19265
19266  section for all templates.
19267  Use a dummy text when no representation is available.
19268  Then you can at least see a reference to the external material in the exported
19269  document.
19270 \end_layout
19271
19272 \begin_layout Description
19273 \begin_inset Flex Code
19274 status collapsed
19275
19276 \begin_layout Plain Layout
19277 Option
19278 \begin_inset space ~
19279 \end_inset
19280
19281 <name>
19282 \begin_inset space ~
19283 \end_inset
19284
19285 <value>
19286 \end_layout
19287
19288 \end_inset
19289
19290  This command defines an additional macro 
19291 \begin_inset Flex Code
19292 status collapsed
19293
19294 \begin_layout Plain Layout
19295 $$<name>
19296 \end_layout
19297
19298 \end_inset
19299
19300  for substitution in 
19301 \begin_inset Flex Code
19302 status collapsed
19303
19304 \begin_layout Plain Layout
19305 Product
19306 \end_layout
19307
19308 \end_inset
19309
19310 .
19311  
19312 \begin_inset Flex Code
19313 status collapsed
19314
19315 \begin_layout Plain Layout
19316 <value>
19317 \end_layout
19318
19319 \end_inset
19320
19321  itself may contain substitution macros.
19322  The advantage over using 
19323 \begin_inset Flex Code
19324 status collapsed
19325
19326 \begin_layout Plain Layout
19327 <value>
19328 \end_layout
19329
19330 \end_inset
19331
19332  directly in 
19333 \begin_inset Flex Code
19334 status collapsed
19335
19336 \begin_layout Plain Layout
19337 Product
19338 \end_layout
19339
19340 \end_inset
19341
19342  is that the substituted value of 
19343 \begin_inset Flex Code
19344 status collapsed
19345
19346 \begin_layout Plain Layout
19347 $$<name>
19348 \end_layout
19349
19350 \end_inset
19351
19352  is sanitized so that it is a valid optional argument in the document format.
19353  This command may occur zero or more times.
19354 \end_layout
19355
19356 \begin_layout Description
19357 \begin_inset Flex Code
19358 status collapsed
19359
19360 \begin_layout Plain Layout
19361 Product
19362 \begin_inset space ~
19363 \end_inset
19364
19365 <text>
19366 \end_layout
19367
19368 \end_inset
19369
19370  The text that is inserted in the exported document.
19371  This is actually the most important command and can be quite complex.
19372  This command must occur exactly once.
19373 \end_layout
19374
19375 \begin_layout Description
19376 \begin_inset Flex Code
19377 status collapsed
19378
19379 \begin_layout Plain Layout
19380 Preamble
19381 \begin_inset space ~
19382 \end_inset
19383
19384 <name>
19385 \end_layout
19386
19387 \end_inset
19388
19389  This command specifies a preamble snippet that will be included in the
19390  LaTeX preamble.
19391  It has to be defined using 
19392 \begin_inset Flex Code
19393 status collapsed
19394
19395 \begin_layout Plain Layout
19396 PreambleDef
19397 \end_layout
19398
19399 \end_inset
19400
19401  \SpecialChar \ldots{}
19402  
19403 \begin_inset Flex Code
19404 status collapsed
19405
19406 \begin_layout Plain Layout
19407 PreambleDefEnd
19408 \end_layout
19409
19410 \end_inset
19411
19412 .
19413  This command may occur zero or more times.
19414 \end_layout
19415
19416 \begin_layout Description
19417 \begin_inset Flex Code
19418 status collapsed
19419
19420 \begin_layout Plain Layout
19421 ReferencedFile
19422 \begin_inset space ~
19423 \end_inset
19424
19425 <format>
19426 \begin_inset space ~
19427 \end_inset
19428
19429 <filename>
19430 \end_layout
19431
19432 \end_inset
19433
19434  This command denotes files that are created by the conversion process and
19435  are needed for a particular export format.
19436  If the filename is relative, it is interpreted relative to the master document.
19437  This command may be given zero or more times.
19438 \end_layout
19439
19440 \begin_layout Description
19441 \begin_inset Flex Code
19442 status collapsed
19443
19444 \begin_layout Plain Layout
19445 Requirement
19446 \begin_inset space ~
19447 \end_inset
19448
19449 <package>
19450 \end_layout
19451
19452 \end_inset
19453
19454  The name of a required LaTeX package.
19455  The package is included via 
19456 \begin_inset Flex Code
19457 status collapsed
19458
19459 \begin_layout Plain Layout
19460
19461 \backslash
19462 usepackage{}
19463 \end_layout
19464
19465 \end_inset
19466
19467  in the LaTeX preamble.
19468  This command may occur zero or more times.
19469 \end_layout
19470
19471 \begin_layout Description
19472 \begin_inset Flex Code
19473 status collapsed
19474
19475 \begin_layout Plain Layout
19476 TransformCommand
19477 \begin_inset space ~
19478 \end_inset
19479
19480 Rotate
19481 \begin_inset space ~
19482 \end_inset
19483
19484 RotationLatexCommand
19485 \end_layout
19486
19487 \end_inset
19488
19489  This command specifies that the built in LaTeX command should be used for
19490  rotation.
19491  This command may occur once or not at all.
19492 \end_layout
19493
19494 \begin_layout Description
19495 \begin_inset Flex Code
19496 status collapsed
19497
19498 \begin_layout Plain Layout
19499 TransformCommand
19500 \begin_inset space ~
19501 \end_inset
19502
19503 Resize
19504 \begin_inset space ~
19505 \end_inset
19506
19507 ResizeLatexCommand
19508 \end_layout
19509
19510 \end_inset
19511
19512  This command specifies that the built in LaTeX command should be used for
19513  resizing.
19514  This command may occur once or not at all.
19515 \end_layout
19516
19517 \begin_layout Description
19518 \begin_inset Flex Code
19519 status collapsed
19520
19521 \begin_layout Plain Layout
19522 TransformOption
19523 \begin_inset space ~
19524 \end_inset
19525
19526 Rotate
19527 \begin_inset space ~
19528 \end_inset
19529
19530 RotationLatexOption
19531 \end_layout
19532
19533 \end_inset
19534
19535  This command specifies that rotation is done via an optional argument.
19536  This command may occur once or not at all.
19537 \end_layout
19538
19539 \begin_layout Description
19540 \begin_inset Flex Code
19541 status collapsed
19542
19543 \begin_layout Plain Layout
19544 TransformOption
19545 \begin_inset space ~
19546 \end_inset
19547
19548 Resize
19549 \begin_inset space ~
19550 \end_inset
19551
19552 ResizeLatexOption
19553 \end_layout
19554
19555 \end_inset
19556
19557  This command specifies that resizing is done via an optional argument.
19558  This command may occur once or not at all.
19559 \end_layout
19560
19561 \begin_layout Description
19562 \begin_inset Flex Code
19563 status collapsed
19564
19565 \begin_layout Plain Layout
19566 TransformOption
19567 \begin_inset space ~
19568 \end_inset
19569
19570 Clip
19571 \begin_inset space ~
19572 \end_inset
19573
19574 ClipLatexOption
19575 \end_layout
19576
19577 \end_inset
19578
19579  This command specifies that clipping is done via an optional argument.
19580  This command may occur once or not at all.
19581 \end_layout
19582
19583 \begin_layout Description
19584 \begin_inset Flex Code
19585 status collapsed
19586
19587 \begin_layout Plain Layout
19588 TransformOption
19589 \begin_inset space ~
19590 \end_inset
19591
19592 Extra
19593 \begin_inset space ~
19594 \end_inset
19595
19596 ExtraLatexOption
19597 \end_layout
19598
19599 \end_inset
19600
19601  This command specifies that an extra optional argument is used.
19602  This command may occur once or not at all.
19603 \end_layout
19604
19605 \begin_layout Description
19606 \begin_inset Flex Code
19607 status collapsed
19608
19609 \begin_layout Plain Layout
19610 UpdateFormat
19611 \begin_inset space ~
19612 \end_inset
19613
19614 <format>
19615 \end_layout
19616
19617 \end_inset
19618
19619  The file format of the converted file.
19620  This must be the name of a format that is known to LyX (see the 
19621 \begin_inset Flex MenuItem
19622 status collapsed
19623
19624 \begin_layout Plain Layout
19625
19626 \bar under
19627 T
19628 \bar default
19629 ools\SpecialChar \menuseparator
19630
19631 \bar under
19632 P
19633 \bar default
19634 references\SpecialChar \menuseparator
19635 File Handling\SpecialChar \menuseparator
19636 File Format
19637 \end_layout
19638
19639 \end_inset
19640
19641  dialog).
19642  This command must occur exactly once.
19643 \end_layout
19644
19645 \begin_layout Description
19646 \begin_inset Flex Code
19647 status collapsed
19648
19649 \begin_layout Plain Layout
19650 UpdateResult
19651 \begin_inset space ~
19652 \end_inset
19653
19654 <filename>
19655 \end_layout
19656
19657 \end_inset
19658
19659  The file name of the converted file.
19660  The file name must be absolute.
19661  This command must occur exactly once.
19662 \end_layout
19663
19664 \begin_layout Subsection
19665 Preamble definitions
19666 \end_layout
19667
19668 \begin_layout Standard
19669 The external template configuration file may contain additional preamble
19670  definitions enclosed by 
19671 \begin_inset Flex Code
19672 status collapsed
19673
19674 \begin_layout Plain Layout
19675 PreambleDef
19676 \end_layout
19677
19678 \end_inset
19679
19680  \SpecialChar \ldots{}
19681  
19682 \begin_inset Flex Code
19683 status collapsed
19684
19685 \begin_layout Plain Layout
19686 PreambleDefEnd
19687 \end_layout
19688
19689 \end_inset
19690
19691 .
19692  They can be used by the templates in the 
19693 \begin_inset Flex Code
19694 status collapsed
19695
19696 \begin_layout Plain Layout
19697 Format
19698 \end_layout
19699
19700 \end_inset
19701
19702  section.
19703 \end_layout
19704
19705 \begin_layout Section
19706 The substitution mechanism
19707 \end_layout
19708
19709 \begin_layout Standard
19710 When the external material facility invokes an external program, it is done
19711  on the basis of a command defined in the template configuration file.
19712  These commands can contain various macros that are expanded before execution.
19713  Execution always take place in the directory of the containing document.
19714 \end_layout
19715
19716 \begin_layout Standard
19717 Also, whenever external material is to be displayed, the name will be produced
19718  by the substitution mechanism, and most other commands in the template
19719  definition support substitution as well.
19720 \end_layout
19721
19722 \begin_layout Standard
19723 The available macros are the following:
19724 \end_layout
19725
19726 \begin_layout Description
19727 \begin_inset Flex Code
19728 status collapsed
19729
19730 \begin_layout Plain Layout
19731 $$AbsOrRelPathMaster
19732 \end_layout
19733
19734 \end_inset
19735
19736  The file path, absolute or relative to the master LyX document.
19737 \end_layout
19738
19739 \begin_layout Description
19740 \begin_inset Flex Code
19741 status collapsed
19742
19743 \begin_layout Plain Layout
19744 $$AbsOrRelPathParent
19745 \end_layout
19746
19747 \end_inset
19748
19749  The file path, absolute or relative to the LyX document.
19750 \end_layout
19751
19752 \begin_layout Description
19753 \begin_inset Flex Code
19754 status collapsed
19755
19756 \begin_layout Plain Layout
19757 $$AbsPath
19758 \end_layout
19759
19760 \end_inset
19761
19762  The absolute file path.
19763 \end_layout
19764
19765 \begin_layout Description
19766 \begin_inset Flex Code
19767 status collapsed
19768
19769 \begin_layout Plain Layout
19770 $$Basename
19771 \end_layout
19772
19773 \end_inset
19774
19775  The filename without path and without the extension.
19776 \end_layout
19777
19778 \begin_layout Description
19779 \begin_inset Flex Code
19780 status collapsed
19781
19782 \begin_layout Plain Layout
19783 $$Contents(
19784 \begin_inset Quotes eld
19785 \end_inset
19786
19787 filename.ext
19788 \begin_inset Quotes erd
19789 \end_inset
19790
19791 )
19792 \end_layout
19793
19794 \end_inset
19795
19796  This macro will expand to the contents of the file with the name 
19797 \begin_inset Flex Code
19798 status collapsed
19799
19800 \begin_layout Plain Layout
19801 filename.ext
19802 \end_layout
19803
19804 \end_inset
19805
19806 .
19807 \end_layout
19808
19809 \begin_layout Description
19810 \begin_inset Flex Code
19811 status collapsed
19812
19813 \begin_layout Plain Layout
19814 $$Extension
19815 \end_layout
19816
19817 \end_inset
19818
19819  The file extension (including the dot).
19820 \end_layout
19821
19822 \begin_layout Description
19823 \begin_inset Flex Code
19824 status collapsed
19825
19826 \begin_layout Plain Layout
19827 $$FName
19828 \end_layout
19829
19830 \end_inset
19831
19832  The filename of the file specified in the external material dialog.
19833  This is either an absolute name, or it is relative to the LyX document.
19834 \end_layout
19835
19836 \begin_layout Description
19837 \begin_inset Flex Code
19838 status collapsed
19839
19840 \begin_layout Plain Layout
19841 $$FPath
19842 \end_layout
19843
19844 \end_inset
19845
19846  The path part of 
19847 \begin_inset Flex Code
19848 status collapsed
19849
19850 \begin_layout Plain Layout
19851 $$FName
19852 \end_layout
19853
19854 \end_inset
19855
19856  (absolute name or relative to the LyX document).
19857 \end_layout
19858
19859 \begin_layout Description
19860 \begin_inset Flex Code
19861 status collapsed
19862
19863 \begin_layout Plain Layout
19864 $$RelPathMaster
19865 \end_layout
19866
19867 \end_inset
19868
19869  The file path, relative to the master LyX document.
19870 \end_layout
19871
19872 \begin_layout Description
19873 \begin_inset Flex Code
19874 status collapsed
19875
19876 \begin_layout Plain Layout
19877 $$RelPathParent
19878 \end_layout
19879
19880 \end_inset
19881
19882  The file path, relative to the LyX document.
19883 \end_layout
19884
19885 \begin_layout Description
19886 \begin_inset Flex Code
19887 status collapsed
19888
19889 \begin_layout Plain Layout
19890 $$Sysdir
19891 \end_layout
19892
19893 \end_inset
19894
19895  This macro will expand to the absolute path of the system directory.
19896  This is typically used to point to the various helper scripts that are
19897  bundled with LyX.
19898 \end_layout
19899
19900 \begin_layout Description
19901 \begin_inset Flex Code
19902 status collapsed
19903
19904 \begin_layout Plain Layout
19905 $$Tempname
19906 \end_layout
19907
19908 \end_inset
19909
19910  A name and full path to a temporary file which will be automatically deleted
19911  whenever the containing document is closed, or the external material insertion
19912  deleted.
19913 \end_layout
19914
19915 \begin_layout Standard
19916 All path macros contain a trailing directory separator, so you can construct
19917  e.
19918 \begin_inset space \thinspace{}
19919 \end_inset
19920
19921 g.
19922 \begin_inset space \space{}
19923 \end_inset
19924
19925 the absolute filename with 
19926 \begin_inset Flex Code
19927 status collapsed
19928
19929 \begin_layout Plain Layout
19930 $$AbsPath$$Basename$$Extension
19931 \end_layout
19932
19933 \end_inset
19934
19935 .
19936 \end_layout
19937
19938 \begin_layout Standard
19939 The macros above are substituted in all commands unless otherwise noted.
19940  The command 
19941 \begin_inset Flex Code
19942 status collapsed
19943
19944 \begin_layout Plain Layout
19945 Product
19946 \end_layout
19947
19948 \end_inset
19949
19950  supports additionally the following substitutions if they are enabled by
19951  the 
19952 \begin_inset Flex Code
19953 status collapsed
19954
19955 \begin_layout Plain Layout
19956 Transform
19957 \end_layout
19958
19959 \end_inset
19960
19961  and 
19962 \begin_inset Flex Code
19963 status collapsed
19964
19965 \begin_layout Plain Layout
19966 TransformCommand
19967 \end_layout
19968
19969 \end_inset
19970
19971  commands:
19972 \end_layout
19973
19974 \begin_layout Description
19975 \begin_inset Flex Code
19976 status collapsed
19977
19978 \begin_layout Plain Layout
19979 $$ResizeFront
19980 \end_layout
19981
19982 \end_inset
19983
19984  The front part of the resize command.
19985 \end_layout
19986
19987 \begin_layout Description
19988 \begin_inset Flex Code
19989 status collapsed
19990
19991 \begin_layout Plain Layout
19992 $$ResizeBack
19993 \end_layout
19994
19995 \end_inset
19996
19997  The back part of the resize command.
19998 \end_layout
19999
20000 \begin_layout Description
20001 \begin_inset Flex Code
20002 status collapsed
20003
20004 \begin_layout Plain Layout
20005 $$RotateFront
20006 \end_layout
20007
20008 \end_inset
20009
20010  The front part of the rotation command.
20011 \end_layout
20012
20013 \begin_layout Description
20014 \begin_inset Flex Code
20015 status collapsed
20016
20017 \begin_layout Plain Layout
20018 $$RotateBack
20019 \end_layout
20020
20021 \end_inset
20022
20023  The back part of the rotation command.
20024 \end_layout
20025
20026 \begin_layout Standard
20027 The value string of the 
20028 \begin_inset Flex Code
20029 status collapsed
20030
20031 \begin_layout Plain Layout
20032 Option
20033 \end_layout
20034
20035 \end_inset
20036
20037  command supports additionally the following substitutions if they are enabled
20038  by the 
20039 \begin_inset Flex Code
20040 status collapsed
20041
20042 \begin_layout Plain Layout
20043 Transform
20044 \end_layout
20045
20046 \end_inset
20047
20048  and 
20049 \begin_inset Flex Code
20050 status collapsed
20051
20052 \begin_layout Plain Layout
20053 TransformOption
20054 \end_layout
20055
20056 \end_inset
20057
20058  commands:
20059 \end_layout
20060
20061 \begin_layout Description
20062 \begin_inset Flex Code
20063 status collapsed
20064
20065 \begin_layout Plain Layout
20066 $$Clip
20067 \end_layout
20068
20069 \end_inset
20070
20071  The clip option.
20072 \end_layout
20073
20074 \begin_layout Description
20075 \begin_inset Flex Code
20076 status collapsed
20077
20078 \begin_layout Plain Layout
20079 $$Extra
20080 \end_layout
20081
20082 \end_inset
20083
20084  The extra option.
20085 \end_layout
20086
20087 \begin_layout Description
20088 \begin_inset Flex Code
20089 status collapsed
20090
20091 \begin_layout Plain Layout
20092 $$Resize
20093 \end_layout
20094
20095 \end_inset
20096
20097  The resize option.
20098 \end_layout
20099
20100 \begin_layout Description
20101 \begin_inset Flex Code
20102 status collapsed
20103
20104 \begin_layout Plain Layout
20105 $$Rotate
20106 \end_layout
20107
20108 \end_inset
20109
20110  The rotation option.
20111 \end_layout
20112
20113 \begin_layout Standard
20114 You may ask why there are so many path macros.
20115  There are mainly two reasons:
20116 \end_layout
20117
20118 \begin_layout Enumerate
20119 Relative and absolute file names should remain relative or absolute, respectivel
20120 y.
20121  Users may have reasons to prefer either form.
20122  Relative names are useful for portable documents that should work on different
20123  machines, for example.
20124  Absolute names may be required by some programs.
20125 \end_layout
20126
20127 \begin_layout Enumerate
20128 LaTeX treats relative file names differently than LyX and other programs
20129  in nested included files.
20130  For LyX, a relative file name is always relative to the document that contains
20131  the file name.
20132  For LaTeX, it is always relative to the master document.
20133  These two definitions are identical if you have only one document, but
20134  differ if you have a master document that includes part documents.
20135  That means that relative filenames must be transformed when presented to
20136  LaTeX.
20137  Fortunately LyX does this automatically for you if you choose the right
20138  macros.
20139 \end_layout
20140
20141 \begin_layout Standard
20142 So which path macro should be used in new template definitions? The rule
20143  is not difficult:
20144 \end_layout
20145
20146 \begin_layout Itemize
20147 Use 
20148 \begin_inset Flex Code
20149 status collapsed
20150
20151 \begin_layout Plain Layout
20152 $$AbsPath
20153 \end_layout
20154
20155 \end_inset
20156
20157  if an absolute path is required.
20158 \end_layout
20159
20160 \begin_layout Itemize
20161 Use 
20162 \begin_inset Flex Code
20163 status collapsed
20164
20165 \begin_layout Plain Layout
20166 $$AbsOrRelPathMaster
20167 \end_layout
20168
20169 \end_inset
20170
20171  if the substituted string is some kind of LaTeX input.
20172 \end_layout
20173
20174 \begin_layout Itemize
20175 Else use 
20176 \begin_inset Flex Code
20177 status collapsed
20178
20179 \begin_layout Plain Layout
20180 $$AbsOrRelPathParent
20181 \end_layout
20182
20183 \end_inset
20184
20185  in order to preserve the user's choice.
20186 \end_layout
20187
20188 \begin_layout Standard
20189 There are special cases where this rule does not work and e.
20190 \begin_inset space \thinspace{}
20191 \end_inset
20192
20193 g.
20194 \begin_inset space \space{}
20195 \end_inset
20196
20197 relative names are needed, but normally it will work just fine.
20198  One example for such a case is the command 
20199 \begin_inset Flex Code
20200 status collapsed
20201
20202 \begin_layout Plain Layout
20203 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20204 \end_layout
20205
20206 \end_inset
20207
20208  in the XFig template above: We can't use the absolute name because the
20209  copier for 
20210 \begin_inset Flex Code
20211 status collapsed
20212
20213 \begin_layout Plain Layout
20214 .pstex_t
20215 \end_layout
20216
20217 \end_inset
20218
20219  files needs the relative name in order to rewrite the file content.
20220 \end_layout
20221
20222 \begin_layout Section
20223 Security discussion
20224 \begin_inset CommandInset label
20225 LatexCommand label
20226 name "sec:Security-discussion"
20227
20228 \end_inset
20229
20230
20231 \end_layout
20232
20233 \begin_layout Standard
20234 The external material feature interfaces with a lot of external programs
20235  and does so automatically, so we have to consider the security implications
20236  of this.
20237  In particular, since you have the option of including your own filenames
20238  and/or parameter strings and those are expanded into a command, it seems
20239  that it would be possible to create a malicious document which executes
20240  arbitrary commands when a user views or prints the document.
20241  This is something we definitely want to avoid.
20242 \end_layout
20243
20244 \begin_layout Standard
20245 However, since the external program commands are specified in the template
20246  configuration file only, there are no security issues if LyX is properly
20247  configured with safe templates only.
20248  This is so because the external programs are invoked with the 
20249 \begin_inset Flex Code
20250 status collapsed
20251
20252 \begin_layout Plain Layout
20253 execvp
20254 \end_layout
20255
20256 \end_inset
20257
20258 -system call rather than the 
20259 \begin_inset Flex Code
20260 status collapsed
20261
20262 \begin_layout Plain Layout
20263 system
20264 \end_layout
20265
20266 \end_inset
20267
20268  system-call, so it's not possible to execute arbitrary commands from the
20269  filename or parameter section via the shell.
20270 \end_layout
20271
20272 \begin_layout Standard
20273 This also implies that you are restricted in what command strings you can
20274  use in the external material templates.
20275  In particular, pipes and redirection are not readily available.
20276  This has to be so if LyX should remain safe.
20277  If you want to use some of the shell features, you should write a safe
20278  script to do this in a controlled manner, and then invoke the script from
20279  the command string.
20280  
20281 \end_layout
20282
20283 \begin_layout Standard
20284 It is possible to design a template that interacts directly with the shell,
20285  but since this would allow a malicious user to execute arbitrary commands
20286  by writing clever filenames and/or parameters, we generally recommend that
20287  you only use safe scripts that work with the 
20288 \begin_inset Flex Code
20289 status collapsed
20290
20291 \begin_layout Plain Layout
20292 execvp
20293 \end_layout
20294
20295 \end_inset
20296
20297  system call in a controlled manner.
20298  Of course, for use in a controlled environment, it can be tempting to just
20299  fall back to use ordinary shell scripts.
20300  If you do so, be aware that you 
20301 \emph on
20302 will
20303 \emph default
20304  provide an easily exploitable security hole in your system.
20305  Of course it stands to reason that such unsafe templates will never be
20306  included in the standard LyX distribution, although we do encourage people
20307  to submit new templates in the open source tradition.
20308  But LyX as shipped from the official distribution channels will never have
20309  unsafe templates.
20310 \end_layout
20311
20312 \begin_layout Standard
20313 Including external material provides a lot of power, and you have to be
20314  careful not to introduce security hazards with this power.
20315  A subtle error in a single line in an innocent looking script can open
20316  the door to huge security problems.
20317  So if you do not fully understand the issues, we recommend that you consult
20318  a knowledgeable security professional or the LyX development team if you
20319  have any questions about whether a given template is safe or not.
20320  And do this before you use it in an uncontrolled environment.
20321 \end_layout
20322
20323 \end_body
20324 \end_document