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