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