]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
df54e285a30f898fe22729ccaf491934120d89fb
[lyx.git] / lib / doc / Customization.lyx
1 #LyX 1.6.0rc5 created this file. For more info see http://www.lyx.org/
2 \lyxformat 344
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 the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected.  If you
12 % have problems LaTeXing this file, please contact 
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
15
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
18
19  % set fonts for nicer pdf view
20  \IfFileExists{lmodern.sty}
21   {\usepackage{lmodern}}{}
22
23 \fi % end if pdflatex is used
24
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
29   \frontmatter
30   \pdfbookmark[1]{\contentsname}{}
31   \myTOC
32   \mainmatter }
33
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36   L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
37   {LyX }}
38
39 % used for multi-column text
40 \usepackage{multicol}
41 \usepackage{inputenc}
42 \end_preamble
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
45 \begin_modules
46 logicalmkup
47 \end_modules
48 \begin_local_layout
49 Format 7
50 InsetLayout CharStyle:MenuItem
51 LyxType               charstyle
52 LabelString           menu
53 LatexType             command
54 LatexName             menuitem
55 Font
56 Family              Sans
57 EndFont
58 Preamble
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
60 EndPreamble
61 End
62 \end_local_layout
63 \language english
64 \inputencoding auto
65 \font_roman default
66 \font_sans default
67 \font_typewriter default
68 \font_default_family default
69 \font_sc false
70 \font_osf false
71 \font_sf_scale 100
72 \font_tt_scale 100
73
74 \graphics default
75 \paperfontsize 12
76 \spacing single
77 \use_hyperref true
78 \pdf_title "LyX Configuration Manual"
79 \pdf_author "LyX Team"
80 \pdf_subject "LyX-documentation Customization"
81 \pdf_keywords "LyX, documentation, customization"
82 \pdf_bookmarks true
83 \pdf_bookmarksnumbered true
84 \pdf_bookmarksopen true
85 \pdf_bookmarksopenlevel 1
86 \pdf_breaklinks false
87 \pdf_pdfborder false
88 \pdf_colorlinks true
89 \pdf_backref false
90 \pdf_pdfusetitle false
91 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
92 \papersize default
93 \use_geometry false
94 \use_amsmath 0
95 \use_esint 0
96 \cite_engine basic
97 \use_bibtopic false
98 \paperorientation portrait
99 \branch OutDated
100 \selected 0
101 \color #f5fae7
102 \end_branch
103 \secnumdepth 3
104 \tocdepth 3
105 \paragraph_separation indent
106 \defskip medskip
107 \quotes_language english
108 \papercolumns 1
109 \papersides 2
110 \paperpagestyle headings
111 \tracking_changes false
112 \output_changes false
113 \author "" 
114 \author "" 
115 \end_header
116
117 \begin_body
118
119 \begin_layout Title
120 Customizing LyX: Features for the Advanced User
121 \end_layout
122
123 \begin_layout Author
124 by the LyX Team
125 \begin_inset Foot
126 status open
127
128 \begin_layout Plain Layout
129 \noindent
130 If you have comments or error corrections, please send them to the LyX Documenta
131 tion mailing list, 
132 \begin_inset CommandInset href
133 LatexCommand href
134 target "lyx-docs@lists.lyx.org"
135 type "mailto:"
136
137 \end_inset
138
139 .
140  Include 
141 \begin_inset Quotes eld
142 \end_inset
143
144 [Customization]
145 \begin_inset Quotes erd
146 \end_inset
147
148  in the subject header, and please cc the current maintainer of this file,
149  Richard Heck <rgheck@comcast.net>.
150 \end_layout
151
152 \end_inset
153
154  
155 \end_layout
156
157 \begin_layout Standard
158 \begin_inset CommandInset toc
159 LatexCommand tableofcontents
160
161 \end_inset
162
163
164 \end_layout
165
166 \begin_layout Chapter
167 Introduction
168 \end_layout
169
170 \begin_layout Standard
171 This manual covers the customization features present in LyX.
172  In it, we discuss issues like keyboard shortcuts, screen previewing options,
173  printer options, sending commands to LyX via the LyX Server, internationalizati
174 on, installing new LaTeX classes and LyX layouts, etc.
175  We can't possibly hope to touch on everything you can change---our developers
176  add new features faster than we can document them---but we will explain
177  the most common customizations and hopefully point you in the right direction
178  for some of the more obscure ones.
179 \end_layout
180
181 \begin_layout Standard
182 \begin_inset Branch OutDated
183 status collapsed
184
185 \begin_layout Standard
186 Information from previous versions of this document that now seems to be
187  outdated is contained in the OutDated branch of this document.
188  By default, this information will not appear in the LaTeX output.
189 \end_layout
190
191 \end_inset
192
193
194 \end_layout
195
196 \begin_layout Chapter
197 LyX configuration files
198 \end_layout
199
200 \begin_layout Standard
201 This chapter aims to help you to find your way through the LyX configuration
202  files.
203  Before continuing to read this chapter, you should find out where your
204  LyX library and user directories are by using 
205 \begin_inset Flex CharStyle:MenuItem
206 status collapsed
207
208 \begin_layout Plain Layout
209
210 \bar under
211 H
212 \bar default
213 elp\SpecialChar \menuseparator
214 About
215 \begin_inset space ~
216 \end_inset
217
218 Ly
219 \bar under
220 X
221 \end_layout
222
223 \end_inset
224
225 .
226  The library directory is the place where LyX places its system-wide configurati
227 on files; the user directory is where you can place your modified versions.
228  We will call the former 
229 \begin_inset Flex CharStyle:Code
230 status collapsed
231
232 \begin_layout Plain Layout
233 LyXDir
234 \end_layout
235
236 \end_inset
237
238  and the latter 
239 \begin_inset Flex CharStyle:MenuItem
240 status collapsed
241
242 \begin_layout Plain Layout
243 UserDir
244 \end_layout
245
246 \end_inset
247
248  in the remainder of this document.
249  
250 \end_layout
251
252 \begin_layout Section
253 What's in 
254 \begin_inset Flex CharStyle:Code
255 status collapsed
256
257 \begin_layout Plain Layout
258 LyXDir
259 \end_layout
260
261 \end_inset
262
263 ?
264 \end_layout
265
266 \begin_layout Standard
267 \begin_inset Flex CharStyle:Code
268 status collapsed
269
270 \begin_layout Plain Layout
271 LyXDir
272 \end_layout
273
274 \end_inset
275
276  and its sub-directories contain a number of files and that can be used
277  to customise LyX's behaviour.
278  You can change many of these files from within LyX itself through the 
279 \begin_inset Flex CharStyle:MenuItem
280 status collapsed
281
282 \begin_layout Plain Layout
283 Tools\SpecialChar \menuseparator
284 Preferences
285 \end_layout
286
287 \end_inset
288
289  dialog.
290  Most customization that you will want to do in LyX is possible through
291  this dialog.
292  However, many other inner aspects of LyX can be customized by modifying
293  the files in 
294 \begin_inset Flex CharStyle:Code
295 status collapsed
296
297 \begin_layout Plain Layout
298 LyXDir
299 \end_layout
300
301 \end_inset
302
303 .
304  These files fall in different categories, described in the following subsection
305 s.
306 \end_layout
307
308 \begin_layout Subsection
309 Automatically generated files
310 \end_layout
311
312 \begin_layout Standard
313 The files, which are to be found in 
314 \begin_inset Flex CharStyle:MenuItem
315 status collapsed
316
317 \begin_layout Plain Layout
318 UserDir
319 \end_layout
320
321 \end_inset
322
323 , are generated when you configure LyX.
324  They contain various default values that are guessed by inspection.
325  In general, it is not a good idea to modify them, since they might be overwritt
326 en at any time.
327 \end_layout
328
329 \begin_layout Labeling
330 \labelwidthstring 00.00.0000
331 \begin_inset Flex CharStyle:Code
332 status collapsed
333
334 \begin_layout Plain Layout
335 lyxrc.defaults
336 \end_layout
337
338 \end_inset
339
340  contains defaults for various commands.
341 \end_layout
342
343 \begin_layout Labeling
344 \labelwidthstring 00.00.0000
345 \begin_inset Flex CharStyle:Code
346 status collapsed
347
348 \begin_layout Plain Layout
349 packages.lst
350 \end_layout
351
352 \end_inset
353
354  contains the list of packages that have been recognized by LyX.
355  It is currently unused by the LyX program itself, but the information extracted
356 , and more, is made available with 
357 \begin_inset Flex CharStyle:MenuItem
358 status collapsed
359
360 \begin_layout Plain Layout
361
362 \bar under
363 H
364 \bar default
365 elp\SpecialChar \menuseparator
366 L
367 \bar under
368 a
369 \bar default
370 TeX
371 \begin_inset space ~
372 \end_inset
373
374 Configuration
375 \end_layout
376
377 \end_inset
378
379 .
380 \end_layout
381
382 \begin_layout Labeling
383 \labelwidthstring 00.00.0000
384 \begin_inset Flex CharStyle:Code
385 status collapsed
386
387 \begin_layout Plain Layout
388 textclass.lst
389 \end_layout
390
391 \end_inset
392
393  the list of text classes that have been found in your 
394 \begin_inset Flex CharStyle:Code
395 status collapsed
396
397 \begin_layout Plain Layout
398 layout/
399 \end_layout
400
401 \end_inset
402
403  directories, along with the associated LaTeX document class and their descripti
404 on.
405 \end_layout
406
407 \begin_layout Labeling
408 \labelwidthstring 00.00.0000
409 \begin_inset Flex CharStyle:Code
410 status collapsed
411
412 \begin_layout Plain Layout
413 lyxmodules.lst
414 \end_layout
415
416 \end_inset
417
418  the list of layout modules found in your 
419 \begin_inset Flex CharStyle:Code
420 status collapsed
421
422 \begin_layout Plain Layout
423 layout/
424 \end_layout
425
426 \end_inset
427
428  directories
429 \end_layout
430
431 \begin_layout Labeling
432 \labelwidthstring 00.00.0000
433 \begin_inset Flex CharStyle:Code
434 status collapsed
435
436 \begin_layout Plain Layout
437 *files.lst
438 \end_layout
439
440 \end_inset
441
442  lists of various sorts of LaTeX-related files found on your system
443 \end_layout
444
445 \begin_layout Labeling
446 \labelwidthstring 00.00.0000
447 \begin_inset Flex CharStyle:Code
448 status collapsed
449
450 \begin_layout Plain Layout
451 doc/LaTeXConfig.lyx
452 \end_layout
453
454 \end_inset
455
456  is automatically generated during configuration from the file 
457 \begin_inset Flex CharStyle:Code
458 status collapsed
459
460 \begin_layout Plain Layout
461 LaTeXConfig.lyx.in
462 \end_layout
463
464 \end_inset
465
466 .
467  It contains information on your LaTeX configuration.
468 \end_layout
469
470 \begin_layout Subsection
471 Directories
472 \end_layout
473
474 \begin_layout Standard
475 These directories are duplicated between 
476 \begin_inset Flex CharStyle:Code
477 status collapsed
478
479 \begin_layout Plain Layout
480 LyXDir
481 \end_layout
482
483 \end_inset
484
485  and 
486 \begin_inset Flex CharStyle:Code
487 status collapsed
488
489 \begin_layout Plain Layout
490 UserDir
491 \end_layout
492
493 \end_inset
494
495 .
496  If a particular files exists in both places, the one in 
497 \begin_inset Flex CharStyle:Code
498 status collapsed
499
500 \begin_layout Plain Layout
501 UserDir
502 \end_layout
503
504 \end_inset
505
506  will be used.
507 \end_layout
508
509 \begin_layout Labeling
510 \labelwidthstring 00.00.0000
511 \begin_inset Flex CharStyle:Code
512 status collapsed
513
514 \begin_layout Plain Layout
515 bind/
516 \end_layout
517
518 \end_inset
519
520  this directory contains files with the extension 
521 \begin_inset Flex CharStyle:Code
522 status collapsed
523
524 \begin_layout Plain Layout
525 .bind
526 \end_layout
527
528 \end_inset
529
530  that define the keybindings used in LyX.
531  If there exists an internationalized version of the bind file named 
532 \begin_inset Flex CharStyle:Code
533 status collapsed
534
535 \begin_layout Plain Layout
536 $LANG_xxx.bind
537 \end_layout
538
539 \end_inset
540
541 , that will be used first.
542 \end_layout
543
544 \begin_layout Labeling
545 \labelwidthstring 00.00.0000
546 \begin_inset Flex CharStyle:Code
547 status collapsed
548
549 \begin_layout Plain Layout
550 clipart/
551 \end_layout
552
553 \end_inset
554
555  contains graphics files that can be included in documents.
556  
557 \end_layout
558
559 \begin_layout Labeling
560 \labelwidthstring 00.00.0000
561 \begin_inset Flex CharStyle:Code
562 status collapsed
563
564 \begin_layout Plain Layout
565 doc/
566 \end_layout
567
568 \end_inset
569
570  contains LyX documentation files (including the one you are currently reading).
571  The file 
572 \begin_inset Flex CharStyle:Code
573 status collapsed
574
575 \begin_layout Plain Layout
576 LaTeXConfig.lyx
577 \end_layout
578
579 \end_inset
580
581  deserves special attention, as noted above.
582  If there exists an internationalized version of the help-document with
583  
584 \begin_inset Flex CharStyle:Code
585 status collapsed
586
587 \begin_layout Plain Layout
588 $LANG_
589 \end_layout
590
591 \end_inset
592
593  prepended to the name, that will be used first.
594  See Chapter
595 \begin_inset space ~
596 \end_inset
597
598
599 \begin_inset CommandInset ref
600 LatexCommand ref
601 reference "chap:i18n"
602
603 \end_inset
604
605  for details.
606 \end_layout
607
608 \begin_layout Labeling
609 \labelwidthstring 00.00.0000
610 \begin_inset Flex CharStyle:Code
611 status collapsed
612
613 \begin_layout Plain Layout
614 examples/
615 \end_layout
616
617 \end_inset
618
619  contains example files that explain how to use some features.
620  In the file browser, press the 
621 \begin_inset Flex CharStyle:MenuItem
622 status collapsed
623
624 \begin_layout Plain Layout
625 Examples
626 \end_layout
627
628 \end_inset
629
630  button to get there.
631 \end_layout
632
633 \begin_layout Labeling
634 \labelwidthstring 00.00.0000
635 \begin_inset Flex CharStyle:Code
636 status collapsed
637
638 \begin_layout Plain Layout
639 images/
640 \end_layout
641
642 \end_inset
643
644  contains image files that are used by the 
645 \begin_inset Flex CharStyle:MenuItem
646 status collapsed
647
648 \begin_layout Plain Layout
649 Document
650 \end_layout
651
652 \end_inset
653
654  dialog.
655  In addition, it also contains the individual icons used in the toolbar
656  and the banners that can be shown when LyX is launched.
657 \end_layout
658
659 \begin_layout Labeling
660 \labelwidthstring 00.00.0000
661 \begin_inset Flex CharStyle:Code
662 status collapsed
663
664 \begin_layout Plain Layout
665 kbd/
666 \end_layout
667
668 \end_inset
669
670  contains keyboard keymapping files.
671  See Chapter
672 \begin_inset space ~
673 \end_inset
674
675
676 \begin_inset CommandInset ref
677 LatexCommand ref
678 reference "sec:keymap"
679
680 \end_inset
681
682  for details.
683 \end_layout
684
685 \begin_layout Labeling
686 \labelwidthstring 00.00.0000
687 \begin_inset Flex CharStyle:Code
688 status collapsed
689
690 \begin_layout Plain Layout
691 layouts/
692 \end_layout
693
694 \end_inset
695
696  contains the text class and module files described in Chapter
697 \begin_inset space ~
698 \end_inset
699
700
701 \begin_inset CommandInset ref
702 LatexCommand ref
703 reference "chap:textclass"
704
705 \end_inset
706
707 .
708 \end_layout
709
710 \begin_layout Labeling
711 \labelwidthstring 00.00.0000
712 \begin_inset Flex CharStyle:Code
713 status collapsed
714
715 \begin_layout Plain Layout
716 lyx2lyx
717 \end_layout
718
719 \end_inset
720
721  contains the 
722 \begin_inset Flex CharStyle:Code
723 status collapsed
724
725 \begin_layout Plain Layout
726 lyx2lyx
727 \end_layout
728
729 \end_inset
730
731  Python scripts used to convert between LyX versions.
732  These can be run from the command line if, say, you want to batch-convert
733  files.
734 \end_layout
735
736 \begin_layout Labeling
737 \labelwidthstring 00.00.0000
738 \begin_inset Flex CharStyle:Code
739 status collapsed
740
741 \begin_layout Plain Layout
742 scripts/
743 \end_layout
744
745 \end_inset
746
747  contains some files that demonstrate the capabilities of the 
748 \begin_inset Flex CharStyle:MenuItem
749 status collapsed
750
751 \begin_layout Plain Layout
752 External
753 \begin_inset space ~
754 \end_inset
755
756 Template
757 \end_layout
758
759 \end_inset
760
761  feature.
762  Also contains some scripts used by LyX itself.
763 \end_layout
764
765 \begin_layout Labeling
766 \labelwidthstring 00.00.0000
767 \begin_inset Flex CharStyle:Code
768 status collapsed
769
770 \begin_layout Plain Layout
771 templates/
772 \end_layout
773
774 \end_inset
775
776  contains the standard LyX template files described in Chapter
777 \begin_inset space ~
778 \end_inset
779
780
781 \begin_inset CommandInset ref
782 LatexCommand ref
783 reference "sec:templates"
784
785 \end_inset
786
787 .
788 \end_layout
789
790 \begin_layout Labeling
791 \labelwidthstring 00.00.0000
792 \begin_inset Flex CharStyle:Code
793 status collapsed
794
795 \begin_layout Plain Layout
796 ui/
797 \end_layout
798
799 \end_inset
800
801  contains files with the extension 
802 \begin_inset Flex CharStyle:Code
803 status collapsed
804
805 \begin_layout Plain Layout
806 .ui
807 \end_layout
808
809 \end_inset
810
811  that define the user interface to LyX.
812  That is, the files define which items appear in which menus and the items
813  appearing on the toolbar.
814 \end_layout
815
816 \begin_layout Subsection
817 Files you don't want to modify
818 \end_layout
819
820 \begin_layout Standard
821 These files are used internally by LyX and you generally do not need to
822  modify them unless you are a developer.
823 \end_layout
824
825 \begin_layout Labeling
826 \labelwidthstring 00.00.0000
827 \begin_inset Flex CharStyle:Code
828 status collapsed
829
830 \begin_layout Plain Layout
831 CREDITS
832 \end_layout
833
834 \end_inset
835
836  this file contains the list of LyX developers.
837  The contents are displayed with the menu entry 
838 \begin_inset Flex CharStyle:MenuItem
839 status collapsed
840
841 \begin_layout Plain Layout
842
843 \bar under
844 H
845 \bar default
846 elp\SpecialChar \menuseparator
847 About
848 \begin_inset space ~
849 \end_inset
850
851 LyX
852 \end_layout
853
854 \end_inset
855
856 .
857 \end_layout
858
859 \begin_layout Labeling
860 \labelwidthstring 00.00.0000
861 \begin_inset Flex CharStyle:Code
862 status collapsed
863
864 \begin_layout Plain Layout
865 chkconfig.ltx
866 \end_layout
867
868 \end_inset
869
870  this is a LaTeX script used during the configuration process.
871  Do not run directly.
872 \end_layout
873
874 \begin_layout Labeling
875 \labelwidthstring 00.00.0000
876 \begin_inset Flex CharStyle:Code
877 status collapsed
878
879 \begin_layout Plain Layout
880 configure.py
881 \end_layout
882
883 \end_inset
884
885  this is the script that is used to re-configure LyX.
886  It creates configuration files in the directory it was run from.
887 \end_layout
888
889 \begin_layout Subsection
890 Other files needing a line or two...
891 \end_layout
892
893 \begin_layout Labeling
894 \labelwidthstring 00.00.0000
895 \begin_inset Flex CharStyle:Code
896 status collapsed
897
898 \begin_layout Plain Layout
899 encodings
900 \end_layout
901
902 \end_inset
903
904  this contains tables describing how different character encodings can be
905  mapped to unicode
906 \end_layout
907
908 \begin_layout Labeling
909 \labelwidthstring 00.00.0000
910 \begin_inset Flex CharStyle:Code
911 status collapsed
912
913 \begin_layout Plain Layout
914 external_templates
915 \end_layout
916
917 \end_inset
918
919  this file contains the templates available to the new 
920 \begin_inset Flex CharStyle:MenuItem
921 status collapsed
922
923 \begin_layout Plain Layout
924 External
925 \begin_inset space ~
926 \end_inset
927
928 Template
929 \end_layout
930
931 \end_inset
932
933  feature.
934 \end_layout
935
936 \begin_layout Labeling
937 \labelwidthstring 00.00.0000
938 \begin_inset Flex CharStyle:Code
939 status collapsed
940
941 \begin_layout Plain Layout
942 languages
943 \end_layout
944
945 \end_inset
946
947  this file contains a list of all the languages currently supported by LyX.
948 \end_layout
949
950 \begin_layout Section
951 Your local configuration directory
952 \end_layout
953
954 \begin_layout Standard
955 Even if you are using LyX as an unprivileged user, you might want to change
956  LyX configuration for your own use.
957  The 
958 \begin_inset Flex CharStyle:Code
959 status collapsed
960
961 \begin_layout Plain Layout
962 UserDir
963 \end_layout
964
965 \end_inset
966
967  directory contains all your personal configuration files.
968  This is the directory described as 
969 \begin_inset Quotes eld
970 \end_inset
971
972 user directory
973 \begin_inset Quotes erd
974 \end_inset
975
976  in 
977 \begin_inset Flex CharStyle:MenuItem
978 status collapsed
979
980 \begin_layout Plain Layout
981
982 \bar under
983 H
984 \bar default
985 elp\SpecialChar \menuseparator
986 About
987 \begin_inset space ~
988 \end_inset
989
990 LyX
991 \end_layout
992
993 \end_inset
994
995 .
996  This directory is used as a mirror of 
997 \begin_inset Flex CharStyle:Code
998 status collapsed
999
1000 \begin_layout Plain Layout
1001 LyXDir
1002 \end_layout
1003
1004 \end_inset
1005
1006 , which means that every file in 
1007 \begin_inset Flex CharStyle:Code
1008 status collapsed
1009
1010 \begin_layout Plain Layout
1011 UserDir
1012 \end_layout
1013
1014 \end_inset
1015
1016  is a replacement for the corresponding file in 
1017 \begin_inset Flex CharStyle:Code
1018 status collapsed
1019
1020 \begin_layout Plain Layout
1021 LyXDir
1022 \end_layout
1023
1024 \end_inset
1025
1026 .
1027  Any configuration file described in the above sections can be placed either
1028  in the system-wide directory, in which case it will affect all users, or
1029  in your local directory for your own use.
1030 \end_layout
1031
1032 \begin_layout Standard
1033 To make things clearer, let's provide a few examples:
1034 \end_layout
1035
1036 \begin_layout Itemize
1037 The preferences set in the 
1038 \begin_inset Flex CharStyle:MenuItem
1039 status collapsed
1040
1041 \begin_layout Plain Layout
1042
1043 \bar under
1044 T
1045 \bar default
1046 ools\SpecialChar \menuseparator
1047
1048 \bar under
1049 P
1050 \bar default
1051 references
1052 \end_layout
1053
1054 \end_inset
1055
1056  dialog are saved to a file 
1057 \begin_inset Flex CharStyle:Code
1058 status collapsed
1059
1060 \begin_layout Plain Layout
1061 preferences
1062 \end_layout
1063
1064 \end_inset
1065
1066  in 
1067 \begin_inset Flex CharStyle:Code
1068 status collapsed
1069
1070 \begin_layout Plain Layout
1071 UserDir
1072 \end_layout
1073
1074 \end_inset
1075
1076 .
1077 \end_layout
1078
1079 \begin_layout Itemize
1080 When you reconfigure using 
1081 \begin_inset Flex CharStyle:MenuItem
1082 status collapsed
1083
1084 \begin_layout Plain Layout
1085
1086 \bar under
1087 T
1088 \bar default
1089 ools\SpecialChar \menuseparator
1090
1091 \bar under
1092 R
1093 \bar default
1094 econfigure
1095 \end_layout
1096
1097 \end_inset
1098
1099 , LyX runs the 
1100 \begin_inset Flex CharStyle:Code
1101 status collapsed
1102
1103 \begin_layout Plain Layout
1104 configure.py
1105 \end_layout
1106
1107 \end_inset
1108
1109  script, and the resulting files are written in your local configuration
1110  directory.
1111  This means that any additional text class file that you might have added
1112  in 
1113 \begin_inset Flex CharStyle:Code
1114 status collapsed
1115
1116 \begin_layout Plain Layout
1117 UserDir/layouts
1118 \end_layout
1119
1120 \end_inset
1121
1122  will be added to the list of classes in the 
1123 \begin_inset Flex CharStyle:MenuItem
1124 status collapsed
1125
1126 \begin_layout Plain Layout
1127 Document\SpecialChar \menuseparator
1128 Settings
1129 \end_layout
1130
1131 \end_inset
1132
1133  dialog.
1134 \end_layout
1135
1136 \begin_layout Itemize
1137 If you get some updated documentation from LyX ftp site and cannot install
1138  it because you do not have sysadmin rights on your system, you can just
1139  copy the files in 
1140 \begin_inset Flex CharStyle:Code
1141 status collapsed
1142
1143 \begin_layout Plain Layout
1144 UserDir/doc/
1145 \end_layout
1146
1147 \end_inset
1148
1149  and the items in the 
1150 \begin_inset Flex CharStyle:MenuItem
1151 status collapsed
1152
1153 \begin_layout Plain Layout
1154
1155 \bar under
1156 H
1157 \bar default
1158 elp
1159 \end_layout
1160
1161 \end_inset
1162
1163  menu will open them!
1164 \end_layout
1165
1166 \begin_layout Section
1167 Running LyX with multiple configurations
1168 \end_layout
1169
1170 \begin_layout Standard
1171 The configuration freedom of the local configuration directory may not suffice
1172  if you want to have more than one configuration at your disposal.
1173  For example, you may want to be use different key bindings or printer settings
1174  at different times.
1175  You can achieve this by having several such directories.
1176  You then specify which directory to use at run-time.
1177 \end_layout
1178
1179 \begin_layout Standard
1180 Invoking LyX with the command line switch 
1181 \begin_inset Flex CharStyle:Code
1182 status collapsed
1183
1184 \begin_layout Plain Layout
1185 -userdir
1186 \end_layout
1187
1188 \end_inset
1189
1190  
1191 \emph on
1192 <some directory>
1193 \emph default
1194  instructs the program to read the configuration from that directory, and
1195  not from the default directory.
1196  (You can determine the default directory by running LyX without the 
1197 \begin_inset Flex CharStyle:Code
1198 status collapsed
1199
1200 \begin_layout Plain Layout
1201 -userdir
1202 \end_layout
1203
1204 \end_inset
1205
1206  switch.) If the specified directory does not exist, LyX offers to create
1207  it for you, just like it does for the default directory on the first time
1208  you run the program.
1209  You can modify the configuration options in this additional user directory
1210  exactly as you would for the default directory.
1211  These directories are completely independent (but read on).
1212  Note that setting the environment variable 
1213 \begin_inset Flex CharStyle:Code
1214 status collapsed
1215
1216 \begin_layout Plain Layout
1217 LYX_USERDIR_VER
1218 \end_layout
1219
1220 \end_inset
1221
1222  to some value has exactly the same effect.
1223 \end_layout
1224
1225 \begin_layout Standard
1226 Having several configurations also requires more maintenance: if you want
1227  to add a new layout to 
1228 \begin_inset Flex CharStyle:Code
1229 status collapsed
1230
1231 \begin_layout Plain Layout
1232 NewUserDir/layouts
1233 \end_layout
1234
1235 \end_inset
1236
1237  which you want available from all your configurations, you must add it
1238  to each directory separately.
1239  You can avoid this with the following trick: after LyX creates the additional
1240  directory, most of the subdirectories (see above) are empty.
1241  If you want the new configuration to mirror an existing one, replace the
1242  empty subdirectory with a symbolic link to the matching subdirectory in
1243  the existing configuration.
1244  Take care with the 
1245 \begin_inset Flex CharStyle:Code
1246 status collapsed
1247
1248 \begin_layout Plain Layout
1249 doc/
1250 \end_layout
1251
1252 \end_inset
1253
1254  subirectory, however, since it contains a file written by the configuration
1255  script (also accessible through 
1256 \begin_inset Flex CharStyle:MenuItem
1257 status collapsed
1258
1259 \begin_layout Plain Layout
1260
1261 \bar under
1262 T
1263 \bar default
1264 ools\SpecialChar \menuseparator
1265
1266 \bar under
1267 R
1268 \bar default
1269 econfigure
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 Using the dialog for the first time
1296 \end_layout
1297
1298 \begin_layout Standard
1299 The 
1300 \begin_inset Flex CharStyle:Code
1301 status collapsed
1302
1303 \begin_layout Plain Layout
1304 UserDir/preferences
1305 \end_layout
1306
1307 \end_inset
1308
1309  file will contain only changes that you have made to the default behavior,
1310  some of which is hard-coded into LyX and some of which is contained in
1311  the system file 
1312 \begin_inset Flex CharStyle:Code
1313 status collapsed
1314
1315 \begin_layout Plain Layout
1316 LyXDir/lyxrc.defaults
1317 \end_layout
1318
1319 \end_inset
1320
1321 .
1322  Note that in both files lines beginning with a 
1323 \begin_inset Quotes eld
1324 \end_inset
1325
1326 #
1327 \begin_inset Quotes erd
1328 \end_inset
1329
1330  are just comments and are not interpreted.
1331  However, only system administrators should edit 
1332 \begin_inset Flex CharStyle:Code
1333 status collapsed
1334
1335 \begin_layout Plain Layout
1336 LyXDir/lyxrc.defaults
1337 \end_layout
1338
1339 \end_inset
1340
1341 .
1342  Users should use the 
1343 \begin_inset Flex CharStyle:MenuItem
1344 status collapsed
1345
1346 \begin_layout Plain Layout
1347 Tools\SpecialChar \menuseparator
1348 Preferences
1349 \end_layout
1350
1351 \end_inset
1352
1353  dialog to create and modify their own 
1354 \begin_inset Flex CharStyle:Code
1355 status collapsed
1356
1357 \begin_layout Plain Layout
1358 UserDir/preferences
1359 \end_layout
1360
1361 \end_inset
1362
1363  file.
1364 \end_layout
1365
1366 \begin_layout Standard
1367 We hope that the 
1368 \begin_inset Flex CharStyle:MenuItem
1369 status collapsed
1370
1371 \begin_layout Plain Layout
1372 Tools\SpecialChar \menuseparator
1373 Preferences
1374 \end_layout
1375
1376 \end_inset
1377
1378  dialog will be largely self-explanatory.
1379  Most things in the dialog have associated `tool tips': hover your mouse
1380  pointer over something for more information.
1381  Before we highlight a few of the more important commands below, however,
1382  a word of warning: Applying some of your changes (e.
1383 \begin_inset space \thinspace{}
1384 \end_inset
1385
1386 g.
1387 \begin_inset space \space{}
1388 \end_inset
1389
1390 screen fonts) will have an instant effect.
1391  Others (e.
1392 \begin_inset space \thinspace{}
1393 \end_inset
1394
1395 g.
1396 \begin_inset space \space{}
1397 \end_inset
1398
1399 changing the bind file) will not.
1400  If nothing appears to have changed, just 
1401 \begin_inset Flex CharStyle:MenuItem
1402 status collapsed
1403
1404 \begin_layout Plain Layout
1405 Save
1406 \end_layout
1407
1408 \end_inset
1409
1410  the changes and restart LyX.
1411 \end_layout
1412
1413 \begin_layout Section
1414 File Handling
1415 \end_layout
1416
1417 \begin_layout Standard
1418 LyX has a powerful mechanism to convert to and from any file format using
1419  external programs.
1420  
1421 \end_layout
1422
1423 \begin_layout Subsection
1424 \begin_inset CommandInset label
1425 LatexCommand label
1426 name "sub:Formats"
1427
1428 \end_inset
1429
1430 Formats
1431 \end_layout
1432
1433 \begin_layout Standard
1434 The first step is to define your file formats if they are not already defined.
1435  To do so, open the 
1436 \begin_inset Flex CharStyle:MenuItem
1437 status collapsed
1438
1439 \begin_layout Plain Layout
1440 Tools\SpecialChar \menuseparator
1441 Preferences\SpecialChar \menuseparator
1442 File Handling\SpecialChar \menuseparator
1443 File Formats
1444 \end_layout
1445
1446 \end_inset
1447
1448  dialog.
1449  Press the 
1450 \begin_inset Flex CharStyle:MenuItem
1451 status collapsed
1452
1453 \begin_layout Plain Layout
1454 New\SpecialChar \ldots{}
1455
1456 \end_layout
1457
1458 \end_inset
1459
1460  button to define your new format.
1461  The 
1462 \begin_inset Flex CharStyle:MenuItem
1463 status collapsed
1464
1465 \begin_layout Plain Layout
1466 Format
1467 \end_layout
1468
1469 \end_inset
1470
1471  field contains the named used to identify the format in the GUI.
1472  The 
1473 \begin_inset Flex CharStyle:MenuItem
1474 status collapsed
1475
1476 \begin_layout Plain Layout
1477 Short Name
1478 \end_layout
1479
1480 \end_inset
1481
1482  is used to identify the format interally.
1483  You will also need to enter a file extension.
1484  These are all required.
1485  The optional 
1486 \begin_inset Flex CharStyle:MenuItem
1487 status collapsed
1488
1489 \begin_layout Plain Layout
1490 Shortcut
1491 \end_layout
1492
1493 \end_inset
1494
1495  field is used to provide a keyboard shortcut on the menus.
1496  (For example, pressing 
1497 \begin_inset Flex CharStyle:MenuItem
1498 status collapsed
1499
1500 \begin_layout Plain Layout
1501 Alt-V D
1502 \end_layout
1503
1504 \end_inset
1505
1506  will 
1507 \begin_inset Flex CharStyle:MenuItem
1508 status collapsed
1509
1510 \begin_layout Plain Layout
1511 View\SpecialChar \menuseparator
1512 DVI
1513 \end_layout
1514
1515 \end_inset
1516
1517 .) 
1518 \end_layout
1519
1520 \begin_layout Standard
1521 A Format can have a 
1522 \begin_inset Flex CharStyle:MenuItem
1523 status collapsed
1524
1525 \begin_layout Plain Layout
1526 Viewer
1527 \end_layout
1528
1529 \end_inset
1530
1531  and 
1532 \begin_inset Flex CharStyle:MenuItem
1533 status collapsed
1534
1535 \begin_layout Plain Layout
1536 Editor
1537 \end_layout
1538
1539 \end_inset
1540
1541  associated with it.
1542  For example, you might want to use 
1543 \begin_inset Flex CharStyle:MenuItem
1544 status collapsed
1545
1546 \begin_layout Plain Layout
1547 Ghostview
1548 \end_layout
1549
1550 \end_inset
1551
1552  to view PostScript files.
1553  You can enter the command needed to start the program in the corresponding
1554  fields.
1555  In defining this command, you can use the four variables listed in the
1556  next section.
1557  The viewer is launched when you view an image in LyX or use the 
1558 \begin_inset Flex CharStyle:MenuItem
1559 status collapsed
1560
1561 \begin_layout Plain Layout
1562 View
1563 \end_layout
1564
1565 \end_inset
1566
1567  menu.
1568  The editor is for example launched when you press the 
1569 \begin_inset Flex CharStyle:MenuItem
1570 status collapsed
1571
1572 \begin_layout Plain Layout
1573 Edit
1574 \end_layout
1575
1576 \end_inset
1577
1578  button in the 
1579 \begin_inset Flex CharStyle:MenuItem
1580 status collapsed
1581
1582 \begin_layout Plain Layout
1583 Graphics
1584 \end_layout
1585
1586 \end_inset
1587
1588  or the 
1589 \begin_inset Flex CharStyle:MenuItem
1590 status collapsed
1591
1592 \begin_layout Plain Layout
1593 External material
1594 \end_layout
1595
1596 \end_inset
1597
1598  dialog.
1599 \end_layout
1600
1601 \begin_layout Standard
1602 The 
1603 \begin_inset Flex CharStyle:MenuItem
1604 status collapsed
1605
1606 \begin_layout Plain Layout
1607 Document format
1608 \end_layout
1609
1610 \end_inset
1611
1612  option tells LyX that a format is suitable for document export.
1613  If this is is set and if a suitable conversion route exists (see 
1614 \begin_inset CommandInset ref
1615 LatexCommand ref
1616 reference "sub:Converters"
1617
1618 \end_inset
1619
1620 ), the format will appear in the 
1621 \begin_inset Flex CharStyle:MenuItem
1622 status collapsed
1623
1624 \begin_layout Plain Layout
1625 File\SpecialChar \menuseparator
1626 Export
1627 \end_layout
1628
1629 \end_inset
1630
1631  menu.
1632  The format will also appear in the 
1633 \begin_inset Flex CharStyle:MenuItem
1634 status collapsed
1635
1636 \begin_layout Plain Layout
1637 View
1638 \end_layout
1639
1640 \end_inset
1641
1642  menu if a viewer is specified for the format.
1643  Pure image formats, such as 
1644 \begin_inset Flex CharStyle:Code
1645 status collapsed
1646
1647 \begin_layout Plain Layout
1648 png
1649 \end_layout
1650
1651 \end_inset
1652
1653 , should not use this option.
1654  Formats that can both represent vector graphics and documents like 
1655 \begin_inset Flex CharStyle:Code
1656 status collapsed
1657
1658 \begin_layout Plain Layout
1659 pdf
1660 \end_layout
1661
1662 \end_inset
1663
1664  should use it.
1665 \end_layout
1666
1667 \begin_layout Standard
1668 The option 
1669 \begin_inset Flex CharStyle:MenuItem
1670 status collapsed
1671
1672 \begin_layout Plain Layout
1673 Vector graphics format
1674 \end_layout
1675
1676 \end_inset
1677
1678  tells LyX that a format can contain vector graphics.
1679  This information is used to determine the target format of included graphics
1680  for 
1681 \begin_inset Flex CharStyle:MenuItem
1682 status collapsed
1683
1684 \begin_layout Plain Layout
1685 pdflatex
1686 \end_layout
1687
1688 \end_inset
1689
1690  export.
1691  Included graphics may need to be converted to either 
1692 \begin_inset Flex CharStyle:MenuItem
1693 status collapsed
1694
1695 \begin_layout Plain Layout
1696 pdf
1697 \end_layout
1698
1699 \end_inset
1700
1701
1702 \begin_inset Flex CharStyle:MenuItem
1703 status collapsed
1704
1705 \begin_layout Plain Layout
1706 png
1707 \end_layout
1708
1709 \end_inset
1710
1711 , or 
1712 \begin_inset Flex CharStyle:MenuItem
1713 status collapsed
1714
1715 \begin_layout Plain Layout
1716 jpg
1717 \end_layout
1718
1719 \end_inset
1720
1721 , since 
1722 \begin_inset Flex CharStyle:MenuItem
1723 status collapsed
1724
1725 \begin_layout Plain Layout
1726 pdflatex
1727 \end_layout
1728
1729 \end_inset
1730
1731  cannot handle other image formats.
1732  If an included graphic is not already in 
1733 \begin_inset Flex CharStyle:MenuItem
1734 status collapsed
1735
1736 \begin_layout Plain Layout
1737 pdf
1738 \end_layout
1739
1740 \end_inset
1741
1742
1743 \begin_inset Flex CharStyle:MenuItem
1744 status collapsed
1745
1746 \begin_layout Plain Layout
1747 png
1748 \end_layout
1749
1750 \end_inset
1751
1752 , or 
1753 \begin_inset Flex CharStyle:MenuItem
1754 status collapsed
1755
1756 \begin_layout Plain Layout
1757 jpg
1758 \end_layout
1759
1760 \end_inset
1761
1762  format, it is converted to 
1763 \begin_inset Flex CharStyle:MenuItem
1764 status collapsed
1765
1766 \begin_layout Plain Layout
1767 pdf
1768 \end_layout
1769
1770 \end_inset
1771
1772  if the vector format option is set, and otherwise to 
1773 \begin_inset Flex CharStyle:MenuItem
1774 status collapsed
1775
1776 \begin_layout Plain Layout
1777 png
1778 \end_layout
1779
1780 \end_inset
1781
1782 .
1783 \end_layout
1784
1785 \begin_layout Subsection
1786 Copiers
1787 \end_layout
1788
1789 \begin_layout Standard
1790 Since all conversions from one format to another take place in LyX's temporary
1791  directory, it is sometimes necessary to modify a file before copying it
1792  to the temporary directory in order that the conversion may be performed.
1793 \begin_inset Foot
1794 status collapsed
1795
1796 \begin_layout Plain Layout
1797 For example, the file may refer to other files---images, for example---using
1798  relative file names, and these may become invalid when the file is copied
1799  to the temporary directory.
1800 \end_layout
1801
1802 \end_inset
1803
1804  This is done by a Copier: It copies a file to (or from) the temporary directory
1805  and may modify it in the process.
1806 \end_layout
1807
1808 \begin_layout Standard
1809 The definitions of the copiers may use four variables:
1810 \end_layout
1811
1812 \begin_layout Labeling
1813 \labelwidthstring 00.00.0000
1814 \begin_inset Flex CharStyle:Code
1815 status collapsed
1816
1817 \begin_layout Plain Layout
1818 $$s
1819 \end_layout
1820
1821 \end_inset
1822
1823  The LyX system directory (e.
1824 \begin_inset space \thinspace{}
1825 \end_inset
1826
1827 g.
1828 \begin_inset space \space{}
1829 \end_inset
1830
1831
1832 \begin_inset Flex CharStyle:MenuItem
1833 status collapsed
1834
1835 \begin_layout Plain Layout
1836 /usr/share/lyx
1837 \end_layout
1838
1839 \end_inset
1840
1841 ).
1842 \end_layout
1843
1844 \begin_layout Labeling
1845 \labelwidthstring 00.00.0000
1846 \begin_inset Flex CharStyle:Code
1847 status collapsed
1848
1849 \begin_layout Plain Layout
1850 $$i
1851 \end_layout
1852
1853 \end_inset
1854
1855  The input file
1856 \end_layout
1857
1858 \begin_layout Labeling
1859 \labelwidthstring 00.00.0000
1860 \begin_inset Flex CharStyle:Code
1861 status collapsed
1862
1863 \begin_layout Plain Layout
1864 $$o
1865 \end_layout
1866
1867 \end_inset
1868
1869  The output file
1870 \end_layout
1871
1872 \begin_layout Labeling
1873 \labelwidthstring 00.00.0000
1874 \begin_inset Flex CharStyle:Code
1875 status collapsed
1876
1877 \begin_layout Plain Layout
1878 $$l
1879 \end_layout
1880
1881 \end_inset
1882
1883  The `LaTeX name'
1884 \end_layout
1885
1886 \begin_layout Standard
1887 The latter should be the filename as it would be used in a LaTeX's 
1888 \series bold
1889
1890 \backslash
1891 include
1892 \series default
1893  command.
1894  It is relevant only when exporting files suitable for such inclusion.
1895 \end_layout
1896
1897 \begin_layout Standard
1898 Copiers can be used to do almost anything with output files.
1899  For example, suppose you want generated pdf files to be copied to a special
1900  directory, 
1901 \begin_inset Flex CharStyle:Code
1902 status collapsed
1903
1904 \begin_layout Plain Layout
1905 /home/you/pdf/
1906 \end_layout
1907
1908 \end_inset
1909
1910 .
1911  Then you could write a shell script such as this one:
1912 \end_layout
1913
1914 \begin_layout Standard
1915 \begin_inset listings
1916 inline false
1917 status open
1918
1919 \begin_layout Plain Layout
1920
1921 #!/bin/bash
1922 \end_layout
1923
1924 \begin_layout Plain Layout
1925
1926 FROMFILE=$1
1927 \end_layout
1928
1929 \begin_layout Plain Layout
1930
1931 TOFILE=`basename $2`
1932 \end_layout
1933
1934 \begin_layout Plain Layout
1935
1936 cp $FROMFILE /home/you/pdf/$TOFILE
1937 \end_layout
1938
1939 \end_inset
1940
1941 Save that in your local LyX directory---say, 
1942 \begin_inset Flex CharStyle:Code
1943 status collapsed
1944
1945 \begin_layout Plain Layout
1946 /home/you/.lyx/scripts/pdfcopier.sh
1947 \end_layout
1948
1949 \end_inset
1950
1951 ---and make it executable, if you need to do so on your platform.
1952  Then, in the 
1953 \begin_inset Flex CharStyle:MenuItem
1954 status collapsed
1955
1956 \begin_layout Plain Layout
1957 Tools\SpecialChar \menuseparator
1958 Preferences:Copiers
1959 \end_layout
1960
1961 \end_inset
1962
1963  dialog, select the 
1964 \begin_inset Flex CharStyle:MenuItem
1965 status collapsed
1966
1967 \begin_layout Plain Layout
1968 PDF(pdflatex)
1969 \end_layout
1970
1971 \end_inset
1972
1973  format---or one of the other pdf formats---and enter 
1974 \begin_inset Flex CharStyle:Code
1975 status collapsed
1976
1977 \begin_layout Plain Layout
1978 pdfcopier.sh $$i $$o
1979 \end_layout
1980
1981 \end_inset
1982
1983  into the 
1984 \begin_inset Flex CharStyle:MenuItem
1985 status collapsed
1986
1987 \begin_layout Plain Layout
1988 Copier
1989 \end_layout
1990
1991 \end_inset
1992
1993  field.
1994  
1995 \end_layout
1996
1997 \begin_layout Standard
1998 Copiers are used by LyX in various of its own conversions.
1999  For example, if appropriate programs are found, LyX will automatically
2000  install copiers for the 
2001 \begin_inset Flex CharStyle:MenuItem
2002 status collapsed
2003
2004 \begin_layout Plain Layout
2005 HTML
2006 \end_layout
2007
2008 \end_inset
2009
2010  and 
2011 \begin_inset Flex CharStyle:MenuItem
2012 status collapsed
2013
2014 \begin_layout Plain Layout
2015 HTML
2016 \begin_inset space ~
2017 \end_inset
2018
2019 (MS Word)
2020 \end_layout
2021
2022 \end_inset
2023
2024  formats.
2025  When these formats are exported, the copier sees that not just the main
2026  HTML file but various associated files (style files, images, etc.) are also
2027  copied.
2028  All these files are written to a subdirectory of the directory in which
2029  the original LyX file was found.
2030 \begin_inset Foot
2031 status collapsed
2032
2033 \begin_layout Plain Layout
2034 This copier can be customized.
2035  The optional 
2036 \begin_inset Quotes eld
2037 \end_inset
2038
2039 -e
2040 \begin_inset Quotes erd
2041 \end_inset
2042
2043  argument takes a comma-separated list of extensions to be copied; if it
2044  is omitted, all files will be copied.
2045  The 
2046 \begin_inset Quotes eld
2047 \end_inset
2048
2049 -t
2050 \begin_inset Quotes erd
2051 \end_inset
2052
2053  argument determines the extension added to the generated directory.
2054  By default, it is 
2055 \begin_inset Quotes eld
2056 \end_inset
2057
2058
2059 \begin_inset Flex CharStyle:MenuItem
2060 status collapsed
2061
2062 \begin_layout Plain Layout
2063 LyXconv
2064 \end_layout
2065
2066 \end_inset
2067
2068
2069 \begin_inset Quotes erd
2070 \end_inset
2071
2072 , so HTML generated from 
2073 \begin_inset Flex CharStyle:MenuItem
2074 status collapsed
2075
2076 \begin_layout Plain Layout
2077 /path/to/filename.lyx
2078 \end_layout
2079
2080 \end_inset
2081
2082  will end up in 
2083 \begin_inset Flex CharStyle:MenuItem
2084 status collapsed
2085
2086 \begin_layout Plain Layout
2087 /path/to/filename.html.LyXconv
2088 \end_layout
2089
2090 \end_inset
2091
2092 .
2093  
2094 \end_layout
2095
2096 \end_inset
2097
2098
2099 \end_layout
2100
2101 \begin_layout Subsection
2102 \begin_inset CommandInset label
2103 LatexCommand label
2104 name "sub:Converters"
2105
2106 \end_inset
2107
2108 Converters
2109 \end_layout
2110
2111 \begin_layout Standard
2112 You can define your own Converters to, uhh, convert files between different
2113  formats.
2114  This is done in the 
2115 \begin_inset Flex CharStyle:MenuItem
2116 status collapsed
2117
2118 \begin_layout Plain Layout
2119 Tools\SpecialChar \menuseparator
2120 Preferences\SpecialChar \menuseparator
2121 File Handling\SpecialChar \menuseparator
2122 Converters
2123 \end_layout
2124
2125 \end_inset
2126
2127  dialog.
2128 \end_layout
2129
2130 \begin_layout Standard
2131 To define a new converter, select the 
2132 \begin_inset Flex CharStyle:MenuItem
2133 status collapsed
2134
2135 \begin_layout Plain Layout
2136 From
2137 \begin_inset space ~
2138 \end_inset
2139
2140 format
2141 \end_layout
2142
2143 \end_inset
2144
2145  and 
2146 \begin_inset Flex CharStyle:MenuItem
2147 status collapsed
2148
2149 \begin_layout Plain Layout
2150 To
2151 \begin_inset space ~
2152 \end_inset
2153
2154 format
2155 \end_layout
2156
2157 \end_inset
2158
2159  from the drop-down lists, enter the command needed for the conversion,
2160  and then press the 
2161 \begin_inset Flex CharStyle:MenuItem
2162 status collapsed
2163
2164 \begin_layout Plain Layout
2165 Add
2166 \end_layout
2167
2168 \end_inset
2169
2170  button.
2171  Several variables can be used in the definition of converters:
2172 \end_layout
2173
2174 \begin_layout Labeling
2175 \labelwidthstring 00.00.0000
2176 \begin_inset Flex CharStyle:Code
2177 status collapsed
2178
2179 \begin_layout Plain Layout
2180 $$s
2181 \end_layout
2182
2183 \end_inset
2184
2185  The LyX system directory
2186 \end_layout
2187
2188 \begin_layout Labeling
2189 \labelwidthstring 00.00.0000
2190 \begin_inset Flex CharStyle:Code
2191 status collapsed
2192
2193 \begin_layout Plain Layout
2194 $$i
2195 \end_layout
2196
2197 \end_inset
2198
2199  The input file
2200 \end_layout
2201
2202 \begin_layout Labeling
2203 \labelwidthstring 00.00.0000
2204 \begin_inset Flex CharStyle:Code
2205 status collapsed
2206
2207 \begin_layout Plain Layout
2208 $$o
2209 \end_layout
2210
2211 \end_inset
2212
2213  The output file
2214 \end_layout
2215
2216 \begin_layout Labeling
2217 \labelwidthstring 00.00.0000
2218 \begin_inset Flex CharStyle:Code
2219 status collapsed
2220
2221 \begin_layout Plain Layout
2222 $$b
2223 \end_layout
2224
2225 \end_inset
2226
2227  The base filename of the input file (i.
2228 \begin_inset space \thinspace{}
2229 \end_inset
2230
2231 g., without the extension)
2232 \end_layout
2233
2234 \begin_layout Labeling
2235 \labelwidthstring 00.00.0000
2236 \begin_inset Flex CharStyle:Code
2237 status collapsed
2238
2239 \begin_layout Plain Layout
2240 $$p
2241 \end_layout
2242
2243 \end_inset
2244
2245  The path to the input file
2246 \end_layout
2247
2248 \begin_layout Standard
2249 In the 
2250 \begin_inset Flex CharStyle:MenuItem
2251 status collapsed
2252
2253 \begin_layout Plain Layout
2254 Extra
2255 \begin_inset space ~
2256 \end_inset
2257
2258 Flag
2259 \end_layout
2260
2261 \end_inset
2262
2263  field you can enter the following flags, separated by commas:
2264 \end_layout
2265
2266 \begin_layout Labeling
2267 \labelwidthstring 00.00.0000
2268 \begin_inset Flex CharStyle:Code
2269 status collapsed
2270
2271 \begin_layout Plain Layout
2272 latex
2273 \end_layout
2274
2275 \end_inset
2276
2277  This converter runs some form of LaTeX.
2278  This will make LyX's LaTeX error logs available.
2279 \end_layout
2280
2281 \begin_layout Labeling
2282 \labelwidthstring 00.00.0000
2283 \begin_inset Flex CharStyle:Code
2284 status collapsed
2285
2286 \begin_layout Plain Layout
2287 needaux
2288 \end_layout
2289
2290 \end_inset
2291
2292  Needs the LaTeX 
2293 \begin_inset Flex CharStyle:MenuItem
2294 status collapsed
2295
2296 \begin_layout Plain Layout
2297 .aux
2298 \end_layout
2299
2300 \end_inset
2301
2302  file for the conversion.
2303 \end_layout
2304
2305 \begin_layout Labeling
2306 \labelwidthstring 00.00.0000
2307 \begin_inset Flex CharStyle:Code
2308 status collapsed
2309
2310 \begin_layout Plain Layout
2311 xml
2312 \end_layout
2313
2314 \end_inset
2315
2316  Output is XML.
2317 \end_layout
2318
2319 \begin_layout Standard
2320 The following three flags are not really flags at all because they take
2321  an argument in the 
2322 \begin_inset Flex CharStyle:MenuItem
2323 status collapsed
2324
2325 \begin_layout Plain Layout
2326 key
2327 \begin_inset space ~
2328 \end_inset
2329
2330 =
2331 \begin_inset space ~
2332 \end_inset
2333
2334 value
2335 \end_layout
2336
2337 \end_inset
2338
2339  format:
2340 \end_layout
2341
2342 \begin_layout Labeling
2343 \labelwidthstring 00.00.0000
2344 \begin_inset Flex CharStyle:Code
2345 status collapsed
2346
2347 \begin_layout Plain Layout
2348 parselog
2349 \end_layout
2350
2351 \end_inset
2352
2353  If set, the converter's standard error will be redirected to a file 
2354 \begin_inset Flex CharStyle:Code
2355 status collapsed
2356
2357 \begin_layout Plain Layout
2358 infile.out
2359 \end_layout
2360
2361 \end_inset
2362
2363 , and the script given as argument will be run as: 
2364 \begin_inset Flex CharStyle:Code
2365 status collapsed
2366
2367 \begin_layout Plain Layout
2368 script <infile.out >infile.log
2369 \end_layout
2370
2371 \end_inset
2372
2373 .
2374  The argument may contain 
2375 \begin_inset Flex CharStyle:Code
2376 status collapsed
2377
2378 \begin_layout Plain Layout
2379 $$s
2380 \end_layout
2381
2382 \end_inset
2383
2384 .
2385 \end_layout
2386
2387 \begin_layout Labeling
2388 \labelwidthstring 00.00.0000
2389 \begin_inset Flex CharStyle:Code
2390 status collapsed
2391
2392 \begin_layout Plain Layout
2393 resultdir
2394 \end_layout
2395
2396 \end_inset
2397
2398  The name of the directory in which the converter will dump the generated
2399  files.
2400  LyX will not create this directory, and it does not copy anything into
2401  it, though it will copy this directory to the destination.
2402  The argument may contain 
2403 \begin_inset Flex CharStyle:Code
2404 status collapsed
2405
2406 \begin_layout Plain Layout
2407 $$b
2408 \end_layout
2409
2410 \end_inset
2411
2412 , which will be replaced by the base name of the input and output files,
2413  respectively, when the directory is copied.
2414 \begin_inset Newline newline
2415 \end_inset
2416
2417 Note that resultdir and usetempdir make no sense together.
2418  The latter will be ignored if the former is given.
2419 \end_layout
2420
2421 \begin_layout Labeling
2422 \labelwidthstring 00.00.0000
2423 \begin_inset Flex CharStyle:Code
2424 status collapsed
2425
2426 \begin_layout Plain Layout
2427 resultfile
2428 \end_layout
2429
2430 \end_inset
2431
2432  Determines the output file name and may, contain 
2433 \begin_inset Flex CharStyle:Code
2434 status collapsed
2435
2436 \begin_layout Plain Layout
2437 $$b
2438 \end_layout
2439
2440 \end_inset
2441
2442 .
2443  Sensible only with resultdir and optional even then; if not given, it defaults
2444  to `index'.
2445 \end_layout
2446
2447 \begin_layout Standard
2448 None of these last three are presently used in any of the converters that
2449  are installed with LyX.
2450  
2451 \end_layout
2452
2453 \begin_layout Standard
2454 You do not have to define converters between all the formats between which
2455  you want to convert.
2456  For example, you will note that there is no `LyX to PostScript®' converter,
2457  but LyX will export PostScript®.
2458  It does so by first creating a LaTeX file (no converter needs to be defined
2459  for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2460  and finally converting the resulting DVI file to PostScript®.
2461  LyX finds such `chains' of converters automatically, and it will always
2462  choose the shortest possible chain.
2463  You can, though, still define multiple conversion methods between file
2464  formats.
2465  For example, the standard LyX configuration provides three ways to convert
2466  LaTeX to PDF: Directly, using 
2467 \begin_inset Flex CharStyle:MenuItem
2468 status collapsed
2469
2470 \begin_layout Plain Layout
2471 pdflatex
2472 \end_layout
2473
2474 \end_inset
2475
2476 ; via (DVI and) PostScript®, using 
2477 \begin_inset Flex CharStyle:MenuItem
2478 status collapsed
2479
2480 \begin_layout Plain Layout
2481 ps2pdf
2482 \end_layout
2483
2484 \end_inset
2485
2486 ; or via DVI, using 
2487 \begin_inset Flex CharStyle:MenuItem
2488 status collapsed
2489
2490 \begin_layout Plain Layout
2491 dvipdfm
2492 \end_layout
2493
2494 \end_inset
2495
2496 .
2497  To define such alternate chains, you must define multiple target `file
2498  formats', as described in section 
2499 \begin_inset CommandInset ref
2500 LatexCommand ref
2501 reference "sub:Formats"
2502
2503 \end_inset
2504
2505 .
2506  For example, in the standard configuration, the formats named 
2507 \begin_inset Flex CharStyle:MenuItem
2508 status collapsed
2509
2510 \begin_layout Plain Layout
2511 pdf
2512 \end_layout
2513
2514 \end_inset
2515
2516
2517 \begin_inset Flex CharStyle:MenuItem
2518 status collapsed
2519
2520 \begin_layout Plain Layout
2521 pdf2
2522 \end_layout
2523
2524 \end_inset
2525
2526 , and 
2527 \begin_inset Flex CharStyle:MenuItem
2528 status collapsed
2529
2530 \begin_layout Plain Layout
2531 pdf3
2532 \end_layout
2533
2534 \end_inset
2535
2536  are defined, all of which share the extension 
2537 \begin_inset Flex CharStyle:MenuItem
2538 status collapsed
2539
2540 \begin_layout Plain Layout
2541 .pdf
2542 \end_layout
2543
2544 \end_inset
2545
2546 , and which correspond to the conversion methods just mentioned.
2547 \end_layout
2548
2549 \begin_layout Chapter
2550 Internationalizing LyX
2551 \begin_inset CommandInset label
2552 LatexCommand label
2553 name "chap:i18n"
2554
2555 \end_inset
2556
2557
2558 \end_layout
2559
2560 \begin_layout Standard
2561 LyX supports using a translated interface.
2562  Last time we checked, LyX provided text in thirty languages.
2563  The language of choice is called your 
2564 \emph on
2565 locale
2566 \emph default
2567 .
2568  (For further reading on locale settings, see also the documentation for
2569  locale that comes with your operating system.
2570  For Linux, the manual page for 
2571 \begin_inset Flex CharStyle:Code
2572 status collapsed
2573
2574 \begin_layout Plain Layout
2575 locale(5)
2576 \end_layout
2577
2578 \end_inset
2579
2580  could be a good place to start).
2581 \end_layout
2582
2583 \begin_layout Standard
2584 Notice that these translations will work, but do contain a few flaws.
2585  In particular, all dialogs have been designed with the English text in
2586  mind, which means that some of the translated text will be too large to
2587  fit within the space allocated.
2588  This is only a display problem and will not cause any harm.
2589  Also, you will find that some of the translations do not define shortcut
2590  keys for everything.
2591  Sometimes, there are simply not enough free letters to do it.
2592  Other times, the translator just hasn't got around to doing it yet.
2593  Our localization team, which you may wish to join,
2594 \begin_inset Foot
2595 status collapsed
2596
2597 \begin_layout Plain Layout
2598 If you are a fluent speaker of a language other than English, joining these
2599  teams is a great way to give back to the LyX community!
2600 \end_layout
2601
2602 \end_inset
2603
2604  will of course try to fix these shortcomings in future versions of LyX.
2605 \end_layout
2606
2607 \begin_layout Section
2608 Translating LyX
2609 \end_layout
2610
2611 \begin_layout Subsection
2612 Translating the graphical user interface (text messages).
2613 \end_layout
2614
2615 \begin_layout Standard
2616 LyX uses the GNU 
2617 \begin_inset Flex CharStyle:Code
2618 status collapsed
2619
2620 \begin_layout Plain Layout
2621 gettext
2622 \end_layout
2623
2624 \end_inset
2625
2626  library to handle the internationalization of the interface.
2627  To have LyX speak your favorite language in all menus and dialogs, you
2628  need a 
2629 \begin_inset Flex CharStyle:Code
2630 status collapsed
2631
2632 \begin_layout Plain Layout
2633 po
2634 \end_layout
2635
2636 \end_inset
2637
2638 -file for that language.
2639  When this is available, you'll have to generate a 
2640 \begin_inset Flex CharStyle:Code
2641 status collapsed
2642
2643 \begin_layout Plain Layout
2644 mo
2645 \end_layout
2646
2647 \end_inset
2648
2649 -file from it and install the 
2650 \begin_inset Flex CharStyle:Code
2651 status collapsed
2652
2653 \begin_layout Plain Layout
2654 mo
2655 \end_layout
2656
2657 \end_inset
2658
2659 -file.
2660  The process of doing all of this is explained in the documentation for
2661  GNU 
2662 \begin_inset Flex CharStyle:Code
2663 status collapsed
2664
2665 \begin_layout Plain Layout
2666 gettext
2667 \end_layout
2668
2669 \end_inset
2670
2671 .
2672  It is possible to do this just for yourself, but if you're going to do
2673  it, you might as well share the results of your labors with the rest of
2674  the LyX community.
2675  Send a message to the LyX developers' list for more information about how
2676  to proceed.
2677 \end_layout
2678
2679 \begin_layout Standard
2680 In short, this is what you should do (xx denotes the language code):
2681 \end_layout
2682
2683 \begin_layout Itemize
2684 Check out the LyX source code.
2685  (See the 
2686 \begin_inset CommandInset href
2687 LatexCommand href
2688 name "information on the web"
2689 target "http://www.lyx.org/devel/cvs.php"
2690
2691 \end_inset
2692
2693 .)
2694 \end_layout
2695
2696 \begin_layout Itemize
2697 Copy the file 
2698 \begin_inset Flex CharStyle:Code
2699 status collapsed
2700
2701 \begin_layout Plain Layout
2702 lyx.pot
2703 \end_layout
2704
2705 \end_inset
2706
2707  to the folder of the 
2708 \begin_inset Flex CharStyle:Code
2709 status collapsed
2710
2711 \begin_layout Plain Layout
2712 **.po
2713 \end_layout
2714
2715 \end_inset
2716
2717  files.
2718  Then rename it to 
2719 \begin_inset Flex CharStyle:Code
2720 status collapsed
2721
2722 \begin_layout Plain Layout
2723 xx.po
2724 \end_layout
2725
2726 \end_inset
2727
2728 .
2729  (If 
2730 \begin_inset Flex CharStyle:Code
2731 status collapsed
2732
2733 \begin_layout Plain Layout
2734 lyx.pot
2735 \end_layout
2736
2737 \end_inset
2738
2739  doesn't exist anywhere, it can be remade with the console command 
2740 \begin_inset Flex CharStyle:Code
2741 status collapsed
2742
2743 \begin_layout Plain Layout
2744 make lyx.pot
2745 \end_layout
2746
2747 \end_inset
2748
2749  in that directory, or you can use an existing po-file for some other language
2750  as a template).
2751 \end_layout
2752
2753 \begin_layout Itemize
2754 Edit 
2755 \begin_inset Flex CharStyle:Code
2756 status collapsed
2757
2758 \begin_layout Plain Layout
2759 xx.po
2760 \end_layout
2761
2762 \end_inset
2763
2764 .
2765 \begin_inset Foot
2766 status collapsed
2767
2768 \begin_layout Plain Layout
2769 This is just a text file, so it can be edited in any text editor.
2770  But there are also specialized programs that support such editing, such
2771  as 
2772 \family typewriter
2773 Poedit
2774 \family default
2775  (for all platforms) or 
2776 \family typewriter
2777 KBabel
2778 \family default
2779  (for KDE).
2780  
2781 \family typewriter
2782 Emacs
2783 \family default
2784  contains a `mode' for editing 
2785 \begin_inset Flex CharStyle:Code
2786 status collapsed
2787
2788 \begin_layout Plain Layout
2789 po
2790 \end_layout
2791
2792 \end_inset
2793
2794  files, as well.
2795 \end_layout
2796
2797 \end_inset
2798
2799  For some menu- and widget-labels, there are also shortcut keys that should
2800  be translated.
2801  Those keys are marked after a `|', and should be translated according to
2802  the words and phrases of the language.
2803  You should also fill also out the information at the beginning of the new
2804  
2805 \begin_inset Flex CharStyle:Code
2806 status collapsed
2807
2808 \begin_layout Plain Layout
2809 po
2810 \end_layout
2811
2812 \end_inset
2813
2814 -file with your email-address, etc., so people know where to reach you with
2815  suggestions and entertaining flames.
2816 \end_layout
2817
2818 \begin_layout Standard
2819 If you are just doing this on your own, then:
2820 \end_layout
2821
2822 \begin_layout Itemize
2823 Generate 
2824 \begin_inset Flex CharStyle:Code
2825 status collapsed
2826
2827 \begin_layout Plain Layout
2828 xx.mo
2829 \end_layout
2830
2831 \end_inset
2832
2833 .
2834  This can be done with 
2835 \begin_inset Flex CharStyle:Code
2836 status collapsed
2837
2838 \begin_layout Plain Layout
2839 msgfmt -o xx.mo < xx.po
2840 \end_layout
2841
2842 \end_inset
2843
2844 .
2845 \end_layout
2846
2847 \begin_layout Itemize
2848 Copy the 
2849 \begin_inset Flex CharStyle:Code
2850 status collapsed
2851
2852 \begin_layout Plain Layout
2853 mo
2854 \end_layout
2855
2856 \end_inset
2857
2858 -file to your locale-tree, at the correct directory for application messages
2859  for the language
2860 \series bold
2861  
2862 \series default
2863 xx, and under the name 
2864 \begin_inset Flex CharStyle:Code
2865 status collapsed
2866
2867 \begin_layout Plain Layout
2868 lyx.mo
2869 \end_layout
2870
2871 \end_inset
2872
2873  (e.
2874 \begin_inset space \thinspace{}
2875 \end_inset
2876
2877 g.
2878 \begin_inset space \space{}
2879 \end_inset
2880
2881
2882 \begin_inset Flex CharStyle:Code
2883 status collapsed
2884
2885 \begin_layout Plain Layout
2886 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2887 \end_layout
2888
2889 \end_inset
2890
2891
2892 \series bold
2893 .
2894 \end_layout
2895
2896 \begin_layout Standard
2897 As said, however, it would be best if the new 
2898 \begin_inset Flex CharStyle:Code
2899 status collapsed
2900
2901 \begin_layout Plain Layout
2902 po
2903 \end_layout
2904
2905 \end_inset
2906
2907 -file could be added to the LyX distribution, so others can use it.
2908  Adding it involves making additional changes to LyX.
2909  So send an email to the developers' mailing list if you're interested in
2910  doing that.
2911 \end_layout
2912
2913 \begin_layout Subsubsection
2914 Ambigous messages
2915 \end_layout
2916
2917 \begin_layout Standard
2918 Sometimes it turns out that one English message needs to be translated into
2919  different messages in the target language.
2920  One example is the message 
2921 \begin_inset Flex CharStyle:Code
2922 status collapsed
2923
2924 \begin_layout Plain Layout
2925 To
2926 \end_layout
2927
2928 \end_inset
2929
2930  which has the German translation 
2931 \lang german
2932 Nach
2933 \lang english
2934  or 
2935 \lang german
2936 Bis
2937 \lang english
2938 , depending upon exactly what the English 
2939 \begin_inset Quotes eld
2940 \end_inset
2941
2942 to
2943 \begin_inset Quotes erd
2944 \end_inset
2945
2946  means.
2947  GNU 
2948 \begin_inset Flex CharStyle:Code
2949 status collapsed
2950
2951 \begin_layout Plain Layout
2952 gettext
2953 \end_layout
2954
2955 \end_inset
2956
2957  does not handle such ambigous translations.
2958  Therefore you have to add some context information to the message: Instead
2959  of 
2960 \begin_inset Flex CharStyle:Code
2961 status collapsed
2962
2963 \begin_layout Plain Layout
2964 To
2965 \end_layout
2966
2967 \end_inset
2968
2969  it becomes 
2970 \begin_inset Flex CharStyle:Code
2971 status collapsed
2972
2973 \begin_layout Plain Layout
2974 To[[as in 'From format x to format y']]
2975 \end_layout
2976
2977 \end_inset
2978
2979  and 
2980 \begin_inset Flex CharStyle:Code
2981 status collapsed
2982
2983 \begin_layout Plain Layout
2984 To[[as in 'From page x to page y']].
2985 \end_layout
2986
2987 \end_inset
2988
2989  Now the two occurences of 
2990 \begin_inset Flex CharStyle:Code
2991 status collapsed
2992
2993 \begin_layout Plain Layout
2994 To
2995 \end_layout
2996
2997 \end_inset
2998
2999  are different for 
3000 \begin_inset Flex CharStyle:Code
3001 status collapsed
3002
3003 \begin_layout Plain Layout
3004 gettext
3005 \end_layout
3006
3007 \end_inset
3008
3009  and can be translated correctly to 
3010 \lang german
3011 Nach
3012 \lang english
3013  and 
3014 \lang german
3015 Bis
3016 \lang english
3017 , respectively.
3018 \end_layout
3019
3020 \begin_layout Standard
3021 Of course the context information needs to be stripped off the original
3022  message when no translation is used.
3023  Therefore you have to put it in double square brackets at the end of the
3024  message (see the example above).
3025  The translation mechanism of LyX ensures that everything in double square
3026  brackets at the end of messages is removed before displaying the message.
3027 \end_layout
3028
3029 \begin_layout Subsection
3030 Translating the documentation.
3031 \end_layout
3032
3033 \begin_layout Standard
3034 The online documentation (in the 
3035 \begin_inset Flex CharStyle:MenuItem
3036 status collapsed
3037
3038 \begin_layout Plain Layout
3039
3040 \bar under
3041 H
3042 \bar default
3043 elp
3044 \end_layout
3045
3046 \end_inset
3047
3048 -menu) can (and should!) be translated.
3049  If there are translated versions of the documentation available
3050 \begin_inset Foot
3051 status collapsed
3052
3053 \begin_layout Plain Layout
3054 As of March 2008, at least some of the documents have been translated into
3055  fourteen languages, with the Tutorial available in a few more.
3056 \end_layout
3057
3058 \end_inset
3059
3060  and the locale is set accordingly, these will be used automagically by
3061  LyX.
3062  LyX looks for translated versions as 
3063 \begin_inset Flex CharStyle:Code
3064 status collapsed
3065
3066 \begin_layout Plain Layout
3067 LyXDir/doc/xx_DocName.lyx
3068 \end_layout
3069
3070 \end_inset
3071
3072 , where 
3073 \begin_inset Flex CharStyle:Code
3074 status collapsed
3075
3076 \begin_layout Plain Layout
3077 xx
3078 \end_layout
3079
3080 \end_inset
3081
3082  is the code for the language currently in use.
3083  If there are no translated documents, the default English versions will
3084  be displayed.
3085  Note that the translated versions must have the same filenames (
3086 \begin_inset Flex CharStyle:Code
3087 status collapsed
3088
3089 \begin_layout Plain Layout
3090 DocName
3091 \end_layout
3092
3093 \end_inset
3094
3095  above) as the original.
3096  If you feel up to translating the documentation (an excellent way to proof-read
3097  the original documentation by the way!), there are a few things you should
3098  do right away:
3099 \end_layout
3100
3101 \begin_layout Itemize
3102 Read 
3103 \begin_inset Flex CharStyle:Code
3104 status collapsed
3105
3106 \begin_layout Plain Layout
3107 DocStyle.lyx
3108 \end_layout
3109
3110 \end_inset
3111
3112 , the guide to writing LyX documentation.
3113  Pay special attention to the translator's section.
3114 \end_layout
3115
3116 \begin_layout Itemize
3117 Check out the documentation translation web page at 
3118 \begin_inset CommandInset href
3119 LatexCommand href
3120 name "http://www.lyx.org/Translation"
3121 target "http://www.lyx.org/Translation"
3122
3123 \end_inset
3124
3125 .
3126  That way, you can find out which (if any) documents have already been translate
3127 d into your language.
3128  You can also find out who (if anyone) is organizing the effort to translate
3129  the documentation into your language.
3130  If no one is organizing the effort, please let us know that you're interested.
3131 \end_layout
3132
3133 \begin_layout Standard
3134 Once you get to actually translating, here's a few hints for you that may
3135  save you trouble:
3136 \end_layout
3137
3138 \begin_layout Itemize
3139 Join the documentation team! There is information on how to do that in 
3140 \begin_inset Flex CharStyle:Code
3141 status collapsed
3142
3143 \begin_layout Plain Layout
3144 Intro.lyx
3145 \end_layout
3146
3147 \end_inset
3148
3149  (
3150 \begin_inset Flex CharStyle:MenuItem
3151 status collapsed
3152
3153 \begin_layout Plain Layout
3154
3155 \bar under
3156 H
3157 \bar default
3158 elp\SpecialChar \menuseparator
3159
3160 \bar under
3161 I
3162 \bar default
3163 ntroduction
3164 \end_layout
3165
3166 \end_inset
3167
3168 ), which by the way is the first document you should translate.
3169 \end_layout
3170
3171 \begin_layout Itemize
3172 Learn the typographic conventions for the language you are translating to.
3173  Typography is an ancient art and over the centuries, a great variety of
3174  conventions have developed throughout different parts of the world.
3175  Also study the professional terminology amongst typographers in your country.
3176  Inventing your own terminology will only confuse the users.
3177  
3178 \emph on
3179 (Warning! Typography is addictive!)
3180 \end_layout
3181
3182 \begin_layout Itemize
3183 Make a copy of the document.
3184  This will be your working copy.
3185  You can use this as your personal translated help-file by placing it in
3186  your 
3187 \begin_inset Flex CharStyle:Code
3188 status collapsed
3189
3190 \begin_layout Plain Layout
3191 UserDir/doc/
3192 \end_layout
3193
3194 \end_inset
3195
3196  directory.
3197 \end_layout
3198
3199 \begin_layout Itemize
3200 Sometimes the original document (from the LyX-team) will be updated.
3201  Use the source viewer at 
3202 \begin_inset CommandInset href
3203 LatexCommand href
3204 name "http://www.lyx.org/trac/timeline"
3205 target "http://www.lyx.org/trac/timeline"
3206
3207 \end_inset
3208
3209  to see what has been changed.
3210  That way you can easily see which parts of the translated document need
3211  to be updated.
3212 \end_layout
3213
3214 \begin_layout Standard
3215 If you ever find an error in the original document, fix it and notify the
3216  rest of the documentation team of the changes! (You didn't forget to join
3217  the documentation team, did you?)
3218 \end_layout
3219
3220 \begin_layout Standard
3221 \begin_inset Branch OutDated
3222 status collapsed
3223
3224 \begin_layout Section
3225 International Keyboard Support
3226 \end_layout
3227
3228 \begin_layout Standard
3229
3230 \emph on
3231 [Editor's Note: The following section is by
3232 \emph default
3233  
3234 \shape smallcaps
3235 \emph on
3236 Ivan Schreter
3237 \shape default
3238 .
3239  It needs to be fixed to conform to the new Documentation Style sheet and
3240  to make use of the new v1.0 features.
3241  The whole thing also needs to be merged with the section following it.-jw
3242  It may also be badly out of date.-rh (2008)]
3243 \end_layout
3244
3245 \begin_layout Subsection
3246 Defining Own Keymaps: Keymap File Format
3247 \end_layout
3248
3249 \begin_layout Standard
3250 Let's look at a keyboard definition file a little closer.
3251  It is a plain text file defining
3252 \end_layout
3253
3254 \begin_layout Itemize
3255 key-to-key or key-to-string translations
3256 \end_layout
3257
3258 \begin_layout Itemize
3259 dead keys
3260 \end_layout
3261
3262 \begin_layout Itemize
3263 dead keys exceptions
3264 \end_layout
3265
3266 \begin_layout Standard
3267 To define key-to-key or key-to-string translation, use this command:
3268 \end_layout
3269
3270 \begin_layout Quotation
3271 \begin_inset Flex CharStyle:Code
3272 status collapsed
3273
3274 \begin_layout Plain Layout
3275
3276 \backslash
3277 kmap
3278 \end_layout
3279
3280 \end_inset
3281
3282  
3283 \begin_inset Flex CharStyle:Code
3284 status collapsed
3285
3286 \begin_layout Plain Layout
3287 key
3288 \end_layout
3289
3290 \end_inset
3291
3292  outstring 
3293 \end_layout
3294
3295 \begin_layout Standard
3296 where 
3297 \begin_inset Flex CharStyle:Code
3298 status collapsed
3299
3300 \begin_layout Plain Layout
3301 key
3302 \end_layout
3303
3304 \end_inset
3305
3306  is the key to be translated and 
3307 \begin_inset Flex CharStyle:Code
3308 status collapsed
3309
3310 \begin_layout Plain Layout
3311 outstring
3312 \end_layout
3313
3314 \end_inset
3315
3316  is the string to be inserted into the document.
3317  To define dead keys, use:
3318 \end_layout
3319
3320 \begin_layout Quotation
3321 \begin_inset Flex CharStyle:Code
3322 status collapsed
3323
3324 \begin_layout Plain Layout
3325
3326 \backslash
3327 kmod
3328 \end_layout
3329
3330 \end_inset
3331
3332  
3333 \begin_inset Flex CharStyle:Code
3334 status collapsed
3335
3336 \begin_layout Plain Layout
3337 key
3338 \end_layout
3339
3340 \end_inset
3341
3342  deadkey
3343 \end_layout
3344
3345 \begin_layout Standard
3346 where 
3347 \begin_inset Flex CharStyle:Code
3348 status collapsed
3349
3350 \begin_layout Plain Layout
3351 key
3352 \end_layout
3353
3354 \end_inset
3355
3356  is a keyboard key and 
3357 \begin_inset Flex CharStyle:Code
3358 status collapsed
3359
3360 \begin_layout Plain Layout
3361 deadkey
3362 \end_layout
3363
3364 \end_inset
3365
3366  is dead key name.
3367  The following dead keys are supported (shortcut name is in parentheses):
3368 \end_layout
3369
3370 \begin_layout Quotation
3371
3372 \emph on
3373 Name
3374 \begin_inset space \hfill{}
3375 \end_inset
3376
3377 Example
3378 \end_layout
3379
3380 \begin_layout Quotation
3381 acute (acu)
3382 \begin_inset space \hfill{}
3383 \end_inset
3384
3385 áéíóú
3386 \end_layout
3387
3388 \begin_layout Quotation
3389 grave (gra)
3390 \begin_inset space \hfill{}
3391 \end_inset
3392
3393 àèìòù
3394 \end_layout
3395
3396 \begin_layout Quotation
3397 macron (mac)
3398 \begin_inset space \hfill{}
3399 \end_inset
3400
3401  ō
3402 \end_layout
3403
3404 \begin_layout Quotation
3405 tilde (til)
3406 \begin_inset space \hfill{}
3407 \end_inset
3408
3409 ñÑ
3410 \end_layout
3411
3412 \begin_layout Quotation
3413 underbar (underb)
3414 \begin_inset space \hfill{}
3415 \end_inset
3416
3417
3418 \begin_inset ERT
3419 status open
3420
3421 \begin_layout Plain Layout
3422
3423
3424 \backslash
3425 b o
3426 \end_layout
3427
3428 \end_inset
3429
3430
3431 \end_layout
3432
3433 \begin_layout Quotation
3434 cedilla (ced)
3435 \begin_inset space \hfill{}
3436 \end_inset
3437
3438 çÇ
3439 \end_layout
3440
3441 \begin_layout Quotation
3442 underdot (underd)
3443 \begin_inset space \hfill{}
3444 \end_inset
3445
3446
3447 \begin_inset ERT
3448 status open
3449
3450 \begin_layout Plain Layout
3451
3452
3453 \backslash
3454 d o
3455 \end_layout
3456
3457 \end_inset
3458
3459
3460 \end_layout
3461
3462 \begin_layout Quotation
3463 circumflex (circu)
3464 \begin_inset space \hfill{}
3465 \end_inset
3466
3467 âêîôû
3468 \end_layout
3469
3470 \begin_layout Quotation
3471 circle (circl)
3472 \begin_inset space \hfill{}
3473 \end_inset
3474
3475 ÅůŮ
3476 \end_layout
3477
3478 \begin_layout Quotation
3479 tie (tie)
3480 \begin_inset space \hfill{}
3481 \end_inset
3482
3483
3484 \begin_inset ERT
3485 status open
3486
3487 \begin_layout Plain Layout
3488
3489
3490 \backslash
3491 t o
3492 \end_layout
3493
3494 \end_inset
3495
3496
3497 \end_layout
3498
3499 \begin_layout Quotation
3500 breve (bre)
3501 \begin_inset space \hfill{}
3502 \end_inset
3503
3504 ă
3505 \begin_inset ERT
3506 status open
3507
3508 \begin_layout Plain Layout
3509
3510
3511 \backslash
3512 u o
3513 \end_layout
3514
3515 \end_inset
3516
3517
3518 \end_layout
3519
3520 \begin_layout Quotation
3521 caron (car)
3522 \begin_inset space \hfill{}
3523 \end_inset
3524
3525 čšž
3526 \end_layout
3527
3528 \begin_layout Quotation
3529 hungarian umlaut (hug)
3530 \begin_inset space \hfill{}
3531 \end_inset
3532
3533 őű
3534 \end_layout
3535
3536 \begin_layout Quotation
3537 umlaut (uml)
3538 \begin_inset space \hfill{}
3539 \end_inset
3540
3541 äöü
3542 \end_layout
3543
3544 \begin_layout Quotation
3545 dot (dot)
3546 \begin_inset space \hfill{}
3547 \end_inset
3548
3549 ż
3550 \begin_inset ERT
3551 status open
3552
3553 \begin_layout Plain Layout
3554
3555
3556 \backslash
3557 .s
3558 \end_layout
3559
3560 \end_inset
3561
3562
3563 \end_layout
3564
3565 \begin_layout Standard
3566 Since in many international keyboards there are exceptions to what some
3567  dead keys should do, you can define them using
3568 \end_layout
3569
3570 \begin_layout Quotation
3571 \begin_inset Flex CharStyle:Code
3572 status collapsed
3573
3574 \begin_layout Plain Layout
3575
3576 \backslash
3577 kxmod
3578 \end_layout
3579
3580 \end_inset
3581
3582  deadkey key outstring
3583 \end_layout
3584
3585 \begin_layout Standard
3586 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3587 , so you put in
3588 \end_layout
3589
3590 \begin_layout Quotation
3591 \begin_inset Flex CharStyle:Code
3592 status collapsed
3593
3594 \begin_layout Plain Layout
3595
3596 \backslash
3597 kxmod
3598 \end_layout
3599
3600 \end_inset
3601
3602  caron o "
3603 \backslash
3604 ^o"
3605 \end_layout
3606
3607 \begin_layout Standard
3608 to make it work correctly.
3609  Also, you have to define as exceptions dead keys over i and j, to remove
3610  the dot from them before inserting an accent mark.
3611  I will change this when the time comes, but so far I haven't had time.
3612 \end_layout
3613
3614 \begin_layout Standard
3615 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3616  double backslash.
3617  Also, quotes and 
3618 \begin_inset Flex CharStyle:Code
3619 status collapsed
3620
3621 \begin_layout Plain Layout
3622 #
3623 \end_layout
3624
3625 \end_inset
3626
3627  have different meaning.
3628  
3629 \begin_inset Flex CharStyle:Code
3630 status collapsed
3631
3632 \begin_layout Plain Layout
3633 #
3634 \end_layout
3635
3636 \end_inset
3637
3638  marks comments, quotes start and end LaTeX-style commands.
3639  To enter quote, you'll need to use 
3640 \begin_inset Flex CharStyle:Code
3641 status collapsed
3642
3643 \begin_layout Plain Layout
3644
3645 \backslash
3646 "
3647 \end_layout
3648
3649 \end_inset
3650
3651 , to enter 
3652 \begin_inset Flex CharStyle:Code
3653 status collapsed
3654
3655 \begin_layout Plain Layout
3656 #
3657 \end_layout
3658
3659 \end_inset
3660
3661 , use 
3662 \begin_inset Flex CharStyle:Code
3663 status collapsed
3664
3665 \begin_layout Plain Layout
3666
3667 \backslash
3668 #
3669 \end_layout
3670
3671 \end_inset
3672
3673 .
3674 \end_layout
3675
3676 \begin_layout Standard
3677 If you make a keyboard description file that works for your language, please
3678  mail it to me, so I can include it in the next keymap distribution.
3679 \end_layout
3680
3681 \begin_layout Standard
3682 More keywords will be supported in keymap configuration file in future,
3683  like
3684 \end_layout
3685
3686 \begin_layout Itemize
3687 \begin_inset Flex CharStyle:Code
3688 status collapsed
3689
3690 \begin_layout Plain Layout
3691
3692 \backslash
3693 kinclude filename
3694 \end_layout
3695
3696 \end_inset
3697
3698
3699 \emph on
3700
3701 \begin_inset space \hfill{}
3702 \end_inset
3703
3704
3705 \begin_inset Flex CharStyle:Code
3706 status collapsed
3707
3708 \begin_layout Plain Layout
3709 include
3710 \end_layout
3711
3712 \end_inset
3713
3714  another file
3715 \end_layout
3716
3717 \begin_layout Itemize
3718 \begin_inset Flex CharStyle:Code
3719 status collapsed
3720
3721 \begin_layout Plain Layout
3722
3723 \backslash
3724 kprog program
3725 \end_layout
3726
3727 \end_inset
3728
3729
3730 \emph on
3731
3732 \begin_inset space \hfill{}
3733 \end_inset
3734
3735
3736 \begin_inset Flex CharStyle:Code
3737 status collapsed
3738
3739 \begin_layout Plain Layout
3740 define
3741 \end_layout
3742
3743 \end_inset
3744
3745  an external keymap translation program 
3746 \end_layout
3747
3748 \begin_layout Standard
3749 Also, it should look into 
3750 \begin_inset Flex CharStyle:Code
3751 status collapsed
3752
3753 \begin_layout Plain Layout
3754 lyxrc
3755 \end_layout
3756
3757 \end_inset
3758
3759  file for defaults, too (for example, a 
3760 \begin_inset Flex CharStyle:Code
3761 status collapsed
3762
3763 \begin_layout Plain Layout
3764
3765 \backslash
3766 kinclude
3767 \end_layout
3768
3769 \end_inset
3770
3771  option to include default keyboard).
3772 \end_layout
3773
3774 \end_inset
3775
3776
3777 \end_layout
3778
3779 \begin_layout Section
3780 \begin_inset CommandInset label
3781 LatexCommand label
3782 name "sec:keymap"
3783
3784 \end_inset
3785
3786 International Keymap Stuff
3787 \end_layout
3788
3789 \begin_layout Standard
3790 \begin_inset Note Note
3791 status open
3792
3793 \begin_layout Plain Layout
3794 In doing the revisions on this document in March 2008, I did not look over
3795  this stuff, as I do not understand it.
3796  It would be good if someone else could do so.
3797 \end_layout
3798
3799 \end_inset
3800
3801
3802 \end_layout
3803
3804 \begin_layout Standard
3805 The next two sections describe the 
3806 \begin_inset Flex CharStyle:Code
3807 status collapsed
3808
3809 \begin_layout Plain Layout
3810
3811 \shape up
3812 .kmap
3813 \end_layout
3814
3815 \end_inset
3816
3817  and 
3818 \begin_inset Flex CharStyle:Code
3819 status collapsed
3820
3821 \begin_layout Plain Layout
3822
3823 \shape up
3824 .cdef
3825 \end_layout
3826
3827 \end_inset
3828
3829  file syntax in detail.
3830  These sections should help you design your own key map if the ones provided
3831  do not meet your needs.
3832 \end_layout
3833
3834 \begin_layout Subsection
3835 The .kmap File
3836 \end_layout
3837
3838 \begin_layout Standard
3839
3840 \shape up
3841 .
3842 \begin_inset Flex CharStyle:Code
3843 status collapsed
3844
3845 \begin_layout Plain Layout
3846 kmap
3847 \end_layout
3848
3849 \end_inset
3850
3851  file maps keystrokes to characters or strings.
3852  As the name suggests, it sets a keyboard mapping.
3853  The 
3854 \begin_inset Flex CharStyle:Code
3855 status collapsed
3856
3857 \begin_layout Plain Layout
3858 .kmap
3859 \end_layout
3860
3861 \end_inset
3862
3863
3864 \shape default
3865  file keywords 
3866 \shape up
3867
3868 \begin_inset Flex CharStyle:Code
3869 status collapsed
3870
3871 \begin_layout Plain Layout
3872
3873 \shape up
3874 kmap
3875 \end_layout
3876
3877 \end_inset
3878
3879
3880 \shape default
3881 ,
3882 \shape up
3883  
3884 \shape default
3885
3886 \begin_inset Flex CharStyle:Code
3887 status collapsed
3888
3889 \begin_layout Plain Layout
3890
3891 \shape up
3892 kmod
3893 \end_layout
3894
3895 \end_inset
3896
3897 ,
3898 \shape up
3899  
3900 \shape default
3901
3902 \begin_inset Flex CharStyle:Code
3903 status collapsed
3904
3905 \begin_layout Plain Layout
3906
3907 \shape up
3908 ksmod
3909 \end_layout
3910
3911 \end_inset
3912
3913 , and 
3914 \begin_inset Flex CharStyle:Code
3915 status collapsed
3916
3917 \begin_layout Plain Layout
3918
3919 \shape up
3920 kcomb
3921 \end_layout
3922
3923 \end_inset
3924
3925  are described in this section.
3926 \end_layout
3927
3928 \begin_layout Labeling
3929 \labelwidthstring 00.00.0000
3930 \begin_inset Flex CharStyle:Code
3931 status collapsed
3932
3933 \begin_layout Plain Layout
3934
3935 \shape up
3936 kmap
3937 \end_layout
3938
3939 \end_inset
3940
3941  Map a character to a string
3942 \end_layout
3943
3944 \begin_layout LyX-Code
3945
3946 \backslash
3947 kmap 
3948 \family roman
3949 \emph on
3950 char
3951 \family default
3952 \emph default
3953  
3954 \family roman
3955 \emph on
3956 string
3957 \end_layout
3958
3959 \begin_layout Standard
3960 This will ma
3961 \family roman
3962 p
3963 \family default
3964  
3965 \family roman
3966 \emph on
3967 char
3968 \family default
3969 \emph default
3970  
3971 \family roman
3972 to
3973 \family default
3974  
3975 \family roman
3976 \emph on
3977 string
3978 \emph default
3979 .
3980  Note that in
3981 \family default
3982  
3983 \family roman
3984 \emph on
3985 string
3986 \emph default
3987 ,
3988 \family default
3989  
3990 \family roman
3991 \shape up
3992 the double-quote (")
3993 \family default
3994 \shape default
3995  
3996 \family roman
3997 and
3998 \family default
3999  
4000 \family roman
4001 \shape up
4002 the backslash (
4003 \backslash
4004 )
4005 \family default
4006 \shape default
4007  
4008 \family roman
4009 must be escaped with a preceding backslash (
4010 \shape up
4011
4012 \backslash
4013
4014 \shape default
4015 )
4016 \family default
4017 .
4018 \end_layout
4019
4020 \begin_layout Standard
4021 An example of a 
4022 \begin_inset Flex CharStyle:MenuItem
4023 status collapsed
4024
4025 \begin_layout Plain Layout
4026
4027 \shape up
4028 kmap
4029 \end_layout
4030
4031 \end_inset
4032
4033  statement to cause the symbol 
4034 \begin_inset Flex CharStyle:MenuItem
4035 status collapsed
4036
4037 \begin_layout Plain Layout
4038
4039 \shape up
4040 /
4041 \end_layout
4042
4043 \end_inset
4044
4045  to be output for the keystroke 
4046 \begin_inset Flex CharStyle:MenuItem
4047 status collapsed
4048
4049 \begin_layout Plain Layout
4050
4051 \shape up
4052 &
4053 \end_layout
4054
4055 \end_inset
4056
4057  is:
4058 \end_layout
4059
4060 \begin_layout LyX-Code
4061
4062 \backslash
4063 kmap & /
4064 \end_layout
4065
4066 \begin_layout Labeling
4067 \labelwidthstring 00.00.0000
4068 \begin_inset Flex CharStyle:Code
4069 status collapsed
4070
4071 \begin_layout Plain Layout
4072
4073 \shape up
4074 kmod
4075 \end_layout
4076
4077 \end_inset
4078
4079  Specify an accent character
4080 \end_layout
4081
4082 \begin_layout LyX-Code
4083
4084 \backslash
4085 kmod 
4086 \family roman
4087 \emph on
4088 char accent allowed
4089 \end_layout
4090
4091 \begin_layout Standard
4092 This will make the cha
4093 \family roman
4094 racter
4095 \family default
4096  
4097 \family roman
4098 \emph on
4099 char
4100 \family default
4101 \emph default
4102  
4103 \family roman
4104 \shape up
4105 \emph on
4106 be an accent
4107 \family default
4108 \shape default
4109 \emph default
4110  
4111 \family roman
4112 \shape up
4113 on the
4114 \family default
4115 \shape default
4116  
4117 \family roman
4118 \shape up
4119 \emph on
4120 allowed
4121 \family default
4122 \shape default
4123 \emph default
4124  
4125 \family roman
4126 \shape up
4127 cha
4128 \family default
4129 racter(s).
4130  This is the dead key
4131 \begin_inset Foot
4132 status collapsed
4133
4134 \begin_layout Plain Layout
4135 The term 
4136 \family roman
4137 \emph on
4138 dead key
4139 \family default
4140 \emph default
4141  refers to a key that does not produce a character by itself, but when followed
4142  with another key, produces the desired accent character.
4143  For example, a German characte
4144 \family roman
4145 r with an umlaut like
4146 \family default
4147  
4148 \family roman
4149 \emph on
4150 ä
4151 \family default
4152 \emph default
4153  
4154 \family roman
4155 can be produced in this manner.
4156 \end_layout
4157
4158 \end_inset
4159
4160  mechanism.
4161  
4162 \end_layout
4163
4164 \begin_layout Standard
4165 If you 
4166 \family roman
4167 hit
4168 \family default
4169  
4170 \family roman
4171 \emph on
4172 char
4173 \family default
4174 \emph default
4175  
4176 \family roman
4177 and then another key not in
4178 \family default
4179  
4180 \family roman
4181 \emph on
4182 allowed
4183 \emph default
4184 , you will get a
4185 \family default
4186  
4187 \family roman
4188 \emph on
4189 char
4190 \family default
4191 \emph default
4192  
4193 \family roman
4194 followed by the other, unallowed key, as output.
4195
4196 \family default
4197  Note that a 
4198 \begin_inset Flex CharStyle:MenuItem
4199 status collapsed
4200
4201 \begin_layout Plain Layout
4202
4203 \shape up
4204 Backspace
4205 \end_layout
4206
4207 \end_inset
4208
4209  cancels a dead key, so if 
4210 \family roman
4211 you hit
4212 \family default
4213  
4214 \family roman
4215 \emph on
4216 char
4217 \family default
4218 \emph default
4219  
4220 \begin_inset Flex CharStyle:MenuItem
4221 status collapsed
4222
4223 \begin_layout Plain Layout
4224
4225 \shape up
4226 \emph on
4227 Backspace
4228 \end_layout
4229
4230 \end_inset
4231
4232 , the cursor will not go one position backwards but will instead cancel
4233  the effect t
4234 \family roman
4235 hat
4236 \family default
4237  
4238 \family roman
4239 \shape up
4240 \emph on
4241 char
4242 \family default
4243 \shape default
4244 \emph default
4245  
4246 \family roman
4247 \shape up
4248 might have had on the next keystroke.
4249  
4250 \end_layout
4251
4252 \begin_layout Standard
4253 The following example specifies that the character ' is to be an acute accent,
4254  allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4255 \end_layout
4256
4257 \begin_layout LyX-Code
4258
4259 \backslash
4260 kmod ' acute aeiouAEIOU
4261 \end_layout
4262
4263 \begin_layout Labeling
4264 \labelwidthstring 00.00.0000
4265 \begin_inset Flex CharStyle:Code
4266 status collapsed
4267
4268 \begin_layout Plain Layout
4269 ksmod
4270 \end_layout
4271
4272 \end_inset
4273
4274  Specify an exception to the accent character
4275 \end_layout
4276
4277 \begin_layout LyX-Code
4278
4279 \backslash
4280 kxmod  
4281 \family roman
4282 \emph on
4283 accent char result
4284 \end_layout
4285
4286 \begin_layout Standard
4287 This defines an exce
4288 \family roman
4289 ption for
4290 \family default
4291  
4292 \family roman
4293 \emph on
4294 accent
4295 \family default
4296 \emph default
4297  
4298 \family roman
4299 on
4300 \family default
4301  
4302 \family roman
4303 \emph on
4304 char
4305 \emph default
4306 .
4307  T
4308 \shape up
4309 he
4310 \family default
4311 \shape default
4312  
4313 \family roman
4314 \shape up
4315 \emph on
4316 accent
4317 \family default
4318 \shape default
4319 \emph default
4320  
4321 \family roman
4322 \shape up
4323 must
4324 \family default
4325 \shape default
4326  
4327 \shape up
4328 have been assigned a keystroke with a previous
4329 \shape default
4330  
4331 \begin_inset Flex CharStyle:Code
4332 status collapsed
4333
4334 \begin_layout Plain Layout
4335
4336 \shape up
4337
4338 \backslash
4339 kmo
4340 \shape default
4341 d
4342 \end_layout
4343
4344 \end_inset
4345
4346  declar
4347 \family roman
4348 ation and
4349 \family default
4350  
4351 \family roman
4352 \emph on
4353 char
4354 \family default
4355 \emph default
4356  
4357 \family roman
4358 must not belong in the
4359 \family default
4360  
4361 \family roman
4362 \emph on
4363 allowed
4364 \family default
4365 \emph default
4366  
4367 \family roman
4368 set of
4369 \family default
4370  
4371 \family roman
4372 \emph on
4373 accent
4374 \emph default
4375 .
4376  When
4377 \family default
4378  
4379 \family roman
4380 \shape up
4381 you enter the
4382 \family default
4383 \shape default
4384  
4385 \family roman
4386 \shape up
4387 \emph on
4388 accent char
4389 \family default
4390 \shape default
4391 \emph default
4392  
4393 \family roman
4394 \shape up
4395 sequence,
4396 \family default
4397 \shape default
4398  
4399 \family roman
4400 \shape up
4401 \emph on
4402 result
4403 \emph default
4404  is produced.
4405  If such a declaration does not exist in
4406 \family default
4407 \shape default
4408  
4409 \shape up
4410 the
4411 \shape default
4412  
4413 \begin_inset Flex CharStyle:Code
4414 status collapsed
4415
4416 \begin_layout Plain Layout
4417
4418 \shape up
4419 .kmap
4420 \end_layout
4421
4422 \end_inset
4423
4424  file and yo
4425 \family roman
4426 u enter
4427 \family default
4428  
4429 \family roman
4430 \emph on
4431 accent char
4432 \emph default
4433 , you get
4434 \family default
4435  
4436 \family roman
4437 \emph on
4438 accent_key char
4439 \emph default
4440  where
4441 \family default
4442  
4443 \family roman
4444 \emph on
4445 accent_key
4446 \emph default
4447  is the first arg
4448 \family default
4449 ument of the 
4450 \begin_inset Flex CharStyle:Code
4451 status collapsed
4452
4453 \begin_layout Plain Layout
4454
4455 \shape up
4456
4457 \backslash
4458 kmod
4459 \end_layout
4460
4461 \end_inset
4462
4463  declaration.
4464  
4465 \end_layout
4466
4467 \begin_layout Standard
4468 The following command produces causes äi to be produced when you enter acute-i
4469  ('i):
4470 \end_layout
4471
4472 \begin_layout LyX-Code
4473
4474 \backslash
4475 kxmod acute i "
4476 \backslash
4477
4478 \backslash
4479 '{
4480 \backslash
4481
4482 \backslash
4483 i}"
4484 \end_layout
4485
4486 \begin_layout Labeling
4487 \labelwidthstring 00.00.0000
4488 \begin_inset Flex CharStyle:Code
4489 status collapsed
4490
4491 \begin_layout Plain Layout
4492 kcomb
4493 \end_layout
4494
4495 \end_inset
4496
4497  Combine two accent characters
4498 \end_layout
4499
4500 \begin_layout LyX-Code
4501
4502 \backslash
4503 kcomb 
4504 \family roman
4505 \emph on
4506 accent1 accent2 allowed
4507 \end_layout
4508
4509 \begin_layout Standard
4510 This one is getting pretty esoteric.
4511  It allows you to combine the effect 
4512 \family roman
4513 of
4514 \family default
4515  
4516 \family roman
4517 \emph on
4518 accent1
4519 \family default
4520 \emph default
4521  
4522 \family roman
4523 and
4524 \family default
4525  
4526 \family roman
4527 \emph on
4528 accent2
4529 \family default
4530 \emph default
4531  
4532 \family roman
4533 (in that order!) on
4534 \family default
4535  
4536 \family roman
4537 \emph on
4538 allowed
4539 \family default
4540 \emph default
4541  
4542 \family roman
4543 chars.
4544  The keystrokes for
4545 \family default
4546  
4547 \family roman
4548 \emph on
4549 accent1
4550 \family default
4551 \emph default
4552  
4553 \family roman
4554 and
4555 \family default
4556  
4557 \family roman
4558 \emph on
4559 accent2
4560 \family default
4561 \emph default
4562  
4563 \family roman
4564 must have be
4565 \family default
4566 en set with a 
4567 \begin_inset Flex CharStyle:Code
4568 status collapsed
4569
4570 \begin_layout Plain Layout
4571
4572 \shape up
4573
4574 \backslash
4575 kmod
4576 \end_layout
4577
4578 \end_inset
4579
4580  command at 
4581 \family roman
4582 a
4583 \family default
4584  
4585 \family roman
4586 \emph on
4587 previous
4588 \family default
4589 \emph default
4590  
4591 \family roman
4592 point in the
4593 \family default
4594  file.
4595  
4596 \end_layout
4597
4598 \begin_layout Standard
4599 Consider this example from the 
4600 \begin_inset Flex CharStyle:Code
4601 status collapsed
4602
4603 \begin_layout Plain Layout
4604
4605 \shape up
4606 greek.kmap
4607 \end_layout
4608
4609 \end_inset
4610
4611  file:
4612 \end_layout
4613
4614 \begin_layout LyX-Code
4615
4616 \backslash
4617 kmod ; acute aeioyvhAEIOYVH 
4618 \backslash
4619 kmod : umlaut iyIY 
4620 \backslash
4621 kcomb acute umlaut iyIY
4622 \end_layout
4623
4624 \begin_layout Standard
4625 This allows you to press 
4626 \begin_inset Flex CharStyle:MenuItem
4627 status collapsed
4628
4629 \begin_layout Plain Layout
4630
4631 \shape up
4632 ;:i
4633 \end_layout
4634
4635 \end_inset
4636
4637  and get the effect of 
4638 \begin_inset Flex CharStyle:Code
4639 status collapsed
4640
4641 \begin_layout Plain Layout
4642
4643 \shape up
4644
4645 \backslash
4646 '{
4647 \backslash
4648 "{i}}
4649 \end_layout
4650
4651 \end_inset
4652
4653 .
4654  
4655 \family roman
4656 \shape up
4657 A backspace
4658 \family default
4659 \shape default
4660  in this case cancels the last dead key, so if you press 
4661 \begin_inset Flex CharStyle:MenuItem
4662 status collapsed
4663
4664 \begin_layout Plain Layout
4665
4666 \shape up
4667 ;: Backspace i
4668 \end_layout
4669
4670 \end_inset
4671
4672  you get 
4673 \begin_inset Flex CharStyle:Code
4674 status collapsed
4675
4676 \begin_layout Plain Layout
4677
4678 \shape up
4679
4680 \backslash
4681 '{i}
4682 \end_layout
4683
4684 \end_inset
4685
4686 .
4687 \end_layout
4688
4689 \begin_layout Subsection
4690 The .cdef File
4691 \end_layout
4692
4693 \begin_layout Standard
4694 After the 
4695 \begin_inset Flex CharStyle:Code
4696 status collapsed
4697
4698 \begin_layout Plain Layout
4699
4700 \shape up
4701 .kmap
4702 \end_layout
4703
4704 \end_inset
4705
4706  mapping is performed, a 
4707 \begin_inset Flex CharStyle:Code
4708 status collapsed
4709
4710 \begin_layout Plain Layout
4711
4712 \shape up
4713 .cde
4714 \shape default
4715 f
4716 \end_layout
4717
4718 \end_inset
4719
4720  file maps the strings that the symbols generate to characters in the current
4721  font.
4722  The LyX distribution currently includes at least the 
4723 \begin_inset Flex CharStyle:Code
4724 status collapsed
4725
4726 \begin_layout Plain Layout
4727
4728 \shape up
4729 iso8859-1.cdef
4730 \end_layout
4731
4732 \end_inset
4733
4734  and 
4735 \begin_inset Flex CharStyle:Code
4736 status collapsed
4737
4738 \begin_layout Plain Layout
4739
4740 \shape up
4741 iso8859-2.cdef
4742 \end_layout
4743
4744 \end_inset
4745
4746  files.
4747 \end_layout
4748
4749 \begin_layout Standard
4750 In general the 
4751 \begin_inset Flex CharStyle:Code
4752 status collapsed
4753
4754 \begin_layout Plain Layout
4755
4756 \shape up
4757 .cdef
4758 \end_layout
4759
4760 \end_inset
4761
4762  file is a sequence of declarations of the form
4763 \end_layout
4764
4765 \begin_layout LyX-Code
4766
4767 \family roman
4768 \emph on
4769 char_index_in_set
4770 \family default
4771 \emph default
4772  
4773 \family roman
4774 \emph on
4775  string
4776 \end_layout
4777
4778 \begin_layout Standard
4779 For example, in order to map 
4780 \begin_inset Flex CharStyle:MenuItem
4781 status collapsed
4782
4783 \begin_layout Plain Layout
4784
4785 \shape up
4786
4787 \backslash
4788 '{e}
4789 \end_layout
4790
4791 \end_inset
4792
4793  to the corresponding character in the iso-8859-1 set (233), the following
4794  declaration is used
4795 \end_layout
4796
4797 \begin_layout LyX-Code
4798 233 "
4799 \backslash
4800
4801 \backslash
4802 '{e}"
4803 \end_layout
4804
4805 \begin_layout Standard
4806 with 
4807 \begin_inset Flex CharStyle:Code
4808 status collapsed
4809
4810 \begin_layout Plain Layout
4811
4812 \backslash
4813
4814 \end_layout
4815
4816 \end_inset
4817
4818  and 
4819 \begin_inset Flex CharStyle:Code
4820 status collapsed
4821
4822 \begin_layout Plain Layout
4823 "
4824 \end_layout
4825
4826 \end_inset
4827
4828  being escap
4829 \family roman
4830 ed in
4831 \family default
4832  
4833 \family roman
4834 \emph on
4835 string
4836 \emph default
4837 .
4838  Note that
4839 \family default
4840  the same character can apply to more than one string.
4841  In the 
4842 \begin_inset Flex CharStyle:Code
4843 status collapsed
4844
4845 \begin_layout Plain Layout
4846 i
4847 \shape up
4848 so-8859-7.cdef
4849 \end_layout
4850
4851 \end_inset
4852
4853  file you have
4854 \end_layout
4855
4856 \begin_layout LyX-Code
4857 192 "
4858 \backslash
4859
4860 \backslash
4861 '{
4862 \backslash
4863
4864 \backslash
4865
4866 \backslash
4867 "{i}}"
4868 \begin_inset Newline newline
4869 \end_inset
4870
4871 192 "
4872 \backslash
4873
4874 \backslash
4875
4876 \backslash
4877 "{
4878 \backslash
4879
4880 \backslash
4881 '{i}}"
4882 \end_layout
4883
4884 \begin_layout Standard
4885 If LyX cannot find a mapping for the string produced by the keystroke or
4886  a deadkey sequence, it will check if it looks like an accented char and
4887  try to draw an accent over the character on screen.
4888 \end_layout
4889
4890 \begin_layout Subsection
4891 Dead Keys
4892 \end_layout
4893
4894 \begin_layout Standard
4895 There is a second way to add support for international characters through
4896  so-called dead-keys.
4897  A dead-key works in combination with a letter to produce an accented character.
4898  Here, we'll explain how to create a really simple dead-key to illustrate
4899  how they work.
4900 \end_layout
4901
4902 \begin_layout Standard
4903 Suppose you happen to need the circumflex character, 
4904 \begin_inset Quotes eld
4905 \end_inset
4906
4907  ̂
4908 \begin_inset Quotes erd
4909 \end_inset
4910
4911 .
4912  You could bind the 
4913 \begin_inset Flex CharStyle:MenuItem
4914 status collapsed
4915
4916 \begin_layout Plain Layout
4917 ^
4918 \end_layout
4919
4920 \end_inset
4921
4922 -key [a.k.a.
4923 \begin_inset space ~
4924 \end_inset
4925
4926
4927 \begin_inset Flex CharStyle:MenuItem
4928 status collapsed
4929
4930 \begin_layout Plain Layout
4931 Shift-6
4932 \end_layout
4933
4934 \end_inset
4935
4936 ] to the LyX command 
4937 \begin_inset Flex CharStyle:Code
4938 status collapsed
4939
4940 \begin_layout Plain Layout
4941 accent-circumflex
4942 \end_layout
4943
4944 \end_inset
4945
4946  in your 
4947 \begin_inset Flex CharStyle:Code
4948 status collapsed
4949
4950 \begin_layout Plain Layout
4951 lyxrc
4952 \end_layout
4953
4954 \end_inset
4955
4956  file.
4957  Now, whenever you type the 
4958 \begin_inset Flex CharStyle:MenuItem
4959 status collapsed
4960
4961 \begin_layout Plain Layout
4962 ^
4963 \end_layout
4964
4965 \end_inset
4966
4967 -key followed by a letter, that letter will have a circumflex accent on
4968  it.
4969  For example, the sequence 
4970 \begin_inset Quotes eld
4971 \end_inset
4972
4973
4974 \begin_inset Flex CharStyle:MenuItem
4975 status collapsed
4976
4977 \begin_layout Plain Layout
4978 ^e
4979 \end_layout
4980
4981 \end_inset
4982
4983
4984 \begin_inset Quotes erd
4985 \end_inset
4986
4987  produces the letter: 
4988 \begin_inset Quotes eld
4989 \end_inset
4990
4991 ê
4992 \begin_inset Quotes erd
4993 \end_inset
4994
4995 .
4996  If you tried to type 
4997 \begin_inset Quotes eld
4998 \end_inset
4999
5000
5001 \begin_inset Flex CharStyle:MenuItem
5002 status collapsed
5003
5004 \begin_layout Plain Layout
5005 ^t
5006 \end_layout
5007
5008 \end_inset
5009
5010
5011 \begin_inset Quotes erd
5012 \end_inset
5013
5014 , however, LyX will complain with a beep, since a 
5015 \begin_inset Quotes eld
5016 \end_inset
5017
5018
5019 \begin_inset Flex CharStyle:MenuItem
5020 status collapsed
5021
5022 \begin_layout Plain Layout
5023 t
5024 \end_layout
5025
5026 \end_inset
5027
5028
5029 \begin_inset Quotes erd
5030 \end_inset
5031
5032  never takes a circumflex accent.
5033  Hitting 
5034 \begin_inset Flex CharStyle:MenuItem
5035 status collapsed
5036
5037 \begin_layout Plain Layout
5038 Space
5039 \end_layout
5040
5041 \end_inset
5042
5043  after a dead-key produces the bare-accent.
5044  Please note this last point! If you bind a key to a dead-key, you'll need
5045  to rebind the character on that key to yet another key.
5046  Binding the 
5047 \begin_inset Flex CharStyle:MenuItem
5048 status collapsed
5049
5050 \begin_layout Plain Layout
5051 ,-key
5052 \end_layout
5053
5054 \end_inset
5055
5056  to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5057 \end_layout
5058
5059 \begin_layout Standard
5060 One common way to bind dead-keys is to use 
5061 \begin_inset Flex CharStyle:MenuItem
5062 status collapsed
5063
5064 \begin_layout Plain Layout
5065 Meta-
5066 \end_layout
5067
5068 \end_inset
5069
5070
5071 \begin_inset Flex CharStyle:MenuItem
5072 status collapsed
5073
5074 \begin_layout Plain Layout
5075 Ctrl-
5076 \end_layout
5077
5078 \end_inset
5079
5080 , and 
5081 \begin_inset Flex CharStyle:MenuItem
5082 status collapsed
5083
5084 \begin_layout Plain Layout
5085 Shift-
5086 \end_layout
5087
5088 \end_inset
5089
5090  in combination with an accent, like 
5091 \begin_inset Quotes eld
5092 \end_inset
5093
5094
5095 \begin_inset Flex CharStyle:MenuItem
5096 status collapsed
5097
5098 \begin_layout Plain Layout
5099 ~
5100 \end_layout
5101
5102 \end_inset
5103
5104
5105 \begin_inset Quotes erd
5106 \end_inset
5107
5108  or 
5109 \begin_inset Quotes eld
5110 \end_inset
5111
5112
5113 \begin_inset Flex CharStyle:MenuItem
5114 status collapsed
5115
5116 \begin_layout Plain Layout
5117 ,
5118 \end_layout
5119
5120 \end_inset
5121
5122
5123 \begin_inset Quotes erd
5124 \end_inset
5125
5126  or 
5127 \begin_inset Quotes eld
5128 \end_inset
5129
5130
5131 \begin_inset Flex CharStyle:MenuItem
5132 status collapsed
5133
5134 \begin_layout Plain Layout
5135 ^
5136 \end_layout
5137
5138 \end_inset
5139
5140
5141 \begin_inset Quotes erd
5142 \end_inset
5143
5144 .
5145  Another way involves using 
5146 \begin_inset Flex CharStyle:Code
5147 status collapsed
5148
5149 \begin_layout Plain Layout
5150 xmodmap
5151 \end_layout
5152
5153 \end_inset
5154
5155  and 
5156 \begin_inset Flex CharStyle:Code
5157 status collapsed
5158
5159 \begin_layout Plain Layout
5160 xkeycaps
5161 \end_layout
5162
5163 \end_inset
5164
5165  to set up the special 
5166 \begin_inset Flex CharStyle:Code
5167 status collapsed
5168
5169 \begin_layout Plain Layout
5170 Mode_Switch
5171 \end_layout
5172
5173 \end_inset
5174
5175  key.
5176  The 
5177 \begin_inset Flex CharStyle:Code
5178 status collapsed
5179
5180 \begin_layout Plain Layout
5181 Mode_Switch
5182 \end_layout
5183
5184 \end_inset
5185
5186  acts in some ways just like 
5187 \begin_inset Flex CharStyle:MenuItem
5188 status collapsed
5189
5190 \begin_layout Plain Layout
5191 Shift
5192 \end_layout
5193
5194 \end_inset
5195
5196  and permits you to bind keys to accented characters.
5197  You can also turn keys into dead-keys by binding them to something like
5198  
5199 \begin_inset Flex CharStyle:Code
5200 status collapsed
5201
5202 \begin_layout Plain Layout
5203 usldead_cedilla
5204 \end_layout
5205
5206 \end_inset
5207
5208  and then binding this symbolic key to the corresponding LyX command.
5209 \begin_inset Foot
5210 status collapsed
5211
5212 \begin_layout Plain Layout
5213 Note from 
5214 \noun on
5215 John Weiss
5216 \noun default
5217 : This is exactly what I do in my 
5218 \begin_inset Flex CharStyle:Code
5219 status collapsed
5220
5221 \begin_layout Plain Layout
5222 ~/.lyx/lyxrc
5223 \end_layout
5224
5225 \end_inset
5226
5227  and my 
5228 \begin_inset Flex CharStyle:Code
5229 status collapsed
5230
5231 \begin_layout Plain Layout
5232 ~/.xmodmap
5233 \end_layout
5234
5235 \end_inset
5236
5237  files.
5238  I have my 
5239 \begin_inset Flex CharStyle:MenuItem
5240 status collapsed
5241
5242 \begin_layout Plain Layout
5243 Scroll
5244 \begin_inset space ~
5245 \end_inset
5246
5247 Lock
5248 \end_layout
5249
5250 \end_inset
5251
5252  key set up as 
5253 \begin_inset Flex CharStyle:Code
5254 status collapsed
5255
5256 \begin_layout Plain Layout
5257 Mode_Shift
5258 \end_layout
5259
5260 \end_inset
5261
5262  and a bunch of these 
5263 \begin_inset Quotes eld
5264 \end_inset
5265
5266
5267 \begin_inset Flex CharStyle:Code
5268 status collapsed
5269
5270 \begin_layout Plain Layout
5271 usldead_*
5272 \end_layout
5273
5274 \end_inset
5275
5276
5277 \begin_inset Quotes erd
5278 \end_inset
5279
5280  symbolic keys bound such things as 
5281 \begin_inset Flex CharStyle:MenuItem
5282 status collapsed
5283
5284 \begin_layout Plain Layout
5285 Scroll
5286 \begin_inset space ~
5287 \end_inset
5288
5289 Lock-^
5290 \end_layout
5291
5292 \end_inset
5293
5294  and 
5295 \begin_inset Flex CharStyle:MenuItem
5296 status collapsed
5297
5298 \begin_layout Plain Layout
5299 Scroll
5300 \begin_inset space ~
5301 \end_inset
5302
5303 Lock-~
5304 \end_layout
5305
5306 \end_inset
5307
5308 .
5309  This is how I produce my accented characters.
5310 \end_layout
5311
5312 \end_inset
5313
5314  You can make just about anything into the 
5315 \begin_inset Flex CharStyle:Code
5316 status collapsed
5317
5318 \begin_layout Plain Layout
5319 Mode_Switch
5320 \end_layout
5321
5322 \end_inset
5323
5324  key: One of the 
5325 \begin_inset Flex CharStyle:MenuItem
5326 status collapsed
5327
5328 \begin_layout Plain Layout
5329 Ctrl-
5330 \end_layout
5331
5332 \end_inset
5333
5334  keys, a spare function key, etc.
5335  As for the LyX commands that produce accents, check the entry for 
5336 \begin_inset Flex CharStyle:Code
5337 status collapsed
5338
5339 \begin_layout Plain Layout
5340 accent-acute
5341 \end_layout
5342
5343 \end_inset
5344
5345  in the 
5346 \emph on
5347 Reference Manual
5348 \emph default
5349 .
5350  You'll find the complete list there.
5351 \end_layout
5352
5353 \begin_layout Subsection
5354 Saving your Language Configuration
5355 \end_layout
5356
5357 \begin_layout Standard
5358 You can edit your preferences so that your desired language environment
5359  is automatically configured when LyX starts up, via the 
5360 \begin_inset Flex CharStyle:MenuItem
5361 status collapsed
5362
5363 \begin_layout Plain Layout
5364 Edit\SpecialChar \menuseparator
5365 Preferences
5366 \end_layout
5367
5368 \end_inset
5369
5370  dialog.
5371 \end_layout
5372
5373 \begin_layout Chapter
5374 Installing New Document Classes, Layouts, and Templates 
5375 \begin_inset CommandInset label
5376 LatexCommand label
5377 name "chap:textclass"
5378
5379 \end_inset
5380
5381
5382 \begin_inset OptArg
5383 status collapsed
5384
5385 \begin_layout Plain Layout
5386 Installing New Document Classes
5387 \end_layout
5388
5389 \end_inset
5390
5391
5392 \end_layout
5393
5394 \begin_layout Standard
5395 In this chapter, we describe the procedures for creating and installing
5396  new LyX layout and template files, as well as offer a refresher on correctly
5397  installing new LaTeX document classes.
5398  Some definitions: a document class is a LaTeX file (usually ending in 
5399 \begin_inset Flex CharStyle:Code
5400 status collapsed
5401
5402 \begin_layout Plain Layout
5403 .cls
5404 \end_layout
5405
5406 \end_inset
5407
5408  or 
5409 \begin_inset Flex CharStyle:Code
5410 status collapsed
5411
5412 \begin_layout Plain Layout
5413 .sty
5414 \end_layout
5415
5416 \end_inset
5417
5418 ) that describes the format of a document such as an article, report, journal
5419  preprint, etc, and all the commands needed to realize that format.
5420  A layout file is a LyX file that corresponds to a LaTeX document class
5421  and that tells LyX how to 
5422 \begin_inset Quotes eld
5423 \end_inset
5424
5425 draw
5426 \begin_inset Quotes erd
5427 \end_inset
5428
5429  things on the screen to make the display look something like the final
5430  printed page.
5431  More precisely, a layout file describes a 
5432 \begin_inset Quotes eld
5433 \end_inset
5434
5435 text class
5436 \begin_inset Quotes erd
5437 \end_inset
5438
5439  which is the internal construct LyX uses to render the screen display.
5440  
5441 \begin_inset Quotes eld
5442 \end_inset
5443
5444 Layout
5445 \begin_inset Quotes erd
5446 \end_inset
5447
5448  and 
5449 \begin_inset Quotes eld
5450 \end_inset
5451
5452 text class
5453 \begin_inset Quotes erd
5454 \end_inset
5455
5456  can be used somewhat interchangeably, but it is better to refer to the
5457  file as the layout, and the thing living in LyX's memory as the text class.
5458  A template file is simply a LyX document that contains a set of predefined
5459  entries for a given document class---entries that are generally required
5460  for that class.
5461  Templates are especially useful for things like journal manuscripts that
5462  are to be submitted electronically.
5463 \end_layout
5464
5465 \begin_layout Section
5466 Installing a new LaTeX package
5467 \end_layout
5468
5469 \begin_layout Standard
5470 Some installations may not include a LaTeX package that you would like to
5471  use within LyX.
5472  For example, you might need FoilTeX, a package for preparing slides or
5473  viewgraphs for overhead projectors.
5474  Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5475  a user interface for that.
5476  For example on MiKTeX you start its program 
5477 \begin_inset Quotes eld
5478 \end_inset
5479
5480 Browse Packages
5481 \begin_inset Quotes erd
5482 \end_inset
5483
5484  to get a list of available packages.
5485  To install one, right click on it or use the installing toolbar button.
5486  When the package you want to install is not in the list, but you have it
5487  in form of a 
5488 \begin_inset Flex CharStyle:Code
5489 status collapsed
5490
5491 \begin_layout Plain Layout
5492 .cls
5493 \end_layout
5494
5495 \end_inset
5496
5497  or 
5498 \begin_inset Flex CharStyle:Code
5499 status collapsed
5500
5501 \begin_layout Plain Layout
5502 .sty
5503 \end_layout
5504
5505 \end_inset
5506
5507 -file, then copy these files to a subfolder of your LaTeX distribution,
5508  for example to the folder 
5509 \family sans
5510 ~
5511 \backslash
5512 tex
5513 \backslash
5514 latex
5515 \family default
5516 .
5517  Then update the file name database of your LaTeX-distribution.
5518  For example on MiKTeX this is done by pressing the button 
5519 \family sans
5520 Refresh
5521 \begin_inset space ~
5522 \end_inset
5523
5524 FNDB
5525 \family default
5526  that you find in MiKTeX's 
5527 \begin_inset Quotes eld
5528 \end_inset
5529
5530 Settings
5531 \begin_inset Quotes erd
5532 \end_inset
5533
5534  program.
5535  In both cases you need afterwards to reconfigure LyX using the menu 
5536 \begin_inset Flex CharStyle:MenuItem
5537 status collapsed
5538
5539 \begin_layout Plain Layout
5540 Tools\SpecialChar \menuseparator
5541 Reconfigure
5542 \end_layout
5543
5544 \end_inset
5545
5546  and then to restart LyX.
5547 \end_layout
5548
5549 \begin_layout Standard
5550 If your LaTeX distribution doesn't provide a user interface, then you can
5551  follow these steps by using a UNIX/Linux console.
5552 \end_layout
5553
5554 \begin_layout Enumerate
5555 Get the package from 
5556 \begin_inset CommandInset href
5557 LatexCommand href
5558 name "CTAN"
5559 target "http://www.ctan.org/"
5560
5561 \end_inset
5562
5563  or wherever.
5564 \end_layout
5565
5566 \begin_layout Enumerate
5567 You can install this package in several different places.
5568  If you want it to be available for all users on your system, then you should
5569  install it in your `local' TeX tree; if you want (or need) it to be available
5570  just for you, then you can install it in your own `user' TeX tree.
5571  Where these should be created, if they do not already exist, depends upon
5572  the details of your system.
5573  To find out, look in the file 
5574 \begin_inset Flex CharStyle:Code
5575 status collapsed
5576
5577 \begin_layout Plain Layout
5578 texmf.cnf
5579 \end_layout
5580
5581 \end_inset
5582
5583 .
5584 \begin_inset Foot
5585 status collapsed
5586
5587 \begin_layout Plain Layout
5588 This usually lives in the directory 
5589 \begin_inset Flex CharStyle:Code
5590 status collapsed
5591
5592 \begin_layout Plain Layout
5593 $TEXMF/web2c
5594 \end_layout
5595
5596 \end_inset
5597
5598 , though you can run 
5599 \begin_inset Flex CharStyle:Code
5600 status collapsed
5601
5602 \begin_layout Plain Layout
5603 kpsewhich texmf.cnf
5604 \end_layout
5605
5606 \end_inset
5607
5608  to locate it.
5609 \end_layout
5610
5611 \end_inset
5612
5613  The location of the `local' TeX tree is defined by 
5614 \begin_inset Flex CharStyle:Code
5615 status collapsed
5616
5617 \begin_layout Plain Layout
5618 TEXMFLOCAL
5619 \end_layout
5620
5621 \end_inset
5622
5623 ; this is usually somewhere like 
5624 \begin_inset Flex CharStyle:Code
5625 status collapsed
5626
5627 \begin_layout Plain Layout
5628 /usr/local/share/texmf/
5629 \end_layout
5630
5631 \end_inset
5632
5633 .
5634  The `user' TeX tree is defined by 
5635 \begin_inset Flex CharStyle:Code
5636 status collapsed
5637
5638 \begin_layout Plain Layout
5639 TEXMFHOME
5640 \end_layout
5641
5642 \end_inset
5643
5644  and is commonly at 
5645 \begin_inset Flex CharStyle:Code
5646 status collapsed
5647
5648 \begin_layout Plain Layout
5649 $HOME/texmf/
5650 \end_layout
5651
5652 \end_inset
5653
5654 .
5655  (If these variables are not predefined, you can define them.) You'll probably
5656  need root permissions to create or modify the `local' tree; but your `user'
5657  tree shouldn't have such limitations.
5658 \end_layout
5659
5660 \begin_layout Enumerate
5661 Make sure 
5662 \begin_inset Flex CharStyle:Code
5663 status collapsed
5664
5665 \begin_layout Plain Layout
5666 TEXMF
5667 \end_layout
5668
5669 \end_inset
5670
5671  includes the 
5672 \begin_inset Flex CharStyle:Code
5673 status collapsed
5674
5675 \begin_layout Plain Layout
5676 TEXMFLOCAL
5677 \end_layout
5678
5679 \end_inset
5680
5681  and 
5682 \begin_inset Flex CharStyle:Code
5683 status collapsed
5684
5685 \begin_layout Plain Layout
5686 TEXMFHOME
5687 \end_layout
5688
5689 \end_inset
5690
5691  variables; e.
5692 \begin_inset space \thinspace{}
5693 \end_inset
5694
5695 g.
5696 \begin_inset Newline newline
5697 \end_inset
5698
5699
5700 \begin_inset Flex CharStyle:Code
5701 status collapsed
5702
5703 \begin_layout Plain Layout
5704 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5705 \end_layout
5706
5707 \end_inset
5708
5709
5710 \begin_inset Newline newline
5711 \end_inset
5712
5713 But, again, most of this will 
5714 \begin_inset Quotes eld
5715 \end_inset
5716
5717 just work
5718 \begin_inset Quotes erd
5719 \end_inset
5720
5721 .
5722 \end_layout
5723
5724 \begin_layout Enumerate
5725 Create your local
5726 \begin_inset Foot
5727 status collapsed
5728
5729 \begin_layout Plain Layout
5730 We'll assume henceforth that you're defining `local' TeX tree.
5731  If you're defining a user tree, just adjust as necessary.
5732 \end_layout
5733
5734 \end_inset
5735
5736  TeX tree.
5737  You must follow the directory structure of your existing 
5738 \begin_inset Flex CharStyle:Code
5739 status collapsed
5740
5741 \begin_layout Plain Layout
5742 texmf
5743 \end_layout
5744
5745 \end_inset
5746
5747  directory, which will be found at 
5748 \begin_inset Flex CharStyle:Code
5749 status collapsed
5750
5751 \begin_layout Plain Layout
5752 TEXMFMAIN
5753 \end_layout
5754
5755 \end_inset
5756
5757 .
5758  For example, latex packages should go under 
5759 \begin_inset Flex CharStyle:Code
5760 status collapsed
5761
5762 \begin_layout Plain Layout
5763 $TEXMFLOCAL/tex/latex/
5764 \end_layout
5765
5766 \end_inset
5767
5768 .
5769 \end_layout
5770
5771 \begin_layout Enumerate
5772 Install the package.
5773  For example, you would unpack the FoilTeX tarball and copy it to 
5774 \begin_inset Flex CharStyle:Code
5775 status collapsed
5776
5777 \begin_layout Plain Layout
5778 $TEXMFLOCAL/tex/latex/foiltex
5779 \end_layout
5780
5781 \end_inset
5782
5783 .
5784  The 
5785 \begin_inset Flex CharStyle:Code
5786 status collapsed
5787
5788 \begin_layout Plain Layout
5789 foiltex
5790 \end_layout
5791
5792 \end_inset
5793
5794  directory contains various files.
5795 \end_layout
5796
5797 \begin_layout Enumerate
5798 Run: 
5799 \begin_inset Flex CharStyle:Code
5800 status collapsed
5801
5802 \begin_layout Plain Layout
5803 texhash
5804 \end_layout
5805
5806 \end_inset
5807
5808 .
5809  This should create 
5810 \begin_inset Flex CharStyle:Code
5811 status collapsed
5812
5813 \begin_layout Plain Layout
5814 $TEXMFLOCAL/ls-R
5815 \end_layout
5816
5817 \end_inset
5818
5819  amongst others.
5820 \end_layout
5821
5822 \begin_layout Standard
5823 Your package is now installed and available to LaTeX.
5824  To make it available to LyX, you need to create a Layout file, if one is
5825  not already available.
5826  (See the next section.) Once you have a layout file, you need only reconfigure
5827  (
5828 \begin_inset Flex CharStyle:MenuItem
5829 status collapsed
5830
5831 \begin_layout Plain Layout
5832 Tools\SpecialChar \menuseparator
5833 Reconfigure
5834 \end_layout
5835
5836 \end_inset
5837
5838 ) and then restart LyX.
5839  You should then see your new package---for example 
5840 \begin_inset Flex CharStyle:MenuItem
5841 status collapsed
5842
5843 \begin_layout Plain Layout
5844 slides (FoilTeX)
5845 \end_layout
5846
5847 \end_inset
5848
5849 ---under 
5850 \begin_inset Flex CharStyle:MenuItem
5851 status collapsed
5852
5853 \begin_layout Plain Layout
5854 Document\SpecialChar \menuseparator
5855 Settings
5856 \end_layout
5857
5858 \end_inset
5859
5860  in the 
5861 \begin_inset Flex CharStyle:MenuItem
5862 status collapsed
5863
5864 \begin_layout Plain Layout
5865 Document Class
5866 \end_layout
5867
5868 \end_inset
5869
5870  drop box.
5871  
5872 \end_layout
5873
5874 \begin_layout Section
5875 Layouts
5876 \end_layout
5877
5878 \begin_layout Standard
5879 This section describes how to write and install your own LyX layout files
5880  and walks through the 
5881 \begin_inset Flex CharStyle:Code
5882 status collapsed
5883
5884 \begin_layout Plain Layout
5885 article
5886 \end_layout
5887
5888 \end_inset
5889
5890  text class format as an example.
5891  The 
5892 \begin_inset Flex CharStyle:Code
5893 status collapsed
5894
5895 \begin_layout Plain Layout
5896 .layout
5897 \end_layout
5898
5899 \end_inset
5900
5901  files describe what paragraph and character styles are available for a
5902  given document class and how LyX should display them.
5903  We try to provide a thorough description of the process here; however,
5904  there are so many different types of documents supported by LaTeX classes
5905  that we can't hope to cover every different possibility or problem you
5906  might encounter.
5907  (The LyX users' list is frequented by people with lots of experience with
5908  layout design who are willing to share what they've learned.)
5909 \end_layout
5910
5911 \begin_layout Standard
5912 As you prepare to write a new layout, it is extremely helpful to look at
5913  the example layouts distributed with LyX.
5914  If you use a nice LaTeX document class that might be of interest for others,
5915  too, and have a nice corresponding LyX layout, feel free to contribute
5916  the stuff to us, so we may put it into the distribution.
5917  There is also a 
5918 \begin_inset CommandInset href
5919 LatexCommand href
5920 name "section on the LyX wiki"
5921 target "http://wiki.lyx.org/Layouts/Layouts"
5922
5923 \end_inset
5924
5925  for this kind of material.
5926 \end_layout
5927
5928 \begin_layout Standard
5929 All the tags described in this chapter are case-insensitive; this means
5930  that 
5931 \begin_inset Flex CharStyle:Code
5932 status collapsed
5933
5934 \begin_layout Plain Layout
5935 Style
5936 \end_layout
5937
5938 \end_inset
5939
5940
5941 \begin_inset Flex CharStyle:Code
5942 status collapsed
5943
5944 \begin_layout Plain Layout
5945 style
5946 \end_layout
5947
5948 \end_inset
5949
5950  and 
5951 \begin_inset Flex CharStyle:Code
5952 status collapsed
5953
5954 \begin_layout Plain Layout
5955 StYlE
5956 \end_layout
5957
5958 \end_inset
5959
5960  are really the same command.
5961  The possible values are printed in brackets after the feature's name.
5962  The default value if a feature isn't specified inside a text class-description
5963  is typeset 
5964 \begin_inset Flex CharStyle:Code
5965 status collapsed
5966
5967 \begin_layout Plain Layout
5968
5969 \emph on
5970 emphasized
5971 \end_layout
5972
5973 \end_inset
5974
5975 .
5976  If the argument has a datatype like 
5977 \begin_inset Quotes eld
5978 \end_inset
5979
5980 string
5981 \begin_inset Quotes erd
5982 \end_inset
5983
5984  or 
5985 \begin_inset Quotes eld
5986 \end_inset
5987
5988 float
5989 \begin_inset Quotes erd
5990 \end_inset
5991
5992 , the default is shown like this: 
5993 \begin_inset Flex CharStyle:Code
5994 status collapsed
5995
5996 \begin_layout Plain Layout
5997 float=
5998 \emph on
5999 default
6000 \end_layout
6001
6002 \end_inset
6003
6004 .
6005 \end_layout
6006
6007 \begin_layout Subsection
6008 \begin_inset CommandInset label
6009 LatexCommand label
6010 name "sub:Layout-modules"
6011
6012 \end_inset
6013
6014 Layout modules
6015 \end_layout
6016
6017 \begin_layout Standard
6018 Similar to layout files, and new with LyX 1.6, are layout 
6019 \emph on
6020 modules
6021 \emph default
6022 .
6023  Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6024  some modules---such as the Endnotes module---provide support for just such
6025  a package.
6026  In a sense, layout modules are similar to included files---files like 
6027 \begin_inset Flex CharStyle:Code
6028 status collapsed
6029
6030 \begin_layout Plain Layout
6031 stdsections.inc
6032 \end_layout
6033
6034 \end_inset
6035
6036 ---in that modules are not specific to a given document layout but may be
6037  used with many different layouts.
6038  The difference is that using a layout module does not require editing the
6039  layout file.
6040  Rather, modules are selected in the 
6041 \begin_inset Flex CharStyle:MenuItem
6042 status collapsed
6043
6044 \begin_layout Plain Layout
6045 Document\SpecialChar \menuseparator
6046 Settings
6047 \end_layout
6048
6049 \end_inset
6050
6051  dialog.
6052 \end_layout
6053
6054 \begin_layout Standard
6055 Building modules is the easiest way to get started with layout editing,
6056  since it can be as simple as adding a single new paragraph or flex inset.
6057  But modules may, in principle, contain anything a layout file can contain.
6058 \end_layout
6059
6060 \begin_layout Standard
6061 A module must begin with a line like the following:
6062 \end_layout
6063
6064 \begin_layout LyX-Code
6065 #
6066 \backslash
6067 DeclareLyXModule[endnotes.sty]{Endnotes} 
6068 \end_layout
6069
6070 \begin_layout Standard
6071 The argument in square brackets is optional: It declares any LaTeX packages
6072  on which the module depends.
6073  The mandatory argument, in curly brackets, is the name of the module, as
6074  it should appear in 
6075 \begin_inset Flex CharStyle:MenuItem
6076 status collapsed
6077
6078 \begin_layout Plain Layout
6079 Document\SpecialChar \menuseparator
6080 Settings
6081 \end_layout
6082
6083 \end_inset
6084
6085 .
6086  
6087 \end_layout
6088
6089 \begin_layout Standard
6090 The module declaration should then be followed by lines like the following:
6091 \end_layout
6092
6093 \begin_layout LyX-Code
6094 #DescriptionBegin 
6095 \end_layout
6096
6097 \begin_layout LyX-Code
6098 #Adds an endnote command, in addition to footnotes.
6099  
6100 \end_layout
6101
6102 \begin_layout LyX-Code
6103 #You will need to add  
6104 \backslash
6105 theendnotes in ERT where you 
6106 \end_layout
6107
6108 \begin_layout LyX-Code
6109 #want the endnotes to appear.
6110  
6111 \end_layout
6112
6113 \begin_layout LyX-Code
6114 #DescriptionEnd 
6115 \end_layout
6116
6117 \begin_layout LyX-Code
6118 #Requires: somemodule | othermodule
6119 \end_layout
6120
6121 \begin_layout LyX-Code
6122 #Excludes: badmodule
6123 \end_layout
6124
6125 \begin_layout Standard
6126 The description is used in 
6127 \begin_inset Flex CharStyle:MenuItem
6128 status collapsed
6129
6130 \begin_layout Plain Layout
6131 Document\SpecialChar \menuseparator
6132 Settings
6133 \end_layout
6134
6135 \end_inset
6136
6137  to provide the user with information about what the module does.
6138  The 
6139 \begin_inset Flex CharStyle:Code
6140 status collapsed
6141
6142 \begin_layout Plain Layout
6143 Requires
6144 \end_layout
6145
6146 \end_inset
6147
6148  line is used to identify other modules with which this one must be used;
6149  the 
6150 \begin_inset Flex CharStyle:Code
6151 status collapsed
6152
6153 \begin_layout Plain Layout
6154 Excludes
6155 \end_layout
6156
6157 \end_inset
6158
6159  line is used to identify modules with which this one may not be used.
6160  Both are optional, and, as shown, multiple modules should be separated
6161  with the pipe symbol: |.
6162  Note that the required modules are treated disjunctively: 
6163 \emph on
6164 at least one
6165 \emph default
6166  of the required modules must be used.
6167  Similarly, 
6168 \emph on
6169 no
6170 \emph default
6171  excluded module may be used.
6172  Note that modules are identified here by their 
6173 \emph on
6174 filenames
6175 \emph default
6176  without the .module extension.
6177  So 
6178 \begin_inset Flex CharStyle:Code
6179 status collapsed
6180
6181 \begin_layout Plain Layout
6182 somemodule
6183 \end_layout
6184
6185 \end_inset
6186
6187  is really 
6188 \begin_inset Flex CharStyle:Code
6189 status collapsed
6190
6191 \begin_layout Plain Layout
6192 somemodule.module
6193 \end_layout
6194
6195 \end_inset
6196
6197 .
6198 \end_layout
6199
6200 \begin_layout Standard
6201 After creating a new module, you will need to reconfigure and then restart
6202  LyX for the module to appear in the menu.
6203  However, changes you make to the module will be seen immediately, if you
6204  open 
6205 \begin_inset Flex CharStyle:MenuItem
6206 status collapsed
6207
6208 \begin_layout Plain Layout
6209 Document\SpecialChar \menuseparator
6210 Settings
6211 \end_layout
6212
6213 \end_inset
6214
6215 , highlight something, and then hit 
6216 \begin_inset Quotes eld
6217 \end_inset
6218
6219 OK
6220 \begin_inset Quotes erd
6221 \end_inset
6222
6223 .
6224  
6225 \emph on
6226 It is strongly recommended that you save your work before doing so
6227 \emph default
6228 .
6229  In fact, 
6230 \emph on
6231 it is strongly recommended that you not attempt to edit modules while simultaneo
6232 usly working on documents
6233 \emph default
6234 .
6235  Though of course the developers strive to keep LyX stable in such situations,
6236  syntax errors and the like in your module file could cause strange behavior.
6237 \end_layout
6238
6239 \begin_layout Subsection
6240 Supporting new document classes
6241 \end_layout
6242
6243 \begin_layout Standard
6244 There are two situations you are likely to encounter when wanting to support
6245  a new LaTeX document class, involving LaTeX2e class (
6246 \begin_inset Flex CharStyle:Code
6247 status collapsed
6248
6249 \begin_layout Plain Layout
6250 .cls
6251 \end_layout
6252
6253 \end_inset
6254
6255 ) and style (
6256 \begin_inset Flex CharStyle:Code
6257 status collapsed
6258
6259 \begin_layout Plain Layout
6260 .sty
6261 \end_layout
6262
6263 \end_inset
6264
6265 ) files.
6266  Supporting a style file is usually fairly easy.
6267  Supporting a new document class is a bit harder.
6268 \end_layout
6269
6270 \begin_layout Subsection
6271 A layout for a 
6272 \begin_inset Flex CharStyle:MenuItem
6273 status collapsed
6274
6275 \begin_layout Plain Layout
6276 sty
6277 \end_layout
6278
6279 \end_inset
6280
6281  file
6282 \end_layout
6283
6284 \begin_layout Standard
6285 If your new document class is provided as a style file that is used in conjuncti
6286 on with an existing, supported document class---for the sake of the example,
6287  we'll assume that the style file is called 
6288 \begin_inset Flex CharStyle:MenuItem
6289 status collapsed
6290
6291 \begin_layout Plain Layout
6292 myclass.sty
6293 \end_layout
6294
6295 \end_inset
6296
6297  and it is meant to be used with 
6298 \begin_inset Flex CharStyle:MenuItem
6299 status collapsed
6300
6301 \begin_layout Plain Layout
6302 report.cls
6303 \end_layout
6304
6305 \end_inset
6306
6307 , which is a standard class---start by copying the existing class's layout
6308  file into your local directory:
6309 \end_layout
6310
6311 \begin_layout LyX-Code
6312 cp report.layout ~/.lyx/layouts/myclass.layout
6313 \end_layout
6314
6315 \begin_layout Standard
6316 Then edit 
6317 \begin_inset Flex CharStyle:Code
6318 status collapsed
6319
6320 \begin_layout Plain Layout
6321 myclass.layout
6322 \end_layout
6323
6324 \end_inset
6325
6326  and change the line: 
6327 \end_layout
6328
6329 \begin_layout LyX-Code
6330
6331 \backslash
6332 DeclareLaTeXClass{report}
6333 \end_layout
6334
6335 \begin_layout Standard
6336 to read
6337 \end_layout
6338
6339 \begin_layout LyX-Code
6340
6341 \backslash
6342 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6343 \end_layout
6344
6345 \begin_layout Standard
6346 Then add:
6347 \end_layout
6348
6349 \begin_layout LyX-Code
6350 Preamble 
6351 \begin_inset Newline newline
6352 \end_inset
6353
6354     
6355 \backslash
6356 usepackage{myclass}
6357 \begin_inset Newline newline
6358 \end_inset
6359
6360 EndPreamble
6361 \end_layout
6362
6363 \begin_layout Standard
6364 near the top of the file.
6365 \end_layout
6366
6367 \begin_layout Standard
6368 Start LyX and select 
6369 \begin_inset Flex CharStyle:MenuItem
6370 status collapsed
6371
6372 \begin_layout Plain Layout
6373 Tools\SpecialChar \menuseparator
6374 Reconfigure
6375 \end_layout
6376
6377 \end_inset
6378
6379 .
6380  Then restart LyX and try creating a new document.
6381  You should see "
6382 \begin_inset Flex CharStyle:MenuItem
6383 status collapsed
6384
6385 \begin_layout Plain Layout
6386 report (myclass)
6387 \end_layout
6388
6389 \end_inset
6390
6391 " as a document class option in the 
6392 \begin_inset Flex CharStyle:MenuItem
6393 status collapsed
6394
6395 \begin_layout Plain Layout
6396 Document\SpecialChar \menuseparator
6397 Settings
6398 \end_layout
6399
6400 \end_inset
6401
6402  dialog.
6403  It is likely that some of the sectioning commands and such in your new
6404  class will work differently from how they worked in the base class---
6405 \begin_inset Flex CharStyle:Code
6406 status collapsed
6407
6408 \begin_layout Plain Layout
6409 report
6410 \end_layout
6411
6412 \end_inset
6413
6414  in this example---so you can fiddle around with the settings for the different
6415  sections if you wish.
6416 \end_layout
6417
6418 \begin_layout Subsection
6419 Layout for a 
6420 \begin_inset Flex CharStyle:MenuItem
6421 status collapsed
6422
6423 \begin_layout Plain Layout
6424 cls
6425 \end_layout
6426
6427 \end_inset
6428
6429  file
6430 \end_layout
6431
6432 \begin_layout Standard
6433 There are two possibilities here.
6434  One is that the class file is itself based upon an existing document class.
6435  For example, many thesis classes are based upon 
6436 \begin_inset Flex CharStyle:MenuItem
6437 status collapsed
6438
6439 \begin_layout Plain Layout
6440 book.cls
6441 \end_layout
6442
6443 \end_inset
6444
6445 .
6446  To see whether yours is, look for a line like
6447 \end_layout
6448
6449 \begin_layout LyX-Code
6450
6451 \backslash
6452 LoadClass{book}
6453 \end_layout
6454
6455 \begin_layout Standard
6456 in the file.
6457  If so, then you may proceed largely as in the previous section, though
6458  the DeclareLaTeXClass line will be different.
6459  If your new class is thesis, and it is based upon book, then the line should
6460  read:
6461 \begin_inset Foot
6462 status collapsed
6463
6464 \begin_layout Plain Layout
6465 And it will be easiest if you save the file to 
6466 \begin_inset Flex CharStyle:Code
6467 status collapsed
6468
6469 \begin_layout Plain Layout
6470 thesis.layout
6471 \end_layout
6472
6473 \end_inset
6474
6475 : LyX assumes that the document class has the same name as the layout file.
6476  
6477 \end_layout
6478
6479 \end_inset
6480
6481
6482 \end_layout
6483
6484 \begin_layout LyX-Code
6485
6486 \backslash
6487 DeclareLaTeXClass[thesis,book]{thesis}
6488 \end_layout
6489
6490 \begin_layout Standard
6491 If, on the other hand, the new class is not based upon an existing class,
6492  you will probably have to 
6493 \begin_inset Quotes eld
6494 \end_inset
6495
6496 roll your own
6497 \begin_inset Quotes erd
6498 \end_inset
6499
6500  layout.
6501  We strongly suggest copying an existing layout file which uses a similar
6502  LaTeX class and then modifying it, if you can do so.
6503  At least use an existing file as a starting point so you can find out what
6504  items you need to worry about.
6505  Again, the specifics are covered below.
6506 \end_layout
6507
6508 \begin_layout Section
6509 Declaring a new text class
6510 \end_layout
6511
6512 \begin_layout Standard
6513 When it's finally time to get your hands dirty and create or edit your own
6514  layout file, the following sections describe what you're up against.
6515  Our advice is to go slowly, save and test often, listen to soothing music,
6516  and enjoy one or two of your favorite adult beverages; more if you are
6517  getting particularly stuck.
6518  It's really not that hard, except that the multitude of options can become
6519  overwhelming if you try to do to much in one sitting.
6520  Go have another adult beverage, just for good measure.
6521 \end_layout
6522
6523 \begin_layout Standard
6524 Here we go!
6525 \end_layout
6526
6527 \begin_layout Standard
6528 Lines in a layout file which begin with a 
6529 \begin_inset Flex CharStyle:Code
6530 status collapsed
6531
6532 \begin_layout Plain Layout
6533 #
6534 \end_layout
6535
6536 \end_inset
6537
6538  are comments.
6539  There is one exception to this rule: all layouts should begin with lines
6540  like:
6541 \end_layout
6542
6543 \begin_layout LyX-Code
6544
6545 \size small
6546 #% Do not delete the line below; configure depends on this 
6547 \end_layout
6548
6549 \begin_layout LyX-Code
6550
6551 \size small
6552 #  
6553 \backslash
6554 DeclareLaTeXClass{article}
6555 \end_layout
6556
6557 \begin_layout Standard
6558 The second line is used when you configure LyX.
6559  The layout file is read by the LaTeX script 
6560 \begin_inset Flex CharStyle:Code
6561 status collapsed
6562
6563 \begin_layout Plain Layout
6564 chkconfig.ltx
6565 \end_layout
6566
6567 \end_inset
6568
6569 , in a special mode where 
6570 \begin_inset Flex CharStyle:Code
6571 status collapsed
6572
6573 \begin_layout Plain Layout
6574 #
6575 \end_layout
6576
6577 \end_inset
6578
6579  is ignored.
6580  The first line is just a LaTeX comment, and the second one contains the
6581  declaration of the text class.
6582  If these lines appear in a file named 
6583 \begin_inset Flex CharStyle:Code
6584 status collapsed
6585
6586 \begin_layout Plain Layout
6587 article.layout
6588 \end_layout
6589
6590 \end_inset
6591
6592 , then they define a text class of name 
6593 \begin_inset Flex CharStyle:Code
6594 status collapsed
6595
6596 \begin_layout Plain Layout
6597 article
6598 \end_layout
6599
6600 \end_inset
6601
6602  (the name of the layout file) which uses the LaTeX document class 
6603 \begin_inset Flex CharStyle:Code
6604 status collapsed
6605
6606 \begin_layout Plain Layout
6607 article.cls
6608 \end_layout
6609
6610 \end_inset
6611
6612  (the default is to use the same name as the layout).
6613  The string 
6614 \begin_inset Quotes eld
6615 \end_inset
6616
6617 article
6618 \begin_inset Quotes erd
6619 \end_inset
6620
6621  that appears above is used as a description of the text class in the 
6622 \begin_inset Flex CharStyle:MenuItem
6623 status collapsed
6624
6625 \begin_layout Plain Layout
6626 Document\SpecialChar \menuseparator
6627 Settings
6628 \end_layout
6629
6630 \end_inset
6631
6632  dialog.
6633 \end_layout
6634
6635 \begin_layout Standard
6636 Let's assume that you wrote your own text class that uses the 
6637 \begin_inset Flex CharStyle:Code
6638 status collapsed
6639
6640 \begin_layout Plain Layout
6641 article.cls
6642 \end_layout
6643
6644 \end_inset
6645
6646  document class, but where you changed the appearance of the section headings.
6647  If you put it in a file 
6648 \begin_inset Flex CharStyle:Code
6649 status collapsed
6650
6651 \begin_layout Plain Layout
6652 myarticle.layout
6653 \end_layout
6654
6655 \end_inset
6656
6657 , the header of this file should be:
6658 \end_layout
6659
6660 \begin_layout LyX-Code
6661
6662 \size small
6663 #% Do not delete the line below; configure depends on this 
6664 \end_layout
6665
6666 \begin_layout LyX-Code
6667
6668 \size small
6669 #  
6670 \backslash
6671 DeclareLaTeXClass[article]{article (with my own headings)}
6672 \end_layout
6673
6674 \begin_layout Standard
6675 This declares a text class 
6676 \begin_inset Flex CharStyle:Code
6677 status collapsed
6678
6679 \begin_layout Plain Layout
6680 myarticle
6681 \end_layout
6682
6683 \end_inset
6684
6685 , associated with the LaTeX document class 
6686 \begin_inset Flex CharStyle:Code
6687 status collapsed
6688
6689 \begin_layout Plain Layout
6690 article.cls
6691 \end_layout
6692
6693 \end_inset
6694
6695  and described as 
6696 \begin_inset Quotes eld
6697 \end_inset
6698
6699 article (with my own headings)
6700 \begin_inset Quotes erd
6701 \end_inset
6702
6703 .
6704  If your text class depends on several packages, you can declare it as:
6705 \end_layout
6706
6707 \begin_layout LyX-Code
6708
6709 \size small
6710 #% Do not delete the line below; configure depends on this 
6711 \end_layout
6712
6713 \begin_layout LyX-Code
6714
6715 \size small
6716 #  
6717 \backslash
6718 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6719 \end_layout
6720
6721 \begin_layout Standard
6722 This indicates that your text class uses the foo.sty package.
6723  Finally, it is also possible to declare classes for DocBook code.
6724  Typical declarations will look like
6725 \end_layout
6726
6727 \begin_layout LyX-Code
6728
6729 \size small
6730 #% Do not delete the line below; configure depends on this 
6731 \end_layout
6732
6733 \begin_layout LyX-Code
6734
6735 \size small
6736
6737 \backslash
6738 DeclareDocBookClass[article]{SGML (DocBook article)}
6739 \end_layout
6740
6741 \begin_layout Standard
6742 Note that these declarations can also be given an optional parameter declaring
6743  the name of the document class (but not a list).
6744 \end_layout
6745
6746 \begin_layout Standard
6747 So, to be as explicit as possible, the form of the layout declaration is:
6748 \end_layout
6749
6750 \begin_layout LyX-Code
6751
6752 \size small
6753 #  
6754 \backslash
6755 DeclareLaTeXClass[class,package.sty]{layout description}
6756 \end_layout
6757
6758 \begin_layout Standard
6759 The class need only be specified if the name of the LaTeX class file and
6760  the name of the layout file are different; if the name of the classfile
6761  is not specified, then LyX will simply assume that it is the same as the
6762  name of the layout file.
6763 \end_layout
6764
6765 \begin_layout Standard
6766 When the text class has been modified to your taste, all you have to do
6767  is to copy it either to 
6768 \begin_inset Flex CharStyle:Code
6769 status collapsed
6770
6771 \begin_layout Plain Layout
6772 LyXDir/layouts/
6773 \end_layout
6774
6775 \end_inset
6776
6777  or to 
6778 \begin_inset Flex CharStyle:Code
6779 status collapsed
6780
6781 \begin_layout Plain Layout
6782 UserDir/layouts
6783 \end_layout
6784
6785 \end_inset
6786
6787 , run 
6788 \begin_inset Flex CharStyle:MenuItem
6789 status collapsed
6790
6791 \begin_layout Plain Layout
6792
6793 \bar under
6794 T
6795 \bar default
6796 ools\SpecialChar \menuseparator
6797
6798 \bar under
6799 R
6800 \bar default
6801 econfigure
6802 \end_layout
6803
6804 \end_inset
6805
6806 , exit LyX and restart it.
6807  Then your new text class should be available along with the others.
6808 \end_layout
6809
6810 \begin_layout Standard
6811 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6812  you made to your layout files.
6813  As a result, editing layout files could be very time consuming.
6814  Beginning with 1.6, however, you can force a reload of the layout currently
6815  in use by using the LyX function 
6816 \begin_inset Flex CharStyle:MenuItem
6817 status collapsed
6818
6819 \begin_layout Plain Layout
6820 layout-reload
6821 \end_layout
6822
6823 \end_inset
6824
6825 .
6826  There is no default binding for this function---though, of course, you
6827  can bind it to a key yourself.
6828  If you want to use this function, then, you should simply enter it in the
6829  mini-buffer.
6830  
6831 \emph on
6832 Warning
6833 \emph default
6834 : This is very much an `advanced feature'.
6835  It is 
6836 \emph on
6837 strongly
6838 \emph default
6839  recommended that you save your work before using this function.
6840  In fact, it is 
6841 \emph on
6842 strongly
6843 \emph default
6844  recommended that you not attempt to edit your layout while simultaneously
6845  working on a document that you care about.
6846  Use a test document.
6847  Syntax errors and the like in your layout file could cause peculiar behavior.
6848  In particular, such errors could cause LyX to regard the current layout
6849  as invalid and to attempt to switch to some other layout.
6850  The LyX team strives to keep LyX stable in such situations, but safe is
6851  better than sorry.
6852 \end_layout
6853
6854 \begin_layout Subsection
6855 File format
6856 \end_layout
6857
6858 \begin_layout Standard
6859 The first non-comment line must contain the file format number:
6860 \end_layout
6861
6862 \begin_layout Description
6863 \begin_inset Flex CharStyle:Code
6864 status collapsed
6865
6866 \begin_layout Plain Layout
6867 Format
6868 \end_layout
6869
6870 \end_inset
6871
6872  [
6873 \begin_inset Flex CharStyle:Code
6874 status collapsed
6875
6876 \begin_layout Plain Layout
6877 int
6878 \end_layout
6879
6880 \end_inset
6881
6882 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6883  don't have an explicit file format).
6884  The file format that is documented here is format 8.
6885 \end_layout
6886
6887 \begin_layout Subsection
6888 General text class parameters
6889 \end_layout
6890
6891 \begin_layout Standard
6892 These are the general parameters which describe the form of the entire document:
6893 \end_layout
6894
6895 \begin_layout Description
6896 \begin_inset Flex CharStyle:Code
6897 status collapsed
6898
6899 \begin_layout Plain Layout
6900 AddToPreamble
6901 \end_layout
6902
6903 \end_inset
6904
6905  Adds information to the document preamble.
6906  Must end with 
6907 \begin_inset Quotes eld
6908 \end_inset
6909
6910
6911 \begin_inset Flex CharStyle:Code
6912 status collapsed
6913
6914 \begin_layout Plain Layout
6915 EndPreamble
6916 \end_layout
6917
6918 \end_inset
6919
6920
6921 \begin_inset Quotes erd
6922 \end_inset
6923
6924 .
6925 \end_layout
6926
6927 \begin_layout Description
6928 \begin_inset Flex CharStyle:Code
6929 status collapsed
6930
6931 \begin_layout Plain Layout
6932 ClassOptions
6933 \end_layout
6934
6935 \end_inset
6936
6937  Describes various global options supported by the document class.
6938  See Section
6939 \begin_inset space ~
6940 \end_inset
6941
6942
6943 \begin_inset CommandInset ref
6944 LatexCommand ref
6945 reference "sec:classoptions"
6946
6947 \end_inset
6948
6949  for a description.
6950  Must end with 
6951 \begin_inset Quotes eld
6952 \end_inset
6953
6954
6955 \begin_inset Flex CharStyle:Code
6956 status collapsed
6957
6958 \begin_layout Plain Layout
6959 End
6960 \end_layout
6961
6962 \end_inset
6963
6964
6965 \begin_inset Quotes erd
6966 \end_inset
6967
6968 .
6969 \end_layout
6970
6971 \begin_layout Description
6972 \begin_inset Flex CharStyle:Code
6973 status collapsed
6974
6975 \begin_layout Plain Layout
6976 Columns
6977 \end_layout
6978
6979 \end_inset
6980
6981  [
6982 \begin_inset Flex CharStyle:Code
6983 status collapsed
6984
6985 \begin_layout Plain Layout
6986
6987 \emph on
6988 1
6989 \end_layout
6990
6991 \end_inset
6992
6993
6994 \begin_inset Flex CharStyle:Code
6995 status collapsed
6996
6997 \begin_layout Plain Layout
6998 2
6999 \end_layout
7000
7001 \end_inset
7002
7003 ] Whether the class should default to having one or two columns.
7004  Can be changed in the 
7005 \begin_inset Flex CharStyle:MenuItem
7006 status collapsed
7007
7008 \begin_layout Plain Layout
7009 Document\SpecialChar \menuseparator
7010 Settings
7011 \end_layout
7012
7013 \end_inset
7014
7015  dialog.
7016 \end_layout
7017
7018 \begin_layout Description
7019 \begin_inset Flex CharStyle:Code
7020 status collapsed
7021
7022 \begin_layout Plain Layout
7023 Counter
7024 \end_layout
7025
7026 \end_inset
7027
7028  This sequence defines a new counter.
7029  See Section
7030 \begin_inset space ~
7031 \end_inset
7032
7033
7034 \begin_inset CommandInset ref
7035 LatexCommand ref
7036 reference "sec:counter"
7037
7038 \end_inset
7039
7040  for details.
7041  Must end with 
7042 \begin_inset Quotes eld
7043 \end_inset
7044
7045
7046 \begin_inset Flex CharStyle:Code
7047 status collapsed
7048
7049 \begin_layout Plain Layout
7050 End
7051 \end_layout
7052
7053 \end_inset
7054
7055
7056 \begin_inset Quotes erd
7057 \end_inset
7058
7059 .
7060 \end_layout
7061
7062 \begin_layout Description
7063 \begin_inset Flex CharStyle:Code
7064 status collapsed
7065
7066 \begin_layout Plain Layout
7067 DefaultFont
7068 \end_layout
7069
7070 \end_inset
7071
7072  Sets the default font used to display the document.
7073  See Section
7074 \begin_inset space ~
7075 \end_inset
7076
7077
7078 \begin_inset CommandInset ref
7079 LatexCommand ref
7080 reference "sec:fonts"
7081
7082 \end_inset
7083
7084  for how to declare fonts.
7085  Must end with 
7086 \begin_inset Quotes eld
7087 \end_inset
7088
7089
7090 \begin_inset Flex CharStyle:Code
7091 status collapsed
7092
7093 \begin_layout Plain Layout
7094 EndFont
7095 \end_layout
7096
7097 \end_inset
7098
7099
7100 \begin_inset Quotes erd
7101 \end_inset
7102
7103 .
7104 \end_layout
7105
7106 \begin_layout Description
7107 \begin_inset Flex CharStyle:Code
7108 status collapsed
7109
7110 \begin_layout Plain Layout
7111 DefaultModule
7112 \end_layout
7113
7114 \end_inset
7115
7116  [
7117 \begin_inset Flex CharStyle:Code
7118 status collapsed
7119
7120 \begin_layout Plain Layout
7121 string]
7122 \end_layout
7123
7124 \end_inset
7125
7126  Specifies a module to be included by default with this document class,
7127  which should be specified by filename without the 
7128 \begin_inset Flex CharStyle:Code
7129 status collapsed
7130
7131 \begin_layout Plain Layout
7132 .module
7133 \end_layout
7134
7135 \end_inset
7136
7137  extension.
7138  The user can still remove the module, but it will be active at the outset.
7139  (This applies only when new files are created, or when this class is chosen
7140  for an existing document.)
7141 \end_layout
7142
7143 \begin_layout Description
7144 \begin_inset Flex CharStyle:Code
7145 status collapsed
7146
7147 \begin_layout Plain Layout
7148 DefaultStyle
7149 \end_layout
7150
7151 \end_inset
7152
7153  [
7154 \begin_inset Flex CharStyle:Code
7155 status collapsed
7156
7157 \begin_layout Plain Layout
7158 string
7159 \end_layout
7160
7161 \end_inset
7162
7163 ] This is the style that will be assigned to new paragraphs, usually 
7164 \begin_inset Flex CharStyle:MenuItem
7165 status collapsed
7166
7167 \begin_layout Plain Layout
7168 Standard
7169 \end_layout
7170
7171 \end_inset
7172
7173 .
7174  This will default to the first defined style if not given, but you are
7175  highly encouraged to use this directive.
7176 \end_layout
7177
7178 \begin_layout Description
7179 \begin_inset Flex CharStyle:Code
7180 status collapsed
7181
7182 \begin_layout Plain Layout
7183 ExcludesModule
7184 \end_layout
7185
7186 \end_inset
7187
7188  [
7189 \begin_inset Flex CharStyle:Code
7190 status collapsed
7191
7192 \begin_layout Plain Layout
7193 string
7194 \end_layout
7195
7196 \end_inset
7197
7198 ] Indicates that the module in question---which should be specified by filename
7199  without the 
7200 \begin_inset Flex CharStyle:Code
7201 status collapsed
7202
7203 \begin_layout Plain Layout
7204 .module
7205 \end_layout
7206
7207 \end_inset
7208
7209  extension---cannot be used with this document class.
7210  This might be used in a journal-specific layout file to prevent, say, the
7211  use of the 
7212 \begin_inset Flex CharStyle:Code
7213 status collapsed
7214
7215 \begin_layout Plain Layout
7216 theorems-sec
7217 \end_layout
7218
7219 \end_inset
7220
7221  module that numbers theorems by section.
7222  This tag may 
7223 \emph on
7224 not
7225 \emph default
7226  be used in a module.
7227  Modules have their own way of excluding other modules (see 
7228 \begin_inset CommandInset ref
7229 LatexCommand ref
7230 reference "sub:Layout-modules"
7231
7232 \end_inset
7233
7234 ).
7235 \end_layout
7236
7237 \begin_layout Description
7238 \begin_inset Flex CharStyle:Code
7239 status collapsed
7240
7241 \begin_layout Plain Layout
7242 Float
7243 \end_layout
7244
7245 \end_inset
7246
7247  Defines a new float.
7248  See Section
7249 \begin_inset space ~
7250 \end_inset
7251
7252
7253 \begin_inset CommandInset ref
7254 LatexCommand ref
7255 reference "sec:floats"
7256
7257 \end_inset
7258
7259  for details.
7260  Must end with 
7261 \begin_inset Quotes eld
7262 \end_inset
7263
7264
7265 \begin_inset Flex CharStyle:Code
7266 status collapsed
7267
7268 \begin_layout Plain Layout
7269 End
7270 \end_layout
7271
7272 \end_inset
7273
7274
7275 \begin_inset Quotes erd
7276 \end_inset
7277
7278 .
7279 \end_layout
7280
7281 \begin_layout Description
7282 \begin_inset Flex CharStyle:Code
7283 status collapsed
7284
7285 \begin_layout Plain Layout
7286 Input
7287 \end_layout
7288
7289 \end_inset
7290
7291  As its name implies, this command allows you to include another layout
7292  definition file within yours to avoid duplicating commands.
7293  Common examples are the standard layout files, for example, 
7294 \begin_inset Flex CharStyle:Code
7295 status collapsed
7296
7297 \begin_layout Plain Layout
7298 stdclass.inc
7299 \end_layout
7300
7301 \end_inset
7302
7303 , which contains most of the basic layouts.
7304 \end_layout
7305
7306 \begin_layout Description
7307 \begin_inset Flex CharStyle:Code
7308 status collapsed
7309
7310 \begin_layout Plain Layout
7311 InsetLayout
7312 \end_layout
7313
7314 \end_inset
7315
7316  This section (re-)defines the layout of an inset.
7317  It can be applied to an existing inset of to a new, user-defined inset,
7318  e.
7319 \begin_inset space \thinspace{}
7320 \end_inset
7321
7322 g.
7323 \begin_inset space \space{}
7324 \end_inset
7325
7326 a new character style.
7327  See Section
7328 \begin_inset space ~
7329 \end_inset
7330
7331
7332 \begin_inset CommandInset ref
7333 LatexCommand ref
7334 reference "sec:charstyle"
7335
7336 \end_inset
7337
7338  for more information.
7339  Must end with 
7340 \begin_inset Quotes eld
7341 \end_inset
7342
7343
7344 \begin_inset Flex CharStyle:Code
7345 status collapsed
7346
7347 \begin_layout Plain Layout
7348 End
7349 \end_layout
7350
7351 \end_inset
7352
7353
7354 \begin_inset Quotes erd
7355 \end_inset
7356
7357 .
7358 \end_layout
7359
7360 \begin_layout Description
7361 \begin_inset Flex CharStyle:Code
7362 status collapsed
7363
7364 \begin_layout Plain Layout
7365 LeftMargin
7366 \end_layout
7367
7368 \end_inset
7369
7370  A string that indicates the width of the left margin on the screen, for
7371  example, 
7372 \begin_inset Quotes eld
7373 \end_inset
7374
7375 MMMMM
7376 \begin_inset Quotes erd
7377 \end_inset
7378
7379 .
7380 \end_layout
7381
7382 \begin_layout Description
7383 \begin_inset Flex CharStyle:Code
7384 status collapsed
7385
7386 \begin_layout Plain Layout
7387 NoFloat
7388 \end_layout
7389
7390 \end_inset
7391
7392  This command deletes an existing float.
7393  This is particularly useful when you want to suppress a float that has
7394  be defined in an input file.
7395 \end_layout
7396
7397 \begin_layout Description
7398 \begin_inset Flex CharStyle:Code
7399 status collapsed
7400
7401 \begin_layout Plain Layout
7402 NoStyle
7403 \end_layout
7404
7405 \end_inset
7406
7407  This command deletes an existing style.
7408  This is particularly useful when you want to suppress a style that has
7409  be defined in an input file.
7410 \end_layout
7411
7412 \begin_layout Description
7413 \begin_inset Flex CharStyle:Code
7414 status collapsed
7415
7416 \begin_layout Plain Layout
7417 OutputType
7418 \end_layout
7419
7420 \end_inset
7421
7422  A string indicating what sort of output documents using this class will
7423  produce.
7424  At present, the options are: `docbook', `latex', and `literate'.
7425 \end_layout
7426
7427 \begin_layout Description
7428 \begin_inset Flex CharStyle:Code
7429 status collapsed
7430
7431 \begin_layout Plain Layout
7432
7433 \series medium
7434 PageStyle
7435 \end_layout
7436
7437 \end_inset
7438
7439  [
7440 \emph on
7441
7442 \begin_inset Flex CharStyle:Code
7443 status collapsed
7444
7445 \begin_layout Plain Layout
7446
7447 \emph on
7448 plain
7449 \end_layout
7450
7451 \end_inset
7452
7453
7454 \emph default
7455
7456 \begin_inset Flex CharStyle:Code
7457 status collapsed
7458
7459 \begin_layout Plain Layout
7460 empty
7461 \end_layout
7462
7463 \end_inset
7464
7465
7466 \begin_inset Flex CharStyle:Code
7467 status collapsed
7468
7469 \begin_layout Plain Layout
7470 headings
7471 \end_layout
7472
7473 \end_inset
7474
7475 ] The class default pagestyle.
7476  Can be changed in the 
7477 \begin_inset Flex CharStyle:MenuItem
7478 status collapsed
7479
7480 \begin_layout Plain Layout
7481 Document\SpecialChar \menuseparator
7482 Settings
7483 \end_layout
7484
7485 \end_inset
7486
7487  dialog.
7488 \end_layout
7489
7490 \begin_layout Description
7491 \begin_inset Flex CharStyle:Code
7492 status collapsed
7493
7494 \begin_layout Plain Layout
7495 Preamble
7496 \end_layout
7497
7498 \end_inset
7499
7500  Sets the preamble for the LaTeX document.
7501  Note that this will completely override any prior 
7502 \begin_inset Flex CharStyle:Code
7503 status collapsed
7504
7505 \begin_layout Plain Layout
7506 Premable
7507 \end_layout
7508
7509 \end_inset
7510
7511  or 
7512 \begin_inset Flex CharStyle:Code
7513 status collapsed
7514
7515 \begin_layout Plain Layout
7516 AddToPreamble
7517 \end_layout
7518
7519 \end_inset
7520
7521  declarations.
7522  Must end with 
7523 \begin_inset Quotes eld
7524 \end_inset
7525
7526
7527 \begin_inset Flex CharStyle:Code
7528 status collapsed
7529
7530 \begin_layout Plain Layout
7531 EndPreamble
7532 \end_layout
7533
7534 \end_inset
7535
7536
7537 \begin_inset Quotes erd
7538 \end_inset
7539
7540 .
7541 \end_layout
7542
7543 \begin_layout Description
7544 \begin_inset Flex CharStyle:Code
7545 status collapsed
7546
7547 \begin_layout Plain Layout
7548 Provides
7549 \end_layout
7550
7551 \end_inset
7552
7553  [
7554 \begin_inset Flex CharStyle:Code
7555 status collapsed
7556
7557 \begin_layout Plain Layout
7558 string
7559 \end_layout
7560
7561 \end_inset
7562
7563 ] [
7564 \begin_inset Flex CharStyle:Code
7565 status collapsed
7566
7567 \begin_layout Plain Layout
7568
7569 \emph on
7570 0
7571 \end_layout
7572
7573 \end_inset
7574
7575
7576 \begin_inset Flex CharStyle:Code
7577 status collapsed
7578
7579 \begin_layout Plain Layout
7580 1
7581 \end_layout
7582
7583 \end_inset
7584
7585 ] Whether the class already provides the feature 
7586 \begin_inset Flex CharStyle:Code
7587 status collapsed
7588
7589 \begin_layout Plain Layout
7590 string
7591 \end_layout
7592
7593 \end_inset
7594
7595 .
7596  A feature is in general the name of a package (
7597 \begin_inset Flex CharStyle:Code
7598 status collapsed
7599
7600 \begin_layout Plain Layout
7601 amsmath
7602 \end_layout
7603
7604 \end_inset
7605
7606
7607 \begin_inset Flex CharStyle:Code
7608 status collapsed
7609
7610 \begin_layout Plain Layout
7611 makeidx
7612 \end_layout
7613
7614 \end_inset
7615
7616 , \SpecialChar \ldots{}
7617 ) or a macro (
7618 \begin_inset Flex CharStyle:Code
7619 status collapsed
7620
7621 \begin_layout Plain Layout
7622 url
7623 \end_layout
7624
7625 \end_inset
7626
7627
7628 \begin_inset Flex CharStyle:Code
7629 status collapsed
7630
7631 \begin_layout Plain Layout
7632 boldsymbol
7633 \end_layout
7634
7635 \end_inset
7636
7637 ,\SpecialChar \ldots{}
7638 ); the complete list of supported features is unfortunately not documented
7639  outside the LyX source code---but see 
7640 \begin_inset Flex CharStyle:Code
7641 status collapsed
7642
7643 \begin_layout Plain Layout
7644 LaTeXFeatures.cpp
7645 \end_layout
7646
7647 \end_inset
7648
7649  if you're interested.
7650  
7651 \begin_inset Flex CharStyle:MenuItem
7652 status collapsed
7653
7654 \begin_layout Plain Layout
7655
7656 \bar under
7657 H
7658 \bar default
7659 elp\SpecialChar \menuseparator
7660
7661 \bar under
7662 L
7663 \bar default
7664 aTeX Configuration
7665 \end_layout
7666
7667 \end_inset
7668
7669  also gives an overview of the supported packages.
7670 \end_layout
7671
7672 \begin_layout Description
7673 \begin_inset Flex CharStyle:Code
7674 status collapsed
7675
7676 \begin_layout Plain Layout
7677 ProvidesModule
7678 \end_layout
7679
7680 \end_inset
7681
7682  [
7683 \begin_inset Flex CharStyle:Code
7684 status collapsed
7685
7686 \begin_layout Plain Layout
7687 string
7688 \end_layout
7689
7690 \end_inset
7691
7692 ] Indicates that this layout provides the functionality of the module mentioned,
7693  which should be specified by filename, which should be specified by filename
7694  without the 
7695 \begin_inset Flex CharStyle:Code
7696 status collapsed
7697
7698 \begin_layout Plain Layout
7699 .module
7700 \end_layout
7701
7702 \end_inset
7703
7704  extension.
7705  This will typically be used if the layout includes the module directly,
7706  rather than using the 
7707 \begin_inset Flex CharStyle:Code
7708 status collapsed
7709
7710 \begin_layout Plain Layout
7711 DefaultModule
7712 \end_layout
7713
7714 \end_inset
7715
7716  tag to indicate that it ought to be used.
7717  It could be used in a module that that provided an alternate implementation
7718  of the same functionality.
7719 \end_layout
7720
7721 \begin_layout Description
7722 \begin_inset Flex CharStyle:Code
7723 status collapsed
7724
7725 \begin_layout Plain Layout
7726 Requires
7727 \end_layout
7728
7729 \end_inset
7730
7731  [
7732 \begin_inset Flex CharStyle:Code
7733 status collapsed
7734
7735 \begin_layout Plain Layout
7736 string
7737 \end_layout
7738
7739 \end_inset
7740
7741 ] Whether the class requires the feature
7742 \begin_inset Flex CharStyle:Code
7743 status collapsed
7744
7745 \begin_layout Plain Layout
7746  string
7747 \end_layout
7748
7749 \end_inset
7750
7751 .
7752  Multiple features must be separated by commas.
7753  Note that you can only request supported features.
7754 \end_layout
7755
7756 \begin_layout Description
7757 \begin_inset Flex CharStyle:Code
7758 status collapsed
7759
7760 \begin_layout Plain Layout
7761 RightMargin
7762 \end_layout
7763
7764 \end_inset
7765
7766  A string that indicates the width of the right margin on the screen, for
7767  example, 
7768 \begin_inset Quotes eld
7769 \end_inset
7770
7771 MMMMM
7772 \begin_inset Quotes erd
7773 \end_inset
7774
7775 .
7776 \end_layout
7777
7778 \begin_layout Description
7779 \begin_inset Flex CharStyle:Code
7780 status collapsed
7781
7782 \begin_layout Plain Layout
7783 SecNumDepth
7784 \end_layout
7785
7786 \end_inset
7787
7788  Sets which divisions get numbered.
7789  Corresponds to the 
7790 \begin_inset Flex CharStyle:Code
7791 status collapsed
7792
7793 \begin_layout Plain Layout
7794 secnumdepth
7795 \end_layout
7796
7797 \end_inset
7798
7799  counter in LaTeX.
7800 \end_layout
7801
7802 \begin_layout Description
7803 \begin_inset Flex CharStyle:Code
7804 status collapsed
7805
7806 \begin_layout Plain Layout
7807 Sides
7808 \end_layout
7809
7810 \end_inset
7811
7812  [
7813 \emph on
7814
7815 \begin_inset Flex CharStyle:Code
7816 status collapsed
7817
7818 \begin_layout Plain Layout
7819
7820 \emph on
7821 1
7822 \end_layout
7823
7824 \end_inset
7825
7826
7827 \emph default
7828
7829 \begin_inset Flex CharStyle:Code
7830 status collapsed
7831
7832 \begin_layout Plain Layout
7833 2
7834 \end_layout
7835
7836 \end_inset
7837
7838 ] Whether the class-default should be printing on one or both sides of the
7839  paper.
7840  Can be changed in the 
7841 \begin_inset Flex CharStyle:MenuItem
7842 status collapsed
7843
7844 \begin_layout Plain Layout
7845 Document\SpecialChar \menuseparator
7846 Settings
7847 \end_layout
7848
7849 \end_inset
7850
7851  dialog.
7852 \end_layout
7853
7854 \begin_layout Description
7855 \begin_inset Flex CharStyle:Code
7856 status collapsed
7857
7858 \begin_layout Plain Layout
7859 Style
7860 \end_layout
7861
7862 \end_inset
7863
7864  This sequence defines a new paragraph style.
7865  If the style already exists, it will redefine some of its parameters instead.
7866  See Section
7867 \begin_inset space ~
7868 \end_inset
7869
7870
7871 \begin_inset CommandInset ref
7872 LatexCommand ref
7873 reference "sec:style"
7874
7875 \end_inset
7876
7877  for details.
7878  Must end with 
7879 \begin_inset Quotes eld
7880 \end_inset
7881
7882
7883 \begin_inset Flex CharStyle:Code
7884 status collapsed
7885
7886 \begin_layout Plain Layout
7887 End
7888 \end_layout
7889
7890 \end_inset
7891
7892
7893 \begin_inset Quotes erd
7894 \end_inset
7895
7896 .
7897 \end_layout
7898
7899 \begin_layout Description
7900 \begin_inset Flex CharStyle:Code
7901 status collapsed
7902
7903 \begin_layout Plain Layout
7904 TitleLatexName
7905 \end_layout
7906
7907 \end_inset
7908
7909  [
7910 \begin_inset Flex CharStyle:Code
7911 status collapsed
7912
7913 \begin_layout Plain Layout
7914 string="maketitle"
7915 \end_layout
7916
7917 \end_inset
7918
7919 ] The name of the command or environment to be used with 
7920 \begin_inset Flex CharStyle:Code
7921 status collapsed
7922
7923 \begin_layout Plain Layout
7924 TitleLatexType
7925 \end_layout
7926
7927 \end_inset
7928
7929 .
7930 \end_layout
7931
7932 \begin_layout Description
7933 \begin_inset Flex CharStyle:Code
7934 status collapsed
7935
7936 \begin_layout Plain Layout
7937 TitleLatexType
7938 \end_layout
7939
7940 \end_inset
7941
7942  [
7943 \begin_inset Flex CharStyle:Code
7944 status collapsed
7945
7946 \begin_layout Plain Layout
7947
7948 \emph on
7949 CommandAfter
7950 \end_layout
7951
7952 \end_inset
7953
7954
7955 \begin_inset Flex CharStyle:Code
7956 status collapsed
7957
7958 \begin_layout Plain Layout
7959 Environment
7960 \end_layout
7961
7962 \end_inset
7963
7964 ] Indicates what kind of markup is used to define the title of a document.
7965  
7966 \begin_inset Flex CharStyle:Code
7967 status collapsed
7968
7969 \begin_layout Plain Layout
7970 CommandAfter
7971 \end_layout
7972
7973 \end_inset
7974
7975  means that the macro with name 
7976 \begin_inset Flex CharStyle:Code
7977 status collapsed
7978
7979 \begin_layout Plain Layout
7980 TitleLatexName
7981 \end_layout
7982
7983 \end_inset
7984
7985  will be inserted after the last layout which has 
7986 \begin_inset Quotes eld
7987 \end_inset
7988
7989
7990 \begin_inset Flex CharStyle:Code
7991 status collapsed
7992
7993 \begin_layout Plain Layout
7994 InTitle 1
7995 \end_layout
7996
7997 \end_inset
7998
7999
8000 \begin_inset Quotes erd
8001 \end_inset
8002
8003 .
8004  
8005 \begin_inset Flex CharStyle:Code
8006 status collapsed
8007
8008 \begin_layout Plain Layout
8009 Environment
8010 \end_layout
8011
8012 \end_inset
8013
8014  corresponds to the case where the block of paragraphs which have 
8015 \begin_inset Quotes eld
8016 \end_inset
8017
8018
8019 \begin_inset Flex CharStyle:Code
8020 status collapsed
8021
8022 \begin_layout Plain Layout
8023 InTitle 1
8024 \end_layout
8025
8026 \end_inset
8027
8028
8029 \begin_inset Quotes erd
8030 \end_inset
8031
8032  should be enclosed into the 
8033 \begin_inset Flex CharStyle:Code
8034 status collapsed
8035
8036 \begin_layout Plain Layout
8037 TitleLatexName
8038 \end_layout
8039
8040 \end_inset
8041
8042  environment.
8043 \end_layout
8044
8045 \begin_layout Description
8046 \begin_inset Flex CharStyle:Code
8047 status open
8048
8049 \begin_layout Plain Layout
8050 TocDepth
8051 \end_layout
8052
8053 \end_inset
8054
8055  Sets which divisions are included in the table of contents.
8056  Corresponds to the 
8057 \begin_inset Flex CharStyle:Code
8058 status collapsed
8059
8060 \begin_layout Plain Layout
8061 tocdepth
8062 \end_layout
8063
8064 \end_inset
8065
8066  counter in LaTeX.
8067 \end_layout
8068
8069 \begin_layout Subsection
8070 \begin_inset Flex CharStyle:Code
8071 status collapsed
8072
8073 \begin_layout Plain Layout
8074 ClassOptions
8075 \end_layout
8076
8077 \end_inset
8078
8079  section
8080 \end_layout
8081
8082 \begin_layout Standard
8083 \begin_inset CommandInset label
8084 LatexCommand label
8085 name "sec:classoptions"
8086
8087 \end_inset
8088
8089 The 
8090 \begin_inset Flex CharStyle:Code
8091 status collapsed
8092
8093 \begin_layout Plain Layout
8094 ClassOptions
8095 \end_layout
8096
8097 \end_inset
8098
8099  section can contain the following entries:
8100 \end_layout
8101
8102 \begin_layout Description
8103 \begin_inset Flex CharStyle:Code
8104 status collapsed
8105
8106 \begin_layout Plain Layout
8107 FontSize
8108 \end_layout
8109
8110 \end_inset
8111
8112  [
8113 \begin_inset Flex CharStyle:Code
8114 status collapsed
8115
8116 \begin_layout Plain Layout
8117 string="10|11|12"
8118 \end_layout
8119
8120 \end_inset
8121
8122 ] The list of available font sizes for the document's main font, separated
8123  by 
8124 \begin_inset Quotes eld
8125 \end_inset
8126
8127
8128 \begin_inset Flex CharStyle:Code
8129 status collapsed
8130
8131 \begin_layout Plain Layout
8132 |
8133 \end_layout
8134
8135 \end_inset
8136
8137
8138 \begin_inset Quotes erd
8139 \end_inset
8140
8141 .
8142 \end_layout
8143
8144 \begin_layout Description
8145 \begin_inset Flex CharStyle:Code
8146 status collapsed
8147
8148 \begin_layout Plain Layout
8149 Header
8150 \end_layout
8151
8152 \end_inset
8153
8154  Used to set the DTD line with XML-based output classes.
8155  E.
8156 \begin_inset space \thinspace{}
8157 \end_inset
8158
8159 g.: PUBLIC 
8160 \begin_inset Quotes eld
8161 \end_inset
8162
8163 -//OASIS//DTD DocBook V4.2//EN
8164 \begin_inset Quotes erd
8165 \end_inset
8166
8167 .
8168 \end_layout
8169
8170 \begin_layout Description
8171 \begin_inset Flex CharStyle:Code
8172 status collapsed
8173
8174 \begin_layout Plain Layout
8175 PageStyle
8176 \end_layout
8177
8178 \end_inset
8179
8180  [
8181 \begin_inset Flex CharStyle:Code
8182 status collapsed
8183
8184 \begin_layout Plain Layout
8185 string="empty|plain|headings|fancy"
8186 \end_layout
8187
8188 \end_inset
8189
8190 ] The list of available page styles, separated by 
8191 \begin_inset Quotes eld
8192 \end_inset
8193
8194
8195 \begin_inset Flex CharStyle:Code
8196 status collapsed
8197
8198 \begin_layout Plain Layout
8199 |
8200 \end_layout
8201
8202 \end_inset
8203
8204
8205 \begin_inset Quotes erd
8206 \end_inset
8207
8208 .
8209 \end_layout
8210
8211 \begin_layout Description
8212 \begin_inset Flex CharStyle:Code
8213 status collapsed
8214
8215 \begin_layout Plain Layout
8216 Other
8217 \end_layout
8218
8219 \end_inset
8220
8221  [
8222 \begin_inset Flex CharStyle:Code
8223 status collapsed
8224
8225 \begin_layout Plain Layout
8226 string=""
8227 \end_layout
8228
8229 \end_inset
8230
8231 ] Some document class options, separated by a comma, that will be added
8232  to the optional part of the 
8233 \begin_inset Flex CharStyle:Code
8234 status collapsed
8235
8236 \begin_layout Plain Layout
8237
8238 \backslash
8239 documentclass
8240 \end_layout
8241
8242 \end_inset
8243
8244  command.
8245 \end_layout
8246
8247 \begin_layout Standard
8248 The 
8249 \begin_inset Flex CharStyle:Code
8250 status collapsed
8251
8252 \begin_layout Plain Layout
8253 ClassOptions
8254 \end_layout
8255
8256 \end_inset
8257
8258  section must end with 
8259 \begin_inset Quotes eld
8260 \end_inset
8261
8262
8263 \begin_inset Flex CharStyle:Code
8264 status collapsed
8265
8266 \begin_layout Plain Layout
8267 End
8268 \end_layout
8269
8270 \end_inset
8271
8272
8273 \begin_inset Quotes erd
8274 \end_inset
8275
8276 .
8277 \end_layout
8278
8279 \begin_layout Subsection
8280 Paragraph Styles
8281 \end_layout
8282
8283 \begin_layout Standard
8284 \begin_inset CommandInset label
8285 LatexCommand label
8286 name "sec:style"
8287
8288 \end_inset
8289
8290 A paragraph style description looks like this:
8291 \begin_inset Foot
8292 status collapsed
8293
8294 \begin_layout Plain Layout
8295 Note that this will either define a new layout or modify an existing one.
8296 \end_layout
8297
8298 \end_inset
8299
8300
8301 \end_layout
8302
8303 \begin_layout LyX-Code
8304 Style 
8305 \family roman
8306 \emph on
8307 name
8308 \end_layout
8309
8310 \begin_layout LyX-Code
8311  ...
8312 \end_layout
8313
8314 \begin_layout LyX-Code
8315 End
8316 \end_layout
8317
8318 \begin_layout Standard
8319 where the following commands are allowed:
8320 \end_layout
8321
8322 \begin_layout Description
8323 \begin_inset Flex CharStyle:Code
8324 status collapsed
8325
8326 \begin_layout Plain Layout
8327 Align
8328 \end_layout
8329
8330 \end_inset
8331
8332  [
8333 \begin_inset Flex CharStyle:Code
8334 status collapsed
8335
8336 \begin_layout Plain Layout
8337
8338 \emph on
8339 block
8340 \emph default
8341 , left, right, center
8342 \end_layout
8343
8344 \end_inset
8345
8346 ] Paragraph alignment.
8347 \end_layout
8348
8349 \begin_layout Description
8350 \begin_inset Flex CharStyle:Code
8351 status collapsed
8352
8353 \begin_layout Plain Layout
8354 AlignPossible
8355 \end_layout
8356
8357 \end_inset
8358
8359  [
8360 \begin_inset Flex CharStyle:Code
8361 status collapsed
8362
8363 \begin_layout Plain Layout
8364
8365 \emph on
8366 block
8367 \emph default
8368 , left, right, center
8369 \end_layout
8370
8371 \end_inset
8372
8373 ] A comma separated list of permitted alignments.
8374  (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8375  sense.
8376  For example a right-aligned or centered enumeration isn't possible.)
8377 \end_layout
8378
8379 \begin_layout Description
8380 \begin_inset Flex CharStyle:Code
8381 status collapsed
8382
8383 \begin_layout Plain Layout
8384 BottomSep
8385 \end_layout
8386
8387 \end_inset
8388
8389  [
8390 \begin_inset Flex CharStyle:Code
8391 status collapsed
8392
8393 \begin_layout Plain Layout
8394 float=0
8395 \end_layout
8396
8397 \end_inset
8398
8399 ]
8400 \begin_inset Foot
8401 status collapsed
8402
8403 \begin_layout Plain Layout
8404 Note that a `float' here is a real number, such as: 1.5.
8405 \end_layout
8406
8407 \end_inset
8408
8409  The vertical space with which the last of a chain of paragraphs with this
8410  layout is separated from the following paragraph.
8411  If the next paragraph has another layout, the separations are not simply
8412  added, but the maximum is taken.
8413 \end_layout
8414
8415 \begin_layout Description
8416 \begin_inset Flex CharStyle:Code
8417 status collapsed
8418
8419 \begin_layout Plain Layout
8420 Category
8421 \end_layout
8422
8423 \end_inset
8424
8425  
8426 \begin_inset Flex CharStyle:Code
8427 status collapsed
8428
8429 \begin_layout Plain Layout
8430 [string]
8431 \end_layout
8432
8433 \end_inset
8434
8435  The category for this style.
8436  This is used to group related styles in the Layout combobox on the toolbar.
8437  Any string can be used, but you may want to use existing categories with
8438  your own styles.
8439  
8440 \end_layout
8441
8442 \begin_layout Description
8443 \begin_inset Flex CharStyle:Code
8444 status collapsed
8445
8446 \begin_layout Plain Layout
8447 CommandDepth
8448 \end_layout
8449
8450 \end_inset
8451
8452  Depth of XML command.
8453  Used only with XML-type formats.
8454 \end_layout
8455
8456 \begin_layout Description
8457 \begin_inset Flex CharStyle:Code
8458 status collapsed
8459
8460 \begin_layout Plain Layout
8461 CopyStyle
8462 \end_layout
8463
8464 \end_inset
8465
8466  
8467 \begin_inset CommandInset label
8468 LatexCommand label
8469 name "des:CopyStyle"
8470
8471 \end_inset
8472
8473
8474 \begin_inset Flex CharStyle:Code
8475 status collapsed
8476
8477 \begin_layout Plain Layout
8478 [string]
8479 \end_layout
8480
8481 \end_inset
8482
8483  Copies all the features of an existing style into the current one.
8484  
8485 \end_layout
8486
8487 \begin_layout Description
8488 \begin_inset Flex CharStyle:Code
8489 status collapsed
8490
8491 \begin_layout Plain Layout
8492 DependsOn
8493 \end_layout
8494
8495 \end_inset
8496
8497  The name of a style whose preamble should be output 
8498 \emph on
8499 before
8500 \emph default
8501  this one.
8502  This allows to ensure some ordering of the preamble snippets when macros
8503  definitions depend on one another.
8504 \begin_inset Foot
8505 status collapsed
8506
8507 \begin_layout Plain Layout
8508 Note that, besides that functionality, there is no way to ensure any ordering
8509  of preambles.
8510  The ordering that you see in a given version of LyX may change without
8511  warning in later versions.
8512 \end_layout
8513
8514 \end_inset
8515
8516
8517 \end_layout
8518
8519 \begin_layout Description
8520 \begin_inset Flex CharStyle:Code
8521 status collapsed
8522
8523 \begin_layout Plain Layout
8524 EndLabeltype
8525 \end_layout
8526
8527 \end_inset
8528
8529  [
8530 \begin_inset Flex CharStyle:Code
8531 status collapsed
8532
8533 \begin_layout Plain Layout
8534
8535 \emph on
8536 No_Label
8537 \emph default
8538 , Box, Filled_Box, Static
8539 \end_layout
8540
8541 \end_inset
8542
8543 ] The type of label that stands at the end of the paragraph (or sequence
8544  of paragraphs if 
8545 \begin_inset Flex CharStyle:Code
8546 status collapsed
8547
8548 \begin_layout Plain Layout
8549 LatexType
8550 \end_layout
8551
8552 \end_inset
8553
8554  is 
8555 \begin_inset Flex CharStyle:Code
8556 status collapsed
8557
8558 \begin_layout Plain Layout
8559 Environment
8560 \end_layout
8561
8562 \end_inset
8563
8564
8565 \begin_inset Flex CharStyle:Code
8566 status collapsed
8567
8568 \begin_layout Plain Layout
8569 Item_Environment
8570 \end_layout
8571
8572 \end_inset
8573
8574  or 
8575 \begin_inset Flex CharStyle:Code
8576 status collapsed
8577
8578 \begin_layout Plain Layout
8579 List_Environment
8580 \end_layout
8581
8582 \end_inset
8583
8584 ).
8585  
8586 \begin_inset Flex CharStyle:Code
8587 status collapsed
8588
8589 \begin_layout Plain Layout
8590 No_Label
8591 \end_layout
8592
8593 \end_inset
8594
8595  means 
8596 \begin_inset Quotes eld
8597 \end_inset
8598
8599 nothing
8600 \begin_inset Quotes erd
8601 \end_inset
8602
8603
8604 \begin_inset Flex CharStyle:Code
8605 status collapsed
8606
8607 \begin_layout Plain Layout
8608 Box
8609 \end_layout
8610
8611 \end_inset
8612
8613  (resp.
8614 \begin_inset Flex CharStyle:Code
8615 status collapsed
8616
8617 \begin_layout Plain Layout
8618 \begin_inset space ~
8619 \end_inset
8620
8621 Filled_Box
8622 \end_layout
8623
8624 \end_inset
8625
8626 ) is a white (resp.
8627 \begin_inset space ~
8628 \end_inset
8629
8630 black) square suitable for end of proof markers, 
8631 \begin_inset Flex CharStyle:Code
8632 status collapsed
8633
8634 \begin_layout Plain Layout
8635 Static
8636 \end_layout
8637
8638 \end_inset
8639
8640  is an explicit text string.
8641 \end_layout
8642
8643 \begin_layout Description
8644 \begin_inset Flex CharStyle:Code
8645 status collapsed
8646
8647 \begin_layout Plain Layout
8648 EndLabelString
8649 \end_layout
8650
8651 \end_inset
8652
8653  [
8654 \begin_inset Flex CharStyle:Code
8655 status collapsed
8656
8657 \begin_layout Plain Layout
8658 string=""
8659 \end_layout
8660
8661 \end_inset
8662
8663 ] The string used for a label with a 
8664 \begin_inset Flex CharStyle:Code
8665 status collapsed
8666
8667 \begin_layout Plain Layout
8668 Static
8669 \end_layout
8670
8671 \end_inset
8672
8673  
8674 \begin_inset Flex CharStyle:Code
8675 status collapsed
8676
8677 \begin_layout Plain Layout
8678 EndLabelType
8679 \end_layout
8680
8681 \end_inset
8682
8683 .
8684  
8685 \end_layout
8686
8687 \begin_layout Description
8688 \begin_inset Flex CharStyle:Code
8689 status collapsed
8690
8691 \begin_layout Plain Layout
8692 Fill_Bottom
8693 \end_layout
8694
8695 \end_inset
8696
8697  [
8698 \begin_inset Flex CharStyle:Code
8699 status collapsed
8700
8701 \begin_layout Plain Layout
8702
8703 \emph on
8704 0
8705 \emph default
8706 ,1
8707 \end_layout
8708
8709 \end_inset
8710
8711 ] Similar to 
8712 \begin_inset Flex CharStyle:Code
8713 status collapsed
8714
8715 \begin_layout Plain Layout
8716 Fill_Top
8717 \end_layout
8718
8719 \end_inset
8720
8721 .
8722 \end_layout
8723
8724 \begin_layout Description
8725 \begin_inset Flex CharStyle:Code
8726 status collapsed
8727
8728 \begin_layout Plain Layout
8729 Fill_Top
8730 \end_layout
8731
8732 \end_inset
8733
8734  [
8735 \begin_inset Flex CharStyle:Code
8736 status collapsed
8737
8738 \begin_layout Plain Layout
8739
8740 \emph on
8741 0
8742 \emph default
8743 ,1
8744 \end_layout
8745
8746 \end_inset
8747
8748 ] With this parameter the 
8749 \begin_inset Flex CharStyle:MenuItem
8750 status collapsed
8751
8752 \begin_layout Plain Layout
8753 Fill
8754 \end_layout
8755
8756 \end_inset
8757
8758  value of the 
8759 \begin_inset Quotes eld
8760 \end_inset
8761
8762 Vertical space above
8763 \begin_inset Quotes erd
8764 \end_inset
8765
8766  list of the 
8767 \begin_inset Flex CharStyle:MenuItem
8768 status collapsed
8769
8770 \begin_layout Plain Layout
8771 Edit\SpecialChar \menuseparator
8772 Paragraph
8773 \begin_inset space ~
8774 \end_inset
8775
8776 Settings
8777 \end_layout
8778
8779 \end_inset
8780
8781  dialog can be set when initializing a paragraph with this style.
8782 \begin_inset Foot
8783 status collapsed
8784
8785 \begin_layout Plain Layout
8786
8787 \emph on
8788 Note from Jean-Marc:
8789 \emph default
8790  I'm not sure that this setting has much use, and it should probably be
8791  removed in later versions.
8792 \end_layout
8793
8794 \end_inset
8795
8796  
8797 \end_layout
8798
8799 \begin_layout Description
8800 \begin_inset Flex CharStyle:Code
8801 status collapsed
8802
8803 \begin_layout Plain Layout
8804 Font
8805 \end_layout
8806
8807 \end_inset
8808
8809  The font used for both the text body 
8810 \emph on
8811 and
8812 \emph default
8813  the label.
8814  See section
8815 \begin_inset space ~
8816 \end_inset
8817
8818
8819 \begin_inset CommandInset ref
8820 LatexCommand ref
8821 reference "sec:fonts"
8822
8823 \end_inset
8824
8825 .
8826  Note that defining this font automatically defines the 
8827 \begin_inset Flex CharStyle:Code
8828 status collapsed
8829
8830 \begin_layout Plain Layout
8831 LabelFont
8832 \end_layout
8833
8834 \end_inset
8835
8836  to the same value.
8837  So you should define this one first if you also want to define 
8838 \begin_inset Flex CharStyle:Code
8839 status collapsed
8840
8841 \begin_layout Plain Layout
8842 LabelFont
8843 \end_layout
8844
8845 \end_inset
8846
8847 .
8848 \end_layout
8849
8850 \begin_layout Description
8851 \begin_inset Flex CharStyle:Code
8852 status collapsed
8853
8854 \begin_layout Plain Layout
8855 FreeSpacing
8856 \end_layout
8857
8858 \end_inset
8859
8860  
8861 \begin_inset CommandInset label
8862 LatexCommand label
8863 name "des:FreeSpacing"
8864
8865 \end_inset
8866
8867 [
8868 \emph on
8869
8870 \begin_inset Flex CharStyle:Code
8871 status collapsed
8872
8873 \begin_layout Plain Layout
8874
8875 \emph on
8876 0
8877 \end_layout
8878
8879 \end_inset
8880
8881
8882 \emph default
8883
8884 \begin_inset Flex CharStyle:Code
8885 status collapsed
8886
8887 \begin_layout Plain Layout
8888 1
8889 \end_layout
8890
8891 \end_inset
8892
8893 ] Usually LyX doesn't allow you to insert more than one space between words,
8894  since a space is considered as the separation between two words, not a
8895  character or symbol of its own.
8896  This is a very fine thing but sometimes annoying, for example, when typing
8897  program code or plain LaTeX code.
8898  For this reason, 
8899 \begin_inset Flex CharStyle:Code
8900 status collapsed
8901
8902 \begin_layout Plain Layout
8903 FreeSpacing
8904 \end_layout
8905
8906 \end_inset
8907
8908  can be enabled.
8909  Note that LyX will create protected blanks for the additional blanks when
8910  in another mode than LaTeX-mode.
8911 \end_layout
8912
8913 \begin_layout Description
8914 \begin_inset Flex CharStyle:Code
8915 status collapsed
8916
8917 \begin_layout Plain Layout
8918 InnerTag
8919 \end_layout
8920
8921 \end_inset
8922
8923  [[FIXME]] (Used only with XML-type formats.)
8924 \end_layout
8925
8926 \begin_layout Description
8927 \begin_inset Flex CharStyle:Code
8928 status collapsed
8929
8930 \begin_layout Plain Layout
8931 InTitle
8932 \end_layout
8933
8934 \end_inset
8935
8936  
8937 \begin_inset Flex CharStyle:Code
8938 status collapsed
8939
8940 \begin_layout Plain Layout
8941 [1, 0]
8942 \end_layout
8943
8944 \end_inset
8945
8946  If 1, marks the layout as being part of a title block (see also the 
8947 \begin_inset Flex CharStyle:Code
8948 status collapsed
8949
8950 \begin_layout Plain Layout
8951 TitleLatexType
8952 \end_layout
8953
8954 \end_inset
8955
8956  and 
8957 \begin_inset Flex CharStyle:Code
8958 status collapsed
8959
8960 \begin_layout Plain Layout
8961 TitleLatexName
8962 \end_layout
8963
8964 \end_inset
8965
8966  global entries).
8967 \end_layout
8968
8969 \begin_layout Description
8970 \begin_inset Flex CharStyle:Code
8971 status collapsed
8972
8973 \begin_layout Plain Layout
8974 ItemSep
8975 \end_layout
8976
8977 \end_inset
8978
8979  [
8980 \begin_inset Flex CharStyle:Code
8981 status collapsed
8982
8983 \begin_layout Plain Layout
8984 float=0
8985 \end_layout
8986
8987 \end_inset
8988
8989 ] This provides extra space between paragraphs that have the same layout.
8990  If you put other layouts into an environment, each is separated with the
8991  environment's 
8992 \begin_inset Flex CharStyle:Code
8993 status collapsed
8994
8995 \begin_layout Plain Layout
8996 Parsep
8997 \end_layout
8998
8999 \end_inset
9000
9001 .
9002  But the whole items of the environment are additionally separated with
9003  this 
9004 \begin_inset Flex CharStyle:Code
9005 status collapsed
9006
9007 \begin_layout Plain Layout
9008 Itemsep
9009 \end_layout
9010
9011 \end_inset
9012
9013 .
9014  Note that this is a
9015 \emph on
9016  multiplier.
9017 \end_layout
9018
9019 \begin_layout Description
9020 \begin_inset Flex CharStyle:Code
9021 status collapsed
9022
9023 \begin_layout Plain Layout
9024 ItemTag
9025 \end_layout
9026
9027 \end_inset
9028
9029  [[FIXME]] (Used only with XML-type formats.)
9030 \end_layout
9031
9032 \begin_layout Description
9033 \begin_inset Flex CharStyle:Code
9034 status collapsed
9035
9036 \begin_layout Plain Layout
9037 KeepEmpty
9038 \end_layout
9039
9040 \end_inset
9041
9042  
9043 \begin_inset CommandInset label
9044 LatexCommand label
9045 name "des:KeepEmpty"
9046
9047 \end_inset
9048
9049 [
9050 \emph on
9051
9052 \begin_inset Flex CharStyle:Code
9053 status collapsed
9054
9055 \begin_layout Plain Layout
9056
9057 \emph on
9058 0
9059 \end_layout
9060
9061 \end_inset
9062
9063
9064 \emph default
9065
9066 \begin_inset Flex CharStyle:Code
9067 status collapsed
9068
9069 \begin_layout Plain Layout
9070 1
9071 \end_layout
9072
9073 \end_inset
9074
9075 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9076  lead to empty LaTeX output.
9077  There are some cases where this could be desirable however: in a letter
9078  template, the required fields can be provided as empty fields, so that
9079  people do not forget them; in some special classes, a layout can be used
9080  as some kind of break, which does not contain actual text.
9081 \end_layout
9082
9083 \begin_layout Description
9084 \begin_inset Flex CharStyle:Code
9085 status collapsed
9086
9087 \begin_layout Plain Layout
9088 LabelBottomsep
9089 \end_layout
9090
9091 \end_inset
9092
9093  [float=0] The vertical space between the label and the text body.
9094  Only used for labels that are above the text body (
9095 \begin_inset Flex CharStyle:Code
9096 status collapsed
9097
9098 \begin_layout Plain Layout
9099 Top_Environment
9100 \end_layout
9101
9102 \end_inset
9103
9104
9105 \begin_inset Flex CharStyle:Code
9106 status collapsed
9107
9108 \begin_layout Plain Layout
9109 Centered_Top_Environment
9110 \end_layout
9111
9112 \end_inset
9113
9114 ).
9115 \end_layout
9116
9117 \begin_layout Description
9118 \begin_inset Flex CharStyle:Code
9119 status collapsed
9120
9121 \begin_layout Plain Layout
9122 LabelCounter
9123 \end_layout
9124
9125 \end_inset
9126
9127  [
9128 \begin_inset Flex CharStyle:Code
9129 status collapsed
9130
9131 \begin_layout Plain Layout
9132 string=""
9133 \end_layout
9134
9135 \end_inset
9136
9137 ]
9138 \begin_inset Newline newline
9139 \end_inset
9140
9141 The name of the counter for automatic numbering (see Section 
9142 \begin_inset CommandInset ref
9143 LatexCommand ref
9144 reference "sec:counter"
9145
9146 \end_inset
9147
9148  for details).
9149  This must be given if 
9150 \begin_inset Flex CharStyle:Code
9151 status collapsed
9152
9153 \begin_layout Plain Layout
9154 Labeltype
9155 \end_layout
9156
9157 \end_inset
9158
9159  is 
9160 \begin_inset Flex CharStyle:Code
9161 status collapsed
9162
9163 \begin_layout Plain Layout
9164 Counter
9165 \end_layout
9166
9167 \end_inset
9168
9169 .
9170 \end_layout
9171
9172 \begin_layout Description
9173 \begin_inset Flex CharStyle:Code
9174 status collapsed
9175
9176 \begin_layout Plain Layout
9177 LabelFont
9178 \end_layout
9179
9180 \end_inset
9181
9182  The font used for the label.
9183  See section
9184 \begin_inset space ~
9185 \end_inset
9186
9187
9188 \begin_inset CommandInset ref
9189 LatexCommand ref
9190 reference "sec:fonts"
9191
9192 \end_inset
9193
9194 .
9195 \end_layout
9196
9197 \begin_layout Description
9198 \begin_inset Flex CharStyle:Code
9199 status collapsed
9200
9201 \begin_layout Plain Layout
9202 LabelIndent
9203 \end_layout
9204
9205 \end_inset
9206
9207  Text that indicates how far a label should be indented.
9208 \end_layout
9209
9210 \begin_layout Description
9211 \begin_inset Flex CharStyle:Code
9212 status collapsed
9213
9214 \begin_layout Plain Layout
9215 Labelsep
9216 \end_layout
9217
9218 \end_inset
9219
9220  [
9221 \begin_inset Flex CharStyle:Code
9222 status collapsed
9223
9224 \begin_layout Plain Layout
9225 string=""
9226 \end_layout
9227
9228 \end_inset
9229
9230 ] The horizontal space between the label and the text body.
9231  Only used for labels that are not above the text body.
9232 \end_layout
9233
9234 \begin_layout Description
9235 \begin_inset Flex CharStyle:Code
9236 status collapsed
9237
9238 \begin_layout Plain Layout
9239 LabelString
9240 \end_layout
9241
9242 \end_inset
9243
9244  [
9245 \begin_inset Flex CharStyle:Code
9246 status collapsed
9247
9248 \begin_layout Plain Layout
9249 string=""
9250 \end_layout
9251
9252 \end_inset
9253
9254 ] The string used for a label with a 
9255 \begin_inset Flex CharStyle:Code
9256 status collapsed
9257
9258 \begin_layout Plain Layout
9259 Static
9260 \end_layout
9261
9262 \end_inset
9263
9264  labeltype.
9265  When 
9266 \begin_inset Flex CharStyle:Code
9267 status collapsed
9268
9269 \begin_layout Plain Layout
9270 LabelCounter
9271 \end_layout
9272
9273 \end_inset
9274
9275  is set, this string can be contain the special formatting commands described
9276  in Section 
9277 \begin_inset CommandInset ref
9278 LatexCommand ref
9279 reference "sec:counter"
9280
9281 \end_inset
9282
9283 .
9284 \begin_inset Foot
9285 status collapsed
9286
9287 \begin_layout Plain Layout
9288 For the sake of backwards compatibility, the string 
9289 \begin_inset Flex CharStyle:Code
9290 status collapsed
9291
9292 \begin_layout Plain Layout
9293 @
9294 \emph on
9295 style-name
9296 \emph default
9297 @
9298 \end_layout
9299
9300 \end_inset
9301
9302  will be replaced by the expanded 
9303 \begin_inset Flex CharStyle:Code
9304 status collapsed
9305
9306 \begin_layout Plain Layout
9307 LabelString
9308 \end_layout
9309
9310 \end_inset
9311
9312  of style 
9313 \begin_inset Flex CharStyle:Code
9314 status collapsed
9315
9316 \begin_layout Plain Layout
9317
9318 \emph on
9319 style-name
9320 \end_layout
9321
9322 \end_inset
9323
9324 .
9325  This feature is now obsolete and should be replaced by the mechanisms of
9326  Section 
9327 \begin_inset CommandInset ref
9328 LatexCommand ref
9329 reference "sec:counter"
9330
9331 \end_inset
9332
9333 .
9334 \end_layout
9335
9336 \end_inset
9337
9338
9339 \end_layout
9340
9341 \begin_layout Description
9342 \begin_inset Flex CharStyle:Code
9343 status collapsed
9344
9345 \begin_layout Plain Layout
9346 LabelStringAppendix
9347 \end_layout
9348
9349 \end_inset
9350
9351  [
9352 \begin_inset Flex CharStyle:Code
9353 status collapsed
9354
9355 \begin_layout Plain Layout
9356 string=""
9357 \end_layout
9358
9359 \end_inset
9360
9361 ] This is used inside the appendix instead of 
9362 \begin_inset Flex CharStyle:Code
9363 status collapsed
9364
9365 \begin_layout Plain Layout
9366 LabelString
9367 \end_layout
9368
9369 \end_inset
9370
9371 .
9372  Note that every 
9373 \begin_inset Flex CharStyle:Code
9374 status collapsed
9375
9376 \begin_layout Plain Layout
9377 LabelString
9378 \end_layout
9379
9380 \end_inset
9381
9382  statement resets 
9383 \begin_inset Flex CharStyle:Code
9384 status collapsed
9385
9386 \begin_layout Plain Layout
9387 LabelStringAppendix
9388 \end_layout
9389
9390 \end_inset
9391
9392  too.
9393 \end_layout
9394
9395 \begin_layout Description
9396 \begin_inset Flex CharStyle:Code
9397 status collapsed
9398
9399 \begin_layout Plain Layout
9400 LabelTag
9401 \end_layout
9402
9403 \end_inset
9404
9405  [FIXME] (Used only with XML-type formats.)
9406 \end_layout
9407
9408 \begin_layout Description
9409 \begin_inset Flex CharStyle:Code
9410 status collapsed
9411
9412 \begin_layout Plain Layout
9413 Labeltype
9414 \end_layout
9415
9416 \end_inset
9417
9418  [
9419 \begin_inset Flex CharStyle:Code
9420 status collapsed
9421
9422 \begin_layout Plain Layout
9423
9424 \emph on
9425 No_Label
9426 \emph default
9427 , Manual, Static, Top_Environment, 
9428 \begin_inset Newline newline
9429 \end_inset
9430
9431 Centered_Top_Environment, Sensitive, Counter
9432 \end_layout
9433
9434 \end_inset
9435
9436
9437 \begin_inset Newline newline
9438 \end_inset
9439
9440
9441 \begin_inset Flex CharStyle:Code
9442 status collapsed
9443
9444 \begin_layout Plain Layout
9445 Manual
9446 \end_layout
9447
9448 \end_inset
9449
9450  means the label is the very first word (up to the first real blank).
9451 \begin_inset Foot
9452 status collapsed
9453
9454 \begin_layout Plain Layout
9455 Use protected spaces if you want more than one word as the label.
9456 \end_layout
9457
9458 \end_inset
9459
9460  
9461 \begin_inset Flex CharStyle:Code
9462 status collapsed
9463
9464 \begin_layout Plain Layout
9465 Static
9466 \end_layout
9467
9468 \end_inset
9469
9470  means it is defined in the layout (see 
9471 \begin_inset Flex CharStyle:Code
9472 status collapsed
9473
9474 \begin_layout Plain Layout
9475 LabelString
9476 \end_layout
9477
9478 \end_inset
9479
9480 ).
9481  
9482 \begin_inset Flex CharStyle:Code
9483 status collapsed
9484
9485 \begin_layout Plain Layout
9486 Top_Environment
9487 \end_layout
9488
9489 \end_inset
9490
9491  and 
9492 \begin_inset Flex CharStyle:Code
9493 status collapsed
9494
9495 \begin_layout Plain Layout
9496 Centered_Top_Environment
9497 \end_layout
9498
9499 \end_inset
9500
9501  are special cases of 
9502 \begin_inset Flex CharStyle:Code
9503 status collapsed
9504
9505 \begin_layout Plain Layout
9506 Static
9507 \end_layout
9508
9509 \end_inset
9510
9511 .
9512  The label will be printed above the paragraph, but only at the top of an
9513  environment or the top of a chain of paragraphs with this layout.
9514  Usage is for example the 
9515 \begin_inset Flex CharStyle:MenuItem
9516 status collapsed
9517
9518 \begin_layout Plain Layout
9519 Abstract
9520 \end_layout
9521
9522 \end_inset
9523
9524  layout or the 
9525 \begin_inset Flex CharStyle:MenuItem
9526 status collapsed
9527
9528 \begin_layout Plain Layout
9529 Bibliography
9530 \end_layout
9531
9532 \end_inset
9533
9534  layout.
9535  This is also the case for 
9536 \begin_inset Flex CharStyle:Code
9537 status collapsed
9538
9539 \begin_layout Plain Layout
9540 Manual
9541 \end_layout
9542
9543 \end_inset
9544
9545  labels with latex type 
9546 \begin_inset Flex CharStyle:Code
9547 status collapsed
9548
9549 \begin_layout Plain Layout
9550 Environment
9551 \end_layout
9552
9553 \end_inset
9554
9555 , in order to make layouts for theorems work correctly.
9556  
9557 \begin_inset Flex CharStyle:Code
9558 status collapsed
9559
9560 \begin_layout Plain Layout
9561 Sensitive
9562 \end_layout
9563
9564 \end_inset
9565
9566  is a special case for the caption-labels 
9567 \begin_inset Quotes eld
9568 \end_inset
9569
9570 Figure
9571 \begin_inset Quotes erd
9572 \end_inset
9573
9574  and 
9575 \begin_inset Quotes eld
9576 \end_inset
9577
9578 Table
9579 \begin_inset Quotes erd
9580 \end_inset
9581
9582 .
9583  
9584 \begin_inset Flex CharStyle:Code
9585 status collapsed
9586
9587 \begin_layout Plain Layout
9588 Sensitive
9589 \end_layout
9590
9591 \end_inset
9592
9593  means the (hardcoded) label string depends on the kind of float.
9594  The 
9595 \begin_inset Flex CharStyle:Code
9596 status collapsed
9597
9598 \begin_layout Plain Layout
9599 Counter
9600 \end_layout
9601
9602 \end_inset
9603
9604  label type defines automatically numbered labels.
9605  See Section 
9606 \begin_inset CommandInset ref
9607 LatexCommand ref
9608 reference "sec:counter"
9609
9610 \end_inset
9611
9612 .
9613 \end_layout
9614
9615 \begin_layout Description
9616 \begin_inset Flex CharStyle:Code
9617 status collapsed
9618
9619 \begin_layout Plain Layout
9620 LatexName
9621 \end_layout
9622
9623 \end_inset
9624
9625  The name of the corresponding LaTeX stuff.
9626  Either the environment or command name.
9627 \end_layout
9628
9629 \begin_layout Description
9630 \begin_inset Flex CharStyle:Code
9631 status collapsed
9632
9633 \begin_layout Plain Layout
9634 LatexParam
9635 \end_layout
9636
9637 \end_inset
9638
9639  An optional parameter for the corresponding 
9640 \begin_inset Flex CharStyle:Code
9641 status collapsed
9642
9643 \begin_layout Plain Layout
9644 LatexName
9645 \end_layout
9646
9647 \end_inset
9648
9649  stuff.
9650  This parameter cannot be changed from within LyX.
9651 \end_layout
9652
9653 \begin_layout Description
9654 \begin_inset Flex CharStyle:Code
9655 status collapsed
9656
9657 \begin_layout Plain Layout
9658 LatexType
9659 \end_layout
9660
9661 \end_inset
9662
9663  
9664 \begin_inset CommandInset label
9665 LatexCommand label
9666 name "des:LatexType"
9667
9668 \end_inset
9669
9670 [
9671 \begin_inset Flex CharStyle:Code
9672 status collapsed
9673
9674 \begin_layout Plain Layout
9675
9676 \emph on
9677 Paragraph
9678 \emph default
9679 , Command, Environment, Item_Environment,
9680 \end_layout
9681
9682 \end_inset
9683
9684  
9685 \begin_inset Flex CharStyle:Code
9686 status collapsed
9687
9688 \begin_layout Plain Layout
9689 List_Environment
9690 \end_layout
9691
9692 \end_inset
9693
9694 ] How the layout should be translated into LaTeX.
9695  
9696 \begin_inset Flex CharStyle:Code
9697 status collapsed
9698
9699 \begin_layout Plain Layout
9700 Paragraph
9701 \end_layout
9702
9703 \end_inset
9704
9705  means nothing special.
9706  
9707 \begin_inset Flex CharStyle:Code
9708 status collapsed
9709
9710 \begin_layout Plain Layout
9711 Command
9712 \end_layout
9713
9714 \end_inset
9715
9716  means 
9717 \begin_inset Flex CharStyle:Code
9718 status collapsed
9719
9720 \begin_layout Plain Layout
9721
9722 \backslash
9723
9724 \emph on
9725 LatexName
9726 \emph default
9727 {\SpecialChar \ldots{}
9728 }
9729 \end_layout
9730
9731 \end_inset
9732
9733  and 
9734 \begin_inset Flex CharStyle:Code
9735 status collapsed
9736
9737 \begin_layout Plain Layout
9738 Environment
9739 \end_layout
9740
9741 \end_inset
9742
9743  means 
9744 \begin_inset Flex CharStyle:Code
9745 status collapsed
9746
9747 \begin_layout Plain Layout
9748
9749 \backslash
9750 begin{
9751 \emph on
9752 LatexName
9753 \emph default
9754 }\SpecialChar \ldots{}
9755
9756 \backslash
9757 end{
9758 \emph on
9759 LatexName
9760 \emph default
9761 }
9762 \end_layout
9763
9764 \end_inset
9765
9766 .
9767  
9768 \begin_inset Flex CharStyle:Code
9769 status collapsed
9770
9771 \begin_layout Plain Layout
9772 Item_Environment
9773 \end_layout
9774
9775 \end_inset
9776
9777  is the same as 
9778 \begin_inset Flex CharStyle:Code
9779 status collapsed
9780
9781 \begin_layout Plain Layout
9782 Environment
9783 \end_layout
9784
9785 \end_inset
9786
9787 , except that a 
9788 \begin_inset Flex CharStyle:Code
9789 status collapsed
9790
9791 \begin_layout Plain Layout
9792
9793 \backslash
9794 item
9795 \end_layout
9796
9797 \end_inset
9798
9799  is generated for each paragraph of this environment.
9800  
9801 \begin_inset Flex CharStyle:Code
9802 status collapsed
9803
9804 \begin_layout Plain Layout
9805 List_Environment
9806 \end_layout
9807
9808 \end_inset
9809
9810  is the same as 
9811 \begin_inset Flex CharStyle:Code
9812 status collapsed
9813
9814 \begin_layout Plain Layout
9815 Item_Environment
9816 \end_layout
9817
9818 \end_inset
9819
9820 , except that 
9821 \begin_inset Flex CharStyle:Code
9822 status collapsed
9823
9824 \begin_layout Plain Layout
9825 LabelWidthString
9826 \end_layout
9827
9828 \end_inset
9829
9830  is passed as an argument to the environment.
9831  
9832 \begin_inset Flex CharStyle:Code
9833 status collapsed
9834
9835 \begin_layout Plain Layout
9836 LabelWidthString
9837 \end_layout
9838
9839 \end_inset
9840
9841  can be defined in the 
9842 \begin_inset Flex CharStyle:MenuItem
9843 status collapsed
9844
9845 \begin_layout Plain Layout
9846
9847 \bar under
9848 L
9849 \bar default
9850 ayout\SpecialChar \menuseparator
9851
9852 \bar under
9853 P
9854 \bar default
9855 aragraph
9856 \end_layout
9857
9858 \end_inset
9859
9860  dialog.
9861  
9862 \begin_inset Flex CharStyle:Code
9863 status collapsed
9864
9865 \begin_layout Plain Layout
9866
9867 \emph on
9868 LatexType
9869 \end_layout
9870
9871 \end_inset
9872
9873  is perhaps a bit misleading, since these rules apply to SGML classes, too.
9874  Visit the SGML class files for specific examples.
9875 \end_layout
9876
9877 \begin_layout Standard
9878 Putting the last few things together, the LaTeX output will be either: 
9879 \end_layout
9880
9881 \begin_layout LyX-Code
9882
9883 \backslash
9884 latexname[latexparam]{\SpecialChar \ldots{}
9885 }
9886 \end_layout
9887
9888 \begin_layout Standard
9889 or: 
9890 \end_layout
9891
9892 \begin_layout LyX-Code
9893
9894 \backslash
9895 begin{latexname}[latexparam] \SpecialChar \ldots{}
9896  
9897 \backslash
9898 end{latexname}.
9899 \end_layout
9900
9901 \begin_layout Standard
9902 depending upon the LaTex type.
9903 \end_layout
9904
9905 \begin_layout Description
9906 \begin_inset Flex CharStyle:Code
9907 status collapsed
9908
9909 \begin_layout Plain Layout
9910 LeftMargin
9911 \end_layout
9912
9913 \end_inset
9914
9915  [
9916 \begin_inset Flex CharStyle:Code
9917 status collapsed
9918
9919 \begin_layout Plain Layout
9920 string=""
9921 \end_layout
9922
9923 \end_inset
9924
9925 ] If you put layouts into environments, the leftmargins are not simply added,
9926  but added with a factor 
9927 \begin_inset Formula $\frac{4}{depth+4}$
9928 \end_inset
9929
9930 .
9931  Note that this parameter is also used when the margin is defined as 
9932 \begin_inset Flex CharStyle:Code
9933 status collapsed
9934
9935 \begin_layout Plain Layout
9936 Manual
9937 \end_layout
9938
9939 \end_inset
9940
9941  or 
9942 \begin_inset Flex CharStyle:Code
9943 status collapsed
9944
9945 \begin_layout Plain Layout
9946 Dynamic
9947 \end_layout
9948
9949 \end_inset
9950
9951 .
9952  Then it is added to the manual or dynamic margin.
9953  
9954 \begin_inset Newline newline
9955 \end_inset
9956
9957 The argument is passed as a string.
9958  For example 
9959 \begin_inset Quotes eld
9960 \end_inset
9961
9962
9963 \begin_inset Flex CharStyle:Code
9964 status collapsed
9965
9966 \begin_layout Plain Layout
9967 MM
9968 \end_layout
9969
9970 \end_inset
9971
9972
9973 \begin_inset Quotes erd
9974 \end_inset
9975
9976  means that the paragraph is indented with the width of 
9977 \begin_inset Quotes eld
9978 \end_inset
9979
9980
9981 \begin_inset Flex CharStyle:Code
9982 status collapsed
9983
9984 \begin_layout Plain Layout
9985 MM
9986 \end_layout
9987
9988 \end_inset
9989
9990
9991 \begin_inset Quotes erd
9992 \end_inset
9993
9994  in the normal font.
9995  You can get a negative width by prefixing the string with 
9996 \begin_inset Quotes eld
9997 \end_inset
9998
9999
10000 \begin_inset Flex CharStyle:Code
10001 status collapsed
10002
10003 \begin_layout Plain Layout
10004 -
10005 \end_layout
10006
10007 \end_inset
10008
10009
10010 \begin_inset Quotes erd
10011 \end_inset
10012
10013 .
10014  This way was chosen so that the look is the same with each used screen
10015  font.
10016  
10017 \end_layout
10018
10019 \begin_layout Description
10020 \begin_inset Flex CharStyle:Code
10021 status collapsed
10022
10023 \begin_layout Plain Layout
10024 Margin
10025 \end_layout
10026
10027 \end_inset
10028
10029  [
10030 \begin_inset Flex CharStyle:Code
10031 status collapsed
10032
10033 \begin_layout Plain Layout
10034
10035 \emph on
10036 Static
10037 \emph default
10038 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10039 \end_layout
10040
10041 \end_inset
10042
10043
10044 \begin_inset Newline newline
10045 \end_inset
10046
10047 The kind of margin that the layout has on the left side.
10048  
10049 \begin_inset Flex CharStyle:Code
10050 status collapsed
10051
10052 \begin_layout Plain Layout
10053 Static
10054 \end_layout
10055
10056 \end_inset
10057
10058  just means a fixed margin.
10059  
10060 \begin_inset Flex CharStyle:Code
10061 status collapsed
10062
10063 \begin_layout Plain Layout
10064 Manual
10065 \end_layout
10066
10067 \end_inset
10068
10069  means that the left margin depends on the string entered in the 
10070 \begin_inset Flex CharStyle:MenuItem
10071 status collapsed
10072
10073 \begin_layout Plain Layout
10074 Edit\SpecialChar \menuseparator
10075 Paragraph
10076 \begin_inset space ~
10077 \end_inset
10078
10079 Settings
10080 \end_layout
10081
10082 \end_inset
10083
10084  dialog.
10085  This is used to typeset nice lists without tabulators.
10086  
10087 \begin_inset Flex CharStyle:Code
10088 status collapsed
10089
10090 \begin_layout Plain Layout
10091 Dynamic
10092 \end_layout
10093
10094 \end_inset
10095
10096  means that the margin depends on the size of the label.
10097  This is used for automatic enumerated headlines.
10098  It is obvious that the headline 
10099 \begin_inset Quotes eld
10100 \end_inset
10101
10102 5.4.3.2.1 Very long headline
10103 \begin_inset Quotes erd
10104 \end_inset
10105
10106  must have a wider left margin (as wide as 
10107 \begin_inset Quotes eld
10108 \end_inset
10109
10110 5.4.3.2.1
10111 \begin_inset Quotes erd
10112 \end_inset
10113
10114  plus the space) than 
10115 \begin_inset Quotes eld
10116 \end_inset
10117
10118 3.2 Very long headline
10119 \begin_inset Quotes erd
10120 \end_inset
10121
10122 , even if standard 
10123 \begin_inset Quotes eld
10124 \end_inset
10125
10126 word processors
10127 \begin_inset Quotes erd
10128 \end_inset
10129
10130  are not able to do this.
10131  
10132 \begin_inset Flex CharStyle:Code
10133 status collapsed
10134
10135 \begin_layout Plain Layout
10136 First_Dynamic
10137 \end_layout
10138
10139 \end_inset
10140
10141  is similar, but only the very first row of the paragraph is dynamic, while
10142  the others are static; this is used, for example, for descriptions.
10143  
10144 \begin_inset Flex CharStyle:Code
10145 status collapsed
10146
10147 \begin_layout Plain Layout
10148 Right_Address_Box
10149 \end_layout
10150
10151 \end_inset
10152
10153  means the margin is chosen in a way that the longest row of this paragraph
10154  fits to the right margin.
10155  This is used to typeset an address on the right edge of the page.
10156 \end_layout
10157
10158 \begin_layout Description
10159 \begin_inset Flex CharStyle:Code
10160 status collapsed
10161
10162 \begin_layout Plain Layout
10163 NeedProtect
10164 \end_layout
10165
10166 \end_inset
10167
10168  [
10169 \begin_inset Flex CharStyle:Code
10170 status collapsed
10171
10172 \begin_layout Plain Layout
10173
10174 \emph on
10175 0
10176 \end_layout
10177
10178 \end_inset
10179
10180 ,
10181 \begin_inset Flex CharStyle:Code
10182 status collapsed
10183
10184 \begin_layout Plain Layout
10185 1
10186 \end_layout
10187
10188 \end_inset
10189
10190 ] Whether fragile commands in this layout should be 
10191 \begin_inset Flex CharStyle:Code
10192 status collapsed
10193
10194 \begin_layout Plain Layout
10195
10196 \backslash
10197 protect
10198 \end_layout
10199
10200 \end_inset
10201
10202 'ed.
10203  (Note: This is 
10204 \emph on
10205 not
10206 \emph default
10207  whether this command should itself be protected.)
10208 \end_layout
10209
10210 \begin_layout Description
10211 \begin_inset Flex CharStyle:Code
10212 status collapsed
10213
10214 \begin_layout Plain Layout
10215 Newline
10216 \end_layout
10217
10218 \end_inset
10219
10220  [
10221 \begin_inset Flex CharStyle:Code
10222 status collapsed
10223
10224 \begin_layout Plain Layout
10225 0
10226 \end_layout
10227
10228 \end_inset
10229
10230
10231 \begin_inset Flex CharStyle:Code
10232 status collapsed
10233
10234 \begin_layout Plain Layout
10235
10236 \emph on
10237 1
10238 \end_layout
10239
10240 \end_inset
10241
10242 ] Whether newlines are translated into LaTeX newlines (
10243 \begin_inset Flex CharStyle:Code
10244 status collapsed
10245
10246 \begin_layout Plain Layout
10247
10248 \backslash
10249
10250 \backslash
10251
10252 \end_layout
10253
10254 \end_inset
10255
10256 ) or not.
10257  The translation can be switched off to allow more comfortable LaTeX editing
10258  inside LyX.
10259 \end_layout
10260
10261 \begin_layout Description
10262 \begin_inset Flex CharStyle:Code
10263 status collapsed
10264
10265 \begin_layout Plain Layout
10266 NextNoIndent
10267 \end_layout
10268
10269 \end_inset
10270
10271  [
10272 \begin_inset Flex CharStyle:Code
10273 status collapsed
10274
10275 \begin_layout Plain Layout
10276 1
10277 \end_layout
10278
10279 \end_inset
10280
10281
10282 \begin_inset Flex CharStyle:Code
10283 status collapsed
10284
10285 \begin_layout Plain Layout
10286
10287 \emph on
10288 0
10289 \end_layout
10290
10291 \end_inset
10292
10293 ] Whether the following Paragraph is allowed to indent its very first row.
10294  
10295 \begin_inset Flex CharStyle:Code
10296 status collapsed
10297
10298 \begin_layout Plain Layout
10299 1
10300 \end_layout
10301
10302 \end_inset
10303
10304  means that it is not allowed to do so; 
10305 \begin_inset Flex CharStyle:Code
10306 status collapsed
10307
10308 \begin_layout Plain Layout
10309 0
10310 \end_layout
10311
10312 \end_inset
10313
10314  means it could do so if it wants to.
10315 \end_layout
10316
10317 \begin_layout Description
10318 \begin_inset Flex CharStyle:Code
10319 status collapsed
10320
10321 \begin_layout Plain Layout
10322 ObsoletedBy
10323 \end_layout
10324
10325 \end_inset
10326
10327  Name of a layout that has replaced this layout.
10328  This is used to rename a layout, while keeping backward compatibility.
10329 \end_layout
10330
10331 \begin_layout Description
10332 \begin_inset Flex CharStyle:Code
10333 status collapsed
10334
10335 \begin_layout Plain Layout
10336 OptionalArgs
10337 \end_layout
10338
10339 \end_inset
10340
10341  [
10342 \begin_inset Flex CharStyle:Code
10343 status collapsed
10344
10345 \begin_layout Plain Layout
10346 int=0
10347 \end_layout
10348
10349 \end_inset
10350
10351 ] The number of optional arguments that can be used with this layout.
10352  This is useful for things like section headings, and only makes sense with
10353  LaTeX.
10354 \end_layout
10355
10356 \begin_layout Description
10357 \begin_inset Flex CharStyle:Code
10358 status collapsed
10359
10360 \begin_layout Plain Layout
10361 ParIndent
10362 \end_layout
10363
10364 \end_inset
10365
10366  [
10367 \begin_inset Flex CharStyle:Code
10368 status collapsed
10369
10370 \begin_layout Plain Layout
10371 string=""
10372 \end_layout
10373
10374 \end_inset
10375
10376 ] The indent of the very first line of a paragraph.
10377  The 
10378 \begin_inset Flex CharStyle:Code
10379 status collapsed
10380
10381 \begin_layout Plain Layout
10382 Parindent
10383 \end_layout
10384
10385 \end_inset
10386
10387  will be fixed for a certain layout.
10388  The exception is Standard layout, since the indentation of a Standard layout
10389  paragraph can be prohibited with 
10390 \begin_inset Flex CharStyle:Code
10391 status collapsed
10392
10393 \begin_layout Plain Layout
10394 NextNoIndent
10395 \end_layout
10396
10397 \end_inset
10398
10399 .
10400  Also, Standard layout paragraphs inside environments use the 
10401 \begin_inset Flex CharStyle:Code
10402 status collapsed
10403
10404 \begin_layout Plain Layout
10405 Parindent
10406 \end_layout
10407
10408 \end_inset
10409
10410  of the environment, not their native one.
10411  For example, Standard paragraphs inside an enumeration are not indented.
10412 \end_layout
10413
10414 \begin_layout Description
10415 \begin_inset Flex CharStyle:Code
10416 status collapsed
10417
10418 \begin_layout Plain Layout
10419 Parsep
10420 \end_layout
10421
10422 \end_inset
10423
10424  [
10425 \begin_inset Flex CharStyle:Code
10426 status collapsed
10427
10428 \begin_layout Plain Layout
10429 float=0
10430 \end_layout
10431
10432 \end_inset
10433
10434 ] The vertical space between two paragraphs of this layout.
10435 \end_layout
10436
10437 \begin_layout Description
10438 \begin_inset Flex CharStyle:Code
10439 status collapsed
10440
10441 \begin_layout Plain Layout
10442 Parskip
10443 \end_layout
10444
10445 \end_inset
10446
10447  [
10448 \begin_inset Flex CharStyle:Code
10449 status collapsed
10450
10451 \begin_layout Plain Layout
10452 float=0
10453 \end_layout
10454
10455 \end_inset
10456
10457 ] LyX allows the user to choose either 
10458 \begin_inset Quotes eld
10459 \end_inset
10460
10461 indent
10462 \begin_inset Quotes erd
10463 \end_inset
10464
10465  or 
10466 \begin_inset Quotes eld
10467 \end_inset
10468
10469 skip
10470 \begin_inset Quotes erd
10471 \end_inset
10472
10473  to typeset a document.
10474  When 
10475 \begin_inset Quotes eld
10476 \end_inset
10477
10478 indent
10479 \begin_inset Quotes erd
10480 \end_inset
10481
10482  is chosen, this value is completely ignored.
10483  When 
10484 \begin_inset Quotes eld
10485 \end_inset
10486
10487 skip
10488 \begin_inset Quotes erd
10489 \end_inset
10490
10491  is chosen, the parindent of a LaTeXtype 
10492 \begin_inset Quotes eld
10493 \end_inset
10494
10495 Paragraph
10496 \begin_inset Quotes erd
10497 \end_inset
10498
10499  layout is ignored and all paragraphs are separated by this parskip argument.
10500  The vertical space is calculated with 
10501 \begin_inset Flex CharStyle:Code
10502 status collapsed
10503
10504 \begin_layout Plain Layout
10505 value
10506 \begin_inset space ~
10507 \end_inset
10508
10509 * DefaultHeight
10510 \end_layout
10511
10512 \end_inset
10513
10514  where 
10515 \begin_inset Flex CharStyle:Code
10516 status collapsed
10517
10518 \begin_layout Plain Layout
10519 DefaultHeight
10520 \end_layout
10521
10522 \end_inset
10523
10524  is the height of a row with the normal font.
10525  This way, the look stays the same with different screen fonts.
10526 \end_layout
10527
10528 \begin_layout Description
10529 \begin_inset Flex CharStyle:Code
10530 status collapsed
10531
10532 \begin_layout Plain Layout
10533 PassThru
10534 \end_layout
10535
10536 \end_inset
10537
10538  
10539 \begin_inset CommandInset label
10540 LatexCommand label
10541 name "des:PathThru"
10542
10543 \end_inset
10544
10545 [
10546 \emph on
10547
10548 \begin_inset Flex CharStyle:Code
10549 status collapsed
10550
10551 \begin_layout Plain Layout
10552
10553 \emph on
10554 0
10555 \end_layout
10556
10557 \end_inset
10558
10559
10560 \emph default
10561
10562 \begin_inset Flex CharStyle:Code
10563 status collapsed
10564
10565 \begin_layout Plain Layout
10566 1
10567 \end_layout
10568
10569 \end_inset
10570
10571 ] Whether the contents of this paragraph should be output in raw form, meaning
10572  without special translations that LaTeX would require.
10573 \end_layout
10574
10575 \begin_layout Description
10576 \begin_inset Flex CharStyle:Code
10577 status collapsed
10578
10579 \begin_layout Plain Layout
10580 Preamble
10581 \end_layout
10582
10583 \end_inset
10584
10585  
10586 \begin_inset CommandInset label
10587 LatexCommand label
10588 name "des:Preamble"
10589
10590 \end_inset
10591
10592 Information to be included in the LaTeX preamable when this style is used.
10593  Used to define macros, load packages, etc., required by this particular
10594  style.
10595  Must end with 
10596 \begin_inset Quotes eld
10597 \end_inset
10598
10599
10600 \begin_inset Flex CharStyle:Code
10601 status collapsed
10602
10603 \begin_layout Plain Layout
10604 EndPreamble
10605 \end_layout
10606
10607 \end_inset
10608
10609
10610 \begin_inset Quotes erd
10611 \end_inset
10612
10613 .
10614 \end_layout
10615
10616 \begin_layout Description
10617 \begin_inset Flex CharStyle:Code
10618 status collapsed
10619
10620 \begin_layout Plain Layout
10621 Requires 
10622 \end_layout
10623
10624 \end_inset
10625
10626 [
10627 \begin_inset Flex CharStyle:Code
10628 status collapsed
10629
10630 \begin_layout Plain Layout
10631 string
10632 \end_layout
10633
10634 \end_inset
10635
10636
10637 \begin_inset CommandInset label
10638 LatexCommand label
10639 name "des:Requires"
10640
10641 \end_inset
10642
10643 Whether the layout requires the feature 
10644 \begin_inset Flex CharStyle:Code
10645 status collapsed
10646
10647 \begin_layout Plain Layout
10648 string
10649 \end_layout
10650
10651 \end_inset
10652
10653 .
10654  See the description of 
10655 \begin_inset Flex CharStyle:Code
10656 status collapsed
10657
10658 \begin_layout Plain Layout
10659 Provides
10660 \end_layout
10661
10662 \end_inset
10663
10664  above (page 
10665 \begin_inset CommandInset ref
10666 LatexCommand pageref
10667 reference "des:FreeSpacing"
10668
10669 \end_inset
10670
10671 ) for information on `features'.
10672  
10673 \end_layout
10674
10675 \begin_layout Description
10676 \begin_inset Flex CharStyle:Code
10677 status collapsed
10678
10679 \begin_layout Plain Layout
10680 RightMargin
10681 \end_layout
10682
10683 \end_inset
10684
10685  [
10686 \begin_inset Flex CharStyle:Code
10687 status collapsed
10688
10689 \begin_layout Plain Layout
10690 string=""
10691 \end_layout
10692
10693 \end_inset
10694
10695 ] Similar to 
10696 \begin_inset Flex CharStyle:Code
10697 status collapsed
10698
10699 \begin_layout Plain Layout
10700 LeftMargin
10701 \end_layout
10702
10703 \end_inset
10704
10705 .
10706 \end_layout
10707
10708 \begin_layout Description
10709 \begin_inset Flex CharStyle:Code
10710 status collapsed
10711
10712 \begin_layout Plain Layout
10713 Spacing
10714 \end_layout
10715
10716 \end_inset
10717
10718  [
10719 \begin_inset Flex CharStyle:Code
10720 status collapsed
10721
10722 \begin_layout Plain Layout
10723
10724 \emph on
10725 single
10726 \emph default
10727 , onehalf, double, other
10728 \end_layout
10729
10730 \end_inset
10731
10732  
10733 \emph on
10734 value
10735 \emph default
10736 ] This defines what the default spacing should be in the layout.
10737  The arguments 
10738 \begin_inset Flex CharStyle:Code
10739 status collapsed
10740
10741 \begin_layout Plain Layout
10742 single
10743 \end_layout
10744
10745 \end_inset
10746
10747
10748 \begin_inset Flex CharStyle:Code
10749 status collapsed
10750
10751 \begin_layout Plain Layout
10752 onehalf
10753 \end_layout
10754
10755 \end_inset
10756
10757  and 
10758 \begin_inset Flex CharStyle:Code
10759 status collapsed
10760
10761 \begin_layout Plain Layout
10762 double
10763 \end_layout
10764
10765 \end_inset
10766
10767  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10768  If you specify the argument 
10769 \begin_inset Flex CharStyle:Code
10770 status collapsed
10771
10772 \begin_layout Plain Layout
10773 other
10774 \end_layout
10775
10776 \end_inset
10777
10778 , then you should also provide a numerical argument which will be the actual
10779  multiplier value.
10780  Note that, contrary to other parameters, 
10781 \begin_inset Flex CharStyle:Code
10782 status collapsed
10783
10784 \begin_layout Plain Layout
10785 Spacing
10786 \end_layout
10787
10788 \end_inset
10789
10790  implies the generation of specific LaTeX code, using the package 
10791 \family roman
10792
10793 \begin_inset Flex CharStyle:Code
10794 status collapsed
10795
10796 \begin_layout Plain Layout
10797 setspace.sty
10798 \end_layout
10799
10800 \end_inset
10801
10802 .
10803 \end_layout
10804
10805 \begin_layout Description
10806 \begin_inset Flex CharStyle:Code
10807 status collapsed
10808
10809 \begin_layout Plain Layout
10810 TextFont
10811 \end_layout
10812
10813 \end_inset
10814
10815  The font used for the text body .
10816  See section 
10817 \begin_inset CommandInset ref
10818 LatexCommand ref
10819 reference "sec:fonts"
10820
10821 \end_inset
10822
10823 .
10824 \end_layout
10825
10826 \begin_layout Description
10827 \begin_inset Flex CharStyle:Code
10828 status collapsed
10829
10830 \begin_layout Plain Layout
10831
10832 \series medium
10833 TocLevel [int]
10834 \end_layout
10835
10836 \end_inset
10837
10838  The level of the style in the table of contents.
10839  This is used for automatic numbering of section headings.
10840 \end_layout
10841
10842 \begin_layout Description
10843 \begin_inset Flex CharStyle:Code
10844 status collapsed
10845
10846 \begin_layout Plain Layout
10847 TopSep
10848 \end_layout
10849
10850 \end_inset
10851
10852  [
10853 \begin_inset Flex CharStyle:Code
10854 status collapsed
10855
10856 \begin_layout Plain Layout
10857 float=0
10858 \end_layout
10859
10860 \end_inset
10861
10862 ] The vertical space with which the very first of a chain of paragraphs
10863  with this layout is separated from the previous paragraph.
10864  If the previous paragraph has another layout, the separations are not simply
10865  added, but the maximum is taken.
10866 \end_layout
10867
10868 \begin_layout Subsection
10869 Floats
10870 \end_layout
10871
10872 \begin_layout Standard
10873 \begin_inset CommandInset label
10874 LatexCommand label
10875 name "sec:floats"
10876
10877 \end_inset
10878
10879 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10880  define the floats (
10881 \begin_inset Flex CharStyle:MenuItem
10882 status collapsed
10883
10884 \begin_layout Plain Layout
10885 figure
10886 \end_layout
10887
10888 \end_inset
10889
10890
10891 \begin_inset Flex CharStyle:MenuItem
10892 status collapsed
10893
10894 \begin_layout Plain Layout
10895 table
10896 \end_layout
10897
10898 \end_inset
10899
10900 , \SpecialChar \ldots{}
10901 ) in the text class itself.
10902  Standard floats are included in the file 
10903 \begin_inset Flex CharStyle:Code
10904 status collapsed
10905
10906 \begin_layout Plain Layout
10907 stdfloats.inc
10908 \end_layout
10909
10910 \end_inset
10911
10912 , so you may have to do no more than add
10913 \end_layout
10914
10915 \begin_layout LyX-Code
10916 Input stdfloats.inc
10917 \end_layout
10918
10919 \begin_layout Standard
10920 to your layout file.
10921  If you want to implement a text class that proposes some other float types
10922  (like the AGU class bundled with LyX), the information below will hopefully
10923  help you:
10924 \end_layout
10925
10926 \begin_layout Description
10927 \begin_inset Flex CharStyle:Code
10928 status collapsed
10929
10930 \begin_layout Plain Layout
10931 Extension
10932 \end_layout
10933
10934 \end_inset
10935
10936  [
10937 \begin_inset Flex CharStyle:Code
10938 status collapsed
10939
10940 \begin_layout Plain Layout
10941 string
10942 \end_layout
10943
10944 \end_inset
10945
10946 =
10947 \begin_inset Quotes erd
10948 \end_inset
10949
10950
10951 \begin_inset Quotes erd
10952 \end_inset
10953
10954 ] The file name extension of an auxiliary file for the list of figures (or
10955  whatever).
10956  LaTeX writes the captions to this file.
10957 \end_layout
10958
10959 \begin_layout Description
10960 \begin_inset Flex CharStyle:Code
10961 status collapsed
10962
10963 \begin_layout Plain Layout
10964 GuiName
10965 \end_layout
10966
10967 \end_inset
10968
10969  [
10970 \begin_inset Flex CharStyle:Code
10971 status collapsed
10972
10973 \begin_layout Plain Layout
10974 string
10975 \end_layout
10976
10977 \end_inset
10978
10979 =
10980 \begin_inset Quotes erd
10981 \end_inset
10982
10983
10984 \begin_inset Quotes erd
10985 \end_inset
10986
10987 ] The string that will be used in the menus and also for the caption.
10988 \end_layout
10989
10990 \begin_layout Description
10991 \begin_inset Flex CharStyle:Code
10992 status collapsed
10993
10994 \begin_layout Plain Layout
10995 LaTeXBuiltin
10996 \end_layout
10997
10998 \end_inset
10999
11000  [
11001 \begin_inset Flex CharStyle:Code
11002 status collapsed
11003
11004 \begin_layout Plain Layout
11005
11006 \emph on
11007 0
11008 \end_layout
11009
11010 \end_inset
11011
11012
11013 \begin_inset Flex CharStyle:Code
11014 status collapsed
11015
11016 \begin_layout Plain Layout
11017 1
11018 \end_layout
11019
11020 \end_inset
11021
11022 ] Set to 
11023 \begin_inset Flex CharStyle:Code
11024 status collapsed
11025
11026 \begin_layout Plain Layout
11027 1
11028 \end_layout
11029
11030 \end_inset
11031
11032  if the float is already defined by the LaTeX document class.
11033  If this is set to 
11034 \begin_inset Flex CharStyle:Code
11035 status collapsed
11036
11037 \begin_layout Plain Layout
11038 0
11039 \end_layout
11040
11041 \end_inset
11042
11043 , the float will be defined using the LaTeX package 
11044 \begin_inset Flex CharStyle:Code
11045 status collapsed
11046
11047 \begin_layout Plain Layout
11048 float
11049 \end_layout
11050
11051 \end_inset
11052
11053 .
11054 \end_layout
11055
11056 \begin_layout Description
11057 \begin_inset Flex CharStyle:Code
11058 status collapsed
11059
11060 \begin_layout Plain Layout
11061 ListName
11062 \end_layout
11063
11064 \end_inset
11065
11066  [
11067 \begin_inset Flex CharStyle:Code
11068 status collapsed
11069
11070 \begin_layout Plain Layout
11071 string
11072 \end_layout
11073
11074 \end_inset
11075
11076 =
11077 \begin_inset Quotes erd
11078 \end_inset
11079
11080
11081 \begin_inset Quotes erd
11082 \end_inset
11083
11084 ] The heading used for the list of floats.
11085 \end_layout
11086
11087 \begin_layout Description
11088 \begin_inset Flex CharStyle:Code
11089 status collapsed
11090
11091 \begin_layout Plain Layout
11092 NumberWithin
11093 \end_layout
11094
11095 \end_inset
11096
11097  [
11098 \begin_inset Flex CharStyle:Code
11099 status collapsed
11100
11101 \begin_layout Plain Layout
11102 string
11103 \end_layout
11104
11105 \end_inset
11106
11107 =
11108 \begin_inset Quotes erd
11109 \end_inset
11110
11111
11112 \begin_inset Quotes erd
11113 \end_inset
11114
11115 ] This (optional) argument determines whether floats of this class will
11116  be numbered within some sectional unit of the document.
11117  For example, if within is equal to 
11118 \begin_inset Flex CharStyle:Code
11119 status collapsed
11120
11121 \begin_layout Plain Layout
11122 chapter
11123 \end_layout
11124
11125 \end_inset
11126
11127 , the floats will be numbered within chapters.
11128  
11129 \end_layout
11130
11131 \begin_layout Description
11132 \begin_inset Flex CharStyle:Code
11133 status collapsed
11134
11135 \begin_layout Plain Layout
11136 Placement
11137 \end_layout
11138
11139 \end_inset
11140
11141  [
11142 \begin_inset Flex CharStyle:Code
11143 status collapsed
11144
11145 \begin_layout Plain Layout
11146 string
11147 \end_layout
11148
11149 \end_inset
11150
11151 =
11152 \begin_inset Quotes erd
11153 \end_inset
11154
11155
11156 \begin_inset Quotes erd
11157 \end_inset
11158
11159 ] The default placement for the given class of floats.
11160  The string should be as in standard LaTeX: 
11161 \begin_inset Flex CharStyle:Code
11162 status collapsed
11163
11164 \begin_layout Plain Layout
11165 t
11166 \end_layout
11167
11168 \end_inset
11169
11170
11171 \begin_inset Flex CharStyle:Code
11172 status collapsed
11173
11174 \begin_layout Plain Layout
11175 b
11176 \end_layout
11177
11178 \end_inset
11179
11180
11181 \begin_inset Flex CharStyle:Code
11182 status collapsed
11183
11184 \begin_layout Plain Layout
11185 p
11186 \end_layout
11187
11188 \end_inset
11189
11190  and 
11191 \begin_inset Flex CharStyle:Code
11192 status collapsed
11193
11194 \begin_layout Plain Layout
11195 h
11196 \end_layout
11197
11198 \end_inset
11199
11200  for top, bottom, page, and here, respectively.
11201 \begin_inset Foot
11202 status collapsed
11203
11204 \begin_layout Plain Layout
11205 Note that the order of these letters in the string is irrelevant, like in
11206  LaTeX.
11207 \end_layout
11208
11209 \end_inset
11210
11211  On top of that there is a new type, 
11212 \begin_inset Flex CharStyle:Code
11213 status collapsed
11214
11215 \begin_layout Plain Layout
11216 H
11217 \end_layout
11218
11219 \end_inset
11220
11221 , which does not really correspond to a float, since it means: put it 
11222 \begin_inset Quotes eld
11223 \end_inset
11224
11225 here
11226 \begin_inset Quotes erd
11227 \end_inset
11228
11229  and nowhere else.
11230  Note however that the 
11231 \begin_inset Flex CharStyle:Code
11232 status collapsed
11233
11234 \begin_layout Plain Layout
11235 H
11236 \end_layout
11237
11238 \end_inset
11239
11240  specifier is special and, because of implementation details, cannot be
11241  used in non-builtin float types.
11242  If you do not understand what this means, just use 
11243 \begin_inset Quotes eld
11244 \end_inset
11245
11246
11247 \begin_inset Flex CharStyle:Code
11248 status collapsed
11249
11250 \begin_layout Plain Layout
11251 tbp
11252 \end_layout
11253
11254 \end_inset
11255
11256
11257 \begin_inset Quotes erd
11258 \end_inset
11259
11260 .
11261 \end_layout
11262
11263 \begin_layout Description
11264 \begin_inset Flex CharStyle:Code
11265 status collapsed
11266
11267 \begin_layout Plain Layout
11268 Style
11269 \end_layout
11270
11271 \end_inset
11272
11273  [
11274 \begin_inset Flex CharStyle:Code
11275 status collapsed
11276
11277 \begin_layout Plain Layout
11278 string
11279 \end_layout
11280
11281 \end_inset
11282
11283 =
11284 \begin_inset Quotes erd
11285 \end_inset
11286
11287
11288 \begin_inset Quotes erd
11289 \end_inset
11290
11291 ] The style used when defining the float using 
11292 \begin_inset Flex CharStyle:Code
11293 status collapsed
11294
11295 \begin_layout Plain Layout
11296
11297 \backslash
11298 newfloat
11299 \end_layout
11300
11301 \end_inset
11302
11303 .
11304 \end_layout
11305
11306 \begin_layout Description
11307 \begin_inset Flex CharStyle:Code
11308 status collapsed
11309
11310 \begin_layout Plain Layout
11311 Type
11312 \end_layout
11313
11314 \end_inset
11315
11316  [
11317 \begin_inset Flex CharStyle:Code
11318 status collapsed
11319
11320 \begin_layout Plain Layout
11321 string
11322 \end_layout
11323
11324 \end_inset
11325
11326 =
11327 \begin_inset Quotes erd
11328 \end_inset
11329
11330
11331 \begin_inset Quotes erd
11332 \end_inset
11333
11334 ] The 
11335 \begin_inset Quotes eld
11336 \end_inset
11337
11338 type
11339 \begin_inset Quotes erd
11340 \end_inset
11341
11342  of the new class of floats, like program or algorithm.
11343  After the appropriate 
11344 \begin_inset Flex CharStyle:Code
11345 status collapsed
11346
11347 \begin_layout Plain Layout
11348
11349 \backslash
11350 newfloat
11351 \end_layout
11352
11353 \end_inset
11354
11355 , commands such as 
11356 \begin_inset Flex CharStyle:Code
11357 status collapsed
11358
11359 \begin_layout Plain Layout
11360
11361 \backslash
11362 begin{program}
11363 \end_layout
11364
11365 \end_inset
11366
11367  or 
11368 \begin_inset Flex CharStyle:Code
11369 status collapsed
11370
11371 \begin_layout Plain Layout
11372
11373 \backslash
11374 end{algorithm*}
11375 \end_layout
11376
11377 \end_inset
11378
11379  will be available.
11380 \end_layout
11381
11382 \begin_layout Standard
11383 Note that defining a float with type 
11384 \begin_inset Flex CharStyle:Code
11385 status collapsed
11386
11387 \begin_layout Plain Layout
11388
11389 \emph on
11390 type
11391 \end_layout
11392
11393 \end_inset
11394
11395  automatically defines the corresponding counter with name 
11396 \begin_inset Flex CharStyle:Code
11397 status collapsed
11398
11399 \begin_layout Plain Layout
11400
11401 \emph on
11402 type
11403 \end_layout
11404
11405 \end_inset
11406
11407 .
11408 \end_layout
11409
11410 \begin_layout Subsection
11411 Flex insets and InsetLayout
11412 \end_layout
11413
11414 \begin_layout Standard
11415 \begin_inset CommandInset label
11416 LatexCommand label
11417 name "sec:charstyle"
11418
11419 \end_inset
11420
11421 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11422  these are called Flex insets.
11423  
11424 \end_layout
11425
11426 \begin_layout Standard
11427 Flex insets come in three different kinds: 
11428 \end_layout
11429
11430 \begin_layout Itemize
11431 character style (
11432 \begin_inset Flex CharStyle:Code
11433 status collapsed
11434
11435 \begin_layout Plain Layout
11436 CharStyle
11437 \end_layout
11438
11439 \end_inset
11440
11441 ): These define semantic markup corresponding to such LaTeX commands as
11442  
11443 \begin_inset Flex CharStyle:Code
11444 status collapsed
11445
11446 \begin_layout Plain Layout
11447
11448 \backslash
11449 noun
11450 \end_layout
11451
11452 \end_inset
11453
11454  and 
11455 \begin_inset Flex CharStyle:Code
11456 status collapsed
11457
11458 \begin_layout Plain Layout
11459
11460 \backslash
11461 code
11462 \end_layout
11463
11464 \end_inset
11465
11466 .
11467 \end_layout
11468
11469 \begin_layout Itemize
11470 user custom (
11471 \begin_inset Flex CharStyle:Code
11472 status collapsed
11473
11474 \begin_layout Plain Layout
11475 Custom
11476 \end_layout
11477
11478 \end_inset
11479
11480 ): These can be used to define custom collapsable insets, similar to ERT,
11481  footnote, and the like.
11482  An obvious example is an endnote inset, which is defined in the 
11483 \begin_inset Flex CharStyle:Code
11484 status collapsed
11485
11486 \begin_layout Plain Layout
11487 endnote
11488 \end_layout
11489
11490 \end_inset
11491
11492  module.
11493 \end_layout
11494
11495 \begin_layout Itemize
11496 XML elements (
11497 \begin_inset Flex CharStyle:Code
11498 status collapsed
11499
11500 \begin_layout Plain Layout
11501 Element
11502 \end_layout
11503
11504 \end_inset
11505
11506 ): For use with DocBook classes.
11507 \end_layout
11508
11509 \begin_layout Standard
11510 Flex insets are defined using the 
11511 \begin_inset Flex CharStyle:Code
11512 status collapsed
11513
11514 \begin_layout Plain Layout
11515 InsetLayout
11516 \end_layout
11517
11518 \end_inset
11519
11520  tag, which shall be explained in a moment.
11521 \end_layout
11522
11523 \begin_layout Standard
11524 The 
11525 \begin_inset Flex CharStyle:Code
11526 status collapsed
11527
11528 \begin_layout Plain Layout
11529 InsetLayout
11530 \end_layout
11531
11532 \end_inset
11533
11534  tag also serves another function: It can be used to customize the general
11535  layout of many different types of insets.
11536  Currently, 
11537 \begin_inset Flex CharStyle:Code
11538 status collapsed
11539
11540 \begin_layout Plain Layout
11541 InsetLayout
11542 \end_layout
11543
11544 \end_inset
11545
11546  can be used to customize the layout parameters for footnotes, marginal
11547  notes, note insets, ERT insets, branches, listings, indexes, boxes, tables,
11548  algorithms, URLs, and optional arguments, as well as to define Flex insets.
11549 \end_layout
11550
11551 \begin_layout Standard
11552 The 
11553 \begin_inset Flex CharStyle:Code
11554 status collapsed
11555
11556 \begin_layout Plain Layout
11557 InsetLayout
11558 \end_layout
11559
11560 \end_inset
11561
11562  definition must begin with a line of the form:
11563 \end_layout
11564
11565 \begin_layout LyX-Code
11566 InsetLayout <Type>
11567 \end_layout
11568
11569 \begin_layout Standard
11570 Here 
11571 \begin_inset Flex CharStyle:Code
11572 status collapsed
11573
11574 \begin_layout Plain Layout
11575 <Type>
11576 \end_layout
11577
11578 \end_inset
11579
11580  indicates the inset whose layout is being defined, and here there are two
11581  cases.
11582 \end_layout
11583
11584 \begin_layout Enumerate
11585 The layout for a pre-existing inset is being modified.
11586  In this case, can be 
11587 \begin_inset Flex CharStyle:Code
11588 status collapsed
11589
11590 \begin_layout Plain Layout
11591 <Type>
11592 \end_layout
11593
11594 \end_inset
11595
11596  any one of the following: 
11597 \begin_inset Flex CharStyle:Code
11598 status collapsed
11599
11600 \begin_layout Plain Layout
11601 Algorithm
11602 \end_layout
11603
11604 \end_inset
11605
11606
11607 \begin_inset Flex CharStyle:Code
11608 status collapsed
11609
11610 \begin_layout Plain Layout
11611 Branch
11612 \end_layout
11613
11614 \end_inset
11615
11616
11617 \begin_inset Flex CharStyle:Code
11618 status collapsed
11619
11620 \begin_layout Plain Layout
11621 Box
11622 \end_layout
11623
11624 \end_inset
11625
11626
11627 \begin_inset Flex CharStyle:Code
11628 status collapsed
11629
11630 \begin_layout Plain Layout
11631 Box:shaded
11632 \end_layout
11633
11634 \end_inset
11635
11636
11637 \begin_inset Flex CharStyle:Code
11638 status collapsed
11639
11640 \begin_layout Plain Layout
11641 ERT
11642 \end_layout
11643
11644 \end_inset
11645
11646
11647 \begin_inset Flex CharStyle:Code
11648 status collapsed
11649
11650 \begin_layout Plain Layout
11651 Figure
11652 \end_layout
11653
11654 \end_inset
11655
11656
11657 \begin_inset Flex CharStyle:Code
11658 status collapsed
11659
11660 \begin_layout Plain Layout
11661 Foot
11662 \end_layout
11663
11664 \end_inset
11665
11666
11667 \begin_inset Flex CharStyle:Code
11668 status collapsed
11669
11670 \begin_layout Plain Layout
11671 Index
11672 \end_layout
11673
11674 \end_inset
11675
11676
11677 \begin_inset Flex CharStyle:Code
11678 status collapsed
11679
11680 \begin_layout Plain Layout
11681 Info
11682 \end_layout
11683
11684 \end_inset
11685
11686
11687 \begin_inset Flex CharStyle:Code
11688 status collapsed
11689
11690 \begin_layout Plain Layout
11691 Info:menu
11692 \end_layout
11693
11694 \end_inset
11695
11696
11697 \begin_inset Flex CharStyle:Code
11698 status collapsed
11699
11700 \begin_layout Plain Layout
11701 Info:shortcut
11702 \end_layout
11703
11704 \end_inset
11705
11706
11707 \begin_inset Flex CharStyle:Code
11708 status collapsed
11709
11710 \begin_layout Plain Layout
11711 Info:shortcuts
11712 \end_layout
11713
11714 \end_inset
11715
11716
11717 \begin_inset Flex CharStyle:Code
11718 status collapsed
11719
11720 \begin_layout Plain Layout
11721 Listings
11722 \end_layout
11723
11724 \end_inset
11725
11726
11727 \begin_inset Flex CharStyle:Code
11728 status collapsed
11729
11730 \begin_layout Plain Layout
11731 Marginal
11732 \end_layout
11733
11734 \end_inset
11735
11736
11737 \begin_inset Flex CharStyle:Code
11738 status collapsed
11739
11740 \begin_layout Plain Layout
11741 Note:Comment
11742 \end_layout
11743
11744 \end_inset
11745
11746
11747 \begin_inset Flex CharStyle:Code
11748 status collapsed
11749
11750 \begin_layout Plain Layout
11751 Note:Note
11752 \end_layout
11753
11754 \end_inset
11755
11756
11757 \begin_inset Flex CharStyle:Code
11758 status collapsed
11759
11760 \begin_layout Plain Layout
11761 Note:GreyedOut
11762 \end_layout
11763
11764 \end_inset
11765
11766
11767 \begin_inset Flex CharStyle:Code
11768 status collapsed
11769
11770 \begin_layout Plain Layout
11771 OptArg
11772 \end_layout
11773
11774 \end_inset
11775
11776
11777 \begin_inset Flex CharStyle:Code
11778 status collapsed
11779
11780 \begin_layout Plain Layout
11781 Table
11782 \end_layout
11783
11784 \end_inset
11785
11786 , or 
11787 \begin_inset Flex CharStyle:Code
11788 status collapsed
11789
11790 \begin_layout Plain Layout
11791 URL
11792 \end_layout
11793
11794 \end_inset
11795
11796 .
11797  
11798 \end_layout
11799
11800 \begin_layout Enumerate
11801 The layout for a Flex inset is being defined.
11802  In this case, 
11803 \begin_inset Flex CharStyle:Code
11804 status collapsed
11805
11806 \begin_layout Plain Layout
11807 <Type>
11808 \end_layout
11809
11810 \end_inset
11811
11812  can be any valid identifier not used by a pre-existing inset.
11813  Note that the definition of a flex inset must
11814 \emph on
11815  als
11816 \emph default
11817 o include a 
11818 \begin_inset Flex CharStyle:Code
11819 status collapsed
11820
11821 \begin_layout Plain Layout
11822 LyXType
11823 \end_layout
11824
11825 \end_inset
11826
11827  entry.
11828 \end_layout
11829
11830 \begin_layout Standard
11831 The 
11832 \begin_inset Flex CharStyle:Code
11833 status collapsed
11834
11835 \begin_layout Plain Layout
11836 InsetLayout
11837 \end_layout
11838
11839 \end_inset
11840
11841  definition can contain the following entries:
11842 \end_layout
11843
11844 \begin_layout Description
11845 \begin_inset Flex CharStyle:Code
11846 status collapsed
11847
11848 \begin_layout Plain Layout
11849 BgColor
11850 \end_layout
11851
11852 \end_inset
11853
11854  The color for the inset's background.
11855  The valid colors are defined in 
11856 \begin_inset Flex CharStyle:Code
11857 status collapsed
11858
11859 \begin_layout Plain Layout
11860 src/ColorCode.h
11861 \end_layout
11862
11863 \end_inset
11864
11865 .
11866 \end_layout
11867
11868 \begin_layout Description
11869 \begin_inset Flex CharStyle:Code
11870 status collapsed
11871
11872 \begin_layout Plain Layout
11873 CopyStyle
11874 \end_layout
11875
11876 \end_inset
11877
11878  As with paragraph styles (see page 
11879 \begin_inset CommandInset ref
11880 LatexCommand ref
11881 reference "des:CopyStyle"
11882
11883 \end_inset
11884
11885 ).
11886 \end_layout
11887
11888 \begin_layout Description
11889 \begin_inset Flex CharStyle:Code
11890 status collapsed
11891
11892 \begin_layout Plain Layout
11893 CustomPars
11894 \end_layout
11895
11896 \end_inset
11897
11898  [
11899 \begin_inset Flex CharStyle:Code
11900 status collapsed
11901
11902 \begin_layout Plain Layout
11903
11904 \emph on
11905 0
11906 \end_layout
11907
11908 \end_inset
11909
11910 ,
11911 \begin_inset Flex CharStyle:Code
11912 status collapsed
11913
11914 \begin_layout Plain Layout
11915 1
11916 \end_layout
11917
11918 \end_inset
11919
11920 ] Indicates whether the user may employ the Paragraph Settings dialog to
11921  customize the paragraph.
11922 \end_layout
11923
11924 \begin_layout Description
11925 \begin_inset Flex CharStyle:Code
11926 status collapsed
11927
11928 \begin_layout Plain Layout
11929 Decoration
11930 \end_layout
11931
11932 \end_inset
11933
11934  can be 
11935 \begin_inset Flex CharStyle:Code
11936 status collapsed
11937
11938 \begin_layout Plain Layout
11939 Classic
11940 \end_layout
11941
11942 \end_inset
11943
11944
11945 \begin_inset Flex CharStyle:Code
11946 status collapsed
11947
11948 \begin_layout Plain Layout
11949 Minimalistic
11950 \end_layout
11951
11952 \end_inset
11953
11954 , or 
11955 \begin_inset Flex CharStyle:Code
11956 status collapsed
11957
11958 \begin_layout Plain Layout
11959 Conglomerate
11960 \end_layout
11961
11962 \end_inset
11963
11964 , describing the rendering style used for the inset's frame and buttons.
11965  Footnotes generally use 
11966 \begin_inset Flex CharStyle:Code
11967 status collapsed
11968
11969 \begin_layout Plain Layout
11970 Classic
11971 \end_layout
11972
11973 \end_inset
11974
11975 , ERT insets generally 
11976 \begin_inset Flex CharStyle:Code
11977 status collapsed
11978
11979 \begin_layout Plain Layout
11980 Minimalistic
11981 \end_layout
11982
11983 \end_inset
11984
11985 , and character styles 
11986 \begin_inset Flex CharStyle:Code
11987 status collapsed
11988
11989 \begin_layout Plain Layout
11990 Conglomerate
11991 \end_layout
11992
11993 \end_inset
11994
11995 .
11996 \end_layout
11997
11998 \begin_layout Description
11999 \begin_inset Flex CharStyle:Code
12000 status collapsed
12001
12002 \begin_layout Plain Layout
12003 End
12004 \end_layout
12005
12006 \end_inset
12007
12008  Required at the end of the InsetLayout declarations.
12009 \end_layout
12010
12011 \begin_layout Description
12012 \begin_inset Flex CharStyle:Code
12013 status collapsed
12014
12015 \begin_layout Plain Layout
12016 Font
12017 \end_layout
12018
12019 \end_inset
12020
12021  The font used for both the text body 
12022 \emph on
12023 and
12024 \emph default
12025  the label.
12026  See section
12027 \begin_inset space ~
12028 \end_inset
12029
12030
12031 \begin_inset CommandInset ref
12032 LatexCommand ref
12033 reference "sec:fonts"
12034
12035 \end_inset
12036
12037 .
12038  Note that defining this font automatically defines the 
12039 \begin_inset Flex CharStyle:Code
12040 status collapsed
12041
12042 \begin_layout Plain Layout
12043 LabelFont
12044 \end_layout
12045
12046 \end_inset
12047
12048  to the same value, so define this first and define 
12049 \begin_inset Flex CharStyle:Code
12050 status collapsed
12051
12052 \begin_layout Plain Layout
12053 LabelFont
12054 \end_layout
12055
12056 \end_inset
12057
12058  later if you want them to be different.
12059 \end_layout
12060
12061 \begin_layout Description
12062 \begin_inset Flex CharStyle:Code
12063 status collapsed
12064
12065 \begin_layout Plain Layout
12066 ForceLTR
12067 \end_layout
12068
12069 \end_inset
12070
12071  Force the 
12072 \begin_inset Quotes eld
12073 \end_inset
12074
12075 latex
12076 \begin_inset Quotes erd
12077 \end_inset
12078
12079  language, leading to Left-to-Right (latin) output, e.
12080 \begin_inset space \thinspace{}
12081 \end_inset
12082
12083 g.
12084 \begin_inset space \space{}
12085 \end_inset
12086
12087 in ERT or URL.
12088  A kludge.
12089 \end_layout
12090
12091 \begin_layout Description
12092 \begin_inset Flex CharStyle:Code
12093 status collapsed
12094
12095 \begin_layout Plain Layout
12096 ForcePlain
12097 \end_layout
12098
12099 \end_inset
12100
12101  [
12102 \begin_inset Flex CharStyle:Code
12103 status collapsed
12104
12105 \begin_layout Plain Layout
12106
12107 \emph on
12108 0
12109 \end_layout
12110
12111 \end_inset
12112
12113 ,
12114 \begin_inset Flex CharStyle:Code
12115 status collapsed
12116
12117 \begin_layout Plain Layout
12118 1
12119 \end_layout
12120
12121 \end_inset
12122
12123 ] Indicates whether the PlainLayout should be used or, instead, the user
12124  can change the paragraph style used in the inset.
12125 \end_layout
12126
12127 \begin_layout Description
12128 \begin_inset Flex CharStyle:Code
12129 status collapsed
12130
12131 \begin_layout Plain Layout
12132 FreeSpacing
12133 \end_layout
12134
12135 \end_inset
12136
12137  As with paragraph styles (see page 
12138 \begin_inset CommandInset ref
12139 LatexCommand pageref
12140 reference "des:FreeSpacing"
12141
12142 \end_inset
12143
12144 ).
12145 \end_layout
12146
12147 \begin_layout Description
12148 \begin_inset Flex CharStyle:Code
12149 status collapsed
12150
12151 \begin_layout Plain Layout
12152 KeepEmpty
12153 \end_layout
12154
12155 \end_inset
12156
12157  As with paragraph styles (see page 
12158 \begin_inset CommandInset ref
12159 LatexCommand pageref
12160 reference "des:KeepEmpty"
12161
12162 \end_inset
12163
12164 ).
12165 \end_layout
12166
12167 \begin_layout Description
12168 \begin_inset Flex CharStyle:Code
12169 status collapsed
12170
12171 \begin_layout Plain Layout
12172 LabelFont
12173 \end_layout
12174
12175 \end_inset
12176
12177  The font used for the label.
12178  See section
12179 \begin_inset space ~
12180 \end_inset
12181
12182
12183 \begin_inset CommandInset ref
12184 LatexCommand ref
12185 reference "sec:fonts"
12186
12187 \end_inset
12188
12189 .
12190  Note that this definition can never appear before 
12191 \begin_inset Flex CharStyle:Code
12192 status collapsed
12193
12194 \begin_layout Plain Layout
12195 Font
12196 \end_layout
12197
12198 \end_inset
12199
12200 , lest it be ineffective.
12201 \end_layout
12202
12203 \begin_layout Description
12204 \begin_inset Flex CharStyle:Code
12205 status collapsed
12206
12207 \begin_layout Plain Layout
12208 LabelString
12209 \end_layout
12210
12211 \end_inset
12212
12213  What will be displayed on the button or elsewhere as the inset label.
12214  Some inset types (ERT and Branch) modify this label on the fly.
12215 \end_layout
12216
12217 \begin_layout Description
12218 \begin_inset Flex CharStyle:Code
12219 status collapsed
12220
12221 \begin_layout Plain Layout
12222 LatexName
12223 \end_layout
12224
12225 \end_inset
12226
12227  The name of the corresponding LaTeX stuff.
12228  Either the environment or command name.
12229 \end_layout
12230
12231 \begin_layout Description
12232 \begin_inset Flex CharStyle:Code
12233 status collapsed
12234
12235 \begin_layout Plain Layout
12236 LatexParam
12237 \end_layout
12238
12239 \end_inset
12240
12241  The optional parameter for the corresponding 
12242 \begin_inset Flex CharStyle:Code
12243 status collapsed
12244
12245 \begin_layout Plain Layout
12246 LatexName
12247 \end_layout
12248
12249 \end_inset
12250
12251  stuff, including possible bracket pairs like 
12252 \begin_inset Flex CharStyle:Code
12253 status collapsed
12254
12255 \begin_layout Plain Layout
12256 []
12257 \end_layout
12258
12259 \end_inset
12260
12261 .
12262  This parameter cannot be changed from within LyX.
12263 \end_layout
12264
12265 \begin_layout Description
12266 \begin_inset Flex CharStyle:Code
12267 status collapsed
12268
12269 \begin_layout Plain Layout
12270 LatexType
12271 \end_layout
12272
12273 \end_inset
12274
12275  As with paragraph styles (see page 
12276 \begin_inset CommandInset ref
12277 LatexCommand pageref
12278 reference "des:LatexType"
12279
12280 \end_inset
12281
12282 ).
12283 \end_layout
12284
12285 \begin_layout Description
12286 \begin_inset Flex CharStyle:Code
12287 status collapsed
12288
12289 \begin_layout Plain Layout
12290 LyxType 
12291 \end_layout
12292
12293 \end_inset
12294
12295  Can be 
12296 \begin_inset Flex CharStyle:Code
12297 status collapsed
12298
12299 \begin_layout Plain Layout
12300 charstyle
12301 \end_layout
12302
12303 \end_inset
12304
12305
12306 \begin_inset Flex CharStyle:Code
12307 status collapsed
12308
12309 \begin_layout Plain Layout
12310 custom
12311 \end_layout
12312
12313 \end_inset
12314
12315
12316 \begin_inset Flex CharStyle:Code
12317 status collapsed
12318
12319 \begin_layout Plain Layout
12320 element
12321 \end_layout
12322
12323 \end_inset
12324
12325 , or 
12326 \begin_inset Flex CharStyle:Code
12327 status collapsed
12328
12329 \begin_layout Plain Layout
12330 end
12331 \end_layout
12332
12333 \end_inset
12334
12335  (indicating a dummy definition ending definitions of charstyles, etc).
12336  This entry is required in and is only meaningful for Flex insets.
12337  Among other things, it determines on which menu this inset will appear.
12338 \end_layout
12339
12340 \begin_layout Description
12341 \begin_inset Flex CharStyle:Code
12342 status collapsed
12343
12344 \begin_layout Plain Layout
12345 MultiPar
12346 \end_layout
12347
12348 \end_inset
12349
12350  [
12351 \begin_inset Flex CharStyle:Code
12352 status collapsed
12353
12354 \begin_layout Plain Layout
12355
12356 \emph on
12357 0
12358 \end_layout
12359
12360 \end_inset
12361
12362 ,
12363 \begin_inset Flex CharStyle:Code
12364 status collapsed
12365
12366 \begin_layout Plain Layout
12367 1
12368 \end_layout
12369
12370 \end_inset
12371
12372 ] Whether multiple paragraphs are permitted in this inset.
12373  This will also set CustomPars to the same value and ForcePlain to the opposite
12374  value.
12375  These can be reset to other values, if they are used 
12376 \emph on
12377 after
12378 \emph default
12379  MultiPar.
12380 \end_layout
12381
12382 \begin_layout Description
12383 \begin_inset Flex CharStyle:Code
12384 status collapsed
12385
12386 \begin_layout Plain Layout
12387 NeedProtect
12388 \end_layout
12389
12390 \end_inset
12391
12392  [
12393 \begin_inset Flex CharStyle:Code
12394 status collapsed
12395
12396 \begin_layout Plain Layout
12397
12398 \emph on
12399 0
12400 \end_layout
12401
12402 \end_inset
12403
12404 ,
12405 \begin_inset Flex CharStyle:Code
12406 status collapsed
12407
12408 \begin_layout Plain Layout
12409 1
12410 \end_layout
12411
12412 \end_inset
12413
12414 ] Whether fragile commands in this layout should be 
12415 \begin_inset Flex CharStyle:Code
12416 status collapsed
12417
12418 \begin_layout Plain Layout
12419
12420 \backslash
12421 protect
12422 \end_layout
12423
12424 \end_inset
12425
12426 'ed.
12427  (Note: This is 
12428 \emph on
12429 not
12430 \emph default
12431  whether the command should itself be protected.)
12432 \end_layout
12433
12434 \begin_layout Description
12435 \begin_inset Flex CharStyle:Code
12436 status collapsed
12437
12438 \begin_layout Plain Layout
12439 PassThru
12440 \end_layout
12441
12442 \end_inset
12443
12444  [
12445 \begin_inset Flex CharStyle:Code
12446 status collapsed
12447
12448 \begin_layout Plain Layout
12449
12450 \emph on
12451 0
12452 \end_layout
12453
12454 \end_inset
12455
12456 ,
12457 \begin_inset Flex CharStyle:Code
12458 status collapsed
12459
12460 \begin_layout Plain Layout
12461 1
12462 \end_layout
12463
12464 \end_inset
12465
12466 ] As with paragraph styles (see page 
12467 \begin_inset CommandInset ref
12468 LatexCommand ref
12469 reference "des:PathThru"
12470
12471 \end_inset
12472
12473 ).
12474 \end_layout
12475
12476 \begin_layout Description
12477 \begin_inset Flex CharStyle:Code
12478 status collapsed
12479
12480 \begin_layout Plain Layout
12481 Preamble
12482 \end_layout
12483
12484 \end_inset
12485
12486  As with paragraph styles (see page 
12487 \begin_inset CommandInset ref
12488 LatexCommand pageref
12489 reference "des:Preamble"
12490
12491 \end_inset
12492
12493 ).
12494 \end_layout
12495
12496 \begin_layout Description
12497 \begin_inset Flex CharStyle:Code
12498 status collapsed
12499
12500 \begin_layout Plain Layout
12501 Requires 
12502 \end_layout
12503
12504 \end_inset
12505
12506  [
12507 \begin_inset Flex CharStyle:Code
12508 status collapsed
12509
12510 \begin_layout Plain Layout
12511 string
12512 \end_layout
12513
12514 \end_inset
12515
12516 ] As with paragraph styles (see page 
12517 \begin_inset CommandInset ref
12518 LatexCommand pageref
12519 reference "des:Requires"
12520
12521 \end_inset
12522
12523 ).
12524 \end_layout
12525
12526 \begin_layout Subsection
12527 Counters
12528 \end_layout
12529
12530 \begin_layout Standard
12531 \begin_inset CommandInset label
12532 LatexCommand label
12533 name "sec:counter"
12534
12535 \end_inset
12536
12537 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12538  counters (
12539 \begin_inset Flex CharStyle:MenuItem
12540 status collapsed
12541
12542 \begin_layout Plain Layout
12543 chapter
12544 \end_layout
12545
12546 \end_inset
12547
12548
12549 \begin_inset Flex CharStyle:MenuItem
12550 status collapsed
12551
12552 \begin_layout Plain Layout
12553 figure
12554 \end_layout
12555
12556 \end_inset
12557
12558 , \SpecialChar \ldots{}
12559 ) in the text class itself.
12560  The standard counters are defined in the file 
12561 \begin_inset Flex CharStyle:Code
12562 status collapsed
12563
12564 \begin_layout Plain Layout
12565 stdcounters.inc
12566 \end_layout
12567
12568 \end_inset
12569
12570 , so you may have to do no more than add
12571 \end_layout
12572
12573 \begin_layout LyX-Code
12574 Input stdcounters.inc
12575 \end_layout
12576
12577 \begin_layout Standard
12578 to your layout file to get them to work.
12579  But if you want to define custom counters, then you can do so.
12580  The counter declaration must begin with:
12581 \end_layout
12582
12583 \begin_layout LyX-Code
12584 Counter name
12585 \end_layout
12586
12587 \begin_layout Standard
12588 where of course `name' is replaced by the name of the counter.
12589  And it must end with 
12590 \begin_inset Quotes eld
12591 \end_inset
12592
12593
12594 \begin_inset Flex CharStyle:Code
12595 status collapsed
12596
12597 \begin_layout Plain Layout
12598 End
12599 \end_layout
12600
12601 \end_inset
12602
12603
12604 \begin_inset Quotes erd
12605 \end_inset
12606
12607 .
12608  The following parameters can also be used:
12609 \end_layout
12610
12611 \begin_layout Description
12612 \begin_inset Flex CharStyle:Code
12613 status collapsed
12614
12615 \begin_layout Plain Layout
12616 LabelString [string=""]
12617 \end_layout
12618
12619 \end_inset
12620
12621  when this is defined, this string defines how the counter is displayed.
12622  Setting this value sets 
12623 \begin_inset Flex CharStyle:Code
12624 status collapsed
12625
12626 \begin_layout Plain Layout
12627 LabelStringAppendix
12628 \end_layout
12629
12630 \end_inset
12631
12632  to the same value.
12633  The following special constructs can be used in the string:
12634 \end_layout
12635
12636 \begin_deeper
12637 \begin_layout Itemize
12638 \begin_inset Flex CharStyle:Code
12639 status collapsed
12640
12641 \begin_layout Plain Layout
12642
12643 \backslash
12644 thecounter
12645 \end_layout
12646
12647 \end_inset
12648
12649  will be replaced by the expansion of the 
12650 \begin_inset Flex CharStyle:Code
12651 status collapsed
12652
12653 \begin_layout Plain Layout
12654 LabelString
12655 \end_layout
12656
12657 \end_inset
12658
12659  (or 
12660 \begin_inset Flex CharStyle:Code
12661 status collapsed
12662
12663 \begin_layout Plain Layout
12664 LabelStringAppendix
12665 \end_layout
12666
12667 \end_inset
12668
12669 ) of the counter 
12670 \begin_inset Flex CharStyle:Code
12671 status collapsed
12672
12673 \begin_layout Plain Layout
12674 counter
12675 \end_layout
12676
12677 \end_inset
12678
12679 .
12680  
12681 \end_layout
12682
12683 \begin_layout Itemize
12684 counter values can be expressed using LaTeX-like macros 
12685 \begin_inset Flex CharStyle:Code
12686 status collapsed
12687
12688 \begin_layout Plain Layout
12689
12690 \backslash
12691
12692 \emph on
12693 numbertype
12694 \emph default
12695 {
12696 \emph on
12697 counter
12698 \emph default
12699 }
12700 \end_layout
12701
12702 \end_inset
12703
12704 , where 
12705 \begin_inset Flex CharStyle:Code
12706 status collapsed
12707
12708 \begin_layout Plain Layout
12709
12710 \emph on
12711 numbertype
12712 \end_layout
12713
12714 \end_inset
12715
12716  can be:
12717 \begin_inset Foot
12718 status collapsed
12719
12720 \begin_layout Plain Layout
12721
12722 \family roman
12723 \series medium
12724 \shape up
12725 \size normal
12726 \emph off
12727 \bar no
12728 \noun off
12729 \color none
12730 Actually, the situation is a bit more complicated: any
12731 \family default
12732 \series default
12733 \shape default
12734 \emph default
12735 \bar default
12736  
12737 \size default
12738 \emph on
12739 \noun default
12740 \color inherit
12741 numbertype
12742 \family roman
12743 \series medium
12744 \shape up
12745 \size normal
12746 \emph off
12747 \bar no
12748 \noun off
12749  other than those descibed below will produce arabic numerals.
12750  It would not be surprising to see this change in the future.
12751 \end_layout
12752
12753 \end_inset
12754
12755  
12756 \begin_inset Flex CharStyle:Code
12757 status collapsed
12758
12759 \begin_layout Plain Layout
12760 arabic
12761 \end_layout
12762
12763 \end_inset
12764
12765 : 1, 2, 3,\SpecialChar \ldots{}
12766
12767 \begin_inset Flex CharStyle:Code
12768 status collapsed
12769
12770 \begin_layout Plain Layout
12771 alph
12772 \end_layout
12773
12774 \end_inset
12775
12776  for lower-case letters: a, b, c, \SpecialChar \ldots{}
12777
12778 \begin_inset Flex CharStyle:Code
12779 status collapsed
12780
12781 \begin_layout Plain Layout
12782 Alph
12783 \end_layout
12784
12785 \end_inset
12786
12787  for upper-case letters: A, B, C, \SpecialChar \ldots{}
12788
12789 \begin_inset Flex CharStyle:Code
12790 status collapsed
12791
12792 \begin_layout Plain Layout
12793 roman
12794 \end_layout
12795
12796 \end_inset
12797
12798  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12799
12800 \begin_inset Flex CharStyle:Code
12801 status collapsed
12802
12803 \begin_layout Plain Layout
12804 Roman
12805 \end_layout
12806
12807 \end_inset
12808
12809  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12810
12811 \begin_inset Flex CharStyle:Code
12812 status collapsed
12813
12814 \begin_layout Plain Layout
12815 hebrew
12816 \end_layout
12817
12818 \end_inset
12819
12820  for hebrew numerals.
12821 \end_layout
12822
12823 \end_deeper
12824 \begin_layout Standard
12825 If LabelString is not defined, a default value is constructed as follows:
12826  if the counter has a master counter 
12827 \begin_inset Flex CharStyle:Code
12828 status collapsed
12829
12830 \begin_layout Plain Layout
12831 master
12832 \end_layout
12833
12834 \end_inset
12835
12836  (defined via 
12837 \begin_inset Flex CharStyle:Code
12838 status collapsed
12839
12840 \begin_layout Plain Layout
12841 Within
12842 \end_layout
12843
12844 \end_inset
12845
12846 ), the string 
12847 \begin_inset Flex CharStyle:Code
12848 status collapsed
12849
12850 \begin_layout Plain Layout
12851
12852 \backslash
12853 themaster.
12854 \backslash
12855 arabic{counter}
12856 \end_layout
12857
12858 \end_inset
12859
12860  is used; otherwise the string 
12861 \begin_inset Flex CharStyle:Code
12862 status collapsed
12863
12864 \begin_layout Plain Layout
12865
12866 \backslash
12867 arabic{counter}
12868 \end_layout
12869
12870 \end_inset
12871
12872  is used.
12873 \end_layout
12874
12875 \begin_layout Description
12876 \begin_inset Flex CharStyle:Code
12877 status collapsed
12878
12879 \begin_layout Plain Layout
12880 LabelStringAppendix [string=""]
12881 \end_layout
12882
12883 \end_inset
12884
12885  Same as 
12886 \begin_inset Flex CharStyle:Code
12887 status collapsed
12888
12889 \begin_layout Plain Layout
12890 LabelString
12891 \end_layout
12892
12893 \end_inset
12894
12895 , but for use in the Appendix.
12896 \end_layout
12897
12898 \begin_layout Description
12899 \begin_inset Flex CharStyle:Code
12900 status collapsed
12901
12902 \begin_layout Plain Layout
12903 Within
12904 \end_layout
12905
12906 \end_inset
12907
12908  [
12909 \begin_inset Flex CharStyle:Code
12910 status collapsed
12911
12912 \begin_layout Plain Layout
12913 string
12914 \end_layout
12915
12916 \end_inset
12917
12918 =
12919 \begin_inset Quotes erd
12920 \end_inset
12921
12922
12923 \begin_inset Quotes erd
12924 \end_inset
12925
12926 ] If this is set to the name of another counter, the present counter will
12927  be reset everytime the other one is increased.
12928  For example, 
12929 \begin_inset Flex CharStyle:Code
12930 status collapsed
12931
12932 \begin_layout Plain Layout
12933 subsection
12934 \end_layout
12935
12936 \end_inset
12937
12938  is numbered inside 
12939 \begin_inset Flex CharStyle:Code
12940 status collapsed
12941
12942 \begin_layout Plain Layout
12943 section
12944 \end_layout
12945
12946 \end_inset
12947
12948 .
12949 \end_layout
12950
12951 \begin_layout Subsection
12952 Font description
12953 \end_layout
12954
12955 \begin_layout Standard
12956 \begin_inset CommandInset label
12957 LatexCommand label
12958 name "sec:fonts"
12959
12960 \end_inset
12961
12962 A font description looks like this:
12963 \end_layout
12964
12965 \begin_layout LyX-Code
12966 Font 
12967 \family roman
12968 \emph on
12969 or
12970 \family default
12971 \emph default
12972  LabelFont
12973 \end_layout
12974
12975 \begin_layout LyX-Code
12976  ...
12977 \end_layout
12978
12979 \begin_layout LyX-Code
12980 EndFont
12981 \end_layout
12982
12983 \begin_layout Standard
12984 The following commands are available:
12985 \end_layout
12986
12987 \begin_layout Description
12988 \begin_inset Flex CharStyle:Code
12989 status collapsed
12990
12991 \begin_layout Plain Layout
12992 Color
12993 \end_layout
12994
12995 \end_inset
12996
12997  [
12998 \begin_inset Flex CharStyle:Code
12999 status collapsed
13000
13001 \begin_layout Plain Layout
13002
13003 \emph on
13004 none
13005 \end_layout
13006
13007 \end_inset
13008
13009
13010 \begin_inset Flex CharStyle:Code
13011 status collapsed
13012
13013 \begin_layout Plain Layout
13014 black
13015 \end_layout
13016
13017 \end_inset
13018
13019
13020 \begin_inset Flex CharStyle:Code
13021 status collapsed
13022
13023 \begin_layout Plain Layout
13024 white
13025 \end_layout
13026
13027 \end_inset
13028
13029
13030 \begin_inset Flex CharStyle:Code
13031 status collapsed
13032
13033 \begin_layout Plain Layout
13034 red
13035 \end_layout
13036
13037 \end_inset
13038
13039
13040 \begin_inset Flex CharStyle:Code
13041 status collapsed
13042
13043 \begin_layout Plain Layout
13044 green
13045 \end_layout
13046
13047 \end_inset
13048
13049
13050 \begin_inset Flex CharStyle:Code
13051 status collapsed
13052
13053 \begin_layout Plain Layout
13054 blue
13055 \end_layout
13056
13057 \end_inset
13058
13059
13060 \begin_inset Flex CharStyle:Code
13061 status collapsed
13062
13063 \begin_layout Plain Layout
13064 cyan
13065 \end_layout
13066
13067 \end_inset
13068
13069
13070 \begin_inset Flex CharStyle:Code
13071 status collapsed
13072
13073 \begin_layout Plain Layout
13074 magenta
13075 \end_layout
13076
13077 \end_inset
13078
13079
13080 \begin_inset Flex CharStyle:Code
13081 status collapsed
13082
13083 \begin_layout Plain Layout
13084 yellow
13085 \end_layout
13086
13087 \end_inset
13088
13089 ]
13090 \end_layout
13091
13092 \begin_layout Description
13093 \begin_inset Flex CharStyle:Code
13094 status collapsed
13095
13096 \begin_layout Plain Layout
13097 Family
13098 \end_layout
13099
13100 \end_inset
13101
13102  [
13103 \emph on
13104
13105 \begin_inset Flex CharStyle:Code
13106 status collapsed
13107
13108 \begin_layout Plain Layout
13109
13110 \emph on
13111 Roman
13112 \end_layout
13113
13114 \end_inset
13115
13116
13117 \emph default
13118
13119 \begin_inset Flex CharStyle:Code
13120 status collapsed
13121
13122 \begin_layout Plain Layout
13123 Sans
13124 \end_layout
13125
13126 \end_inset
13127
13128
13129 \begin_inset Flex CharStyle:Code
13130 status collapsed
13131
13132 \begin_layout Plain Layout
13133 Typewriter
13134 \end_layout
13135
13136 \end_inset
13137
13138
13139 \end_layout
13140
13141 \begin_layout Description
13142 \begin_inset Flex CharStyle:Code
13143 status collapsed
13144
13145 \begin_layout Plain Layout
13146 Misc
13147 \end_layout
13148
13149 \end_inset
13150
13151  [
13152 \begin_inset Flex CharStyle:Code
13153 status collapsed
13154
13155 \begin_layout Plain Layout
13156 string
13157 \end_layout
13158
13159 \end_inset
13160
13161 ] Valid argument sare: 
13162 \begin_inset Flex CharStyle:Code
13163 status collapsed
13164
13165 \begin_layout Plain Layout
13166 emph
13167 \end_layout
13168
13169 \end_inset
13170
13171
13172 \begin_inset Flex CharStyle:Code
13173 status collapsed
13174
13175 \begin_layout Plain Layout
13176 noun
13177 \end_layout
13178
13179 \end_inset
13180
13181
13182 \begin_inset Flex CharStyle:Code
13183 status collapsed
13184
13185 \begin_layout Plain Layout
13186 underbar
13187 \end_layout
13188
13189 \end_inset
13190
13191
13192 \begin_inset Flex CharStyle:Code
13193 status collapsed
13194
13195 \begin_layout Plain Layout
13196 no_emph
13197 \end_layout
13198
13199 \end_inset
13200
13201
13202 \begin_inset Flex CharStyle:Code
13203 status collapsed
13204
13205 \begin_layout Plain Layout
13206 no_noun
13207 \end_layout
13208
13209 \end_inset
13210
13211  and 
13212 \begin_inset Flex CharStyle:Code
13213 status collapsed
13214
13215 \begin_layout Plain Layout
13216 no_bar
13217 \end_layout
13218
13219 \end_inset
13220
13221 .
13222  Each of these turns on or off the corresponding attribute.
13223 \end_layout
13224
13225 \begin_layout Description
13226 \begin_inset Flex CharStyle:Code
13227 status collapsed
13228
13229 \begin_layout Plain Layout
13230 Series
13231 \end_layout
13232
13233 \end_inset
13234
13235  [
13236 \emph on
13237
13238 \begin_inset Flex CharStyle:Code
13239 status collapsed
13240
13241 \begin_layout Plain Layout
13242
13243 \emph on
13244 Medium
13245 \end_layout
13246
13247 \end_inset
13248
13249
13250 \emph default
13251
13252 \begin_inset Flex CharStyle:Code
13253 status collapsed
13254
13255 \begin_layout Plain Layout
13256 Bold
13257 \end_layout
13258
13259 \end_inset
13260
13261
13262 \end_layout
13263
13264 \begin_layout Description
13265 \begin_inset Flex CharStyle:Code
13266 status collapsed
13267
13268 \begin_layout Plain Layout
13269 Shape
13270 \end_layout
13271
13272 \end_inset
13273
13274  [
13275 \emph on
13276
13277 \begin_inset Flex CharStyle:Code
13278 status collapsed
13279
13280 \begin_layout Plain Layout
13281
13282 \emph on
13283 Up
13284 \end_layout
13285
13286 \end_inset
13287
13288
13289 \emph default
13290
13291 \begin_inset Flex CharStyle:Code
13292 status collapsed
13293
13294 \begin_layout Plain Layout
13295 Italic
13296 \end_layout
13297
13298 \end_inset
13299
13300
13301 \begin_inset Flex CharStyle:Code
13302 status collapsed
13303
13304 \begin_layout Plain Layout
13305 SmallCaps
13306 \end_layout
13307
13308 \end_inset
13309
13310
13311 \begin_inset Flex CharStyle:Code
13312 status collapsed
13313
13314 \begin_layout Plain Layout
13315 Slanted
13316 \end_layout
13317
13318 \end_inset
13319
13320
13321 \end_layout
13322
13323 \begin_layout Description
13324 \begin_inset Flex CharStyle:Code
13325 status collapsed
13326
13327 \begin_layout Plain Layout
13328 Size
13329 \end_layout
13330
13331 \end_inset
13332
13333  [
13334 \begin_inset Flex CharStyle:Code
13335 status collapsed
13336
13337 \begin_layout Plain Layout
13338 tiny
13339 \end_layout
13340
13341 \end_inset
13342
13343
13344 \begin_inset Flex CharStyle:Code
13345 status collapsed
13346
13347 \begin_layout Plain Layout
13348 small
13349 \end_layout
13350
13351 \end_inset
13352
13353
13354 \begin_inset Flex CharStyle:Code
13355 status collapsed
13356
13357 \begin_layout Plain Layout
13358
13359 \emph on
13360 normal
13361 \end_layout
13362
13363 \end_inset
13364
13365
13366 \begin_inset Flex CharStyle:Code
13367 status collapsed
13368
13369 \begin_layout Plain Layout
13370 large
13371 \end_layout
13372
13373 \end_inset
13374
13375
13376 \begin_inset Flex CharStyle:Code
13377 status collapsed
13378
13379 \begin_layout Plain Layout
13380 larger
13381 \end_layout
13382
13383 \end_inset
13384
13385
13386 \begin_inset Flex CharStyle:Code
13387 status collapsed
13388
13389 \begin_layout Plain Layout
13390 largest
13391 \end_layout
13392
13393 \end_inset
13394
13395
13396 \begin_inset Flex CharStyle:Code
13397 status collapsed
13398
13399 \begin_layout Plain Layout
13400 huge
13401 \end_layout
13402
13403 \end_inset
13404
13405
13406 \begin_inset Flex CharStyle:Code
13407 status collapsed
13408
13409 \begin_layout Plain Layout
13410 giant
13411 \end_layout
13412
13413 \end_inset
13414
13415 ]
13416 \end_layout
13417
13418 \begin_layout Subsection
13419 Upgrading old layout files
13420 \end_layout
13421
13422 \begin_layout Standard
13423 The file format of layout files changes from time to time, so old layout
13424  files need to be converted.
13425  This process has been automated since LyX 1.4.0: If LyX reads an old format
13426  layout file it will call the conversion tool 
13427 \begin_inset Flex CharStyle:Code
13428 status collapsed
13429
13430 \begin_layout Plain Layout
13431 LyXDir/scripts/layout2layout.py
13432 \end_layout
13433
13434 \end_inset
13435
13436  and convert it to a temporary file in current format.
13437  The original file is left untouched.
13438  If you want to convert the layout file permanently, just call the converter
13439  by hand:
13440 \end_layout
13441
13442 \begin_layout LyX-Code
13443 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13444 \end_layout
13445
13446 \begin_layout Standard
13447 (You need to replace 
13448 \begin_inset Flex CharStyle:Code
13449 status collapsed
13450
13451 \begin_layout Plain Layout
13452 $LyXDir
13453 \end_layout
13454
13455 \end_inset
13456
13457  with the name of your LyX system directory, unless you happen to have defined
13458  such an environment variable.) Then copy 
13459 \begin_inset Flex CharStyle:Code
13460 status collapsed
13461
13462 \begin_layout Plain Layout
13463 myclassnew.layout
13464 \end_layout
13465
13466 \end_inset
13467
13468  to 
13469 \begin_inset Flex CharStyle:Code
13470 status collapsed
13471
13472 \begin_layout Plain Layout
13473 UserDir/layouts/
13474 \end_layout
13475
13476 \end_inset
13477
13478 .
13479 \end_layout
13480
13481 \begin_layout Standard
13482 The automatic conversion only handles syntax changes.
13483  It cannot handle the case where the contents of included files was changed,
13484  so these will have to be converted separately.
13485 \end_layout
13486
13487 \begin_layout Section
13488 Creating Templates
13489 \begin_inset CommandInset label
13490 LatexCommand label
13491 name "sec:templates"
13492
13493 \end_inset
13494
13495
13496 \end_layout
13497
13498 \begin_layout Standard
13499 Templates are created just like usual documents.
13500  The only difference is that usual documents contain all possible settings,
13501  including the font scheme and the paper size.
13502  Usually a user doesn't want a template to overwrite his defaults in these
13503  cases.
13504  For that reason, the designer of a template should remove the corresponding
13505  commands like 
13506 \begin_inset Flex CharStyle:Code
13507 status collapsed
13508
13509 \begin_layout Plain Layout
13510
13511 \backslash
13512 fontscheme
13513 \end_layout
13514
13515 \end_inset
13516
13517  or 
13518 \begin_inset Flex CharStyle:Code
13519 status collapsed
13520
13521 \begin_layout Plain Layout
13522
13523 \backslash
13524 papersize
13525 \end_layout
13526
13527 \end_inset
13528
13529  from the template LyX file.
13530  This can be done with any simple text-editor, for example 
13531 \begin_inset Flex CharStyle:Code
13532 status collapsed
13533
13534 \begin_layout Plain Layout
13535 vi
13536 \end_layout
13537
13538 \end_inset
13539
13540  or 
13541 \begin_inset Flex CharStyle:Code
13542 status collapsed
13543
13544 \begin_layout Plain Layout
13545 xedit
13546 \end_layout
13547
13548 \end_inset
13549
13550 .
13551  
13552 \end_layout
13553
13554 \begin_layout Standard
13555 Put the edited template files you create in 
13556 \begin_inset Flex CharStyle:Code
13557 status collapsed
13558
13559 \begin_layout Plain Layout
13560 UserDir/templates/
13561 \end_layout
13562
13563 \end_inset
13564
13565 , copy the ones you use from the global template directory in 
13566 \begin_inset Flex CharStyle:Code
13567 status collapsed
13568
13569 \begin_layout Plain Layout
13570 LyXDir/templates/
13571 \end_layout
13572
13573 \end_inset
13574
13575  to the same place, and redefine the template path in the 
13576 \begin_inset Flex CharStyle:MenuItem
13577 status collapsed
13578
13579 \begin_layout Plain Layout
13580 Tools\SpecialChar \menuseparator
13581 Preferences\SpecialChar \menuseparator
13582 Paths
13583 \end_layout
13584
13585 \end_inset
13586
13587  dialog.
13588 \end_layout
13589
13590 \begin_layout Standard
13591 Note that there is a template which has a particular meaning: 
13592 \begin_inset Flex CharStyle:Code
13593 status collapsed
13594
13595 \begin_layout Plain Layout
13596 defaults.lyx
13597 \end_layout
13598
13599 \end_inset
13600
13601 .
13602  This template is loaded everytime you create a new document with 
13603 \begin_inset Flex CharStyle:MenuItem
13604 status collapsed
13605
13606 \begin_layout Plain Layout
13607 File\SpecialChar \menuseparator
13608 New
13609 \end_layout
13610
13611 \end_inset
13612
13613  in order to provide useful defaults.
13614  To create this template from inside LyX, all you have to do is to open
13615  a document with the correct settings, and use the 
13616 \begin_inset Flex CharStyle:MenuItem
13617 status collapsed
13618
13619 \begin_layout Plain Layout
13620 Save as Document Defaults
13621 \end_layout
13622
13623 \end_inset
13624
13625  button.
13626 \end_layout
13627
13628 \begin_layout Chapter
13629 Including External Material
13630 \end_layout
13631
13632 \begin_layout Standard
13633 \begin_inset Box Shadowbox
13634 position "t"
13635 hor_pos "c"
13636 has_inner_box 1
13637 inner_pos "t"
13638 use_parbox 0
13639 width "100col%"
13640 special "none"
13641 height "1in"
13642 height_special "totalheight"
13643 status open
13644
13645 \begin_layout Plain Layout
13646 WARNING: This portion of the documentation has not been updated for some
13647  time.
13648  We certainly hope that it is still accurate, but there are no guarantees.
13649 \end_layout
13650
13651 \end_inset
13652
13653
13654 \end_layout
13655
13656 \begin_layout Standard
13657 The use of material from sources external to LyX is covered in detail in
13658  the 
13659 \emph on
13660 Embedded Objects
13661 \emph default
13662  manual.
13663  This part of the manual covers what needs to happen behind the scenes for
13664  new sorts of material to be included.
13665 \end_layout
13666
13667 \begin_layout Section
13668 How does it work?
13669 \end_layout
13670
13671 \begin_layout Standard
13672 The external material feature is based on the concept of a 
13673 \emph on
13674 template
13675 \emph default
13676 .
13677  A template is a specification of how LyX should interface with a certain
13678  kind of material.
13679  As bundled, LyX comes with predefined templates for Xfig figures, various
13680  raster format images, chess diagrams, and LilyPond music notation.
13681  You can check the actual list by using the menu 
13682 \begin_inset Flex CharStyle:MenuItem
13683 status collapsed
13684
13685 \begin_layout Plain Layout
13686 Insert\SpecialChar \menuseparator
13687 File\SpecialChar \menuseparator
13688 External Material
13689 \end_layout
13690
13691 \end_inset
13692
13693 .
13694  Furthermore, it is possible to roll your own template to support a specific
13695  kind of material.
13696  Later we'll describe in more detail what is involved, and hopefully you
13697  will submit all the templates you create so we can include them in a later
13698  LyX version.
13699 \end_layout
13700
13701 \begin_layout Standard
13702 Another basic idea of the external material feature is to distinguish between
13703  the original file that serves as a base for final material and the produced
13704  file that is included in your exported or printed document.
13705  For example, consider the case of a figure produced with 
13706 \begin_inset Flex CharStyle:Code
13707 status collapsed
13708
13709 \begin_layout Plain Layout
13710 Xfig
13711 \end_layout
13712
13713 \end_inset
13714
13715 .
13716  The Xfig application itself works on an original file with the 
13717 \begin_inset Flex CharStyle:Code
13718 status collapsed
13719
13720 \begin_layout Plain Layout
13721 .fig
13722 \end_layout
13723
13724 \end_inset
13725
13726  extension.
13727  Within XFig, you create and change your figure, and when you are done,
13728  you save the 
13729 \begin_inset Flex CharStyle:Code
13730 status collapsed
13731
13732 \begin_layout Plain Layout
13733 fig
13734 \end_layout
13735
13736 \end_inset
13737
13738 -file.
13739  When you want to include the figure in your document, you invoke 
13740 \begin_inset Flex CharStyle:Code
13741 status collapsed
13742
13743 \begin_layout Plain Layout
13744 transfig
13745 \end_layout
13746
13747 \end_inset
13748
13749  in order to create a PostScript file that can readily be included in your
13750  LaTeX file.
13751  In this case, the 
13752 \begin_inset Flex CharStyle:Code
13753 status collapsed
13754
13755 \begin_layout Plain Layout
13756 .fig
13757 \end_layout
13758
13759 \end_inset
13760
13761  file is the original file, and the PostScript file is the produced file.
13762 \end_layout
13763
13764 \begin_layout Standard
13765 This distinction is important in order to allow updating of the material
13766  while you are in the process of writing the document.
13767  Furthermore, it provides us with the flexibility that is needed to support
13768  multiple export formats.
13769  For instance, in the case of a plain text file, it is not exactly an award-winn
13770 ing idea to include the figure as raw PostScript®.
13771  Instead, you'd either prefer to just include a reference to the figure
13772  or try to invoke some graphics to Ascii converter to make the final result
13773  look similar to the real graphics.
13774  The external material management allows you to do this, because it is parameter
13775 ized on the different export formats that LyX supports.
13776 \end_layout
13777
13778 \begin_layout Standard
13779 Besides supporting the production of different products according to the
13780  exported format, it supports tight integration with editing and viewing
13781  applications.
13782  In the case of an XFig figure, you are able to invoke Xfig on the original
13783  file with a single click from within the external material dialog in LyX,
13784  and also preview the produced PostScript file with ghostview with another
13785  click.
13786  No more fiddling around with the command line and/or file browsers to locate
13787  and manipulate the original or produced files.
13788  In this way, you are finally able to take full advantage of the many different
13789  applications that are relevant to use when you write your documents, and
13790  ultimately be more productive.
13791 \end_layout
13792
13793 \begin_layout Section
13794 The external template configuration file
13795 \end_layout
13796
13797 \begin_layout Standard
13798 It is relatively easy to add custom external template definitions to LyX.
13799  However, be aware that doing this in an careless manner most probably 
13800 \emph on
13801 will
13802 \emph default
13803  introduce an easily exploitable security hole.
13804  So before you do this, please read the discussion about security in section
13805  
13806 \begin_inset CommandInset ref
13807 LatexCommand ref
13808 reference "sec:Security-discussion"
13809
13810 \end_inset
13811
13812 .
13813 \end_layout
13814
13815 \begin_layout Standard
13816 Having said that, we encourage you to submit any interesting templates that
13817  you create.
13818  
13819 \end_layout
13820
13821 \begin_layout Standard
13822 The external templates are defined in the 
13823 \begin_inset Flex CharStyle:Code
13824 status collapsed
13825
13826 \begin_layout Plain Layout
13827 LyXDir/lib/external_templates
13828 \end_layout
13829
13830 \end_inset
13831
13832  file.
13833  You can place your own version in 
13834 \begin_inset Flex CharStyle:Code
13835 status collapsed
13836
13837 \begin_layout Plain Layout
13838 UserDir/external_templates
13839 \end_layout
13840
13841 \end_inset
13842
13843 .
13844 \end_layout
13845
13846 \begin_layout Standard
13847 A typical template looks like this:
13848 \end_layout
13849
13850 \begin_layout LyX-Code
13851 Template XFig
13852 \end_layout
13853
13854 \begin_layout LyX-Code
13855 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13856 \end_layout
13857
13858 \begin_layout LyX-Code
13859 HelpText
13860 \end_layout
13861
13862 \begin_layout LyX-Code
13863 An XFig figure.
13864 \end_layout
13865
13866 \begin_layout LyX-Code
13867 HelpTextEnd
13868 \end_layout
13869
13870 \begin_layout LyX-Code
13871 InputFormat fig
13872 \end_layout
13873
13874 \begin_layout LyX-Code
13875 FileFilter "*.fig"
13876 \end_layout
13877
13878 \begin_layout LyX-Code
13879 AutomaticProduction true
13880 \end_layout
13881
13882 \begin_layout LyX-Code
13883 Transform Rotate
13884 \end_layout
13885
13886 \begin_layout LyX-Code
13887 Transform Resize
13888 \end_layout
13889
13890 \begin_layout LyX-Code
13891 Format LaTeX
13892 \end_layout
13893
13894 \begin_layout LyX-Code
13895 TransformCommand Rotate RotationLatexCommand
13896 \end_layout
13897
13898 \begin_layout LyX-Code
13899 TransformCommand Resize ResizeLatexCommand
13900 \end_layout
13901
13902 \begin_layout LyX-Code
13903 Product "$$RotateFront$$ResizeFront
13904 \end_layout
13905
13906 \begin_layout LyX-Code
13907          
13908 \backslash
13909
13910 \backslash
13911 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13912 \end_layout
13913
13914 \begin_layout LyX-Code
13915          $$ResizeBack$$RotateBack"
13916 \end_layout
13917
13918 \begin_layout LyX-Code
13919 UpdateFormat pstex
13920 \end_layout
13921
13922 \begin_layout LyX-Code
13923 UpdateResult "$$AbsPath$$Basename.pstex_t"
13924 \end_layout
13925
13926 \begin_layout LyX-Code
13927 Requirement "graphicx"
13928 \end_layout
13929
13930 \begin_layout LyX-Code
13931 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13932 \end_layout
13933
13934 \begin_layout LyX-Code
13935 ReferencedFile latex "$$AbsPath$$Basename.eps"
13936 \end_layout
13937
13938 \begin_layout LyX-Code
13939 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13940 \end_layout
13941
13942 \begin_layout LyX-Code
13943 FormatEnd
13944 \end_layout
13945
13946 \begin_layout LyX-Code
13947 Format PDFLaTeX
13948 \end_layout
13949
13950 \begin_layout LyX-Code
13951 TransformCommand Rotate RotationLatexCommand
13952 \end_layout
13953
13954 \begin_layout LyX-Code
13955 TransformCommand Resize ResizeLatexCommand
13956 \end_layout
13957
13958 \begin_layout LyX-Code
13959 Product "$$RotateFront$$ResizeFront
13960 \end_layout
13961
13962 \begin_layout LyX-Code
13963          
13964 \backslash
13965
13966 \backslash
13967 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13968 \end_layout
13969
13970 \begin_layout LyX-Code
13971          $$ResizeBack$$RotateBack"
13972 \end_layout
13973
13974 \begin_layout LyX-Code
13975 UpdateFormat pdftex
13976 \end_layout
13977
13978 \begin_layout LyX-Code
13979 UpdateResult "$$AbsPath$$Basename.pdftex_t"
13980 \end_layout
13981
13982 \begin_layout LyX-Code
13983 Requirement "graphicx"
13984 \end_layout
13985
13986 \begin_layout LyX-Code
13987 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
13988 \end_layout
13989
13990 \begin_layout LyX-Code
13991 ReferencedFile latex "$$AbsPath$$Basename.pdf"
13992 \end_layout
13993
13994 \begin_layout LyX-Code
13995 FormatEnd
13996 \end_layout
13997
13998 \begin_layout LyX-Code
13999 Format Ascii
14000 \end_layout
14001
14002 \begin_layout LyX-Code
14003 Product "$$Contents(
14004 \backslash
14005 "$$AbsPath$$Basename.asc
14006 \backslash
14007 ")"
14008 \end_layout
14009
14010 \begin_layout LyX-Code
14011 UpdateFormat asciixfig
14012 \end_layout
14013
14014 \begin_layout LyX-Code
14015 UpdateResult "$$AbsPath$$Basename.asc"
14016 \end_layout
14017
14018 \begin_layout LyX-Code
14019 FormatEnd
14020 \end_layout
14021
14022 \begin_layout LyX-Code
14023 Format DocBook
14024 \end_layout
14025
14026 \begin_layout LyX-Code
14027 Product "<graphic fileref=
14028 \backslash
14029 "$$AbsOrRelPathMaster$$Basename.eps
14030 \backslash
14031 ">
14032 \end_layout
14033
14034 \begin_layout LyX-Code
14035          </graphic>"
14036 \end_layout
14037
14038 \begin_layout LyX-Code
14039 UpdateFormat eps
14040 \end_layout
14041
14042 \begin_layout LyX-Code
14043 UpdateResult "$$AbsPath$$Basename.eps"
14044 \end_layout
14045
14046 \begin_layout LyX-Code
14047 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14048 \end_layout
14049
14050 \begin_layout LyX-Code
14051 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14052 \end_layout
14053
14054 \begin_layout LyX-Code
14055 FormatEnd
14056 \end_layout
14057
14058 \begin_layout LyX-Code
14059 Product "[XFig: $$FName]"
14060 \end_layout
14061
14062 \begin_layout LyX-Code
14063 FormatEnd
14064 \end_layout
14065
14066 \begin_layout LyX-Code
14067 TemplateEnd
14068 \end_layout
14069
14070 \begin_layout Standard
14071 As you can see, the template is enclosed in 
14072 \begin_inset Flex CharStyle:Code
14073 status collapsed
14074
14075 \begin_layout Plain Layout
14076 Template
14077 \end_layout
14078
14079 \end_inset
14080
14081  \SpecialChar \ldots{}
14082  
14083 \begin_inset Flex CharStyle:Code
14084 status collapsed
14085
14086 \begin_layout Plain Layout
14087 TemplateEnd
14088 \end_layout
14089
14090 \end_inset
14091
14092 .
14093  It contains a header specifying some general settings and, for each supported
14094  primary document file format, a section 
14095 \begin_inset Flex CharStyle:Code
14096 status collapsed
14097
14098 \begin_layout Plain Layout
14099 Format
14100 \end_layout
14101
14102 \end_inset
14103
14104  \SpecialChar \ldots{}
14105  
14106 \begin_inset Flex CharStyle:Code
14107 status collapsed
14108
14109 \begin_layout Plain Layout
14110 FormatEnd
14111 \end_layout
14112
14113 \end_inset
14114
14115 .
14116 \end_layout
14117
14118 \begin_layout Subsection
14119 The template header
14120 \end_layout
14121
14122 \begin_layout Description
14123 \begin_inset Flex CharStyle:Code
14124 status collapsed
14125
14126 \begin_layout Plain Layout
14127 AutomaticProduction
14128 \begin_inset space ~
14129 \end_inset
14130
14131 true|false
14132 \end_layout
14133
14134 \end_inset
14135
14136  Whether the file represented by the template must be generated by LyX.
14137  This command must occur exactly once.
14138 \end_layout
14139
14140 \begin_layout Description
14141 \begin_inset Flex CharStyle:Code
14142 status collapsed
14143
14144 \begin_layout Plain Layout
14145 FileFilter
14146 \begin_inset space ~
14147 \end_inset
14148
14149 <pattern>
14150 \end_layout
14151
14152 \end_inset
14153
14154  A glob pattern that is used in the file dialog to filter out the desired
14155  files.
14156  If there is more than one possible file extension (e.
14157 \begin_inset space \thinspace{}
14158 \end_inset
14159
14160 g.
14161 \begin_inset space \space{}
14162 \end_inset
14163
14164 tgif has 
14165 \begin_inset Flex CharStyle:Code
14166 status collapsed
14167
14168 \begin_layout Plain Layout
14169 .obj
14170 \end_layout
14171
14172 \end_inset
14173
14174  and 
14175 \begin_inset Flex CharStyle:Code
14176 status collapsed
14177
14178 \begin_layout Plain Layout
14179 .tgo
14180 \end_layout
14181
14182 \end_inset
14183
14184 ), use something like 
14185 \begin_inset Flex CharStyle:Code
14186 status collapsed
14187
14188 \begin_layout Plain Layout
14189 "*.{obj,tgo}"
14190 \end_layout
14191
14192 \end_inset
14193
14194 .
14195  This command must occur exactly once.
14196 \end_layout
14197
14198 \begin_layout Description
14199 \begin_inset Flex CharStyle:Code
14200 status collapsed
14201
14202 \begin_layout Plain Layout
14203 GuiName
14204 \begin_inset space ~
14205 \end_inset
14206
14207 <guiname>
14208 \end_layout
14209
14210 \end_inset
14211
14212  The text that is displayed on the button.
14213  This command must occur exactly once.
14214 \end_layout
14215
14216 \begin_layout Description
14217 \begin_inset Flex CharStyle:Code
14218 status collapsed
14219
14220 \begin_layout Plain Layout
14221 HelpText
14222 \begin_inset space ~
14223 \end_inset
14224
14225 <text>
14226 \begin_inset space ~
14227 \end_inset
14228
14229 HelpTextEnd
14230 \end_layout
14231
14232 \end_inset
14233
14234  The help text that is used in the External dialog.
14235  Provide enough information to explain to the user just what the template
14236  can provide him with.
14237  This command must occur exactly once.
14238 \end_layout
14239
14240 \begin_layout Description
14241 \begin_inset Flex CharStyle:Code
14242 status collapsed
14243
14244 \begin_layout Plain Layout
14245 InputFormat
14246 \begin_inset space ~
14247 \end_inset
14248
14249 <format>
14250 \end_layout
14251
14252 \end_inset
14253
14254  The file format of the original file.
14255  This must be the name of a format that is known to LyX (see section 
14256 \begin_inset CommandInset ref
14257 LatexCommand ref
14258 reference "sub:Formats"
14259
14260 \end_inset
14261
14262 ).
14263  Use 
14264 \begin_inset Quotes eld
14265 \end_inset
14266
14267
14268 \begin_inset Flex CharStyle:Code
14269 status collapsed
14270
14271 \begin_layout Plain Layout
14272 *
14273 \end_layout
14274
14275 \end_inset
14276
14277
14278 \begin_inset Quotes erd
14279 \end_inset
14280
14281  if the template can handle original files of more than one format.
14282  LyX will attempt to interrogate the file itself in order to deduce its
14283  format in this case.
14284  This command must occur exactly once.
14285 \end_layout
14286
14287 \begin_layout Description
14288 \begin_inset Flex CharStyle:Code
14289 status collapsed
14290
14291 \begin_layout Plain Layout
14292 Template
14293 \begin_inset space ~
14294 \end_inset
14295
14296 <id>
14297 \end_layout
14298
14299 \end_inset
14300
14301  A unique name for the template.
14302  It must not contain substitution macros (see below).
14303 \end_layout
14304
14305 \begin_layout Description
14306 \begin_inset Flex CharStyle:Code
14307 status collapsed
14308
14309 \begin_layout Plain Layout
14310 Transform
14311 \begin_inset space ~
14312 \end_inset
14313
14314 Rotate|Resize|Clip|Extra
14315 \end_layout
14316
14317 \end_inset
14318
14319  This command specifies which transformations are supported by this template.
14320  It may occur zero or more times.
14321  This command enables the corresponding tabs in the external dialog.
14322  Each 
14323 \begin_inset Flex CharStyle:Code
14324 status collapsed
14325
14326 \begin_layout Plain Layout
14327 Transform
14328 \end_layout
14329
14330 \end_inset
14331
14332  command must have either a corresponding 
14333 \begin_inset Flex CharStyle:Code
14334 status collapsed
14335
14336 \begin_layout Plain Layout
14337 TransformCommand
14338 \end_layout
14339
14340 \end_inset
14341
14342  or a 
14343 \begin_inset Flex CharStyle:Code
14344 status collapsed
14345
14346 \begin_layout Plain Layout
14347 TransformOption
14348 \end_layout
14349
14350 \end_inset
14351
14352  command in the 
14353 \begin_inset Flex CharStyle:Code
14354 status collapsed
14355
14356 \begin_layout Plain Layout
14357 Format
14358 \end_layout
14359
14360 \end_inset
14361
14362  section.
14363  Otherwise the transformation will not be supported by that format.
14364 \end_layout
14365
14366 \begin_layout Subsection
14367 The Format section
14368 \end_layout
14369
14370 \begin_layout Description
14371 \begin_inset Flex CharStyle:Code
14372 status collapsed
14373
14374 \begin_layout Plain Layout
14375 Format
14376 \begin_inset space ~
14377 \end_inset
14378
14379 LaTeX|PDFLaTeX|PlainText|DocBook
14380 \end_layout
14381
14382 \end_inset
14383
14384  The primary document file format that this format definition is for.
14385  Not every template has a sensible representation in all document file formats.
14386  Please define nevertheless a 
14387 \begin_inset Flex CharStyle:Code
14388 status collapsed
14389
14390 \begin_layout Plain Layout
14391 Format
14392 \end_layout
14393
14394 \end_inset
14395
14396  section for all formats.
14397  Use a dummy text when no representation is available.
14398  Then you can at least see a reference to the external material in the exported
14399  document.
14400 \end_layout
14401
14402 \begin_layout Description
14403 \begin_inset Flex CharStyle:Code
14404 status collapsed
14405
14406 \begin_layout Plain Layout
14407 Option
14408 \begin_inset space ~
14409 \end_inset
14410
14411 <name>
14412 \begin_inset space ~
14413 \end_inset
14414
14415 <value>
14416 \end_layout
14417
14418 \end_inset
14419
14420  This command defines an additional macro 
14421 \begin_inset Flex CharStyle:Code
14422 status collapsed
14423
14424 \begin_layout Plain Layout
14425 $$<name>
14426 \end_layout
14427
14428 \end_inset
14429
14430  for substitution in 
14431 \begin_inset Flex CharStyle:Code
14432 status collapsed
14433
14434 \begin_layout Plain Layout
14435 Product
14436 \end_layout
14437
14438 \end_inset
14439
14440 .
14441  
14442 \begin_inset Flex CharStyle:Code
14443 status collapsed
14444
14445 \begin_layout Plain Layout
14446 <value>
14447 \end_layout
14448
14449 \end_inset
14450
14451  itself may contain substitution macros.
14452  The advantage over using 
14453 \begin_inset Flex CharStyle:Code
14454 status collapsed
14455
14456 \begin_layout Plain Layout
14457 <value>
14458 \end_layout
14459
14460 \end_inset
14461
14462  directly in 
14463 \begin_inset Flex CharStyle:Code
14464 status collapsed
14465
14466 \begin_layout Plain Layout
14467 Product
14468 \end_layout
14469
14470 \end_inset
14471
14472  is that the substituted value of 
14473 \begin_inset Flex CharStyle:Code
14474 status collapsed
14475
14476 \begin_layout Plain Layout
14477 $$<name>
14478 \end_layout
14479
14480 \end_inset
14481
14482  is sanitized so that it is a valid optional argument in the document format.
14483  This command may occur zero or more times.
14484 \end_layout
14485
14486 \begin_layout Description
14487 \begin_inset Flex CharStyle:Code
14488 status collapsed
14489
14490 \begin_layout Plain Layout
14491 Product
14492 \begin_inset space ~
14493 \end_inset
14494
14495 <text>
14496 \end_layout
14497
14498 \end_inset
14499
14500  The text that is inserted in the exported document.
14501  This is actually the most important command and can be quite complex.
14502  This command must occur exactly once.
14503 \end_layout
14504
14505 \begin_layout Description
14506 \begin_inset Flex CharStyle:Code
14507 status collapsed
14508
14509 \begin_layout Plain Layout
14510 Preamble
14511 \begin_inset space ~
14512 \end_inset
14513
14514 <name>
14515 \end_layout
14516
14517 \end_inset
14518
14519  This command specifies a preamble snippet that will be included in the
14520  LaTeX preamble.
14521  It has to be defined using 
14522 \begin_inset Flex CharStyle:Code
14523 status collapsed
14524
14525 \begin_layout Plain Layout
14526 PreambleDef
14527 \end_layout
14528
14529 \end_inset
14530
14531  \SpecialChar \ldots{}
14532  
14533 \begin_inset Flex CharStyle:Code
14534 status collapsed
14535
14536 \begin_layout Plain Layout
14537 PreambleDefEnd
14538 \end_layout
14539
14540 \end_inset
14541
14542 .
14543  This command may occur zero or more times.
14544 \end_layout
14545
14546 \begin_layout Description
14547 \begin_inset Flex CharStyle:Code
14548 status collapsed
14549
14550 \begin_layout Plain Layout
14551 ReferencedFile
14552 \begin_inset space ~
14553 \end_inset
14554
14555 <format>
14556 \begin_inset space ~
14557 \end_inset
14558
14559 <filename>
14560 \end_layout
14561
14562 \end_inset
14563
14564  This command denotes files that are created by the conversion process and
14565  are needed for a particular export format.
14566  If the filename is relative, it is interpreted relative to the master document.
14567  This command may be given zero or more times.
14568 \end_layout
14569
14570 \begin_layout Description
14571 \begin_inset Flex CharStyle:Code
14572 status collapsed
14573
14574 \begin_layout Plain Layout
14575 Requirement
14576 \begin_inset space ~
14577 \end_inset
14578
14579 <package>
14580 \end_layout
14581
14582 \end_inset
14583
14584  The name of a required LaTeX package.
14585  The package is included via 
14586 \begin_inset Flex CharStyle:Code
14587 status collapsed
14588
14589 \begin_layout Plain Layout
14590
14591 \backslash
14592 usepackage{}
14593 \end_layout
14594
14595 \end_inset
14596
14597  in the LaTeX preamble.
14598  This command may occur zero or more times.
14599 \end_layout
14600
14601 \begin_layout Description
14602 \begin_inset Flex CharStyle:Code
14603 status collapsed
14604
14605 \begin_layout Plain Layout
14606 TransformCommand
14607 \begin_inset space ~
14608 \end_inset
14609
14610 Rotate
14611 \begin_inset space ~
14612 \end_inset
14613
14614 RotationLatexCommand
14615 \end_layout
14616
14617 \end_inset
14618
14619  This command specifies that the built in LaTeX command should be used for
14620  rotation.
14621  This command may occur once or not at all.
14622 \end_layout
14623
14624 \begin_layout Description
14625 \begin_inset Flex CharStyle:Code
14626 status collapsed
14627
14628 \begin_layout Plain Layout
14629 TransformCommand
14630 \begin_inset space ~
14631 \end_inset
14632
14633 Resize
14634 \begin_inset space ~
14635 \end_inset
14636
14637 ResizeLatexCommand
14638 \end_layout
14639
14640 \end_inset
14641
14642  This command specifies that the built in LaTeX command should be used for
14643  resizing.
14644  This command may occur once or not at all.
14645 \end_layout
14646
14647 \begin_layout Description
14648 \begin_inset Flex CharStyle:Code
14649 status collapsed
14650
14651 \begin_layout Plain Layout
14652 TransformOption
14653 \begin_inset space ~
14654 \end_inset
14655
14656 Rotate
14657 \begin_inset space ~
14658 \end_inset
14659
14660 RotationLatexOption
14661 \end_layout
14662
14663 \end_inset
14664
14665  This command specifies that rotation is done via an optional argument.
14666  This command may occur once or not at all.
14667 \end_layout
14668
14669 \begin_layout Description
14670 \begin_inset Flex CharStyle:Code
14671 status collapsed
14672
14673 \begin_layout Plain Layout
14674 TransformOption
14675 \begin_inset space ~
14676 \end_inset
14677
14678 Resize
14679 \begin_inset space ~
14680 \end_inset
14681
14682 ResizeLatexOption
14683 \end_layout
14684
14685 \end_inset
14686
14687  This command specifies that resizing is done via an optional argument.
14688  This command may occur once or not at all.
14689 \end_layout
14690
14691 \begin_layout Description
14692 \begin_inset Flex CharStyle:Code
14693 status collapsed
14694
14695 \begin_layout Plain Layout
14696 TransformOption
14697 \begin_inset space ~
14698 \end_inset
14699
14700 Clip
14701 \begin_inset space ~
14702 \end_inset
14703
14704 ClipLatexOption
14705 \end_layout
14706
14707 \end_inset
14708
14709  This command specifies that clipping is done via an optional argument.
14710  This command may occur once or not at all.
14711 \end_layout
14712
14713 \begin_layout Description
14714 \begin_inset Flex CharStyle:Code
14715 status collapsed
14716
14717 \begin_layout Plain Layout
14718 TransformOption
14719 \begin_inset space ~
14720 \end_inset
14721
14722 Extra
14723 \begin_inset space ~
14724 \end_inset
14725
14726 ExtraLatexOption
14727 \end_layout
14728
14729 \end_inset
14730
14731  This command specifies that an extra optional argument is used.
14732  This command may occur once or not at all.
14733 \end_layout
14734
14735 \begin_layout Description
14736 \begin_inset Flex CharStyle:Code
14737 status collapsed
14738
14739 \begin_layout Plain Layout
14740 UpdateFormat
14741 \begin_inset space ~
14742 \end_inset
14743
14744 <format>
14745 \end_layout
14746
14747 \end_inset
14748
14749  The file format of the converted file.
14750  This must be the name of a format that is known to LyX (see the 
14751 \begin_inset Flex CharStyle:MenuItem
14752 status collapsed
14753
14754 \begin_layout Plain Layout
14755
14756 \bar under
14757 T
14758 \bar default
14759 ools\SpecialChar \menuseparator
14760
14761 \bar under
14762 P
14763 \bar default
14764 references:Conversion
14765 \end_layout
14766
14767 \end_inset
14768
14769  dialog).
14770  This command must occur exactly once.
14771 \end_layout
14772
14773 \begin_layout Description
14774 \begin_inset Flex CharStyle:Code
14775 status collapsed
14776
14777 \begin_layout Plain Layout
14778 UpdateResult
14779 \begin_inset space ~
14780 \end_inset
14781
14782 <filename>
14783 \end_layout
14784
14785 \end_inset
14786
14787  The file name of the converted file.
14788  The file name must be absolute.
14789  This command must occur exactly once.
14790 \end_layout
14791
14792 \begin_layout Subsection
14793 Preamble definitions
14794 \end_layout
14795
14796 \begin_layout Standard
14797 The external template configuration file may contain additional preamble
14798  definitions enclosed by 
14799 \begin_inset Flex CharStyle:Code
14800 status collapsed
14801
14802 \begin_layout Plain Layout
14803 PreambleDef
14804 \end_layout
14805
14806 \end_inset
14807
14808  \SpecialChar \ldots{}
14809  
14810 \begin_inset Flex CharStyle:Code
14811 status collapsed
14812
14813 \begin_layout Plain Layout
14814 PreambleDefEnd
14815 \end_layout
14816
14817 \end_inset
14818
14819 .
14820  They can be used by the templates in the 
14821 \begin_inset Flex CharStyle:Code
14822 status collapsed
14823
14824 \begin_layout Plain Layout
14825 Format
14826 \end_layout
14827
14828 \end_inset
14829
14830  section.
14831 \end_layout
14832
14833 \begin_layout Section
14834 The substitution mechanism
14835 \end_layout
14836
14837 \begin_layout Standard
14838 When the external material facility invokes an external program, it is done
14839  on the basis of a command defined in the template configuration file.
14840  These commands can contain various macros that are expanded before execution.
14841  Execution always take place in the directory of the containing document.
14842 \end_layout
14843
14844 \begin_layout Standard
14845 Also, whenever external material is to be displayed, the name will be produced
14846  by the substitution mechanism, and most other commands in the template
14847  definition support substitution as well.
14848 \end_layout
14849
14850 \begin_layout Standard
14851 The available macros are the following:
14852 \end_layout
14853
14854 \begin_layout Description
14855 \begin_inset Flex CharStyle:Code
14856 status collapsed
14857
14858 \begin_layout Plain Layout
14859 $$AbsOrRelPathMaster
14860 \end_layout
14861
14862 \end_inset
14863
14864  The file path, absolute or relative to the master LyX document.
14865 \end_layout
14866
14867 \begin_layout Description
14868 \begin_inset Flex CharStyle:Code
14869 status collapsed
14870
14871 \begin_layout Plain Layout
14872 $$AbsOrRelPathParent
14873 \end_layout
14874
14875 \end_inset
14876
14877  The file path, absolute or relative to the LyX document.
14878 \end_layout
14879
14880 \begin_layout Description
14881 \begin_inset Flex CharStyle:Code
14882 status collapsed
14883
14884 \begin_layout Plain Layout
14885 $$AbsPath
14886 \end_layout
14887
14888 \end_inset
14889
14890  The absolute file path.
14891 \end_layout
14892
14893 \begin_layout Description
14894 \begin_inset Flex CharStyle:Code
14895 status collapsed
14896
14897 \begin_layout Plain Layout
14898 $$Basename
14899 \end_layout
14900
14901 \end_inset
14902
14903  The filename without path and without the extension.
14904 \end_layout
14905
14906 \begin_layout Description
14907 \begin_inset Flex CharStyle:Code
14908 status collapsed
14909
14910 \begin_layout Plain Layout
14911 $$Contents(
14912 \begin_inset Quotes eld
14913 \end_inset
14914
14915 filename.ext
14916 \begin_inset Quotes erd
14917 \end_inset
14918
14919 )
14920 \end_layout
14921
14922 \end_inset
14923
14924  This macro will expand to the contents of the file with the name 
14925 \begin_inset Flex CharStyle:Code
14926 status collapsed
14927
14928 \begin_layout Plain Layout
14929 filename.ext
14930 \end_layout
14931
14932 \end_inset
14933
14934 .
14935 \end_layout
14936
14937 \begin_layout Description
14938 \begin_inset Flex CharStyle:Code
14939 status collapsed
14940
14941 \begin_layout Plain Layout
14942 $$Extension
14943 \end_layout
14944
14945 \end_inset
14946
14947  The file extension (including the dot).
14948 \end_layout
14949
14950 \begin_layout Description
14951 \begin_inset Flex CharStyle:Code
14952 status collapsed
14953
14954 \begin_layout Plain Layout
14955 $$FName
14956 \end_layout
14957
14958 \end_inset
14959
14960  The filename of the file specified in the external material dialog.
14961  This is either an absolute name, or it is relative to the LyX document.
14962 \end_layout
14963
14964 \begin_layout Description
14965 \begin_inset Flex CharStyle:Code
14966 status collapsed
14967
14968 \begin_layout Plain Layout
14969 $$FPath
14970 \end_layout
14971
14972 \end_inset
14973
14974  The path part of 
14975 \begin_inset Flex CharStyle:Code
14976 status collapsed
14977
14978 \begin_layout Plain Layout
14979 $$FName
14980 \end_layout
14981
14982 \end_inset
14983
14984  (absolute name or relative to the LyX document).
14985 \end_layout
14986
14987 \begin_layout Description
14988 \begin_inset Flex CharStyle:Code
14989 status collapsed
14990
14991 \begin_layout Plain Layout
14992 $$RelPathMaster
14993 \end_layout
14994
14995 \end_inset
14996
14997  The file path, relative to the master LyX document.
14998 \end_layout
14999
15000 \begin_layout Description
15001 \begin_inset Flex CharStyle:Code
15002 status collapsed
15003
15004 \begin_layout Plain Layout
15005 $$RelPathParent
15006 \end_layout
15007
15008 \end_inset
15009
15010  The file path, relative to the LyX document.
15011 \end_layout
15012
15013 \begin_layout Description
15014 \begin_inset Flex CharStyle:Code
15015 status collapsed
15016
15017 \begin_layout Plain Layout
15018 $$Sysdir
15019 \end_layout
15020
15021 \end_inset
15022
15023  This macro will expand to the absolute path of the system directory.
15024  This is typically used to point to the various helper scripts that are
15025  bundled with LyX.
15026 \end_layout
15027
15028 \begin_layout Description
15029 \begin_inset Flex CharStyle:Code
15030 status collapsed
15031
15032 \begin_layout Plain Layout
15033 $$Tempname
15034 \end_layout
15035
15036 \end_inset
15037
15038  A name and full path to a temporary file which will be automatically deleted
15039  whenever the containing document is closed, or the external material insertion
15040  deleted.
15041 \end_layout
15042
15043 \begin_layout Standard
15044 All path macros contain a trailing directory separator, so you can construct
15045  e.
15046 \begin_inset space \thinspace{}
15047 \end_inset
15048
15049 g.
15050 \begin_inset space \space{}
15051 \end_inset
15052
15053 the absolute filename with 
15054 \begin_inset Flex CharStyle:Code
15055 status collapsed
15056
15057 \begin_layout Plain Layout
15058 $$AbsPath$$Basename$$Extension
15059 \end_layout
15060
15061 \end_inset
15062
15063 .
15064 \end_layout
15065
15066 \begin_layout Standard
15067 The macros above are substituted in all commands unless otherwise noted.
15068  The command 
15069 \begin_inset Flex CharStyle:Code
15070 status collapsed
15071
15072 \begin_layout Plain Layout
15073 Product
15074 \end_layout
15075
15076 \end_inset
15077
15078  supports additionally the following substitutions if they are enabled by
15079  the 
15080 \begin_inset Flex CharStyle:Code
15081 status collapsed
15082
15083 \begin_layout Plain Layout
15084 Transform
15085 \end_layout
15086
15087 \end_inset
15088
15089  and 
15090 \begin_inset Flex CharStyle:Code
15091 status collapsed
15092
15093 \begin_layout Plain Layout
15094 TransformCommand
15095 \end_layout
15096
15097 \end_inset
15098
15099  commands:
15100 \end_layout
15101
15102 \begin_layout Description
15103 \begin_inset Flex CharStyle:Code
15104 status collapsed
15105
15106 \begin_layout Plain Layout
15107 $$ResizeFront
15108 \end_layout
15109
15110 \end_inset
15111
15112  The front part of the resize command.
15113 \end_layout
15114
15115 \begin_layout Description
15116 \begin_inset Flex CharStyle:Code
15117 status collapsed
15118
15119 \begin_layout Plain Layout
15120 $$ResizeBack
15121 \end_layout
15122
15123 \end_inset
15124
15125  The back part of the resize command.
15126 \end_layout
15127
15128 \begin_layout Description
15129 \begin_inset Flex CharStyle:Code
15130 status collapsed
15131
15132 \begin_layout Plain Layout
15133 $$RotateFront
15134 \end_layout
15135
15136 \end_inset
15137
15138  The front part of the rotation command.
15139 \end_layout
15140
15141 \begin_layout Description
15142 \begin_inset Flex CharStyle:Code
15143 status collapsed
15144
15145 \begin_layout Plain Layout
15146 $$RotateBack
15147 \end_layout
15148
15149 \end_inset
15150
15151  The back part of the rotation command.
15152 \end_layout
15153
15154 \begin_layout Standard
15155 The value string of the 
15156 \begin_inset Flex CharStyle:Code
15157 status collapsed
15158
15159 \begin_layout Plain Layout
15160 Option
15161 \end_layout
15162
15163 \end_inset
15164
15165  command supports additionally the following substitutions if they are enabled
15166  by the 
15167 \begin_inset Flex CharStyle:Code
15168 status collapsed
15169
15170 \begin_layout Plain Layout
15171 Transform
15172 \end_layout
15173
15174 \end_inset
15175
15176  and 
15177 \begin_inset Flex CharStyle:Code
15178 status collapsed
15179
15180 \begin_layout Plain Layout
15181 TransformOption
15182 \end_layout
15183
15184 \end_inset
15185
15186  commands:
15187 \end_layout
15188
15189 \begin_layout Description
15190 \begin_inset Flex CharStyle:Code
15191 status collapsed
15192
15193 \begin_layout Plain Layout
15194 $$Clip
15195 \end_layout
15196
15197 \end_inset
15198
15199  The clip option.
15200 \end_layout
15201
15202 \begin_layout Description
15203 \begin_inset Flex CharStyle:Code
15204 status collapsed
15205
15206 \begin_layout Plain Layout
15207 $$Extra
15208 \end_layout
15209
15210 \end_inset
15211
15212  The extra option.
15213 \end_layout
15214
15215 \begin_layout Description
15216 \begin_inset Flex CharStyle:Code
15217 status collapsed
15218
15219 \begin_layout Plain Layout
15220 $$Resize
15221 \end_layout
15222
15223 \end_inset
15224
15225  The resize option.
15226 \end_layout
15227
15228 \begin_layout Description
15229 \begin_inset Flex CharStyle:Code
15230 status collapsed
15231
15232 \begin_layout Plain Layout
15233 $$Rotate
15234 \end_layout
15235
15236 \end_inset
15237
15238  The rotation option.
15239 \end_layout
15240
15241 \begin_layout Standard
15242 You may ask why there are so many path macros.
15243  There are mainly two reasons:
15244 \end_layout
15245
15246 \begin_layout Enumerate
15247 Relative and absolute file names should remain relative or absolute, respectivel
15248 y.
15249  Users may have reasons to prefer either form.
15250  Relative names are useful for portable documents that should work on different
15251  machines, for example.
15252  Absolute names may be required by some programs.
15253 \end_layout
15254
15255 \begin_layout Enumerate
15256 LaTeX treats relative file names differently than LyX and other programs
15257  in nested included files.
15258  For LyX, a relative file name is always relative to the document that contains
15259  the file name.
15260  For LaTeX, it is always relative to the master document.
15261  These two definitions are identical if you have only one document, but
15262  differ if you have a master document that includes part documents.
15263  That means that relative filenames must be transformed when presented to
15264  LaTeX.
15265  Fortunately LyX does this automatically for you if you choose the right
15266  macros.
15267 \end_layout
15268
15269 \begin_layout Standard
15270 So which path macro should be used in new template definitions? The rule
15271  is not difficult:
15272 \end_layout
15273
15274 \begin_layout Itemize
15275 Use 
15276 \begin_inset Flex CharStyle:Code
15277 status collapsed
15278
15279 \begin_layout Plain Layout
15280 $$AbsPath
15281 \end_layout
15282
15283 \end_inset
15284
15285  if an absolute path is required.
15286 \end_layout
15287
15288 \begin_layout Itemize
15289 Use 
15290 \begin_inset Flex CharStyle:Code
15291 status collapsed
15292
15293 \begin_layout Plain Layout
15294 $$AbsOrRelPathMaster
15295 \end_layout
15296
15297 \end_inset
15298
15299  if the substituted string is some kind of LaTeX input.
15300 \end_layout
15301
15302 \begin_layout Itemize
15303 Else use 
15304 \begin_inset Flex CharStyle:Code
15305 status collapsed
15306
15307 \begin_layout Plain Layout
15308 $$AbsOrRelPathParent
15309 \end_layout
15310
15311 \end_inset
15312
15313  in order to preserve the user's choice.
15314 \end_layout
15315
15316 \begin_layout Standard
15317 There are special cases where this rule does not work and e.
15318 \begin_inset space \thinspace{}
15319 \end_inset
15320
15321 g.
15322 \begin_inset space \space{}
15323 \end_inset
15324
15325 relative names are needed, but normally it will work just fine.
15326  One example for such a case is the command 
15327 \begin_inset Flex CharStyle:Code
15328 status collapsed
15329
15330 \begin_layout Plain Layout
15331 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15332 \end_layout
15333
15334 \end_inset
15335
15336  in the XFig template above: We can't use the absolute name because the
15337  copier for 
15338 \begin_inset Flex CharStyle:Code
15339 status collapsed
15340
15341 \begin_layout Plain Layout
15342 .pstex_t
15343 \end_layout
15344
15345 \end_inset
15346
15347  files needs the relative name in order to rewrite the file content.
15348 \end_layout
15349
15350 \begin_layout Section
15351 \begin_inset CommandInset label
15352 LatexCommand label
15353 name "sec:Security-discussion"
15354
15355 \end_inset
15356
15357 Security discussion
15358 \end_layout
15359
15360 \begin_layout Standard
15361 \begin_inset Box Shadowbox
15362 position "t"
15363 hor_pos "c"
15364 has_inner_box 1
15365 inner_pos "t"
15366 use_parbox 0
15367 width "100col%"
15368 special "none"
15369 height "1in"
15370 height_special "totalheight"
15371 status open
15372
15373 \begin_layout Plain Layout
15374 WARNING: This section is definitely outdated.
15375 \end_layout
15376
15377 \end_inset
15378
15379
15380 \end_layout
15381
15382 \begin_layout Standard
15383 The external material feature interfaces with a lot of external programs
15384  and does so automatically, so we have to consider the security implications
15385  of this.
15386  In particular, since you have the option of including your own filenames
15387  and/or parameter strings and those are expanded into a command, it seems
15388  that it would be possible to create a malicious document which executes
15389  arbitrary commands when a user views or prints the document.
15390  This is something we definately want to avoid.
15391 \end_layout
15392
15393 \begin_layout Standard
15394 However, since the external program commands are specified in the template
15395  configuration file only, there are no security issues if LyX is properly
15396  configured with safe templates only.
15397  This is so because the external programs are invoked with the 
15398 \begin_inset Flex CharStyle:Code
15399 status collapsed
15400
15401 \begin_layout Plain Layout
15402 execvp
15403 \end_layout
15404
15405 \end_inset
15406
15407 -system call rather than the 
15408 \begin_inset Flex CharStyle:Code
15409 status collapsed
15410
15411 \begin_layout Plain Layout
15412 system
15413 \end_layout
15414
15415 \end_inset
15416
15417  system-call, so it's not possible to execute arbitrary commands from the
15418  filename or parameter section via the shell.
15419 \end_layout
15420
15421 \begin_layout Standard
15422 This also implies that you are restricted in what command strings you can
15423  use in the external material templates.
15424  In particular, pipes and redirection are not readily available.
15425  This has to be so if LyX should remain safe.
15426  If you want to use some of the shell features, you should write a safe
15427  script to do this in a controlled manner, and then invoke the script from
15428  the command string.
15429  In the 
15430 \begin_inset Flex CharStyle:Code
15431 status collapsed
15432
15433 \begin_layout Plain Layout
15434 lib/scripts
15435 \end_layout
15436
15437 \end_inset
15438
15439  directory of the LyX installation, you can find a safe wrapper script 
15440 \begin_inset Flex CharStyle:Code
15441 status collapsed
15442
15443 \begin_layout Plain Layout
15444 general_command_wrapper.py
15445 \end_layout
15446
15447 \end_inset
15448
15449  that supports redirection of input and output.
15450  That can serve as an example for how to write safe template scripts.
15451  For a more advanced example that uses 
15452 \begin_inset Flex CharStyle:Code
15453 status collapsed
15454
15455 \begin_layout Plain Layout
15456 fork
15457 \end_layout
15458
15459 \end_inset
15460
15461  and friends, take a look at the 
15462 \begin_inset Flex CharStyle:Code
15463 status collapsed
15464
15465 \begin_layout Plain Layout
15466 pic2ascii.py
15467 \end_layout
15468
15469 \end_inset
15470
15471  converter script.
15472 \end_layout
15473
15474 \begin_layout Standard
15475 It is possible to design a template that interacts directly with the shell,
15476  but since this would allow a malicious user to execute arbitrary commands
15477  by writing clever filenames and/or parameters, we generally recommend that
15478  you only use safe scripts that work with the 
15479 \begin_inset Flex CharStyle:Code
15480 status collapsed
15481
15482 \begin_layout Plain Layout
15483 execvp
15484 \end_layout
15485
15486 \end_inset
15487
15488  system call in a controlled manner.
15489  Of course, for use in a controlled environment, it can be tempting to just
15490  fall back to use ordinary shell scripts.
15491  If you do so, be aware that you 
15492 \emph on
15493 will
15494 \emph default
15495  provide an easily exploitable security hole in your system.
15496  Of course it stands to reason that such unsafe templates will never be
15497  included in the standard LyX distribution, although we do encourage people
15498  to submit new templates in the open source tradition.
15499  But LyX as shipped from the official distribution channels will never have
15500  unsafe templates.
15501 \end_layout
15502
15503 \begin_layout Standard
15504 Including external material provides a lot of power, and you have to be
15505  careful not to introduce security hazards with this power.
15506  A subtle error in a single line in an innocent looking script can open
15507  the door to huge security problems.
15508  So if you do not fully understand the issues, we recommend that you consult
15509  a knowledgable security professional or the LyX development team if you
15510  have any questions about whether a given template is safe or not.
15511  And do this before you use it in an uncontrolled environment.
15512 \end_layout
15513
15514 \end_body
15515 \end_document