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