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