]> git.lyx.org Git - features.git/blob - lib/doc/Customization.lyx
Repair the NextNoIndent docs.
[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
11838 \change_deleted 1414654397 1302985166
11839 Whether the following Paragraph is allowed to indent its very first row.
11840  
11841 \begin_inset Flex Code
11842 status collapsed
11843
11844 \begin_layout Plain Layout
11845 1
11846 \end_layout
11847
11848 \end_inset
11849
11850  means that it is not allowed to do so; 
11851 \begin_inset Flex Code
11852 status collapsed
11853
11854 \begin_layout Plain Layout
11855 0
11856 \end_layout
11857
11858 \end_inset
11859
11860  means it could do so if it wants to.
11861 \change_inserted 1414654397 1302985275
11862 If set to true, and if 
11863 \begin_inset Flex Code
11864 status collapsed
11865
11866 \begin_layout Plain Layout
11867
11868 \change_inserted 1414654397 1302985206
11869 DefaultStyle
11870 \change_unchanged
11871
11872 \end_layout
11873
11874 \end_inset
11875
11876  (usually 
11877 \begin_inset Flex Code
11878 status collapsed
11879
11880 \begin_layout Plain Layout
11881
11882 \change_inserted 1414654397 1302985230
11883 Standard
11884 \change_unchanged
11885
11886 \end_layout
11887
11888 \end_inset
11889
11890 ) paragraphs are being indented, then the indentation of such a paragraph
11891  following one of this type will be suppressed.
11892  (So this will not affect the display of non-default paragraphs.)
11893 \change_unchanged
11894
11895 \end_layout
11896
11897 \begin_layout Description
11898 \begin_inset Flex Code
11899 status collapsed
11900
11901 \begin_layout Plain Layout
11902 ObsoletedBy
11903 \end_layout
11904
11905 \end_inset
11906
11907  Name of a style that has replaced this style.
11908  This is used to rename a style, while keeping backward compatibility.
11909 \end_layout
11910
11911 \begin_layout Description
11912 \begin_inset Flex Code
11913 status collapsed
11914
11915 \begin_layout Plain Layout
11916 OptionalArgs
11917 \end_layout
11918
11919 \end_inset
11920
11921  [
11922 \begin_inset Flex Code
11923 status collapsed
11924
11925 \begin_layout Plain Layout
11926 int=0
11927 \end_layout
11928
11929 \end_inset
11930
11931 ] The number of optional arguments that can be used with this style.
11932  This is useful for things like section headings, and only makes sense with
11933  LaTeX.
11934  Note that, on output, the optional arguments will all precede any required
11935  arguments (see below).
11936  So one can have constructs like:
11937 \end_layout
11938
11939 \begin_deeper
11940 \begin_layout LyX-Code
11941
11942 \backslash
11943 mycmd[opt1]{req1}{contents of paragraph}
11944 \end_layout
11945
11946 \begin_layout Standard
11947 but one cannot have things like: 
11948 \end_layout
11949
11950 \begin_layout LyX-Code
11951
11952 \backslash
11953 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11954 \end_layout
11955
11956 \begin_layout Standard
11957 at least, not without ERT (with which you can have anything).
11958  
11959 \end_layout
11960
11961 \end_deeper
11962 \begin_layout Description
11963 \begin_inset Flex Code
11964 status collapsed
11965
11966 \begin_layout Plain Layout
11967 ParbreakIsNewline
11968 \end_layout
11969
11970 \end_inset
11971
11972
11973 \begin_inset CommandInset label
11974 LatexCommand label
11975 name "des:ParbreakIsNewline"
11976
11977 \end_inset
11978
11979  [
11980 \begin_inset Flex Code
11981 status collapsed
11982
11983 \begin_layout Plain Layout
11984
11985 \emph on
11986 0
11987 \end_layout
11988
11989 \end_inset
11990
11991
11992 \begin_inset Flex Code
11993 status collapsed
11994
11995 \begin_layout Plain Layout
11996 1
11997 \end_layout
11998
11999 \end_inset
12000
12001 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12002  output, but only by a line break; together with 
12003 \begin_inset Flex Code
12004 status collapsed
12005
12006 \begin_layout Plain Layout
12007 PassThru 1
12008 \end_layout
12009
12010 \end_inset
12011
12012 , this allows to emulate a plain text editor (like the ERT inset).
12013 \end_layout
12014
12015 \begin_layout Description
12016 \begin_inset Flex Code
12017 status collapsed
12018
12019 \begin_layout Plain Layout
12020 ParIndent
12021 \end_layout
12022
12023 \end_inset
12024
12025  [
12026 \begin_inset Flex Code
12027 status collapsed
12028
12029 \begin_layout Plain Layout
12030 string=""
12031 \end_layout
12032
12033 \end_inset
12034
12035 ] The indent of the very first line of a paragraph.
12036  The 
12037 \begin_inset Flex Code
12038 status collapsed
12039
12040 \begin_layout Plain Layout
12041 Parindent
12042 \end_layout
12043
12044 \end_inset
12045
12046  will be fixed for a certain style.
12047  The exception is the default style, since the indentation for these paragraphs
12048  can be prohibited with 
12049 \begin_inset Flex Code
12050 status collapsed
12051
12052 \begin_layout Plain Layout
12053 NextNoIndent
12054 \end_layout
12055
12056 \end_inset
12057
12058 .
12059  Also, 
12060 \begin_inset Flex Code
12061 status collapsed
12062
12063 \begin_layout Plain Layout
12064 Standard
12065 \end_layout
12066
12067 \end_inset
12068
12069  style paragraphs inside environments use the 
12070 \begin_inset Flex Code
12071 status collapsed
12072
12073 \begin_layout Plain Layout
12074 Parindent
12075 \end_layout
12076
12077 \end_inset
12078
12079  of the environment, not their native one.
12080  For example, 
12081 \begin_inset Flex Code
12082 status collapsed
12083
12084 \begin_layout Plain Layout
12085 Standard
12086 \end_layout
12087
12088 \end_inset
12089
12090  paragraphs inside an enumeration are not indented.
12091 \end_layout
12092
12093 \begin_layout Description
12094 \begin_inset Flex Code
12095 status collapsed
12096
12097 \begin_layout Plain Layout
12098 Parsep
12099 \end_layout
12100
12101 \end_inset
12102
12103  [
12104 \begin_inset Flex Code
12105 status collapsed
12106
12107 \begin_layout Plain Layout
12108 float=0
12109 \end_layout
12110
12111 \end_inset
12112
12113 ] The vertical space between two paragraphs of this style.
12114 \end_layout
12115
12116 \begin_layout Description
12117 \begin_inset Flex Code
12118 status collapsed
12119
12120 \begin_layout Plain Layout
12121 Parskip
12122 \end_layout
12123
12124 \end_inset
12125
12126  [
12127 \begin_inset Flex Code
12128 status collapsed
12129
12130 \begin_layout Plain Layout
12131 float=0
12132 \end_layout
12133
12134 \end_inset
12135
12136 ] LyX allows the user to choose either 
12137 \begin_inset Quotes eld
12138 \end_inset
12139
12140 indent
12141 \begin_inset Quotes erd
12142 \end_inset
12143
12144  or 
12145 \begin_inset Quotes eld
12146 \end_inset
12147
12148 skip
12149 \begin_inset Quotes erd
12150 \end_inset
12151
12152  to typeset a document.
12153  When 
12154 \begin_inset Quotes eld
12155 \end_inset
12156
12157 indent
12158 \begin_inset Quotes erd
12159 \end_inset
12160
12161  is chosen, this value is completely ignored.
12162  When 
12163 \begin_inset Quotes eld
12164 \end_inset
12165
12166 skip
12167 \begin_inset Quotes erd
12168 \end_inset
12169
12170  is chosen, the parindent of a LaTeXtype 
12171 \begin_inset Quotes eld
12172 \end_inset
12173
12174 Paragraph
12175 \begin_inset Quotes erd
12176 \end_inset
12177
12178  style is ignored and all paragraphs are separated by this parskip argument.
12179  The vertical space is calculated with 
12180 \begin_inset Flex Code
12181 status collapsed
12182
12183 \begin_layout Plain Layout
12184 value
12185 \begin_inset space ~
12186 \end_inset
12187
12188 * DefaultHeight
12189 \end_layout
12190
12191 \end_inset
12192
12193  where 
12194 \begin_inset Flex Code
12195 status collapsed
12196
12197 \begin_layout Plain Layout
12198 DefaultHeight
12199 \end_layout
12200
12201 \end_inset
12202
12203  is the height of a row with the normal font.
12204  This way, the look stays the same with different screen fonts.
12205 \end_layout
12206
12207 \begin_layout Description
12208 \begin_inset Flex Code
12209 status collapsed
12210
12211 \begin_layout Plain Layout
12212 PassThru
12213 \end_layout
12214
12215 \end_inset
12216
12217  
12218 \begin_inset CommandInset label
12219 LatexCommand label
12220 name "des:PassThru"
12221
12222 \end_inset
12223
12224 [
12225 \begin_inset Flex Code
12226 status collapsed
12227
12228 \begin_layout Plain Layout
12229
12230 \emph on
12231 0
12232 \end_layout
12233
12234 \end_inset
12235
12236
12237 \begin_inset Flex Code
12238 status collapsed
12239
12240 \begin_layout Plain Layout
12241 1
12242 \end_layout
12243
12244 \end_inset
12245
12246 ] Whether the contents of this paragraph should be output in raw form, meaning
12247  without special translations that LaTeX would require.
12248 \end_layout
12249
12250 \begin_layout Description
12251 \begin_inset Flex Code
12252 status collapsed
12253
12254 \begin_layout Plain Layout
12255 Preamble
12256 \end_layout
12257
12258 \end_inset
12259
12260  
12261 \begin_inset CommandInset label
12262 LatexCommand label
12263 name "des:Preamble"
12264
12265 \end_inset
12266
12267 Information to be included in the LaTeX preamble when this style is used.
12268  Used to define macros, load packages, etc., required by this particular
12269  style.
12270  Must end with 
12271 \begin_inset Quotes eld
12272 \end_inset
12273
12274
12275 \begin_inset Flex Code
12276 status collapsed
12277
12278 \begin_layout Plain Layout
12279 EndPreamble
12280 \end_layout
12281
12282 \end_inset
12283
12284
12285 \begin_inset Quotes erd
12286 \end_inset
12287
12288 .
12289 \end_layout
12290
12291 \begin_layout Description
12292 \begin_inset Flex Code
12293 status collapsed
12294
12295 \begin_layout Plain Layout
12296 RefPrefix
12297 \end_layout
12298
12299 \end_inset
12300
12301  [
12302 \begin_inset Flex Code
12303 status collapsed
12304
12305 \begin_layout Plain Layout
12306 string
12307 \end_layout
12308
12309 \end_inset
12310
12311 ] The prefix to use when creating labels referring to paragraphs of this
12312  type.
12313  This allows the use of formatted references.
12314 \end_layout
12315
12316 \begin_layout Description
12317 \begin_inset Flex Code
12318 status collapsed
12319
12320 \begin_layout Plain Layout
12321 RequiredArgs
12322 \end_layout
12323
12324 \end_inset
12325
12326  [
12327 \begin_inset Flex Code
12328 status collapsed
12329
12330 \begin_layout Plain Layout
12331 int=0
12332 \end_layout
12333
12334 \end_inset
12335
12336 ] The number of required arguments that the LaTeX command or environment
12337  corresponding to this style expects.
12338  In the case of a command, these are required arguments 
12339 \emph on
12340 other than
12341 \emph default
12342  that associated with the content of the paragraph itself.
12343  These do not actually have to be provided: LyX will output empty arguments
12344  if necessary.
12345  Note that optional arguments will be output before required arguments.
12346  See the discussion of the 
12347 \begin_inset Flex Code
12348 status collapsed
12349
12350 \begin_layout Plain Layout
12351 OptionalArgs
12352 \end_layout
12353
12354 \end_inset
12355
12356  tag above for more information.
12357 \end_layout
12358
12359 \begin_layout Description
12360 \begin_inset Flex Code
12361 status collapsed
12362
12363 \begin_layout Plain Layout
12364 Requires 
12365 \end_layout
12366
12367 \end_inset
12368
12369  [
12370 \begin_inset Flex Code
12371 status collapsed
12372
12373 \begin_layout Plain Layout
12374 string
12375 \end_layout
12376
12377 \end_inset
12378
12379
12380 \begin_inset CommandInset label
12381 LatexCommand label
12382 name "des:Requires"
12383
12384 \end_inset
12385
12386 Whether the style requires the feature 
12387 \begin_inset Flex Code
12388 status collapsed
12389
12390 \begin_layout Plain Layout
12391 string
12392 \end_layout
12393
12394 \end_inset
12395
12396 .
12397  See the description of 
12398 \begin_inset Flex Code
12399 status collapsed
12400
12401 \begin_layout Plain Layout
12402 Provides
12403 \end_layout
12404
12405 \end_inset
12406
12407  above (page 
12408 \begin_inset CommandInset ref
12409 LatexCommand pageref
12410 reference "des:FreeSpacing"
12411
12412 \end_inset
12413
12414 ) for information on `features'.
12415  
12416 \end_layout
12417
12418 \begin_layout Description
12419 \begin_inset Flex Code
12420 status collapsed
12421
12422 \begin_layout Plain Layout
12423 RightMargin
12424 \end_layout
12425
12426 \end_inset
12427
12428  [
12429 \begin_inset Flex Code
12430 status collapsed
12431
12432 \begin_layout Plain Layout
12433 string=""
12434 \end_layout
12435
12436 \end_inset
12437
12438 ] Similar to 
12439 \begin_inset Flex Code
12440 status collapsed
12441
12442 \begin_layout Plain Layout
12443 LeftMargin
12444 \end_layout
12445
12446 \end_inset
12447
12448 .
12449 \end_layout
12450
12451 \begin_layout Description
12452 \begin_inset Flex Code
12453 status collapsed
12454
12455 \begin_layout Plain Layout
12456 Spacing
12457 \end_layout
12458
12459 \end_inset
12460
12461  [
12462 \begin_inset Flex Code
12463 status collapsed
12464
12465 \begin_layout Plain Layout
12466
12467 \emph on
12468 single
12469 \emph default
12470 , onehalf, double, other
12471 \end_layout
12472
12473 \end_inset
12474
12475  
12476 \emph on
12477 value
12478 \emph default
12479 ] This defines what the default spacing should be in the style.
12480  The arguments 
12481 \begin_inset Flex Code
12482 status collapsed
12483
12484 \begin_layout Plain Layout
12485 single
12486 \end_layout
12487
12488 \end_inset
12489
12490
12491 \begin_inset Flex Code
12492 status collapsed
12493
12494 \begin_layout Plain Layout
12495 onehalf
12496 \end_layout
12497
12498 \end_inset
12499
12500  and 
12501 \begin_inset Flex Code
12502 status collapsed
12503
12504 \begin_layout Plain Layout
12505 double
12506 \end_layout
12507
12508 \end_inset
12509
12510  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12511  If you specify the argument 
12512 \begin_inset Flex Code
12513 status collapsed
12514
12515 \begin_layout Plain Layout
12516 other
12517 \end_layout
12518
12519 \end_inset
12520
12521 , then you should also provide a numerical argument which will be the actual
12522  multiplier value.
12523  Note that, contrary to other parameters, 
12524 \begin_inset Flex Code
12525 status collapsed
12526
12527 \begin_layout Plain Layout
12528 Spacing
12529 \end_layout
12530
12531 \end_inset
12532
12533  implies the generation of specific LaTeX code, using the package 
12534 \family roman
12535
12536 \begin_inset Flex Code
12537 status collapsed
12538
12539 \begin_layout Plain Layout
12540 setspace.sty
12541 \end_layout
12542
12543 \end_inset
12544
12545 .
12546 \end_layout
12547
12548 \begin_layout Description
12549 \begin_inset Flex Code
12550 status collapsed
12551
12552 \begin_layout Plain Layout
12553 Spellcheck
12554 \end_layout
12555
12556 \end_inset
12557
12558  [
12559 \begin_inset Flex Code
12560 status collapsed
12561
12562 \begin_layout Plain Layout
12563 0
12564 \end_layout
12565
12566 \end_inset
12567
12568 ,
12569 \begin_inset Flex Code
12570 status collapsed
12571
12572 \begin_layout Plain Layout
12573
12574 \emph on
12575 1
12576 \end_layout
12577
12578 \end_inset
12579
12580 ] Spellcheck paragraphs of this style.
12581  Default is true.
12582 \end_layout
12583
12584 \begin_layout Description
12585 \begin_inset Flex Code
12586 status collapsed
12587
12588 \begin_layout Plain Layout
12589 TextFont
12590 \end_layout
12591
12592 \end_inset
12593
12594  The font used for the text body .
12595  See section 
12596 \begin_inset CommandInset ref
12597 LatexCommand ref
12598 reference "sub:Font-description"
12599
12600 \end_inset
12601
12602 .
12603 \end_layout
12604
12605 \begin_layout Description
12606 \begin_inset Flex Code
12607 status collapsed
12608
12609 \begin_layout Plain Layout
12610 TocLevel
12611 \end_layout
12612
12613 \end_inset
12614
12615
12616 \series medium
12617  
12618 \begin_inset Flex Code
12619 status collapsed
12620
12621 \begin_layout Plain Layout
12622
12623 \series medium
12624 [int]
12625 \end_layout
12626
12627 \end_inset
12628
12629
12630 \series default
12631  The level of the style in the table of contents.
12632  This is used for automatic numbering of section headings.
12633 \end_layout
12634
12635 \begin_layout Description
12636 \begin_inset Flex Code
12637 status collapsed
12638
12639 \begin_layout Plain Layout
12640 TopSep
12641 \end_layout
12642
12643 \end_inset
12644
12645  [
12646 \begin_inset Flex Code
12647 status collapsed
12648
12649 \begin_layout Plain Layout
12650 float=0
12651 \end_layout
12652
12653 \end_inset
12654
12655 ] The vertical space with which the very first of a chain of paragraphs
12656  with this style is separated from the previous paragraph.
12657  If the previous paragraph has another style, the separations are not simply
12658  added, but the maximum is taken.
12659 \end_layout
12660
12661 \begin_layout Subsection
12662 \begin_inset CommandInset label
12663 LatexCommand label
12664 name "sub:I18n"
12665
12666 \end_inset
12667
12668 Internationalization of Paragraph Styles
12669 \end_layout
12670
12671 \begin_layout Standard
12672 LyX has long supported internationalization of layout information, but,
12673  until version 2.0, this applied only to the user interface and not to, say,
12674  PDF output.
12675  Thus, French authors were forced to resort to ugly hacks if they wanted
12676  `
12677 \lang french
12678 Théorème
12679 \lang english
12680  1' instead of `Theorem 1'.
12681  Thanks to Georg Baum, that is no longer the case.
12682 \end_layout
12683
12684 \begin_layout Standard
12685 If a 
12686 \begin_inset Flex Code
12687 status collapsed
12688
12689 \begin_layout Plain Layout
12690 Style
12691 \end_layout
12692
12693 \end_inset
12694
12695  defines text that is to appear in the typeset document, it may use 
12696 \begin_inset Flex Code
12697 status collapsed
12698
12699 \begin_layout Plain Layout
12700 LangPreamble
12701 \end_layout
12702
12703 \end_inset
12704
12705  and 
12706 \begin_inset Flex Code
12707 status collapsed
12708
12709 \begin_layout Plain Layout
12710 BabelPreamble
12711 \end_layout
12712
12713 \end_inset
12714
12715  to support non-English and even multi-language documents correctly.
12716  The following excerpt (from the 
12717 \begin_inset Flex Code
12718 status collapsed
12719
12720 \begin_layout Plain Layout
12721 theorems-ams.inc
12722 \end_layout
12723
12724 \end_inset
12725
12726  file) shows how this works:
12727 \end_layout
12728
12729 \begin_layout LyX-Code
12730 Preamble
12731 \end_layout
12732
12733 \begin_deeper
12734 \begin_layout LyX-Code
12735   
12736 \backslash
12737 theoremstyle{remark}
12738 \end_layout
12739
12740 \begin_layout LyX-Code
12741   
12742 \backslash
12743 newtheorem{claim}[thm]{
12744 \backslash
12745 protect
12746 \backslash
12747 claimname}
12748 \end_layout
12749
12750 \begin_layout LyX-Code
12751 EndPreamble
12752 \end_layout
12753
12754 \begin_layout LyX-Code
12755 LangPreamble
12756 \end_layout
12757
12758 \begin_layout LyX-Code
12759   
12760 \backslash
12761 providecommand{
12762 \backslash
12763 claimname}{_(Claim)}
12764 \end_layout
12765
12766 \begin_layout LyX-Code
12767 EndLangPreamble
12768 \end_layout
12769
12770 \begin_layout LyX-Code
12771 BabelPreamble
12772 \end_layout
12773
12774 \begin_layout LyX-Code
12775     
12776 \backslash
12777 addto
12778 \backslash
12779 captions$$lang{
12780 \backslash
12781 renewcommand{
12782 \backslash
12783 claimname}{_(Claim)}}
12784 \end_layout
12785
12786 \begin_layout LyX-Code
12787 EndBabelPreamble
12788 \end_layout
12789
12790 \end_deeper
12791 \begin_layout Standard
12792 In principle, any legal LaTeX may appear in the 
12793 \begin_inset Flex Code
12794 status collapsed
12795
12796 \begin_layout Plain Layout
12797 LangPreamble
12798 \end_layout
12799
12800 \end_inset
12801
12802  and 
12803 \begin_inset Flex Code
12804 status collapsed
12805
12806 \begin_layout Plain Layout
12807 BabelPreamble
12808 \end_layout
12809
12810 \end_inset
12811
12812  tags, but in practice they will typically look as they do here.
12813  The key to correct translation of the typeset text is the definition of
12814  the LaTeX command 
12815 \begin_inset Flex Code
12816 status collapsed
12817
12818 \begin_layout Plain Layout
12819
12820 \backslash
12821 claimname
12822 \end_layout
12823
12824 \end_inset
12825
12826  and its use in 
12827 \begin_inset Flex Code
12828 status collapsed
12829
12830 \begin_layout Plain Layout
12831
12832 \backslash
12833 newtheorem
12834 \end_layout
12835
12836 \end_inset
12837
12838 .
12839  
12840 \end_layout
12841
12842 \begin_layout Standard
12843 The 
12844 \begin_inset Flex Code
12845 status collapsed
12846
12847 \begin_layout Plain Layout
12848 LangPreamble
12849 \end_layout
12850
12851 \end_inset
12852
12853  tag provides for internationalization based upon the overall language of
12854  the document.
12855  The contents of the tag will be included in the preamble, just as with
12856  the 
12857 \begin_inset Flex Code
12858 status collapsed
12859
12860 \begin_layout Plain Layout
12861 Preamble
12862 \end_layout
12863
12864 \end_inset
12865
12866  tag.
12867  What makes it special is the use of the 
12868 \begin_inset Quotes eld
12869 \end_inset
12870
12871 function
12872 \begin_inset Quotes erd
12873 \end_inset
12874
12875  
12876 \begin_inset Flex Code
12877 status collapsed
12878
12879 \begin_layout Plain Layout
12880 _()
12881 \end_layout
12882
12883 \end_inset
12884
12885 , which will be replaced, when LyX produces LaTeX output, with the translation
12886  of its argument into the document language.
12887 \end_layout
12888
12889 \begin_layout Standard
12890 The 
12891 \begin_inset Flex Code
12892 status collapsed
12893
12894 \begin_layout Plain Layout
12895 BabelPreamble
12896 \end_layout
12897
12898 \end_inset
12899
12900  tag is more complex, since it is meant to provide support for multi-language
12901  documents and so offers an interface to the 
12902 \begin_inset Flex Code
12903 status collapsed
12904
12905 \begin_layout Plain Layout
12906 babel
12907 \end_layout
12908
12909 \end_inset
12910
12911  package.
12912  Its contents will be added to the preamble once for each language that
12913  appears in the document.
12914  In this case, the argument to 
12915 \begin_inset Flex Code
12916 status collapsed
12917
12918 \begin_layout Plain Layout
12919 _()
12920 \end_layout
12921
12922 \end_inset
12923
12924  will be replaced with its translation into the language in question; the
12925  expression 
12926 \begin_inset Flex Code
12927 status collapsed
12928
12929 \begin_layout Plain Layout
12930 $$lang
12931 \end_layout
12932
12933 \end_inset
12934
12935  is replaced by the language name (as used by the babel package).
12936 \end_layout
12937
12938 \begin_layout Standard
12939 A German document that also included a French section would thus have the
12940  following in the preamble:
12941 \end_layout
12942
12943 \begin_layout LyX-Code
12944
12945 \backslash
12946 addto
12947 \backslash
12948 captionsfrench{
12949 \backslash
12950 renewcommand{
12951 \backslash
12952 claimname}{Affirmation}}   
12953 \backslash
12954 addto
12955 \backslash
12956 captionsngerman{
12957 \backslash
12958 renewcommand{
12959 \backslash
12960 claimname}{Behauptung}}   
12961 \backslash
12962 providecommand{
12963 \backslash
12964 claimname}{Behauptung}
12965 \end_layout
12966
12967 \begin_layout Standard
12968 LaTeX and 
12969 \begin_inset Flex Code
12970 status collapsed
12971
12972 \begin_layout Plain Layout
12973 babel
12974 \end_layout
12975
12976 \end_inset
12977
12978  will then conspire to produce the correct text in the output.
12979 \end_layout
12980
12981 \begin_layout Standard
12982 One important point to note here is that the translations are provided by
12983  LyX itself, through the same mechanism it uses for internationalization
12984  of the user interface.
12985  This means, in effect, that 
12986 \begin_inset Flex Code
12987 status collapsed
12988
12989 \begin_layout Plain Layout
12990 LangPreamble
12991 \end_layout
12992
12993 \end_inset
12994
12995  and 
12996 \begin_inset Flex Code
12997 status collapsed
12998
12999 \begin_layout Plain Layout
13000 BabelPreamble
13001 \end_layout
13002
13003 \end_inset
13004
13005  are really only of use in layout files that are provided with LyX, since
13006  text entered in user-created layout files will not be seen by LyX's internation
13007 alization routines.
13008  That said, however, any layout created with the intention that it will
13009  be included with LyX should use these tags where appropriate.
13010 \end_layout
13011
13012 \begin_layout Subsection
13013 Floats
13014 \begin_inset CommandInset label
13015 LatexCommand label
13016 name "sub:Floats"
13017
13018 \end_inset
13019
13020
13021 \end_layout
13022
13023 \begin_layout Standard
13024 Since version 1.3.0 of LyX, it is has been both possible and necessary to
13025  define the floats (
13026 \begin_inset Flex MenuItem
13027 status collapsed
13028
13029 \begin_layout Plain Layout
13030 figure
13031 \end_layout
13032
13033 \end_inset
13034
13035
13036 \begin_inset Flex MenuItem
13037 status collapsed
13038
13039 \begin_layout Plain Layout
13040 table
13041 \end_layout
13042
13043 \end_inset
13044
13045 , \SpecialChar \ldots{}
13046 ) in the text class itself.
13047  Standard floats are included in the file 
13048 \begin_inset Flex Code
13049 status collapsed
13050
13051 \begin_layout Plain Layout
13052 stdfloats.inc
13053 \end_layout
13054
13055 \end_inset
13056
13057 , so you may have to do no more than add
13058 \end_layout
13059
13060 \begin_layout LyX-Code
13061 Input stdfloats.inc
13062 \end_layout
13063
13064 \begin_layout Standard
13065 to your layout file.
13066  If you want to implement a text class that proposes some other float types
13067  (like the AGU class bundled with LyX), the information below will hopefully
13068  help you:
13069 \end_layout
13070
13071 \begin_layout Description
13072 \begin_inset Flex Code
13073 status collapsed
13074
13075 \begin_layout Plain Layout
13076 Extension
13077 \end_layout
13078
13079 \end_inset
13080
13081  [
13082 \begin_inset Flex Code
13083 status collapsed
13084
13085 \begin_layout Plain Layout
13086 string
13087 \end_layout
13088
13089 \end_inset
13090
13091 =
13092 \begin_inset Quotes erd
13093 \end_inset
13094
13095
13096 \begin_inset Quotes erd
13097 \end_inset
13098
13099 ] The file name extension of an auxiliary file for the list of figures (or
13100  whatever).
13101  LaTeX writes the captions to this file.
13102 \end_layout
13103
13104 \begin_layout Description
13105 \begin_inset Flex Code
13106 status collapsed
13107
13108 \begin_layout Plain Layout
13109 GuiName
13110 \end_layout
13111
13112 \end_inset
13113
13114  [
13115 \begin_inset Flex Code
13116 status collapsed
13117
13118 \begin_layout Plain Layout
13119 string
13120 \end_layout
13121
13122 \end_inset
13123
13124 =
13125 \begin_inset Quotes erd
13126 \end_inset
13127
13128
13129 \begin_inset Quotes erd
13130 \end_inset
13131
13132 ] The string that will be used in the menus and also for the caption.
13133  This is translated to the current language if babel is used.
13134 \end_layout
13135
13136 \begin_layout Description
13137 \begin_inset Flex Code
13138 status collapsed
13139
13140 \begin_layout Plain Layout
13141 HTML*
13142 \end_layout
13143
13144 \end_inset
13145
13146  These are used for XHTML output.
13147  See 
13148 \begin_inset CommandInset ref
13149 LatexCommand ref
13150 reference "sec:Tags-for-XHTML"
13151
13152 \end_inset
13153
13154 .
13155 \end_layout
13156
13157 \begin_layout Description
13158 \begin_inset Flex Code
13159 status collapsed
13160
13161 \begin_layout Plain Layout
13162 IsPredefined
13163 \end_layout
13164
13165 \end_inset
13166
13167  [
13168 \emph on
13169
13170 \begin_inset Flex Code
13171 status open
13172
13173 \begin_layout Plain Layout
13174 0
13175 \end_layout
13176
13177 \end_inset
13178
13179
13180 \emph default
13181
13182 \begin_inset Flex Code
13183 status collapsed
13184
13185 \begin_layout Plain Layout
13186 1
13187 \end_layout
13188
13189 \end_inset
13190
13191 ] Indicates whether the float is already defined in the document class or
13192  if we instead need to load 
13193 \begin_inset Flex Code
13194 status collapsed
13195
13196 \begin_layout Plain Layout
13197 float.sty
13198 \end_layout
13199
13200 \end_inset
13201
13202  and use what it provides to define it on-the-fly.
13203  The default is 
13204 \begin_inset Flex Code
13205 status collapsed
13206
13207 \begin_layout Plain Layout
13208 0
13209 \end_layout
13210
13211 \end_inset
13212
13213 , which means: use 
13214 \begin_inset Flex Code
13215 status collapsed
13216
13217 \begin_layout Plain Layout
13218 float.sty
13219 \end_layout
13220
13221 \end_inset
13222
13223 .
13224  It should be set to 
13225 \begin_inset Flex Code
13226 status collapsed
13227
13228 \begin_layout Plain Layout
13229 1
13230 \end_layout
13231
13232 \end_inset
13233
13234  if the float is already defined by the LaTeX document class.
13235 \end_layout
13236
13237 \begin_layout Description
13238 \begin_inset Flex Code
13239 status collapsed
13240
13241 \begin_layout Plain Layout
13242 ListCommand
13243 \end_layout
13244
13245 \end_inset
13246
13247  [
13248 \begin_inset Flex Code
13249 status collapsed
13250
13251 \begin_layout Plain Layout
13252 string
13253 \end_layout
13254
13255 \end_inset
13256
13257 =
13258 \begin_inset Quotes erd
13259 \end_inset
13260
13261
13262 \begin_inset Quotes erd
13263 \end_inset
13264
13265 ] The command used to generate a list of floats of this type; the leading
13266  `
13267 \backslash
13268 ' should be omitted.
13269  This 
13270 \emph on
13271 must
13272 \emph default
13273  be given if 
13274 \begin_inset Flex Code
13275 status collapsed
13276
13277 \begin_layout Plain Layout
13278 UsesFloatPkg
13279 \end_layout
13280
13281 \end_inset
13282
13283  is false, since there is no standard way to generate this command.
13284  It is ignored if 
13285 \begin_inset Flex Code
13286 status collapsed
13287
13288 \begin_layout Plain Layout
13289 UsesFloatPkg
13290 \end_layout
13291
13292 \end_inset
13293
13294  is true, since in that case there is a standard way to define the command.
13295 \end_layout
13296
13297 \begin_layout Description
13298 \begin_inset Flex Code
13299 status collapsed
13300
13301 \begin_layout Plain Layout
13302 ListName
13303 \end_layout
13304
13305 \end_inset
13306
13307  [
13308 \begin_inset Flex Code
13309 status collapsed
13310
13311 \begin_layout Plain Layout
13312 string
13313 \end_layout
13314
13315 \end_inset
13316
13317 =
13318 \begin_inset Quotes erd
13319 \end_inset
13320
13321
13322 \begin_inset Quotes erd
13323 \end_inset
13324
13325 ] A title for a list of floats of this kind (list of figures, tables, or
13326  whatever).
13327  It is used for the screen label within LyX; it is passed to LaTeX for use
13328  as the title there; and it is used as the title in XHTML output.
13329  It will be translated to the document language.
13330 \end_layout
13331
13332 \begin_layout Description
13333 \begin_inset Flex Code
13334 status collapsed
13335
13336 \begin_layout Plain Layout
13337 NumberWithin
13338 \end_layout
13339
13340 \end_inset
13341
13342  [
13343 \begin_inset Flex Code
13344 status collapsed
13345
13346 \begin_layout Plain Layout
13347 string
13348 \end_layout
13349
13350 \end_inset
13351
13352 =
13353 \begin_inset Quotes erd
13354 \end_inset
13355
13356
13357 \begin_inset Quotes erd
13358 \end_inset
13359
13360 ] This (optional) argument determines whether floats of this class will
13361  be numbered within some sectional unit of the document.
13362  For example, if within is equal to 
13363 \begin_inset Flex Code
13364 status collapsed
13365
13366 \begin_layout Plain Layout
13367 chapter
13368 \end_layout
13369
13370 \end_inset
13371
13372 , the floats will be numbered within chapters.
13373  
13374 \end_layout
13375
13376 \begin_layout Description
13377 \begin_inset Flex Code
13378 status collapsed
13379
13380 \begin_layout Plain Layout
13381 Placement
13382 \end_layout
13383
13384 \end_inset
13385
13386  [
13387 \begin_inset Flex Code
13388 status collapsed
13389
13390 \begin_layout Plain Layout
13391 string
13392 \end_layout
13393
13394 \end_inset
13395
13396 =
13397 \begin_inset Quotes erd
13398 \end_inset
13399
13400
13401 \begin_inset Quotes erd
13402 \end_inset
13403
13404 ] The default placement for the given class of floats.
13405  The string should be as in standard LaTeX: 
13406 \begin_inset Flex Code
13407 status collapsed
13408
13409 \begin_layout Plain Layout
13410 t
13411 \end_layout
13412
13413 \end_inset
13414
13415
13416 \begin_inset Flex Code
13417 status collapsed
13418
13419 \begin_layout Plain Layout
13420 b
13421 \end_layout
13422
13423 \end_inset
13424
13425
13426 \begin_inset Flex Code
13427 status collapsed
13428
13429 \begin_layout Plain Layout
13430 p
13431 \end_layout
13432
13433 \end_inset
13434
13435  and 
13436 \begin_inset Flex Code
13437 status collapsed
13438
13439 \begin_layout Plain Layout
13440 h
13441 \end_layout
13442
13443 \end_inset
13444
13445  for top, bottom, page, and here, respectively.
13446 \begin_inset Foot
13447 status collapsed
13448
13449 \begin_layout Plain Layout
13450 Note that the order of these letters in the string is irrelevant, like in
13451  LaTeX.
13452 \end_layout
13453
13454 \end_inset
13455
13456  On top of that there is a new type, 
13457 \begin_inset Flex Code
13458 status collapsed
13459
13460 \begin_layout Plain Layout
13461 H
13462 \end_layout
13463
13464 \end_inset
13465
13466 , which does not really correspond to a float, since it means: put it 
13467 \begin_inset Quotes eld
13468 \end_inset
13469
13470 here
13471 \begin_inset Quotes erd
13472 \end_inset
13473
13474  and nowhere else.
13475  Note however that the 
13476 \begin_inset Flex Code
13477 status collapsed
13478
13479 \begin_layout Plain Layout
13480 H
13481 \end_layout
13482
13483 \end_inset
13484
13485  specifier is special and, because of implementation details, cannot be
13486  used in non-built in float types.
13487  If you do not understand what this means, just use 
13488 \begin_inset Quotes eld
13489 \end_inset
13490
13491
13492 \begin_inset Flex Code
13493 status collapsed
13494
13495 \begin_layout Plain Layout
13496 tbp
13497 \end_layout
13498
13499 \end_inset
13500
13501
13502 \begin_inset Quotes erd
13503 \end_inset
13504
13505 .
13506 \end_layout
13507
13508 \begin_layout Description
13509 \begin_inset Flex Code
13510 status collapsed
13511
13512 \begin_layout Plain Layout
13513 RefPrefix
13514 \end_layout
13515
13516 \end_inset
13517
13518  [
13519 \begin_inset Flex Code
13520 status collapsed
13521
13522 \begin_layout Plain Layout
13523 string
13524 \end_layout
13525
13526 \end_inset
13527
13528 ] The prefix to use when creating labels referring to floats of this type.
13529  This allows the use of formatted references.
13530  Note that you can remove any 
13531 \begin_inset Flex Code
13532 status collapsed
13533
13534 \begin_layout Plain Layout
13535 RefPrefix
13536 \end_layout
13537
13538 \end_inset
13539
13540  set by a copied style by using the special value 
13541 \begin_inset Quotes eld
13542 \end_inset
13543
13544 OFF
13545 \begin_inset Quotes erd
13546 \end_inset
13547
13548 , which must be all caps.
13549 \end_layout
13550
13551 \begin_layout Description
13552 \begin_inset Flex Code
13553 status collapsed
13554
13555 \begin_layout Plain Layout
13556 Style
13557 \end_layout
13558
13559 \end_inset
13560
13561  [
13562 \begin_inset Flex Code
13563 status collapsed
13564
13565 \begin_layout Plain Layout
13566 string
13567 \end_layout
13568
13569 \end_inset
13570
13571 =
13572 \begin_inset Quotes erd
13573 \end_inset
13574
13575
13576 \begin_inset Quotes erd
13577 \end_inset
13578
13579 ] The style used when defining the float using 
13580 \begin_inset Flex Code
13581 status collapsed
13582
13583 \begin_layout Plain Layout
13584
13585 \backslash
13586 newfloat
13587 \end_layout
13588
13589 \end_inset
13590
13591 .
13592 \end_layout
13593
13594 \begin_layout Description
13595 \begin_inset Flex Code
13596 status collapsed
13597
13598 \begin_layout Plain Layout
13599 Type
13600 \end_layout
13601
13602 \end_inset
13603
13604  [
13605 \begin_inset Flex Code
13606 status collapsed
13607
13608 \begin_layout Plain Layout
13609 string
13610 \end_layout
13611
13612 \end_inset
13613
13614 =
13615 \begin_inset Quotes erd
13616 \end_inset
13617
13618
13619 \begin_inset Quotes erd
13620 \end_inset
13621
13622 ] The 
13623 \begin_inset Quotes eld
13624 \end_inset
13625
13626 type
13627 \begin_inset Quotes erd
13628 \end_inset
13629
13630  of the new class of floats, like program or algorithm.
13631  After the appropriate 
13632 \begin_inset Flex Code
13633 status collapsed
13634
13635 \begin_layout Plain Layout
13636
13637 \backslash
13638 newfloat
13639 \end_layout
13640
13641 \end_inset
13642
13643 , commands such as 
13644 \begin_inset Flex Code
13645 status collapsed
13646
13647 \begin_layout Plain Layout
13648
13649 \backslash
13650 begin{program}
13651 \end_layout
13652
13653 \end_inset
13654
13655  or 
13656 \begin_inset Flex Code
13657 status collapsed
13658
13659 \begin_layout Plain Layout
13660
13661 \backslash
13662 end{algorithm*}
13663 \end_layout
13664
13665 \end_inset
13666
13667  will be available.
13668 \end_layout
13669
13670 \begin_layout Description
13671 \begin_inset Flex Code
13672 status collapsed
13673
13674 \begin_layout Plain Layout
13675 UsesFloatPkg
13676 \end_layout
13677
13678 \end_inset
13679
13680  [
13681 \begin_inset Flex Code
13682 status open
13683
13684 \begin_layout Plain Layout
13685 0
13686 \end_layout
13687
13688 \end_inset
13689
13690
13691 \begin_inset Flex Code
13692 status collapsed
13693
13694 \begin_layout Plain Layout
13695
13696 \emph on
13697 1
13698 \end_layout
13699
13700 \end_inset
13701
13702 ] Tells us whether this float is defined using the facilities provided by
13703  
13704 \begin_inset Flex Code
13705 status collapsed
13706
13707 \begin_layout Plain Layout
13708 float.sty
13709 \end_layout
13710
13711 \end_inset
13712
13713 , either by the class file or a package, or on-the-fly by LyX itself.
13714 \end_layout
13715
13716 \begin_layout Standard
13717 Note that defining a float with type 
13718 \begin_inset Flex Code
13719 status collapsed
13720
13721 \begin_layout Plain Layout
13722
13723 \emph on
13724 type
13725 \end_layout
13726
13727 \end_inset
13728
13729  automatically defines the corresponding counter with name 
13730 \begin_inset Flex Code
13731 status collapsed
13732
13733 \begin_layout Plain Layout
13734
13735 \emph on
13736 type
13737 \end_layout
13738
13739 \end_inset
13740
13741 .
13742 \end_layout
13743
13744 \begin_layout Subsection
13745 Flex insets and InsetLayout
13746 \begin_inset CommandInset label
13747 LatexCommand label
13748 name "sub:Flex-insets-and"
13749
13750 \end_inset
13751
13752
13753 \end_layout
13754
13755 \begin_layout Standard
13756 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13757  these are called Flex insets.
13758  
13759 \end_layout
13760
13761 \begin_layout Standard
13762 Flex insets come in three different kinds: 
13763 \end_layout
13764
13765 \begin_layout Itemize
13766 character style (
13767 \begin_inset Flex Code
13768 status collapsed
13769
13770 \begin_layout Plain Layout
13771 CharStyle
13772 \end_layout
13773
13774 \end_inset
13775
13776 ): These define semantic markup corresponding to such LaTeX commands as
13777  
13778 \begin_inset Flex Code
13779 status collapsed
13780
13781 \begin_layout Plain Layout
13782
13783 \backslash
13784 noun
13785 \end_layout
13786
13787 \end_inset
13788
13789  and 
13790 \begin_inset Flex Code
13791 status collapsed
13792
13793 \begin_layout Plain Layout
13794
13795 \backslash
13796 code
13797 \end_layout
13798
13799 \end_inset
13800
13801 .
13802 \end_layout
13803
13804 \begin_layout Itemize
13805 user custom (
13806 \begin_inset Flex Code
13807 status collapsed
13808
13809 \begin_layout Plain Layout
13810 Custom
13811 \end_layout
13812
13813 \end_inset
13814
13815 ): These can be used to define custom collapsible insets, similar to TeX
13816  code, footnote, and the like.
13817  An obvious example is an endnote inset, which is defined in the 
13818 \begin_inset Flex Code
13819 status collapsed
13820
13821 \begin_layout Plain Layout
13822 endnote
13823 \end_layout
13824
13825 \end_inset
13826
13827  module.
13828 \end_layout
13829
13830 \begin_layout Itemize
13831 XML elements (
13832 \begin_inset Flex Code
13833 status collapsed
13834
13835 \begin_layout Plain Layout
13836 Element
13837 \end_layout
13838
13839 \end_inset
13840
13841 ): For use with DocBook classes.
13842 \end_layout
13843
13844 \begin_layout Standard
13845 Flex insets are defined using the 
13846 \begin_inset Flex Code
13847 status collapsed
13848
13849 \begin_layout Plain Layout
13850 InsetLayout
13851 \end_layout
13852
13853 \end_inset
13854
13855  tag, which shall be explained in a moment.
13856 \end_layout
13857
13858 \begin_layout Standard
13859 The 
13860 \begin_inset Flex Code
13861 status collapsed
13862
13863 \begin_layout Plain Layout
13864 InsetLayout
13865 \end_layout
13866
13867 \end_inset
13868
13869  tag also serves another function: It can be used to customize the general
13870  layout of many different types of insets.
13871  Currently, 
13872 \begin_inset Flex Code
13873 status collapsed
13874
13875 \begin_layout Plain Layout
13876 InsetLayout
13877 \end_layout
13878
13879 \end_inset
13880
13881  can be used to customize the layout parameters for footnotes, marginal
13882  notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13883  boxes, tables, algorithms, URLs, and optional arguments, as well as to
13884  define Flex insets.
13885 \end_layout
13886
13887 \begin_layout Standard
13888 The 
13889 \begin_inset Flex Code
13890 status collapsed
13891
13892 \begin_layout Plain Layout
13893 InsetLayout
13894 \end_layout
13895
13896 \end_inset
13897
13898  definition must begin with a line of the form:
13899 \end_layout
13900
13901 \begin_layout LyX-Code
13902 InsetLayout <Type>
13903 \end_layout
13904
13905 \begin_layout Standard
13906 Here 
13907 \begin_inset Flex Code
13908 status collapsed
13909
13910 \begin_layout Plain Layout
13911 <Type>
13912 \end_layout
13913
13914 \end_inset
13915
13916  indicates the inset whose layout is being defined, and here there are two
13917  cases.
13918 \end_layout
13919
13920 \begin_layout Enumerate
13921 The layout for a pre-existing inset is being modified.
13922  In this case, can be 
13923 \begin_inset Flex Code
13924 status collapsed
13925
13926 \begin_layout Plain Layout
13927 <Type>
13928 \end_layout
13929
13930 \end_inset
13931
13932  any one of the following: 
13933 \begin_inset Flex Code
13934 status collapsed
13935
13936 \begin_layout Plain Layout
13937 Algorithm
13938 \end_layout
13939
13940 \end_inset
13941
13942
13943 \begin_inset Flex Code
13944 status collapsed
13945
13946 \begin_layout Plain Layout
13947 Branch
13948 \end_layout
13949
13950 \end_inset
13951
13952
13953 \begin_inset Flex Code
13954 status collapsed
13955
13956 \begin_layout Plain Layout
13957 Box
13958 \end_layout
13959
13960 \end_inset
13961
13962
13963 \begin_inset Flex Code
13964 status collapsed
13965
13966 \begin_layout Plain Layout
13967 Box:shaded
13968 \end_layout
13969
13970 \end_inset
13971
13972
13973 \begin_inset Flex Code
13974 status collapsed
13975
13976 \begin_layout Plain Layout
13977 ERT
13978 \end_layout
13979
13980 \end_inset
13981
13982
13983 \begin_inset Flex Code
13984 status collapsed
13985
13986 \begin_layout Plain Layout
13987 Figure
13988 \end_layout
13989
13990 \end_inset
13991
13992
13993 \begin_inset Flex Code
13994 status collapsed
13995
13996 \begin_layout Plain Layout
13997 Foot
13998 \end_layout
13999
14000 \end_inset
14001
14002
14003 \begin_inset Flex Code
14004 status collapsed
14005
14006 \begin_layout Plain Layout
14007 Index
14008 \end_layout
14009
14010 \end_inset
14011
14012
14013 \begin_inset Flex Code
14014 status collapsed
14015
14016 \begin_layout Plain Layout
14017 Info
14018 \end_layout
14019
14020 \end_inset
14021
14022
14023 \begin_inset Flex Code
14024 status collapsed
14025
14026 \begin_layout Plain Layout
14027 Info:menu
14028 \end_layout
14029
14030 \end_inset
14031
14032
14033 \begin_inset Flex Code
14034 status collapsed
14035
14036 \begin_layout Plain Layout
14037 Info:shortcut
14038 \end_layout
14039
14040 \end_inset
14041
14042
14043 \begin_inset Flex Code
14044 status collapsed
14045
14046 \begin_layout Plain Layout
14047 Info:shortcuts
14048 \end_layout
14049
14050 \end_inset
14051
14052
14053 \begin_inset Flex Code
14054 status collapsed
14055
14056 \begin_layout Plain Layout
14057 Listings
14058 \end_layout
14059
14060 \end_inset
14061
14062
14063 \begin_inset Flex Code
14064 status collapsed
14065
14066 \begin_layout Plain Layout
14067 Marginal
14068 \end_layout
14069
14070 \end_inset
14071
14072
14073 \begin_inset Flex Code
14074 status collapsed
14075
14076 \begin_layout Plain Layout
14077 Note:Comment
14078 \end_layout
14079
14080 \end_inset
14081
14082
14083 \begin_inset Flex Code
14084 status collapsed
14085
14086 \begin_layout Plain Layout
14087 Note:Note
14088 \end_layout
14089
14090 \end_inset
14091
14092
14093 \begin_inset Flex Code
14094 status collapsed
14095
14096 \begin_layout Plain Layout
14097 Note:Greyedout
14098 \end_layout
14099
14100 \end_inset
14101
14102
14103 \begin_inset Flex Code
14104 status collapsed
14105
14106 \begin_layout Plain Layout
14107 OptArg
14108 \end_layout
14109
14110 \end_inset
14111
14112
14113 \begin_inset Flex Code
14114 status collapsed
14115
14116 \begin_layout Plain Layout
14117 Table
14118 \end_layout
14119
14120 \end_inset
14121
14122 , or 
14123 \begin_inset Flex Code
14124 status collapsed
14125
14126 \begin_layout Plain Layout
14127 URL
14128 \end_layout
14129
14130 \end_inset
14131
14132 .
14133 \end_layout
14134
14135 \begin_layout Enumerate
14136 The layout for a Flex inset is being defined.
14137  In this case, 
14138 \begin_inset Flex Code
14139 status collapsed
14140
14141 \begin_layout Plain Layout
14142 <Type>
14143 \end_layout
14144
14145 \end_inset
14146
14147  must be of the form 
14148 \begin_inset Quotes eld
14149 \end_inset
14150
14151
14152 \begin_inset Flex Code
14153 status collapsed
14154
14155 \begin_layout Plain Layout
14156 Flex:<name>
14157 \end_layout
14158
14159 \end_inset
14160
14161
14162 \begin_inset Quotes erd
14163 \end_inset
14164
14165 , where 
14166 \begin_inset Flex Code
14167 status collapsed
14168
14169 \begin_layout Plain Layout
14170 name
14171 \end_layout
14172
14173 \end_inset
14174
14175  may be be any valid identifier not used by a pre-existing Flex inset.
14176  The identifier may include spaces, but in that case the whole thing must
14177  be wrapped in quotes.
14178  Note that the definition of a flex inset 
14179 \emph on
14180 must 
14181 \emph default
14182 also include a 
14183 \begin_inset Flex Code
14184 status collapsed
14185
14186 \begin_layout Plain Layout
14187 LyXType
14188 \end_layout
14189
14190 \end_inset
14191
14192  entry, declaring which type of inset it defines.
14193 \end_layout
14194
14195 \begin_layout Standard
14196 The 
14197 \begin_inset Flex Code
14198 status collapsed
14199
14200 \begin_layout Plain Layout
14201 InsetLayout
14202 \end_layout
14203
14204 \end_inset
14205
14206  definition can contain the following entries:
14207 \end_layout
14208
14209 \begin_layout Description
14210 \begin_inset Flex Code
14211 status collapsed
14212
14213 \begin_layout Plain Layout
14214 BgColor
14215 \end_layout
14216
14217 \end_inset
14218
14219  The color for the inset's background.
14220  The valid colors are defined in 
14221 \begin_inset Flex Code
14222 status collapsed
14223
14224 \begin_layout Plain Layout
14225 src/ColorCode.h
14226 \end_layout
14227
14228 \end_inset
14229
14230 .
14231 \end_layout
14232
14233 \begin_layout Description
14234 \begin_inset Flex Code
14235 status collapsed
14236
14237 \begin_layout Plain Layout
14238 ContentAsLabel
14239 \end_layout
14240
14241 \end_inset
14242
14243  [
14244 \begin_inset Flex Code
14245 status collapsed
14246
14247 \begin_layout Plain Layout
14248
14249 \emph on
14250 0
14251 \end_layout
14252
14253 \end_inset
14254
14255 ,
14256 \begin_inset Flex Code
14257 status collapsed
14258
14259 \begin_layout Plain Layout
14260 1
14261 \end_layout
14262
14263 \end_inset
14264
14265 ] Whether to use the content of the inset as the label, when the inset is
14266  closed.
14267  Default is false.
14268 \end_layout
14269
14270 \begin_layout Description
14271 \begin_inset Flex Code
14272 status collapsed
14273
14274 \begin_layout Plain Layout
14275 CopyStyle
14276 \end_layout
14277
14278 \end_inset
14279
14280  As with paragraph styles (see page 
14281 \begin_inset CommandInset ref
14282 LatexCommand ref
14283 reference "des:CopyStyle"
14284
14285 \end_inset
14286
14287 ).
14288 \end_layout
14289
14290 \begin_layout Description
14291 \begin_inset Flex Code
14292 status collapsed
14293
14294 \begin_layout Plain Layout
14295 CustomPars
14296 \end_layout
14297
14298 \end_inset
14299
14300  [
14301 \begin_inset Flex Code
14302 status collapsed
14303
14304 \begin_layout Plain Layout
14305
14306 \emph on
14307 0
14308 \end_layout
14309
14310 \end_inset
14311
14312 ,
14313 \begin_inset Flex Code
14314 status collapsed
14315
14316 \begin_layout Plain Layout
14317 1
14318 \end_layout
14319
14320 \end_inset
14321
14322 ] Indicates whether the user may employ the Paragraph Settings dialog to
14323  customize the paragraph.
14324 \end_layout
14325
14326 \begin_layout Description
14327 \begin_inset Flex Code
14328 status collapsed
14329
14330 \begin_layout Plain Layout
14331 Decoration
14332 \end_layout
14333
14334 \end_inset
14335
14336  can be 
14337 \begin_inset Flex Code
14338 status collapsed
14339
14340 \begin_layout Plain Layout
14341 Classic
14342 \end_layout
14343
14344 \end_inset
14345
14346
14347 \begin_inset Flex Code
14348 status collapsed
14349
14350 \begin_layout Plain Layout
14351 Minimalistic
14352 \end_layout
14353
14354 \end_inset
14355
14356 , or 
14357 \begin_inset Flex Code
14358 status collapsed
14359
14360 \begin_layout Plain Layout
14361 Conglomerate
14362 \end_layout
14363
14364 \end_inset
14365
14366 , describing the rendering style used for the inset's frame and buttons.
14367  Footnotes generally use 
14368 \begin_inset Flex Code
14369 status collapsed
14370
14371 \begin_layout Plain Layout
14372 Classic
14373 \end_layout
14374
14375 \end_inset
14376
14377 , ERT insets generally 
14378 \begin_inset Flex Code
14379 status collapsed
14380
14381 \begin_layout Plain Layout
14382 Minimalistic
14383 \end_layout
14384
14385 \end_inset
14386
14387 , and character styles 
14388 \begin_inset Flex Code
14389 status collapsed
14390
14391 \begin_layout Plain Layout
14392 Conglomerate
14393 \end_layout
14394
14395 \end_inset
14396
14397 .
14398 \end_layout
14399
14400 \begin_layout Description
14401 \begin_inset Flex Code
14402 status collapsed
14403
14404 \begin_layout Plain Layout
14405 Display
14406 \end_layout
14407
14408 \end_inset
14409
14410  [
14411 \begin_inset Flex Code
14412 status collapsed
14413
14414 \begin_layout Plain Layout
14415 0
14416 \end_layout
14417
14418 \end_inset
14419
14420 ,
14421 \begin_inset Flex Code
14422 status collapsed
14423
14424 \begin_layout Plain Layout
14425
14426 \emph on
14427 1
14428 \end_layout
14429
14430 \end_inset
14431
14432 ] Only useful if 
14433 \begin_inset Flex Code
14434 status collapsed
14435
14436 \begin_layout Plain Layout
14437 LatexType
14438 \end_layout
14439
14440 \end_inset
14441
14442  is 
14443 \begin_inset Flex Code
14444 status collapsed
14445
14446 \begin_layout Plain Layout
14447 Environment
14448 \end_layout
14449
14450 \end_inset
14451
14452 .
14453  Indicates whether the environment will stand on its own in LaTeX output
14454  or will appear inline with the surrounding text.
14455  If set to false, it is supposed that the LaTeX environment ignores white
14456  space (including one newline character) after the 
14457 \begin_inset Flex Code
14458 status collapsed
14459
14460 \begin_layout Plain Layout
14461
14462 \backslash
14463 begin{
14464 \emph on
14465 LatexName
14466 \emph default
14467 }
14468 \end_layout
14469
14470 \end_inset
14471
14472  and 
14473 \begin_inset Flex Code
14474 status collapsed
14475
14476 \begin_layout Plain Layout
14477
14478 \backslash
14479 end{
14480 \emph on
14481 LatexName
14482 \emph default
14483 }
14484 \end_layout
14485
14486 \end_inset
14487
14488  tags.
14489  Default is true.
14490 \end_layout
14491
14492 \begin_layout Description
14493 \begin_inset Flex Code
14494 status collapsed
14495
14496 \begin_layout Plain Layout
14497 End
14498 \end_layout
14499
14500 \end_inset
14501
14502  Required at the end of the InsetLayout declarations.
14503 \end_layout
14504
14505 \begin_layout Description
14506 \begin_inset Flex Code
14507 status collapsed
14508
14509 \begin_layout Plain Layout
14510 Font
14511 \end_layout
14512
14513 \end_inset
14514
14515  The font used for both the text body 
14516 \emph on
14517 and
14518 \emph default
14519  the label.
14520  See section
14521 \begin_inset space ~
14522 \end_inset
14523
14524
14525 \begin_inset CommandInset ref
14526 LatexCommand ref
14527 reference "sub:Font-description"
14528
14529 \end_inset
14530
14531 .
14532  Note that defining this font automatically defines the 
14533 \begin_inset Flex Code
14534 status collapsed
14535
14536 \begin_layout Plain Layout
14537 LabelFont
14538 \end_layout
14539
14540 \end_inset
14541
14542  to the same value, so define this first and define 
14543 \begin_inset Flex Code
14544 status collapsed
14545
14546 \begin_layout Plain Layout
14547 LabelFont
14548 \end_layout
14549
14550 \end_inset
14551
14552  later if you want them to be different.
14553 \end_layout
14554
14555 \begin_layout Description
14556 \begin_inset Flex Code
14557 status collapsed
14558
14559 \begin_layout Plain Layout
14560 ForceLTR
14561 \end_layout
14562
14563 \end_inset
14564
14565  Force the 
14566 \begin_inset Quotes eld
14567 \end_inset
14568
14569 latex
14570 \begin_inset Quotes erd
14571 \end_inset
14572
14573  language, leading to Left-to-Right (latin) output, e.
14574 \begin_inset space \thinspace{}
14575 \end_inset
14576
14577 g.
14578 \begin_inset space \space{}
14579 \end_inset
14580
14581 in TeX code or URL.
14582  A kludge.
14583 \end_layout
14584
14585 \begin_layout Description
14586 \begin_inset Flex Code
14587 status collapsed
14588
14589 \begin_layout Plain Layout
14590 ForcePlain
14591 \end_layout
14592
14593 \end_inset
14594
14595  [
14596 \begin_inset Flex Code
14597 status collapsed
14598
14599 \begin_layout Plain Layout
14600
14601 \emph on
14602 0
14603 \end_layout
14604
14605 \end_inset
14606
14607 ,
14608 \begin_inset Flex Code
14609 status collapsed
14610
14611 \begin_layout Plain Layout
14612 1
14613 \end_layout
14614
14615 \end_inset
14616
14617 ] Indicates whether the 
14618 \begin_inset Flex Code
14619 status collapsed
14620
14621 \begin_layout Plain Layout
14622 PlainLayout
14623 \end_layout
14624
14625 \end_inset
14626
14627  should be used or, instead, the user can change the paragraph style used
14628  in the inset.
14629  Default is false.
14630 \end_layout
14631
14632 \begin_layout Description
14633 \begin_inset Flex Code
14634 status collapsed
14635
14636 \begin_layout Plain Layout
14637 FreeSpacing
14638 \end_layout
14639
14640 \end_inset
14641
14642  As with paragraph styles (see page 
14643 \begin_inset CommandInset ref
14644 LatexCommand pageref
14645 reference "des:FreeSpacing"
14646
14647 \end_inset
14648
14649 ).
14650  Default is false.
14651 \end_layout
14652
14653 \begin_layout Description
14654 \begin_inset Flex Code
14655 status collapsed
14656
14657 \begin_layout Plain Layout
14658 HTML*
14659 \end_layout
14660
14661 \end_inset
14662
14663  These tags control XHTML output.
14664  See section 
14665 \begin_inset CommandInset ref
14666 LatexCommand ref
14667 reference "sec:Tags-for-XHTML"
14668
14669 \end_inset
14670
14671 .
14672 \end_layout
14673
14674 \begin_layout Description
14675 \begin_inset Flex Code
14676 status collapsed
14677
14678 \begin_layout Plain Layout
14679 InToc
14680 \end_layout
14681
14682 \end_inset
14683
14684  [
14685 \begin_inset Flex Code
14686 status collapsed
14687
14688 \begin_layout Plain Layout
14689
14690 \emph on
14691 0
14692 \end_layout
14693
14694 \end_inset
14695
14696 ,
14697 \begin_inset Flex Code
14698 status collapsed
14699
14700 \begin_layout Plain Layout
14701 1
14702 \end_layout
14703
14704 \end_inset
14705
14706 ] Whether to include the contents of this inset in the strings generated
14707  for the `Outline' pane.
14708  One would not, for example, want the content of a footnote in a section
14709  header to be included in the TOC displayed in the outline, but one would
14710  normally want the content of a character style displayed.
14711  Default is false: not to include.
14712 \end_layout
14713
14714 \begin_layout Description
14715 \begin_inset Flex Code
14716 status collapsed
14717
14718 \begin_layout Plain Layout
14719 KeepEmpty
14720 \end_layout
14721
14722 \end_inset
14723
14724  As with paragraph styles (see page 
14725 \begin_inset CommandInset ref
14726 LatexCommand pageref
14727 reference "des:KeepEmpty"
14728
14729 \end_inset
14730
14731 ).
14732  Default is false.
14733 \end_layout
14734
14735 \begin_layout Description
14736 \begin_inset Flex Code
14737 status collapsed
14738
14739 \begin_layout Plain Layout
14740 LabelFont
14741 \end_layout
14742
14743 \end_inset
14744
14745  The font used for the label.
14746  See section
14747 \begin_inset space ~
14748 \end_inset
14749
14750
14751 \begin_inset CommandInset ref
14752 LatexCommand ref
14753 reference "sub:Font-description"
14754
14755 \end_inset
14756
14757 .
14758  Note that this definition can never appear before 
14759 \begin_inset Flex Code
14760 status collapsed
14761
14762 \begin_layout Plain Layout
14763 Font
14764 \end_layout
14765
14766 \end_inset
14767
14768 , lest it be ineffective.
14769 \end_layout
14770
14771 \begin_layout Description
14772 \begin_inset Flex Code
14773 status collapsed
14774
14775 \begin_layout Plain Layout
14776 LabelString
14777 \end_layout
14778
14779 \end_inset
14780
14781  What will be displayed on the button or elsewhere as the inset label.
14782  Some inset types (
14783 \begin_inset Flex Code
14784 status collapsed
14785
14786 \begin_layout Plain Layout
14787 TeX code
14788 \end_layout
14789
14790 \end_inset
14791
14792  and 
14793 \begin_inset Flex Code
14794 status collapsed
14795
14796 \begin_layout Plain Layout
14797 Branch
14798 \end_layout
14799
14800 \end_inset
14801
14802 ) modify this label on the fly.
14803 \end_layout
14804
14805 \begin_layout Description
14806 \begin_inset Flex Code
14807 status collapsed
14808
14809 \begin_layout Plain Layout
14810 LatexName
14811 \end_layout
14812
14813 \end_inset
14814
14815  The name of the corresponding LaTeX stuff.
14816  Either the environment or command name.
14817 \end_layout
14818
14819 \begin_layout Description
14820 \begin_inset Flex Code
14821 status collapsed
14822
14823 \begin_layout Plain Layout
14824 LatexParam
14825 \end_layout
14826
14827 \end_inset
14828
14829  The optional parameter for the corresponding 
14830 \begin_inset Flex Code
14831 status collapsed
14832
14833 \begin_layout Plain Layout
14834 LatexName
14835 \end_layout
14836
14837 \end_inset
14838
14839  stuff, including possible bracket pairs like 
14840 \begin_inset Flex Code
14841 status collapsed
14842
14843 \begin_layout Plain Layout
14844 []
14845 \end_layout
14846
14847 \end_inset
14848
14849 .
14850  This parameter cannot be changed from within LyX.
14851 \end_layout
14852
14853 \begin_layout Description
14854 \begin_inset Flex Code
14855 status collapsed
14856
14857 \begin_layout Plain Layout
14858 LatexType
14859 \end_layout
14860
14861 \end_inset
14862
14863  As with paragraph styles (see page 
14864 \begin_inset CommandInset ref
14865 LatexCommand pageref
14866 reference "des:LatexType"
14867
14868 \end_inset
14869
14870 ).
14871 \end_layout
14872
14873 \begin_layout Description
14874 \begin_inset Flex Code
14875 status collapsed
14876
14877 \begin_layout Plain Layout
14878 LyxType
14879 \end_layout
14880
14881 \end_inset
14882
14883  Can be 
14884 \begin_inset Flex Code
14885 status collapsed
14886
14887 \begin_layout Plain Layout
14888 charstyle
14889 \end_layout
14890
14891 \end_inset
14892
14893
14894 \begin_inset Flex Code
14895 status collapsed
14896
14897 \begin_layout Plain Layout
14898 custom
14899 \end_layout
14900
14901 \end_inset
14902
14903
14904 \begin_inset Flex Code
14905 status collapsed
14906
14907 \begin_layout Plain Layout
14908 element
14909 \end_layout
14910
14911 \end_inset
14912
14913 , or 
14914 \begin_inset Flex Code
14915 status collapsed
14916
14917 \begin_layout Plain Layout
14918 end
14919 \end_layout
14920
14921 \end_inset
14922
14923  (indicating a dummy definition ending definitions of charstyles, etc).
14924  This entry is required in and is only meaningful for Flex insets.
14925  Among other things, it determines on which menu this inset will appear.
14926  Setting 
14927 \begin_inset Flex Code
14928 status collapsed
14929
14930 \begin_layout Plain Layout
14931 LyXType
14932 \end_layout
14933
14934 \end_inset
14935
14936  to 
14937 \begin_inset Flex Code
14938 status collapsed
14939
14940 \begin_layout Plain Layout
14941 charstyle
14942 \end_layout
14943
14944 \end_inset
14945
14946  will set 
14947 \begin_inset Flex Code
14948 status collapsed
14949
14950 \begin_layout Plain Layout
14951 MultiPar
14952 \end_layout
14953
14954 \end_inset
14955
14956  to false.
14957  
14958 \begin_inset Flex Code
14959 status collapsed
14960
14961 \begin_layout Plain Layout
14962 MultiPar
14963 \end_layout
14964
14965 \end_inset
14966
14967  can be set to true for charstyle insets, if you wish, by setting it 
14968 \emph on
14969 after
14970 \emph default
14971  you set the 
14972 \begin_inset Flex Code
14973 status collapsed
14974
14975 \begin_layout Plain Layout
14976 LyXType
14977 \end_layout
14978
14979 \end_inset
14980
14981 .
14982 \end_layout
14983
14984 \begin_layout Description
14985 \begin_inset Flex Code
14986 status collapsed
14987
14988 \begin_layout Plain Layout
14989 MultiPar
14990 \end_layout
14991
14992 \end_inset
14993
14994  [
14995 \begin_inset Flex Code
14996 status collapsed
14997
14998 \begin_layout Plain Layout
14999
15000 \emph on
15001 0
15002 \end_layout
15003
15004 \end_inset
15005
15006 ,
15007 \begin_inset Flex Code
15008 status collapsed
15009
15010 \begin_layout Plain Layout
15011 1
15012 \end_layout
15013
15014 \end_inset
15015
15016 ] Whether multiple paragraphs are permitted in this inset.
15017  This will also set 
15018 \begin_inset Flex Code
15019 status collapsed
15020
15021 \begin_layout Plain Layout
15022 CustomPars
15023 \end_layout
15024
15025 \end_inset
15026
15027  to the same value and 
15028 \begin_inset Flex Code
15029 status collapsed
15030
15031 \begin_layout Plain Layout
15032 ForcePlain
15033 \end_layout
15034
15035 \end_inset
15036
15037  to the opposite value.
15038  These can be reset to other values, if they are used 
15039 \emph on
15040 after
15041 \emph default
15042  
15043 \begin_inset Flex Code
15044 status collapsed
15045
15046 \begin_layout Plain Layout
15047 MultiPar
15048 \end_layout
15049
15050 \end_inset
15051
15052 .
15053  Default is true.
15054 \end_layout
15055
15056 \begin_layout Description
15057 \begin_inset Flex Code
15058 status collapsed
15059
15060 \begin_layout Plain Layout
15061 NeedProtect
15062 \end_layout
15063
15064 \end_inset
15065
15066  [
15067 \begin_inset Flex Code
15068 status collapsed
15069
15070 \begin_layout Plain Layout
15071
15072 \emph on
15073 0
15074 \end_layout
15075
15076 \end_inset
15077
15078 ,
15079 \begin_inset Flex Code
15080 status collapsed
15081
15082 \begin_layout Plain Layout
15083 1
15084 \end_layout
15085
15086 \end_inset
15087
15088 ] Whether fragile commands in this inset should be 
15089 \begin_inset Flex Code
15090 status collapsed
15091
15092 \begin_layout Plain Layout
15093
15094 \backslash
15095 protect
15096 \end_layout
15097
15098 \end_inset
15099
15100 'ed.
15101  (Note: This is 
15102 \emph on
15103 not
15104 \emph default
15105  whether the command should itself be protected.) Default is false.
15106 \end_layout
15107
15108 \begin_layout Description
15109 \begin_inset Flex Code
15110 status collapsed
15111
15112 \begin_layout Plain Layout
15113 ParbreakIsNewline
15114 \end_layout
15115
15116 \end_inset
15117
15118  [
15119 \begin_inset Flex Code
15120 status collapsed
15121
15122 \begin_layout Plain Layout
15123
15124 \emph on
15125 0
15126 \end_layout
15127
15128 \end_inset
15129
15130
15131 \begin_inset Flex Code
15132 status collapsed
15133
15134 \begin_layout Plain Layout
15135 1
15136 \end_layout
15137
15138 \end_inset
15139
15140 ] As with paragraph styles (see page 
15141 \begin_inset CommandInset ref
15142 LatexCommand pageref
15143 reference "des:ParbreakIsNewline"
15144
15145 \end_inset
15146
15147 ).
15148  Default is false.
15149 \end_layout
15150
15151 \begin_layout Description
15152 \begin_inset Flex Code
15153 status collapsed
15154
15155 \begin_layout Plain Layout
15156 PassThru
15157 \end_layout
15158
15159 \end_inset
15160
15161  [
15162 \begin_inset Flex Code
15163 status collapsed
15164
15165 \begin_layout Plain Layout
15166
15167 \emph on
15168 0
15169 \end_layout
15170
15171 \end_inset
15172
15173 ,
15174 \begin_inset Flex Code
15175 status collapsed
15176
15177 \begin_layout Plain Layout
15178 1
15179 \end_layout
15180
15181 \end_inset
15182
15183 ] As with paragraph styles (see page 
15184 \begin_inset CommandInset ref
15185 LatexCommand pageref
15186 reference "des:PassThru"
15187
15188 \end_inset
15189
15190 ).
15191  Default is false.
15192 \end_layout
15193
15194 \begin_layout Description
15195 \begin_inset Flex Code
15196 status collapsed
15197
15198 \begin_layout Plain Layout
15199 Preamble
15200 \end_layout
15201
15202 \end_inset
15203
15204  As with paragraph styles (see page 
15205 \begin_inset CommandInset ref
15206 LatexCommand pageref
15207 reference "des:Preamble"
15208
15209 \end_inset
15210
15211 ).
15212 \end_layout
15213
15214 \begin_layout Description
15215 \begin_inset Flex Code
15216 status collapsed
15217
15218 \begin_layout Plain Layout
15219 RefPrefix
15220 \end_layout
15221
15222 \end_inset
15223
15224  [
15225 \begin_inset Flex Code
15226 status collapsed
15227
15228 \begin_layout Plain Layout
15229 string
15230 \end_layout
15231
15232 \end_inset
15233
15234 ] The prefix to use when creating labels referring to insets of this type.
15235  This allows the use of formatted references.
15236 \end_layout
15237
15238 \begin_layout Description
15239 \begin_inset Flex Code
15240 status collapsed
15241
15242 \begin_layout Plain Layout
15243 Requires
15244 \end_layout
15245
15246 \end_inset
15247
15248  [
15249 \begin_inset Flex Code
15250 status collapsed
15251
15252 \begin_layout Plain Layout
15253 string
15254 \end_layout
15255
15256 \end_inset
15257
15258 ] As with paragraph styles (see page 
15259 \begin_inset CommandInset ref
15260 LatexCommand pageref
15261 reference "des:Requires"
15262
15263 \end_inset
15264
15265 ).
15266 \end_layout
15267
15268 \begin_layout Description
15269 \begin_inset Flex Code
15270 status collapsed
15271
15272 \begin_layout Plain Layout
15273 ResetsFont
15274 \end_layout
15275
15276 \end_inset
15277
15278  [
15279 \begin_inset Flex Code
15280 status collapsed
15281
15282 \begin_layout Plain Layout
15283 0
15284 \end_layout
15285
15286 \end_inset
15287
15288 ,
15289 \begin_inset Flex Code
15290 status collapsed
15291
15292 \begin_layout Plain Layout
15293
15294 \emph on
15295 1
15296 \end_layout
15297
15298 \end_inset
15299
15300 ] Whether this inset should use the font of its surrounding environment
15301  or uses its own.
15302  Default is true: uses its own.
15303 \end_layout
15304
15305 \begin_layout Description
15306 \begin_inset Flex Code
15307 status collapsed
15308
15309 \begin_layout Plain Layout
15310 Spellcheck
15311 \end_layout
15312
15313 \end_inset
15314
15315  [
15316 \begin_inset Flex Code
15317 status collapsed
15318
15319 \begin_layout Plain Layout
15320 0
15321 \end_layout
15322
15323 \end_inset
15324
15325 ,
15326 \begin_inset Flex Code
15327 status collapsed
15328
15329 \begin_layout Plain Layout
15330
15331 \emph on
15332 1
15333 \end_layout
15334
15335 \end_inset
15336
15337 ] Spellcheck the contents of this inset.
15338  Default is true.
15339 \end_layout
15340
15341 \begin_layout Subsection
15342 Counters
15343 \begin_inset CommandInset label
15344 LatexCommand label
15345 name "sub:Counters"
15346
15347 \end_inset
15348
15349
15350 \end_layout
15351
15352 \begin_layout Standard
15353 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15354  counters (
15355 \begin_inset Flex MenuItem
15356 status collapsed
15357
15358 \begin_layout Plain Layout
15359 chapter
15360 \end_layout
15361
15362 \end_inset
15363
15364
15365 \begin_inset Flex MenuItem
15366 status collapsed
15367
15368 \begin_layout Plain Layout
15369 figure
15370 \end_layout
15371
15372 \end_inset
15373
15374 , \SpecialChar \ldots{}
15375 ) in the text class itself.
15376  The standard counters are defined in the file 
15377 \begin_inset Flex Code
15378 status collapsed
15379
15380 \begin_layout Plain Layout
15381 stdcounters.inc
15382 \end_layout
15383
15384 \end_inset
15385
15386 , so you may have to do no more than add
15387 \end_layout
15388
15389 \begin_layout LyX-Code
15390 Input stdcounters.inc
15391 \end_layout
15392
15393 \begin_layout Standard
15394 to your layout file to get them to work.
15395  But if you want to define custom counters, then you can do so.
15396  The counter declaration must begin with:
15397 \end_layout
15398
15399 \begin_layout LyX-Code
15400 Counter CounterName
15401 \end_layout
15402
15403 \begin_layout Standard
15404 where of course `
15405 \begin_inset Flex Code
15406 status collapsed
15407
15408 \begin_layout Plain Layout
15409 CounterName
15410 \end_layout
15411
15412 \end_inset
15413
15414 ' is replaced by the name of the counter.
15415  And it must end with 
15416 \begin_inset Quotes eld
15417 \end_inset
15418
15419
15420 \begin_inset Flex Code
15421 status collapsed
15422
15423 \begin_layout Plain Layout
15424 End
15425 \end_layout
15426
15427 \end_inset
15428
15429
15430 \begin_inset Quotes erd
15431 \end_inset
15432
15433 .
15434  The following parameters can also be used:
15435 \end_layout
15436
15437 \begin_layout Description
15438 \begin_inset Flex Code
15439 status collapsed
15440
15441 \begin_layout Plain Layout
15442 LabelString
15443 \end_layout
15444
15445 \end_inset
15446
15447  [
15448 \begin_inset Flex Code
15449 status collapsed
15450
15451 \begin_layout Plain Layout
15452 string
15453 \end_layout
15454
15455 \end_inset
15456
15457 =
15458 \begin_inset Quotes erd
15459 \end_inset
15460
15461
15462 \begin_inset Quotes erd
15463 \end_inset
15464
15465 ] When defined, this string defines how the counter is displayed.
15466  Setting this value sets 
15467 \begin_inset Flex Code
15468 status collapsed
15469
15470 \begin_layout Plain Layout
15471 LabelStringAppendix
15472 \end_layout
15473
15474 \end_inset
15475
15476  to the same value.
15477  The following special constructs can be used in the string:
15478 \end_layout
15479
15480 \begin_deeper
15481 \begin_layout Itemize
15482 \begin_inset Flex Code
15483 status collapsed
15484
15485 \begin_layout Plain Layout
15486
15487 \backslash
15488 thecounter
15489 \end_layout
15490
15491 \end_inset
15492
15493  will be replaced by the expansion of the 
15494 \begin_inset Flex Code
15495 status collapsed
15496
15497 \begin_layout Plain Layout
15498 LabelString
15499 \end_layout
15500
15501 \end_inset
15502
15503  (or 
15504 \begin_inset Flex Code
15505 status collapsed
15506
15507 \begin_layout Plain Layout
15508 LabelStringAppendix
15509 \end_layout
15510
15511 \end_inset
15512
15513 ) of the counter 
15514 \begin_inset Flex Code
15515 status collapsed
15516
15517 \begin_layout Plain Layout
15518 counter
15519 \end_layout
15520
15521 \end_inset
15522
15523 .
15524  
15525 \end_layout
15526
15527 \begin_layout Itemize
15528 counter values can be expressed using LaTeX-like macros 
15529 \begin_inset Flex Code
15530 status collapsed
15531
15532 \begin_layout Plain Layout
15533
15534 \backslash
15535
15536 \emph on
15537 numbertype
15538 \emph default
15539 {
15540 \emph on
15541 counter
15542 \emph default
15543 }
15544 \end_layout
15545
15546 \end_inset
15547
15548 , where 
15549 \begin_inset Flex Code
15550 status collapsed
15551
15552 \begin_layout Plain Layout
15553
15554 \emph on
15555 numbertype
15556 \end_layout
15557
15558 \end_inset
15559
15560  can be:
15561 \begin_inset Foot
15562 status collapsed
15563
15564 \begin_layout Plain Layout
15565
15566 \family roman
15567 \series medium
15568 \shape up
15569 \size normal
15570 \emph off
15571 \bar no
15572 \noun off
15573 \color none
15574 Actually, the situation is a bit more complicated: any
15575 \family default
15576 \series default
15577 \shape default
15578 \emph default
15579 \bar default
15580  
15581 \size default
15582 \emph on
15583 \noun default
15584 \color inherit
15585 numbertype
15586 \family roman
15587 \series medium
15588 \shape up
15589 \size normal
15590 \emph off
15591 \bar no
15592 \noun off
15593  other than those described below will produce arabic numerals.
15594  It would not be surprising to see this change in the future.
15595 \end_layout
15596
15597 \end_inset
15598
15599  
15600 \begin_inset Flex Code
15601 status collapsed
15602
15603 \begin_layout Plain Layout
15604 arabic
15605 \end_layout
15606
15607 \end_inset
15608
15609 : 1, 2, 3,\SpecialChar \ldots{}
15610
15611 \begin_inset Flex Code
15612 status collapsed
15613
15614 \begin_layout Plain Layout
15615 alph
15616 \end_layout
15617
15618 \end_inset
15619
15620  for lower-case letters: a, b, c, \SpecialChar \ldots{}
15621
15622 \begin_inset Flex Code
15623 status collapsed
15624
15625 \begin_layout Plain Layout
15626 Alph
15627 \end_layout
15628
15629 \end_inset
15630
15631  for upper-case letters: A, B, C, \SpecialChar \ldots{}
15632
15633 \begin_inset Flex Code
15634 status collapsed
15635
15636 \begin_layout Plain Layout
15637 roman
15638 \end_layout
15639
15640 \end_inset
15641
15642  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15643
15644 \begin_inset Flex Code
15645 status collapsed
15646
15647 \begin_layout Plain Layout
15648 Roman
15649 \end_layout
15650
15651 \end_inset
15652
15653  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15654
15655 \begin_inset Flex Code
15656 status collapsed
15657
15658 \begin_layout Plain Layout
15659 hebrew
15660 \end_layout
15661
15662 \end_inset
15663
15664  for hebrew numerals.
15665 \end_layout
15666
15667 \end_deeper
15668 \begin_layout Standard
15669 If LabelString is not defined, a default value is constructed as follows:
15670  if the counter has a master counter 
15671 \begin_inset Flex Code
15672 status collapsed
15673
15674 \begin_layout Plain Layout
15675 master
15676 \end_layout
15677
15678 \end_inset
15679
15680  (defined via 
15681 \begin_inset Flex Code
15682 status collapsed
15683
15684 \begin_layout Plain Layout
15685 Within
15686 \end_layout
15687
15688 \end_inset
15689
15690 ), the string 
15691 \begin_inset Flex Code
15692 status collapsed
15693
15694 \begin_layout Plain Layout
15695
15696 \backslash
15697 themaster.
15698 \backslash
15699 arabic{counter}
15700 \end_layout
15701
15702 \end_inset
15703
15704  is used; otherwise the string 
15705 \begin_inset Flex Code
15706 status collapsed
15707
15708 \begin_layout Plain Layout
15709
15710 \backslash
15711 arabic{counter}
15712 \end_layout
15713
15714 \end_inset
15715
15716  is used.
15717 \end_layout
15718
15719 \begin_layout Description
15720 \begin_inset Flex Code
15721 status collapsed
15722
15723 \begin_layout Plain Layout
15724 LabelStringAppendix
15725 \end_layout
15726
15727 \end_inset
15728
15729  [
15730 \begin_inset Flex Code
15731 status collapsed
15732
15733 \begin_layout Plain Layout
15734 string
15735 \end_layout
15736
15737 \end_inset
15738
15739 =
15740 \begin_inset Quotes erd
15741 \end_inset
15742
15743
15744 \begin_inset Quotes erd
15745 \end_inset
15746
15747 ] Same as 
15748 \begin_inset Flex Code
15749 status collapsed
15750
15751 \begin_layout Plain Layout
15752 LabelString
15753 \end_layout
15754
15755 \end_inset
15756
15757 , but for use in the Appendix.
15758 \end_layout
15759
15760 \begin_layout Description
15761 \begin_inset Flex Code
15762 status collapsed
15763
15764 \begin_layout Plain Layout
15765 PrettyFormat
15766 \end_layout
15767
15768 \end_inset
15769
15770  [
15771 \begin_inset Flex Code
15772 status collapsed
15773
15774 \begin_layout Plain Layout
15775 string
15776 \end_layout
15777
15778 \end_inset
15779
15780 =
15781 \begin_inset Quotes erd
15782 \end_inset
15783
15784
15785 \begin_inset Quotes erd
15786 \end_inset
15787
15788 ] A format for use with formatted references to this counter.
15789  For example, one might want to have references to section numbers appear
15790  as 
15791 \begin_inset Quotes eld
15792 \end_inset
15793
15794 Section 2.4
15795 \begin_inset Quotes erd
15796 \end_inset
15797
15798 .
15799  The string should contain 
15800 \begin_inset Quotes eld
15801 \end_inset
15802
15803 ##
15804 \begin_inset Quotes erd
15805 \end_inset
15806
15807 .
15808  This will be replaced by the counter number itself.
15809  So, for sections, it would be: Section ##.
15810 \end_layout
15811
15812 \begin_layout Description
15813 \begin_inset Flex Code
15814 status collapsed
15815
15816 \begin_layout Plain Layout
15817 Within
15818 \end_layout
15819
15820 \end_inset
15821
15822  [
15823 \begin_inset Flex Code
15824 status collapsed
15825
15826 \begin_layout Plain Layout
15827 string
15828 \end_layout
15829
15830 \end_inset
15831
15832 =
15833 \begin_inset Quotes erd
15834 \end_inset
15835
15836
15837 \begin_inset Quotes erd
15838 \end_inset
15839
15840 ] If this is set to the name of another counter, the present counter will
15841  be reset every time the other one is increased.
15842  For example, 
15843 \begin_inset Flex Code
15844 status collapsed
15845
15846 \begin_layout Plain Layout
15847 subsection
15848 \end_layout
15849
15850 \end_inset
15851
15852  is numbered inside 
15853 \begin_inset Flex Code
15854 status collapsed
15855
15856 \begin_layout Plain Layout
15857 section
15858 \end_layout
15859
15860 \end_inset
15861
15862 .
15863 \end_layout
15864
15865 \begin_layout Subsection
15866 Font description
15867 \begin_inset CommandInset label
15868 LatexCommand label
15869 name "sub:Font-description"
15870
15871 \end_inset
15872
15873
15874 \end_layout
15875
15876 \begin_layout Standard
15877 A font description looks like this:
15878 \end_layout
15879
15880 \begin_layout LyX-Code
15881 Font 
15882 \family roman
15883 \emph on
15884 or
15885 \family default
15886 \emph default
15887  LabelFont
15888 \end_layout
15889
15890 \begin_layout LyX-Code
15891  ...
15892 \end_layout
15893
15894 \begin_layout LyX-Code
15895 EndFont
15896 \end_layout
15897
15898 \begin_layout Standard
15899 The following commands are available:
15900 \end_layout
15901
15902 \begin_layout Description
15903 \begin_inset Flex Code
15904 status collapsed
15905
15906 \begin_layout Plain Layout
15907 Color
15908 \end_layout
15909
15910 \end_inset
15911
15912  [
15913 \begin_inset Flex Code
15914 status collapsed
15915
15916 \begin_layout Plain Layout
15917
15918 \emph on
15919 none
15920 \end_layout
15921
15922 \end_inset
15923
15924
15925 \begin_inset Flex Code
15926 status collapsed
15927
15928 \begin_layout Plain Layout
15929 black
15930 \end_layout
15931
15932 \end_inset
15933
15934
15935 \begin_inset Flex Code
15936 status collapsed
15937
15938 \begin_layout Plain Layout
15939 white
15940 \end_layout
15941
15942 \end_inset
15943
15944
15945 \begin_inset Flex Code
15946 status collapsed
15947
15948 \begin_layout Plain Layout
15949 red
15950 \end_layout
15951
15952 \end_inset
15953
15954
15955 \begin_inset Flex Code
15956 status collapsed
15957
15958 \begin_layout Plain Layout
15959 green
15960 \end_layout
15961
15962 \end_inset
15963
15964
15965 \begin_inset Flex Code
15966 status collapsed
15967
15968 \begin_layout Plain Layout
15969 blue
15970 \end_layout
15971
15972 \end_inset
15973
15974
15975 \begin_inset Flex Code
15976 status collapsed
15977
15978 \begin_layout Plain Layout
15979 cyan
15980 \end_layout
15981
15982 \end_inset
15983
15984
15985 \begin_inset Flex Code
15986 status collapsed
15987
15988 \begin_layout Plain Layout
15989 magenta
15990 \end_layout
15991
15992 \end_inset
15993
15994
15995 \begin_inset Flex Code
15996 status collapsed
15997
15998 \begin_layout Plain Layout
15999 yellow
16000 \end_layout
16001
16002 \end_inset
16003
16004 ]
16005 \end_layout
16006
16007 \begin_layout Description
16008 \begin_inset Flex Code
16009 status collapsed
16010
16011 \begin_layout Plain Layout
16012 Family
16013 \end_layout
16014
16015 \end_inset
16016
16017  [
16018 \begin_inset Flex Code
16019 status collapsed
16020
16021 \begin_layout Plain Layout
16022
16023 \emph on
16024 Roman
16025 \end_layout
16026
16027 \end_inset
16028
16029
16030 \begin_inset Flex Code
16031 status collapsed
16032
16033 \begin_layout Plain Layout
16034 Sans
16035 \end_layout
16036
16037 \end_inset
16038
16039
16040 \begin_inset Flex Code
16041 status collapsed
16042
16043 \begin_layout Plain Layout
16044 Typewriter
16045 \end_layout
16046
16047 \end_inset
16048
16049
16050 \end_layout
16051
16052 \begin_layout Description
16053 \begin_inset Flex Code
16054 status collapsed
16055
16056 \begin_layout Plain Layout
16057 Misc
16058 \end_layout
16059
16060 \end_inset
16061
16062  [
16063 \begin_inset Flex Code
16064 status collapsed
16065
16066 \begin_layout Plain Layout
16067 string
16068 \end_layout
16069
16070 \end_inset
16071
16072 ] Valid arguments are: 
16073 \begin_inset Flex Code
16074 status collapsed
16075
16076 \begin_layout Plain Layout
16077 emph
16078 \end_layout
16079
16080 \end_inset
16081
16082
16083 \begin_inset Flex Code
16084 status collapsed
16085
16086 \begin_layout Plain Layout
16087 noun
16088 \end_layout
16089
16090 \end_inset
16091
16092
16093 \begin_inset Flex Code
16094 status collapsed
16095
16096 \begin_layout Plain Layout
16097 underbar
16098 \end_layout
16099
16100 \end_inset
16101
16102
16103 \begin_inset Flex Code
16104 status collapsed
16105
16106 \begin_layout Plain Layout
16107 no_emph
16108 \end_layout
16109
16110 \end_inset
16111
16112
16113 \begin_inset Flex Code
16114 status collapsed
16115
16116 \begin_layout Plain Layout
16117 no_noun
16118 \end_layout
16119
16120 \end_inset
16121
16122  and 
16123 \begin_inset Flex Code
16124 status collapsed
16125
16126 \begin_layout Plain Layout
16127 no_bar
16128 \end_layout
16129
16130 \end_inset
16131
16132 .
16133  Each of these turns on or off the corresponding attribute.
16134  For example, 
16135 \begin_inset Flex Code
16136 status collapsed
16137
16138 \begin_layout Plain Layout
16139 emph
16140 \end_layout
16141
16142 \end_inset
16143
16144  turns on emphasis, and 
16145 \begin_inset Flex Code
16146 status collapsed
16147
16148 \begin_layout Plain Layout
16149 no_emph
16150 \end_layout
16151
16152 \end_inset
16153
16154  turns it off.
16155  
16156 \begin_inset Newline newline
16157 \end_inset
16158
16159 If the latter seems puzzling, remember that the font settings for the present
16160  context are generally inherited from the surrounding context.
16161  So 
16162 \begin_inset Flex Code
16163 status collapsed
16164
16165 \begin_layout Plain Layout
16166 no_emph
16167 \end_layout
16168
16169 \end_inset
16170
16171  would turn off the emphasis that was anyway in effect, say, in a theorem
16172  environment.
16173 \end_layout
16174
16175 \begin_layout Description
16176 \begin_inset Flex Code
16177 status collapsed
16178
16179 \begin_layout Plain Layout
16180 Series
16181 \end_layout
16182
16183 \end_inset
16184
16185  [
16186 \begin_inset Flex Code
16187 status collapsed
16188
16189 \begin_layout Plain Layout
16190
16191 \emph on
16192 Medium
16193 \end_layout
16194
16195 \end_inset
16196
16197
16198 \begin_inset Flex Code
16199 status collapsed
16200
16201 \begin_layout Plain Layout
16202 Bold
16203 \end_layout
16204
16205 \end_inset
16206
16207
16208 \end_layout
16209
16210 \begin_layout Description
16211 \begin_inset Flex Code
16212 status collapsed
16213
16214 \begin_layout Plain Layout
16215 Shape
16216 \end_layout
16217
16218 \end_inset
16219
16220  [
16221 \begin_inset Flex Code
16222 status collapsed
16223
16224 \begin_layout Plain Layout
16225
16226 \emph on
16227 Up
16228 \end_layout
16229
16230 \end_inset
16231
16232
16233 \begin_inset Flex Code
16234 status collapsed
16235
16236 \begin_layout Plain Layout
16237 Italic
16238 \end_layout
16239
16240 \end_inset
16241
16242
16243 \begin_inset Flex Code
16244 status collapsed
16245
16246 \begin_layout Plain Layout
16247 SmallCaps
16248 \end_layout
16249
16250 \end_inset
16251
16252
16253 \begin_inset Flex Code
16254 status collapsed
16255
16256 \begin_layout Plain Layout
16257 Slanted
16258 \end_layout
16259
16260 \end_inset
16261
16262
16263 \end_layout
16264
16265 \begin_layout Description
16266 \begin_inset Flex Code
16267 status collapsed
16268
16269 \begin_layout Plain Layout
16270 Size
16271 \end_layout
16272
16273 \end_inset
16274
16275  [
16276 \begin_inset Flex Code
16277 status collapsed
16278
16279 \begin_layout Plain Layout
16280 tiny
16281 \end_layout
16282
16283 \end_inset
16284
16285
16286 \begin_inset Flex Code
16287 status collapsed
16288
16289 \begin_layout Plain Layout
16290 small
16291 \end_layout
16292
16293 \end_inset
16294
16295
16296 \begin_inset Flex Code
16297 status collapsed
16298
16299 \begin_layout Plain Layout
16300
16301 \emph on
16302 normal
16303 \end_layout
16304
16305 \end_inset
16306
16307
16308 \begin_inset Flex Code
16309 status collapsed
16310
16311 \begin_layout Plain Layout
16312 large
16313 \end_layout
16314
16315 \end_inset
16316
16317
16318 \begin_inset Flex Code
16319 status collapsed
16320
16321 \begin_layout Plain Layout
16322 larger
16323 \end_layout
16324
16325 \end_inset
16326
16327
16328 \begin_inset Flex Code
16329 status collapsed
16330
16331 \begin_layout Plain Layout
16332 largest
16333 \end_layout
16334
16335 \end_inset
16336
16337
16338 \begin_inset Flex Code
16339 status collapsed
16340
16341 \begin_layout Plain Layout
16342 huge
16343 \end_layout
16344
16345 \end_inset
16346
16347
16348 \begin_inset Flex Code
16349 status collapsed
16350
16351 \begin_layout Plain Layout
16352 giant
16353 \end_layout
16354
16355 \end_inset
16356
16357 ]
16358 \end_layout
16359
16360 \begin_layout Subsection
16361 \begin_inset CommandInset label
16362 LatexCommand label
16363 name "sub:Citation-format-description"
16364
16365 \end_inset
16366
16367 Citation format description
16368 \end_layout
16369
16370 \begin_layout Standard
16371 The 
16372 \begin_inset Flex Code
16373 status collapsed
16374
16375 \begin_layout Plain Layout
16376 CiteFormat
16377 \end_layout
16378
16379 \end_inset
16380
16381  blocks are used to describe how bibliographic information should be displayed,
16382  both within LyX itself (in the citation dialog and in tooltips, for example)
16383  and in XHTML output.
16384  Such a block might look like this:
16385 \end_layout
16386
16387 \begin_layout LyX-Code
16388 CiteFormat
16389 \end_layout
16390
16391 \begin_layout LyX-Code
16392  article ...
16393 \end_layout
16394
16395 \begin_layout LyX-Code
16396  book ...
16397 \end_layout
16398
16399 \begin_layout LyX-Code
16400 End
16401 \end_layout
16402
16403 \begin_layout Standard
16404 The individual lines define how the bibliographic information associated
16405  with an article or book, respectively, is to be displayed, and such a definitio
16406 n can be given for any `entry type' that might be present in a BibTeX file.
16407  LyX defines a default format in the source code that will be used if no
16408  specific definition has been given.
16409  LyX predefines several formats in the file 
16410 \begin_inset Flex Code
16411 status collapsed
16412
16413 \begin_layout Plain Layout
16414 stdciteformats.inc
16415 \end_layout
16416
16417 \end_inset
16418
16419 , which is included in most of LyX's document classes.
16420 \end_layout
16421
16422 \begin_layout Standard
16423 The definitions use a simple language that allows BibTeX keys to be replaced
16424  with their values.
16425  Keys should be enclosed in 
16426 \begin_inset Flex Code
16427 status collapsed
16428
16429 \begin_layout Plain Layout
16430 %
16431 \end_layout
16432
16433 \end_inset
16434
16435  signs, e.g.: 
16436 \begin_inset Flex Code
16437 status collapsed
16438
16439 \begin_layout Plain Layout
16440 %author%
16441 \end_layout
16442
16443 \end_inset
16444
16445 .
16446  So a simple definition might look like this:
16447 \end_layout
16448
16449 \begin_layout LyX-Code
16450 misc %author%, 
16451 \begin_inset Quotes eld
16452 \end_inset
16453
16454 %title
16455 \begin_inset Quotes erd
16456 \end_inset
16457
16458 .
16459 \end_layout
16460
16461 \begin_layout Standard
16462 This would print the author, followed by a comma, followed by the title,
16463  in quotes, followed by a period.
16464 \end_layout
16465
16466 \begin_layout Standard
16467 Of course, sometimes you may want to print a key only if it exists.
16468  This can be done by using a conditional construction, such as: 
16469 \begin_inset Flex Code
16470 status collapsed
16471
16472 \begin_layout Plain Layout
16473 {%volume%[[vol.
16474 \begin_inset space ~
16475 \end_inset
16476
16477 %volume%]]}
16478 \end_layout
16479
16480 \end_inset
16481
16482 .
16483  This says: If the 
16484 \begin_inset Flex Code
16485 status collapsed
16486
16487 \begin_layout Plain Layout
16488 volume
16489 \end_layout
16490
16491 \end_inset
16492
16493  key exists, then print 
16494 \begin_inset Quotes eld
16495 \end_inset
16496
16497 vol.
16498 \begin_inset space ~
16499 \end_inset
16500
16501
16502 \begin_inset Quotes erd
16503 \end_inset
16504
16505  followed by the volume key.
16506  It is also possible to have an else clause in the conditional, such as:
16507  
16508 \begin_inset Flex Code
16509 status collapsed
16510
16511 \begin_layout Plain Layout
16512 {%author%[[%author%]][[%editor%, ed.]]}
16513 \end_layout
16514
16515 \end_inset
16516
16517 .
16518  Here, the 
16519 \begin_inset Flex Code
16520 status collapsed
16521
16522 \begin_layout Plain Layout
16523 author
16524 \end_layout
16525
16526 \end_inset
16527
16528  key is printed if it exists; otherwise, the editor key is printed, followed
16529  by 
16530 \begin_inset Quotes eld
16531 \end_inset
16532
16533 ,
16534 \begin_inset space ~
16535 \end_inset
16536
16537 ed.
16538 \begin_inset Quotes erd
16539 \end_inset
16540
16541  Note that the key is again enclosed in 
16542 \begin_inset Flex Code
16543 status collapsed
16544
16545 \begin_layout Plain Layout
16546 %
16547 \end_layout
16548
16549 \end_inset
16550
16551  signs; the entire conditional is enclosed in braces; and the if and else
16552  clauses are enclosed in double brackets, 
16553 \begin_inset Quotes eld
16554 \end_inset
16555
16556
16557 \begin_inset Flex Code
16558 status collapsed
16559
16560 \begin_layout Plain Layout
16561 [[
16562 \end_layout
16563
16564 \end_inset
16565
16566
16567 \begin_inset Quotes eld
16568 \end_inset
16569
16570  and 
16571 \begin_inset Quotes eld
16572 \end_inset
16573
16574
16575 \begin_inset Flex Code
16576 status collapsed
16577
16578 \begin_layout Plain Layout
16579 ]]
16580 \end_layout
16581
16582 \end_inset
16583
16584
16585 \begin_inset Quotes erd
16586 \end_inset
16587
16588 .
16589  There must be no space between any of these.
16590 \end_layout
16591
16592 \begin_layout Standard
16593 There is one other piece of syntax available in definitions, which looks
16594  like this: 
16595 \begin_inset Flex Code
16596 status collapsed
16597
16598 \begin_layout Plain Layout
16599 {!<i>!}
16600 \end_layout
16601
16602 \end_inset
16603
16604 .
16605  This defines a piece of formatting information that is to be used when
16606  creating 
16607 \begin_inset Quotes eld
16608 \end_inset
16609
16610 rich text
16611 \begin_inset Quotes erd
16612 \end_inset
16613
16614 .
16615  Obviously, we do not want to output HTML tags when writing plain text,
16616  so they should be wrapped in 
16617 \begin_inset Quotes eld
16618 \end_inset
16619
16620 {!
16621 \begin_inset Quotes erd
16622 \end_inset
16623
16624  and 
16625 \begin_inset Quotes eld
16626 \end_inset
16627
16628 !}
16629 \begin_inset Quotes erd
16630 \end_inset
16631
16632 .
16633 \end_layout
16634
16635 \begin_layout Standard
16636 Two special sorts of definitions are also possible in a 
16637 \begin_inset Flex Code
16638 status collapsed
16639
16640 \begin_layout Plain Layout
16641 CiteFormat
16642 \end_layout
16643
16644 \end_inset
16645
16646  block.
16647  An example of the first would be:
16648 \end_layout
16649
16650 \begin_layout LyX-Code
16651 !quotetitle 
16652 \begin_inset Quotes eld
16653 \end_inset
16654
16655 %title%
16656 \begin_inset Quotes erd
16657 \end_inset
16658
16659
16660 \end_layout
16661
16662 \begin_layout Standard
16663 This is an abbreviation, or macro, and it can be used by treating it as
16664  if it were a key: 
16665 \begin_inset Flex Code
16666 status collapsed
16667
16668 \begin_layout Plain Layout
16669 %!quotetitle%
16670 \end_layout
16671
16672 \end_inset
16673
16674 .
16675  LyX will treat 
16676 \begin_inset Flex Code
16677 status collapsed
16678
16679 \begin_layout Plain Layout
16680 %!quotetitle%
16681 \end_layout
16682
16683 \end_inset
16684
16685  exactly as it would treat its definition.
16686  So, let us issue the obvious 
16687 \emph on
16688 warning
16689 \emph default
16690 .
16691  Do not do this:
16692 \end_layout
16693
16694 \begin_layout LyX-Code
16695 !funfun %funfun%
16696 \end_layout
16697
16698 \begin_layout Standard
16699 or anything like it.
16700  LyX shouldn't go into an infinite loop, but it may go into a long one before
16701  it gives up.
16702 \end_layout
16703
16704 \begin_layout Standard
16705 The second sort of special definition might look like this:
16706 \end_layout
16707
16708 \begin_layout LyX-Code
16709 _pptext pp.
16710 \end_layout
16711
16712 \begin_layout Standard
16713 This defines a translatable piece of text, which allows relevant parts of
16714  the bibliography to be translated.
16715  It can be included in a definition by treating it as a key: 
16716 \begin_inset Flex Code
16717 status collapsed
16718
16719 \begin_layout Plain Layout
16720 %_pptext%
16721 \end_layout
16722
16723 \end_inset
16724
16725 .
16726  Several of these are predefined in 
16727 \begin_inset Flex Code
16728 status collapsed
16729
16730 \begin_layout Plain Layout
16731 stdciteformats.inc
16732 \end_layout
16733
16734 \end_inset
16735
16736 .
16737  Note that these are not macros, in the sense just defined.
16738  They will not be expanded.
16739 \end_layout
16740
16741 \begin_layout Standard
16742 So here then is an example that use all these features:
16743 \end_layout
16744
16745 \begin_layout LyX-Code
16746 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16747 \end_layout
16748
16749 \begin_layout Standard
16750 This defines a macro that prints the author, followed by a comma, if the
16751  
16752 \begin_inset Flex Code
16753 status collapsed
16754
16755 \begin_layout Plain Layout
16756 author
16757 \end_layout
16758
16759 \end_inset
16760
16761  key is defined, or else prints the name of the editor, followed by the
16762  
16763 \begin_inset Flex Code
16764 status collapsed
16765
16766 \begin_layout Plain Layout
16767 _edtext
16768 \end_layout
16769
16770 \end_inset
16771
16772  or its translation (it is by default 
16773 \begin_inset Quotes eld
16774 \end_inset
16775
16776 ed.
16777 \begin_inset Quotes erd
16778 \end_inset
16779
16780 ), if the 
16781 \begin_inset Flex Code
16782 status collapsed
16783
16784 \begin_layout Plain Layout
16785 editor
16786 \end_layout
16787
16788 \end_inset
16789
16790  key is defined.
16791  Note that this is in fact defined in 
16792 \begin_inset Flex Code
16793 status collapsed
16794
16795 \begin_layout Plain Layout
16796 stdciteformats.inc
16797 \end_layout
16798
16799 \end_inset
16800
16801 , so you can use it in your own definitions, or re-definitions, if you load
16802  that file first.
16803 \end_layout
16804
16805 \begin_layout Section
16806 \begin_inset CommandInset label
16807 LatexCommand label
16808 name "sec:Tags-for-XHTML"
16809
16810 \end_inset
16811
16812 Tags for XHTML output
16813 \end_layout
16814
16815 \begin_layout Standard
16816 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16817  by layout information.
16818  In general, LyX provides sensible defaults and, as mentioned earlier, it
16819  will even construct default CSS style rules from the other layout tags.
16820  For example, LyX will attempt to use the information provided in the 
16821 \begin_inset Flex Code
16822 status collapsed
16823
16824 \begin_layout Plain Layout
16825 Font
16826 \end_layout
16827
16828 \end_inset
16829
16830  declaration for the Chapter style to write CSS that will appropriately
16831  format chapter headings.
16832 \end_layout
16833
16834 \begin_layout Standard
16835 In many cases, then, you may not have to do anything at all to get acceptable
16836  XHTML output for your own environments, custom insets, and so forth.
16837  But in some cases you will, and so LyX provides a number of layout tags
16838  that can be used to customize the XHTML and CSS that are generated.
16839 \end_layout
16840
16841 \begin_layout Standard
16842 Note that there are two tags, 
16843 \begin_inset Flex Code
16844 status collapsed
16845
16846 \begin_layout Plain Layout
16847 HTMLPreamble
16848 \end_layout
16849
16850 \end_inset
16851
16852  and 
16853 \begin_inset Flex Code
16854 status collapsed
16855
16856 \begin_layout Plain Layout
16857 AddToHTMLPreamble
16858 \end_layout
16859
16860 \end_inset
16861
16862  that may appear outside style and inset declarations.
16863  See 
16864 \begin_inset CommandInset ref
16865 LatexCommand ref
16866 reference "sub:General-text-class"
16867
16868 \end_inset
16869
16870  for details on these.
16871 \end_layout
16872
16873 \begin_layout Subsection
16874 \begin_inset CommandInset label
16875 LatexCommand label
16876 name "sub:Paragraph-Style-XHTML"
16877
16878 \end_inset
16879
16880 Paragraph styles
16881 \end_layout
16882
16883 \begin_layout Standard
16884 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16885  dealing with a normal paragraph, a command, or an environment, where this
16886  is itself determined by the contents of the corresponding 
16887 \begin_inset Flex Code
16888 status collapsed
16889
16890 \begin_layout Plain Layout
16891 LaTeXType
16892 \end_layout
16893
16894 \end_inset
16895
16896  tag.
16897  
16898 \end_layout
16899
16900 \begin_layout Standard
16901 For a command or normal paragraph, the output XHTML has the following form:
16902 \end_layout
16903
16904 \begin_layout LyX-Code
16905 <tag attr=
16906 \begin_inset Quotes erd
16907 \end_inset
16908
16909 value
16910 \begin_inset Quotes erd
16911 \end_inset
16912
16913 >
16914 \end_layout
16915
16916 \begin_layout LyX-Code
16917 <labeltag attr=
16918 \begin_inset Quotes erd
16919 \end_inset
16920
16921 value
16922 \begin_inset Quotes erd
16923 \end_inset
16924
16925 >Label</labeltag>
16926 \end_layout
16927
16928 \begin_layout LyX-Code
16929 Contents of the paragraph.
16930 \end_layout
16931
16932 \begin_layout LyX-Code
16933 </tag>
16934 \end_layout
16935
16936 \begin_layout Standard
16937 The label tags are of course omitted if the paragraph does not have a label.
16938 \end_layout
16939
16940 \begin_layout Standard
16941 For an environment that is not some sort of list, the XHTML takes this form:
16942 \end_layout
16943
16944 \begin_layout LyX-Code
16945 <tag attr=
16946 \begin_inset Quotes erd
16947 \end_inset
16948
16949 value
16950 \begin_inset Quotes erd
16951 \end_inset
16952
16953 >
16954 \end_layout
16955
16956 \begin_layout LyX-Code
16957 <itemtag attr=
16958 \begin_inset Quotes erd
16959 \end_inset
16960
16961 value
16962 \begin_inset Quotes erd
16963 \end_inset
16964
16965 ><labeltag attr=
16966 \begin_inset Quotes erd
16967 \end_inset
16968
16969 value
16970 \begin_inset Quotes erd
16971 \end_inset
16972
16973 >Environment Label</labeltag>First paragraph.</itemtag>
16974 \end_layout
16975
16976 \begin_layout LyX-Code
16977 <itemtag>Second paragraph.</itemtag>
16978 \end_layout
16979
16980 \begin_layout LyX-Code
16981 </tag>
16982 \end_layout
16983
16984 \begin_layout Standard
16985 Note that the label is output only for the first paragraph, as it should
16986  be for a theorem, for example.
16987  
16988 \end_layout
16989
16990 \begin_layout Standard
16991 For a list, we have one of these forms:
16992 \end_layout
16993
16994 \begin_layout LyX-Code
16995 <tag attr=
16996 \begin_inset Quotes erd
16997 \end_inset
16998
16999 value
17000 \begin_inset Quotes erd
17001 \end_inset
17002
17003 >
17004 \end_layout
17005
17006 \begin_layout LyX-Code
17007 <itemtag attr=
17008 \begin_inset Quotes erd
17009 \end_inset
17010
17011 value
17012 \begin_inset Quotes erd
17013 \end_inset
17014
17015 ><labeltag attr=
17016 \begin_inset Quotes erd
17017 \end_inset
17018
17019 value
17020 \begin_inset Quotes erd
17021 \end_inset
17022
17023 >List Label</labeltag>First item.</itemtag>
17024 \end_layout
17025
17026 \begin_layout LyX-Code
17027 <itemtag attr=
17028 \begin_inset Quotes erd
17029 \end_inset
17030
17031 value
17032 \begin_inset Quotes erd
17033 \end_inset
17034
17035 ><labeltag attr=
17036 \begin_inset Quotes erd
17037 \end_inset
17038
17039 value
17040 \begin_inset Quotes erd
17041 \end_inset
17042
17043 >List Label</labeltag>Second item.</itemtag>
17044 \end_layout
17045
17046 \begin_layout LyX-Code
17047 </tag>
17048 \end_layout
17049
17050 \begin_layout LyX-Code
17051
17052 \end_layout
17053
17054 \begin_layout LyX-Code
17055 <tag attr=
17056 \begin_inset Quotes erd
17057 \end_inset
17058
17059 value
17060 \begin_inset Quotes erd
17061 \end_inset
17062
17063 >
17064 \end_layout
17065
17066 \begin_layout LyX-Code
17067 <labeltag attr=
17068 \begin_inset Quotes erd
17069 \end_inset
17070
17071 value
17072 \begin_inset Quotes erd
17073 \end_inset
17074
17075 >List Label</labeltag><itemtag attr=
17076 \begin_inset Quotes erd
17077 \end_inset
17078
17079 value
17080 \begin_inset Quotes erd
17081 \end_inset
17082
17083 >First item.</itemtag>
17084 \end_layout
17085
17086 \begin_layout LyX-Code
17087 <labeltag attr=
17088 \begin_inset Quotes erd
17089 \end_inset
17090
17091 value
17092 \begin_inset Quotes erd
17093 \end_inset
17094
17095 >List Label</labeltag><itemtag attr=
17096 \begin_inset Quotes erd
17097 \end_inset
17098
17099 value
17100 \begin_inset Quotes erd
17101 \end_inset
17102
17103 >Second item.</itemtag>
17104 \end_layout
17105
17106 \begin_layout LyX-Code
17107 </tag>
17108 \end_layout
17109
17110 \begin_layout Standard
17111 Note the different orders of 
17112 \begin_inset Flex Code
17113 status collapsed
17114
17115 \begin_layout Plain Layout
17116 labeltag
17117 \end_layout
17118
17119 \end_inset
17120
17121  and 
17122 \begin_inset Flex Code
17123 status collapsed
17124
17125 \begin_layout Plain Layout
17126 itemtag
17127 \end_layout
17128
17129 \end_inset
17130
17131 .
17132  Which order we get depends upon the setting of 
17133 \begin_inset Flex Code
17134 status collapsed
17135
17136 \begin_layout Plain Layout
17137 HTMLLabelFirst
17138 \end_layout
17139
17140 \end_inset
17141
17142 : If 
17143 \begin_inset Flex Code
17144 status collapsed
17145
17146 \begin_layout Plain Layout
17147 HTMLLabelFirst
17148 \end_layout
17149
17150 \end_inset
17151
17152  is false (the default), you get the first of these, with the label within
17153  the item; if true, you get the second, with the label outside the item.
17154 \end_layout
17155
17156 \begin_layout Standard
17157 The specific tags and attributes output for each paragraph type can be controlle
17158 d by means of the layout tags we are about to describe.
17159  As mentioned earlier, however, LyX uses sensible defaults for many of these,
17160  so you often may not need to do very much to get good XHTML output.
17161  Think of the available tags as there so you can tweak things to your liking.
17162 \end_layout
17163
17164 \begin_layout Description
17165 \begin_inset Flex Code
17166 status collapsed
17167
17168 \begin_layout Plain Layout
17169 HTMLAttr
17170 \end_layout
17171
17172 \end_inset
17173
17174  [
17175 \begin_inset Flex Code
17176 status collapsed
17177
17178 \begin_layout Plain Layout
17179 string
17180 \end_layout
17181
17182 \end_inset
17183
17184 ] Specifies attribute information to be output with the main tag.
17185  For example, 
17186 \begin_inset Quotes eld
17187 \end_inset
17188
17189
17190 \begin_inset Flex Code
17191 status collapsed
17192
17193 \begin_layout Plain Layout
17194 class=`mydiv'
17195 \end_layout
17196
17197 \end_inset
17198
17199
17200 \begin_inset Quotes erd
17201 \end_inset
17202
17203 .
17204  By default, LyX will output 
17205 \begin_inset Quotes eld
17206 \end_inset
17207
17208
17209 \begin_inset Flex Code
17210 status collapsed
17211
17212 \begin_layout Plain Layout
17213 class=`layoutname'
17214 \end_layout
17215
17216 \end_inset
17217
17218
17219 \begin_inset Quotes erd
17220 \end_inset
17221
17222 , where 
17223 \begin_inset Flex Code
17224 status collapsed
17225
17226 \begin_layout Plain Layout
17227 layoutname
17228 \end_layout
17229
17230 \end_inset
17231
17232  is the LyX name of the layout, made lowercase, for example: chapter.
17233  This should 
17234 \emph on
17235 not
17236 \emph default
17237  contain any style information.
17238  Use 
17239 \begin_inset Flex Code
17240 status collapsed
17241
17242 \begin_layout Plain Layout
17243 HTMLStyle
17244 \end_layout
17245
17246 \end_inset
17247
17248  for that purpose.
17249 \end_layout
17250
17251 \begin_layout Description
17252 \begin_inset Flex Code
17253 status collapsed
17254
17255 \begin_layout Plain Layout
17256 HTMLForceCSS
17257 \end_layout
17258
17259 \end_inset
17260
17261  [
17262 \begin_inset Flex Code
17263 status collapsed
17264
17265 \begin_layout Plain Layout
17266
17267 \emph on
17268 0
17269 \emph default
17270 ,1
17271 \end_layout
17272
17273 \end_inset
17274
17275 ] Whether to output the default CSS information LyX generates for this layout,
17276  even if additional information is explicitly provided via 
17277 \begin_inset Flex Code
17278 status collapsed
17279
17280 \begin_layout Plain Layout
17281 HTMLStyle
17282 \end_layout
17283
17284 \end_inset
17285
17286 .
17287  Setting this to 
17288 \begin_inset Flex Code
17289 status collapsed
17290
17291 \begin_layout Plain Layout
17292 1
17293 \end_layout
17294
17295 \end_inset
17296
17297  allows you to alter or augment the generated CSS, rather than to override
17298  it completely.
17299  Default is 
17300 \begin_inset Flex Code
17301 status collapsed
17302
17303 \begin_layout Plain Layout
17304 0
17305 \end_layout
17306
17307 \end_inset
17308
17309 .
17310 \end_layout
17311
17312 \begin_layout Description
17313 \begin_inset Flex Code
17314 status collapsed
17315
17316 \begin_layout Plain Layout
17317 HTMLItem
17318 \end_layout
17319
17320 \end_inset
17321
17322  [
17323 \begin_inset Flex Code
17324 status collapsed
17325
17326 \begin_layout Plain Layout
17327 string
17328 \end_layout
17329
17330 \end_inset
17331
17332 ] The tag to be used for individual paragraphs of environments, replacing
17333  
17334 \begin_inset Flex Code
17335 status collapsed
17336
17337 \begin_layout Plain Layout
17338 itemtag
17339 \end_layout
17340
17341 \end_inset
17342
17343  in the examples above.
17344  Defaults to 
17345 \begin_inset Flex Code
17346 status collapsed
17347
17348 \begin_layout Plain Layout
17349 div
17350 \end_layout
17351
17352 \end_inset
17353
17354 .
17355 \end_layout
17356
17357 \begin_layout Description
17358 \begin_inset Flex Code
17359 status collapsed
17360
17361 \begin_layout Plain Layout
17362 HTMLItemAttr
17363 \end_layout
17364
17365 \end_inset
17366
17367  [
17368 \begin_inset Flex Code
17369 status collapsed
17370
17371 \begin_layout Plain Layout
17372 string
17373 \end_layout
17374
17375 \end_inset
17376
17377 ] Attributes for the item tag.
17378  Defaults to 
17379 \begin_inset Quotes eld
17380 \end_inset
17381
17382
17383 \begin_inset Flex Code
17384 status collapsed
17385
17386 \begin_layout Plain Layout
17387 class=`layoutname_item'
17388 \end_layout
17389
17390 \end_inset
17391
17392
17393 \begin_inset Quotes erd
17394 \end_inset
17395
17396 .
17397  This should 
17398 \emph on
17399 not
17400 \emph default
17401  contain any style information.
17402  Use 
17403 \begin_inset Flex Code
17404 status collapsed
17405
17406 \begin_layout Plain Layout
17407 HTMLStyle
17408 \end_layout
17409
17410 \end_inset
17411
17412  for that purpose.
17413 \end_layout
17414
17415 \begin_layout Description
17416 \begin_inset Flex Code
17417 status collapsed
17418
17419 \begin_layout Plain Layout
17420 HTMLLabel
17421 \end_layout
17422
17423 \end_inset
17424
17425  [
17426 \begin_inset Flex Code
17427 status collapsed
17428
17429 \begin_layout Plain Layout
17430 string
17431 \end_layout
17432
17433 \end_inset
17434
17435 ] The tag to be used for paragraph and item labels, replacing 
17436 \begin_inset Flex Code
17437 status collapsed
17438
17439 \begin_layout Plain Layout
17440 labeltag
17441 \end_layout
17442
17443 \end_inset
17444
17445  in the examples above.
17446  Defaults to 
17447 \begin_inset Flex Code
17448 status collapsed
17449
17450 \begin_layout Plain Layout
17451 span
17452 \end_layout
17453
17454 \end_inset
17455
17456 , unless 
17457 \begin_inset Flex Code
17458 status collapsed
17459
17460 \begin_layout Plain Layout
17461 LabelType
17462 \end_layout
17463
17464 \end_inset
17465
17466  is either 
17467 \begin_inset Flex Code
17468 status collapsed
17469
17470 \begin_layout Plain Layout
17471 Top_Environment
17472 \end_layout
17473
17474 \end_inset
17475
17476  or 
17477 \begin_inset Flex Code
17478 status collapsed
17479
17480 \begin_layout Plain Layout
17481 Centered_Top_Environment
17482 \end_layout
17483
17484 \end_inset
17485
17486 , in which case it defaults to 
17487 \begin_inset Flex Code
17488 status collapsed
17489
17490 \begin_layout Plain Layout
17491 div
17492 \end_layout
17493
17494 \end_inset
17495
17496 .
17497 \end_layout
17498
17499 \begin_layout Description
17500 \begin_inset Flex Code
17501 status collapsed
17502
17503 \begin_layout Plain Layout
17504 HTMLLabelAttr
17505 \end_layout
17506
17507 \end_inset
17508
17509  [
17510 \begin_inset Flex Code
17511 status collapsed
17512
17513 \begin_layout Plain Layout
17514 string
17515 \end_layout
17516
17517 \end_inset
17518
17519 ] Attributes for the label tag.
17520  Defaults to 
17521 \begin_inset Quotes eld
17522 \end_inset
17523
17524
17525 \begin_inset Flex Code
17526 status collapsed
17527
17528 \begin_layout Plain Layout
17529 class=`layoutname_label'
17530 \end_layout
17531
17532 \end_inset
17533
17534
17535 \begin_inset Quotes erd
17536 \end_inset
17537
17538 .
17539  This should 
17540 \emph on
17541 not
17542 \emph default
17543  contain any style information.
17544  Use 
17545 \begin_inset Flex Code
17546 status collapsed
17547
17548 \begin_layout Plain Layout
17549 HTMLStyle
17550 \end_layout
17551
17552 \end_inset
17553
17554  for that purpose.
17555 \end_layout
17556
17557 \begin_layout Description
17558 \begin_inset Flex Code
17559 status collapsed
17560
17561 \begin_layout Plain Layout
17562 HTMLLabelFirst
17563 \end_layout
17564
17565 \end_inset
17566
17567  [
17568 \begin_inset Flex Code
17569 status collapsed
17570
17571 \begin_layout Plain Layout
17572
17573 \emph on
17574 0
17575 \emph default
17576 ,1
17577 \end_layout
17578
17579 \end_inset
17580
17581 ] Meaningful only for list-like environments, this tag controls whether
17582  the label tag is output before or inside the item tag.
17583  This is used, for example, in the description environment, where we want
17584  `
17585 \begin_inset Flex Code
17586 status collapsed
17587
17588 \begin_layout Plain Layout
17589 <dt>\SpecialChar \ldots{}
17590 </dt><dd>\SpecialChar \ldots{}
17591 </dd>
17592 \end_layout
17593
17594 \end_inset
17595
17596 .
17597  Default is 
17598 \begin_inset Flex Code
17599 status collapsed
17600
17601 \begin_layout Plain Layout
17602 0
17603 \end_layout
17604
17605 \end_inset
17606
17607 : The label tag is output inside the item tag.
17608 \end_layout
17609
17610 \begin_layout Description
17611 \begin_inset Flex Code
17612 status collapsed
17613
17614 \begin_layout Plain Layout
17615 HTMLPreamble
17616 \end_layout
17617
17618 \end_inset
17619
17620  Information to be output in the 
17621 \begin_inset Flex Code
17622 status collapsed
17623
17624 \begin_layout Plain Layout
17625 <head>
17626 \end_layout
17627
17628 \end_inset
17629
17630  section when this style is used.
17631  This might, for example, be used to include a 
17632 \begin_inset Flex Code
17633 status collapsed
17634
17635 \begin_layout Plain Layout
17636 <script>
17637 \end_layout
17638
17639 \end_inset
17640
17641  block defining an 
17642 \begin_inset Flex Code
17643 status collapsed
17644
17645 \begin_layout Plain Layout
17646 onclick
17647 \end_layout
17648
17649 \end_inset
17650
17651  handler.
17652 \end_layout
17653
17654 \begin_layout Description
17655 \begin_inset Flex Code
17656 status collapsed
17657
17658 \begin_layout Plain Layout
17659 HTMLStyle
17660 \end_layout
17661
17662 \end_inset
17663
17664  CSS style information to be included when this style is used.
17665  Note that this will automatically be wrapped in a layout-generated 
17666 \begin_inset Flex Code
17667 status collapsed
17668
17669 \begin_layout Plain Layout
17670 <style>
17671 \end_layout
17672
17673 \end_inset
17674
17675  block, so only the CSS itself need be included.
17676 \end_layout
17677
17678 \begin_layout Description
17679 \begin_inset Flex Code
17680 status collapsed
17681
17682 \begin_layout Plain Layout
17683 HTMLTag
17684 \end_layout
17685
17686 \end_inset
17687
17688  [
17689 \begin_inset Flex Code
17690 status collapsed
17691
17692 \begin_layout Plain Layout
17693 string
17694 \end_layout
17695
17696 \end_inset
17697
17698 ] The tag to be used for the main label, replacing 
17699 \begin_inset Flex Code
17700 status collapsed
17701
17702 \begin_layout Plain Layout
17703 tag
17704 \end_layout
17705
17706 \end_inset
17707
17708  in the examples above.
17709  Defaults to 
17710 \begin_inset Flex Code
17711 status collapsed
17712
17713 \begin_layout Plain Layout
17714 div
17715 \end_layout
17716
17717 \end_inset
17718
17719 .
17720 \end_layout
17721
17722 \begin_layout Description
17723 \begin_inset Flex Code
17724 status collapsed
17725
17726 \begin_layout Plain Layout
17727 HTMLTitle
17728 \end_layout
17729
17730 \end_inset
17731
17732  [
17733 \begin_inset Flex Code
17734 status collapsed
17735
17736 \begin_layout Plain Layout
17737
17738 \emph on
17739 0
17740 \emph default
17741 ,1
17742 \end_layout
17743
17744 \end_inset
17745
17746 ] Marks this style as the one to be used to generate the 
17747 \begin_inset Flex Code
17748 status collapsed
17749
17750 \begin_layout Plain Layout
17751 <title>
17752 \end_layout
17753
17754 \end_inset
17755
17756  tag for the XHTML file.
17757  By default, it is false.
17758  The 
17759 \begin_inset Flex Code
17760 status collapsed
17761
17762 \begin_layout Plain Layout
17763 stdtitle.inc
17764 \end_layout
17765
17766 \end_inset
17767
17768  file sets it to true for the 
17769 \begin_inset Flex Code
17770 status collapsed
17771
17772 \begin_layout Plain Layout
17773 title
17774 \end_layout
17775
17776 \end_inset
17777
17778  environment.
17779  
17780 \end_layout
17781
17782 \begin_layout Subsection
17783 InsetLayout XHTML
17784 \end_layout
17785
17786 \begin_layout Standard
17787 The XHTML output of insets can also be controlled by information in layout
17788  files.
17789 \begin_inset Foot
17790 status collapsed
17791
17792 \begin_layout Plain Layout
17793 At present, this is true only for 
17794 \begin_inset Quotes eld
17795 \end_inset
17796
17797 text
17798 \begin_inset Quotes erd
17799 \end_inset
17800
17801  insets (insets you can type into) and is not true for 
17802 \begin_inset Quotes eld
17803 \end_inset
17804
17805 command
17806 \begin_inset Quotes erd
17807 \end_inset
17808
17809  insets (insets that are associated with dialog boxes).
17810 \end_layout
17811
17812 \end_inset
17813
17814  Here, too, LyX tries to provide sensible defaults, and it constructs default
17815  CSS style rules.
17816  But everything can be customized.
17817 \end_layout
17818
17819 \begin_layout Standard
17820 The XHTML LyX outputs for an inset has the following form:
17821 \end_layout
17822
17823 \begin_layout LyX-Code
17824 <tag attr=
17825 \begin_inset Quotes erd
17826 \end_inset
17827
17828 value
17829 \begin_inset Quotes erd
17830 \end_inset
17831
17832 >
17833 \end_layout
17834
17835 \begin_layout LyX-Code
17836 <labeltag>Label</labeltag>
17837 \end_layout
17838
17839 \begin_layout LyX-Code
17840 <innertag attr=
17841 \begin_inset Quotes erd
17842 \end_inset
17843
17844 value
17845 \begin_inset Quotes erd
17846 \end_inset
17847
17848 >Contents of the inset.</innertag>
17849 \end_layout
17850
17851 \begin_layout LyX-Code
17852 </tag>
17853 \end_layout
17854
17855 \begin_layout Standard
17856 If the inset permits multiple paragraphs---that is, if 
17857 \begin_inset Flex Code
17858 status collapsed
17859
17860 \begin_layout Plain Layout
17861 MultiPar
17862 \end_layout
17863
17864 \end_inset
17865
17866  is true---then the contents of the inset will itself be output as paragraphs
17867  formatted according to the styles used for those paragraphs (standard,
17868  quote, and the like).
17869  The label tag is of course omitted if the paragraph does not have a label
17870  and, at present, is always 
17871 \begin_inset Flex Code
17872 status collapsed
17873
17874 \begin_layout Plain Layout
17875 span
17876 \end_layout
17877
17878 \end_inset
17879
17880 .
17881  The inner tag is optional and, by default, does not appear.
17882 \end_layout
17883
17884 \begin_layout Standard
17885 The specific tags and attributes output for each inset can be controlled
17886  by means of the following layout tags.
17887 \end_layout
17888
17889 \begin_layout Description
17890 \begin_inset Flex Code
17891 status collapsed
17892
17893 \begin_layout Plain Layout
17894 HTMLAttr
17895 \end_layout
17896
17897 \end_inset
17898
17899  [
17900 \begin_inset Flex Code
17901 status collapsed
17902
17903 \begin_layout Plain Layout
17904 string
17905 \end_layout
17906
17907 \end_inset
17908
17909 ] Specifies attribute information to be output with the main tag.
17910  For example, 
17911 \begin_inset Quotes eld
17912 \end_inset
17913
17914
17915 \begin_inset Flex Code
17916 status collapsed
17917
17918 \begin_layout Plain Layout
17919 class=`myinset' onclick=`\SpecialChar \ldots{}
17920 '
17921 \end_layout
17922
17923 \end_inset
17924
17925
17926 \begin_inset Quotes erd
17927 \end_inset
17928
17929 .
17930  By default, LyX will output 
17931 \begin_inset Quotes eld
17932 \end_inset
17933
17934
17935 \begin_inset Flex Code
17936 status collapsed
17937
17938 \begin_layout Plain Layout
17939 class=`insetname'
17940 \end_layout
17941
17942 \end_inset
17943
17944
17945 \begin_inset Quotes erd
17946 \end_inset
17947
17948 , where 
17949 \begin_inset Flex Code
17950 status collapsed
17951
17952 \begin_layout Plain Layout
17953 insetname
17954 \end_layout
17955
17956 \end_inset
17957
17958  is the LyX name of the inset, made lowercase and with non-alphanumeric
17959  characters converted to underscores, for example: footnote.
17960 \end_layout
17961
17962 \begin_layout Description
17963 \begin_inset Flex Code
17964 status collapsed
17965
17966 \begin_layout Plain Layout
17967 HTMLForceCSS
17968 \end_layout
17969
17970 \end_inset
17971
17972  [
17973 \begin_inset Flex Code
17974 status collapsed
17975
17976 \begin_layout Plain Layout
17977
17978 \emph on
17979 0
17980 \emph default
17981 ,1
17982 \end_layout
17983
17984 \end_inset
17985
17986 ] Whether to output the default CSS information LyX generates for this layout,
17987  even if additional information is explicitly provided via 
17988 \begin_inset Flex Code
17989 status collapsed
17990
17991 \begin_layout Plain Layout
17992 HTMLStyle
17993 \end_layout
17994
17995 \end_inset
17996
17997 .
17998  Setting this to 
17999 \begin_inset Flex Code
18000 status collapsed
18001
18002 \begin_layout Plain Layout
18003 1
18004 \end_layout
18005
18006 \end_inset
18007
18008  allows you to alter or augment the generated CSS, rather than to override
18009  it completely.
18010  Default is 0.
18011 \end_layout
18012
18013 \begin_layout Description
18014 \begin_inset Flex Code
18015 status collapsed
18016
18017 \begin_layout Plain Layout
18018 HTMLInnerAttr
18019 \end_layout
18020
18021 \end_inset
18022
18023  [
18024 \begin_inset Flex Code
18025 status collapsed
18026
18027 \begin_layout Plain Layout
18028 string
18029 \end_layout
18030
18031 \end_inset
18032
18033 ] Attributes for the inner tag.
18034  Defaults to 
18035 \begin_inset Quotes eld
18036 \end_inset
18037
18038
18039 \begin_inset Flex Code
18040 status collapsed
18041
18042 \begin_layout Plain Layout
18043 class=`insetname_inner'
18044 \end_layout
18045
18046 \end_inset
18047
18048
18049 \begin_inset Quotes erd
18050 \end_inset
18051
18052 .
18053 \end_layout
18054
18055 \begin_layout Description
18056 \begin_inset Flex Code
18057 status collapsed
18058
18059 \begin_layout Plain Layout
18060 HTMLInnerTag
18061 \end_layout
18062
18063 \end_inset
18064
18065  [
18066 \begin_inset Flex Code
18067 status collapsed
18068
18069 \begin_layout Plain Layout
18070 string
18071 \end_layout
18072
18073 \end_inset
18074
18075 ] The inner tag, replacing 
18076 \begin_inset Flex Code
18077 status collapsed
18078
18079 \begin_layout Plain Layout
18080 innertag
18081 \end_layout
18082
18083 \end_inset
18084
18085  in the examples above.
18086  By default, there is none.
18087 \end_layout
18088
18089 \begin_layout Description
18090 \begin_inset Flex Code
18091 status collapsed
18092
18093 \begin_layout Plain Layout
18094 HTMLIsBlock
18095 \end_layout
18096
18097 \end_inset
18098
18099  [
18100 \begin_inset Flex Code
18101 status collapsed
18102
18103 \begin_layout Plain Layout
18104 0,
18105 \emph on
18106 1
18107 \end_layout
18108
18109 \end_inset
18110
18111 ] Whether this inset represents a standalone block of text (such as a footnote)
18112  or instead represents material that is included in the surrounding text
18113  (such as a branch).
18114  Defaults to 1.
18115 \end_layout
18116
18117 \begin_layout Description
18118 \begin_inset Flex Code
18119 status collapsed
18120
18121 \begin_layout Plain Layout
18122 HTMLLabel
18123 \end_layout
18124
18125 \end_inset
18126
18127  [
18128 \begin_inset Flex Code
18129 status collapsed
18130
18131 \begin_layout Plain Layout
18132 string
18133 \end_layout
18134
18135 \end_inset
18136
18137 ] A label for this inset, possibly including a reference to a counter.
18138  For example, for footnote, it might be: 
18139 \begin_inset Flex Code
18140 status collapsed
18141
18142 \begin_layout Plain Layout
18143
18144 \backslash
18145 arabic{footnote}
18146 \end_layout
18147
18148 \end_inset
18149
18150 .
18151  This is optional, and there is no default.
18152 \end_layout
18153
18154 \begin_layout Description
18155 \begin_inset Flex Code
18156 status collapsed
18157
18158 \begin_layout Plain Layout
18159 HTMLPreamble
18160 \end_layout
18161
18162 \end_inset
18163
18164  Information to be output in the 
18165 \begin_inset Flex Code
18166 status collapsed
18167
18168 \begin_layout Plain Layout
18169 <head>
18170 \end_layout
18171
18172 \end_inset
18173
18174  section when this style is used.
18175  This might, for example, be used to include a 
18176 \begin_inset Flex Code
18177 status collapsed
18178
18179 \begin_layout Plain Layout
18180 <script>
18181 \end_layout
18182
18183 \end_inset
18184
18185  block defining an 
18186 \begin_inset Flex Code
18187 status collapsed
18188
18189 \begin_layout Plain Layout
18190 onclick
18191 \end_layout
18192
18193 \end_inset
18194
18195  handler.
18196 \end_layout
18197
18198 \begin_layout Description
18199 \begin_inset Flex Code
18200 status collapsed
18201
18202 \begin_layout Plain Layout
18203 HTMLStyle
18204 \end_layout
18205
18206 \end_inset
18207
18208  CSS style information to be included when this style is used.
18209  Note that this will automatically be wrapped in a layout-generated 
18210 \begin_inset Flex Code
18211 status collapsed
18212
18213 \begin_layout Plain Layout
18214 <style>
18215 \end_layout
18216
18217 \end_inset
18218
18219  block, so only the CSS itself need be included.
18220 \end_layout
18221
18222 \begin_layout Description
18223 \begin_inset Flex Code
18224 status collapsed
18225
18226 \begin_layout Plain Layout
18227 HTMLTag
18228 \end_layout
18229
18230 \end_inset
18231
18232  [
18233 \begin_inset Flex Code
18234 status collapsed
18235
18236 \begin_layout Plain Layout
18237 string
18238 \end_layout
18239
18240 \end_inset
18241
18242 ] The tag to be used for the main label, replacing 
18243 \begin_inset Flex Code
18244 status collapsed
18245
18246 \begin_layout Plain Layout
18247 tag
18248 \end_layout
18249
18250 \end_inset
18251
18252  in the examples above.
18253  The default depends upon the setting of 
18254 \begin_inset Flex Code
18255 status collapsed
18256
18257 \begin_layout Plain Layout
18258 MultiPar
18259 \end_layout
18260
18261 \end_inset
18262
18263 : If 
18264 \begin_inset Flex Code
18265 status collapsed
18266
18267 \begin_layout Plain Layout
18268 MultiPar
18269 \end_layout
18270
18271 \end_inset
18272
18273  is true, the default is 
18274 \begin_inset Flex Code
18275 status collapsed
18276
18277 \begin_layout Plain Layout
18278 div
18279 \end_layout
18280
18281 \end_inset
18282
18283 ; if it is false, the default is 
18284 \begin_inset Flex Code
18285 status collapsed
18286
18287 \begin_layout Plain Layout
18288 span
18289 \end_layout
18290
18291 \end_inset
18292
18293 .
18294 \end_layout
18295
18296 \begin_layout Subsection
18297 Float XHTML
18298 \end_layout
18299
18300 \begin_layout Standard
18301 The XHTML output for floats too can be controlled by layout information.
18302  The output has the following form:
18303 \end_layout
18304
18305 \begin_layout LyX-Code
18306 <tag attr=
18307 \begin_inset Quotes erd
18308 \end_inset
18309
18310 value
18311 \begin_inset Quotes erd
18312 \end_inset
18313
18314 >
18315 \end_layout
18316
18317 \begin_layout LyX-Code
18318 Contents of the float.
18319 \end_layout
18320
18321 \begin_layout LyX-Code
18322 </tag>
18323 \end_layout
18324
18325 \begin_layout Standard
18326 The caption, if there is one, is a separate inset and will be output as
18327  such.
18328  Its appearance can be controlled via the InsetLayout for caption insets.
18329  
18330 \end_layout
18331
18332 \begin_layout Description
18333 \begin_inset Flex Code
18334 status collapsed
18335
18336 \begin_layout Plain Layout
18337 HTMLAttr
18338 \end_layout
18339
18340 \end_inset
18341
18342  [
18343 \begin_inset Flex Code
18344 status collapsed
18345
18346 \begin_layout Plain Layout
18347 string
18348 \end_layout
18349
18350 \end_inset
18351
18352 ] Specifies attribute information to be output with the main tag.
18353  For example, 
18354 \begin_inset Quotes eld
18355 \end_inset
18356
18357
18358 \begin_inset Flex Code
18359 status collapsed
18360
18361 \begin_layout Plain Layout
18362 class=`myfloat' onclick=`\SpecialChar \ldots{}
18363 '
18364 \end_layout
18365
18366 \end_inset
18367
18368
18369 \begin_inset Quotes erd
18370 \end_inset
18371
18372 .
18373  By default, LyX will output 
18374 \begin_inset Quotes eld
18375 \end_inset
18376
18377
18378 \begin_inset Flex Code
18379 status collapsed
18380
18381 \begin_layout Plain Layout
18382 class=`float float-floattype'
18383 \end_layout
18384
18385 \end_inset
18386
18387
18388 \begin_inset Quotes erd
18389 \end_inset
18390
18391 , where 
18392 \begin_inset Flex Code
18393 status collapsed
18394
18395 \begin_layout Plain Layout
18396 floattype
18397 \end_layout
18398
18399 \end_inset
18400
18401  is LyX's name for this type of float, as determined by the float declaration
18402  (see 
18403 \begin_inset CommandInset ref
18404 LatexCommand ref
18405 reference "sub:Floats"
18406
18407 \end_inset
18408
18409 ), though made lowercase and with non-alphanumeric characters converted
18410  to underscores, for example: float-table.
18411 \end_layout
18412
18413 \begin_layout Description
18414 \begin_inset Flex Code
18415 status collapsed
18416
18417 \begin_layout Plain Layout
18418 HTMLStyle
18419 \end_layout
18420
18421 \end_inset
18422
18423  CSS style information to be included when this float is used.
18424  Note that this will automatically be wrapped in a layout-generated 
18425 \begin_inset Flex Code
18426 status collapsed
18427
18428 \begin_layout Plain Layout
18429 <style>
18430 \end_layout
18431
18432 \end_inset
18433
18434  block, so only the CSS itself need be included.
18435 \end_layout
18436
18437 \begin_layout Description
18438 \begin_inset Flex Code
18439 status collapsed
18440
18441 \begin_layout Plain Layout
18442 HTMLTag
18443 \end_layout
18444
18445 \end_inset
18446
18447  [
18448 \begin_inset Flex Code
18449 status collapsed
18450
18451 \begin_layout Plain Layout
18452 string
18453 \end_layout
18454
18455 \end_inset
18456
18457 ] The tag to be used for this float, replacing 
18458 \begin_inset Quotes eld
18459 \end_inset
18460
18461
18462 \begin_inset Flex Code
18463 status collapsed
18464
18465 \begin_layout Plain Layout
18466 tag
18467 \end_layout
18468
18469 \end_inset
18470
18471
18472 \begin_inset Quotes erd
18473 \end_inset
18474
18475  in the example above.
18476  The default is 
18477 \begin_inset Flex Code
18478 status collapsed
18479
18480 \begin_layout Plain Layout
18481 div
18482 \end_layout
18483
18484 \end_inset
18485
18486  and will rarely need changing.
18487 \end_layout
18488
18489 \begin_layout Subsection
18490 Bibliography formatting
18491 \end_layout
18492
18493 \begin_layout Standard
18494 The bibliography can be formatted using 
18495 \begin_inset Flex Code
18496 status collapsed
18497
18498 \begin_layout Plain Layout
18499 CiteFormat
18500 \end_layout
18501
18502 \end_inset
18503
18504  blocks.
18505  See Section 
18506 \begin_inset CommandInset ref
18507 LatexCommand ref
18508 reference "sub:Citation-format-description"
18509
18510 \end_inset
18511
18512  for the details.
18513 \end_layout
18514
18515 \begin_layout Subsection
18516 LyX-generated CSS
18517 \end_layout
18518
18519 \begin_layout Standard
18520 We have several times mentioned that LyX will generate default CSS style
18521  rules for both insets and paragraph styles, based upon the other layout
18522  information that is provided.
18523  In this section, we shall say a word about which layout information LyX
18524  uses and how.
18525 \end_layout
18526
18527 \begin_layout Standard
18528 At present, LyX auto-generates CSS only for font information, making use
18529  of the 
18530 \begin_inset Flex Code
18531 status collapsed
18532
18533 \begin_layout Plain Layout
18534 Family
18535 \end_layout
18536
18537 \end_inset
18538
18539
18540 \begin_inset Flex Code
18541 status collapsed
18542
18543 \begin_layout Plain Layout
18544 Series
18545 \end_layout
18546
18547 \end_inset
18548
18549
18550 \begin_inset Flex Code
18551 status collapsed
18552
18553 \begin_layout Plain Layout
18554 Shape
18555 \end_layout
18556
18557 \end_inset
18558
18559 , and 
18560 \begin_inset Flex Code
18561 status collapsed
18562
18563 \begin_layout Plain Layout
18564 Size
18565 \end_layout
18566
18567 \end_inset
18568
18569  specified in the 
18570 \begin_inset Flex Code
18571 status collapsed
18572
18573 \begin_layout Plain Layout
18574 Font
18575 \end_layout
18576
18577 \end_inset
18578
18579  declaration.
18580  (See 
18581 \begin_inset CommandInset ref
18582 LatexCommand ref
18583 reference "sub:Font-description"
18584
18585 \end_inset
18586
18587 .) The translation is mostly straightforward and obvious.
18588  For example, 
18589 \begin_inset Quotes eld
18590 \end_inset
18591
18592
18593 \begin_inset Flex Code
18594 status collapsed
18595
18596 \begin_layout Plain Layout
18597 Family Sans
18598 \end_layout
18599
18600 \end_inset
18601
18602
18603 \begin_inset Quotes erd
18604 \end_inset
18605
18606  becomes 
18607 \begin_inset Quotes eld
18608 \end_inset
18609
18610
18611 \begin_inset Flex Code
18612 status collapsed
18613
18614 \begin_layout Plain Layout
18615 font-family: sans-serif;
18616 \end_layout
18617
18618 \end_inset
18619
18620
18621 \begin_inset Quotes erd
18622 \end_inset
18623
18624 .
18625  The correspondence of LyX sizes and CSS sizes is a little less obvious
18626  but nonetheless intuitive.
18627  See the 
18628 \begin_inset Flex Code
18629 status collapsed
18630
18631 \begin_layout Plain Layout
18632 getSizeCSS()
18633 \end_layout
18634
18635 \end_inset
18636
18637  function in 
18638 \begin_inset Flex URL
18639 status collapsed
18640
18641 \begin_layout Plain Layout
18642
18643 src/FontInfo.cpp
18644 \end_layout
18645
18646 \end_inset
18647
18648  for the details.
18649  
18650 \end_layout
18651
18652 \begin_layout Chapter
18653 Including External Material
18654 \end_layout
18655
18656 \begin_layout Standard
18657 \begin_inset Box Shadowbox
18658 position "t"
18659 hor_pos "c"
18660 has_inner_box 1
18661 inner_pos "t"
18662 use_parbox 0
18663 use_makebox 0
18664 width "100col%"
18665 special "none"
18666 height "1in"
18667 height_special "totalheight"
18668 status open
18669
18670 \begin_layout Plain Layout
18671 WARNING: This portion of the documentation has not been updated for some
18672  time.
18673  We certainly hope that it is still accurate, but there are no guarantees.
18674 \end_layout
18675
18676 \end_inset
18677
18678
18679 \end_layout
18680
18681 \begin_layout Standard
18682 The use of material from sources external to LyX is covered in detail in
18683  the 
18684 \emph on
18685 Embedded Objects
18686 \emph default
18687  manual.
18688  This part of the manual covers what needs to happen behind the scenes for
18689  new sorts of material to be included.
18690 \end_layout
18691
18692 \begin_layout Section
18693 How does it work?
18694 \end_layout
18695
18696 \begin_layout Standard
18697 The external material feature is based on the concept of a 
18698 \emph on
18699 template
18700 \emph default
18701 .
18702  A template is a specification of how LyX should interface with a certain
18703  kind of material.
18704  As bundled, LyX comes with predefined templates for Xfig figures, various
18705  raster format images, chess diagrams, and LilyPond music notation.
18706  You can check the actual list by using the menu 
18707 \begin_inset Flex MenuItem
18708 status collapsed
18709
18710 \begin_layout Plain Layout
18711 Insert\SpecialChar \menuseparator
18712 File\SpecialChar \menuseparator
18713 External Material
18714 \end_layout
18715
18716 \end_inset
18717
18718 .
18719  Furthermore, it is possible to roll your own template to support a specific
18720  kind of material.
18721  Later we'll describe in more detail what is involved, and hopefully you
18722  will submit all the templates you create so we can include them in a later
18723  LyX version.
18724 \end_layout
18725
18726 \begin_layout Standard
18727 Another basic idea of the external material feature is to distinguish between
18728  the original file that serves as a base for final material and the produced
18729  file that is included in your exported or printed document.
18730  For example, consider the case of a figure produced with 
18731 \begin_inset Flex Code
18732 status collapsed
18733
18734 \begin_layout Plain Layout
18735 Xfig
18736 \end_layout
18737
18738 \end_inset
18739
18740 .
18741  The Xfig application itself works on an original file with the 
18742 \begin_inset Flex Code
18743 status collapsed
18744
18745 \begin_layout Plain Layout
18746 .fig
18747 \end_layout
18748
18749 \end_inset
18750
18751  extension.
18752  Within Xfig, you create and change your figure, and when you are done,
18753  you save the 
18754 \begin_inset Flex Code
18755 status collapsed
18756
18757 \begin_layout Plain Layout
18758 fig
18759 \end_layout
18760
18761 \end_inset
18762
18763 -file.
18764  When you want to include the figure in your document, you invoke 
18765 \begin_inset Flex Code
18766 status collapsed
18767
18768 \begin_layout Plain Layout
18769 transfig
18770 \end_layout
18771
18772 \end_inset
18773
18774  in order to create a PostScript file that can readily be included in your
18775  LaTeX file.
18776  In this case, the 
18777 \begin_inset Flex Code
18778 status collapsed
18779
18780 \begin_layout Plain Layout
18781 .fig
18782 \end_layout
18783
18784 \end_inset
18785
18786  file is the original file, and the PostScript file is the produced file.
18787 \end_layout
18788
18789 \begin_layout Standard
18790 This distinction is important in order to allow updating of the material
18791  while you are in the process of writing the document.
18792  Furthermore, it provides us with the flexibility that is needed to support
18793  multiple export formats.
18794  For instance, in the case of a plain text file, it is not exactly an award-winn
18795 ing idea to include the figure as raw PostScript.
18796  Instead, you'd either prefer to just include a reference to the figure
18797  or try to invoke some graphics to ASCII converter to make the final result
18798  look similar to the real graphics.
18799  The external material management allows you to do this, because it is parametri
18800 zed on the different export formats that LyX supports.
18801 \end_layout
18802
18803 \begin_layout Standard
18804 Besides supporting the production of different products according to the
18805  exported format, it supports tight integration with editing and viewing
18806  applications.
18807  In the case of an Xfig figure, you are able to invoke Xfig on the original
18808  file with a single click from within the external material dialog in LyX,
18809  and also preview the produced PostScript file with Ghostview with another
18810  click.
18811  No more fiddling around with the command line and/or file browsers to locate
18812  and manipulate the original or produced files.
18813  In this way, you are finally able to take full advantage of the many different
18814  applications that are relevant to use when you write your documents, and
18815  ultimately be more productive.
18816 \end_layout
18817
18818 \begin_layout Section
18819 The external template configuration file
18820 \end_layout
18821
18822 \begin_layout Standard
18823 It is relatively easy to add custom external template definitions to LyX.
18824  However, be aware that doing this in an careless manner most probably 
18825 \emph on
18826 will
18827 \emph default
18828  introduce an easily exploitable security hole.
18829  So before you do this, please read the discussion about security in section
18830  
18831 \begin_inset CommandInset ref
18832 LatexCommand ref
18833 reference "sec:Security-discussion"
18834
18835 \end_inset
18836
18837 .
18838 \end_layout
18839
18840 \begin_layout Standard
18841 Having said that, we encourage you to submit any interesting templates that
18842  you create.
18843  
18844 \end_layout
18845
18846 \begin_layout Standard
18847 The external templates are defined in the 
18848 \begin_inset Flex Code
18849 status collapsed
18850
18851 \begin_layout Plain Layout
18852 LyXDir/lib/external_templates
18853 \end_layout
18854
18855 \end_inset
18856
18857  file.
18858  You can place your own version in 
18859 \begin_inset Flex Code
18860 status collapsed
18861
18862 \begin_layout Plain Layout
18863 UserDir/external_templates
18864 \end_layout
18865
18866 \end_inset
18867
18868 .
18869 \end_layout
18870
18871 \begin_layout Standard
18872 A typical template looks like this:
18873 \end_layout
18874
18875 \begin_layout LyX-Code
18876 Template XFig
18877 \end_layout
18878
18879 \begin_layout LyX-Code
18880 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18881 \end_layout
18882
18883 \begin_layout LyX-Code
18884 HelpText
18885 \end_layout
18886
18887 \begin_layout LyX-Code
18888 An XFig figure.
18889 \end_layout
18890
18891 \begin_layout LyX-Code
18892 HelpTextEnd
18893 \end_layout
18894
18895 \begin_layout LyX-Code
18896 InputFormat fig
18897 \end_layout
18898
18899 \begin_layout LyX-Code
18900 FileFilter "*.fig"
18901 \end_layout
18902
18903 \begin_layout LyX-Code
18904 AutomaticProduction true
18905 \end_layout
18906
18907 \begin_layout LyX-Code
18908 Transform Rotate
18909 \end_layout
18910
18911 \begin_layout LyX-Code
18912 Transform Resize
18913 \end_layout
18914
18915 \begin_layout LyX-Code
18916 Format LaTeX
18917 \end_layout
18918
18919 \begin_layout LyX-Code
18920 TransformCommand Rotate RotationLatexCommand
18921 \end_layout
18922
18923 \begin_layout LyX-Code
18924 TransformCommand Resize ResizeLatexCommand
18925 \end_layout
18926
18927 \begin_layout LyX-Code
18928 Product "$$RotateFront$$ResizeFront
18929 \end_layout
18930
18931 \begin_layout LyX-Code
18932          
18933 \backslash
18934
18935 \backslash
18936 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18937 \end_layout
18938
18939 \begin_layout LyX-Code
18940          $$ResizeBack$$RotateBack"
18941 \end_layout
18942
18943 \begin_layout LyX-Code
18944 UpdateFormat pstex
18945 \end_layout
18946
18947 \begin_layout LyX-Code
18948 UpdateResult "$$AbsPath$$Basename.pstex_t"
18949 \end_layout
18950
18951 \begin_layout LyX-Code
18952 Requirement "graphicx"
18953 \end_layout
18954
18955 \begin_layout LyX-Code
18956 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18957 \end_layout
18958
18959 \begin_layout LyX-Code
18960 ReferencedFile latex "$$AbsPath$$Basename.eps"
18961 \end_layout
18962
18963 \begin_layout LyX-Code
18964 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18965 \end_layout
18966
18967 \begin_layout LyX-Code
18968 FormatEnd
18969 \end_layout
18970
18971 \begin_layout LyX-Code
18972 Format PDFLaTeX
18973 \end_layout
18974
18975 \begin_layout LyX-Code
18976 TransformCommand Rotate RotationLatexCommand
18977 \end_layout
18978
18979 \begin_layout LyX-Code
18980 TransformCommand Resize ResizeLatexCommand
18981 \end_layout
18982
18983 \begin_layout LyX-Code
18984 Product "$$RotateFront$$ResizeFront
18985 \end_layout
18986
18987 \begin_layout LyX-Code
18988          
18989 \backslash
18990
18991 \backslash
18992 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18993 \end_layout
18994
18995 \begin_layout LyX-Code
18996          $$ResizeBack$$RotateBack"
18997 \end_layout
18998
18999 \begin_layout LyX-Code
19000 UpdateFormat pdftex
19001 \end_layout
19002
19003 \begin_layout LyX-Code
19004 UpdateResult "$$AbsPath$$Basename.pdftex_t"
19005 \end_layout
19006
19007 \begin_layout LyX-Code
19008 Requirement "graphicx"
19009 \end_layout
19010
19011 \begin_layout LyX-Code
19012 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
19013 \end_layout
19014
19015 \begin_layout LyX-Code
19016 ReferencedFile latex "$$AbsPath$$Basename.pdf"
19017 \end_layout
19018
19019 \begin_layout LyX-Code
19020 FormatEnd
19021 \end_layout
19022
19023 \begin_layout LyX-Code
19024 Format Ascii
19025 \end_layout
19026
19027 \begin_layout LyX-Code
19028 Product "$$Contents(
19029 \backslash
19030 "$$AbsPath$$Basename.asc
19031 \backslash
19032 ")"
19033 \end_layout
19034
19035 \begin_layout LyX-Code
19036 UpdateFormat asciixfig
19037 \end_layout
19038
19039 \begin_layout LyX-Code
19040 UpdateResult "$$AbsPath$$Basename.asc"
19041 \end_layout
19042
19043 \begin_layout LyX-Code
19044 FormatEnd
19045 \end_layout
19046
19047 \begin_layout LyX-Code
19048 Format DocBook
19049 \end_layout
19050
19051 \begin_layout LyX-Code
19052 Product "<graphic fileref=
19053 \backslash
19054 "$$AbsOrRelPathMaster$$Basename.eps
19055 \backslash
19056 ">
19057 \end_layout
19058
19059 \begin_layout LyX-Code
19060          </graphic>"
19061 \end_layout
19062
19063 \begin_layout LyX-Code
19064 UpdateFormat eps
19065 \end_layout
19066
19067 \begin_layout LyX-Code
19068 UpdateResult "$$AbsPath$$Basename.eps"
19069 \end_layout
19070
19071 \begin_layout LyX-Code
19072 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19073 \end_layout
19074
19075 \begin_layout LyX-Code
19076 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19077 \end_layout
19078
19079 \begin_layout LyX-Code
19080 FormatEnd
19081 \end_layout
19082
19083 \begin_layout LyX-Code
19084 Product "[XFig: $$FName]"
19085 \end_layout
19086
19087 \begin_layout LyX-Code
19088 FormatEnd
19089 \end_layout
19090
19091 \begin_layout LyX-Code
19092 TemplateEnd
19093 \end_layout
19094
19095 \begin_layout Standard
19096 As you can see, the template is enclosed in 
19097 \begin_inset Flex Code
19098 status collapsed
19099
19100 \begin_layout Plain Layout
19101 Template
19102 \end_layout
19103
19104 \end_inset
19105
19106  \SpecialChar \ldots{}
19107  
19108 \begin_inset Flex Code
19109 status collapsed
19110
19111 \begin_layout Plain Layout
19112 TemplateEnd
19113 \end_layout
19114
19115 \end_inset
19116
19117 .
19118  It contains a header specifying some general settings and, for each supported
19119  primary document file format, a section 
19120 \begin_inset Flex Code
19121 status collapsed
19122
19123 \begin_layout Plain Layout
19124 Format
19125 \end_layout
19126
19127 \end_inset
19128
19129  \SpecialChar \ldots{}
19130  
19131 \begin_inset Flex Code
19132 status collapsed
19133
19134 \begin_layout Plain Layout
19135 FormatEnd
19136 \end_layout
19137
19138 \end_inset
19139
19140 .
19141 \end_layout
19142
19143 \begin_layout Subsection
19144 The template header
19145 \end_layout
19146
19147 \begin_layout Description
19148 \begin_inset Flex Code
19149 status collapsed
19150
19151 \begin_layout Plain Layout
19152 AutomaticProduction
19153 \begin_inset space ~
19154 \end_inset
19155
19156 true|false
19157 \end_layout
19158
19159 \end_inset
19160
19161  Whether the file represented by the template must be generated by LyX.
19162  This command must occur exactly once.
19163 \end_layout
19164
19165 \begin_layout Description
19166 \begin_inset Flex Code
19167 status collapsed
19168
19169 \begin_layout Plain Layout
19170 FileFilter
19171 \begin_inset space ~
19172 \end_inset
19173
19174 <pattern>
19175 \end_layout
19176
19177 \end_inset
19178
19179  A glob pattern that is used in the file dialog to filter out the desired
19180  files.
19181  If there is more than one possible file extension (e.
19182 \begin_inset space \thinspace{}
19183 \end_inset
19184
19185 g.
19186 \begin_inset space \space{}
19187 \end_inset
19188
19189 tgif has 
19190 \begin_inset Flex Code
19191 status collapsed
19192
19193 \begin_layout Plain Layout
19194 .obj
19195 \end_layout
19196
19197 \end_inset
19198
19199  and 
19200 \begin_inset Flex Code
19201 status collapsed
19202
19203 \begin_layout Plain Layout
19204 .tgo
19205 \end_layout
19206
19207 \end_inset
19208
19209 ), use something like 
19210 \begin_inset Flex Code
19211 status collapsed
19212
19213 \begin_layout Plain Layout
19214 "*.{obj,tgo}"
19215 \end_layout
19216
19217 \end_inset
19218
19219 .
19220  This command must occur exactly once.
19221 \end_layout
19222
19223 \begin_layout Description
19224 \begin_inset Flex Code
19225 status collapsed
19226
19227 \begin_layout Plain Layout
19228 GuiName
19229 \begin_inset space ~
19230 \end_inset
19231
19232 <guiname>
19233 \end_layout
19234
19235 \end_inset
19236
19237  The text that is displayed on the button.
19238  This command must occur exactly once.
19239 \end_layout
19240
19241 \begin_layout Description
19242 \begin_inset Flex Code
19243 status collapsed
19244
19245 \begin_layout Plain Layout
19246 HelpText
19247 \begin_inset space ~
19248 \end_inset
19249
19250 <text>
19251 \begin_inset space ~
19252 \end_inset
19253
19254 HelpTextEnd
19255 \end_layout
19256
19257 \end_inset
19258
19259  The help text that is used in the External dialog.
19260  Provide enough information to explain to the user just what the template
19261  can provide him with.
19262  This command must occur exactly once.
19263 \end_layout
19264
19265 \begin_layout Description
19266 \begin_inset Flex Code
19267 status collapsed
19268
19269 \begin_layout Plain Layout
19270 InputFormat
19271 \begin_inset space ~
19272 \end_inset
19273
19274 <format>
19275 \end_layout
19276
19277 \end_inset
19278
19279  The file format of the original file.
19280  This must be the name of a format that is known to LyX (see section
19281 \begin_inset space ~
19282 \end_inset
19283
19284
19285 \begin_inset CommandInset ref
19286 LatexCommand ref
19287 reference "sec:Formats"
19288
19289 \end_inset
19290
19291 ).
19292  Use 
19293 \begin_inset Quotes eld
19294 \end_inset
19295
19296
19297 \begin_inset Flex Code
19298 status collapsed
19299
19300 \begin_layout Plain Layout
19301 *
19302 \end_layout
19303
19304 \end_inset
19305
19306
19307 \begin_inset Quotes erd
19308 \end_inset
19309
19310  if the template can handle original files of more than one format.
19311  LyX will attempt to interrogate the file itself in order to deduce its
19312  format in this case.
19313  This command must occur exactly once.
19314 \end_layout
19315
19316 \begin_layout Description
19317 \begin_inset Flex Code
19318 status collapsed
19319
19320 \begin_layout Plain Layout
19321 Template
19322 \begin_inset space ~
19323 \end_inset
19324
19325 <id>
19326 \end_layout
19327
19328 \end_inset
19329
19330  A unique name for the template.
19331  It must not contain substitution macros (see below).
19332 \end_layout
19333
19334 \begin_layout Description
19335 \begin_inset Flex Code
19336 status collapsed
19337
19338 \begin_layout Plain Layout
19339 Transform
19340 \begin_inset space ~
19341 \end_inset
19342
19343 Rotate|Resize|Clip|Extra
19344 \end_layout
19345
19346 \end_inset
19347
19348  This command specifies which transformations are supported by this template.
19349  It may occur zero or more times.
19350  This command enables the corresponding tabs in the external dialog.
19351  Each 
19352 \begin_inset Flex Code
19353 status collapsed
19354
19355 \begin_layout Plain Layout
19356 Transform
19357 \end_layout
19358
19359 \end_inset
19360
19361  command must have either a corresponding 
19362 \begin_inset Flex Code
19363 status collapsed
19364
19365 \begin_layout Plain Layout
19366 TransformCommand
19367 \end_layout
19368
19369 \end_inset
19370
19371  or a 
19372 \begin_inset Flex Code
19373 status collapsed
19374
19375 \begin_layout Plain Layout
19376 TransformOption
19377 \end_layout
19378
19379 \end_inset
19380
19381  command in the 
19382 \begin_inset Flex Code
19383 status collapsed
19384
19385 \begin_layout Plain Layout
19386 Format
19387 \end_layout
19388
19389 \end_inset
19390
19391  section.
19392  Otherwise the transformation will not be supported by that format.
19393 \end_layout
19394
19395 \begin_layout Subsection
19396 The Format section
19397 \end_layout
19398
19399 \begin_layout Description
19400 \begin_inset Flex Code
19401 status collapsed
19402
19403 \begin_layout Plain Layout
19404 Format
19405 \begin_inset space ~
19406 \end_inset
19407
19408 LaTeX|PDFLaTeX|PlainText|DocBook
19409 \end_layout
19410
19411 \end_inset
19412
19413  The primary document file format that this format definition is for.
19414  Not every template has a sensible representation in all document file formats.
19415  Please define nevertheless a 
19416 \begin_inset Flex Code
19417 status collapsed
19418
19419 \begin_layout Plain Layout
19420 Format
19421 \end_layout
19422
19423 \end_inset
19424
19425  section for all templates.
19426  Use a dummy text when no representation is available.
19427  Then you can at least see a reference to the external material in the exported
19428  document.
19429 \end_layout
19430
19431 \begin_layout Description
19432 \begin_inset Flex Code
19433 status collapsed
19434
19435 \begin_layout Plain Layout
19436 Option
19437 \begin_inset space ~
19438 \end_inset
19439
19440 <name>
19441 \begin_inset space ~
19442 \end_inset
19443
19444 <value>
19445 \end_layout
19446
19447 \end_inset
19448
19449  This command defines an additional macro 
19450 \begin_inset Flex Code
19451 status collapsed
19452
19453 \begin_layout Plain Layout
19454 $$<name>
19455 \end_layout
19456
19457 \end_inset
19458
19459  for substitution in 
19460 \begin_inset Flex Code
19461 status collapsed
19462
19463 \begin_layout Plain Layout
19464 Product
19465 \end_layout
19466
19467 \end_inset
19468
19469 .
19470  
19471 \begin_inset Flex Code
19472 status collapsed
19473
19474 \begin_layout Plain Layout
19475 <value>
19476 \end_layout
19477
19478 \end_inset
19479
19480  itself may contain substitution macros.
19481  The advantage over using 
19482 \begin_inset Flex Code
19483 status collapsed
19484
19485 \begin_layout Plain Layout
19486 <value>
19487 \end_layout
19488
19489 \end_inset
19490
19491  directly in 
19492 \begin_inset Flex Code
19493 status collapsed
19494
19495 \begin_layout Plain Layout
19496 Product
19497 \end_layout
19498
19499 \end_inset
19500
19501  is that the substituted value of 
19502 \begin_inset Flex Code
19503 status collapsed
19504
19505 \begin_layout Plain Layout
19506 $$<name>
19507 \end_layout
19508
19509 \end_inset
19510
19511  is sanitized so that it is a valid optional argument in the document format.
19512  This command may occur zero or more times.
19513 \end_layout
19514
19515 \begin_layout Description
19516 \begin_inset Flex Code
19517 status collapsed
19518
19519 \begin_layout Plain Layout
19520 Product
19521 \begin_inset space ~
19522 \end_inset
19523
19524 <text>
19525 \end_layout
19526
19527 \end_inset
19528
19529  The text that is inserted in the exported document.
19530  This is actually the most important command and can be quite complex.
19531  This command must occur exactly once.
19532 \end_layout
19533
19534 \begin_layout Description
19535 \begin_inset Flex Code
19536 status collapsed
19537
19538 \begin_layout Plain Layout
19539 Preamble
19540 \begin_inset space ~
19541 \end_inset
19542
19543 <name>
19544 \end_layout
19545
19546 \end_inset
19547
19548  This command specifies a preamble snippet that will be included in the
19549  LaTeX preamble.
19550  It has to be defined using 
19551 \begin_inset Flex Code
19552 status collapsed
19553
19554 \begin_layout Plain Layout
19555 PreambleDef
19556 \end_layout
19557
19558 \end_inset
19559
19560  \SpecialChar \ldots{}
19561  
19562 \begin_inset Flex Code
19563 status collapsed
19564
19565 \begin_layout Plain Layout
19566 PreambleDefEnd
19567 \end_layout
19568
19569 \end_inset
19570
19571 .
19572  This command may occur zero or more times.
19573 \end_layout
19574
19575 \begin_layout Description
19576 \begin_inset Flex Code
19577 status collapsed
19578
19579 \begin_layout Plain Layout
19580 ReferencedFile
19581 \begin_inset space ~
19582 \end_inset
19583
19584 <format>
19585 \begin_inset space ~
19586 \end_inset
19587
19588 <filename>
19589 \end_layout
19590
19591 \end_inset
19592
19593  This command denotes files that are created by the conversion process and
19594  are needed for a particular export format.
19595  If the filename is relative, it is interpreted relative to the master document.
19596  This command may be given zero or more times.
19597 \end_layout
19598
19599 \begin_layout Description
19600 \begin_inset Flex Code
19601 status collapsed
19602
19603 \begin_layout Plain Layout
19604 Requirement
19605 \begin_inset space ~
19606 \end_inset
19607
19608 <package>
19609 \end_layout
19610
19611 \end_inset
19612
19613  The name of a required LaTeX package.
19614  The package is included via 
19615 \begin_inset Flex Code
19616 status collapsed
19617
19618 \begin_layout Plain Layout
19619
19620 \backslash
19621 usepackage{}
19622 \end_layout
19623
19624 \end_inset
19625
19626  in the LaTeX preamble.
19627  This command may occur zero or more times.
19628 \end_layout
19629
19630 \begin_layout Description
19631 \begin_inset Flex Code
19632 status collapsed
19633
19634 \begin_layout Plain Layout
19635 TransformCommand
19636 \begin_inset space ~
19637 \end_inset
19638
19639 Rotate
19640 \begin_inset space ~
19641 \end_inset
19642
19643 RotationLatexCommand
19644 \end_layout
19645
19646 \end_inset
19647
19648  This command specifies that the built in LaTeX command should be used for
19649  rotation.
19650  This command may occur once or not at all.
19651 \end_layout
19652
19653 \begin_layout Description
19654 \begin_inset Flex Code
19655 status collapsed
19656
19657 \begin_layout Plain Layout
19658 TransformCommand
19659 \begin_inset space ~
19660 \end_inset
19661
19662 Resize
19663 \begin_inset space ~
19664 \end_inset
19665
19666 ResizeLatexCommand
19667 \end_layout
19668
19669 \end_inset
19670
19671  This command specifies that the built in LaTeX command should be used for
19672  resizing.
19673  This command may occur once or not at all.
19674 \end_layout
19675
19676 \begin_layout Description
19677 \begin_inset Flex Code
19678 status collapsed
19679
19680 \begin_layout Plain Layout
19681 TransformOption
19682 \begin_inset space ~
19683 \end_inset
19684
19685 Rotate
19686 \begin_inset space ~
19687 \end_inset
19688
19689 RotationLatexOption
19690 \end_layout
19691
19692 \end_inset
19693
19694  This command specifies that rotation is done via an optional argument.
19695  This command may occur once or not at all.
19696 \end_layout
19697
19698 \begin_layout Description
19699 \begin_inset Flex Code
19700 status collapsed
19701
19702 \begin_layout Plain Layout
19703 TransformOption
19704 \begin_inset space ~
19705 \end_inset
19706
19707 Resize
19708 \begin_inset space ~
19709 \end_inset
19710
19711 ResizeLatexOption
19712 \end_layout
19713
19714 \end_inset
19715
19716  This command specifies that resizing is done via an optional argument.
19717  This command may occur once or not at all.
19718 \end_layout
19719
19720 \begin_layout Description
19721 \begin_inset Flex Code
19722 status collapsed
19723
19724 \begin_layout Plain Layout
19725 TransformOption
19726 \begin_inset space ~
19727 \end_inset
19728
19729 Clip
19730 \begin_inset space ~
19731 \end_inset
19732
19733 ClipLatexOption
19734 \end_layout
19735
19736 \end_inset
19737
19738  This command specifies that clipping is done via an optional argument.
19739  This command may occur once or not at all.
19740 \end_layout
19741
19742 \begin_layout Description
19743 \begin_inset Flex Code
19744 status collapsed
19745
19746 \begin_layout Plain Layout
19747 TransformOption
19748 \begin_inset space ~
19749 \end_inset
19750
19751 Extra
19752 \begin_inset space ~
19753 \end_inset
19754
19755 ExtraLatexOption
19756 \end_layout
19757
19758 \end_inset
19759
19760  This command specifies that an extra optional argument is used.
19761  This command may occur once or not at all.
19762 \end_layout
19763
19764 \begin_layout Description
19765 \begin_inset Flex Code
19766 status collapsed
19767
19768 \begin_layout Plain Layout
19769 UpdateFormat
19770 \begin_inset space ~
19771 \end_inset
19772
19773 <format>
19774 \end_layout
19775
19776 \end_inset
19777
19778  The file format of the converted file.
19779  This must be the name of a format that is known to LyX (see the 
19780 \begin_inset Flex MenuItem
19781 status collapsed
19782
19783 \begin_layout Plain Layout
19784
19785 \bar under
19786 T
19787 \bar default
19788 ools\SpecialChar \menuseparator
19789
19790 \bar under
19791 P
19792 \bar default
19793 references\SpecialChar \menuseparator
19794 File Handling\SpecialChar \menuseparator
19795 File Format
19796 \end_layout
19797
19798 \end_inset
19799
19800  dialog).
19801  This command must occur exactly once.
19802 \end_layout
19803
19804 \begin_layout Description
19805 \begin_inset Flex Code
19806 status collapsed
19807
19808 \begin_layout Plain Layout
19809 UpdateResult
19810 \begin_inset space ~
19811 \end_inset
19812
19813 <filename>
19814 \end_layout
19815
19816 \end_inset
19817
19818  The file name of the converted file.
19819  The file name must be absolute.
19820  This command must occur exactly once.
19821 \end_layout
19822
19823 \begin_layout Subsection
19824 Preamble definitions
19825 \end_layout
19826
19827 \begin_layout Standard
19828 The external template configuration file may contain additional preamble
19829  definitions enclosed by 
19830 \begin_inset Flex Code
19831 status collapsed
19832
19833 \begin_layout Plain Layout
19834 PreambleDef
19835 \end_layout
19836
19837 \end_inset
19838
19839  \SpecialChar \ldots{}
19840  
19841 \begin_inset Flex Code
19842 status collapsed
19843
19844 \begin_layout Plain Layout
19845 PreambleDefEnd
19846 \end_layout
19847
19848 \end_inset
19849
19850 .
19851  They can be used by the templates in the 
19852 \begin_inset Flex Code
19853 status collapsed
19854
19855 \begin_layout Plain Layout
19856 Format
19857 \end_layout
19858
19859 \end_inset
19860
19861  section.
19862 \end_layout
19863
19864 \begin_layout Section
19865 The substitution mechanism
19866 \end_layout
19867
19868 \begin_layout Standard
19869 When the external material facility invokes an external program, it is done
19870  on the basis of a command defined in the template configuration file.
19871  These commands can contain various macros that are expanded before execution.
19872  Execution always take place in the directory of the containing document.
19873 \end_layout
19874
19875 \begin_layout Standard
19876 Also, whenever external material is to be displayed, the name will be produced
19877  by the substitution mechanism, and most other commands in the template
19878  definition support substitution as well.
19879 \end_layout
19880
19881 \begin_layout Standard
19882 The available macros are the following:
19883 \end_layout
19884
19885 \begin_layout Description
19886 \begin_inset Flex Code
19887 status collapsed
19888
19889 \begin_layout Plain Layout
19890 $$AbsOrRelPathMaster
19891 \end_layout
19892
19893 \end_inset
19894
19895  The file path, absolute or relative to the master LyX document.
19896 \end_layout
19897
19898 \begin_layout Description
19899 \begin_inset Flex Code
19900 status collapsed
19901
19902 \begin_layout Plain Layout
19903 $$AbsOrRelPathParent
19904 \end_layout
19905
19906 \end_inset
19907
19908  The file path, absolute or relative to the LyX document.
19909 \end_layout
19910
19911 \begin_layout Description
19912 \begin_inset Flex Code
19913 status collapsed
19914
19915 \begin_layout Plain Layout
19916 $$AbsPath
19917 \end_layout
19918
19919 \end_inset
19920
19921  The absolute file path.
19922 \end_layout
19923
19924 \begin_layout Description
19925 \begin_inset Flex Code
19926 status collapsed
19927
19928 \begin_layout Plain Layout
19929 $$Basename
19930 \end_layout
19931
19932 \end_inset
19933
19934  The filename without path and without the extension.
19935 \end_layout
19936
19937 \begin_layout Description
19938 \begin_inset Flex Code
19939 status collapsed
19940
19941 \begin_layout Plain Layout
19942 $$Contents(
19943 \begin_inset Quotes eld
19944 \end_inset
19945
19946 filename.ext
19947 \begin_inset Quotes erd
19948 \end_inset
19949
19950 )
19951 \end_layout
19952
19953 \end_inset
19954
19955  This macro will expand to the contents of the file with the name 
19956 \begin_inset Flex Code
19957 status collapsed
19958
19959 \begin_layout Plain Layout
19960 filename.ext
19961 \end_layout
19962
19963 \end_inset
19964
19965 .
19966 \end_layout
19967
19968 \begin_layout Description
19969 \begin_inset Flex Code
19970 status collapsed
19971
19972 \begin_layout Plain Layout
19973 $$Extension
19974 \end_layout
19975
19976 \end_inset
19977
19978  The file extension (including the dot).
19979 \end_layout
19980
19981 \begin_layout Description
19982 \begin_inset Flex Code
19983 status collapsed
19984
19985 \begin_layout Plain Layout
19986 $$FName
19987 \end_layout
19988
19989 \end_inset
19990
19991  The filename of the file specified in the external material dialog.
19992  This is either an absolute name, or it is relative to the 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 $$FPath
20001 \end_layout
20002
20003 \end_inset
20004
20005  The path part of 
20006 \begin_inset Flex Code
20007 status collapsed
20008
20009 \begin_layout Plain Layout
20010 $$FName
20011 \end_layout
20012
20013 \end_inset
20014
20015  (absolute name or relative to the LyX document).
20016 \end_layout
20017
20018 \begin_layout Description
20019 \begin_inset Flex Code
20020 status collapsed
20021
20022 \begin_layout Plain Layout
20023 $$RelPathMaster
20024 \end_layout
20025
20026 \end_inset
20027
20028  The file path, relative to the master LyX document.
20029 \end_layout
20030
20031 \begin_layout Description
20032 \begin_inset Flex Code
20033 status collapsed
20034
20035 \begin_layout Plain Layout
20036 $$RelPathParent
20037 \end_layout
20038
20039 \end_inset
20040
20041  The file path, relative to the LyX document.
20042 \end_layout
20043
20044 \begin_layout Description
20045 \begin_inset Flex Code
20046 status collapsed
20047
20048 \begin_layout Plain Layout
20049 $$Sysdir
20050 \end_layout
20051
20052 \end_inset
20053
20054  This macro will expand to the absolute path of the system directory.
20055  This is typically used to point to the various helper scripts that are
20056  bundled with LyX.
20057 \end_layout
20058
20059 \begin_layout Description
20060 \begin_inset Flex Code
20061 status collapsed
20062
20063 \begin_layout Plain Layout
20064 $$Tempname
20065 \end_layout
20066
20067 \end_inset
20068
20069  A name and full path to a temporary file which will be automatically deleted
20070  whenever the containing document is closed, or the external material insertion
20071  deleted.
20072 \end_layout
20073
20074 \begin_layout Standard
20075 All path macros contain a trailing directory separator, so you can construct
20076  e.
20077 \begin_inset space \thinspace{}
20078 \end_inset
20079
20080 g.
20081 \begin_inset space \space{}
20082 \end_inset
20083
20084 the absolute filename with 
20085 \begin_inset Flex Code
20086 status collapsed
20087
20088 \begin_layout Plain Layout
20089 $$AbsPath$$Basename$$Extension
20090 \end_layout
20091
20092 \end_inset
20093
20094 .
20095 \end_layout
20096
20097 \begin_layout Standard
20098 The macros above are substituted in all commands unless otherwise noted.
20099  The command 
20100 \begin_inset Flex Code
20101 status collapsed
20102
20103 \begin_layout Plain Layout
20104 Product
20105 \end_layout
20106
20107 \end_inset
20108
20109  supports additionally the following substitutions if they are enabled by
20110  the 
20111 \begin_inset Flex Code
20112 status collapsed
20113
20114 \begin_layout Plain Layout
20115 Transform
20116 \end_layout
20117
20118 \end_inset
20119
20120  and 
20121 \begin_inset Flex Code
20122 status collapsed
20123
20124 \begin_layout Plain Layout
20125 TransformCommand
20126 \end_layout
20127
20128 \end_inset
20129
20130  commands:
20131 \end_layout
20132
20133 \begin_layout Description
20134 \begin_inset Flex Code
20135 status collapsed
20136
20137 \begin_layout Plain Layout
20138 $$ResizeFront
20139 \end_layout
20140
20141 \end_inset
20142
20143  The front part of the resize command.
20144 \end_layout
20145
20146 \begin_layout Description
20147 \begin_inset Flex Code
20148 status collapsed
20149
20150 \begin_layout Plain Layout
20151 $$ResizeBack
20152 \end_layout
20153
20154 \end_inset
20155
20156  The back part of the resize command.
20157 \end_layout
20158
20159 \begin_layout Description
20160 \begin_inset Flex Code
20161 status collapsed
20162
20163 \begin_layout Plain Layout
20164 $$RotateFront
20165 \end_layout
20166
20167 \end_inset
20168
20169  The front part of the rotation command.
20170 \end_layout
20171
20172 \begin_layout Description
20173 \begin_inset Flex Code
20174 status collapsed
20175
20176 \begin_layout Plain Layout
20177 $$RotateBack
20178 \end_layout
20179
20180 \end_inset
20181
20182  The back part of the rotation command.
20183 \end_layout
20184
20185 \begin_layout Standard
20186 The value string of the 
20187 \begin_inset Flex Code
20188 status collapsed
20189
20190 \begin_layout Plain Layout
20191 Option
20192 \end_layout
20193
20194 \end_inset
20195
20196  command supports additionally the following substitutions if they are enabled
20197  by the 
20198 \begin_inset Flex Code
20199 status collapsed
20200
20201 \begin_layout Plain Layout
20202 Transform
20203 \end_layout
20204
20205 \end_inset
20206
20207  and 
20208 \begin_inset Flex Code
20209 status collapsed
20210
20211 \begin_layout Plain Layout
20212 TransformOption
20213 \end_layout
20214
20215 \end_inset
20216
20217  commands:
20218 \end_layout
20219
20220 \begin_layout Description
20221 \begin_inset Flex Code
20222 status collapsed
20223
20224 \begin_layout Plain Layout
20225 $$Clip
20226 \end_layout
20227
20228 \end_inset
20229
20230  The clip option.
20231 \end_layout
20232
20233 \begin_layout Description
20234 \begin_inset Flex Code
20235 status collapsed
20236
20237 \begin_layout Plain Layout
20238 $$Extra
20239 \end_layout
20240
20241 \end_inset
20242
20243  The extra option.
20244 \end_layout
20245
20246 \begin_layout Description
20247 \begin_inset Flex Code
20248 status collapsed
20249
20250 \begin_layout Plain Layout
20251 $$Resize
20252 \end_layout
20253
20254 \end_inset
20255
20256  The resize option.
20257 \end_layout
20258
20259 \begin_layout Description
20260 \begin_inset Flex Code
20261 status collapsed
20262
20263 \begin_layout Plain Layout
20264 $$Rotate
20265 \end_layout
20266
20267 \end_inset
20268
20269  The rotation option.
20270 \end_layout
20271
20272 \begin_layout Standard
20273 You may ask why there are so many path macros.
20274  There are mainly two reasons:
20275 \end_layout
20276
20277 \begin_layout Enumerate
20278 Relative and absolute file names should remain relative or absolute, respectivel
20279 y.
20280  Users may have reasons to prefer either form.
20281  Relative names are useful for portable documents that should work on different
20282  machines, for example.
20283  Absolute names may be required by some programs.
20284 \end_layout
20285
20286 \begin_layout Enumerate
20287 LaTeX treats relative file names differently than LyX and other programs
20288  in nested included files.
20289  For LyX, a relative file name is always relative to the document that contains
20290  the file name.
20291  For LaTeX, it is always relative to the master document.
20292  These two definitions are identical if you have only one document, but
20293  differ if you have a master document that includes part documents.
20294  That means that relative filenames must be transformed when presented to
20295  LaTeX.
20296  Fortunately LyX does this automatically for you if you choose the right
20297  macros.
20298 \end_layout
20299
20300 \begin_layout Standard
20301 So which path macro should be used in new template definitions? The rule
20302  is not difficult:
20303 \end_layout
20304
20305 \begin_layout Itemize
20306 Use 
20307 \begin_inset Flex Code
20308 status collapsed
20309
20310 \begin_layout Plain Layout
20311 $$AbsPath
20312 \end_layout
20313
20314 \end_inset
20315
20316  if an absolute path is required.
20317 \end_layout
20318
20319 \begin_layout Itemize
20320 Use 
20321 \begin_inset Flex Code
20322 status collapsed
20323
20324 \begin_layout Plain Layout
20325 $$AbsOrRelPathMaster
20326 \end_layout
20327
20328 \end_inset
20329
20330  if the substituted string is some kind of LaTeX input.
20331 \end_layout
20332
20333 \begin_layout Itemize
20334 Else use 
20335 \begin_inset Flex Code
20336 status collapsed
20337
20338 \begin_layout Plain Layout
20339 $$AbsOrRelPathParent
20340 \end_layout
20341
20342 \end_inset
20343
20344  in order to preserve the user's choice.
20345 \end_layout
20346
20347 \begin_layout Standard
20348 There are special cases where this rule does not work and e.
20349 \begin_inset space \thinspace{}
20350 \end_inset
20351
20352 g.
20353 \begin_inset space \space{}
20354 \end_inset
20355
20356 relative names are needed, but normally it will work just fine.
20357  One example for such a case is the command 
20358 \begin_inset Flex Code
20359 status collapsed
20360
20361 \begin_layout Plain Layout
20362 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20363 \end_layout
20364
20365 \end_inset
20366
20367  in the XFig template above: We can't use the absolute name because the
20368  copier for 
20369 \begin_inset Flex Code
20370 status collapsed
20371
20372 \begin_layout Plain Layout
20373 .pstex_t
20374 \end_layout
20375
20376 \end_inset
20377
20378  files needs the relative name in order to rewrite the file content.
20379 \end_layout
20380
20381 \begin_layout Section
20382 Security discussion
20383 \begin_inset CommandInset label
20384 LatexCommand label
20385 name "sec:Security-discussion"
20386
20387 \end_inset
20388
20389
20390 \end_layout
20391
20392 \begin_layout Standard
20393 The external material feature interfaces with a lot of external programs
20394  and does so automatically, so we have to consider the security implications
20395  of this.
20396  In particular, since you have the option of including your own filenames
20397  and/or parameter strings and those are expanded into a command, it seems
20398  that it would be possible to create a malicious document which executes
20399  arbitrary commands when a user views or prints the document.
20400  This is something we definitely want to avoid.
20401 \end_layout
20402
20403 \begin_layout Standard
20404 However, since the external program commands are specified in the template
20405  configuration file only, there are no security issues if LyX is properly
20406  configured with safe templates only.
20407  This is so because the external programs are invoked with the 
20408 \begin_inset Flex Code
20409 status collapsed
20410
20411 \begin_layout Plain Layout
20412 execvp
20413 \end_layout
20414
20415 \end_inset
20416
20417 -system call rather than the 
20418 \begin_inset Flex Code
20419 status collapsed
20420
20421 \begin_layout Plain Layout
20422 system
20423 \end_layout
20424
20425 \end_inset
20426
20427  system-call, so it's not possible to execute arbitrary commands from the
20428  filename or parameter section via the shell.
20429 \end_layout
20430
20431 \begin_layout Standard
20432 This also implies that you are restricted in what command strings you can
20433  use in the external material templates.
20434  In particular, pipes and redirection are not readily available.
20435  This has to be so if LyX should remain safe.
20436  If you want to use some of the shell features, you should write a safe
20437  script to do this in a controlled manner, and then invoke the script from
20438  the command string.
20439  
20440 \end_layout
20441
20442 \begin_layout Standard
20443 It is possible to design a template that interacts directly with the shell,
20444  but since this would allow a malicious user to execute arbitrary commands
20445  by writing clever filenames and/or parameters, we generally recommend that
20446  you only use safe scripts that work with the 
20447 \begin_inset Flex Code
20448 status collapsed
20449
20450 \begin_layout Plain Layout
20451 execvp
20452 \end_layout
20453
20454 \end_inset
20455
20456  system call in a controlled manner.
20457  Of course, for use in a controlled environment, it can be tempting to just
20458  fall back to use ordinary shell scripts.
20459  If you do so, be aware that you 
20460 \emph on
20461 will
20462 \emph default
20463  provide an easily exploitable security hole in your system.
20464  Of course it stands to reason that such unsafe templates will never be
20465  included in the standard LyX distribution, although we do encourage people
20466  to submit new templates in the open source tradition.
20467  But LyX as shipped from the official distribution channels will never have
20468  unsafe templates.
20469 \end_layout
20470
20471 \begin_layout Standard
20472 Including external material provides a lot of power, and you have to be
20473  careful not to introduce security hazards with this power.
20474  A subtle error in a single line in an innocent looking script can open
20475  the door to huge security problems.
20476  So if you do not fully understand the issues, we recommend that you consult
20477  a knowledgeable security professional or the LyX development team if you
20478  have any questions about whether a given template is safe or not.
20479  And do this before you use it in an uncontrolled environment.
20480 \end_layout
20481
20482 \end_body
20483 \end_document