]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
Acknowledgments.lyx: fix a typo
[lyx.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 AddToPreamble
7820 \end_layout
7821
7822 \end_inset
7823
7824  Adds information to the document preamble.
7825  Must end with 
7826 \begin_inset Quotes eld
7827 \end_inset
7828
7829
7830 \begin_inset Flex Code
7831 status collapsed
7832
7833 \begin_layout Plain Layout
7834 EndPreamble
7835 \end_layout
7836
7837 \end_inset
7838
7839
7840 \begin_inset Quotes erd
7841 \end_inset
7842
7843 .
7844 \end_layout
7845
7846 \begin_layout Description
7847 \begin_inset Flex Code
7848 status collapsed
7849
7850 \begin_layout Plain Layout
7851 CiteFormat
7852 \end_layout
7853
7854 \end_inset
7855
7856  Defines formats for use in the display of bibliographic information.
7857  See Section 
7858 \begin_inset CommandInset ref
7859 LatexCommand ref
7860 reference "sub:Citation-format-description"
7861
7862 \end_inset
7863
7864  for details.
7865  Must end with 
7866 \begin_inset Quotes eld
7867 \end_inset
7868
7869
7870 \begin_inset Flex Code
7871 status collapsed
7872
7873 \begin_layout Plain Layout
7874 End
7875 \end_layout
7876
7877 \end_inset
7878
7879
7880 \begin_inset Quotes erd
7881 \end_inset
7882
7883 .
7884 \end_layout
7885
7886 \begin_layout Description
7887 \begin_inset Flex Code
7888 status collapsed
7889
7890 \begin_layout Plain Layout
7891 ClassOptions
7892 \end_layout
7893
7894 \end_inset
7895
7896  Describes various global options supported by the document class.
7897  See Section
7898 \begin_inset space ~
7899 \end_inset
7900
7901
7902 \begin_inset CommandInset ref
7903 LatexCommand ref
7904 reference "sub:ClassOptions"
7905
7906 \end_inset
7907
7908  for a description.
7909  Must end with 
7910 \begin_inset Quotes eld
7911 \end_inset
7912
7913
7914 \begin_inset Flex Code
7915 status collapsed
7916
7917 \begin_layout Plain Layout
7918 End
7919 \end_layout
7920
7921 \end_inset
7922
7923
7924 \begin_inset Quotes erd
7925 \end_inset
7926
7927 .
7928 \end_layout
7929
7930 \begin_layout Description
7931 \begin_inset Flex Code
7932 status collapsed
7933
7934 \begin_layout Plain Layout
7935 Columns
7936 \end_layout
7937
7938 \end_inset
7939
7940  [
7941 \begin_inset Flex Code
7942 status collapsed
7943
7944 \begin_layout Plain Layout
7945
7946 \emph on
7947 1
7948 \end_layout
7949
7950 \end_inset
7951
7952
7953 \begin_inset Flex Code
7954 status collapsed
7955
7956 \begin_layout Plain Layout
7957 2
7958 \end_layout
7959
7960 \end_inset
7961
7962 ] Whether the class should 
7963 \emph on
7964 default
7965 \emph default
7966  to having one or two columns.
7967  Can be changed in the 
7968 \begin_inset Flex MenuItem
7969 status collapsed
7970
7971 \begin_layout Plain Layout
7972 Document\SpecialChar \menuseparator
7973 Settings
7974 \end_layout
7975
7976 \end_inset
7977
7978  dialog.
7979 \end_layout
7980
7981 \begin_layout Description
7982 \begin_inset Flex Code
7983 status collapsed
7984
7985 \begin_layout Plain Layout
7986 Counter
7987 \end_layout
7988
7989 \end_inset
7990
7991  [
7992 \begin_inset Flex Code
7993 status collapsed
7994
7995 \begin_layout Plain Layout
7996 string
7997 \end_layout
7998
7999 \end_inset
8000
8001 ] This sequence defines the properties for a counter.
8002  If the counter does not yet exist, it is created; if it does exist, it
8003  is modified.
8004  Must end with 
8005 \begin_inset Quotes eld
8006 \end_inset
8007
8008
8009 \begin_inset Flex Code
8010 status collapsed
8011
8012 \begin_layout Plain Layout
8013 End
8014 \end_layout
8015
8016 \end_inset
8017
8018
8019 \begin_inset Quotes erd
8020 \end_inset
8021
8022 .
8023 \begin_inset Newline newline
8024 \end_inset
8025
8026 See Section
8027 \begin_inset space ~
8028 \end_inset
8029
8030
8031 \begin_inset CommandInset ref
8032 LatexCommand ref
8033 reference "sub:Counters"
8034
8035 \end_inset
8036
8037  for details on counters.
8038 \end_layout
8039
8040 \begin_layout Description
8041 \begin_inset Flex Code
8042 status collapsed
8043
8044 \begin_layout Plain Layout
8045 DefaultFont
8046 \end_layout
8047
8048 \end_inset
8049
8050  Sets the default font used to display the document.
8051  See Section
8052 \begin_inset space ~
8053 \end_inset
8054
8055
8056 \begin_inset CommandInset ref
8057 LatexCommand ref
8058 reference "sub:Font-description"
8059
8060 \end_inset
8061
8062  for how to declare fonts.
8063  Must end with 
8064 \begin_inset Quotes eld
8065 \end_inset
8066
8067
8068 \begin_inset Flex Code
8069 status collapsed
8070
8071 \begin_layout Plain Layout
8072 EndFont
8073 \end_layout
8074
8075 \end_inset
8076
8077
8078 \begin_inset Quotes erd
8079 \end_inset
8080
8081 .
8082 \end_layout
8083
8084 \begin_layout Description
8085 \begin_inset Flex Code
8086 status collapsed
8087
8088 \begin_layout Plain Layout
8089 DefaultModule
8090 \end_layout
8091
8092 \end_inset
8093
8094  [
8095 \begin_inset Flex Code
8096 status collapsed
8097
8098 \begin_layout Plain Layout
8099 string]
8100 \end_layout
8101
8102 \end_inset
8103
8104  Specifies a module to be included by default with this document class.
8105  The module should be specified by filename without the 
8106 \begin_inset Flex Code
8107 status collapsed
8108
8109 \begin_layout Plain Layout
8110 .module
8111 \end_layout
8112
8113 \end_inset
8114
8115  extension.
8116  The user can still remove the module, but it will be active at the outset.
8117  (This applies only when new files are created, or when this class is chosen
8118  for an existing document.)
8119 \end_layout
8120
8121 \begin_layout Description
8122 \begin_inset Flex Code
8123 status collapsed
8124
8125 \begin_layout Plain Layout
8126 DefaultStyle
8127 \end_layout
8128
8129 \end_inset
8130
8131  [
8132 \begin_inset Flex Code
8133 status collapsed
8134
8135 \begin_layout Plain Layout
8136 string
8137 \end_layout
8138
8139 \end_inset
8140
8141 ] This is the style that will be assigned to new paragraphs, usually 
8142 \begin_inset Flex MenuItem
8143 status collapsed
8144
8145 \begin_layout Plain Layout
8146 Standard
8147 \end_layout
8148
8149 \end_inset
8150
8151 .
8152  This will default to the first defined style if not given, but you are
8153  encouraged to use this directive.
8154 \end_layout
8155
8156 \begin_layout Description
8157 \begin_inset Flex Code
8158 status collapsed
8159
8160 \begin_layout Plain Layout
8161 ExcludesModule
8162 \end_layout
8163
8164 \end_inset
8165
8166  [
8167 \begin_inset Flex Code
8168 status collapsed
8169
8170 \begin_layout Plain Layout
8171 string
8172 \end_layout
8173
8174 \end_inset
8175
8176 ] This tag indicates that the module in question—which should be specified
8177  by filename without the 
8178 \begin_inset Flex Code
8179 status collapsed
8180
8181 \begin_layout Plain Layout
8182 .module
8183 \end_layout
8184
8185 \end_inset
8186
8187  extension—cannot be used with this document class.
8188  This might be used in a journal-specific layout file to prevent, say, the
8189  use of the 
8190 \begin_inset Flex Code
8191 status collapsed
8192
8193 \begin_layout Plain Layout
8194 theorems-sec
8195 \end_layout
8196
8197 \end_inset
8198
8199  module that numbers theorems by section.
8200  This tag may 
8201 \emph on
8202 not
8203 \emph default
8204  be used in a module.
8205  Modules have their own way of excluding other modules (see 
8206 \begin_inset CommandInset ref
8207 LatexCommand ref
8208 reference "sub:Layout-modules"
8209
8210 \end_inset
8211
8212 ).
8213 \end_layout
8214
8215 \begin_layout Description
8216 \begin_inset Flex Code
8217 status collapsed
8218
8219 \begin_layout Plain Layout
8220 Float
8221 \end_layout
8222
8223 \end_inset
8224
8225  Defines a new float.
8226  See Section
8227 \begin_inset space ~
8228 \end_inset
8229
8230
8231 \begin_inset CommandInset ref
8232 LatexCommand ref
8233 reference "sub:Floats"
8234
8235 \end_inset
8236
8237  for details.
8238  Must end with 
8239 \begin_inset Quotes eld
8240 \end_inset
8241
8242
8243 \begin_inset Flex Code
8244 status collapsed
8245
8246 \begin_layout Plain Layout
8247 End
8248 \end_layout
8249
8250 \end_inset
8251
8252
8253 \begin_inset Quotes erd
8254 \end_inset
8255
8256 .
8257 \end_layout
8258
8259 \begin_layout Description
8260 \begin_inset Flex Code
8261 status collapsed
8262
8263 \begin_layout Plain Layout
8264 HTMLPreamble
8265 \end_layout
8266
8267 \end_inset
8268
8269  Sets the information that will be output in the 
8270 \begin_inset Flex Code
8271 status collapsed
8272
8273 \begin_layout Plain Layout
8274 <head>
8275 \end_layout
8276
8277 \end_inset
8278
8279  block when this document class is output to XHTML.
8280  Note that this will completely override any prior 
8281 \begin_inset Flex Code
8282 status collapsed
8283
8284 \begin_layout Plain Layout
8285 HTMLPreamble
8286 \end_layout
8287
8288 \end_inset
8289
8290  or 
8291 \begin_inset Flex Code
8292 status collapsed
8293
8294 \begin_layout Plain Layout
8295 AddToHTMLPreamble
8296 \end_layout
8297
8298 \end_inset
8299
8300  declarations.
8301  (Use 
8302 \begin_inset Flex Code
8303 status collapsed
8304
8305 \begin_layout Plain Layout
8306 AddToHTMLPreamble
8307 \end_layout
8308
8309 \end_inset
8310
8311  if you just want to add material to the preamble.) Must end with 
8312 \begin_inset Quotes eld
8313 \end_inset
8314
8315
8316 \begin_inset Flex Code
8317 status collapsed
8318
8319 \begin_layout Plain Layout
8320 EndPreamble
8321 \end_layout
8322
8323 \end_inset
8324
8325
8326 \begin_inset Quotes erd
8327 \end_inset
8328
8329 .
8330 \end_layout
8331
8332 \begin_layout Description
8333 \begin_inset Flex Code
8334 status collapsed
8335
8336 \begin_layout Plain Layout
8337 HTMLTOCSection
8338 \end_layout
8339
8340 \end_inset
8341
8342  [
8343 \begin_inset Flex Code
8344 status collapsed
8345
8346 \begin_layout Plain Layout
8347 string
8348 \end_layout
8349
8350 \end_inset
8351
8352 ] The layout to use for the table of contents, bibliography, and so forth,
8353  when the document is output to HTML.
8354  For articles, this should normally be Section; for books, Chapter.
8355  If it is not given, then LyX will attempt to figure out which layout to
8356  use.
8357 \end_layout
8358
8359 \begin_layout Description
8360 \begin_inset Flex Code
8361 status collapsed
8362
8363 \begin_layout Plain Layout
8364 IfCounter
8365 \end_layout
8366
8367 \end_inset
8368
8369  [
8370 \begin_inset Flex Code
8371 status collapsed
8372
8373 \begin_layout Plain Layout
8374 string
8375 \end_layout
8376
8377 \end_inset
8378
8379 ] Modifies the properties of the given counter.
8380  If the counter does not exist, the section is ignored.
8381  Must end with 
8382 \begin_inset Quotes eld
8383 \end_inset
8384
8385
8386 \begin_inset Flex Code
8387 status collapsed
8388
8389 \begin_layout Plain Layout
8390 End
8391 \end_layout
8392
8393 \end_inset
8394
8395
8396 \begin_inset Quotes erd
8397 \end_inset
8398
8399 .
8400 \begin_inset Newline newline
8401 \end_inset
8402
8403 See Section
8404 \begin_inset space ~
8405 \end_inset
8406
8407
8408 \begin_inset CommandInset ref
8409 LatexCommand ref
8410 reference "sub:Counters"
8411
8412 \end_inset
8413
8414  for details on counters.
8415 \end_layout
8416
8417 \begin_layout Description
8418 \begin_inset Flex Code
8419 status collapsed
8420
8421 \begin_layout Plain Layout
8422 IfStyle
8423 \end_layout
8424
8425 \end_inset
8426
8427  [
8428 \begin_inset Flex Code
8429 status collapsed
8430
8431 \begin_layout Plain Layout
8432 string
8433 \end_layout
8434
8435 \end_inset
8436
8437 ] Modifies the properties of the given paragraph style.
8438  If the style does not exist, the section is ignored.
8439  Must end with 
8440 \begin_inset Quotes eld
8441 \end_inset
8442
8443
8444 \begin_inset Flex Code
8445 status collapsed
8446
8447 \begin_layout Plain Layout
8448 End
8449 \end_layout
8450
8451 \end_inset
8452
8453
8454 \begin_inset Quotes erd
8455 \end_inset
8456
8457 .
8458 \end_layout
8459
8460 \begin_layout Description
8461 \begin_inset Flex Code
8462 status collapsed
8463
8464 \begin_layout Plain Layout
8465 Input
8466 \end_layout
8467
8468 \end_inset
8469
8470  As its name implies, this command allows you to include another layout
8471  definition file within yours to avoid duplicating commands.
8472  Common examples are the standard layout files, for example, 
8473 \begin_inset Flex Code
8474 status collapsed
8475
8476 \begin_layout Plain Layout
8477 stdclass.inc
8478 \end_layout
8479
8480 \end_inset
8481
8482 , which contains most of the basic layouts.
8483 \end_layout
8484
8485 \begin_layout Description
8486 \begin_inset Flex Code
8487 status collapsed
8488
8489 \begin_layout Plain Layout
8490 InsetLayout
8491 \end_layout
8492
8493 \end_inset
8494
8495  This section (re-)defines the layout of an inset.
8496  It can be applied to an existing inset or to a new, user-defined inset,
8497  e.g., a new character style.
8498  Must end with 
8499 \begin_inset Quotes eld
8500 \end_inset
8501
8502
8503 \begin_inset Flex Code
8504 status collapsed
8505
8506 \begin_layout Plain Layout
8507 End
8508 \end_layout
8509
8510 \end_inset
8511
8512
8513 \begin_inset Quotes erd
8514 \end_inset
8515
8516 .
8517 \begin_inset Newline newline
8518 \end_inset
8519
8520 See Section
8521 \begin_inset space ~
8522 \end_inset
8523
8524
8525 \begin_inset CommandInset ref
8526 LatexCommand ref
8527 reference "sub:Flex-insets-and"
8528
8529 \end_inset
8530
8531  for more information.
8532  
8533 \end_layout
8534
8535 \begin_layout Description
8536 \begin_inset Flex Code
8537 status collapsed
8538
8539 \begin_layout Plain Layout
8540 LeftMargin
8541 \end_layout
8542
8543 \end_inset
8544
8545  [
8546 \begin_inset Flex Code
8547 status collapsed
8548
8549 \begin_layout Plain Layout
8550 string
8551 \end_layout
8552
8553 \end_inset
8554
8555 ] A string that indicates the width of the left margin on the screen, for
8556  example, 
8557 \begin_inset Quotes eld
8558 \end_inset
8559
8560 MMMMM
8561 \begin_inset Quotes erd
8562 \end_inset
8563
8564 .
8565  (Note that this is not a `length', like 
8566 \begin_inset Quotes eld
8567 \end_inset
8568
8569 2ex
8570 \begin_inset Quotes erd
8571 \end_inset
8572
8573 .)
8574 \end_layout
8575
8576 \begin_layout Description
8577 \begin_inset Flex Code
8578 status collapsed
8579
8580 \begin_layout Plain Layout
8581 NoCounter
8582 \end_layout
8583
8584 \end_inset
8585
8586  [
8587 \begin_inset Flex Code
8588 status collapsed
8589
8590 \begin_layout Plain Layout
8591 string
8592 \end_layout
8593
8594 \end_inset
8595
8596 ] This command deletes an existing counter, usually one defined in an included
8597  file.
8598 \end_layout
8599
8600 \begin_layout Description
8601 \begin_inset Flex Code
8602 status collapsed
8603
8604 \begin_layout Plain Layout
8605 NoFloat
8606 \end_layout
8607
8608 \end_inset
8609
8610  This command deletes an existing float.
8611  This is particularly useful when you want to suppress a float that has
8612  been defined in an input file.
8613 \end_layout
8614
8615 \begin_layout Description
8616 \begin_inset Flex Code
8617 status collapsed
8618
8619 \begin_layout Plain Layout
8620 NoStyle
8621 \end_layout
8622
8623 \end_inset
8624
8625  This command deletes an existing style.
8626  This is particularly useful when you want to suppress a style that has
8627  be defined in an input file.
8628 \end_layout
8629
8630 \begin_layout Description
8631 \begin_inset Flex Code
8632 status collapsed
8633
8634 \begin_layout Plain Layout
8635 OutputFormat
8636 \end_layout
8637
8638 \end_inset
8639
8640  A string indicating the file format (as defined in the Preferences dialog)
8641  produced by this class.
8642  It is mainly useful when 
8643 \begin_inset Flex Code
8644 status collapsed
8645
8646 \begin_layout Plain Layout
8647 OutputType
8648 \end_layout
8649
8650 \end_inset
8651
8652  is `literate' and one wants to define a new type of literate document.
8653  This string is reset to `docbook', `latex', or `literate' when the correspondin
8654
8655 \begin_inset Flex Code
8656 status collapsed
8657
8658 \begin_layout Plain Layout
8659 OutputType
8660 \end_layout
8661
8662 \end_inset
8663
8664  parameter is encountered.
8665 \end_layout
8666
8667 \begin_layout Description
8668 \begin_inset Flex Code
8669 status collapsed
8670
8671 \begin_layout Plain Layout
8672 OutputType
8673 \end_layout
8674
8675 \end_inset
8676
8677  A string indicating what sort of output documents using this class will
8678  produce.
8679  At present, the options are: `docbook', `latex', and `literate'.
8680 \end_layout
8681
8682 \begin_layout Description
8683 \begin_inset Flex Code
8684 status collapsed
8685
8686 \begin_layout Plain Layout
8687 PageStyle
8688 \end_layout
8689
8690 \end_inset
8691
8692  [
8693 \begin_inset Flex Code
8694 status collapsed
8695
8696 \begin_layout Plain Layout
8697
8698 \emph on
8699 plain
8700 \end_layout
8701
8702 \end_inset
8703
8704
8705 \begin_inset Flex Code
8706 status collapsed
8707
8708 \begin_layout Plain Layout
8709 empty
8710 \end_layout
8711
8712 \end_inset
8713
8714
8715 \begin_inset Flex Code
8716 status collapsed
8717
8718 \begin_layout Plain Layout
8719 headings
8720 \end_layout
8721
8722 \end_inset
8723
8724 ] The default pagestyle.
8725  Can be changed in the 
8726 \begin_inset Flex MenuItem
8727 status collapsed
8728
8729 \begin_layout Plain Layout
8730 Document\SpecialChar \menuseparator
8731 Settings
8732 \end_layout
8733
8734 \end_inset
8735
8736  dialog.
8737 \end_layout
8738
8739 \begin_layout Description
8740 \begin_inset Flex Code
8741 status collapsed
8742
8743 \begin_layout Plain Layout
8744 Preamble
8745 \end_layout
8746
8747 \end_inset
8748
8749  Sets the preamble for the LaTeX document.
8750  Note that this will completely override any prior 
8751 \begin_inset Flex Code
8752 status collapsed
8753
8754 \begin_layout Plain Layout
8755 Preamble
8756 \end_layout
8757
8758 \end_inset
8759
8760  or 
8761 \begin_inset Flex Code
8762 status collapsed
8763
8764 \begin_layout Plain Layout
8765 AddToPreamble
8766 \end_layout
8767
8768 \end_inset
8769
8770  declarations.
8771  (Use 
8772 \begin_inset Flex Code
8773 status collapsed
8774
8775 \begin_layout Plain Layout
8776 AddToPreamble
8777 \end_layout
8778
8779 \end_inset
8780
8781  if you just want to add material to the preamble.) Must end with 
8782 \begin_inset Quotes eld
8783 \end_inset
8784
8785
8786 \begin_inset Flex Code
8787 status collapsed
8788
8789 \begin_layout Plain Layout
8790 EndPreamble
8791 \end_layout
8792
8793 \end_inset
8794
8795
8796 \begin_inset Quotes erd
8797 \end_inset
8798
8799 .
8800 \end_layout
8801
8802 \begin_layout Description
8803 \begin_inset Flex Code
8804 status collapsed
8805
8806 \begin_layout Plain Layout
8807 Provides
8808 \end_layout
8809
8810 \end_inset
8811
8812  [
8813 \begin_inset Flex Code
8814 status collapsed
8815
8816 \begin_layout Plain Layout
8817 string
8818 \end_layout
8819
8820 \end_inset
8821
8822 ] [
8823 \begin_inset Flex Code
8824 status collapsed
8825
8826 \begin_layout Plain Layout
8827
8828 \emph on
8829 0
8830 \end_layout
8831
8832 \end_inset
8833
8834
8835 \begin_inset Flex Code
8836 status collapsed
8837
8838 \begin_layout Plain Layout
8839 1
8840 \end_layout
8841
8842 \end_inset
8843
8844 ] Whether the class already provides the feature 
8845 \begin_inset Flex Code
8846 status collapsed
8847
8848 \begin_layout Plain Layout
8849 string
8850 \end_layout
8851
8852 \end_inset
8853
8854 .
8855  A feature is in general the name of a package (
8856 \begin_inset Flex Code
8857 status collapsed
8858
8859 \begin_layout Plain Layout
8860 amsmath
8861 \end_layout
8862
8863 \end_inset
8864
8865
8866 \begin_inset Flex Code
8867 status collapsed
8868
8869 \begin_layout Plain Layout
8870 makeidx
8871 \end_layout
8872
8873 \end_inset
8874
8875 , \SpecialChar \ldots{}
8876 ) or a macro (
8877 \begin_inset Flex Code
8878 status collapsed
8879
8880 \begin_layout Plain Layout
8881 url
8882 \end_layout
8883
8884 \end_inset
8885
8886
8887 \begin_inset Flex Code
8888 status collapsed
8889
8890 \begin_layout Plain Layout
8891 boldsymbol
8892 \end_layout
8893
8894 \end_inset
8895
8896 ,\SpecialChar \ldots{}
8897 ); the complete list of supported features is unfortunately not documented
8898  outside the LyX source code—but see 
8899 \begin_inset Flex Code
8900 status collapsed
8901
8902 \begin_layout Plain Layout
8903 LaTeXFeatures.cpp
8904 \end_layout
8905
8906 \end_inset
8907
8908  if you're interested.
8909  
8910 \begin_inset Flex MenuItem
8911 status collapsed
8912
8913 \begin_layout Plain Layout
8914 Help\SpecialChar \menuseparator
8915 LaTeX Configuration
8916 \end_layout
8917
8918 \end_inset
8919
8920  also gives an overview of the supported packages.
8921 \end_layout
8922
8923 \begin_layout Description
8924 \begin_inset Flex Code
8925 status collapsed
8926
8927 \begin_layout Plain Layout
8928 ProvidesModule
8929 \end_layout
8930
8931 \end_inset
8932
8933  [
8934 \begin_inset Flex Code
8935 status collapsed
8936
8937 \begin_layout Plain Layout
8938 string
8939 \end_layout
8940
8941 \end_inset
8942
8943 ] Indicates that this layout provides the functionality of the module mentioned,
8944  which should be specified by the filename without the 
8945 \begin_inset Flex Code
8946 status collapsed
8947
8948 \begin_layout Plain Layout
8949 .module
8950 \end_layout
8951
8952 \end_inset
8953
8954  extension.
8955  This will typically be used if the layout includes the module directly,
8956  rather than using the 
8957 \begin_inset Flex Code
8958 status collapsed
8959
8960 \begin_layout Plain Layout
8961 DefaultModule
8962 \end_layout
8963
8964 \end_inset
8965
8966  tag to indicate that it ought to be used.
8967  It could also be used in a module that provided an alternate implementation
8968  of the same functionality.
8969 \end_layout
8970
8971 \begin_layout Description
8972 \begin_inset Flex Code
8973 status collapsed
8974
8975 \begin_layout Plain Layout
8976 Requires
8977 \end_layout
8978
8979 \end_inset
8980
8981  [
8982 \begin_inset Flex Code
8983 status collapsed
8984
8985 \begin_layout Plain Layout
8986 string
8987 \end_layout
8988
8989 \end_inset
8990
8991 ] Whether the class requires the feature 
8992 \begin_inset Flex Code
8993 status collapsed
8994
8995 \begin_layout Plain Layout
8996 string
8997 \end_layout
8998
8999 \end_inset
9000
9001 .
9002  Multiple features must be separated by commas.
9003  Note that you can only request supported features.
9004  (Again, see 
9005 \begin_inset Flex Code
9006 status collapsed
9007
9008 \begin_layout Plain Layout
9009 LaTeXFeatures.cpp
9010 \end_layout
9011
9012 \end_inset
9013
9014  for a list of these.)
9015 \end_layout
9016
9017 \begin_layout Description
9018 \begin_inset Flex Code
9019 status collapsed
9020
9021 \begin_layout Plain Layout
9022 RightMargin
9023 \end_layout
9024
9025 \end_inset
9026
9027  A string that indicates the width of the right margin on the screen, for
9028  example, 
9029 \begin_inset Quotes eld
9030 \end_inset
9031
9032 MMMMM
9033 \begin_inset Quotes erd
9034 \end_inset
9035
9036 .
9037 \end_layout
9038
9039 \begin_layout Description
9040 \begin_inset Flex Code
9041 status collapsed
9042
9043 \begin_layout Plain Layout
9044 SecNumDepth
9045 \end_layout
9046
9047 \end_inset
9048
9049  Sets which divisions get numbered.
9050  Corresponds to the 
9051 \begin_inset Flex Code
9052 status collapsed
9053
9054 \begin_layout Plain Layout
9055 secnumdepth
9056 \end_layout
9057
9058 \end_inset
9059
9060  counter in LaTeX.
9061 \end_layout
9062
9063 \begin_layout Description
9064 \begin_inset Flex Code
9065 status collapsed
9066
9067 \begin_layout Plain Layout
9068 Sides
9069 \end_layout
9070
9071 \end_inset
9072
9073  [
9074 \begin_inset Flex Code
9075 status collapsed
9076
9077 \begin_layout Plain Layout
9078
9079 \emph on
9080 1
9081 \end_layout
9082
9083 \end_inset
9084
9085
9086 \begin_inset Flex Code
9087 status collapsed
9088
9089 \begin_layout Plain Layout
9090 2
9091 \end_layout
9092
9093 \end_inset
9094
9095 ] Whether the class-default should be printing on one or both sides of the
9096  paper.
9097  Can be changed in the 
9098 \begin_inset Flex MenuItem
9099 status collapsed
9100
9101 \begin_layout Plain Layout
9102 Document\SpecialChar \menuseparator
9103 Settings
9104 \end_layout
9105
9106 \end_inset
9107
9108  dialog.
9109 \end_layout
9110
9111 \begin_layout Description
9112 \begin_inset Flex Code
9113 status collapsed
9114
9115 \begin_layout Plain Layout
9116 Style
9117 \end_layout
9118
9119 \end_inset
9120
9121  This sequence defines a paragraph style.
9122  If the style does not yet exist, it is created; if it does exist, its parameter
9123 s are modified.
9124  Must end with 
9125 \begin_inset Quotes eld
9126 \end_inset
9127
9128
9129 \begin_inset Flex Code
9130 status collapsed
9131
9132 \begin_layout Plain Layout
9133 End
9134 \end_layout
9135
9136 \end_inset
9137
9138
9139 \begin_inset Quotes erd
9140 \end_inset
9141
9142 .
9143 \begin_inset Newline newline
9144 \end_inset
9145
9146 See Section
9147 \begin_inset space ~
9148 \end_inset
9149
9150
9151 \begin_inset CommandInset ref
9152 LatexCommand ref
9153 reference "sub:Paragraph-Styles"
9154
9155 \end_inset
9156
9157  for details on paragraph styles.
9158 \end_layout
9159
9160 \begin_layout Description
9161 \begin_inset Flex Code
9162 status collapsed
9163
9164 \begin_layout Plain Layout
9165 TitleLatexName
9166 \end_layout
9167
9168 \end_inset
9169
9170  [
9171 \begin_inset Flex Code
9172 status collapsed
9173
9174 \begin_layout Plain Layout
9175 string="maketitle"
9176 \end_layout
9177
9178 \end_inset
9179
9180 ] The name of the command or environment to be used with 
9181 \begin_inset Flex Code
9182 status collapsed
9183
9184 \begin_layout Plain Layout
9185 TitleLatexType
9186 \end_layout
9187
9188 \end_inset
9189
9190 .
9191 \end_layout
9192
9193 \begin_layout Description
9194 \begin_inset Flex Code
9195 status collapsed
9196
9197 \begin_layout Plain Layout
9198 TitleLatexType
9199 \end_layout
9200
9201 \end_inset
9202
9203  [
9204 \begin_inset Flex Code
9205 status collapsed
9206
9207 \begin_layout Plain Layout
9208
9209 \emph on
9210 CommandAfter
9211 \end_layout
9212
9213 \end_inset
9214
9215
9216 \begin_inset Flex Code
9217 status collapsed
9218
9219 \begin_layout Plain Layout
9220 Environment
9221 \end_layout
9222
9223 \end_inset
9224
9225 ] Indicates what kind of markup is used to define the title of a document.
9226  
9227 \begin_inset Flex Code
9228 status collapsed
9229
9230 \begin_layout Plain Layout
9231 CommandAfter
9232 \end_layout
9233
9234 \end_inset
9235
9236  means that the macro with name 
9237 \begin_inset Flex Code
9238 status collapsed
9239
9240 \begin_layout Plain Layout
9241 TitleLatexName
9242 \end_layout
9243
9244 \end_inset
9245
9246  will be inserted after the last layout which has 
9247 \begin_inset Quotes eld
9248 \end_inset
9249
9250
9251 \begin_inset Flex Code
9252 status collapsed
9253
9254 \begin_layout Plain Layout
9255 InTitle 1
9256 \end_layout
9257
9258 \end_inset
9259
9260
9261 \begin_inset Quotes erd
9262 \end_inset
9263
9264 .
9265  
9266 \begin_inset Flex Code
9267 status collapsed
9268
9269 \begin_layout Plain Layout
9270 Environment
9271 \end_layout
9272
9273 \end_inset
9274
9275  corresponds to the case where the block of paragraphs which have 
9276 \begin_inset Quotes eld
9277 \end_inset
9278
9279
9280 \begin_inset Flex Code
9281 status collapsed
9282
9283 \begin_layout Plain Layout
9284 InTitle 1
9285 \end_layout
9286
9287 \end_inset
9288
9289
9290 \begin_inset Quotes erd
9291 \end_inset
9292
9293  should be enclosed into the 
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  environment.
9304 \end_layout
9305
9306 \begin_layout Description
9307 \begin_inset Flex Code
9308 status collapsed
9309
9310 \begin_layout Plain Layout
9311 TocDepth
9312 \end_layout
9313
9314 \end_inset
9315
9316  Sets which divisions are included in the table of contents.
9317  Corresponds to the 
9318 \begin_inset Flex Code
9319 status collapsed
9320
9321 \begin_layout Plain Layout
9322 tocdepth
9323 \end_layout
9324
9325 \end_inset
9326
9327  counter in LaTeX.
9328 \end_layout
9329
9330 \begin_layout Subsection
9331 \begin_inset Flex Code
9332 status collapsed
9333
9334 \begin_layout Plain Layout
9335 ClassOptions
9336 \end_layout
9337
9338 \end_inset
9339
9340  section
9341 \begin_inset CommandInset label
9342 LatexCommand label
9343 name "sub:ClassOptions"
9344
9345 \end_inset
9346
9347
9348 \end_layout
9349
9350 \begin_layout Standard
9351 The 
9352 \begin_inset Flex Code
9353 status collapsed
9354
9355 \begin_layout Plain Layout
9356 ClassOptions
9357 \end_layout
9358
9359 \end_inset
9360
9361  section can contain the following entries:
9362 \end_layout
9363
9364 \begin_layout Description
9365 \begin_inset Flex Code
9366 status collapsed
9367
9368 \begin_layout Plain Layout
9369 FontSize
9370 \end_layout
9371
9372 \end_inset
9373
9374  [
9375 \begin_inset Flex Code
9376 status collapsed
9377
9378 \begin_layout Plain Layout
9379 string="10|11|12"
9380 \end_layout
9381
9382 \end_inset
9383
9384 ] The list of available font sizes for the document's main font, separated
9385  by 
9386 \begin_inset Quotes eld
9387 \end_inset
9388
9389
9390 \begin_inset Flex Code
9391 status collapsed
9392
9393 \begin_layout Plain Layout
9394 |
9395 \end_layout
9396
9397 \end_inset
9398
9399
9400 \begin_inset Quotes erd
9401 \end_inset
9402
9403 .
9404 \end_layout
9405
9406 \begin_layout Description
9407 \begin_inset Flex Code
9408 status collapsed
9409
9410 \begin_layout Plain Layout
9411 Header
9412 \end_layout
9413
9414 \end_inset
9415
9416  Used to set the DTD line with XML-based output classes.
9417  E.
9418 \begin_inset space \thinspace{}
9419 \end_inset
9420
9421 g.: PUBLIC 
9422 \begin_inset Quotes eld
9423 \end_inset
9424
9425 -//OASIS//DTD DocBook V4.2//EN
9426 \begin_inset Quotes erd
9427 \end_inset
9428
9429 .
9430 \end_layout
9431
9432 \begin_layout Description
9433 \begin_inset Flex Code
9434 status collapsed
9435
9436 \begin_layout Plain Layout
9437 PageStyle
9438 \end_layout
9439
9440 \end_inset
9441
9442  [
9443 \begin_inset Flex Code
9444 status collapsed
9445
9446 \begin_layout Plain Layout
9447 string="empty|plain|headings|fancy"
9448 \end_layout
9449
9450 \end_inset
9451
9452 ] The list of available page styles, separated by 
9453 \begin_inset Quotes eld
9454 \end_inset
9455
9456
9457 \begin_inset Flex Code
9458 status collapsed
9459
9460 \begin_layout Plain Layout
9461 |
9462 \end_layout
9463
9464 \end_inset
9465
9466
9467 \begin_inset Quotes erd
9468 \end_inset
9469
9470 .
9471 \end_layout
9472
9473 \begin_layout Description
9474 \begin_inset Flex Code
9475 status collapsed
9476
9477 \begin_layout Plain Layout
9478 Other
9479 \end_layout
9480
9481 \end_inset
9482
9483  [
9484 \begin_inset Flex Code
9485 status collapsed
9486
9487 \begin_layout Plain Layout
9488 string=""
9489 \end_layout
9490
9491 \end_inset
9492
9493 ] Some document class options, separated by a comma, that will be added
9494  to the optional part of the 
9495 \begin_inset Flex Code
9496 status collapsed
9497
9498 \begin_layout Plain Layout
9499
9500 \backslash
9501 documentclass
9502 \end_layout
9503
9504 \end_inset
9505
9506  command.
9507 \end_layout
9508
9509 \begin_layout Standard
9510 The 
9511 \begin_inset Flex Code
9512 status collapsed
9513
9514 \begin_layout Plain Layout
9515 ClassOptions
9516 \end_layout
9517
9518 \end_inset
9519
9520  section must end with 
9521 \begin_inset Quotes eld
9522 \end_inset
9523
9524
9525 \begin_inset Flex Code
9526 status collapsed
9527
9528 \begin_layout Plain Layout
9529 End
9530 \end_layout
9531
9532 \end_inset
9533
9534
9535 \begin_inset Quotes erd
9536 \end_inset
9537
9538 .
9539 \end_layout
9540
9541 \begin_layout Subsection
9542 Paragraph styles
9543 \begin_inset CommandInset label
9544 LatexCommand label
9545 name "sub:Paragraph-Styles"
9546
9547 \end_inset
9548
9549
9550 \end_layout
9551
9552 \begin_layout Standard
9553 A paragraph style description looks like this:
9554 \begin_inset Foot
9555 status collapsed
9556
9557 \begin_layout Plain Layout
9558 Note that this will either define a new style or modify an existing one.
9559 \end_layout
9560
9561 \end_inset
9562
9563
9564 \end_layout
9565
9566 \begin_layout LyX-Code
9567 Style 
9568 \family roman
9569 \emph on
9570 name
9571 \end_layout
9572
9573 \begin_layout LyX-Code
9574  ...
9575 \end_layout
9576
9577 \begin_layout LyX-Code
9578 End
9579 \end_layout
9580
9581 \begin_layout Standard
9582 where the following commands are allowed:
9583 \end_layout
9584
9585 \begin_layout Description
9586 \begin_inset Flex Code
9587 status collapsed
9588
9589 \begin_layout Plain Layout
9590 Align
9591 \end_layout
9592
9593 \end_inset
9594
9595  [
9596 \begin_inset Flex Code
9597 status collapsed
9598
9599 \begin_layout Plain Layout
9600
9601 \emph on
9602 block
9603 \emph default
9604 , left, right, center
9605 \end_layout
9606
9607 \end_inset
9608
9609 ] Paragraph alignment.
9610 \end_layout
9611
9612 \begin_layout Description
9613 \begin_inset Flex Code
9614 status collapsed
9615
9616 \begin_layout Plain Layout
9617 AlignPossible
9618 \end_layout
9619
9620 \end_inset
9621
9622  [
9623 \begin_inset Flex Code
9624 status collapsed
9625
9626 \begin_layout Plain Layout
9627
9628 \emph on
9629 block
9630 \emph default
9631 , left, right, center
9632 \end_layout
9633
9634 \end_inset
9635
9636 ] A comma separated list of permitted alignments.
9637  (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9638  sense.
9639  For example a right-aligned or centered enumeration isn't possible.)
9640 \end_layout
9641
9642 \begin_layout Description
9643 \begin_inset Flex Code
9644 status collapsed
9645
9646 \begin_layout Plain Layout
9647 BabelPreamble
9648 \end_layout
9649
9650 \end_inset
9651
9652  Note that this will completely override any prior 
9653 \begin_inset Flex Code
9654 status collapsed
9655
9656 \begin_layout Plain Layout
9657 BabelPreamble
9658 \end_layout
9659
9660 \end_inset
9661
9662  declaration for this style.
9663  Must end with 
9664 \begin_inset Quotes eld
9665 \end_inset
9666
9667
9668 \begin_inset Flex Code
9669 status collapsed
9670
9671 \begin_layout Plain Layout
9672 EndBabelPreamble
9673 \end_layout
9674
9675 \end_inset
9676
9677
9678 \begin_inset Quotes erd
9679 \end_inset
9680
9681 .
9682  See section 
9683 \begin_inset CommandInset ref
9684 LatexCommand ref
9685 reference "sub:I18n"
9686
9687 \end_inset
9688
9689  for details on its use.
9690 \end_layout
9691
9692 \begin_layout Description
9693 \begin_inset Flex Code
9694 status collapsed
9695
9696 \begin_layout Plain Layout
9697 BottomSep
9698 \end_layout
9699
9700 \end_inset
9701
9702  [
9703 \begin_inset Flex Code
9704 status collapsed
9705
9706 \begin_layout Plain Layout
9707 float=0
9708 \end_layout
9709
9710 \end_inset
9711
9712 ]
9713 \begin_inset Foot
9714 status collapsed
9715
9716 \begin_layout Plain Layout
9717 Note that a `float' here is a real number, such as: 1.5.
9718 \end_layout
9719
9720 \end_inset
9721
9722  The vertical space with which the last of a chain of paragraphs with this
9723  style is separated from the following paragraph.
9724  If the next paragraph has another style, the separations are not simply
9725  added, but the maximum is taken.
9726 \end_layout
9727
9728 \begin_layout Description
9729 \begin_inset Flex Code
9730 status collapsed
9731
9732 \begin_layout Plain Layout
9733 Category
9734 \end_layout
9735
9736 \end_inset
9737
9738  
9739 \begin_inset Flex Code
9740 status collapsed
9741
9742 \begin_layout Plain Layout
9743 [string]
9744 \end_layout
9745
9746 \end_inset
9747
9748  The category for this style.
9749  This is used to group related styles in the style combobox on the toolbar.
9750  Any string can be used, but you may want to use existing categories with
9751  your own styles.
9752  
9753 \end_layout
9754
9755 \begin_layout Description
9756 \begin_inset Flex Code
9757 status collapsed
9758
9759 \begin_layout Plain Layout
9760 CommandDepth
9761 \end_layout
9762
9763 \end_inset
9764
9765  Depth of XML command.
9766  Used only with XML-type formats.
9767 \end_layout
9768
9769 \begin_layout Description
9770 \begin_inset Flex Code
9771 status collapsed
9772
9773 \begin_layout Plain Layout
9774 CopyStyle
9775 \end_layout
9776
9777 \end_inset
9778
9779  
9780 \begin_inset CommandInset label
9781 LatexCommand label
9782 name "des:CopyStyle"
9783
9784 \end_inset
9785
9786
9787 \begin_inset Flex Code
9788 status collapsed
9789
9790 \begin_layout Plain Layout
9791 [string]
9792 \end_layout
9793
9794 \end_inset
9795
9796  Copies all the features of an existing style into the current one.
9797  
9798 \end_layout
9799
9800 \begin_layout Description
9801 \begin_inset Flex Code
9802 status collapsed
9803
9804 \begin_layout Plain Layout
9805 DependsOn
9806 \end_layout
9807
9808 \end_inset
9809
9810  The name of a style whose preamble should be output 
9811 \emph on
9812 before
9813 \emph default
9814  this one.
9815  This allows to ensure some ordering of the preamble snippets when macros
9816  definitions depend on one another.
9817 \begin_inset Foot
9818 status collapsed
9819
9820 \begin_layout Plain Layout
9821 Note that, besides that functionality, there is no way to ensure any ordering
9822  of preambles.
9823  The ordering that you see in a given version of LyX may change without
9824  warning in later versions.
9825 \end_layout
9826
9827 \end_inset
9828
9829
9830 \end_layout
9831
9832 \begin_layout Description
9833 \begin_inset Flex Code
9834 status collapsed
9835
9836 \begin_layout Plain Layout
9837 EndLabeltype
9838 \end_layout
9839
9840 \end_inset
9841
9842  [
9843 \begin_inset Flex Code
9844 status collapsed
9845
9846 \begin_layout Plain Layout
9847
9848 \emph on
9849 No_Label
9850 \emph default
9851 , Box, Filled_Box, Static
9852 \end_layout
9853
9854 \end_inset
9855
9856 ] The type of label that stands at the end of the paragraph (or sequence
9857  of paragraphs if 
9858 \begin_inset Flex Code
9859 status collapsed
9860
9861 \begin_layout Plain Layout
9862 LatexType
9863 \end_layout
9864
9865 \end_inset
9866
9867  is 
9868 \begin_inset Flex Code
9869 status collapsed
9870
9871 \begin_layout Plain Layout
9872 Environment
9873 \end_layout
9874
9875 \end_inset
9876
9877
9878 \begin_inset Flex Code
9879 status collapsed
9880
9881 \begin_layout Plain Layout
9882 Item_Environment
9883 \end_layout
9884
9885 \end_inset
9886
9887  or 
9888 \begin_inset Flex Code
9889 status collapsed
9890
9891 \begin_layout Plain Layout
9892 List_Environment
9893 \end_layout
9894
9895 \end_inset
9896
9897 ).
9898  
9899 \begin_inset Flex Code
9900 status collapsed
9901
9902 \begin_layout Plain Layout
9903 No_Label
9904 \end_layout
9905
9906 \end_inset
9907
9908  means 
9909 \begin_inset Quotes eld
9910 \end_inset
9911
9912 nothing
9913 \begin_inset Quotes erd
9914 \end_inset
9915
9916
9917 \begin_inset Flex Code
9918 status collapsed
9919
9920 \begin_layout Plain Layout
9921 Box
9922 \end_layout
9923
9924 \end_inset
9925
9926  (resp.
9927 \begin_inset Flex Code
9928 status collapsed
9929
9930 \begin_layout Plain Layout
9931 \begin_inset space ~
9932 \end_inset
9933
9934 Filled_Box
9935 \end_layout
9936
9937 \end_inset
9938
9939 ) is a white (resp.
9940 \begin_inset space ~
9941 \end_inset
9942
9943 black) square suitable for end of proof markers, 
9944 \begin_inset Flex Code
9945 status collapsed
9946
9947 \begin_layout Plain Layout
9948 Static
9949 \end_layout
9950
9951 \end_inset
9952
9953  is an explicit text string.
9954 \end_layout
9955
9956 \begin_layout Description
9957 \begin_inset Flex Code
9958 status collapsed
9959
9960 \begin_layout Plain Layout
9961 EndLabelString
9962 \end_layout
9963
9964 \end_inset
9965
9966  [
9967 \begin_inset Flex Code
9968 status collapsed
9969
9970 \begin_layout Plain Layout
9971 string=""
9972 \end_layout
9973
9974 \end_inset
9975
9976 ] The string used for a label with a 
9977 \begin_inset Flex Code
9978 status collapsed
9979
9980 \begin_layout Plain Layout
9981 Static
9982 \end_layout
9983
9984 \end_inset
9985
9986  
9987 \begin_inset Flex Code
9988 status collapsed
9989
9990 \begin_layout Plain Layout
9991 EndLabelType
9992 \end_layout
9993
9994 \end_inset
9995
9996 .
9997  
9998 \end_layout
9999
10000 \begin_layout Description
10001 \begin_inset Flex Code
10002 status collapsed
10003
10004 \begin_layout Plain Layout
10005 Font
10006 \end_layout
10007
10008 \end_inset
10009
10010  The font used for both the text body 
10011 \emph on
10012 and
10013 \emph default
10014  the label.
10015  See section
10016 \begin_inset space ~
10017 \end_inset
10018
10019
10020 \begin_inset CommandInset ref
10021 LatexCommand ref
10022 reference "sub:Font-description"
10023
10024 \end_inset
10025
10026 .
10027  Note that defining this font automatically defines the 
10028 \begin_inset Flex Code
10029 status collapsed
10030
10031 \begin_layout Plain Layout
10032 LabelFont
10033 \end_layout
10034
10035 \end_inset
10036
10037  to the same value.
10038  So you should define this one first if you also want to define 
10039 \begin_inset Flex Code
10040 status collapsed
10041
10042 \begin_layout Plain Layout
10043 LabelFont
10044 \end_layout
10045
10046 \end_inset
10047
10048 .
10049 \end_layout
10050
10051 \begin_layout Description
10052 \begin_inset Flex Code
10053 status collapsed
10054
10055 \begin_layout Plain Layout
10056 FreeSpacing
10057 \end_layout
10058
10059 \end_inset
10060
10061  
10062 \begin_inset CommandInset label
10063 LatexCommand label
10064 name "des:FreeSpacing"
10065
10066 \end_inset
10067
10068 [
10069 \begin_inset Flex Code
10070 status collapsed
10071
10072 \begin_layout Plain Layout
10073
10074 \emph on
10075 0
10076 \end_layout
10077
10078 \end_inset
10079
10080
10081 \begin_inset Flex Code
10082 status collapsed
10083
10084 \begin_layout Plain Layout
10085 1
10086 \end_layout
10087
10088 \end_inset
10089
10090 ] Usually LyX doesn't allow you to insert more than one space between words,
10091  since a space is considered as the separation between two words, not a
10092  character or symbol of its own.
10093  This is a very fine thing but sometimes annoying, for example, when typing
10094  program code or plain LaTeX code.
10095  For this reason, 
10096 \begin_inset Flex Code
10097 status collapsed
10098
10099 \begin_layout Plain Layout
10100 FreeSpacing
10101 \end_layout
10102
10103 \end_inset
10104
10105  can be enabled.
10106  Note that LyX will create protected blanks for the additional blanks when
10107  in another mode than LaTeX-mode.
10108 \end_layout
10109
10110 \begin_layout Description
10111 \begin_inset Flex Code
10112 status collapsed
10113
10114 \begin_layout Plain Layout
10115 HTML*
10116 \end_layout
10117
10118 \end_inset
10119
10120  These tags are used with XHTML output.
10121  See 
10122 \begin_inset CommandInset ref
10123 LatexCommand ref
10124 reference "sub:Paragraph-Style-XHTML"
10125
10126 \end_inset
10127
10128 .
10129 \end_layout
10130
10131 \begin_layout Description
10132 \begin_inset Flex Code
10133 status collapsed
10134
10135 \begin_layout Plain Layout
10136 InnerTag
10137 \end_layout
10138
10139 \end_inset
10140
10141  [[FIXME]] (Used only with XML-type formats.)
10142 \end_layout
10143
10144 \begin_layout Description
10145 \begin_inset Flex Code
10146 status collapsed
10147
10148 \begin_layout Plain Layout
10149 InPreamble
10150 \end_layout
10151
10152 \end_inset
10153
10154  
10155 \begin_inset Flex Code
10156 status collapsed
10157
10158 \begin_layout Plain Layout
10159 [1, 0]
10160 \end_layout
10161
10162 \end_inset
10163
10164  If 1, marks the style as to be included in the document preamble rather
10165  than in the document body.
10166  This is useful for document classes that want such information as the title
10167  and author to appear in the preamble.
10168  Note that this works only for styles for which the 
10169 \begin_inset Flex Code
10170 status collapsed
10171
10172 \begin_layout Plain Layout
10173 LatexType
10174 \end_layout
10175
10176 \end_inset
10177
10178  is 
10179 \begin_inset Flex Code
10180 status collapsed
10181
10182 \begin_layout Plain Layout
10183 Command
10184 \end_layout
10185
10186 \end_inset
10187
10188  or 
10189 \begin_inset Flex Code
10190 status collapsed
10191
10192 \begin_layout Plain Layout
10193 Paragraph
10194 \end_layout
10195
10196 \end_inset
10197
10198 .
10199 \end_layout
10200
10201 \begin_layout Description
10202 \begin_inset Flex Code
10203 status collapsed
10204
10205 \begin_layout Plain Layout
10206 InTitle
10207 \end_layout
10208
10209 \end_inset
10210
10211  
10212 \begin_inset Flex Code
10213 status collapsed
10214
10215 \begin_layout Plain Layout
10216 [1, 0]
10217 \end_layout
10218
10219 \end_inset
10220
10221  If 1, marks the style as being part of a title block (see also the 
10222 \begin_inset Flex Code
10223 status collapsed
10224
10225 \begin_layout Plain Layout
10226 TitleLatexType
10227 \end_layout
10228
10229 \end_inset
10230
10231  and 
10232 \begin_inset Flex Code
10233 status collapsed
10234
10235 \begin_layout Plain Layout
10236 TitleLatexName
10237 \end_layout
10238
10239 \end_inset
10240
10241  global entries).
10242 \end_layout
10243
10244 \begin_layout Description
10245 \begin_inset Flex Code
10246 status collapsed
10247
10248 \begin_layout Plain Layout
10249 ItemSep
10250 \end_layout
10251
10252 \end_inset
10253
10254  [
10255 \begin_inset Flex Code
10256 status collapsed
10257
10258 \begin_layout Plain Layout
10259 float=0
10260 \end_layout
10261
10262 \end_inset
10263
10264 ] This provides extra space between paragraphs that have the same style.
10265  If you put other styles into an environment, each is separated with the
10266  environment's 
10267 \begin_inset Flex Code
10268 status collapsed
10269
10270 \begin_layout Plain Layout
10271 Parsep
10272 \end_layout
10273
10274 \end_inset
10275
10276 .
10277  But the whole items of the environment are additionally separated with
10278  this 
10279 \begin_inset Flex Code
10280 status collapsed
10281
10282 \begin_layout Plain Layout
10283 Itemsep
10284 \end_layout
10285
10286 \end_inset
10287
10288 .
10289  Note that this is a
10290 \emph on
10291  multiplier.
10292 \end_layout
10293
10294 \begin_layout Description
10295 \begin_inset Flex Code
10296 status collapsed
10297
10298 \begin_layout Plain Layout
10299 ItemTag
10300 \end_layout
10301
10302 \end_inset
10303
10304  [[FIXME]] (Used only with XML-type formats.)
10305 \end_layout
10306
10307 \begin_layout Description
10308 \begin_inset Flex Code
10309 status collapsed
10310
10311 \begin_layout Plain Layout
10312 KeepEmpty
10313 \end_layout
10314
10315 \end_inset
10316
10317  
10318 \begin_inset CommandInset label
10319 LatexCommand label
10320 name "des:KeepEmpty"
10321
10322 \end_inset
10323
10324 [
10325 \begin_inset Flex Code
10326 status collapsed
10327
10328 \begin_layout Plain Layout
10329
10330 \emph on
10331 0
10332 \end_layout
10333
10334 \end_inset
10335
10336
10337 \begin_inset Flex Code
10338 status collapsed
10339
10340 \begin_layout Plain Layout
10341 1
10342 \end_layout
10343
10344 \end_inset
10345
10346 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10347  lead to empty LaTeX output.
10348  There are some cases where this could be desirable however: in a letter
10349  template, the required fields can be provided as empty fields, so that
10350  people do not forget them; in some special classes, a style can be used
10351  as some kind of break, which does not contain actual text.
10352 \end_layout
10353
10354 \begin_layout Description
10355 \begin_inset Flex Code
10356 status collapsed
10357
10358 \begin_layout Plain Layout
10359 LabelBottomsep
10360 \end_layout
10361
10362 \end_inset
10363
10364  [float=0] The vertical space between the label and the text body.
10365  Only used for labels that are above the text body (
10366 \begin_inset Flex Code
10367 status collapsed
10368
10369 \begin_layout Plain Layout
10370 Top_Environment
10371 \end_layout
10372
10373 \end_inset
10374
10375
10376 \begin_inset Flex Code
10377 status collapsed
10378
10379 \begin_layout Plain Layout
10380 Centered_Top_Environment
10381 \end_layout
10382
10383 \end_inset
10384
10385 ).
10386 \end_layout
10387
10388 \begin_layout Description
10389 \begin_inset Flex Code
10390 status collapsed
10391
10392 \begin_layout Plain Layout
10393 LabelCounter
10394 \end_layout
10395
10396 \end_inset
10397
10398  [
10399 \begin_inset Flex Code
10400 status collapsed
10401
10402 \begin_layout Plain Layout
10403 string=""
10404 \end_layout
10405
10406 \end_inset
10407
10408 ]
10409 \begin_inset Newline newline
10410 \end_inset
10411
10412 The name of the counter for automatic numbering.
10413  
10414 \begin_inset Newline newline
10415 \end_inset
10416
10417 This 
10418 \emph on
10419 must
10420 \emph default
10421  be given if 
10422 \begin_inset Flex Code
10423 status collapsed
10424
10425 \begin_layout Plain Layout
10426 LabelType
10427 \end_layout
10428
10429 \end_inset
10430
10431  is 
10432 \begin_inset Flex Code
10433 status collapsed
10434
10435 \begin_layout Plain Layout
10436 Counter
10437 \end_layout
10438
10439 \end_inset
10440
10441 .
10442  In that case, the counter will be stepped each time the style appears.
10443  
10444 \begin_inset Newline newline
10445 \end_inset
10446
10447 This 
10448 \emph on
10449 may
10450 \emph default
10451  also be given if 
10452 \begin_inset Flex Code
10453 status collapsed
10454
10455 \begin_layout Plain Layout
10456 LabelType
10457 \end_layout
10458
10459 \end_inset
10460
10461  is 
10462 \begin_inset Flex Code
10463 status collapsed
10464
10465 \begin_layout Plain Layout
10466 Enumerate
10467 \end_layout
10468
10469 \end_inset
10470
10471 , though this case is a bit complicated.
10472  Suppose you declare 
10473 \begin_inset Quotes eld
10474 \end_inset
10475
10476
10477 \begin_inset Flex Code
10478 status collapsed
10479
10480 \begin_layout Plain Layout
10481 LabelCounter myenum
10482 \end_layout
10483
10484 \end_inset
10485
10486
10487 \begin_inset Quotes erd
10488 \end_inset
10489
10490 .
10491  Then the actual counters used are 
10492 \begin_inset Flex Code
10493 status collapsed
10494
10495 \begin_layout Plain Layout
10496 myenumi
10497 \end_layout
10498
10499 \end_inset
10500
10501
10502 \begin_inset Flex Code
10503 status collapsed
10504
10505 \begin_layout Plain Layout
10506 myenumii
10507 \end_layout
10508
10509 \end_inset
10510
10511
10512 \begin_inset Flex Code
10513 status collapsed
10514
10515 \begin_layout Plain Layout
10516 myenumiii
10517 \end_layout
10518
10519 \end_inset
10520
10521 , and 
10522 \begin_inset Flex Code
10523 status collapsed
10524
10525 \begin_layout Plain Layout
10526 myenumiv
10527 \end_layout
10528
10529 \end_inset
10530
10531 , much as in LaTeX.
10532  These counters must all be declared separately.
10533 \begin_inset Newline newline
10534 \end_inset
10535
10536 See Section 
10537 \begin_inset CommandInset ref
10538 LatexCommand ref
10539 reference "sub:Counters"
10540
10541 \end_inset
10542
10543  for details on counters.
10544 \end_layout
10545
10546 \begin_layout Description
10547 \begin_inset Flex Code
10548 status collapsed
10549
10550 \begin_layout Plain Layout
10551 LabelFont
10552 \end_layout
10553
10554 \end_inset
10555
10556  The font used for the label.
10557  See section
10558 \begin_inset space ~
10559 \end_inset
10560
10561
10562 \begin_inset CommandInset ref
10563 LatexCommand ref
10564 reference "sub:Font-description"
10565
10566 \end_inset
10567
10568 .
10569 \end_layout
10570
10571 \begin_layout Description
10572 \begin_inset Flex Code
10573 status collapsed
10574
10575 \begin_layout Plain Layout
10576 LabelIndent
10577 \end_layout
10578
10579 \end_inset
10580
10581  Text that indicates how far a label should be indented.
10582 \end_layout
10583
10584 \begin_layout Description
10585 \begin_inset Flex Code
10586 status collapsed
10587
10588 \begin_layout Plain Layout
10589 Labelsep
10590 \end_layout
10591
10592 \end_inset
10593
10594  [
10595 \begin_inset Flex Code
10596 status collapsed
10597
10598 \begin_layout Plain Layout
10599 string=""
10600 \end_layout
10601
10602 \end_inset
10603
10604 ] The horizontal space between the label and the text body.
10605  Only used for labels that are not above the text body.
10606 \end_layout
10607
10608 \begin_layout Description
10609 \begin_inset Flex Code
10610 status collapsed
10611
10612 \begin_layout Plain Layout
10613 LabelString
10614 \end_layout
10615
10616 \end_inset
10617
10618  [
10619 \begin_inset Flex Code
10620 status collapsed
10621
10622 \begin_layout Plain Layout
10623 string=""
10624 \end_layout
10625
10626 \end_inset
10627
10628 ] The string used for a label with a 
10629 \begin_inset Flex Code
10630 status collapsed
10631
10632 \begin_layout Plain Layout
10633 Static
10634 \end_layout
10635
10636 \end_inset
10637
10638  labeltype.
10639  When 
10640 \begin_inset Flex Code
10641 status collapsed
10642
10643 \begin_layout Plain Layout
10644 LabelCounter
10645 \end_layout
10646
10647 \end_inset
10648
10649  is set, this string can be contain the special formatting commands described
10650  in Section 
10651 \begin_inset CommandInset ref
10652 LatexCommand ref
10653 reference "sub:Counters"
10654
10655 \end_inset
10656
10657 .
10658 \begin_inset Foot
10659 status collapsed
10660
10661 \begin_layout Plain Layout
10662 For the sake of backwards compatibility, the string 
10663 \begin_inset Flex Code
10664 status collapsed
10665
10666 \begin_layout Plain Layout
10667 @
10668 \emph on
10669 style-name
10670 \emph default
10671 @
10672 \end_layout
10673
10674 \end_inset
10675
10676  will be replaced by the expanded 
10677 \begin_inset Flex Code
10678 status collapsed
10679
10680 \begin_layout Plain Layout
10681 LabelString
10682 \end_layout
10683
10684 \end_inset
10685
10686  of style 
10687 \begin_inset Flex Code
10688 status collapsed
10689
10690 \begin_layout Plain Layout
10691
10692 \emph on
10693 style-name
10694 \end_layout
10695
10696 \end_inset
10697
10698 .
10699  This feature is now obsolete and should be replaced by the mechanisms of
10700  Section 
10701 \begin_inset CommandInset ref
10702 LatexCommand ref
10703 reference "sub:Counters"
10704
10705 \end_inset
10706
10707 .
10708 \end_layout
10709
10710 \end_inset
10711
10712
10713 \end_layout
10714
10715 \begin_layout Description
10716 \begin_inset Flex Code
10717 status collapsed
10718
10719 \begin_layout Plain Layout
10720 LabelStringAppendix
10721 \end_layout
10722
10723 \end_inset
10724
10725  [
10726 \begin_inset Flex Code
10727 status collapsed
10728
10729 \begin_layout Plain Layout
10730 string=""
10731 \end_layout
10732
10733 \end_inset
10734
10735 ] This is used inside the appendix instead of 
10736 \begin_inset Flex Code
10737 status collapsed
10738
10739 \begin_layout Plain Layout
10740 LabelString
10741 \end_layout
10742
10743 \end_inset
10744
10745 .
10746  Note that every 
10747 \begin_inset Flex Code
10748 status collapsed
10749
10750 \begin_layout Plain Layout
10751 LabelString
10752 \end_layout
10753
10754 \end_inset
10755
10756  statement resets 
10757 \begin_inset Flex Code
10758 status collapsed
10759
10760 \begin_layout Plain Layout
10761 LabelStringAppendix
10762 \end_layout
10763
10764 \end_inset
10765
10766  too.
10767 \end_layout
10768
10769 \begin_layout Description
10770 \begin_inset Flex Code
10771 status collapsed
10772
10773 \begin_layout Plain Layout
10774 LabelTag
10775 \end_layout
10776
10777 \end_inset
10778
10779  [FIXME] (Used only with XML-type formats.)
10780 \end_layout
10781
10782 \begin_layout Description
10783 \begin_inset Flex Code
10784 status collapsed
10785
10786 \begin_layout Plain Layout
10787 LabelType
10788 \end_layout
10789
10790 \end_inset
10791
10792  [
10793 \begin_inset Flex Code
10794 status collapsed
10795
10796 \begin_layout Plain Layout
10797
10798 \emph on
10799 No_Label
10800 \emph default
10801 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10802  Enumerate, Itemize, Bibliography
10803 \end_layout
10804
10805 \end_inset
10806
10807
10808 \end_layout
10809
10810 \begin_deeper
10811 \begin_layout Itemize
10812 \begin_inset Flex Code
10813 status collapsed
10814
10815 \begin_layout Plain Layout
10816 Manual
10817 \end_layout
10818
10819 \end_inset
10820
10821  means the label is the very first word (up to the first real blank).
10822  Use protected spaces (like
10823 \begin_inset space ~
10824 \end_inset
10825
10826 that one) if you want more than one word as the label.
10827  
10828 \end_layout
10829
10830 \begin_layout Itemize
10831 \begin_inset Flex Code
10832 status collapsed
10833
10834 \begin_layout Plain Layout
10835 Static
10836 \end_layout
10837
10838 \end_inset
10839
10840  means the label is simply whatever 
10841 \begin_inset Flex Code
10842 status collapsed
10843
10844 \begin_layout Plain Layout
10845 LabelString
10846 \end_layout
10847
10848 \end_inset
10849
10850  declares it to be.
10851  Note that this really is `static'.
10852 \end_layout
10853
10854 \begin_layout Itemize
10855 \begin_inset Flex Code
10856 status collapsed
10857
10858 \begin_layout Plain Layout
10859 Top_Environment
10860 \end_layout
10861
10862 \end_inset
10863
10864  and 
10865 \begin_inset Flex Code
10866 status collapsed
10867
10868 \begin_layout Plain Layout
10869 Centered_Top_Environment
10870 \end_layout
10871
10872 \end_inset
10873
10874  are special cases of 
10875 \begin_inset Flex Code
10876 status collapsed
10877
10878 \begin_layout Plain Layout
10879 Static
10880 \end_layout
10881
10882 \end_inset
10883
10884 .
10885  The label will be printed above the paragraph, but only at the top of an
10886  environment or the top of a chain of paragraphs with this style.
10887  This might be used with the 
10888 \begin_inset Flex MenuItem
10889 status collapsed
10890
10891 \begin_layout Plain Layout
10892 Abstract
10893 \end_layout
10894
10895 \end_inset
10896
10897  style, for example.
10898 \end_layout
10899
10900 \begin_layout Itemize
10901 \begin_inset Flex Code
10902 status collapsed
10903
10904 \begin_layout Plain Layout
10905 Sensitive
10906 \end_layout
10907
10908 \end_inset
10909
10910  is a special case for the caption-labels 
10911 \begin_inset Quotes eld
10912 \end_inset
10913
10914 Figure
10915 \begin_inset Quotes erd
10916 \end_inset
10917
10918  and 
10919 \begin_inset Quotes eld
10920 \end_inset
10921
10922 Table
10923 \begin_inset Quotes erd
10924 \end_inset
10925
10926 .
10927  
10928 \begin_inset Flex Code
10929 status collapsed
10930
10931 \begin_layout Plain Layout
10932 Sensitive
10933 \end_layout
10934
10935 \end_inset
10936
10937  means the (hardcoded) label string depends on the kind of float: It is
10938  hardcoded to be `FloatType N', where N is the value of the counter associated
10939  with the float.
10940 \end_layout
10941
10942 \begin_layout Itemize
10943 The 
10944 \begin_inset Flex Code
10945 status collapsed
10946
10947 \begin_layout Plain Layout
10948 Counter
10949 \end_layout
10950
10951 \end_inset
10952
10953  label type defines automatically numbered labels.
10954  The 
10955 \begin_inset Flex Code
10956 status collapsed
10957
10958 \begin_layout Plain Layout
10959 LabelString
10960 \end_layout
10961
10962 \end_inset
10963
10964  will be expanded to resolve any counter references it contains: For example,
10965  it might be 
10966 \begin_inset Quotes eld
10967 \end_inset
10968
10969
10970 \begin_inset Flex Code
10971 status collapsed
10972
10973 \begin_layout Plain Layout
10974 Section 
10975 \backslash
10976 thechapter.
10977 \backslash
10978 thesection
10979 \end_layout
10980
10981 \end_inset
10982
10983
10984 \begin_inset Quotes erd
10985 \end_inset
10986
10987 .
10988  See Section 
10989 \begin_inset CommandInset ref
10990 LatexCommand ref
10991 reference "sub:Counters"
10992
10993 \end_inset
10994
10995  for more information on counters.
10996 \end_layout
10997
10998 \begin_layout Itemize
10999 \begin_inset Flex Code
11000 status collapsed
11001
11002 \begin_layout Plain Layout
11003 Enumerate
11004 \end_layout
11005
11006 \end_inset
11007
11008  produces the usual sort of enumeration labels.
11009  At present, it is hardcoded to use Arabic numerals, lowercase letters,
11010  small Roman numerals, and uppercase letters for the four possible depths.
11011 \end_layout
11012
11013 \begin_layout Itemize
11014 \begin_inset Flex Code
11015 status collapsed
11016
11017 \begin_layout Plain Layout
11018 Itemize
11019 \end_layout
11020
11021 \end_inset
11022
11023  produces various bullets at the different levels.
11024  It is also hardcoded.
11025 \end_layout
11026
11027 \begin_layout Itemize
11028 \begin_inset Flex Code
11029 status collapsed
11030
11031 \begin_layout Plain Layout
11032 Bibliography
11033 \end_layout
11034
11035 \end_inset
11036
11037  is used internally by LyX and should be used only with 
11038 \begin_inset Flex Code
11039 status collapsed
11040
11041 \begin_layout Plain Layout
11042 LatexType BibEnvironment
11043 \end_layout
11044
11045 \end_inset
11046
11047 .
11048 \end_layout
11049
11050 \end_deeper
11051 \begin_layout Description
11052 \begin_inset Flex Code
11053 status collapsed
11054
11055 \begin_layout Plain Layout
11056 LangPreamble
11057 \end_layout
11058
11059 \end_inset
11060
11061  Note that this will completely override any prior 
11062 \begin_inset Flex Code
11063 status collapsed
11064
11065 \begin_layout Plain Layout
11066 LangPreamble
11067 \end_layout
11068
11069 \end_inset
11070
11071  declaration for this style.
11072  Must end with 
11073 \begin_inset Quotes eld
11074 \end_inset
11075
11076
11077 \begin_inset Flex Code
11078 status collapsed
11079
11080 \begin_layout Plain Layout
11081 EndLangPreamble
11082 \end_layout
11083
11084 \end_inset
11085
11086
11087 \begin_inset Quotes erd
11088 \end_inset
11089
11090 .
11091  See section 
11092 \begin_inset CommandInset ref
11093 LatexCommand ref
11094 reference "sub:I18n"
11095
11096 \end_inset
11097
11098  for details on its use.
11099 \end_layout
11100
11101 \begin_layout Description
11102 \begin_inset Flex Code
11103 status collapsed
11104
11105 \begin_layout Plain Layout
11106 LatexName
11107 \end_layout
11108
11109 \end_inset
11110
11111  The name of the corresponding LaTeX stuff.
11112  Either the environment or command name.
11113 \end_layout
11114
11115 \begin_layout Description
11116 \begin_inset Flex Code
11117 status collapsed
11118
11119 \begin_layout Plain Layout
11120 LatexParam
11121 \end_layout
11122
11123 \end_inset
11124
11125  An optional parameter for the corresponding 
11126 \begin_inset Flex Code
11127 status collapsed
11128
11129 \begin_layout Plain Layout
11130 LatexName
11131 \end_layout
11132
11133 \end_inset
11134
11135  stuff.
11136  This parameter cannot be changed from within LyX.
11137 \end_layout
11138
11139 \begin_layout Description
11140 \begin_inset Flex Code
11141 status collapsed
11142
11143 \begin_layout Plain Layout
11144 LatexType
11145 \end_layout
11146
11147 \end_inset
11148
11149  
11150 \begin_inset CommandInset label
11151 LatexCommand label
11152 name "des:LatexType"
11153
11154 \end_inset
11155
11156 [
11157 \begin_inset Flex Code
11158 status collapsed
11159
11160 \begin_layout Plain Layout
11161
11162 \emph on
11163 Paragraph
11164 \emph default
11165 , Command, Environment, Item_Environment,
11166 \end_layout
11167
11168 \end_inset
11169
11170  
11171 \begin_inset Flex Code
11172 status collapsed
11173
11174 \begin_layout Plain Layout
11175 List_Environment, Bib_Environment
11176 \end_layout
11177
11178 \end_inset
11179
11180 ] How the style should be translated into LaTeX.
11181 \begin_inset Foot
11182 status collapsed
11183
11184 \begin_layout Plain Layout
11185 \begin_inset Flex Code
11186 status collapsed
11187
11188 \begin_layout Plain Layout
11189 LatexType
11190 \end_layout
11191
11192 \end_inset
11193
11194  is perhaps a bit misleading, since these rules apply to SGML classes, too.
11195  Visit the SGML class files for specific examples.
11196 \end_layout
11197
11198 \end_inset
11199
11200
11201 \end_layout
11202
11203 \begin_deeper
11204 \begin_layout Itemize
11205 \begin_inset Flex Code
11206 status collapsed
11207
11208 \begin_layout Plain Layout
11209 Paragraph
11210 \end_layout
11211
11212 \end_inset
11213
11214  means nothing special.
11215  
11216 \end_layout
11217
11218 \begin_layout Itemize
11219 \begin_inset Flex Code
11220 status collapsed
11221
11222 \begin_layout Plain Layout
11223 Command
11224 \end_layout
11225
11226 \end_inset
11227
11228  means 
11229 \begin_inset Flex Code
11230 status collapsed
11231
11232 \begin_layout Plain Layout
11233
11234 \backslash
11235
11236 \emph on
11237 LatexName
11238 \emph default
11239 {\SpecialChar \ldots{}
11240 }
11241 \end_layout
11242
11243 \end_inset
11244
11245 .
11246 \end_layout
11247
11248 \begin_layout Itemize
11249 \begin_inset Flex Code
11250 status collapsed
11251
11252 \begin_layout Plain Layout
11253 Environment
11254 \end_layout
11255
11256 \end_inset
11257
11258  means 
11259 \begin_inset Flex Code
11260 status collapsed
11261
11262 \begin_layout Plain Layout
11263
11264 \backslash
11265 begin{
11266 \emph on
11267 LatexName
11268 \emph default
11269 }\SpecialChar \ldots{}
11270
11271 \backslash
11272 end{
11273 \emph on
11274 LatexName
11275 \emph default
11276 }
11277 \end_layout
11278
11279 \end_inset
11280
11281 .
11282  
11283 \end_layout
11284
11285 \begin_layout Itemize
11286 \begin_inset Flex Code
11287 status collapsed
11288
11289 \begin_layout Plain Layout
11290 Item_Environment
11291 \end_layout
11292
11293 \end_inset
11294
11295  is the same as 
11296 \begin_inset Flex Code
11297 status collapsed
11298
11299 \begin_layout Plain Layout
11300 Environment
11301 \end_layout
11302
11303 \end_inset
11304
11305 , except that an 
11306 \begin_inset Flex Code
11307 status collapsed
11308
11309 \begin_layout Plain Layout
11310
11311 \backslash
11312 item
11313 \end_layout
11314
11315 \end_inset
11316
11317  is generated for each paragraph of this environment.
11318  
11319 \end_layout
11320
11321 \begin_layout Itemize
11322 \begin_inset Flex Code
11323 status collapsed
11324
11325 \begin_layout Plain Layout
11326 List_Environment
11327 \end_layout
11328
11329 \end_inset
11330
11331  is the same as 
11332 \begin_inset Flex Code
11333 status collapsed
11334
11335 \begin_layout Plain Layout
11336 Item_Environment
11337 \end_layout
11338
11339 \end_inset
11340
11341 , except that 
11342 \begin_inset Flex Code
11343 status collapsed
11344
11345 \begin_layout Plain Layout
11346 LabelWidthString
11347 \end_layout
11348
11349 \end_inset
11350
11351  is passed as an argument to the environment.
11352  
11353 \begin_inset Flex Code
11354 status collapsed
11355
11356 \begin_layout Plain Layout
11357 LabelWidthString
11358 \end_layout
11359
11360 \end_inset
11361
11362  can be defined in the 
11363 \begin_inset Flex MenuItem
11364 status collapsed
11365
11366 \begin_layout Plain Layout
11367
11368 \bar under
11369 Edit
11370 \bar default
11371 \SpecialChar \menuseparator
11372
11373 \bar under
11374 P
11375 \bar default
11376 aragraph
11377 \begin_inset space ~
11378 \end_inset
11379
11380 settings
11381 \end_layout
11382
11383 \end_inset
11384
11385  dialog.
11386  
11387 \end_layout
11388
11389 \begin_layout Standard
11390 Putting the last few things together, the LaTeX output will be either: 
11391 \end_layout
11392
11393 \begin_layout LyX-Code
11394
11395 \backslash
11396 latexname[latexparam]{\SpecialChar \ldots{}
11397 }
11398 \end_layout
11399
11400 \begin_layout Standard
11401 or: 
11402 \end_layout
11403
11404 \begin_layout LyX-Code
11405
11406 \backslash
11407 begin{latexname}[latexparam] \SpecialChar \ldots{}
11408  
11409 \backslash
11410 end{latexname}.
11411 \end_layout
11412
11413 \begin_layout Standard
11414 depending upon the LaTeX type.
11415 \end_layout
11416
11417 \end_deeper
11418 \begin_layout Description
11419 \begin_inset Flex Code
11420 status collapsed
11421
11422 \begin_layout Plain Layout
11423 LeftMargin
11424 \end_layout
11425
11426 \end_inset
11427
11428  [
11429 \begin_inset Flex Code
11430 status collapsed
11431
11432 \begin_layout Plain Layout
11433 string=""
11434 \end_layout
11435
11436 \end_inset
11437
11438 ] If you put styles into environments, the leftmargins are not simply added,
11439  but added with a factor 
11440 \begin_inset Formula $\frac{4}{depth+4}$
11441 \end_inset
11442
11443 .
11444  Note that this parameter is also used when the margin is defined as 
11445 \begin_inset Flex Code
11446 status collapsed
11447
11448 \begin_layout Plain Layout
11449 Manual
11450 \end_layout
11451
11452 \end_inset
11453
11454  or 
11455 \begin_inset Flex Code
11456 status collapsed
11457
11458 \begin_layout Plain Layout
11459 Dynamic
11460 \end_layout
11461
11462 \end_inset
11463
11464 .
11465  Then it is added to the manual or dynamic margin.
11466  
11467 \begin_inset Newline newline
11468 \end_inset
11469
11470 The argument is passed as a string.
11471  For example 
11472 \begin_inset Quotes eld
11473 \end_inset
11474
11475
11476 \begin_inset Flex Code
11477 status collapsed
11478
11479 \begin_layout Plain Layout
11480 MM
11481 \end_layout
11482
11483 \end_inset
11484
11485
11486 \begin_inset Quotes erd
11487 \end_inset
11488
11489  means that the paragraph is indented with the width of 
11490 \begin_inset Quotes eld
11491 \end_inset
11492
11493
11494 \begin_inset Flex Code
11495 status collapsed
11496
11497 \begin_layout Plain Layout
11498 MM
11499 \end_layout
11500
11501 \end_inset
11502
11503
11504 \begin_inset Quotes erd
11505 \end_inset
11506
11507  in the normal font.
11508  You can get a negative width by prefixing the string with 
11509 \begin_inset Quotes eld
11510 \end_inset
11511
11512
11513 \begin_inset Flex Code
11514 status collapsed
11515
11516 \begin_layout Plain Layout
11517 -
11518 \end_layout
11519
11520 \end_inset
11521
11522
11523 \begin_inset Quotes erd
11524 \end_inset
11525
11526 .
11527  This way was chosen so that the look is the same with each used screen
11528  font.
11529  
11530 \end_layout
11531
11532 \begin_layout Description
11533 \begin_inset Flex Code
11534 status collapsed
11535
11536 \begin_layout Plain Layout
11537 Margin
11538 \end_layout
11539
11540 \end_inset
11541
11542  [
11543 \begin_inset Flex Code
11544 status collapsed
11545
11546 \begin_layout Plain Layout
11547
11548 \emph on
11549 Static
11550 \emph default
11551 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11552 \end_layout
11553
11554 \end_inset
11555
11556
11557 \begin_inset Newline newline
11558 \end_inset
11559
11560 The kind of margin that the style has on the left side.
11561  
11562 \begin_inset Flex Code
11563 status collapsed
11564
11565 \begin_layout Plain Layout
11566 Static
11567 \end_layout
11568
11569 \end_inset
11570
11571  just means a fixed margin.
11572  
11573 \begin_inset Flex Code
11574 status collapsed
11575
11576 \begin_layout Plain Layout
11577 Manual
11578 \end_layout
11579
11580 \end_inset
11581
11582  means that the left margin depends on the string entered in the 
11583 \begin_inset Flex MenuItem
11584 status collapsed
11585
11586 \begin_layout Plain Layout
11587 Edit\SpecialChar \menuseparator
11588 Paragraph
11589 \begin_inset space ~
11590 \end_inset
11591
11592 Settings
11593 \end_layout
11594
11595 \end_inset
11596
11597  dialog.
11598  This is used to typeset nice lists without tabulators.
11599  
11600 \begin_inset Flex Code
11601 status collapsed
11602
11603 \begin_layout Plain Layout
11604 Dynamic
11605 \end_layout
11606
11607 \end_inset
11608
11609  means that the margin depends on the size of the label.
11610  This is used for automatic enumerated headlines.
11611  It is obvious that the headline 
11612 \begin_inset Quotes eld
11613 \end_inset
11614
11615 5.4.3.2.1 Very long headline
11616 \begin_inset Quotes erd
11617 \end_inset
11618
11619  must have a wider left margin (as wide as 
11620 \begin_inset Quotes eld
11621 \end_inset
11622
11623 5.4.3.2.1
11624 \begin_inset Quotes erd
11625 \end_inset
11626
11627  plus the space) than 
11628 \begin_inset Quotes eld
11629 \end_inset
11630
11631 3.2 Very long headline
11632 \begin_inset Quotes erd
11633 \end_inset
11634
11635 , even if standard 
11636 \begin_inset Quotes eld
11637 \end_inset
11638
11639 word processors
11640 \begin_inset Quotes erd
11641 \end_inset
11642
11643  are not able to do this.
11644  
11645 \begin_inset Flex Code
11646 status collapsed
11647
11648 \begin_layout Plain Layout
11649 First_Dynamic
11650 \end_layout
11651
11652 \end_inset
11653
11654  is similar, but only the very first row of the paragraph is dynamic, while
11655  the others are static; this is used, for example, for descriptions.
11656  
11657 \begin_inset Flex Code
11658 status collapsed
11659
11660 \begin_layout Plain Layout
11661 Right_Address_Box
11662 \end_layout
11663
11664 \end_inset
11665
11666  means the margin is chosen in a way that the longest row of this paragraph
11667  fits to the right margin.
11668  This is used to typeset an address on the right edge of the page.
11669 \end_layout
11670
11671 \begin_layout Description
11672 \begin_inset Flex Code
11673 status collapsed
11674
11675 \begin_layout Plain Layout
11676 NeedProtect
11677 \end_layout
11678
11679 \end_inset
11680
11681  [
11682 \begin_inset Flex Code
11683 status collapsed
11684
11685 \begin_layout Plain Layout
11686
11687 \emph on
11688 0
11689 \end_layout
11690
11691 \end_inset
11692
11693 ,
11694 \begin_inset Flex Code
11695 status collapsed
11696
11697 \begin_layout Plain Layout
11698 1
11699 \end_layout
11700
11701 \end_inset
11702
11703 ] Whether fragile commands in this style should be 
11704 \begin_inset Flex Code
11705 status collapsed
11706
11707 \begin_layout Plain Layout
11708
11709 \backslash
11710 protect
11711 \end_layout
11712
11713 \end_inset
11714
11715 'ed.
11716  (Note: This is 
11717 \emph on
11718 not
11719 \emph default
11720  whether this command should itself be protected.)
11721 \end_layout
11722
11723 \begin_layout Description
11724 \begin_inset Flex Code
11725 status collapsed
11726
11727 \begin_layout Plain Layout
11728 Newline
11729 \end_layout
11730
11731 \end_inset
11732
11733  [
11734 \begin_inset Flex Code
11735 status collapsed
11736
11737 \begin_layout Plain Layout
11738 0
11739 \end_layout
11740
11741 \end_inset
11742
11743
11744 \begin_inset Flex Code
11745 status collapsed
11746
11747 \begin_layout Plain Layout
11748
11749 \emph on
11750 1
11751 \end_layout
11752
11753 \end_inset
11754
11755 ] Whether newlines are translated into LaTeX newlines (
11756 \begin_inset Flex Code
11757 status collapsed
11758
11759 \begin_layout Plain Layout
11760
11761 \backslash
11762
11763 \backslash
11764
11765 \end_layout
11766
11767 \end_inset
11768
11769 ) or not.
11770  The translation can be switched off to allow more comfortable LaTeX editing
11771  inside LyX.
11772 \end_layout
11773
11774 \begin_layout Description
11775 \begin_inset Flex Code
11776 status collapsed
11777
11778 \begin_layout Plain Layout
11779 NextNoIndent
11780 \end_layout
11781
11782 \end_inset
11783
11784  [
11785 \begin_inset Flex Code
11786 status collapsed
11787
11788 \begin_layout Plain Layout
11789 1
11790 \end_layout
11791
11792 \end_inset
11793
11794
11795 \begin_inset Flex Code
11796 status collapsed
11797
11798 \begin_layout Plain Layout
11799
11800 \emph on
11801 0
11802 \end_layout
11803
11804 \end_inset
11805
11806 ] If set to true, and if 
11807 \begin_inset Flex Code
11808 status collapsed
11809
11810 \begin_layout Plain Layout
11811 DefaultStyle
11812 \end_layout
11813
11814 \end_inset
11815
11816  (usually 
11817 \begin_inset Flex Code
11818 status collapsed
11819
11820 \begin_layout Plain Layout
11821 Standard
11822 \end_layout
11823
11824 \end_inset
11825
11826 ) paragraphs are being indented, then the indentation of such a paragraph
11827  following one of this type will be suppressed.
11828  (So this will not affect the display of non-default paragraphs.)
11829 \end_layout
11830
11831 \begin_layout Description
11832 \begin_inset Flex Code
11833 status collapsed
11834
11835 \begin_layout Plain Layout
11836 ObsoletedBy
11837 \end_layout
11838
11839 \end_inset
11840
11841  Name of a style that has replaced this style.
11842  This is used to rename a style, while keeping backward compatibility.
11843 \end_layout
11844
11845 \begin_layout Description
11846 \begin_inset Flex Code
11847 status collapsed
11848
11849 \begin_layout Plain Layout
11850 OptionalArgs
11851 \end_layout
11852
11853 \end_inset
11854
11855  [
11856 \begin_inset Flex Code
11857 status collapsed
11858
11859 \begin_layout Plain Layout
11860 int=0
11861 \end_layout
11862
11863 \end_inset
11864
11865 ] The number of optional arguments that can be used with this style.
11866  This is useful for things like section headings, and only makes sense with
11867  LaTeX.
11868  Note that, on output, the optional arguments will all precede any required
11869  arguments (see below).
11870  So one can have constructs like:
11871 \end_layout
11872
11873 \begin_deeper
11874 \begin_layout LyX-Code
11875
11876 \backslash
11877 mycmd[opt1]{req1}{contents of paragraph}
11878 \end_layout
11879
11880 \begin_layout Standard
11881 but one cannot have things like: 
11882 \end_layout
11883
11884 \begin_layout LyX-Code
11885
11886 \backslash
11887 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11888 \end_layout
11889
11890 \begin_layout Standard
11891 at least, not without ERT (with which you can have anything).
11892  
11893 \end_layout
11894
11895 \end_deeper
11896 \begin_layout Description
11897 \begin_inset Flex Code
11898 status collapsed
11899
11900 \begin_layout Plain Layout
11901 ParbreakIsNewline
11902 \end_layout
11903
11904 \end_inset
11905
11906
11907 \begin_inset CommandInset label
11908 LatexCommand label
11909 name "des:ParbreakIsNewline"
11910
11911 \end_inset
11912
11913  [
11914 \begin_inset Flex Code
11915 status collapsed
11916
11917 \begin_layout Plain Layout
11918
11919 \emph on
11920 0
11921 \end_layout
11922
11923 \end_inset
11924
11925
11926 \begin_inset Flex Code
11927 status collapsed
11928
11929 \begin_layout Plain Layout
11930 1
11931 \end_layout
11932
11933 \end_inset
11934
11935 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11936  output, but only by a line break; together with 
11937 \begin_inset Flex Code
11938 status collapsed
11939
11940 \begin_layout Plain Layout
11941 PassThru 1
11942 \end_layout
11943
11944 \end_inset
11945
11946 , this allows to emulate a plain text editor (like the ERT inset).
11947 \end_layout
11948
11949 \begin_layout Description
11950 \begin_inset Flex Code
11951 status collapsed
11952
11953 \begin_layout Plain Layout
11954 ParIndent
11955 \end_layout
11956
11957 \end_inset
11958
11959  [
11960 \begin_inset Flex Code
11961 status collapsed
11962
11963 \begin_layout Plain Layout
11964 string=""
11965 \end_layout
11966
11967 \end_inset
11968
11969 ] The indent of the very first line of a paragraph.
11970  The 
11971 \begin_inset Flex Code
11972 status collapsed
11973
11974 \begin_layout Plain Layout
11975 Parindent
11976 \end_layout
11977
11978 \end_inset
11979
11980  will be fixed for a certain style.
11981  The exception is the default style, since the indentation for these paragraphs
11982  can be prohibited with 
11983 \begin_inset Flex Code
11984 status collapsed
11985
11986 \begin_layout Plain Layout
11987 NextNoIndent
11988 \end_layout
11989
11990 \end_inset
11991
11992 .
11993  Also, 
11994 \begin_inset Flex Code
11995 status collapsed
11996
11997 \begin_layout Plain Layout
11998 Standard
11999 \end_layout
12000
12001 \end_inset
12002
12003  style paragraphs inside environments use the 
12004 \begin_inset Flex Code
12005 status collapsed
12006
12007 \begin_layout Plain Layout
12008 Parindent
12009 \end_layout
12010
12011 \end_inset
12012
12013  of the environment, not their native one.
12014  For example, 
12015 \begin_inset Flex Code
12016 status collapsed
12017
12018 \begin_layout Plain Layout
12019 Standard
12020 \end_layout
12021
12022 \end_inset
12023
12024  paragraphs inside an enumeration are not indented.
12025 \end_layout
12026
12027 \begin_layout Description
12028 \begin_inset Flex Code
12029 status collapsed
12030
12031 \begin_layout Plain Layout
12032 Parsep
12033 \end_layout
12034
12035 \end_inset
12036
12037  [
12038 \begin_inset Flex Code
12039 status collapsed
12040
12041 \begin_layout Plain Layout
12042 float=0
12043 \end_layout
12044
12045 \end_inset
12046
12047 ] The vertical space between two paragraphs of this style.
12048 \end_layout
12049
12050 \begin_layout Description
12051 \begin_inset Flex Code
12052 status collapsed
12053
12054 \begin_layout Plain Layout
12055 Parskip
12056 \end_layout
12057
12058 \end_inset
12059
12060  [
12061 \begin_inset Flex Code
12062 status collapsed
12063
12064 \begin_layout Plain Layout
12065 float=0
12066 \end_layout
12067
12068 \end_inset
12069
12070 ] LyX allows the user to choose either 
12071 \begin_inset Quotes eld
12072 \end_inset
12073
12074 indent
12075 \begin_inset Quotes erd
12076 \end_inset
12077
12078  or 
12079 \begin_inset Quotes eld
12080 \end_inset
12081
12082 skip
12083 \begin_inset Quotes erd
12084 \end_inset
12085
12086  to typeset a document.
12087  When 
12088 \begin_inset Quotes eld
12089 \end_inset
12090
12091 indent
12092 \begin_inset Quotes erd
12093 \end_inset
12094
12095  is chosen, this value is completely ignored.
12096  When 
12097 \begin_inset Quotes eld
12098 \end_inset
12099
12100 skip
12101 \begin_inset Quotes erd
12102 \end_inset
12103
12104  is chosen, the parindent of a LaTeXtype 
12105 \begin_inset Quotes eld
12106 \end_inset
12107
12108 Paragraph
12109 \begin_inset Quotes erd
12110 \end_inset
12111
12112  style is ignored and all paragraphs are separated by this parskip argument.
12113  The vertical space is calculated with 
12114 \begin_inset Flex Code
12115 status collapsed
12116
12117 \begin_layout Plain Layout
12118 value
12119 \begin_inset space ~
12120 \end_inset
12121
12122 * DefaultHeight
12123 \end_layout
12124
12125 \end_inset
12126
12127  where 
12128 \begin_inset Flex Code
12129 status collapsed
12130
12131 \begin_layout Plain Layout
12132 DefaultHeight
12133 \end_layout
12134
12135 \end_inset
12136
12137  is the height of a row with the normal font.
12138  This way, the look stays the same with different screen fonts.
12139 \end_layout
12140
12141 \begin_layout Description
12142 \begin_inset Flex Code
12143 status collapsed
12144
12145 \begin_layout Plain Layout
12146 PassThru
12147 \end_layout
12148
12149 \end_inset
12150
12151  
12152 \begin_inset CommandInset label
12153 LatexCommand label
12154 name "des:PassThru"
12155
12156 \end_inset
12157
12158 [
12159 \begin_inset Flex Code
12160 status collapsed
12161
12162 \begin_layout Plain Layout
12163
12164 \emph on
12165 0
12166 \end_layout
12167
12168 \end_inset
12169
12170
12171 \begin_inset Flex Code
12172 status collapsed
12173
12174 \begin_layout Plain Layout
12175 1
12176 \end_layout
12177
12178 \end_inset
12179
12180 ] Whether the contents of this paragraph should be output in raw form, meaning
12181  without special translations that LaTeX would require.
12182 \end_layout
12183
12184 \begin_layout Description
12185 \begin_inset Flex Code
12186 status collapsed
12187
12188 \begin_layout Plain Layout
12189 Preamble
12190 \end_layout
12191
12192 \end_inset
12193
12194  
12195 \begin_inset CommandInset label
12196 LatexCommand label
12197 name "des:Preamble"
12198
12199 \end_inset
12200
12201 Information to be included in the LaTeX preamble when this style is used.
12202  Used to define macros, load packages, etc., required by this particular
12203  style.
12204  Must end with 
12205 \begin_inset Quotes eld
12206 \end_inset
12207
12208
12209 \begin_inset Flex Code
12210 status collapsed
12211
12212 \begin_layout Plain Layout
12213 EndPreamble
12214 \end_layout
12215
12216 \end_inset
12217
12218
12219 \begin_inset Quotes erd
12220 \end_inset
12221
12222 .
12223 \end_layout
12224
12225 \begin_layout Description
12226 \begin_inset Flex Code
12227 status collapsed
12228
12229 \begin_layout Plain Layout
12230 RefPrefix
12231 \end_layout
12232
12233 \end_inset
12234
12235  [
12236 \begin_inset Flex Code
12237 status collapsed
12238
12239 \begin_layout Plain Layout
12240 string
12241 \end_layout
12242
12243 \end_inset
12244
12245 ] The prefix to use when creating labels referring to paragraphs of this
12246  type.
12247  This allows the use of formatted references.
12248 \end_layout
12249
12250 \begin_layout Description
12251 \begin_inset Flex Code
12252 status collapsed
12253
12254 \begin_layout Plain Layout
12255 RequiredArgs
12256 \end_layout
12257
12258 \end_inset
12259
12260  [
12261 \begin_inset Flex Code
12262 status collapsed
12263
12264 \begin_layout Plain Layout
12265 int=0
12266 \end_layout
12267
12268 \end_inset
12269
12270 ] The number of required arguments that the LaTeX command or environment
12271  corresponding to this style expects.
12272  In the case of a command, these are required arguments 
12273 \emph on
12274 other than
12275 \emph default
12276  that associated with the content of the paragraph itself.
12277  These do not actually have to be provided: LyX will output empty arguments
12278  if necessary.
12279  Note that optional arguments will be output before required arguments.
12280  See the discussion of the 
12281 \begin_inset Flex Code
12282 status collapsed
12283
12284 \begin_layout Plain Layout
12285 OptionalArgs
12286 \end_layout
12287
12288 \end_inset
12289
12290  tag above for more information.
12291 \end_layout
12292
12293 \begin_layout Description
12294 \begin_inset Flex Code
12295 status collapsed
12296
12297 \begin_layout Plain Layout
12298 Requires 
12299 \end_layout
12300
12301 \end_inset
12302
12303  [
12304 \begin_inset Flex Code
12305 status collapsed
12306
12307 \begin_layout Plain Layout
12308 string
12309 \end_layout
12310
12311 \end_inset
12312
12313
12314 \begin_inset CommandInset label
12315 LatexCommand label
12316 name "des:Requires"
12317
12318 \end_inset
12319
12320 Whether the style requires the feature 
12321 \begin_inset Flex Code
12322 status collapsed
12323
12324 \begin_layout Plain Layout
12325 string
12326 \end_layout
12327
12328 \end_inset
12329
12330 .
12331  See the description of 
12332 \begin_inset Flex Code
12333 status collapsed
12334
12335 \begin_layout Plain Layout
12336 Provides
12337 \end_layout
12338
12339 \end_inset
12340
12341  above (page 
12342 \begin_inset CommandInset ref
12343 LatexCommand pageref
12344 reference "des:FreeSpacing"
12345
12346 \end_inset
12347
12348 ) for information on `features'.
12349  
12350 \end_layout
12351
12352 \begin_layout Description
12353 \begin_inset Flex Code
12354 status collapsed
12355
12356 \begin_layout Plain Layout
12357 RightMargin
12358 \end_layout
12359
12360 \end_inset
12361
12362  [
12363 \begin_inset Flex Code
12364 status collapsed
12365
12366 \begin_layout Plain Layout
12367 string=""
12368 \end_layout
12369
12370 \end_inset
12371
12372 ] Similar to 
12373 \begin_inset Flex Code
12374 status collapsed
12375
12376 \begin_layout Plain Layout
12377 LeftMargin
12378 \end_layout
12379
12380 \end_inset
12381
12382 .
12383 \end_layout
12384
12385 \begin_layout Description
12386 \begin_inset Flex Code
12387 status collapsed
12388
12389 \begin_layout Plain Layout
12390 Spacing
12391 \end_layout
12392
12393 \end_inset
12394
12395  [
12396 \begin_inset Flex Code
12397 status collapsed
12398
12399 \begin_layout Plain Layout
12400
12401 \emph on
12402 single
12403 \emph default
12404 , onehalf, double, other
12405 \end_layout
12406
12407 \end_inset
12408
12409  
12410 \emph on
12411 value
12412 \emph default
12413 ] This defines what the default spacing should be in the style.
12414  The arguments 
12415 \begin_inset Flex Code
12416 status collapsed
12417
12418 \begin_layout Plain Layout
12419 single
12420 \end_layout
12421
12422 \end_inset
12423
12424
12425 \begin_inset Flex Code
12426 status collapsed
12427
12428 \begin_layout Plain Layout
12429 onehalf
12430 \end_layout
12431
12432 \end_inset
12433
12434  and 
12435 \begin_inset Flex Code
12436 status collapsed
12437
12438 \begin_layout Plain Layout
12439 double
12440 \end_layout
12441
12442 \end_inset
12443
12444  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12445  If you specify the argument 
12446 \begin_inset Flex Code
12447 status collapsed
12448
12449 \begin_layout Plain Layout
12450 other
12451 \end_layout
12452
12453 \end_inset
12454
12455 , then you should also provide a numerical argument which will be the actual
12456  multiplier value.
12457  Note that, contrary to other parameters, 
12458 \begin_inset Flex Code
12459 status collapsed
12460
12461 \begin_layout Plain Layout
12462 Spacing
12463 \end_layout
12464
12465 \end_inset
12466
12467  implies the generation of specific LaTeX code, using the package 
12468 \family roman
12469
12470 \begin_inset Flex Code
12471 status collapsed
12472
12473 \begin_layout Plain Layout
12474 setspace.sty
12475 \end_layout
12476
12477 \end_inset
12478
12479 .
12480 \end_layout
12481
12482 \begin_layout Description
12483 \begin_inset Flex Code
12484 status collapsed
12485
12486 \begin_layout Plain Layout
12487 Spellcheck
12488 \end_layout
12489
12490 \end_inset
12491
12492  [
12493 \begin_inset Flex Code
12494 status collapsed
12495
12496 \begin_layout Plain Layout
12497 0
12498 \end_layout
12499
12500 \end_inset
12501
12502 ,
12503 \begin_inset Flex Code
12504 status collapsed
12505
12506 \begin_layout Plain Layout
12507
12508 \emph on
12509 1
12510 \end_layout
12511
12512 \end_inset
12513
12514 ] Spellcheck paragraphs of this style.
12515  Default is true.
12516 \end_layout
12517
12518 \begin_layout Description
12519 \begin_inset Flex Code
12520 status collapsed
12521
12522 \begin_layout Plain Layout
12523 TextFont
12524 \end_layout
12525
12526 \end_inset
12527
12528  The font used for the text body .
12529  See section 
12530 \begin_inset CommandInset ref
12531 LatexCommand ref
12532 reference "sub:Font-description"
12533
12534 \end_inset
12535
12536 .
12537 \end_layout
12538
12539 \begin_layout Description
12540 \begin_inset Flex Code
12541 status collapsed
12542
12543 \begin_layout Plain Layout
12544 TocLevel
12545 \end_layout
12546
12547 \end_inset
12548
12549
12550 \series medium
12551  
12552 \begin_inset Flex Code
12553 status collapsed
12554
12555 \begin_layout Plain Layout
12556
12557 \series medium
12558 [int]
12559 \end_layout
12560
12561 \end_inset
12562
12563
12564 \series default
12565  The level of the style in the table of contents.
12566  This is used for automatic numbering of section headings.
12567 \end_layout
12568
12569 \begin_layout Description
12570 \begin_inset Flex Code
12571 status collapsed
12572
12573 \begin_layout Plain Layout
12574 TopSep
12575 \end_layout
12576
12577 \end_inset
12578
12579  [
12580 \begin_inset Flex Code
12581 status collapsed
12582
12583 \begin_layout Plain Layout
12584 float=0
12585 \end_layout
12586
12587 \end_inset
12588
12589 ] The vertical space with which the very first of a chain of paragraphs
12590  with this style is separated from the previous paragraph.
12591  If the previous paragraph has another style, the separations are not simply
12592  added, but the maximum is taken.
12593 \end_layout
12594
12595 \begin_layout Subsection
12596 \begin_inset CommandInset label
12597 LatexCommand label
12598 name "sub:I18n"
12599
12600 \end_inset
12601
12602 Internationalization of Paragraph Styles
12603 \end_layout
12604
12605 \begin_layout Standard
12606 LyX has long supported internationalization of layout information, but,
12607  until version 2.0, this applied only to the user interface and not to, say,
12608  PDF output.
12609  Thus, French authors were forced to resort to ugly hacks if they wanted
12610  `
12611 \lang french
12612 Théorème
12613 \lang english
12614  1' instead of `Theorem 1'.
12615  Thanks to Georg Baum, that is no longer the case.
12616 \end_layout
12617
12618 \begin_layout Standard
12619 If a 
12620 \begin_inset Flex Code
12621 status collapsed
12622
12623 \begin_layout Plain Layout
12624 Style
12625 \end_layout
12626
12627 \end_inset
12628
12629  defines text that is to appear in the typeset document, it may use 
12630 \begin_inset Flex Code
12631 status collapsed
12632
12633 \begin_layout Plain Layout
12634 LangPreamble
12635 \end_layout
12636
12637 \end_inset
12638
12639  and 
12640 \begin_inset Flex Code
12641 status collapsed
12642
12643 \begin_layout Plain Layout
12644 BabelPreamble
12645 \end_layout
12646
12647 \end_inset
12648
12649  to support non-English and even multi-language documents correctly.
12650  The following excerpt (from the 
12651 \begin_inset Flex Code
12652 status collapsed
12653
12654 \begin_layout Plain Layout
12655 theorems-ams.inc
12656 \end_layout
12657
12658 \end_inset
12659
12660  file) shows how this works:
12661 \end_layout
12662
12663 \begin_layout LyX-Code
12664 Preamble
12665 \end_layout
12666
12667 \begin_deeper
12668 \begin_layout LyX-Code
12669   
12670 \backslash
12671 theoremstyle{remark}
12672 \end_layout
12673
12674 \begin_layout LyX-Code
12675   
12676 \backslash
12677 newtheorem{claim}[thm]{
12678 \backslash
12679 protect
12680 \backslash
12681 claimname}
12682 \end_layout
12683
12684 \begin_layout LyX-Code
12685 EndPreamble
12686 \end_layout
12687
12688 \begin_layout LyX-Code
12689 LangPreamble
12690 \end_layout
12691
12692 \begin_layout LyX-Code
12693   
12694 \backslash
12695 providecommand{
12696 \backslash
12697 claimname}{_(Claim)}
12698 \end_layout
12699
12700 \begin_layout LyX-Code
12701 EndLangPreamble
12702 \end_layout
12703
12704 \begin_layout LyX-Code
12705 BabelPreamble
12706 \end_layout
12707
12708 \begin_layout LyX-Code
12709     
12710 \backslash
12711 addto
12712 \backslash
12713 captions$$lang{
12714 \backslash
12715 renewcommand{
12716 \backslash
12717 claimname}{_(Claim)}}
12718 \end_layout
12719
12720 \begin_layout LyX-Code
12721 EndBabelPreamble
12722 \end_layout
12723
12724 \end_deeper
12725 \begin_layout Standard
12726 In principle, any legal LaTeX may appear in the 
12727 \begin_inset Flex Code
12728 status collapsed
12729
12730 \begin_layout Plain Layout
12731 LangPreamble
12732 \end_layout
12733
12734 \end_inset
12735
12736  and 
12737 \begin_inset Flex Code
12738 status collapsed
12739
12740 \begin_layout Plain Layout
12741 BabelPreamble
12742 \end_layout
12743
12744 \end_inset
12745
12746  tags, but in practice they will typically look as they do here.
12747  The key to correct translation of the typeset text is the definition of
12748  the LaTeX command 
12749 \begin_inset Flex Code
12750 status collapsed
12751
12752 \begin_layout Plain Layout
12753
12754 \backslash
12755 claimname
12756 \end_layout
12757
12758 \end_inset
12759
12760  and its use in 
12761 \begin_inset Flex Code
12762 status collapsed
12763
12764 \begin_layout Plain Layout
12765
12766 \backslash
12767 newtheorem
12768 \end_layout
12769
12770 \end_inset
12771
12772 .
12773  
12774 \end_layout
12775
12776 \begin_layout Standard
12777 The 
12778 \begin_inset Flex Code
12779 status collapsed
12780
12781 \begin_layout Plain Layout
12782 LangPreamble
12783 \end_layout
12784
12785 \end_inset
12786
12787  tag provides for internationalization based upon the overall language of
12788  the document.
12789  The contents of the tag will be included in the preamble, just as with
12790  the 
12791 \begin_inset Flex Code
12792 status collapsed
12793
12794 \begin_layout Plain Layout
12795 Preamble
12796 \end_layout
12797
12798 \end_inset
12799
12800  tag.
12801  What makes it special is the use of the 
12802 \begin_inset Quotes eld
12803 \end_inset
12804
12805 function
12806 \begin_inset Quotes erd
12807 \end_inset
12808
12809  
12810 \begin_inset Flex Code
12811 status collapsed
12812
12813 \begin_layout Plain Layout
12814 _()
12815 \end_layout
12816
12817 \end_inset
12818
12819 , which will be replaced, when LyX produces LaTeX output, with the translation
12820  of its argument into the document language.
12821 \end_layout
12822
12823 \begin_layout Standard
12824 The 
12825 \begin_inset Flex Code
12826 status collapsed
12827
12828 \begin_layout Plain Layout
12829 BabelPreamble
12830 \end_layout
12831
12832 \end_inset
12833
12834  tag is more complex, since it is meant to provide support for multi-language
12835  documents and so offers an interface to the 
12836 \begin_inset Flex Code
12837 status collapsed
12838
12839 \begin_layout Plain Layout
12840 babel
12841 \end_layout
12842
12843 \end_inset
12844
12845  package.
12846  Its contents will be added to the preamble once for each language that
12847  appears in the document.
12848  In this case, the argument to 
12849 \begin_inset Flex Code
12850 status collapsed
12851
12852 \begin_layout Plain Layout
12853 _()
12854 \end_layout
12855
12856 \end_inset
12857
12858  will be replaced with its translation into the language in question; the
12859  expression 
12860 \begin_inset Flex Code
12861 status collapsed
12862
12863 \begin_layout Plain Layout
12864 $$lang
12865 \end_layout
12866
12867 \end_inset
12868
12869  is replaced by the language name (as used by the babel package).
12870 \end_layout
12871
12872 \begin_layout Standard
12873 A German document that also included a French section would thus have the
12874  following in the preamble:
12875 \end_layout
12876
12877 \begin_layout LyX-Code
12878
12879 \backslash
12880 addto
12881 \backslash
12882 captionsfrench{
12883 \backslash
12884 renewcommand{
12885 \backslash
12886 claimname}{Affirmation}}   
12887 \backslash
12888 addto
12889 \backslash
12890 captionsngerman{
12891 \backslash
12892 renewcommand{
12893 \backslash
12894 claimname}{Behauptung}}   
12895 \backslash
12896 providecommand{
12897 \backslash
12898 claimname}{Behauptung}
12899 \end_layout
12900
12901 \begin_layout Standard
12902 LaTeX and 
12903 \begin_inset Flex Code
12904 status collapsed
12905
12906 \begin_layout Plain Layout
12907 babel
12908 \end_layout
12909
12910 \end_inset
12911
12912  will then conspire to produce the correct text in the output.
12913 \end_layout
12914
12915 \begin_layout Standard
12916 One important point to note here is that the translations are provided by
12917  LyX itself, through the same mechanism it uses for internationalization
12918  of the user interface.
12919  This means, in effect, that 
12920 \begin_inset Flex Code
12921 status collapsed
12922
12923 \begin_layout Plain Layout
12924 LangPreamble
12925 \end_layout
12926
12927 \end_inset
12928
12929  and 
12930 \begin_inset Flex Code
12931 status collapsed
12932
12933 \begin_layout Plain Layout
12934 BabelPreamble
12935 \end_layout
12936
12937 \end_inset
12938
12939  are really only of use in layout files that are provided with LyX, since
12940  text entered in user-created layout files will not be seen by LyX's internation
12941 alization routines.
12942  That said, however, any layout created with the intention that it will
12943  be included with LyX should use these tags where appropriate.
12944 \end_layout
12945
12946 \begin_layout Subsection
12947 Floats
12948 \begin_inset CommandInset label
12949 LatexCommand label
12950 name "sub:Floats"
12951
12952 \end_inset
12953
12954
12955 \end_layout
12956
12957 \begin_layout Standard
12958 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12959  define the floats (
12960 \begin_inset Flex MenuItem
12961 status collapsed
12962
12963 \begin_layout Plain Layout
12964 figure
12965 \end_layout
12966
12967 \end_inset
12968
12969
12970 \begin_inset Flex MenuItem
12971 status collapsed
12972
12973 \begin_layout Plain Layout
12974 table
12975 \end_layout
12976
12977 \end_inset
12978
12979 , \SpecialChar \ldots{}
12980 ) in the text class itself.
12981  Standard floats are included in the file 
12982 \begin_inset Flex Code
12983 status collapsed
12984
12985 \begin_layout Plain Layout
12986 stdfloats.inc
12987 \end_layout
12988
12989 \end_inset
12990
12991 , so you may have to do no more than add
12992 \end_layout
12993
12994 \begin_layout LyX-Code
12995 Input stdfloats.inc
12996 \end_layout
12997
12998 \begin_layout Standard
12999 to your layout file.
13000  If you want to implement a text class that proposes some other float types
13001  (like the AGU class bundled with LyX), the information below will hopefully
13002  help you:
13003 \end_layout
13004
13005 \begin_layout Description
13006 \begin_inset Flex Code
13007 status collapsed
13008
13009 \begin_layout Plain Layout
13010 Extension
13011 \end_layout
13012
13013 \end_inset
13014
13015  [
13016 \begin_inset Flex Code
13017 status collapsed
13018
13019 \begin_layout Plain Layout
13020 string
13021 \end_layout
13022
13023 \end_inset
13024
13025 =
13026 \begin_inset Quotes erd
13027 \end_inset
13028
13029
13030 \begin_inset Quotes erd
13031 \end_inset
13032
13033 ] The file name extension of an auxiliary file for the list of figures (or
13034  whatever).
13035  LaTeX writes the captions to this file.
13036 \end_layout
13037
13038 \begin_layout Description
13039 \begin_inset Flex Code
13040 status collapsed
13041
13042 \begin_layout Plain Layout
13043 GuiName
13044 \end_layout
13045
13046 \end_inset
13047
13048  [
13049 \begin_inset Flex Code
13050 status collapsed
13051
13052 \begin_layout Plain Layout
13053 string
13054 \end_layout
13055
13056 \end_inset
13057
13058 =
13059 \begin_inset Quotes erd
13060 \end_inset
13061
13062
13063 \begin_inset Quotes erd
13064 \end_inset
13065
13066 ] The string that will be used in the menus and also for the caption.
13067  This is translated to the current language if babel is used.
13068 \end_layout
13069
13070 \begin_layout Description
13071 \begin_inset Flex Code
13072 status collapsed
13073
13074 \begin_layout Plain Layout
13075 HTML*
13076 \end_layout
13077
13078 \end_inset
13079
13080  These are used for XHTML output.
13081  See 
13082 \begin_inset CommandInset ref
13083 LatexCommand ref
13084 reference "sec:Tags-for-XHTML"
13085
13086 \end_inset
13087
13088 .
13089 \end_layout
13090
13091 \begin_layout Description
13092 \begin_inset Flex Code
13093 status collapsed
13094
13095 \begin_layout Plain Layout
13096 IsPredefined
13097 \end_layout
13098
13099 \end_inset
13100
13101  [
13102 \emph on
13103
13104 \begin_inset Flex Code
13105 status open
13106
13107 \begin_layout Plain Layout
13108 0
13109 \end_layout
13110
13111 \end_inset
13112
13113
13114 \emph default
13115
13116 \begin_inset Flex Code
13117 status collapsed
13118
13119 \begin_layout Plain Layout
13120 1
13121 \end_layout
13122
13123 \end_inset
13124
13125 ] Indicates whether the float is already defined in the document class or
13126  if we instead need to load 
13127 \begin_inset Flex Code
13128 status collapsed
13129
13130 \begin_layout Plain Layout
13131 float.sty
13132 \end_layout
13133
13134 \end_inset
13135
13136  and use what it provides to define it on-the-fly.
13137  The default is 
13138 \begin_inset Flex Code
13139 status collapsed
13140
13141 \begin_layout Plain Layout
13142 0
13143 \end_layout
13144
13145 \end_inset
13146
13147 , which means: use 
13148 \begin_inset Flex Code
13149 status collapsed
13150
13151 \begin_layout Plain Layout
13152 float.sty
13153 \end_layout
13154
13155 \end_inset
13156
13157 .
13158  It should be set to 
13159 \begin_inset Flex Code
13160 status collapsed
13161
13162 \begin_layout Plain Layout
13163 1
13164 \end_layout
13165
13166 \end_inset
13167
13168  if the float is already defined by the LaTeX document class.
13169 \end_layout
13170
13171 \begin_layout Description
13172 \begin_inset Flex Code
13173 status collapsed
13174
13175 \begin_layout Plain Layout
13176 ListCommand
13177 \end_layout
13178
13179 \end_inset
13180
13181  [
13182 \begin_inset Flex Code
13183 status collapsed
13184
13185 \begin_layout Plain Layout
13186 string
13187 \end_layout
13188
13189 \end_inset
13190
13191 =
13192 \begin_inset Quotes erd
13193 \end_inset
13194
13195
13196 \begin_inset Quotes erd
13197 \end_inset
13198
13199 ] The command used to generate a list of floats of this type; the leading
13200  `
13201 \backslash
13202 ' should be omitted.
13203  This 
13204 \emph on
13205 must
13206 \emph default
13207  be given if 
13208 \begin_inset Flex Code
13209 status collapsed
13210
13211 \begin_layout Plain Layout
13212 UsesFloatPkg
13213 \end_layout
13214
13215 \end_inset
13216
13217  is false, since there is no standard way to generate this command.
13218  It is ignored if 
13219 \begin_inset Flex Code
13220 status collapsed
13221
13222 \begin_layout Plain Layout
13223 UsesFloatPkg
13224 \end_layout
13225
13226 \end_inset
13227
13228  is true, since in that case there is a standard way to define the command.
13229 \end_layout
13230
13231 \begin_layout Description
13232 \begin_inset Flex Code
13233 status collapsed
13234
13235 \begin_layout Plain Layout
13236 ListName
13237 \end_layout
13238
13239 \end_inset
13240
13241  [
13242 \begin_inset Flex Code
13243 status collapsed
13244
13245 \begin_layout Plain Layout
13246 string
13247 \end_layout
13248
13249 \end_inset
13250
13251 =
13252 \begin_inset Quotes erd
13253 \end_inset
13254
13255
13256 \begin_inset Quotes erd
13257 \end_inset
13258
13259 ] A title for a list of floats of this kind (list of figures, tables, or
13260  whatever).
13261  It is used for the screen label within LyX; it is passed to LaTeX for use
13262  as the title there; and it is used as the title in XHTML output.
13263  It will be translated to the document language.
13264 \end_layout
13265
13266 \begin_layout Description
13267 \begin_inset Flex Code
13268 status collapsed
13269
13270 \begin_layout Plain Layout
13271 NumberWithin
13272 \end_layout
13273
13274 \end_inset
13275
13276  [
13277 \begin_inset Flex Code
13278 status collapsed
13279
13280 \begin_layout Plain Layout
13281 string
13282 \end_layout
13283
13284 \end_inset
13285
13286 =
13287 \begin_inset Quotes erd
13288 \end_inset
13289
13290
13291 \begin_inset Quotes erd
13292 \end_inset
13293
13294 ] This (optional) argument determines whether floats of this class will
13295  be numbered within some sectional unit of the document.
13296  For example, if within is equal to 
13297 \begin_inset Flex Code
13298 status collapsed
13299
13300 \begin_layout Plain Layout
13301 chapter
13302 \end_layout
13303
13304 \end_inset
13305
13306 , the floats will be numbered within chapters.
13307  
13308 \end_layout
13309
13310 \begin_layout Description
13311 \begin_inset Flex Code
13312 status collapsed
13313
13314 \begin_layout Plain Layout
13315 Placement
13316 \end_layout
13317
13318 \end_inset
13319
13320  [
13321 \begin_inset Flex Code
13322 status collapsed
13323
13324 \begin_layout Plain Layout
13325 string
13326 \end_layout
13327
13328 \end_inset
13329
13330 =
13331 \begin_inset Quotes erd
13332 \end_inset
13333
13334
13335 \begin_inset Quotes erd
13336 \end_inset
13337
13338 ] The default placement for the given class of floats.
13339  The string should be as in standard LaTeX: 
13340 \begin_inset Flex Code
13341 status collapsed
13342
13343 \begin_layout Plain Layout
13344 t
13345 \end_layout
13346
13347 \end_inset
13348
13349
13350 \begin_inset Flex Code
13351 status collapsed
13352
13353 \begin_layout Plain Layout
13354 b
13355 \end_layout
13356
13357 \end_inset
13358
13359
13360 \begin_inset Flex Code
13361 status collapsed
13362
13363 \begin_layout Plain Layout
13364 p
13365 \end_layout
13366
13367 \end_inset
13368
13369  and 
13370 \begin_inset Flex Code
13371 status collapsed
13372
13373 \begin_layout Plain Layout
13374 h
13375 \end_layout
13376
13377 \end_inset
13378
13379  for top, bottom, page, and here, respectively.
13380 \begin_inset Foot
13381 status collapsed
13382
13383 \begin_layout Plain Layout
13384 Note that the order of these letters in the string is irrelevant, like in
13385  LaTeX.
13386 \end_layout
13387
13388 \end_inset
13389
13390  On top of that there is a new type, 
13391 \begin_inset Flex Code
13392 status collapsed
13393
13394 \begin_layout Plain Layout
13395 H
13396 \end_layout
13397
13398 \end_inset
13399
13400 , which does not really correspond to a float, since it means: put it 
13401 \begin_inset Quotes eld
13402 \end_inset
13403
13404 here
13405 \begin_inset Quotes erd
13406 \end_inset
13407
13408  and nowhere else.
13409  Note however that the 
13410 \begin_inset Flex Code
13411 status collapsed
13412
13413 \begin_layout Plain Layout
13414 H
13415 \end_layout
13416
13417 \end_inset
13418
13419  specifier is special and, because of implementation details, cannot be
13420  used in non-built in float types.
13421  If you do not understand what this means, just use 
13422 \begin_inset Quotes eld
13423 \end_inset
13424
13425
13426 \begin_inset Flex Code
13427 status collapsed
13428
13429 \begin_layout Plain Layout
13430 tbp
13431 \end_layout
13432
13433 \end_inset
13434
13435
13436 \begin_inset Quotes erd
13437 \end_inset
13438
13439 .
13440 \end_layout
13441
13442 \begin_layout Description
13443 \begin_inset Flex Code
13444 status collapsed
13445
13446 \begin_layout Plain Layout
13447 RefPrefix
13448 \end_layout
13449
13450 \end_inset
13451
13452  [
13453 \begin_inset Flex Code
13454 status collapsed
13455
13456 \begin_layout Plain Layout
13457 string
13458 \end_layout
13459
13460 \end_inset
13461
13462 ] The prefix to use when creating labels referring to floats of this type.
13463  This allows the use of formatted references.
13464  Note that you can remove any 
13465 \begin_inset Flex Code
13466 status collapsed
13467
13468 \begin_layout Plain Layout
13469 RefPrefix
13470 \end_layout
13471
13472 \end_inset
13473
13474  set by a copied style by using the special value 
13475 \begin_inset Quotes eld
13476 \end_inset
13477
13478 OFF
13479 \begin_inset Quotes erd
13480 \end_inset
13481
13482 , which must be all caps.
13483 \end_layout
13484
13485 \begin_layout Description
13486 \begin_inset Flex Code
13487 status collapsed
13488
13489 \begin_layout Plain Layout
13490 Style
13491 \end_layout
13492
13493 \end_inset
13494
13495  [
13496 \begin_inset Flex Code
13497 status collapsed
13498
13499 \begin_layout Plain Layout
13500 string
13501 \end_layout
13502
13503 \end_inset
13504
13505 =
13506 \begin_inset Quotes erd
13507 \end_inset
13508
13509
13510 \begin_inset Quotes erd
13511 \end_inset
13512
13513 ] The style used when defining the float using 
13514 \begin_inset Flex Code
13515 status collapsed
13516
13517 \begin_layout Plain Layout
13518
13519 \backslash
13520 newfloat
13521 \end_layout
13522
13523 \end_inset
13524
13525 .
13526 \end_layout
13527
13528 \begin_layout Description
13529 \begin_inset Flex Code
13530 status collapsed
13531
13532 \begin_layout Plain Layout
13533 Type
13534 \end_layout
13535
13536 \end_inset
13537
13538  [
13539 \begin_inset Flex Code
13540 status collapsed
13541
13542 \begin_layout Plain Layout
13543 string
13544 \end_layout
13545
13546 \end_inset
13547
13548 =
13549 \begin_inset Quotes erd
13550 \end_inset
13551
13552
13553 \begin_inset Quotes erd
13554 \end_inset
13555
13556 ] The 
13557 \begin_inset Quotes eld
13558 \end_inset
13559
13560 type
13561 \begin_inset Quotes erd
13562 \end_inset
13563
13564  of the new class of floats, like program or algorithm.
13565  After the appropriate 
13566 \begin_inset Flex Code
13567 status collapsed
13568
13569 \begin_layout Plain Layout
13570
13571 \backslash
13572 newfloat
13573 \end_layout
13574
13575 \end_inset
13576
13577 , commands such as 
13578 \begin_inset Flex Code
13579 status collapsed
13580
13581 \begin_layout Plain Layout
13582
13583 \backslash
13584 begin{program}
13585 \end_layout
13586
13587 \end_inset
13588
13589  or 
13590 \begin_inset Flex Code
13591 status collapsed
13592
13593 \begin_layout Plain Layout
13594
13595 \backslash
13596 end{algorithm*}
13597 \end_layout
13598
13599 \end_inset
13600
13601  will be available.
13602 \end_layout
13603
13604 \begin_layout Description
13605 \begin_inset Flex Code
13606 status collapsed
13607
13608 \begin_layout Plain Layout
13609 UsesFloatPkg
13610 \end_layout
13611
13612 \end_inset
13613
13614  [
13615 \begin_inset Flex Code
13616 status open
13617
13618 \begin_layout Plain Layout
13619 0
13620 \end_layout
13621
13622 \end_inset
13623
13624
13625 \begin_inset Flex Code
13626 status collapsed
13627
13628 \begin_layout Plain Layout
13629
13630 \emph on
13631 1
13632 \end_layout
13633
13634 \end_inset
13635
13636 ] Tells us whether this float is defined using the facilities provided by
13637  
13638 \begin_inset Flex Code
13639 status collapsed
13640
13641 \begin_layout Plain Layout
13642 float.sty
13643 \end_layout
13644
13645 \end_inset
13646
13647 , either by the class file or a package, or on-the-fly by LyX itself.
13648 \end_layout
13649
13650 \begin_layout Standard
13651 Note that defining a float with type 
13652 \begin_inset Flex Code
13653 status collapsed
13654
13655 \begin_layout Plain Layout
13656
13657 \emph on
13658 type
13659 \end_layout
13660
13661 \end_inset
13662
13663  automatically defines the corresponding counter with name 
13664 \begin_inset Flex Code
13665 status collapsed
13666
13667 \begin_layout Plain Layout
13668
13669 \emph on
13670 type
13671 \end_layout
13672
13673 \end_inset
13674
13675 .
13676 \end_layout
13677
13678 \begin_layout Subsection
13679 Flex insets and InsetLayout
13680 \begin_inset CommandInset label
13681 LatexCommand label
13682 name "sub:Flex-insets-and"
13683
13684 \end_inset
13685
13686
13687 \end_layout
13688
13689 \begin_layout Standard
13690 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13691  these are called Flex insets.
13692  
13693 \end_layout
13694
13695 \begin_layout Standard
13696 Flex insets come in three different kinds: 
13697 \end_layout
13698
13699 \begin_layout Itemize
13700 character style (
13701 \begin_inset Flex Code
13702 status collapsed
13703
13704 \begin_layout Plain Layout
13705 CharStyle
13706 \end_layout
13707
13708 \end_inset
13709
13710 ): These define semantic markup corresponding to such LaTeX commands as
13711  
13712 \begin_inset Flex Code
13713 status collapsed
13714
13715 \begin_layout Plain Layout
13716
13717 \backslash
13718 noun
13719 \end_layout
13720
13721 \end_inset
13722
13723  and 
13724 \begin_inset Flex Code
13725 status collapsed
13726
13727 \begin_layout Plain Layout
13728
13729 \backslash
13730 code
13731 \end_layout
13732
13733 \end_inset
13734
13735 .
13736 \end_layout
13737
13738 \begin_layout Itemize
13739 user custom (
13740 \begin_inset Flex Code
13741 status collapsed
13742
13743 \begin_layout Plain Layout
13744 Custom
13745 \end_layout
13746
13747 \end_inset
13748
13749 ): These can be used to define custom collapsible insets, similar to TeX
13750  code, footnote, and the like.
13751  An obvious example is an endnote inset, which is defined in the 
13752 \begin_inset Flex Code
13753 status collapsed
13754
13755 \begin_layout Plain Layout
13756 endnote
13757 \end_layout
13758
13759 \end_inset
13760
13761  module.
13762 \end_layout
13763
13764 \begin_layout Itemize
13765 XML elements (
13766 \begin_inset Flex Code
13767 status collapsed
13768
13769 \begin_layout Plain Layout
13770 Element
13771 \end_layout
13772
13773 \end_inset
13774
13775 ): For use with DocBook classes.
13776 \end_layout
13777
13778 \begin_layout Standard
13779 Flex insets are defined using the 
13780 \begin_inset Flex Code
13781 status collapsed
13782
13783 \begin_layout Plain Layout
13784 InsetLayout
13785 \end_layout
13786
13787 \end_inset
13788
13789  tag, which shall be explained in a moment.
13790 \end_layout
13791
13792 \begin_layout Standard
13793 The 
13794 \begin_inset Flex Code
13795 status collapsed
13796
13797 \begin_layout Plain Layout
13798 InsetLayout
13799 \end_layout
13800
13801 \end_inset
13802
13803  tag also serves another function: It can be used to customize the general
13804  layout of many different types of insets.
13805  Currently, 
13806 \begin_inset Flex Code
13807 status collapsed
13808
13809 \begin_layout Plain Layout
13810 InsetLayout
13811 \end_layout
13812
13813 \end_inset
13814
13815  can be used to customize the layout parameters for footnotes, marginal
13816  notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13817  boxes, tables, algorithms, URLs, and optional arguments, as well as to
13818  define Flex insets.
13819 \end_layout
13820
13821 \begin_layout Standard
13822 The 
13823 \begin_inset Flex Code
13824 status collapsed
13825
13826 \begin_layout Plain Layout
13827 InsetLayout
13828 \end_layout
13829
13830 \end_inset
13831
13832  definition must begin with a line of the form:
13833 \end_layout
13834
13835 \begin_layout LyX-Code
13836 InsetLayout <Type>
13837 \end_layout
13838
13839 \begin_layout Standard
13840 Here 
13841 \begin_inset Flex Code
13842 status collapsed
13843
13844 \begin_layout Plain Layout
13845 <Type>
13846 \end_layout
13847
13848 \end_inset
13849
13850  indicates the inset whose layout is being defined, and here there are two
13851  cases.
13852 \end_layout
13853
13854 \begin_layout Enumerate
13855 The layout for a pre-existing inset is being modified.
13856  In this case, can be 
13857 \begin_inset Flex Code
13858 status collapsed
13859
13860 \begin_layout Plain Layout
13861 <Type>
13862 \end_layout
13863
13864 \end_inset
13865
13866  any one of the following: 
13867 \begin_inset Flex Code
13868 status collapsed
13869
13870 \begin_layout Plain Layout
13871 Algorithm
13872 \end_layout
13873
13874 \end_inset
13875
13876
13877 \begin_inset Flex Code
13878 status collapsed
13879
13880 \begin_layout Plain Layout
13881 Branch
13882 \end_layout
13883
13884 \end_inset
13885
13886
13887 \begin_inset Flex Code
13888 status collapsed
13889
13890 \begin_layout Plain Layout
13891 Box
13892 \end_layout
13893
13894 \end_inset
13895
13896
13897 \begin_inset Flex Code
13898 status collapsed
13899
13900 \begin_layout Plain Layout
13901 Box:shaded
13902 \end_layout
13903
13904 \end_inset
13905
13906
13907 \begin_inset Flex Code
13908 status collapsed
13909
13910 \begin_layout Plain Layout
13911 ERT
13912 \end_layout
13913
13914 \end_inset
13915
13916
13917 \begin_inset Flex Code
13918 status collapsed
13919
13920 \begin_layout Plain Layout
13921 Figure
13922 \end_layout
13923
13924 \end_inset
13925
13926
13927 \begin_inset Flex Code
13928 status collapsed
13929
13930 \begin_layout Plain Layout
13931 Foot
13932 \end_layout
13933
13934 \end_inset
13935
13936
13937 \begin_inset Flex Code
13938 status collapsed
13939
13940 \begin_layout Plain Layout
13941 Index
13942 \end_layout
13943
13944 \end_inset
13945
13946
13947 \begin_inset Flex Code
13948 status collapsed
13949
13950 \begin_layout Plain Layout
13951 Info
13952 \end_layout
13953
13954 \end_inset
13955
13956
13957 \begin_inset Flex Code
13958 status collapsed
13959
13960 \begin_layout Plain Layout
13961 Info:menu
13962 \end_layout
13963
13964 \end_inset
13965
13966
13967 \begin_inset Flex Code
13968 status collapsed
13969
13970 \begin_layout Plain Layout
13971 Info:shortcut
13972 \end_layout
13973
13974 \end_inset
13975
13976
13977 \begin_inset Flex Code
13978 status collapsed
13979
13980 \begin_layout Plain Layout
13981 Info:shortcuts
13982 \end_layout
13983
13984 \end_inset
13985
13986
13987 \begin_inset Flex Code
13988 status collapsed
13989
13990 \begin_layout Plain Layout
13991 Listings
13992 \end_layout
13993
13994 \end_inset
13995
13996
13997 \begin_inset Flex Code
13998 status collapsed
13999
14000 \begin_layout Plain Layout
14001 Marginal
14002 \end_layout
14003
14004 \end_inset
14005
14006
14007 \begin_inset Flex Code
14008 status collapsed
14009
14010 \begin_layout Plain Layout
14011 Note:Comment
14012 \end_layout
14013
14014 \end_inset
14015
14016
14017 \begin_inset Flex Code
14018 status collapsed
14019
14020 \begin_layout Plain Layout
14021 Note:Note
14022 \end_layout
14023
14024 \end_inset
14025
14026
14027 \begin_inset Flex Code
14028 status collapsed
14029
14030 \begin_layout Plain Layout
14031 Note:Greyedout
14032 \end_layout
14033
14034 \end_inset
14035
14036
14037 \begin_inset Flex Code
14038 status collapsed
14039
14040 \begin_layout Plain Layout
14041 OptArg
14042 \end_layout
14043
14044 \end_inset
14045
14046
14047 \begin_inset Flex Code
14048 status collapsed
14049
14050 \begin_layout Plain Layout
14051 Table
14052 \end_layout
14053
14054 \end_inset
14055
14056 , or 
14057 \begin_inset Flex Code
14058 status collapsed
14059
14060 \begin_layout Plain Layout
14061 URL
14062 \end_layout
14063
14064 \end_inset
14065
14066 .
14067 \end_layout
14068
14069 \begin_layout Enumerate
14070 The layout for a Flex inset is being defined.
14071  In this case, 
14072 \begin_inset Flex Code
14073 status collapsed
14074
14075 \begin_layout Plain Layout
14076 <Type>
14077 \end_layout
14078
14079 \end_inset
14080
14081  must be of the form 
14082 \begin_inset Quotes eld
14083 \end_inset
14084
14085
14086 \begin_inset Flex Code
14087 status collapsed
14088
14089 \begin_layout Plain Layout
14090 Flex:<name>
14091 \end_layout
14092
14093 \end_inset
14094
14095
14096 \begin_inset Quotes erd
14097 \end_inset
14098
14099 , where 
14100 \begin_inset Flex Code
14101 status collapsed
14102
14103 \begin_layout Plain Layout
14104 name
14105 \end_layout
14106
14107 \end_inset
14108
14109  may be be any valid identifier not used by a pre-existing Flex inset.
14110  The identifier may include spaces, but in that case the whole thing must
14111  be wrapped in quotes.
14112  Note that the definition of a flex inset 
14113 \emph on
14114 must 
14115 \emph default
14116 also include a 
14117 \begin_inset Flex Code
14118 status collapsed
14119
14120 \begin_layout Plain Layout
14121 LyXType
14122 \end_layout
14123
14124 \end_inset
14125
14126  entry, declaring which type of inset it defines.
14127 \end_layout
14128
14129 \begin_layout Standard
14130 The 
14131 \begin_inset Flex Code
14132 status collapsed
14133
14134 \begin_layout Plain Layout
14135 InsetLayout
14136 \end_layout
14137
14138 \end_inset
14139
14140  definition can contain the following entries:
14141 \end_layout
14142
14143 \begin_layout Description
14144 \begin_inset Flex Code
14145 status collapsed
14146
14147 \begin_layout Plain Layout
14148 BgColor
14149 \end_layout
14150
14151 \end_inset
14152
14153  The color for the inset's background.
14154  The valid colors are defined in 
14155 \begin_inset Flex Code
14156 status collapsed
14157
14158 \begin_layout Plain Layout
14159 src/ColorCode.h
14160 \end_layout
14161
14162 \end_inset
14163
14164 .
14165 \end_layout
14166
14167 \begin_layout Description
14168 \begin_inset Flex Code
14169 status collapsed
14170
14171 \begin_layout Plain Layout
14172 ContentAsLabel
14173 \end_layout
14174
14175 \end_inset
14176
14177  [
14178 \begin_inset Flex Code
14179 status collapsed
14180
14181 \begin_layout Plain Layout
14182
14183 \emph on
14184 0
14185 \end_layout
14186
14187 \end_inset
14188
14189 ,
14190 \begin_inset Flex Code
14191 status collapsed
14192
14193 \begin_layout Plain Layout
14194 1
14195 \end_layout
14196
14197 \end_inset
14198
14199 ] Whether to use the content of the inset as the label, when the inset is
14200  closed.
14201  Default is false.
14202 \end_layout
14203
14204 \begin_layout Description
14205 \begin_inset Flex Code
14206 status collapsed
14207
14208 \begin_layout Plain Layout
14209 CopyStyle
14210 \end_layout
14211
14212 \end_inset
14213
14214  As with paragraph styles (see page 
14215 \begin_inset CommandInset ref
14216 LatexCommand ref
14217 reference "des:CopyStyle"
14218
14219 \end_inset
14220
14221 ).
14222 \end_layout
14223
14224 \begin_layout Description
14225 \begin_inset Flex Code
14226 status collapsed
14227
14228 \begin_layout Plain Layout
14229 CustomPars
14230 \end_layout
14231
14232 \end_inset
14233
14234  [
14235 \begin_inset Flex Code
14236 status collapsed
14237
14238 \begin_layout Plain Layout
14239
14240 \emph on
14241 0
14242 \end_layout
14243
14244 \end_inset
14245
14246 ,
14247 \begin_inset Flex Code
14248 status collapsed
14249
14250 \begin_layout Plain Layout
14251 1
14252 \end_layout
14253
14254 \end_inset
14255
14256 ] Indicates whether the user may employ the Paragraph Settings dialog to
14257  customize the paragraph.
14258 \end_layout
14259
14260 \begin_layout Description
14261 \begin_inset Flex Code
14262 status collapsed
14263
14264 \begin_layout Plain Layout
14265 Decoration
14266 \end_layout
14267
14268 \end_inset
14269
14270  can be 
14271 \begin_inset Flex Code
14272 status collapsed
14273
14274 \begin_layout Plain Layout
14275 Classic
14276 \end_layout
14277
14278 \end_inset
14279
14280
14281 \begin_inset Flex Code
14282 status collapsed
14283
14284 \begin_layout Plain Layout
14285 Minimalistic
14286 \end_layout
14287
14288 \end_inset
14289
14290 , or 
14291 \begin_inset Flex Code
14292 status collapsed
14293
14294 \begin_layout Plain Layout
14295 Conglomerate
14296 \end_layout
14297
14298 \end_inset
14299
14300 , describing the rendering style used for the inset's frame and buttons.
14301  Footnotes generally use 
14302 \begin_inset Flex Code
14303 status collapsed
14304
14305 \begin_layout Plain Layout
14306 Classic
14307 \end_layout
14308
14309 \end_inset
14310
14311 , ERT insets generally 
14312 \begin_inset Flex Code
14313 status collapsed
14314
14315 \begin_layout Plain Layout
14316 Minimalistic
14317 \end_layout
14318
14319 \end_inset
14320
14321 , and character styles 
14322 \begin_inset Flex Code
14323 status collapsed
14324
14325 \begin_layout Plain Layout
14326 Conglomerate
14327 \end_layout
14328
14329 \end_inset
14330
14331 .
14332 \end_layout
14333
14334 \begin_layout Description
14335 \begin_inset Flex Code
14336 status collapsed
14337
14338 \begin_layout Plain Layout
14339 Display
14340 \end_layout
14341
14342 \end_inset
14343
14344  [
14345 \begin_inset Flex Code
14346 status collapsed
14347
14348 \begin_layout Plain Layout
14349 0
14350 \end_layout
14351
14352 \end_inset
14353
14354 ,
14355 \begin_inset Flex Code
14356 status collapsed
14357
14358 \begin_layout Plain Layout
14359
14360 \emph on
14361 1
14362 \end_layout
14363
14364 \end_inset
14365
14366 ] Only useful if 
14367 \begin_inset Flex Code
14368 status collapsed
14369
14370 \begin_layout Plain Layout
14371 LatexType
14372 \end_layout
14373
14374 \end_inset
14375
14376  is 
14377 \begin_inset Flex Code
14378 status collapsed
14379
14380 \begin_layout Plain Layout
14381 Environment
14382 \end_layout
14383
14384 \end_inset
14385
14386 .
14387  Indicates whether the environment will stand on its own in LaTeX output
14388  or will appear inline with the surrounding text.
14389  If set to false, it is supposed that the LaTeX environment ignores white
14390  space (including one newline character) after the 
14391 \begin_inset Flex Code
14392 status collapsed
14393
14394 \begin_layout Plain Layout
14395
14396 \backslash
14397 begin{
14398 \emph on
14399 LatexName
14400 \emph default
14401 }
14402 \end_layout
14403
14404 \end_inset
14405
14406  and 
14407 \begin_inset Flex Code
14408 status collapsed
14409
14410 \begin_layout Plain Layout
14411
14412 \backslash
14413 end{
14414 \emph on
14415 LatexName
14416 \emph default
14417 }
14418 \end_layout
14419
14420 \end_inset
14421
14422  tags.
14423  Default is true.
14424 \end_layout
14425
14426 \begin_layout Description
14427 \begin_inset Flex Code
14428 status collapsed
14429
14430 \begin_layout Plain Layout
14431 End
14432 \end_layout
14433
14434 \end_inset
14435
14436  Required at the end of the InsetLayout declarations.
14437 \end_layout
14438
14439 \begin_layout Description
14440 \begin_inset Flex Code
14441 status collapsed
14442
14443 \begin_layout Plain Layout
14444 Font
14445 \end_layout
14446
14447 \end_inset
14448
14449  The font used for both the text body 
14450 \emph on
14451 and
14452 \emph default
14453  the label.
14454  See section
14455 \begin_inset space ~
14456 \end_inset
14457
14458
14459 \begin_inset CommandInset ref
14460 LatexCommand ref
14461 reference "sub:Font-description"
14462
14463 \end_inset
14464
14465 .
14466  Note that defining this font automatically defines the 
14467 \begin_inset Flex Code
14468 status collapsed
14469
14470 \begin_layout Plain Layout
14471 LabelFont
14472 \end_layout
14473
14474 \end_inset
14475
14476  to the same value, so define this first and define 
14477 \begin_inset Flex Code
14478 status collapsed
14479
14480 \begin_layout Plain Layout
14481 LabelFont
14482 \end_layout
14483
14484 \end_inset
14485
14486  later if you want them to be different.
14487 \end_layout
14488
14489 \begin_layout Description
14490 \begin_inset Flex Code
14491 status collapsed
14492
14493 \begin_layout Plain Layout
14494 ForceLTR
14495 \end_layout
14496
14497 \end_inset
14498
14499  Force the 
14500 \begin_inset Quotes eld
14501 \end_inset
14502
14503 latex
14504 \begin_inset Quotes erd
14505 \end_inset
14506
14507  language, leading to Left-to-Right (latin) output, e.
14508 \begin_inset space \thinspace{}
14509 \end_inset
14510
14511 g.
14512 \begin_inset space \space{}
14513 \end_inset
14514
14515 in TeX code or URL.
14516  A kludge.
14517 \end_layout
14518
14519 \begin_layout Description
14520 \begin_inset Flex Code
14521 status collapsed
14522
14523 \begin_layout Plain Layout
14524 ForcePlain
14525 \end_layout
14526
14527 \end_inset
14528
14529  [
14530 \begin_inset Flex Code
14531 status collapsed
14532
14533 \begin_layout Plain Layout
14534
14535 \emph on
14536 0
14537 \end_layout
14538
14539 \end_inset
14540
14541 ,
14542 \begin_inset Flex Code
14543 status collapsed
14544
14545 \begin_layout Plain Layout
14546 1
14547 \end_layout
14548
14549 \end_inset
14550
14551 ] Indicates whether the 
14552 \begin_inset Flex Code
14553 status collapsed
14554
14555 \begin_layout Plain Layout
14556 PlainLayout
14557 \end_layout
14558
14559 \end_inset
14560
14561  should be used or, instead, the user can change the paragraph style used
14562  in the inset.
14563  Default is false.
14564 \end_layout
14565
14566 \begin_layout Description
14567 \begin_inset Flex Code
14568 status collapsed
14569
14570 \begin_layout Plain Layout
14571 FreeSpacing
14572 \end_layout
14573
14574 \end_inset
14575
14576  As with paragraph styles (see page 
14577 \begin_inset CommandInset ref
14578 LatexCommand pageref
14579 reference "des:FreeSpacing"
14580
14581 \end_inset
14582
14583 ).
14584  Default is false.
14585 \end_layout
14586
14587 \begin_layout Description
14588 \begin_inset Flex Code
14589 status collapsed
14590
14591 \begin_layout Plain Layout
14592 HTML*
14593 \end_layout
14594
14595 \end_inset
14596
14597  These tags control XHTML output.
14598  See section 
14599 \begin_inset CommandInset ref
14600 LatexCommand ref
14601 reference "sec:Tags-for-XHTML"
14602
14603 \end_inset
14604
14605 .
14606 \end_layout
14607
14608 \begin_layout Description
14609 \begin_inset Flex Code
14610 status collapsed
14611
14612 \begin_layout Plain Layout
14613 InToc
14614 \end_layout
14615
14616 \end_inset
14617
14618  [
14619 \begin_inset Flex Code
14620 status collapsed
14621
14622 \begin_layout Plain Layout
14623
14624 \emph on
14625 0
14626 \end_layout
14627
14628 \end_inset
14629
14630 ,
14631 \begin_inset Flex Code
14632 status collapsed
14633
14634 \begin_layout Plain Layout
14635 1
14636 \end_layout
14637
14638 \end_inset
14639
14640 ] Whether to include the contents of this inset in the strings generated
14641  for the `Outline' pane.
14642  One would not, for example, want the content of a footnote in a section
14643  header to be included in the TOC displayed in the outline, but one would
14644  normally want the content of a character style displayed.
14645  Default is false: not to include.
14646 \end_layout
14647
14648 \begin_layout Description
14649 \begin_inset Flex Code
14650 status collapsed
14651
14652 \begin_layout Plain Layout
14653 KeepEmpty
14654 \end_layout
14655
14656 \end_inset
14657
14658  As with paragraph styles (see page 
14659 \begin_inset CommandInset ref
14660 LatexCommand pageref
14661 reference "des:KeepEmpty"
14662
14663 \end_inset
14664
14665 ).
14666  Default is false.
14667 \end_layout
14668
14669 \begin_layout Description
14670 \begin_inset Flex Code
14671 status collapsed
14672
14673 \begin_layout Plain Layout
14674 LabelFont
14675 \end_layout
14676
14677 \end_inset
14678
14679  The font used for the label.
14680  See section
14681 \begin_inset space ~
14682 \end_inset
14683
14684
14685 \begin_inset CommandInset ref
14686 LatexCommand ref
14687 reference "sub:Font-description"
14688
14689 \end_inset
14690
14691 .
14692  Note that this definition can never appear before 
14693 \begin_inset Flex Code
14694 status collapsed
14695
14696 \begin_layout Plain Layout
14697 Font
14698 \end_layout
14699
14700 \end_inset
14701
14702 , lest it be ineffective.
14703 \end_layout
14704
14705 \begin_layout Description
14706 \begin_inset Flex Code
14707 status collapsed
14708
14709 \begin_layout Plain Layout
14710 LabelString
14711 \end_layout
14712
14713 \end_inset
14714
14715  What will be displayed on the button or elsewhere as the inset label.
14716  Some inset types (
14717 \begin_inset Flex Code
14718 status collapsed
14719
14720 \begin_layout Plain Layout
14721 TeX code
14722 \end_layout
14723
14724 \end_inset
14725
14726  and 
14727 \begin_inset Flex Code
14728 status collapsed
14729
14730 \begin_layout Plain Layout
14731 Branch
14732 \end_layout
14733
14734 \end_inset
14735
14736 ) modify this label on the fly.
14737 \end_layout
14738
14739 \begin_layout Description
14740 \begin_inset Flex Code
14741 status collapsed
14742
14743 \begin_layout Plain Layout
14744 LatexName
14745 \end_layout
14746
14747 \end_inset
14748
14749  The name of the corresponding LaTeX stuff.
14750  Either the environment or command name.
14751 \end_layout
14752
14753 \begin_layout Description
14754 \begin_inset Flex Code
14755 status collapsed
14756
14757 \begin_layout Plain Layout
14758 LatexParam
14759 \end_layout
14760
14761 \end_inset
14762
14763  The optional parameter for the corresponding 
14764 \begin_inset Flex Code
14765 status collapsed
14766
14767 \begin_layout Plain Layout
14768 LatexName
14769 \end_layout
14770
14771 \end_inset
14772
14773  stuff, including possible bracket pairs like 
14774 \begin_inset Flex Code
14775 status collapsed
14776
14777 \begin_layout Plain Layout
14778 []
14779 \end_layout
14780
14781 \end_inset
14782
14783 .
14784  This parameter cannot be changed from within LyX.
14785 \end_layout
14786
14787 \begin_layout Description
14788 \begin_inset Flex Code
14789 status collapsed
14790
14791 \begin_layout Plain Layout
14792 LatexType
14793 \end_layout
14794
14795 \end_inset
14796
14797  As with paragraph styles (see page 
14798 \begin_inset CommandInset ref
14799 LatexCommand pageref
14800 reference "des:LatexType"
14801
14802 \end_inset
14803
14804 ).
14805 \end_layout
14806
14807 \begin_layout Description
14808 \begin_inset Flex Code
14809 status collapsed
14810
14811 \begin_layout Plain Layout
14812 LyxType
14813 \end_layout
14814
14815 \end_inset
14816
14817  Can be 
14818 \begin_inset Flex Code
14819 status collapsed
14820
14821 \begin_layout Plain Layout
14822 charstyle
14823 \end_layout
14824
14825 \end_inset
14826
14827
14828 \begin_inset Flex Code
14829 status collapsed
14830
14831 \begin_layout Plain Layout
14832 custom
14833 \end_layout
14834
14835 \end_inset
14836
14837
14838 \begin_inset Flex Code
14839 status collapsed
14840
14841 \begin_layout Plain Layout
14842 element
14843 \end_layout
14844
14845 \end_inset
14846
14847 , or 
14848 \begin_inset Flex Code
14849 status collapsed
14850
14851 \begin_layout Plain Layout
14852 end
14853 \end_layout
14854
14855 \end_inset
14856
14857  (indicating a dummy definition ending definitions of charstyles, etc).
14858  This entry is required in and is only meaningful for Flex insets.
14859  Among other things, it determines on which menu this inset will appear.
14860  Setting 
14861 \begin_inset Flex Code
14862 status collapsed
14863
14864 \begin_layout Plain Layout
14865 LyXType
14866 \end_layout
14867
14868 \end_inset
14869
14870  to 
14871 \begin_inset Flex Code
14872 status collapsed
14873
14874 \begin_layout Plain Layout
14875 charstyle
14876 \end_layout
14877
14878 \end_inset
14879
14880  will set 
14881 \begin_inset Flex Code
14882 status collapsed
14883
14884 \begin_layout Plain Layout
14885 MultiPar
14886 \end_layout
14887
14888 \end_inset
14889
14890  to false.
14891  
14892 \begin_inset Flex Code
14893 status collapsed
14894
14895 \begin_layout Plain Layout
14896 MultiPar
14897 \end_layout
14898
14899 \end_inset
14900
14901  can be set to true for charstyle insets, if you wish, by setting it 
14902 \emph on
14903 after
14904 \emph default
14905  you set the 
14906 \begin_inset Flex Code
14907 status collapsed
14908
14909 \begin_layout Plain Layout
14910 LyXType
14911 \end_layout
14912
14913 \end_inset
14914
14915 .
14916 \end_layout
14917
14918 \begin_layout Description
14919 \begin_inset Flex Code
14920 status collapsed
14921
14922 \begin_layout Plain Layout
14923 MultiPar
14924 \end_layout
14925
14926 \end_inset
14927
14928  [
14929 \begin_inset Flex Code
14930 status collapsed
14931
14932 \begin_layout Plain Layout
14933
14934 \emph on
14935 0
14936 \end_layout
14937
14938 \end_inset
14939
14940 ,
14941 \begin_inset Flex Code
14942 status collapsed
14943
14944 \begin_layout Plain Layout
14945 1
14946 \end_layout
14947
14948 \end_inset
14949
14950 ] Whether multiple paragraphs are permitted in this inset.
14951  This will also set 
14952 \begin_inset Flex Code
14953 status collapsed
14954
14955 \begin_layout Plain Layout
14956 CustomPars
14957 \end_layout
14958
14959 \end_inset
14960
14961  to the same value and 
14962 \begin_inset Flex Code
14963 status collapsed
14964
14965 \begin_layout Plain Layout
14966 ForcePlain
14967 \end_layout
14968
14969 \end_inset
14970
14971  to the opposite value.
14972  These can be reset to other values, if they are used 
14973 \emph on
14974 after
14975 \emph default
14976  
14977 \begin_inset Flex Code
14978 status collapsed
14979
14980 \begin_layout Plain Layout
14981 MultiPar
14982 \end_layout
14983
14984 \end_inset
14985
14986 .
14987  Default is true.
14988 \end_layout
14989
14990 \begin_layout Description
14991 \begin_inset Flex Code
14992 status collapsed
14993
14994 \begin_layout Plain Layout
14995 NeedProtect
14996 \end_layout
14997
14998 \end_inset
14999
15000  [
15001 \begin_inset Flex Code
15002 status collapsed
15003
15004 \begin_layout Plain Layout
15005
15006 \emph on
15007 0
15008 \end_layout
15009
15010 \end_inset
15011
15012 ,
15013 \begin_inset Flex Code
15014 status collapsed
15015
15016 \begin_layout Plain Layout
15017 1
15018 \end_layout
15019
15020 \end_inset
15021
15022 ] Whether fragile commands in this inset should be 
15023 \begin_inset Flex Code
15024 status collapsed
15025
15026 \begin_layout Plain Layout
15027
15028 \backslash
15029 protect
15030 \end_layout
15031
15032 \end_inset
15033
15034 'ed.
15035  (Note: This is 
15036 \emph on
15037 not
15038 \emph default
15039  whether the command should itself be protected.) Default is false.
15040 \end_layout
15041
15042 \begin_layout Description
15043 \begin_inset Flex Code
15044 status collapsed
15045
15046 \begin_layout Plain Layout
15047 ParbreakIsNewline
15048 \end_layout
15049
15050 \end_inset
15051
15052  [
15053 \begin_inset Flex Code
15054 status collapsed
15055
15056 \begin_layout Plain Layout
15057
15058 \emph on
15059 0
15060 \end_layout
15061
15062 \end_inset
15063
15064
15065 \begin_inset Flex Code
15066 status collapsed
15067
15068 \begin_layout Plain Layout
15069 1
15070 \end_layout
15071
15072 \end_inset
15073
15074 ] As with paragraph styles (see page 
15075 \begin_inset CommandInset ref
15076 LatexCommand pageref
15077 reference "des:ParbreakIsNewline"
15078
15079 \end_inset
15080
15081 ).
15082  Default is false.
15083 \end_layout
15084
15085 \begin_layout Description
15086 \begin_inset Flex Code
15087 status collapsed
15088
15089 \begin_layout Plain Layout
15090 PassThru
15091 \end_layout
15092
15093 \end_inset
15094
15095  [
15096 \begin_inset Flex Code
15097 status collapsed
15098
15099 \begin_layout Plain Layout
15100
15101 \emph on
15102 0
15103 \end_layout
15104
15105 \end_inset
15106
15107 ,
15108 \begin_inset Flex Code
15109 status collapsed
15110
15111 \begin_layout Plain Layout
15112 1
15113 \end_layout
15114
15115 \end_inset
15116
15117 ] As with paragraph styles (see page 
15118 \begin_inset CommandInset ref
15119 LatexCommand pageref
15120 reference "des:PassThru"
15121
15122 \end_inset
15123
15124 ).
15125  Default is false.
15126 \end_layout
15127
15128 \begin_layout Description
15129 \begin_inset Flex Code
15130 status collapsed
15131
15132 \begin_layout Plain Layout
15133 Preamble
15134 \end_layout
15135
15136 \end_inset
15137
15138  As with paragraph styles (see page 
15139 \begin_inset CommandInset ref
15140 LatexCommand pageref
15141 reference "des:Preamble"
15142
15143 \end_inset
15144
15145 ).
15146 \end_layout
15147
15148 \begin_layout Description
15149 \begin_inset Flex Code
15150 status collapsed
15151
15152 \begin_layout Plain Layout
15153 RefPrefix
15154 \end_layout
15155
15156 \end_inset
15157
15158  [
15159 \begin_inset Flex Code
15160 status collapsed
15161
15162 \begin_layout Plain Layout
15163 string
15164 \end_layout
15165
15166 \end_inset
15167
15168 ] The prefix to use when creating labels referring to insets of this type.
15169  This allows the use of formatted references.
15170 \end_layout
15171
15172 \begin_layout Description
15173 \begin_inset Flex Code
15174 status collapsed
15175
15176 \begin_layout Plain Layout
15177 Requires
15178 \end_layout
15179
15180 \end_inset
15181
15182  [
15183 \begin_inset Flex Code
15184 status collapsed
15185
15186 \begin_layout Plain Layout
15187 string
15188 \end_layout
15189
15190 \end_inset
15191
15192 ] As with paragraph styles (see page 
15193 \begin_inset CommandInset ref
15194 LatexCommand pageref
15195 reference "des:Requires"
15196
15197 \end_inset
15198
15199 ).
15200 \end_layout
15201
15202 \begin_layout Description
15203 \begin_inset Flex Code
15204 status collapsed
15205
15206 \begin_layout Plain Layout
15207 ResetsFont
15208 \end_layout
15209
15210 \end_inset
15211
15212  [
15213 \begin_inset Flex Code
15214 status collapsed
15215
15216 \begin_layout Plain Layout
15217 0
15218 \end_layout
15219
15220 \end_inset
15221
15222 ,
15223 \begin_inset Flex Code
15224 status collapsed
15225
15226 \begin_layout Plain Layout
15227
15228 \emph on
15229 1
15230 \end_layout
15231
15232 \end_inset
15233
15234 ] Whether this inset should use the font of its surrounding environment
15235  or uses its own.
15236  Default is true: uses its own.
15237 \end_layout
15238
15239 \begin_layout Description
15240 \begin_inset Flex Code
15241 status collapsed
15242
15243 \begin_layout Plain Layout
15244 Spellcheck
15245 \end_layout
15246
15247 \end_inset
15248
15249  [
15250 \begin_inset Flex Code
15251 status collapsed
15252
15253 \begin_layout Plain Layout
15254 0
15255 \end_layout
15256
15257 \end_inset
15258
15259 ,
15260 \begin_inset Flex Code
15261 status collapsed
15262
15263 \begin_layout Plain Layout
15264
15265 \emph on
15266 1
15267 \end_layout
15268
15269 \end_inset
15270
15271 ] Spellcheck the contents of this inset.
15272  Default is true.
15273 \end_layout
15274
15275 \begin_layout Subsection
15276 Counters
15277 \begin_inset CommandInset label
15278 LatexCommand label
15279 name "sub:Counters"
15280
15281 \end_inset
15282
15283
15284 \end_layout
15285
15286 \begin_layout Standard
15287 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15288  counters (
15289 \begin_inset Flex MenuItem
15290 status collapsed
15291
15292 \begin_layout Plain Layout
15293 chapter
15294 \end_layout
15295
15296 \end_inset
15297
15298
15299 \begin_inset Flex MenuItem
15300 status collapsed
15301
15302 \begin_layout Plain Layout
15303 figure
15304 \end_layout
15305
15306 \end_inset
15307
15308 , \SpecialChar \ldots{}
15309 ) in the text class itself.
15310  The standard counters are defined in the file 
15311 \begin_inset Flex Code
15312 status collapsed
15313
15314 \begin_layout Plain Layout
15315 stdcounters.inc
15316 \end_layout
15317
15318 \end_inset
15319
15320 , so you may have to do no more than add
15321 \end_layout
15322
15323 \begin_layout LyX-Code
15324 Input stdcounters.inc
15325 \end_layout
15326
15327 \begin_layout Standard
15328 to your layout file to get them to work.
15329  But if you want to define custom counters, then you can do so.
15330  The counter declaration must begin with:
15331 \end_layout
15332
15333 \begin_layout LyX-Code
15334 Counter CounterName
15335 \end_layout
15336
15337 \begin_layout Standard
15338 where of course `
15339 \begin_inset Flex Code
15340 status collapsed
15341
15342 \begin_layout Plain Layout
15343 CounterName
15344 \end_layout
15345
15346 \end_inset
15347
15348 ' is replaced by the name of the counter.
15349  And it must end with 
15350 \begin_inset Quotes eld
15351 \end_inset
15352
15353
15354 \begin_inset Flex Code
15355 status collapsed
15356
15357 \begin_layout Plain Layout
15358 End
15359 \end_layout
15360
15361 \end_inset
15362
15363
15364 \begin_inset Quotes erd
15365 \end_inset
15366
15367 .
15368  The following parameters can also be used:
15369 \end_layout
15370
15371 \begin_layout Description
15372 \begin_inset Flex Code
15373 status collapsed
15374
15375 \begin_layout Plain Layout
15376 LabelString
15377 \end_layout
15378
15379 \end_inset
15380
15381  [
15382 \begin_inset Flex Code
15383 status collapsed
15384
15385 \begin_layout Plain Layout
15386 string
15387 \end_layout
15388
15389 \end_inset
15390
15391 =
15392 \begin_inset Quotes erd
15393 \end_inset
15394
15395
15396 \begin_inset Quotes erd
15397 \end_inset
15398
15399 ] When defined, this string defines how the counter is displayed.
15400  Setting this value sets 
15401 \begin_inset Flex Code
15402 status collapsed
15403
15404 \begin_layout Plain Layout
15405 LabelStringAppendix
15406 \end_layout
15407
15408 \end_inset
15409
15410  to the same value.
15411  The following special constructs can be used in the string:
15412 \end_layout
15413
15414 \begin_deeper
15415 \begin_layout Itemize
15416 \begin_inset Flex Code
15417 status collapsed
15418
15419 \begin_layout Plain Layout
15420
15421 \backslash
15422 thecounter
15423 \end_layout
15424
15425 \end_inset
15426
15427  will be replaced by the expansion of the 
15428 \begin_inset Flex Code
15429 status collapsed
15430
15431 \begin_layout Plain Layout
15432 LabelString
15433 \end_layout
15434
15435 \end_inset
15436
15437  (or 
15438 \begin_inset Flex Code
15439 status collapsed
15440
15441 \begin_layout Plain Layout
15442 LabelStringAppendix
15443 \end_layout
15444
15445 \end_inset
15446
15447 ) of the counter 
15448 \begin_inset Flex Code
15449 status collapsed
15450
15451 \begin_layout Plain Layout
15452 counter
15453 \end_layout
15454
15455 \end_inset
15456
15457 .
15458  
15459 \end_layout
15460
15461 \begin_layout Itemize
15462 counter values can be expressed using LaTeX-like macros 
15463 \begin_inset Flex Code
15464 status collapsed
15465
15466 \begin_layout Plain Layout
15467
15468 \backslash
15469
15470 \emph on
15471 numbertype
15472 \emph default
15473 {
15474 \emph on
15475 counter
15476 \emph default
15477 }
15478 \end_layout
15479
15480 \end_inset
15481
15482 , where 
15483 \begin_inset Flex Code
15484 status collapsed
15485
15486 \begin_layout Plain Layout
15487
15488 \emph on
15489 numbertype
15490 \end_layout
15491
15492 \end_inset
15493
15494  can be:
15495 \begin_inset Foot
15496 status collapsed
15497
15498 \begin_layout Plain Layout
15499
15500 \family roman
15501 \series medium
15502 \shape up
15503 \size normal
15504 \emph off
15505 \bar no
15506 \noun off
15507 \color none
15508 Actually, the situation is a bit more complicated: any
15509 \family default
15510 \series default
15511 \shape default
15512 \emph default
15513 \bar default
15514  
15515 \size default
15516 \emph on
15517 \noun default
15518 \color inherit
15519 numbertype
15520 \family roman
15521 \series medium
15522 \shape up
15523 \size normal
15524 \emph off
15525 \bar no
15526 \noun off
15527  other than those described below will produce arabic numerals.
15528  It would not be surprising to see this change in the future.
15529 \end_layout
15530
15531 \end_inset
15532
15533  
15534 \begin_inset Flex Code
15535 status collapsed
15536
15537 \begin_layout Plain Layout
15538 arabic
15539 \end_layout
15540
15541 \end_inset
15542
15543 : 1, 2, 3,\SpecialChar \ldots{}
15544
15545 \begin_inset Flex Code
15546 status collapsed
15547
15548 \begin_layout Plain Layout
15549 alph
15550 \end_layout
15551
15552 \end_inset
15553
15554  for lower-case letters: a, b, c, \SpecialChar \ldots{}
15555
15556 \begin_inset Flex Code
15557 status collapsed
15558
15559 \begin_layout Plain Layout
15560 Alph
15561 \end_layout
15562
15563 \end_inset
15564
15565  for upper-case letters: A, B, C, \SpecialChar \ldots{}
15566
15567 \begin_inset Flex Code
15568 status collapsed
15569
15570 \begin_layout Plain Layout
15571 roman
15572 \end_layout
15573
15574 \end_inset
15575
15576  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15577
15578 \begin_inset Flex Code
15579 status collapsed
15580
15581 \begin_layout Plain Layout
15582 Roman
15583 \end_layout
15584
15585 \end_inset
15586
15587  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15588
15589 \begin_inset Flex Code
15590 status collapsed
15591
15592 \begin_layout Plain Layout
15593 hebrew
15594 \end_layout
15595
15596 \end_inset
15597
15598  for hebrew numerals.
15599 \end_layout
15600
15601 \end_deeper
15602 \begin_layout Standard
15603 If LabelString is not defined, a default value is constructed as follows:
15604  if the counter has a master counter 
15605 \begin_inset Flex Code
15606 status collapsed
15607
15608 \begin_layout Plain Layout
15609 master
15610 \end_layout
15611
15612 \end_inset
15613
15614  (defined via 
15615 \begin_inset Flex Code
15616 status collapsed
15617
15618 \begin_layout Plain Layout
15619 Within
15620 \end_layout
15621
15622 \end_inset
15623
15624 ), the string 
15625 \begin_inset Flex Code
15626 status collapsed
15627
15628 \begin_layout Plain Layout
15629
15630 \backslash
15631 themaster.
15632 \backslash
15633 arabic{counter}
15634 \end_layout
15635
15636 \end_inset
15637
15638  is used; otherwise the string 
15639 \begin_inset Flex Code
15640 status collapsed
15641
15642 \begin_layout Plain Layout
15643
15644 \backslash
15645 arabic{counter}
15646 \end_layout
15647
15648 \end_inset
15649
15650  is used.
15651 \end_layout
15652
15653 \begin_layout Description
15654 \begin_inset Flex Code
15655 status collapsed
15656
15657 \begin_layout Plain Layout
15658 LabelStringAppendix
15659 \end_layout
15660
15661 \end_inset
15662
15663  [
15664 \begin_inset Flex Code
15665 status collapsed
15666
15667 \begin_layout Plain Layout
15668 string
15669 \end_layout
15670
15671 \end_inset
15672
15673 =
15674 \begin_inset Quotes erd
15675 \end_inset
15676
15677
15678 \begin_inset Quotes erd
15679 \end_inset
15680
15681 ] Same as 
15682 \begin_inset Flex Code
15683 status collapsed
15684
15685 \begin_layout Plain Layout
15686 LabelString
15687 \end_layout
15688
15689 \end_inset
15690
15691 , but for use in the Appendix.
15692 \end_layout
15693
15694 \begin_layout Description
15695 \begin_inset Flex Code
15696 status collapsed
15697
15698 \begin_layout Plain Layout
15699 PrettyFormat
15700 \end_layout
15701
15702 \end_inset
15703
15704  [
15705 \begin_inset Flex Code
15706 status collapsed
15707
15708 \begin_layout Plain Layout
15709 string
15710 \end_layout
15711
15712 \end_inset
15713
15714 =
15715 \begin_inset Quotes erd
15716 \end_inset
15717
15718
15719 \begin_inset Quotes erd
15720 \end_inset
15721
15722 ] A format for use with formatted references to this counter.
15723  For example, one might want to have references to section numbers appear
15724  as 
15725 \begin_inset Quotes eld
15726 \end_inset
15727
15728 Section 2.4
15729 \begin_inset Quotes erd
15730 \end_inset
15731
15732 .
15733  The string should contain 
15734 \begin_inset Quotes eld
15735 \end_inset
15736
15737 ##
15738 \begin_inset Quotes erd
15739 \end_inset
15740
15741 .
15742  This will be replaced by the counter number itself.
15743  So, for sections, it would be: Section ##.
15744 \end_layout
15745
15746 \begin_layout Description
15747 \begin_inset Flex Code
15748 status collapsed
15749
15750 \begin_layout Plain Layout
15751 Within
15752 \end_layout
15753
15754 \end_inset
15755
15756  [
15757 \begin_inset Flex Code
15758 status collapsed
15759
15760 \begin_layout Plain Layout
15761 string
15762 \end_layout
15763
15764 \end_inset
15765
15766 =
15767 \begin_inset Quotes erd
15768 \end_inset
15769
15770
15771 \begin_inset Quotes erd
15772 \end_inset
15773
15774 ] If this is set to the name of another counter, the present counter will
15775  be reset every time the other one is increased.
15776  For example, 
15777 \begin_inset Flex Code
15778 status collapsed
15779
15780 \begin_layout Plain Layout
15781 subsection
15782 \end_layout
15783
15784 \end_inset
15785
15786  is numbered inside 
15787 \begin_inset Flex Code
15788 status collapsed
15789
15790 \begin_layout Plain Layout
15791 section
15792 \end_layout
15793
15794 \end_inset
15795
15796 .
15797 \end_layout
15798
15799 \begin_layout Subsection
15800 Font description
15801 \begin_inset CommandInset label
15802 LatexCommand label
15803 name "sub:Font-description"
15804
15805 \end_inset
15806
15807
15808 \end_layout
15809
15810 \begin_layout Standard
15811 A font description looks like this:
15812 \end_layout
15813
15814 \begin_layout LyX-Code
15815 Font 
15816 \family roman
15817 \emph on
15818 or
15819 \family default
15820 \emph default
15821  LabelFont
15822 \end_layout
15823
15824 \begin_layout LyX-Code
15825  ...
15826 \end_layout
15827
15828 \begin_layout LyX-Code
15829 EndFont
15830 \end_layout
15831
15832 \begin_layout Standard
15833 The following commands are available:
15834 \end_layout
15835
15836 \begin_layout Description
15837 \begin_inset Flex Code
15838 status collapsed
15839
15840 \begin_layout Plain Layout
15841 Color
15842 \end_layout
15843
15844 \end_inset
15845
15846  [
15847 \begin_inset Flex Code
15848 status collapsed
15849
15850 \begin_layout Plain Layout
15851
15852 \emph on
15853 none
15854 \end_layout
15855
15856 \end_inset
15857
15858
15859 \begin_inset Flex Code
15860 status collapsed
15861
15862 \begin_layout Plain Layout
15863 black
15864 \end_layout
15865
15866 \end_inset
15867
15868
15869 \begin_inset Flex Code
15870 status collapsed
15871
15872 \begin_layout Plain Layout
15873 white
15874 \end_layout
15875
15876 \end_inset
15877
15878
15879 \begin_inset Flex Code
15880 status collapsed
15881
15882 \begin_layout Plain Layout
15883 red
15884 \end_layout
15885
15886 \end_inset
15887
15888
15889 \begin_inset Flex Code
15890 status collapsed
15891
15892 \begin_layout Plain Layout
15893 green
15894 \end_layout
15895
15896 \end_inset
15897
15898
15899 \begin_inset Flex Code
15900 status collapsed
15901
15902 \begin_layout Plain Layout
15903 blue
15904 \end_layout
15905
15906 \end_inset
15907
15908
15909 \begin_inset Flex Code
15910 status collapsed
15911
15912 \begin_layout Plain Layout
15913 cyan
15914 \end_layout
15915
15916 \end_inset
15917
15918
15919 \begin_inset Flex Code
15920 status collapsed
15921
15922 \begin_layout Plain Layout
15923 magenta
15924 \end_layout
15925
15926 \end_inset
15927
15928
15929 \begin_inset Flex Code
15930 status collapsed
15931
15932 \begin_layout Plain Layout
15933 yellow
15934 \end_layout
15935
15936 \end_inset
15937
15938 ]
15939 \end_layout
15940
15941 \begin_layout Description
15942 \begin_inset Flex Code
15943 status collapsed
15944
15945 \begin_layout Plain Layout
15946 Family
15947 \end_layout
15948
15949 \end_inset
15950
15951  [
15952 \begin_inset Flex Code
15953 status collapsed
15954
15955 \begin_layout Plain Layout
15956
15957 \emph on
15958 Roman
15959 \end_layout
15960
15961 \end_inset
15962
15963
15964 \begin_inset Flex Code
15965 status collapsed
15966
15967 \begin_layout Plain Layout
15968 Sans
15969 \end_layout
15970
15971 \end_inset
15972
15973
15974 \begin_inset Flex Code
15975 status collapsed
15976
15977 \begin_layout Plain Layout
15978 Typewriter
15979 \end_layout
15980
15981 \end_inset
15982
15983
15984 \end_layout
15985
15986 \begin_layout Description
15987 \begin_inset Flex Code
15988 status collapsed
15989
15990 \begin_layout Plain Layout
15991 Misc
15992 \end_layout
15993
15994 \end_inset
15995
15996  [
15997 \begin_inset Flex Code
15998 status collapsed
15999
16000 \begin_layout Plain Layout
16001 string
16002 \end_layout
16003
16004 \end_inset
16005
16006 ] Valid arguments are: 
16007 \begin_inset Flex Code
16008 status collapsed
16009
16010 \begin_layout Plain Layout
16011 emph
16012 \end_layout
16013
16014 \end_inset
16015
16016
16017 \begin_inset Flex Code
16018 status collapsed
16019
16020 \begin_layout Plain Layout
16021 noun
16022 \end_layout
16023
16024 \end_inset
16025
16026
16027 \begin_inset Flex Code
16028 status collapsed
16029
16030 \begin_layout Plain Layout
16031 underbar
16032 \end_layout
16033
16034 \end_inset
16035
16036
16037 \begin_inset Flex Code
16038 status collapsed
16039
16040 \begin_layout Plain Layout
16041 no_emph
16042 \end_layout
16043
16044 \end_inset
16045
16046
16047 \begin_inset Flex Code
16048 status collapsed
16049
16050 \begin_layout Plain Layout
16051 no_noun
16052 \end_layout
16053
16054 \end_inset
16055
16056  and 
16057 \begin_inset Flex Code
16058 status collapsed
16059
16060 \begin_layout Plain Layout
16061 no_bar
16062 \end_layout
16063
16064 \end_inset
16065
16066 .
16067  Each of these turns on or off the corresponding attribute.
16068  For example, 
16069 \begin_inset Flex Code
16070 status collapsed
16071
16072 \begin_layout Plain Layout
16073 emph
16074 \end_layout
16075
16076 \end_inset
16077
16078  turns on emphasis, and 
16079 \begin_inset Flex Code
16080 status collapsed
16081
16082 \begin_layout Plain Layout
16083 no_emph
16084 \end_layout
16085
16086 \end_inset
16087
16088  turns it off.
16089  
16090 \begin_inset Newline newline
16091 \end_inset
16092
16093 If the latter seems puzzling, remember that the font settings for the present
16094  context are generally inherited from the surrounding context.
16095  So 
16096 \begin_inset Flex Code
16097 status collapsed
16098
16099 \begin_layout Plain Layout
16100 no_emph
16101 \end_layout
16102
16103 \end_inset
16104
16105  would turn off the emphasis that was anyway in effect, say, in a theorem
16106  environment.
16107 \end_layout
16108
16109 \begin_layout Description
16110 \begin_inset Flex Code
16111 status collapsed
16112
16113 \begin_layout Plain Layout
16114 Series
16115 \end_layout
16116
16117 \end_inset
16118
16119  [
16120 \begin_inset Flex Code
16121 status collapsed
16122
16123 \begin_layout Plain Layout
16124
16125 \emph on
16126 Medium
16127 \end_layout
16128
16129 \end_inset
16130
16131
16132 \begin_inset Flex Code
16133 status collapsed
16134
16135 \begin_layout Plain Layout
16136 Bold
16137 \end_layout
16138
16139 \end_inset
16140
16141
16142 \end_layout
16143
16144 \begin_layout Description
16145 \begin_inset Flex Code
16146 status collapsed
16147
16148 \begin_layout Plain Layout
16149 Shape
16150 \end_layout
16151
16152 \end_inset
16153
16154  [
16155 \begin_inset Flex Code
16156 status collapsed
16157
16158 \begin_layout Plain Layout
16159
16160 \emph on
16161 Up
16162 \end_layout
16163
16164 \end_inset
16165
16166
16167 \begin_inset Flex Code
16168 status collapsed
16169
16170 \begin_layout Plain Layout
16171 Italic
16172 \end_layout
16173
16174 \end_inset
16175
16176
16177 \begin_inset Flex Code
16178 status collapsed
16179
16180 \begin_layout Plain Layout
16181 SmallCaps
16182 \end_layout
16183
16184 \end_inset
16185
16186
16187 \begin_inset Flex Code
16188 status collapsed
16189
16190 \begin_layout Plain Layout
16191 Slanted
16192 \end_layout
16193
16194 \end_inset
16195
16196
16197 \end_layout
16198
16199 \begin_layout Description
16200 \begin_inset Flex Code
16201 status collapsed
16202
16203 \begin_layout Plain Layout
16204 Size
16205 \end_layout
16206
16207 \end_inset
16208
16209  [
16210 \begin_inset Flex Code
16211 status collapsed
16212
16213 \begin_layout Plain Layout
16214 tiny
16215 \end_layout
16216
16217 \end_inset
16218
16219
16220 \begin_inset Flex Code
16221 status collapsed
16222
16223 \begin_layout Plain Layout
16224 small
16225 \end_layout
16226
16227 \end_inset
16228
16229
16230 \begin_inset Flex Code
16231 status collapsed
16232
16233 \begin_layout Plain Layout
16234
16235 \emph on
16236 normal
16237 \end_layout
16238
16239 \end_inset
16240
16241
16242 \begin_inset Flex Code
16243 status collapsed
16244
16245 \begin_layout Plain Layout
16246 large
16247 \end_layout
16248
16249 \end_inset
16250
16251
16252 \begin_inset Flex Code
16253 status collapsed
16254
16255 \begin_layout Plain Layout
16256 larger
16257 \end_layout
16258
16259 \end_inset
16260
16261
16262 \begin_inset Flex Code
16263 status collapsed
16264
16265 \begin_layout Plain Layout
16266 largest
16267 \end_layout
16268
16269 \end_inset
16270
16271
16272 \begin_inset Flex Code
16273 status collapsed
16274
16275 \begin_layout Plain Layout
16276 huge
16277 \end_layout
16278
16279 \end_inset
16280
16281
16282 \begin_inset Flex Code
16283 status collapsed
16284
16285 \begin_layout Plain Layout
16286 giant
16287 \end_layout
16288
16289 \end_inset
16290
16291 ]
16292 \end_layout
16293
16294 \begin_layout Subsection
16295 \begin_inset CommandInset label
16296 LatexCommand label
16297 name "sub:Citation-format-description"
16298
16299 \end_inset
16300
16301 Citation format description
16302 \end_layout
16303
16304 \begin_layout Standard
16305 The 
16306 \begin_inset Flex Code
16307 status collapsed
16308
16309 \begin_layout Plain Layout
16310 CiteFormat
16311 \end_layout
16312
16313 \end_inset
16314
16315  blocks are used to describe how bibliographic information should be displayed,
16316  both within LyX itself (in the citation dialog and in tooltips, for example)
16317  and in XHTML output.
16318  Such a block might look like this:
16319 \end_layout
16320
16321 \begin_layout LyX-Code
16322 CiteFormat
16323 \end_layout
16324
16325 \begin_layout LyX-Code
16326  article ...
16327 \end_layout
16328
16329 \begin_layout LyX-Code
16330  book ...
16331 \end_layout
16332
16333 \begin_layout LyX-Code
16334 End
16335 \end_layout
16336
16337 \begin_layout Standard
16338 The individual lines define how the bibliographic information associated
16339  with an article or book, respectively, is to be displayed, and such a definitio
16340 n can be given for any `entry type' that might be present in a BibTeX file.
16341  LyX defines a default format in the source code that will be used if no
16342  specific definition has been given.
16343  LyX predefines several formats in the file 
16344 \begin_inset Flex Code
16345 status collapsed
16346
16347 \begin_layout Plain Layout
16348 stdciteformats.inc
16349 \end_layout
16350
16351 \end_inset
16352
16353 , which is included in most of LyX's document classes.
16354 \end_layout
16355
16356 \begin_layout Standard
16357 The definitions use a simple language that allows BibTeX keys to be replaced
16358  with their values.
16359  Keys should be enclosed in 
16360 \begin_inset Flex Code
16361 status collapsed
16362
16363 \begin_layout Plain Layout
16364 %
16365 \end_layout
16366
16367 \end_inset
16368
16369  signs, e.g.: 
16370 \begin_inset Flex Code
16371 status collapsed
16372
16373 \begin_layout Plain Layout
16374 %author%
16375 \end_layout
16376
16377 \end_inset
16378
16379 .
16380  So a simple definition might look like this:
16381 \end_layout
16382
16383 \begin_layout LyX-Code
16384 misc %author%, 
16385 \begin_inset Quotes eld
16386 \end_inset
16387
16388 %title
16389 \begin_inset Quotes erd
16390 \end_inset
16391
16392 .
16393 \end_layout
16394
16395 \begin_layout Standard
16396 This would print the author, followed by a comma, followed by the title,
16397  in quotes, followed by a period.
16398 \end_layout
16399
16400 \begin_layout Standard
16401 Of course, sometimes you may want to print a key only if it exists.
16402  This can be done by using a conditional construction, such as: 
16403 \begin_inset Flex Code
16404 status collapsed
16405
16406 \begin_layout Plain Layout
16407 {%volume%[[vol.
16408 \begin_inset space ~
16409 \end_inset
16410
16411 %volume%]]}
16412 \end_layout
16413
16414 \end_inset
16415
16416 .
16417  This says: If the 
16418 \begin_inset Flex Code
16419 status collapsed
16420
16421 \begin_layout Plain Layout
16422 volume
16423 \end_layout
16424
16425 \end_inset
16426
16427  key exists, then print 
16428 \begin_inset Quotes eld
16429 \end_inset
16430
16431 vol.
16432 \begin_inset space ~
16433 \end_inset
16434
16435
16436 \begin_inset Quotes erd
16437 \end_inset
16438
16439  followed by the volume key.
16440  It is also possible to have an else clause in the conditional, such as:
16441  
16442 \begin_inset Flex Code
16443 status collapsed
16444
16445 \begin_layout Plain Layout
16446 {%author%[[%author%]][[%editor%, ed.]]}
16447 \end_layout
16448
16449 \end_inset
16450
16451 .
16452  Here, the 
16453 \begin_inset Flex Code
16454 status collapsed
16455
16456 \begin_layout Plain Layout
16457 author
16458 \end_layout
16459
16460 \end_inset
16461
16462  key is printed if it exists; otherwise, the editor key is printed, followed
16463  by 
16464 \begin_inset Quotes eld
16465 \end_inset
16466
16467 ,
16468 \begin_inset space ~
16469 \end_inset
16470
16471 ed.
16472 \begin_inset Quotes erd
16473 \end_inset
16474
16475  Note that the key is again enclosed in 
16476 \begin_inset Flex Code
16477 status collapsed
16478
16479 \begin_layout Plain Layout
16480 %
16481 \end_layout
16482
16483 \end_inset
16484
16485  signs; the entire conditional is enclosed in braces; and the if and else
16486  clauses are enclosed in double brackets, 
16487 \begin_inset Quotes eld
16488 \end_inset
16489
16490
16491 \begin_inset Flex Code
16492 status collapsed
16493
16494 \begin_layout Plain Layout
16495 [[
16496 \end_layout
16497
16498 \end_inset
16499
16500
16501 \begin_inset Quotes eld
16502 \end_inset
16503
16504  and 
16505 \begin_inset Quotes eld
16506 \end_inset
16507
16508
16509 \begin_inset Flex Code
16510 status collapsed
16511
16512 \begin_layout Plain Layout
16513 ]]
16514 \end_layout
16515
16516 \end_inset
16517
16518
16519 \begin_inset Quotes erd
16520 \end_inset
16521
16522 .
16523  There must be no space between any of these.
16524 \end_layout
16525
16526 \begin_layout Standard
16527 There is one other piece of syntax available in definitions, which looks
16528  like this: 
16529 \begin_inset Flex Code
16530 status collapsed
16531
16532 \begin_layout Plain Layout
16533 {!<i>!}
16534 \end_layout
16535
16536 \end_inset
16537
16538 .
16539  This defines a piece of formatting information that is to be used when
16540  creating 
16541 \begin_inset Quotes eld
16542 \end_inset
16543
16544 rich text
16545 \begin_inset Quotes erd
16546 \end_inset
16547
16548 .
16549  Obviously, we do not want to output HTML tags when writing plain text,
16550  so they should be wrapped in 
16551 \begin_inset Quotes eld
16552 \end_inset
16553
16554 {!
16555 \begin_inset Quotes erd
16556 \end_inset
16557
16558  and 
16559 \begin_inset Quotes eld
16560 \end_inset
16561
16562 !}
16563 \begin_inset Quotes erd
16564 \end_inset
16565
16566 .
16567 \end_layout
16568
16569 \begin_layout Standard
16570 Two special sorts of definitions are also possible in a 
16571 \begin_inset Flex Code
16572 status collapsed
16573
16574 \begin_layout Plain Layout
16575 CiteFormat
16576 \end_layout
16577
16578 \end_inset
16579
16580  block.
16581  An example of the first would be:
16582 \end_layout
16583
16584 \begin_layout LyX-Code
16585 !quotetitle 
16586 \begin_inset Quotes eld
16587 \end_inset
16588
16589 %title%
16590 \begin_inset Quotes erd
16591 \end_inset
16592
16593
16594 \end_layout
16595
16596 \begin_layout Standard
16597 This is an abbreviation, or macro, and it can be used by treating it as
16598  if it were a key: 
16599 \begin_inset Flex Code
16600 status collapsed
16601
16602 \begin_layout Plain Layout
16603 %!quotetitle%
16604 \end_layout
16605
16606 \end_inset
16607
16608 .
16609  LyX will treat 
16610 \begin_inset Flex Code
16611 status collapsed
16612
16613 \begin_layout Plain Layout
16614 %!quotetitle%
16615 \end_layout
16616
16617 \end_inset
16618
16619  exactly as it would treat its definition.
16620  So, let us issue the obvious 
16621 \emph on
16622 warning
16623 \emph default
16624 .
16625  Do not do this:
16626 \end_layout
16627
16628 \begin_layout LyX-Code
16629 !funfun %funfun%
16630 \end_layout
16631
16632 \begin_layout Standard
16633 or anything like it.
16634  LyX shouldn't go into an infinite loop, but it may go into a long one before
16635  it gives up.
16636 \end_layout
16637
16638 \begin_layout Standard
16639 The second sort of special definition might look like this:
16640 \end_layout
16641
16642 \begin_layout LyX-Code
16643 _pptext pp.
16644 \end_layout
16645
16646 \begin_layout Standard
16647 This defines a translatable piece of text, which allows relevant parts of
16648  the bibliography to be translated.
16649  It can be included in a definition by treating it as a key: 
16650 \begin_inset Flex Code
16651 status collapsed
16652
16653 \begin_layout Plain Layout
16654 %_pptext%
16655 \end_layout
16656
16657 \end_inset
16658
16659 .
16660  Several of these are predefined in 
16661 \begin_inset Flex Code
16662 status collapsed
16663
16664 \begin_layout Plain Layout
16665 stdciteformats.inc
16666 \end_layout
16667
16668 \end_inset
16669
16670 .
16671  Note that these are not macros, in the sense just defined.
16672  They will not be expanded.
16673 \end_layout
16674
16675 \begin_layout Standard
16676 So here then is an example that use all these features:
16677 \end_layout
16678
16679 \begin_layout LyX-Code
16680 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16681 \end_layout
16682
16683 \begin_layout Standard
16684 This defines a macro that prints the author, followed by a comma, if the
16685  
16686 \begin_inset Flex Code
16687 status collapsed
16688
16689 \begin_layout Plain Layout
16690 author
16691 \end_layout
16692
16693 \end_inset
16694
16695  key is defined, or else prints the name of the editor, followed by the
16696  
16697 \begin_inset Flex Code
16698 status collapsed
16699
16700 \begin_layout Plain Layout
16701 _edtext
16702 \end_layout
16703
16704 \end_inset
16705
16706  or its translation (it is by default 
16707 \begin_inset Quotes eld
16708 \end_inset
16709
16710 ed.
16711 \begin_inset Quotes erd
16712 \end_inset
16713
16714 ), if the 
16715 \begin_inset Flex Code
16716 status collapsed
16717
16718 \begin_layout Plain Layout
16719 editor
16720 \end_layout
16721
16722 \end_inset
16723
16724  key is defined.
16725  Note that this is in fact defined in 
16726 \begin_inset Flex Code
16727 status collapsed
16728
16729 \begin_layout Plain Layout
16730 stdciteformats.inc
16731 \end_layout
16732
16733 \end_inset
16734
16735 , so you can use it in your own definitions, or re-definitions, if you load
16736  that file first.
16737 \end_layout
16738
16739 \begin_layout Section
16740 \begin_inset CommandInset label
16741 LatexCommand label
16742 name "sec:Tags-for-XHTML"
16743
16744 \end_inset
16745
16746 Tags for XHTML output
16747 \end_layout
16748
16749 \begin_layout Standard
16750 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16751  by layout information.
16752  In general, LyX provides sensible defaults and, as mentioned earlier, it
16753  will even construct default CSS style rules from the other layout tags.
16754  For example, LyX will attempt to use the information provided in the 
16755 \begin_inset Flex Code
16756 status collapsed
16757
16758 \begin_layout Plain Layout
16759 Font
16760 \end_layout
16761
16762 \end_inset
16763
16764  declaration for the Chapter style to write CSS that will appropriately
16765  format chapter headings.
16766 \end_layout
16767
16768 \begin_layout Standard
16769 In many cases, then, you may not have to do anything at all to get acceptable
16770  XHTML output for your own environments, custom insets, and so forth.
16771  But in some cases you will, and so LyX provides a number of layout tags
16772  that can be used to customize the XHTML and CSS that are generated.
16773 \end_layout
16774
16775 \begin_layout Standard
16776 Note that there are two tags, 
16777 \begin_inset Flex Code
16778 status collapsed
16779
16780 \begin_layout Plain Layout
16781 HTMLPreamble
16782 \end_layout
16783
16784 \end_inset
16785
16786  and 
16787 \begin_inset Flex Code
16788 status collapsed
16789
16790 \begin_layout Plain Layout
16791 AddToHTMLPreamble
16792 \end_layout
16793
16794 \end_inset
16795
16796  that may appear outside style and inset declarations.
16797  See 
16798 \begin_inset CommandInset ref
16799 LatexCommand ref
16800 reference "sub:General-text-class"
16801
16802 \end_inset
16803
16804  for details on these.
16805 \end_layout
16806
16807 \begin_layout Subsection
16808 \begin_inset CommandInset label
16809 LatexCommand label
16810 name "sub:Paragraph-Style-XHTML"
16811
16812 \end_inset
16813
16814 Paragraph styles
16815 \end_layout
16816
16817 \begin_layout Standard
16818 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16819  dealing with a normal paragraph, a command, or an environment, where this
16820  is itself determined by the contents of the corresponding 
16821 \begin_inset Flex Code
16822 status collapsed
16823
16824 \begin_layout Plain Layout
16825 LaTeXType
16826 \end_layout
16827
16828 \end_inset
16829
16830  tag.
16831  
16832 \end_layout
16833
16834 \begin_layout Standard
16835 For a command or normal paragraph, the output XHTML has the following form:
16836 \end_layout
16837
16838 \begin_layout LyX-Code
16839 <tag attr=
16840 \begin_inset Quotes erd
16841 \end_inset
16842
16843 value
16844 \begin_inset Quotes erd
16845 \end_inset
16846
16847 >
16848 \end_layout
16849
16850 \begin_layout LyX-Code
16851 <labeltag attr=
16852 \begin_inset Quotes erd
16853 \end_inset
16854
16855 value
16856 \begin_inset Quotes erd
16857 \end_inset
16858
16859 >Label</labeltag>
16860 \end_layout
16861
16862 \begin_layout LyX-Code
16863 Contents of the paragraph.
16864 \end_layout
16865
16866 \begin_layout LyX-Code
16867 </tag>
16868 \end_layout
16869
16870 \begin_layout Standard
16871 The label tags are of course omitted if the paragraph does not have a label.
16872 \end_layout
16873
16874 \begin_layout Standard
16875 For an environment that is not some sort of list, the XHTML takes this form:
16876 \end_layout
16877
16878 \begin_layout LyX-Code
16879 <tag attr=
16880 \begin_inset Quotes erd
16881 \end_inset
16882
16883 value
16884 \begin_inset Quotes erd
16885 \end_inset
16886
16887 >
16888 \end_layout
16889
16890 \begin_layout LyX-Code
16891 <itemtag attr=
16892 \begin_inset Quotes erd
16893 \end_inset
16894
16895 value
16896 \begin_inset Quotes erd
16897 \end_inset
16898
16899 ><labeltag attr=
16900 \begin_inset Quotes erd
16901 \end_inset
16902
16903 value
16904 \begin_inset Quotes erd
16905 \end_inset
16906
16907 >Environment Label</labeltag>First paragraph.</itemtag>
16908 \end_layout
16909
16910 \begin_layout LyX-Code
16911 <itemtag>Second paragraph.</itemtag>
16912 \end_layout
16913
16914 \begin_layout LyX-Code
16915 </tag>
16916 \end_layout
16917
16918 \begin_layout Standard
16919 Note that the label is output only for the first paragraph, as it should
16920  be for a theorem, for example.
16921  
16922 \end_layout
16923
16924 \begin_layout Standard
16925 For a list, we have one of these forms:
16926 \end_layout
16927
16928 \begin_layout LyX-Code
16929 <tag attr=
16930 \begin_inset Quotes erd
16931 \end_inset
16932
16933 value
16934 \begin_inset Quotes erd
16935 \end_inset
16936
16937 >
16938 \end_layout
16939
16940 \begin_layout LyX-Code
16941 <itemtag attr=
16942 \begin_inset Quotes erd
16943 \end_inset
16944
16945 value
16946 \begin_inset Quotes erd
16947 \end_inset
16948
16949 ><labeltag attr=
16950 \begin_inset Quotes erd
16951 \end_inset
16952
16953 value
16954 \begin_inset Quotes erd
16955 \end_inset
16956
16957 >List Label</labeltag>First item.</itemtag>
16958 \end_layout
16959
16960 \begin_layout LyX-Code
16961 <itemtag attr=
16962 \begin_inset Quotes erd
16963 \end_inset
16964
16965 value
16966 \begin_inset Quotes erd
16967 \end_inset
16968
16969 ><labeltag attr=
16970 \begin_inset Quotes erd
16971 \end_inset
16972
16973 value
16974 \begin_inset Quotes erd
16975 \end_inset
16976
16977 >List Label</labeltag>Second item.</itemtag>
16978 \end_layout
16979
16980 \begin_layout LyX-Code
16981 </tag>
16982 \end_layout
16983
16984 \begin_layout LyX-Code
16985
16986 \end_layout
16987
16988 \begin_layout LyX-Code
16989 <tag attr=
16990 \begin_inset Quotes erd
16991 \end_inset
16992
16993 value
16994 \begin_inset Quotes erd
16995 \end_inset
16996
16997 >
16998 \end_layout
16999
17000 \begin_layout LyX-Code
17001 <labeltag attr=
17002 \begin_inset Quotes erd
17003 \end_inset
17004
17005 value
17006 \begin_inset Quotes erd
17007 \end_inset
17008
17009 >List Label</labeltag><itemtag attr=
17010 \begin_inset Quotes erd
17011 \end_inset
17012
17013 value
17014 \begin_inset Quotes erd
17015 \end_inset
17016
17017 >First item.</itemtag>
17018 \end_layout
17019
17020 \begin_layout LyX-Code
17021 <labeltag attr=
17022 \begin_inset Quotes erd
17023 \end_inset
17024
17025 value
17026 \begin_inset Quotes erd
17027 \end_inset
17028
17029 >List Label</labeltag><itemtag attr=
17030 \begin_inset Quotes erd
17031 \end_inset
17032
17033 value
17034 \begin_inset Quotes erd
17035 \end_inset
17036
17037 >Second item.</itemtag>
17038 \end_layout
17039
17040 \begin_layout LyX-Code
17041 </tag>
17042 \end_layout
17043
17044 \begin_layout Standard
17045 Note the different orders of 
17046 \begin_inset Flex Code
17047 status collapsed
17048
17049 \begin_layout Plain Layout
17050 labeltag
17051 \end_layout
17052
17053 \end_inset
17054
17055  and 
17056 \begin_inset Flex Code
17057 status collapsed
17058
17059 \begin_layout Plain Layout
17060 itemtag
17061 \end_layout
17062
17063 \end_inset
17064
17065 .
17066  Which order we get depends upon the setting of 
17067 \begin_inset Flex Code
17068 status collapsed
17069
17070 \begin_layout Plain Layout
17071 HTMLLabelFirst
17072 \end_layout
17073
17074 \end_inset
17075
17076 : If 
17077 \begin_inset Flex Code
17078 status collapsed
17079
17080 \begin_layout Plain Layout
17081 HTMLLabelFirst
17082 \end_layout
17083
17084 \end_inset
17085
17086  is false (the default), you get the first of these, with the label within
17087  the item; if true, you get the second, with the label outside the item.
17088 \end_layout
17089
17090 \begin_layout Standard
17091 The specific tags and attributes output for each paragraph type can be controlle
17092 d by means of the layout tags we are about to describe.
17093  As mentioned earlier, however, LyX uses sensible defaults for many of these,
17094  so you often may not need to do very much to get good XHTML output.
17095  Think of the available tags as there so you can tweak things to your liking.
17096 \end_layout
17097
17098 \begin_layout Description
17099 \begin_inset Flex Code
17100 status collapsed
17101
17102 \begin_layout Plain Layout
17103 HTMLAttr
17104 \end_layout
17105
17106 \end_inset
17107
17108  [
17109 \begin_inset Flex Code
17110 status collapsed
17111
17112 \begin_layout Plain Layout
17113 string
17114 \end_layout
17115
17116 \end_inset
17117
17118 ] Specifies attribute information to be output with the main tag.
17119  For example, 
17120 \begin_inset Quotes eld
17121 \end_inset
17122
17123
17124 \begin_inset Flex Code
17125 status collapsed
17126
17127 \begin_layout Plain Layout
17128 class=`mydiv'
17129 \end_layout
17130
17131 \end_inset
17132
17133
17134 \begin_inset Quotes erd
17135 \end_inset
17136
17137 .
17138  By default, LyX will output 
17139 \begin_inset Quotes eld
17140 \end_inset
17141
17142
17143 \begin_inset Flex Code
17144 status collapsed
17145
17146 \begin_layout Plain Layout
17147 class=`layoutname'
17148 \end_layout
17149
17150 \end_inset
17151
17152
17153 \begin_inset Quotes erd
17154 \end_inset
17155
17156 , where 
17157 \begin_inset Flex Code
17158 status collapsed
17159
17160 \begin_layout Plain Layout
17161 layoutname
17162 \end_layout
17163
17164 \end_inset
17165
17166  is the LyX name of the layout, made lowercase, for example: chapter.
17167  This should 
17168 \emph on
17169 not
17170 \emph default
17171  contain any style information.
17172  Use 
17173 \begin_inset Flex Code
17174 status collapsed
17175
17176 \begin_layout Plain Layout
17177 HTMLStyle
17178 \end_layout
17179
17180 \end_inset
17181
17182  for that purpose.
17183 \end_layout
17184
17185 \begin_layout Description
17186 \begin_inset Flex Code
17187 status collapsed
17188
17189 \begin_layout Plain Layout
17190 HTMLForceCSS
17191 \end_layout
17192
17193 \end_inset
17194
17195  [
17196 \begin_inset Flex Code
17197 status collapsed
17198
17199 \begin_layout Plain Layout
17200
17201 \emph on
17202 0
17203 \emph default
17204 ,1
17205 \end_layout
17206
17207 \end_inset
17208
17209 ] Whether to output the default CSS information LyX generates for this layout,
17210  even if additional information is explicitly provided via 
17211 \begin_inset Flex Code
17212 status collapsed
17213
17214 \begin_layout Plain Layout
17215 HTMLStyle
17216 \end_layout
17217
17218 \end_inset
17219
17220 .
17221  Setting this to 
17222 \begin_inset Flex Code
17223 status collapsed
17224
17225 \begin_layout Plain Layout
17226 1
17227 \end_layout
17228
17229 \end_inset
17230
17231  allows you to alter or augment the generated CSS, rather than to override
17232  it completely.
17233  Default is 
17234 \begin_inset Flex Code
17235 status collapsed
17236
17237 \begin_layout Plain Layout
17238 0
17239 \end_layout
17240
17241 \end_inset
17242
17243 .
17244 \end_layout
17245
17246 \begin_layout Description
17247 \begin_inset Flex Code
17248 status collapsed
17249
17250 \begin_layout Plain Layout
17251 HTMLItem
17252 \end_layout
17253
17254 \end_inset
17255
17256  [
17257 \begin_inset Flex Code
17258 status collapsed
17259
17260 \begin_layout Plain Layout
17261 string
17262 \end_layout
17263
17264 \end_inset
17265
17266 ] The tag to be used for individual paragraphs of environments, replacing
17267  
17268 \begin_inset Flex Code
17269 status collapsed
17270
17271 \begin_layout Plain Layout
17272 itemtag
17273 \end_layout
17274
17275 \end_inset
17276
17277  in the examples above.
17278  Defaults to 
17279 \begin_inset Flex Code
17280 status collapsed
17281
17282 \begin_layout Plain Layout
17283 div
17284 \end_layout
17285
17286 \end_inset
17287
17288 .
17289 \end_layout
17290
17291 \begin_layout Description
17292 \begin_inset Flex Code
17293 status collapsed
17294
17295 \begin_layout Plain Layout
17296 HTMLItemAttr
17297 \end_layout
17298
17299 \end_inset
17300
17301  [
17302 \begin_inset Flex Code
17303 status collapsed
17304
17305 \begin_layout Plain Layout
17306 string
17307 \end_layout
17308
17309 \end_inset
17310
17311 ] Attributes for the item tag.
17312  Defaults to 
17313 \begin_inset Quotes eld
17314 \end_inset
17315
17316
17317 \begin_inset Flex Code
17318 status collapsed
17319
17320 \begin_layout Plain Layout
17321 class=`layoutname_item'
17322 \end_layout
17323
17324 \end_inset
17325
17326
17327 \begin_inset Quotes erd
17328 \end_inset
17329
17330 .
17331  This should 
17332 \emph on
17333 not
17334 \emph default
17335  contain any style information.
17336  Use 
17337 \begin_inset Flex Code
17338 status collapsed
17339
17340 \begin_layout Plain Layout
17341 HTMLStyle
17342 \end_layout
17343
17344 \end_inset
17345
17346  for that purpose.
17347 \end_layout
17348
17349 \begin_layout Description
17350 \begin_inset Flex Code
17351 status collapsed
17352
17353 \begin_layout Plain Layout
17354 HTMLLabel
17355 \end_layout
17356
17357 \end_inset
17358
17359  [
17360 \begin_inset Flex Code
17361 status collapsed
17362
17363 \begin_layout Plain Layout
17364 string
17365 \end_layout
17366
17367 \end_inset
17368
17369 ] The tag to be used for paragraph and item labels, replacing 
17370 \begin_inset Flex Code
17371 status collapsed
17372
17373 \begin_layout Plain Layout
17374 labeltag
17375 \end_layout
17376
17377 \end_inset
17378
17379  in the examples above.
17380  Defaults to 
17381 \begin_inset Flex Code
17382 status collapsed
17383
17384 \begin_layout Plain Layout
17385 span
17386 \end_layout
17387
17388 \end_inset
17389
17390 , unless 
17391 \begin_inset Flex Code
17392 status collapsed
17393
17394 \begin_layout Plain Layout
17395 LabelType
17396 \end_layout
17397
17398 \end_inset
17399
17400  is either 
17401 \begin_inset Flex Code
17402 status collapsed
17403
17404 \begin_layout Plain Layout
17405 Top_Environment
17406 \end_layout
17407
17408 \end_inset
17409
17410  or 
17411 \begin_inset Flex Code
17412 status collapsed
17413
17414 \begin_layout Plain Layout
17415 Centered_Top_Environment
17416 \end_layout
17417
17418 \end_inset
17419
17420 , in which case it defaults to 
17421 \begin_inset Flex Code
17422 status collapsed
17423
17424 \begin_layout Plain Layout
17425 div
17426 \end_layout
17427
17428 \end_inset
17429
17430 .
17431 \end_layout
17432
17433 \begin_layout Description
17434 \begin_inset Flex Code
17435 status collapsed
17436
17437 \begin_layout Plain Layout
17438 HTMLLabelAttr
17439 \end_layout
17440
17441 \end_inset
17442
17443  [
17444 \begin_inset Flex Code
17445 status collapsed
17446
17447 \begin_layout Plain Layout
17448 string
17449 \end_layout
17450
17451 \end_inset
17452
17453 ] Attributes for the label tag.
17454  Defaults to 
17455 \begin_inset Quotes eld
17456 \end_inset
17457
17458
17459 \begin_inset Flex Code
17460 status collapsed
17461
17462 \begin_layout Plain Layout
17463 class=`layoutname_label'
17464 \end_layout
17465
17466 \end_inset
17467
17468
17469 \begin_inset Quotes erd
17470 \end_inset
17471
17472 .
17473  This should 
17474 \emph on
17475 not
17476 \emph default
17477  contain any style information.
17478  Use 
17479 \begin_inset Flex Code
17480 status collapsed
17481
17482 \begin_layout Plain Layout
17483 HTMLStyle
17484 \end_layout
17485
17486 \end_inset
17487
17488  for that purpose.
17489 \end_layout
17490
17491 \begin_layout Description
17492 \begin_inset Flex Code
17493 status collapsed
17494
17495 \begin_layout Plain Layout
17496 HTMLLabelFirst
17497 \end_layout
17498
17499 \end_inset
17500
17501  [
17502 \begin_inset Flex Code
17503 status collapsed
17504
17505 \begin_layout Plain Layout
17506
17507 \emph on
17508 0
17509 \emph default
17510 ,1
17511 \end_layout
17512
17513 \end_inset
17514
17515 ] Meaningful only for list-like environments, this tag controls whether
17516  the label tag is output before or inside the item tag.
17517  This is used, for example, in the description environment, where we want
17518  `
17519 \begin_inset Flex Code
17520 status collapsed
17521
17522 \begin_layout Plain Layout
17523 <dt>\SpecialChar \ldots{}
17524 </dt><dd>\SpecialChar \ldots{}
17525 </dd>
17526 \end_layout
17527
17528 \end_inset
17529
17530 .
17531  Default is 
17532 \begin_inset Flex Code
17533 status collapsed
17534
17535 \begin_layout Plain Layout
17536 0
17537 \end_layout
17538
17539 \end_inset
17540
17541 : The label tag is output inside the item tag.
17542 \end_layout
17543
17544 \begin_layout Description
17545 \begin_inset Flex Code
17546 status collapsed
17547
17548 \begin_layout Plain Layout
17549 HTMLPreamble
17550 \end_layout
17551
17552 \end_inset
17553
17554  Information to be output in the 
17555 \begin_inset Flex Code
17556 status collapsed
17557
17558 \begin_layout Plain Layout
17559 <head>
17560 \end_layout
17561
17562 \end_inset
17563
17564  section when this style is used.
17565  This might, for example, be used to include a 
17566 \begin_inset Flex Code
17567 status collapsed
17568
17569 \begin_layout Plain Layout
17570 <script>
17571 \end_layout
17572
17573 \end_inset
17574
17575  block defining an 
17576 \begin_inset Flex Code
17577 status collapsed
17578
17579 \begin_layout Plain Layout
17580 onclick
17581 \end_layout
17582
17583 \end_inset
17584
17585  handler.
17586 \end_layout
17587
17588 \begin_layout Description
17589 \begin_inset Flex Code
17590 status collapsed
17591
17592 \begin_layout Plain Layout
17593 HTMLStyle
17594 \end_layout
17595
17596 \end_inset
17597
17598  CSS style information to be included when this style is used.
17599  Note that this will automatically be wrapped in a layout-generated 
17600 \begin_inset Flex Code
17601 status collapsed
17602
17603 \begin_layout Plain Layout
17604 <style>
17605 \end_layout
17606
17607 \end_inset
17608
17609  block, so only the CSS itself need be included.
17610 \end_layout
17611
17612 \begin_layout Description
17613 \begin_inset Flex Code
17614 status collapsed
17615
17616 \begin_layout Plain Layout
17617 HTMLTag
17618 \end_layout
17619
17620 \end_inset
17621
17622  [
17623 \begin_inset Flex Code
17624 status collapsed
17625
17626 \begin_layout Plain Layout
17627 string
17628 \end_layout
17629
17630 \end_inset
17631
17632 ] The tag to be used for the main label, replacing 
17633 \begin_inset Flex Code
17634 status collapsed
17635
17636 \begin_layout Plain Layout
17637 tag
17638 \end_layout
17639
17640 \end_inset
17641
17642  in the examples above.
17643  Defaults to 
17644 \begin_inset Flex Code
17645 status collapsed
17646
17647 \begin_layout Plain Layout
17648 div
17649 \end_layout
17650
17651 \end_inset
17652
17653 .
17654 \end_layout
17655
17656 \begin_layout Description
17657 \begin_inset Flex Code
17658 status collapsed
17659
17660 \begin_layout Plain Layout
17661 HTMLTitle
17662 \end_layout
17663
17664 \end_inset
17665
17666  [
17667 \begin_inset Flex Code
17668 status collapsed
17669
17670 \begin_layout Plain Layout
17671
17672 \emph on
17673 0
17674 \emph default
17675 ,1
17676 \end_layout
17677
17678 \end_inset
17679
17680 ] Marks this style as the one to be used to generate the 
17681 \begin_inset Flex Code
17682 status collapsed
17683
17684 \begin_layout Plain Layout
17685 <title>
17686 \end_layout
17687
17688 \end_inset
17689
17690  tag for the XHTML file.
17691  By default, it is false.
17692  The 
17693 \begin_inset Flex Code
17694 status collapsed
17695
17696 \begin_layout Plain Layout
17697 stdtitle.inc
17698 \end_layout
17699
17700 \end_inset
17701
17702  file sets it to true for the 
17703 \begin_inset Flex Code
17704 status collapsed
17705
17706 \begin_layout Plain Layout
17707 title
17708 \end_layout
17709
17710 \end_inset
17711
17712  environment.
17713  
17714 \end_layout
17715
17716 \begin_layout Subsection
17717 InsetLayout XHTML
17718 \end_layout
17719
17720 \begin_layout Standard
17721 The XHTML output of insets can also be controlled by information in layout
17722  files.
17723 \begin_inset Foot
17724 status collapsed
17725
17726 \begin_layout Plain Layout
17727 At present, this is true only for 
17728 \begin_inset Quotes eld
17729 \end_inset
17730
17731 text
17732 \begin_inset Quotes erd
17733 \end_inset
17734
17735  insets (insets you can type into) and is not true for 
17736 \begin_inset Quotes eld
17737 \end_inset
17738
17739 command
17740 \begin_inset Quotes erd
17741 \end_inset
17742
17743  insets (insets that are associated with dialog boxes).
17744 \end_layout
17745
17746 \end_inset
17747
17748  Here, too, LyX tries to provide sensible defaults, and it constructs default
17749  CSS style rules.
17750  But everything can be customized.
17751 \end_layout
17752
17753 \begin_layout Standard
17754 The XHTML LyX outputs for an inset has the following form:
17755 \end_layout
17756
17757 \begin_layout LyX-Code
17758 <tag attr=
17759 \begin_inset Quotes erd
17760 \end_inset
17761
17762 value
17763 \begin_inset Quotes erd
17764 \end_inset
17765
17766 >
17767 \end_layout
17768
17769 \begin_layout LyX-Code
17770 <labeltag>Label</labeltag>
17771 \end_layout
17772
17773 \begin_layout LyX-Code
17774 <innertag attr=
17775 \begin_inset Quotes erd
17776 \end_inset
17777
17778 value
17779 \begin_inset Quotes erd
17780 \end_inset
17781
17782 >Contents of the inset.</innertag>
17783 \end_layout
17784
17785 \begin_layout LyX-Code
17786 </tag>
17787 \end_layout
17788
17789 \begin_layout Standard
17790 If the inset permits multiple paragraphs---that is, if 
17791 \begin_inset Flex Code
17792 status collapsed
17793
17794 \begin_layout Plain Layout
17795 MultiPar
17796 \end_layout
17797
17798 \end_inset
17799
17800  is true---then the contents of the inset will itself be output as paragraphs
17801  formatted according to the styles used for those paragraphs (standard,
17802  quote, and the like).
17803  The label tag is of course omitted if the paragraph does not have a label
17804  and, at present, is always 
17805 \begin_inset Flex Code
17806 status collapsed
17807
17808 \begin_layout Plain Layout
17809 span
17810 \end_layout
17811
17812 \end_inset
17813
17814 .
17815  The inner tag is optional and, by default, does not appear.
17816 \end_layout
17817
17818 \begin_layout Standard
17819 The specific tags and attributes output for each inset can be controlled
17820  by means of the following layout tags.
17821 \end_layout
17822
17823 \begin_layout Description
17824 \begin_inset Flex Code
17825 status collapsed
17826
17827 \begin_layout Plain Layout
17828 HTMLAttr
17829 \end_layout
17830
17831 \end_inset
17832
17833  [
17834 \begin_inset Flex Code
17835 status collapsed
17836
17837 \begin_layout Plain Layout
17838 string
17839 \end_layout
17840
17841 \end_inset
17842
17843 ] Specifies attribute information to be output with the main tag.
17844  For example, 
17845 \begin_inset Quotes eld
17846 \end_inset
17847
17848
17849 \begin_inset Flex Code
17850 status collapsed
17851
17852 \begin_layout Plain Layout
17853 class=`myinset' onclick=`\SpecialChar \ldots{}
17854 '
17855 \end_layout
17856
17857 \end_inset
17858
17859
17860 \begin_inset Quotes erd
17861 \end_inset
17862
17863 .
17864  By default, LyX will output 
17865 \begin_inset Quotes eld
17866 \end_inset
17867
17868
17869 \begin_inset Flex Code
17870 status collapsed
17871
17872 \begin_layout Plain Layout
17873 class=`insetname'
17874 \end_layout
17875
17876 \end_inset
17877
17878
17879 \begin_inset Quotes erd
17880 \end_inset
17881
17882 , where 
17883 \begin_inset Flex Code
17884 status collapsed
17885
17886 \begin_layout Plain Layout
17887 insetname
17888 \end_layout
17889
17890 \end_inset
17891
17892  is the LyX name of the inset, made lowercase and with non-alphanumeric
17893  characters converted to underscores, for example: footnote.
17894 \end_layout
17895
17896 \begin_layout Description
17897 \begin_inset Flex Code
17898 status collapsed
17899
17900 \begin_layout Plain Layout
17901 HTMLForceCSS
17902 \end_layout
17903
17904 \end_inset
17905
17906  [
17907 \begin_inset Flex Code
17908 status collapsed
17909
17910 \begin_layout Plain Layout
17911
17912 \emph on
17913 0
17914 \emph default
17915 ,1
17916 \end_layout
17917
17918 \end_inset
17919
17920 ] Whether to output the default CSS information LyX generates for this layout,
17921  even if additional information is explicitly provided via 
17922 \begin_inset Flex Code
17923 status collapsed
17924
17925 \begin_layout Plain Layout
17926 HTMLStyle
17927 \end_layout
17928
17929 \end_inset
17930
17931 .
17932  Setting this to 
17933 \begin_inset Flex Code
17934 status collapsed
17935
17936 \begin_layout Plain Layout
17937 1
17938 \end_layout
17939
17940 \end_inset
17941
17942  allows you to alter or augment the generated CSS, rather than to override
17943  it completely.
17944  Default is 0.
17945 \end_layout
17946
17947 \begin_layout Description
17948 \begin_inset Flex Code
17949 status collapsed
17950
17951 \begin_layout Plain Layout
17952 HTMLInnerAttr
17953 \end_layout
17954
17955 \end_inset
17956
17957  [
17958 \begin_inset Flex Code
17959 status collapsed
17960
17961 \begin_layout Plain Layout
17962 string
17963 \end_layout
17964
17965 \end_inset
17966
17967 ] Attributes for the inner tag.
17968  Defaults to 
17969 \begin_inset Quotes eld
17970 \end_inset
17971
17972
17973 \begin_inset Flex Code
17974 status collapsed
17975
17976 \begin_layout Plain Layout
17977 class=`insetname_inner'
17978 \end_layout
17979
17980 \end_inset
17981
17982
17983 \begin_inset Quotes erd
17984 \end_inset
17985
17986 .
17987 \end_layout
17988
17989 \begin_layout Description
17990 \begin_inset Flex Code
17991 status collapsed
17992
17993 \begin_layout Plain Layout
17994 HTMLInnerTag
17995 \end_layout
17996
17997 \end_inset
17998
17999  [
18000 \begin_inset Flex Code
18001 status collapsed
18002
18003 \begin_layout Plain Layout
18004 string
18005 \end_layout
18006
18007 \end_inset
18008
18009 ] The inner tag, replacing 
18010 \begin_inset Flex Code
18011 status collapsed
18012
18013 \begin_layout Plain Layout
18014 innertag
18015 \end_layout
18016
18017 \end_inset
18018
18019  in the examples above.
18020  By default, there is none.
18021 \end_layout
18022
18023 \begin_layout Description
18024 \begin_inset Flex Code
18025 status collapsed
18026
18027 \begin_layout Plain Layout
18028 HTMLIsBlock
18029 \end_layout
18030
18031 \end_inset
18032
18033  [
18034 \begin_inset Flex Code
18035 status collapsed
18036
18037 \begin_layout Plain Layout
18038 0,
18039 \emph on
18040 1
18041 \end_layout
18042
18043 \end_inset
18044
18045 ] Whether this inset represents a standalone block of text (such as a footnote)
18046  or instead represents material that is included in the surrounding text
18047  (such as a branch).
18048  Defaults to 1.
18049 \end_layout
18050
18051 \begin_layout Description
18052 \begin_inset Flex Code
18053 status collapsed
18054
18055 \begin_layout Plain Layout
18056 HTMLLabel
18057 \end_layout
18058
18059 \end_inset
18060
18061  [
18062 \begin_inset Flex Code
18063 status collapsed
18064
18065 \begin_layout Plain Layout
18066 string
18067 \end_layout
18068
18069 \end_inset
18070
18071 ] A label for this inset, possibly including a reference to a counter.
18072  For example, for footnote, it might be: 
18073 \begin_inset Flex Code
18074 status collapsed
18075
18076 \begin_layout Plain Layout
18077
18078 \backslash
18079 arabic{footnote}
18080 \end_layout
18081
18082 \end_inset
18083
18084 .
18085  This is optional, and there is no default.
18086 \end_layout
18087
18088 \begin_layout Description
18089 \begin_inset Flex Code
18090 status collapsed
18091
18092 \begin_layout Plain Layout
18093 HTMLPreamble
18094 \end_layout
18095
18096 \end_inset
18097
18098  Information to be output in the 
18099 \begin_inset Flex Code
18100 status collapsed
18101
18102 \begin_layout Plain Layout
18103 <head>
18104 \end_layout
18105
18106 \end_inset
18107
18108  section when this style is used.
18109  This might, for example, be used to include a 
18110 \begin_inset Flex Code
18111 status collapsed
18112
18113 \begin_layout Plain Layout
18114 <script>
18115 \end_layout
18116
18117 \end_inset
18118
18119  block defining an 
18120 \begin_inset Flex Code
18121 status collapsed
18122
18123 \begin_layout Plain Layout
18124 onclick
18125 \end_layout
18126
18127 \end_inset
18128
18129  handler.
18130 \end_layout
18131
18132 \begin_layout Description
18133 \begin_inset Flex Code
18134 status collapsed
18135
18136 \begin_layout Plain Layout
18137 HTMLStyle
18138 \end_layout
18139
18140 \end_inset
18141
18142  CSS style information to be included when this style is used.
18143  Note that this will automatically be wrapped in a layout-generated 
18144 \begin_inset Flex Code
18145 status collapsed
18146
18147 \begin_layout Plain Layout
18148 <style>
18149 \end_layout
18150
18151 \end_inset
18152
18153  block, so only the CSS itself need be included.
18154 \end_layout
18155
18156 \begin_layout Description
18157 \begin_inset Flex Code
18158 status collapsed
18159
18160 \begin_layout Plain Layout
18161 HTMLTag
18162 \end_layout
18163
18164 \end_inset
18165
18166  [
18167 \begin_inset Flex Code
18168 status collapsed
18169
18170 \begin_layout Plain Layout
18171 string
18172 \end_layout
18173
18174 \end_inset
18175
18176 ] The tag to be used for the main label, replacing 
18177 \begin_inset Flex Code
18178 status collapsed
18179
18180 \begin_layout Plain Layout
18181 tag
18182 \end_layout
18183
18184 \end_inset
18185
18186  in the examples above.
18187  The default depends upon the setting of 
18188 \begin_inset Flex Code
18189 status collapsed
18190
18191 \begin_layout Plain Layout
18192 MultiPar
18193 \end_layout
18194
18195 \end_inset
18196
18197 : If 
18198 \begin_inset Flex Code
18199 status collapsed
18200
18201 \begin_layout Plain Layout
18202 MultiPar
18203 \end_layout
18204
18205 \end_inset
18206
18207  is true, the default is 
18208 \begin_inset Flex Code
18209 status collapsed
18210
18211 \begin_layout Plain Layout
18212 div
18213 \end_layout
18214
18215 \end_inset
18216
18217 ; if it is false, the default is 
18218 \begin_inset Flex Code
18219 status collapsed
18220
18221 \begin_layout Plain Layout
18222 span
18223 \end_layout
18224
18225 \end_inset
18226
18227 .
18228 \end_layout
18229
18230 \begin_layout Subsection
18231 Float XHTML
18232 \end_layout
18233
18234 \begin_layout Standard
18235 The XHTML output for floats too can be controlled by layout information.
18236  The output has the following form:
18237 \end_layout
18238
18239 \begin_layout LyX-Code
18240 <tag attr=
18241 \begin_inset Quotes erd
18242 \end_inset
18243
18244 value
18245 \begin_inset Quotes erd
18246 \end_inset
18247
18248 >
18249 \end_layout
18250
18251 \begin_layout LyX-Code
18252 Contents of the float.
18253 \end_layout
18254
18255 \begin_layout LyX-Code
18256 </tag>
18257 \end_layout
18258
18259 \begin_layout Standard
18260 The caption, if there is one, is a separate inset and will be output as
18261  such.
18262  Its appearance can be controlled via the InsetLayout for caption insets.
18263  
18264 \end_layout
18265
18266 \begin_layout Description
18267 \begin_inset Flex Code
18268 status collapsed
18269
18270 \begin_layout Plain Layout
18271 HTMLAttr
18272 \end_layout
18273
18274 \end_inset
18275
18276  [
18277 \begin_inset Flex Code
18278 status collapsed
18279
18280 \begin_layout Plain Layout
18281 string
18282 \end_layout
18283
18284 \end_inset
18285
18286 ] Specifies attribute information to be output with the main tag.
18287  For example, 
18288 \begin_inset Quotes eld
18289 \end_inset
18290
18291
18292 \begin_inset Flex Code
18293 status collapsed
18294
18295 \begin_layout Plain Layout
18296 class=`myfloat' onclick=`\SpecialChar \ldots{}
18297 '
18298 \end_layout
18299
18300 \end_inset
18301
18302
18303 \begin_inset Quotes erd
18304 \end_inset
18305
18306 .
18307  By default, LyX will output 
18308 \begin_inset Quotes eld
18309 \end_inset
18310
18311
18312 \begin_inset Flex Code
18313 status collapsed
18314
18315 \begin_layout Plain Layout
18316 class=`float float-floattype'
18317 \end_layout
18318
18319 \end_inset
18320
18321
18322 \begin_inset Quotes erd
18323 \end_inset
18324
18325 , where 
18326 \begin_inset Flex Code
18327 status collapsed
18328
18329 \begin_layout Plain Layout
18330 floattype
18331 \end_layout
18332
18333 \end_inset
18334
18335  is LyX's name for this type of float, as determined by the float declaration
18336  (see 
18337 \begin_inset CommandInset ref
18338 LatexCommand ref
18339 reference "sub:Floats"
18340
18341 \end_inset
18342
18343 ), though made lowercase and with non-alphanumeric characters converted
18344  to underscores, for example: float-table.
18345 \end_layout
18346
18347 \begin_layout Description
18348 \begin_inset Flex Code
18349 status collapsed
18350
18351 \begin_layout Plain Layout
18352 HTMLStyle
18353 \end_layout
18354
18355 \end_inset
18356
18357  CSS style information to be included when this float is used.
18358  Note that this will automatically be wrapped in a layout-generated 
18359 \begin_inset Flex Code
18360 status collapsed
18361
18362 \begin_layout Plain Layout
18363 <style>
18364 \end_layout
18365
18366 \end_inset
18367
18368  block, so only the CSS itself need be included.
18369 \end_layout
18370
18371 \begin_layout Description
18372 \begin_inset Flex Code
18373 status collapsed
18374
18375 \begin_layout Plain Layout
18376 HTMLTag
18377 \end_layout
18378
18379 \end_inset
18380
18381  [
18382 \begin_inset Flex Code
18383 status collapsed
18384
18385 \begin_layout Plain Layout
18386 string
18387 \end_layout
18388
18389 \end_inset
18390
18391 ] The tag to be used for this float, replacing 
18392 \begin_inset Quotes eld
18393 \end_inset
18394
18395
18396 \begin_inset Flex Code
18397 status collapsed
18398
18399 \begin_layout Plain Layout
18400 tag
18401 \end_layout
18402
18403 \end_inset
18404
18405
18406 \begin_inset Quotes erd
18407 \end_inset
18408
18409  in the example above.
18410  The default is 
18411 \begin_inset Flex Code
18412 status collapsed
18413
18414 \begin_layout Plain Layout
18415 div
18416 \end_layout
18417
18418 \end_inset
18419
18420  and will rarely need changing.
18421 \end_layout
18422
18423 \begin_layout Subsection
18424 Bibliography formatting
18425 \end_layout
18426
18427 \begin_layout Standard
18428 The bibliography can be formatted using 
18429 \begin_inset Flex Code
18430 status collapsed
18431
18432 \begin_layout Plain Layout
18433 CiteFormat
18434 \end_layout
18435
18436 \end_inset
18437
18438  blocks.
18439  See Section 
18440 \begin_inset CommandInset ref
18441 LatexCommand ref
18442 reference "sub:Citation-format-description"
18443
18444 \end_inset
18445
18446  for the details.
18447 \end_layout
18448
18449 \begin_layout Subsection
18450 LyX-generated CSS
18451 \end_layout
18452
18453 \begin_layout Standard
18454 We have several times mentioned that LyX will generate default CSS style
18455  rules for both insets and paragraph styles, based upon the other layout
18456  information that is provided.
18457  In this section, we shall say a word about which layout information LyX
18458  uses and how.
18459 \end_layout
18460
18461 \begin_layout Standard
18462 At present, LyX auto-generates CSS only for font information, making use
18463  of the 
18464 \begin_inset Flex Code
18465 status collapsed
18466
18467 \begin_layout Plain Layout
18468 Family
18469 \end_layout
18470
18471 \end_inset
18472
18473
18474 \begin_inset Flex Code
18475 status collapsed
18476
18477 \begin_layout Plain Layout
18478 Series
18479 \end_layout
18480
18481 \end_inset
18482
18483
18484 \begin_inset Flex Code
18485 status collapsed
18486
18487 \begin_layout Plain Layout
18488 Shape
18489 \end_layout
18490
18491 \end_inset
18492
18493 , and 
18494 \begin_inset Flex Code
18495 status collapsed
18496
18497 \begin_layout Plain Layout
18498 Size
18499 \end_layout
18500
18501 \end_inset
18502
18503  specified in the 
18504 \begin_inset Flex Code
18505 status collapsed
18506
18507 \begin_layout Plain Layout
18508 Font
18509 \end_layout
18510
18511 \end_inset
18512
18513  declaration.
18514  (See 
18515 \begin_inset CommandInset ref
18516 LatexCommand ref
18517 reference "sub:Font-description"
18518
18519 \end_inset
18520
18521 .) The translation is mostly straightforward and obvious.
18522  For example, 
18523 \begin_inset Quotes eld
18524 \end_inset
18525
18526
18527 \begin_inset Flex Code
18528 status collapsed
18529
18530 \begin_layout Plain Layout
18531 Family Sans
18532 \end_layout
18533
18534 \end_inset
18535
18536
18537 \begin_inset Quotes erd
18538 \end_inset
18539
18540  becomes 
18541 \begin_inset Quotes eld
18542 \end_inset
18543
18544
18545 \begin_inset Flex Code
18546 status collapsed
18547
18548 \begin_layout Plain Layout
18549 font-family: sans-serif;
18550 \end_layout
18551
18552 \end_inset
18553
18554
18555 \begin_inset Quotes erd
18556 \end_inset
18557
18558 .
18559  The correspondence of LyX sizes and CSS sizes is a little less obvious
18560  but nonetheless intuitive.
18561  See the 
18562 \begin_inset Flex Code
18563 status collapsed
18564
18565 \begin_layout Plain Layout
18566 getSizeCSS()
18567 \end_layout
18568
18569 \end_inset
18570
18571  function in 
18572 \begin_inset Flex URL
18573 status collapsed
18574
18575 \begin_layout Plain Layout
18576
18577 src/FontInfo.cpp
18578 \end_layout
18579
18580 \end_inset
18581
18582  for the details.
18583  
18584 \end_layout
18585
18586 \begin_layout Chapter
18587 Including External Material
18588 \end_layout
18589
18590 \begin_layout Standard
18591 \begin_inset Box Shadowbox
18592 position "t"
18593 hor_pos "c"
18594 has_inner_box 1
18595 inner_pos "t"
18596 use_parbox 0
18597 use_makebox 0
18598 width "100col%"
18599 special "none"
18600 height "1in"
18601 height_special "totalheight"
18602 status open
18603
18604 \begin_layout Plain Layout
18605 WARNING: This portion of the documentation has not been updated for some
18606  time.
18607  We certainly hope that it is still accurate, but there are no guarantees.
18608 \end_layout
18609
18610 \end_inset
18611
18612
18613 \end_layout
18614
18615 \begin_layout Standard
18616 The use of material from sources external to LyX is covered in detail in
18617  the 
18618 \emph on
18619 Embedded Objects
18620 \emph default
18621  manual.
18622  This part of the manual covers what needs to happen behind the scenes for
18623  new sorts of material to be included.
18624 \end_layout
18625
18626 \begin_layout Section
18627 How does it work?
18628 \end_layout
18629
18630 \begin_layout Standard
18631 The external material feature is based on the concept of a 
18632 \emph on
18633 template
18634 \emph default
18635 .
18636  A template is a specification of how LyX should interface with a certain
18637  kind of material.
18638  As bundled, LyX comes with predefined templates for Xfig figures, various
18639  raster format images, chess diagrams, and LilyPond music notation.
18640  You can check the actual list by using the menu 
18641 \begin_inset Flex MenuItem
18642 status collapsed
18643
18644 \begin_layout Plain Layout
18645 Insert\SpecialChar \menuseparator
18646 File\SpecialChar \menuseparator
18647 External Material
18648 \end_layout
18649
18650 \end_inset
18651
18652 .
18653  Furthermore, it is possible to roll your own template to support a specific
18654  kind of material.
18655  Later we'll describe in more detail what is involved, and hopefully you
18656  will submit all the templates you create so we can include them in a later
18657  LyX version.
18658 \end_layout
18659
18660 \begin_layout Standard
18661 Another basic idea of the external material feature is to distinguish between
18662  the original file that serves as a base for final material and the produced
18663  file that is included in your exported or printed document.
18664  For example, consider the case of a figure produced with 
18665 \begin_inset Flex Code
18666 status collapsed
18667
18668 \begin_layout Plain Layout
18669 Xfig
18670 \end_layout
18671
18672 \end_inset
18673
18674 .
18675  The Xfig application itself works on an original file with the 
18676 \begin_inset Flex Code
18677 status collapsed
18678
18679 \begin_layout Plain Layout
18680 .fig
18681 \end_layout
18682
18683 \end_inset
18684
18685  extension.
18686  Within Xfig, you create and change your figure, and when you are done,
18687  you save the 
18688 \begin_inset Flex Code
18689 status collapsed
18690
18691 \begin_layout Plain Layout
18692 fig
18693 \end_layout
18694
18695 \end_inset
18696
18697 -file.
18698  When you want to include the figure in your document, you invoke 
18699 \begin_inset Flex Code
18700 status collapsed
18701
18702 \begin_layout Plain Layout
18703 transfig
18704 \end_layout
18705
18706 \end_inset
18707
18708  in order to create a PostScript file that can readily be included in your
18709  LaTeX file.
18710  In this case, the 
18711 \begin_inset Flex Code
18712 status collapsed
18713
18714 \begin_layout Plain Layout
18715 .fig
18716 \end_layout
18717
18718 \end_inset
18719
18720  file is the original file, and the PostScript file is the produced file.
18721 \end_layout
18722
18723 \begin_layout Standard
18724 This distinction is important in order to allow updating of the material
18725  while you are in the process of writing the document.
18726  Furthermore, it provides us with the flexibility that is needed to support
18727  multiple export formats.
18728  For instance, in the case of a plain text file, it is not exactly an award-winn
18729 ing idea to include the figure as raw PostScript.
18730  Instead, you would either prefer to just include a reference to the figure
18731  or try to invoke some graphics to ASCII converter to make the final result
18732  look similar to the real graphics.
18733  The external material management allows you to do this, because it is parametri
18734 zed on the different export formats that LyX supports.
18735 \end_layout
18736
18737 \begin_layout Standard
18738 Besides supporting the production of different products according to the
18739  exported format, it supports tight integration with editing and viewing
18740  applications.
18741  In the case of an Xfig figure, you are able to invoke Xfig on the original
18742  file with a single click from within the external material dialog in LyX,
18743  and also preview the produced PostScript file with Ghostview with another
18744  click.
18745  No more fiddling around with the command line and/or file browsers to locate
18746  and manipulate the original or produced files.
18747  In this way, you are finally able to take full advantage of the many different
18748  applications that are relevant to use when you write your documents, and
18749  ultimately be more productive.
18750 \end_layout
18751
18752 \begin_layout Section
18753 The external template configuration file
18754 \end_layout
18755
18756 \begin_layout Standard
18757 It is relatively easy to add custom external template definitions to LyX.
18758  However, be aware that doing this in an careless manner most probably 
18759 \emph on
18760 will
18761 \emph default
18762  introduce an easily exploitable security hole.
18763  So before you do this, please read the discussion about security in section
18764  
18765 \begin_inset CommandInset ref
18766 LatexCommand ref
18767 reference "sec:Security-discussion"
18768
18769 \end_inset
18770
18771 .
18772 \end_layout
18773
18774 \begin_layout Standard
18775 Having said that, we encourage you to submit any interesting templates that
18776  you create.
18777  
18778 \end_layout
18779
18780 \begin_layout Standard
18781 The external templates are defined in the 
18782 \begin_inset Flex Code
18783 status collapsed
18784
18785 \begin_layout Plain Layout
18786 LyXDir/lib/external_templates
18787 \end_layout
18788
18789 \end_inset
18790
18791  file.
18792  You can place your own version in 
18793 \begin_inset Flex Code
18794 status collapsed
18795
18796 \begin_layout Plain Layout
18797 UserDir/external_templates
18798 \end_layout
18799
18800 \end_inset
18801
18802 .
18803 \end_layout
18804
18805 \begin_layout Standard
18806 A typical template looks like this:
18807 \end_layout
18808
18809 \begin_layout LyX-Code
18810 Template XFig
18811 \end_layout
18812
18813 \begin_layout LyX-Code
18814 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18815 \end_layout
18816
18817 \begin_layout LyX-Code
18818 HelpText
18819 \end_layout
18820
18821 \begin_layout LyX-Code
18822 An XFig figure.
18823 \end_layout
18824
18825 \begin_layout LyX-Code
18826 HelpTextEnd
18827 \end_layout
18828
18829 \begin_layout LyX-Code
18830 InputFormat fig
18831 \end_layout
18832
18833 \begin_layout LyX-Code
18834 FileFilter "*.fig"
18835 \end_layout
18836
18837 \begin_layout LyX-Code
18838 AutomaticProduction true
18839 \end_layout
18840
18841 \begin_layout LyX-Code
18842 Transform Rotate
18843 \end_layout
18844
18845 \begin_layout LyX-Code
18846 Transform Resize
18847 \end_layout
18848
18849 \begin_layout LyX-Code
18850 Format LaTeX
18851 \end_layout
18852
18853 \begin_layout LyX-Code
18854 TransformCommand Rotate RotationLatexCommand
18855 \end_layout
18856
18857 \begin_layout LyX-Code
18858 TransformCommand Resize ResizeLatexCommand
18859 \end_layout
18860
18861 \begin_layout LyX-Code
18862 Product "$$RotateFront$$ResizeFront
18863 \end_layout
18864
18865 \begin_layout LyX-Code
18866          
18867 \backslash
18868
18869 \backslash
18870 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18871 \end_layout
18872
18873 \begin_layout LyX-Code
18874          $$ResizeBack$$RotateBack"
18875 \end_layout
18876
18877 \begin_layout LyX-Code
18878 UpdateFormat pstex
18879 \end_layout
18880
18881 \begin_layout LyX-Code
18882 UpdateResult "$$AbsPath$$Basename.pstex_t"
18883 \end_layout
18884
18885 \begin_layout LyX-Code
18886 Requirement "graphicx"
18887 \end_layout
18888
18889 \begin_layout LyX-Code
18890 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18891 \end_layout
18892
18893 \begin_layout LyX-Code
18894 ReferencedFile latex "$$AbsPath$$Basename.eps"
18895 \end_layout
18896
18897 \begin_layout LyX-Code
18898 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18899 \end_layout
18900
18901 \begin_layout LyX-Code
18902 FormatEnd
18903 \end_layout
18904
18905 \begin_layout LyX-Code
18906 Format PDFLaTeX
18907 \end_layout
18908
18909 \begin_layout LyX-Code
18910 TransformCommand Rotate RotationLatexCommand
18911 \end_layout
18912
18913 \begin_layout LyX-Code
18914 TransformCommand Resize ResizeLatexCommand
18915 \end_layout
18916
18917 \begin_layout LyX-Code
18918 Product "$$RotateFront$$ResizeFront
18919 \end_layout
18920
18921 \begin_layout LyX-Code
18922          
18923 \backslash
18924
18925 \backslash
18926 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18927 \end_layout
18928
18929 \begin_layout LyX-Code
18930          $$ResizeBack$$RotateBack"
18931 \end_layout
18932
18933 \begin_layout LyX-Code
18934 UpdateFormat pdftex
18935 \end_layout
18936
18937 \begin_layout LyX-Code
18938 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18939 \end_layout
18940
18941 \begin_layout LyX-Code
18942 Requirement "graphicx"
18943 \end_layout
18944
18945 \begin_layout LyX-Code
18946 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18947 \end_layout
18948
18949 \begin_layout LyX-Code
18950 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18951 \end_layout
18952
18953 \begin_layout LyX-Code
18954 FormatEnd
18955 \end_layout
18956
18957 \begin_layout LyX-Code
18958 Format Ascii
18959 \end_layout
18960
18961 \begin_layout LyX-Code
18962 Product "$$Contents(
18963 \backslash
18964 "$$AbsPath$$Basename.asc
18965 \backslash
18966 ")"
18967 \end_layout
18968
18969 \begin_layout LyX-Code
18970 UpdateFormat asciixfig
18971 \end_layout
18972
18973 \begin_layout LyX-Code
18974 UpdateResult "$$AbsPath$$Basename.asc"
18975 \end_layout
18976
18977 \begin_layout LyX-Code
18978 FormatEnd
18979 \end_layout
18980
18981 \begin_layout LyX-Code
18982 Format DocBook
18983 \end_layout
18984
18985 \begin_layout LyX-Code
18986 Product "<graphic fileref=
18987 \backslash
18988 "$$AbsOrRelPathMaster$$Basename.eps
18989 \backslash
18990 ">
18991 \end_layout
18992
18993 \begin_layout LyX-Code
18994          </graphic>"
18995 \end_layout
18996
18997 \begin_layout LyX-Code
18998 UpdateFormat eps
18999 \end_layout
19000
19001 \begin_layout LyX-Code
19002 UpdateResult "$$AbsPath$$Basename.eps"
19003 \end_layout
19004
19005 \begin_layout LyX-Code
19006 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19007 \end_layout
19008
19009 \begin_layout LyX-Code
19010 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19011 \end_layout
19012
19013 \begin_layout LyX-Code
19014 FormatEnd
19015 \end_layout
19016
19017 \begin_layout LyX-Code
19018 Product "[XFig: $$FName]"
19019 \end_layout
19020
19021 \begin_layout LyX-Code
19022 FormatEnd
19023 \end_layout
19024
19025 \begin_layout LyX-Code
19026 TemplateEnd
19027 \end_layout
19028
19029 \begin_layout Standard
19030 As you can see, the template is enclosed in 
19031 \begin_inset Flex Code
19032 status collapsed
19033
19034 \begin_layout Plain Layout
19035 Template
19036 \end_layout
19037
19038 \end_inset
19039
19040  \SpecialChar \ldots{}
19041  
19042 \begin_inset Flex Code
19043 status collapsed
19044
19045 \begin_layout Plain Layout
19046 TemplateEnd
19047 \end_layout
19048
19049 \end_inset
19050
19051 .
19052  It contains a header specifying some general settings and, for each supported
19053  primary document file format, a section 
19054 \begin_inset Flex Code
19055 status collapsed
19056
19057 \begin_layout Plain Layout
19058 Format
19059 \end_layout
19060
19061 \end_inset
19062
19063  \SpecialChar \ldots{}
19064  
19065 \begin_inset Flex Code
19066 status collapsed
19067
19068 \begin_layout Plain Layout
19069 FormatEnd
19070 \end_layout
19071
19072 \end_inset
19073
19074 .
19075 \end_layout
19076
19077 \begin_layout Subsection
19078 The template header
19079 \end_layout
19080
19081 \begin_layout Description
19082 \begin_inset Flex Code
19083 status collapsed
19084
19085 \begin_layout Plain Layout
19086 AutomaticProduction
19087 \begin_inset space ~
19088 \end_inset
19089
19090 true|false
19091 \end_layout
19092
19093 \end_inset
19094
19095  Whether the file represented by the template must be generated by LyX.
19096  This command must occur exactly once.
19097 \end_layout
19098
19099 \begin_layout Description
19100 \begin_inset Flex Code
19101 status collapsed
19102
19103 \begin_layout Plain Layout
19104 FileFilter
19105 \begin_inset space ~
19106 \end_inset
19107
19108 <pattern>
19109 \end_layout
19110
19111 \end_inset
19112
19113  A glob pattern that is used in the file dialog to filter out the desired
19114  files.
19115  If there is more than one possible file extension (e.
19116 \begin_inset space \thinspace{}
19117 \end_inset
19118
19119 g.
19120 \begin_inset space \space{}
19121 \end_inset
19122
19123 tgif has 
19124 \begin_inset Flex Code
19125 status collapsed
19126
19127 \begin_layout Plain Layout
19128 .obj
19129 \end_layout
19130
19131 \end_inset
19132
19133  and 
19134 \begin_inset Flex Code
19135 status collapsed
19136
19137 \begin_layout Plain Layout
19138 .tgo
19139 \end_layout
19140
19141 \end_inset
19142
19143 ), use something like 
19144 \begin_inset Flex Code
19145 status collapsed
19146
19147 \begin_layout Plain Layout
19148 "*.{obj,tgo}"
19149 \end_layout
19150
19151 \end_inset
19152
19153 .
19154  This command must occur exactly once.
19155 \end_layout
19156
19157 \begin_layout Description
19158 \begin_inset Flex Code
19159 status collapsed
19160
19161 \begin_layout Plain Layout
19162 GuiName
19163 \begin_inset space ~
19164 \end_inset
19165
19166 <guiname>
19167 \end_layout
19168
19169 \end_inset
19170
19171  The text that is displayed on the button.
19172  This command must occur exactly once.
19173 \end_layout
19174
19175 \begin_layout Description
19176 \begin_inset Flex Code
19177 status collapsed
19178
19179 \begin_layout Plain Layout
19180 HelpText
19181 \begin_inset space ~
19182 \end_inset
19183
19184 <text>
19185 \begin_inset space ~
19186 \end_inset
19187
19188 HelpTextEnd
19189 \end_layout
19190
19191 \end_inset
19192
19193  The help text that is used in the External dialog.
19194  Provide enough information to explain to the user just what the template
19195  can provide him with.
19196  This command must occur exactly once.
19197 \end_layout
19198
19199 \begin_layout Description
19200 \begin_inset Flex Code
19201 status collapsed
19202
19203 \begin_layout Plain Layout
19204 InputFormat
19205 \begin_inset space ~
19206 \end_inset
19207
19208 <format>
19209 \end_layout
19210
19211 \end_inset
19212
19213  The file format of the original file.
19214  This must be the name of a format that is known to LyX (see section
19215 \begin_inset space ~
19216 \end_inset
19217
19218
19219 \begin_inset CommandInset ref
19220 LatexCommand ref
19221 reference "sec:Formats"
19222
19223 \end_inset
19224
19225 ).
19226  Use 
19227 \begin_inset Quotes eld
19228 \end_inset
19229
19230
19231 \begin_inset Flex Code
19232 status collapsed
19233
19234 \begin_layout Plain Layout
19235 *
19236 \end_layout
19237
19238 \end_inset
19239
19240
19241 \begin_inset Quotes erd
19242 \end_inset
19243
19244  if the template can handle original files of more than one format.
19245  LyX will attempt to interrogate the file itself in order to deduce its
19246  format in this case.
19247  This command must occur exactly once.
19248 \end_layout
19249
19250 \begin_layout Description
19251 \begin_inset Flex Code
19252 status collapsed
19253
19254 \begin_layout Plain Layout
19255 Template
19256 \begin_inset space ~
19257 \end_inset
19258
19259 <id>
19260 \end_layout
19261
19262 \end_inset
19263
19264  A unique name for the template.
19265  It must not contain substitution macros (see below).
19266 \end_layout
19267
19268 \begin_layout Description
19269 \begin_inset Flex Code
19270 status collapsed
19271
19272 \begin_layout Plain Layout
19273 Transform
19274 \begin_inset space ~
19275 \end_inset
19276
19277 Rotate|Resize|Clip|Extra
19278 \end_layout
19279
19280 \end_inset
19281
19282  This command specifies which transformations are supported by this template.
19283  It may occur zero or more times.
19284  This command enables the corresponding tabs in the external dialog.
19285  Each 
19286 \begin_inset Flex Code
19287 status collapsed
19288
19289 \begin_layout Plain Layout
19290 Transform
19291 \end_layout
19292
19293 \end_inset
19294
19295  command must have either a corresponding 
19296 \begin_inset Flex Code
19297 status collapsed
19298
19299 \begin_layout Plain Layout
19300 TransformCommand
19301 \end_layout
19302
19303 \end_inset
19304
19305  or a 
19306 \begin_inset Flex Code
19307 status collapsed
19308
19309 \begin_layout Plain Layout
19310 TransformOption
19311 \end_layout
19312
19313 \end_inset
19314
19315  command in the 
19316 \begin_inset Flex Code
19317 status collapsed
19318
19319 \begin_layout Plain Layout
19320 Format
19321 \end_layout
19322
19323 \end_inset
19324
19325  section.
19326  Otherwise the transformation will not be supported by that format.
19327 \end_layout
19328
19329 \begin_layout Subsection
19330 The Format section
19331 \end_layout
19332
19333 \begin_layout Description
19334 \begin_inset Flex Code
19335 status collapsed
19336
19337 \begin_layout Plain Layout
19338 Format
19339 \begin_inset space ~
19340 \end_inset
19341
19342 LaTeX|PDFLaTeX|PlainText|DocBook
19343 \end_layout
19344
19345 \end_inset
19346
19347  The primary document file format that this format definition is for.
19348  Not every template has a sensible representation in all document file formats.
19349  Please define nevertheless a 
19350 \begin_inset Flex Code
19351 status collapsed
19352
19353 \begin_layout Plain Layout
19354 Format
19355 \end_layout
19356
19357 \end_inset
19358
19359  section for all templates.
19360  Use a dummy text when no representation is available.
19361  Then you can at least see a reference to the external material in the exported
19362  document.
19363 \end_layout
19364
19365 \begin_layout Description
19366 \begin_inset Flex Code
19367 status collapsed
19368
19369 \begin_layout Plain Layout
19370 Option
19371 \begin_inset space ~
19372 \end_inset
19373
19374 <name>
19375 \begin_inset space ~
19376 \end_inset
19377
19378 <value>
19379 \end_layout
19380
19381 \end_inset
19382
19383  This command defines an additional macro 
19384 \begin_inset Flex Code
19385 status collapsed
19386
19387 \begin_layout Plain Layout
19388 $$<name>
19389 \end_layout
19390
19391 \end_inset
19392
19393  for substitution in 
19394 \begin_inset Flex Code
19395 status collapsed
19396
19397 \begin_layout Plain Layout
19398 Product
19399 \end_layout
19400
19401 \end_inset
19402
19403 .
19404  
19405 \begin_inset Flex Code
19406 status collapsed
19407
19408 \begin_layout Plain Layout
19409 <value>
19410 \end_layout
19411
19412 \end_inset
19413
19414  itself may contain substitution macros.
19415  The advantage over using 
19416 \begin_inset Flex Code
19417 status collapsed
19418
19419 \begin_layout Plain Layout
19420 <value>
19421 \end_layout
19422
19423 \end_inset
19424
19425  directly in 
19426 \begin_inset Flex Code
19427 status collapsed
19428
19429 \begin_layout Plain Layout
19430 Product
19431 \end_layout
19432
19433 \end_inset
19434
19435  is that the substituted value of 
19436 \begin_inset Flex Code
19437 status collapsed
19438
19439 \begin_layout Plain Layout
19440 $$<name>
19441 \end_layout
19442
19443 \end_inset
19444
19445  is sanitized so that it is a valid optional argument in the document format.
19446  This command may occur zero or more times.
19447 \end_layout
19448
19449 \begin_layout Description
19450 \begin_inset Flex Code
19451 status collapsed
19452
19453 \begin_layout Plain Layout
19454 Product
19455 \begin_inset space ~
19456 \end_inset
19457
19458 <text>
19459 \end_layout
19460
19461 \end_inset
19462
19463  The text that is inserted in the exported document.
19464  This is actually the most important command and can be quite complex.
19465  This command must occur exactly once.
19466 \end_layout
19467
19468 \begin_layout Description
19469 \begin_inset Flex Code
19470 status collapsed
19471
19472 \begin_layout Plain Layout
19473 Preamble
19474 \begin_inset space ~
19475 \end_inset
19476
19477 <name>
19478 \end_layout
19479
19480 \end_inset
19481
19482  This command specifies a preamble snippet that will be included in the
19483  LaTeX preamble.
19484  It has to be defined using 
19485 \begin_inset Flex Code
19486 status collapsed
19487
19488 \begin_layout Plain Layout
19489 PreambleDef
19490 \end_layout
19491
19492 \end_inset
19493
19494  \SpecialChar \ldots{}
19495  
19496 \begin_inset Flex Code
19497 status collapsed
19498
19499 \begin_layout Plain Layout
19500 PreambleDefEnd
19501 \end_layout
19502
19503 \end_inset
19504
19505 .
19506  This command may occur zero or more times.
19507 \end_layout
19508
19509 \begin_layout Description
19510 \begin_inset Flex Code
19511 status collapsed
19512
19513 \begin_layout Plain Layout
19514 ReferencedFile
19515 \begin_inset space ~
19516 \end_inset
19517
19518 <format>
19519 \begin_inset space ~
19520 \end_inset
19521
19522 <filename>
19523 \end_layout
19524
19525 \end_inset
19526
19527  This command denotes files that are created by the conversion process and
19528  are needed for a particular export format.
19529  If the filename is relative, it is interpreted relative to the master document.
19530  This command may be given zero or more times.
19531 \end_layout
19532
19533 \begin_layout Description
19534 \begin_inset Flex Code
19535 status collapsed
19536
19537 \begin_layout Plain Layout
19538 Requirement
19539 \begin_inset space ~
19540 \end_inset
19541
19542 <package>
19543 \end_layout
19544
19545 \end_inset
19546
19547  The name of a required LaTeX package.
19548  The package is included via 
19549 \begin_inset Flex Code
19550 status collapsed
19551
19552 \begin_layout Plain Layout
19553
19554 \backslash
19555 usepackage{}
19556 \end_layout
19557
19558 \end_inset
19559
19560  in the LaTeX preamble.
19561  This command may occur zero or more times.
19562 \end_layout
19563
19564 \begin_layout Description
19565 \begin_inset Flex Code
19566 status collapsed
19567
19568 \begin_layout Plain Layout
19569 TransformCommand
19570 \begin_inset space ~
19571 \end_inset
19572
19573 Rotate
19574 \begin_inset space ~
19575 \end_inset
19576
19577 RotationLatexCommand
19578 \end_layout
19579
19580 \end_inset
19581
19582  This command specifies that the built in LaTeX command should be used for
19583  rotation.
19584  This command may occur once or not at all.
19585 \end_layout
19586
19587 \begin_layout Description
19588 \begin_inset Flex Code
19589 status collapsed
19590
19591 \begin_layout Plain Layout
19592 TransformCommand
19593 \begin_inset space ~
19594 \end_inset
19595
19596 Resize
19597 \begin_inset space ~
19598 \end_inset
19599
19600 ResizeLatexCommand
19601 \end_layout
19602
19603 \end_inset
19604
19605  This command specifies that the built in LaTeX command should be used for
19606  resizing.
19607  This command may occur once or not at all.
19608 \end_layout
19609
19610 \begin_layout Description
19611 \begin_inset Flex Code
19612 status collapsed
19613
19614 \begin_layout Plain Layout
19615 TransformOption
19616 \begin_inset space ~
19617 \end_inset
19618
19619 Rotate
19620 \begin_inset space ~
19621 \end_inset
19622
19623 RotationLatexOption
19624 \end_layout
19625
19626 \end_inset
19627
19628  This command specifies that rotation is done via an optional argument.
19629  This command may occur once or not at all.
19630 \end_layout
19631
19632 \begin_layout Description
19633 \begin_inset Flex Code
19634 status collapsed
19635
19636 \begin_layout Plain Layout
19637 TransformOption
19638 \begin_inset space ~
19639 \end_inset
19640
19641 Resize
19642 \begin_inset space ~
19643 \end_inset
19644
19645 ResizeLatexOption
19646 \end_layout
19647
19648 \end_inset
19649
19650  This command specifies that resizing is done via an optional argument.
19651  This command may occur once or not at all.
19652 \end_layout
19653
19654 \begin_layout Description
19655 \begin_inset Flex Code
19656 status collapsed
19657
19658 \begin_layout Plain Layout
19659 TransformOption
19660 \begin_inset space ~
19661 \end_inset
19662
19663 Clip
19664 \begin_inset space ~
19665 \end_inset
19666
19667 ClipLatexOption
19668 \end_layout
19669
19670 \end_inset
19671
19672  This command specifies that clipping is done via an optional argument.
19673  This command may occur once or not at all.
19674 \end_layout
19675
19676 \begin_layout Description
19677 \begin_inset Flex Code
19678 status collapsed
19679
19680 \begin_layout Plain Layout
19681 TransformOption
19682 \begin_inset space ~
19683 \end_inset
19684
19685 Extra
19686 \begin_inset space ~
19687 \end_inset
19688
19689 ExtraLatexOption
19690 \end_layout
19691
19692 \end_inset
19693
19694  This command specifies that an extra optional argument is used.
19695  This command may occur once or not at all.
19696 \end_layout
19697
19698 \begin_layout Description
19699 \begin_inset Flex Code
19700 status collapsed
19701
19702 \begin_layout Plain Layout
19703 UpdateFormat
19704 \begin_inset space ~
19705 \end_inset
19706
19707 <format>
19708 \end_layout
19709
19710 \end_inset
19711
19712  The file format of the converted file.
19713  This must be the name of a format that is known to LyX (see the 
19714 \begin_inset Flex MenuItem
19715 status collapsed
19716
19717 \begin_layout Plain Layout
19718
19719 \bar under
19720 T
19721 \bar default
19722 ools\SpecialChar \menuseparator
19723
19724 \bar under
19725 P
19726 \bar default
19727 references\SpecialChar \menuseparator
19728 File Handling\SpecialChar \menuseparator
19729 File Format
19730 \end_layout
19731
19732 \end_inset
19733
19734  dialog).
19735  This command must occur exactly once.
19736 \end_layout
19737
19738 \begin_layout Description
19739 \begin_inset Flex Code
19740 status collapsed
19741
19742 \begin_layout Plain Layout
19743 UpdateResult
19744 \begin_inset space ~
19745 \end_inset
19746
19747 <filename>
19748 \end_layout
19749
19750 \end_inset
19751
19752  The file name of the converted file.
19753  The file name must be absolute.
19754  This command must occur exactly once.
19755 \end_layout
19756
19757 \begin_layout Subsection
19758 Preamble definitions
19759 \end_layout
19760
19761 \begin_layout Standard
19762 The external template configuration file may contain additional preamble
19763  definitions enclosed by 
19764 \begin_inset Flex Code
19765 status collapsed
19766
19767 \begin_layout Plain Layout
19768 PreambleDef
19769 \end_layout
19770
19771 \end_inset
19772
19773  \SpecialChar \ldots{}
19774  
19775 \begin_inset Flex Code
19776 status collapsed
19777
19778 \begin_layout Plain Layout
19779 PreambleDefEnd
19780 \end_layout
19781
19782 \end_inset
19783
19784 .
19785  They can be used by the templates in the 
19786 \begin_inset Flex Code
19787 status collapsed
19788
19789 \begin_layout Plain Layout
19790 Format
19791 \end_layout
19792
19793 \end_inset
19794
19795  section.
19796 \end_layout
19797
19798 \begin_layout Section
19799 The substitution mechanism
19800 \end_layout
19801
19802 \begin_layout Standard
19803 When the external material facility invokes an external program, it is done
19804  on the basis of a command defined in the template configuration file.
19805  These commands can contain various macros that are expanded before execution.
19806  Execution always take place in the directory of the containing document.
19807 \end_layout
19808
19809 \begin_layout Standard
19810 Also, whenever external material is to be displayed, the name will be produced
19811  by the substitution mechanism, and most other commands in the template
19812  definition support substitution as well.
19813 \end_layout
19814
19815 \begin_layout Standard
19816 The available macros are the following:
19817 \end_layout
19818
19819 \begin_layout Description
19820 \begin_inset Flex Code
19821 status collapsed
19822
19823 \begin_layout Plain Layout
19824 $$AbsOrRelPathMaster
19825 \end_layout
19826
19827 \end_inset
19828
19829  The file path, absolute or relative to the master LyX document.
19830 \end_layout
19831
19832 \begin_layout Description
19833 \begin_inset Flex Code
19834 status collapsed
19835
19836 \begin_layout Plain Layout
19837 $$AbsOrRelPathParent
19838 \end_layout
19839
19840 \end_inset
19841
19842  The file path, absolute or relative to the LyX document.
19843 \end_layout
19844
19845 \begin_layout Description
19846 \begin_inset Flex Code
19847 status collapsed
19848
19849 \begin_layout Plain Layout
19850 $$AbsPath
19851 \end_layout
19852
19853 \end_inset
19854
19855  The absolute file path.
19856 \end_layout
19857
19858 \begin_layout Description
19859 \begin_inset Flex Code
19860 status collapsed
19861
19862 \begin_layout Plain Layout
19863 $$Basename
19864 \end_layout
19865
19866 \end_inset
19867
19868  The filename without path and without the extension.
19869 \end_layout
19870
19871 \begin_layout Description
19872 \begin_inset Flex Code
19873 status collapsed
19874
19875 \begin_layout Plain Layout
19876 $$Contents(
19877 \begin_inset Quotes eld
19878 \end_inset
19879
19880 filename.ext
19881 \begin_inset Quotes erd
19882 \end_inset
19883
19884 )
19885 \end_layout
19886
19887 \end_inset
19888
19889  This macro will expand to the contents of the file with the name 
19890 \begin_inset Flex Code
19891 status collapsed
19892
19893 \begin_layout Plain Layout
19894 filename.ext
19895 \end_layout
19896
19897 \end_inset
19898
19899 .
19900 \end_layout
19901
19902 \begin_layout Description
19903 \begin_inset Flex Code
19904 status collapsed
19905
19906 \begin_layout Plain Layout
19907 $$Extension
19908 \end_layout
19909
19910 \end_inset
19911
19912  The file extension (including the dot).
19913 \end_layout
19914
19915 \begin_layout Description
19916 \begin_inset Flex Code
19917 status collapsed
19918
19919 \begin_layout Plain Layout
19920 $$FName
19921 \end_layout
19922
19923 \end_inset
19924
19925  The filename of the file specified in the external material dialog.
19926  This is either an absolute name, or it is relative to the LyX document.
19927 \end_layout
19928
19929 \begin_layout Description
19930 \begin_inset Flex Code
19931 status collapsed
19932
19933 \begin_layout Plain Layout
19934 $$FPath
19935 \end_layout
19936
19937 \end_inset
19938
19939  The path part of 
19940 \begin_inset Flex Code
19941 status collapsed
19942
19943 \begin_layout Plain Layout
19944 $$FName
19945 \end_layout
19946
19947 \end_inset
19948
19949  (absolute name or relative to the LyX document).
19950 \end_layout
19951
19952 \begin_layout Description
19953 \begin_inset Flex Code
19954 status collapsed
19955
19956 \begin_layout Plain Layout
19957 $$RelPathMaster
19958 \end_layout
19959
19960 \end_inset
19961
19962  The file path, relative to the master LyX document.
19963 \end_layout
19964
19965 \begin_layout Description
19966 \begin_inset Flex Code
19967 status collapsed
19968
19969 \begin_layout Plain Layout
19970 $$RelPathParent
19971 \end_layout
19972
19973 \end_inset
19974
19975  The file path, relative to the LyX document.
19976 \end_layout
19977
19978 \begin_layout Description
19979 \begin_inset Flex Code
19980 status collapsed
19981
19982 \begin_layout Plain Layout
19983 $$Sysdir
19984 \end_layout
19985
19986 \end_inset
19987
19988  This macro will expand to the absolute path of the system directory.
19989  This is typically used to point to the various helper scripts that are
19990  bundled with LyX.
19991 \end_layout
19992
19993 \begin_layout Description
19994 \begin_inset Flex Code
19995 status collapsed
19996
19997 \begin_layout Plain Layout
19998 $$Tempname
19999 \end_layout
20000
20001 \end_inset
20002
20003  A name and full path to a temporary file which will be automatically deleted
20004  whenever the containing document is closed, or the external material insertion
20005  deleted.
20006 \end_layout
20007
20008 \begin_layout Standard
20009 All path macros contain a trailing directory separator, so you can construct
20010  e.
20011 \begin_inset space \thinspace{}
20012 \end_inset
20013
20014 g.
20015 \begin_inset space \space{}
20016 \end_inset
20017
20018 the absolute filename with 
20019 \begin_inset Flex Code
20020 status collapsed
20021
20022 \begin_layout Plain Layout
20023 $$AbsPath$$Basename$$Extension
20024 \end_layout
20025
20026 \end_inset
20027
20028 .
20029 \end_layout
20030
20031 \begin_layout Standard
20032 The macros above are substituted in all commands unless otherwise noted.
20033  The command 
20034 \begin_inset Flex Code
20035 status collapsed
20036
20037 \begin_layout Plain Layout
20038 Product
20039 \end_layout
20040
20041 \end_inset
20042
20043  supports additionally the following substitutions if they are enabled by
20044  the 
20045 \begin_inset Flex Code
20046 status collapsed
20047
20048 \begin_layout Plain Layout
20049 Transform
20050 \end_layout
20051
20052 \end_inset
20053
20054  and 
20055 \begin_inset Flex Code
20056 status collapsed
20057
20058 \begin_layout Plain Layout
20059 TransformCommand
20060 \end_layout
20061
20062 \end_inset
20063
20064  commands:
20065 \end_layout
20066
20067 \begin_layout Description
20068 \begin_inset Flex Code
20069 status collapsed
20070
20071 \begin_layout Plain Layout
20072 $$ResizeFront
20073 \end_layout
20074
20075 \end_inset
20076
20077  The front part of the resize command.
20078 \end_layout
20079
20080 \begin_layout Description
20081 \begin_inset Flex Code
20082 status collapsed
20083
20084 \begin_layout Plain Layout
20085 $$ResizeBack
20086 \end_layout
20087
20088 \end_inset
20089
20090  The back part of the resize command.
20091 \end_layout
20092
20093 \begin_layout Description
20094 \begin_inset Flex Code
20095 status collapsed
20096
20097 \begin_layout Plain Layout
20098 $$RotateFront
20099 \end_layout
20100
20101 \end_inset
20102
20103  The front part of the rotation command.
20104 \end_layout
20105
20106 \begin_layout Description
20107 \begin_inset Flex Code
20108 status collapsed
20109
20110 \begin_layout Plain Layout
20111 $$RotateBack
20112 \end_layout
20113
20114 \end_inset
20115
20116  The back part of the rotation command.
20117 \end_layout
20118
20119 \begin_layout Standard
20120 The value string of the 
20121 \begin_inset Flex Code
20122 status collapsed
20123
20124 \begin_layout Plain Layout
20125 Option
20126 \end_layout
20127
20128 \end_inset
20129
20130  command supports additionally the following substitutions if they are enabled
20131  by the 
20132 \begin_inset Flex Code
20133 status collapsed
20134
20135 \begin_layout Plain Layout
20136 Transform
20137 \end_layout
20138
20139 \end_inset
20140
20141  and 
20142 \begin_inset Flex Code
20143 status collapsed
20144
20145 \begin_layout Plain Layout
20146 TransformOption
20147 \end_layout
20148
20149 \end_inset
20150
20151  commands:
20152 \end_layout
20153
20154 \begin_layout Description
20155 \begin_inset Flex Code
20156 status collapsed
20157
20158 \begin_layout Plain Layout
20159 $$Clip
20160 \end_layout
20161
20162 \end_inset
20163
20164  The clip option.
20165 \end_layout
20166
20167 \begin_layout Description
20168 \begin_inset Flex Code
20169 status collapsed
20170
20171 \begin_layout Plain Layout
20172 $$Extra
20173 \end_layout
20174
20175 \end_inset
20176
20177  The extra option.
20178 \end_layout
20179
20180 \begin_layout Description
20181 \begin_inset Flex Code
20182 status collapsed
20183
20184 \begin_layout Plain Layout
20185 $$Resize
20186 \end_layout
20187
20188 \end_inset
20189
20190  The resize option.
20191 \end_layout
20192
20193 \begin_layout Description
20194 \begin_inset Flex Code
20195 status collapsed
20196
20197 \begin_layout Plain Layout
20198 $$Rotate
20199 \end_layout
20200
20201 \end_inset
20202
20203  The rotation option.
20204 \end_layout
20205
20206 \begin_layout Standard
20207 You may ask why there are so many path macros.
20208  There are mainly two reasons:
20209 \end_layout
20210
20211 \begin_layout Enumerate
20212 Relative and absolute file names should remain relative or absolute, respectivel
20213 y.
20214  Users may have reasons to prefer either form.
20215  Relative names are useful for portable documents that should work on different
20216  machines, for example.
20217  Absolute names may be required by some programs.
20218 \end_layout
20219
20220 \begin_layout Enumerate
20221 LaTeX treats relative file names differently than LyX and other programs
20222  in nested included files.
20223  For LyX, a relative file name is always relative to the document that contains
20224  the file name.
20225  For LaTeX, it is always relative to the master document.
20226  These two definitions are identical if you have only one document, but
20227  differ if you have a master document that includes part documents.
20228  That means that relative filenames must be transformed when presented to
20229  LaTeX.
20230  Fortunately LyX does this automatically for you if you choose the right
20231  macros.
20232 \end_layout
20233
20234 \begin_layout Standard
20235 So which path macro should be used in new template definitions? The rule
20236  is not difficult:
20237 \end_layout
20238
20239 \begin_layout Itemize
20240 Use 
20241 \begin_inset Flex Code
20242 status collapsed
20243
20244 \begin_layout Plain Layout
20245 $$AbsPath
20246 \end_layout
20247
20248 \end_inset
20249
20250  if an absolute path is required.
20251 \end_layout
20252
20253 \begin_layout Itemize
20254 Use 
20255 \begin_inset Flex Code
20256 status collapsed
20257
20258 \begin_layout Plain Layout
20259 $$AbsOrRelPathMaster
20260 \end_layout
20261
20262 \end_inset
20263
20264  if the substituted string is some kind of LaTeX input.
20265 \end_layout
20266
20267 \begin_layout Itemize
20268 Else use 
20269 \begin_inset Flex Code
20270 status collapsed
20271
20272 \begin_layout Plain Layout
20273 $$AbsOrRelPathParent
20274 \end_layout
20275
20276 \end_inset
20277
20278  in order to preserve the user's choice.
20279 \end_layout
20280
20281 \begin_layout Standard
20282 There are special cases where this rule does not work and e.
20283 \begin_inset space \thinspace{}
20284 \end_inset
20285
20286 g.
20287 \begin_inset space \space{}
20288 \end_inset
20289
20290 relative names are needed, but normally it will work just fine.
20291  One example for such a case is the command 
20292 \begin_inset Flex Code
20293 status collapsed
20294
20295 \begin_layout Plain Layout
20296 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20297 \end_layout
20298
20299 \end_inset
20300
20301  in the XFig template above: We can't use the absolute name because the
20302  copier for 
20303 \begin_inset Flex Code
20304 status collapsed
20305
20306 \begin_layout Plain Layout
20307 .pstex_t
20308 \end_layout
20309
20310 \end_inset
20311
20312  files needs the relative name in order to rewrite the file content.
20313 \end_layout
20314
20315 \begin_layout Section
20316 Security discussion
20317 \begin_inset CommandInset label
20318 LatexCommand label
20319 name "sec:Security-discussion"
20320
20321 \end_inset
20322
20323
20324 \end_layout
20325
20326 \begin_layout Standard
20327 The external material feature interfaces with a lot of external programs
20328  and does so automatically, so we have to consider the security implications
20329  of this.
20330  In particular, since you have the option of including your own filenames
20331  and/or parameter strings and those are expanded into a command, it seems
20332  that it would be possible to create a malicious document which executes
20333  arbitrary commands when a user views or prints the document.
20334  This is something we definitely want to avoid.
20335 \end_layout
20336
20337 \begin_layout Standard
20338 However, since the external program commands are specified in the template
20339  configuration file only, there are no security issues if LyX is properly
20340  configured with safe templates only.
20341  This is so because the external programs are invoked with the 
20342 \begin_inset Flex Code
20343 status collapsed
20344
20345 \begin_layout Plain Layout
20346 execvp
20347 \end_layout
20348
20349 \end_inset
20350
20351 -system call rather than the 
20352 \begin_inset Flex Code
20353 status collapsed
20354
20355 \begin_layout Plain Layout
20356 system
20357 \end_layout
20358
20359 \end_inset
20360
20361  system-call, so it's not possible to execute arbitrary commands from the
20362  filename or parameter section via the shell.
20363 \end_layout
20364
20365 \begin_layout Standard
20366 This also implies that you are restricted in what command strings you can
20367  use in the external material templates.
20368  In particular, pipes and redirection are not readily available.
20369  This has to be so if LyX should remain safe.
20370  If you want to use some of the shell features, you should write a safe
20371  script to do this in a controlled manner, and then invoke the script from
20372  the command string.
20373  
20374 \end_layout
20375
20376 \begin_layout Standard
20377 It is possible to design a template that interacts directly with the shell,
20378  but since this would allow a malicious user to execute arbitrary commands
20379  by writing clever filenames and/or parameters, we generally recommend that
20380  you only use safe scripts that work with the 
20381 \begin_inset Flex Code
20382 status collapsed
20383
20384 \begin_layout Plain Layout
20385 execvp
20386 \end_layout
20387
20388 \end_inset
20389
20390  system call in a controlled manner.
20391  Of course, for use in a controlled environment, it can be tempting to just
20392  fall back to use ordinary shell scripts.
20393  If you do so, be aware that you 
20394 \emph on
20395 will
20396 \emph default
20397  provide an easily exploitable security hole in your system.
20398  Of course it stands to reason that such unsafe templates will never be
20399  included in the standard LyX distribution, although we do encourage people
20400  to submit new templates in the open source tradition.
20401  But LyX as shipped from the official distribution channels will never have
20402  unsafe templates.
20403 \end_layout
20404
20405 \begin_layout Standard
20406 Including external material provides a lot of power, and you have to be
20407  careful not to introduce security hazards with this power.
20408  A subtle error in a single line in an innocent looking script can open
20409  the door to huge security problems.
20410  So if you do not fully understand the issues, we recommend that you consult
20411  a knowledgeable security professional or the LyX development team if you
20412  have any questions about whether a given template is safe or not.
20413  And do this before you use it in an uncontrolled environment.
20414 \end_layout
20415
20416 \end_body
20417 \end_document