]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
UserGuide.lyx: - removed doubled sentence
[lyx.git] / lib / doc / Customization.lyx
1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
2 \lyxformat 347
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 kxmod
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 \emph on
4074 char 
4075 \emph default
4076 be an 
4077 \emph on
4078 accent
4079 \emph default
4080  
4081 \family roman
4082 \shape up
4083 on the
4084 \family default
4085 \shape default
4086  
4087 \family roman
4088 \shape up
4089 \emph on
4090 allowed
4091 \family default
4092 \shape default
4093 \emph default
4094  
4095 \family roman
4096 \shape up
4097 cha
4098 \family default
4099 racter(s).
4100  This is the dead key
4101 \begin_inset Foot
4102 status collapsed
4103
4104 \begin_layout Plain Layout
4105 The term 
4106 \family roman
4107 \emph on
4108 dead key
4109 \family default
4110 \emph default
4111  refers to a key that does not produce a character by itself, but when followed
4112  with another key, produces the desired accent character.
4113  For example, a German characte
4114 \family roman
4115 r with an umlaut like
4116 \family default
4117  
4118 \family roman
4119 \emph on
4120 ä
4121 \family default
4122 \emph default
4123  
4124 \family roman
4125 can be produced in this manner.
4126 \end_layout
4127
4128 \end_inset
4129
4130  mechanism.
4131  
4132 \end_layout
4133
4134 \begin_layout Standard
4135 If you 
4136 \family roman
4137 hit
4138 \family default
4139  
4140 \family roman
4141 \emph on
4142 char
4143 \family default
4144 \emph default
4145  
4146 \family roman
4147 and then another key not in
4148 \family default
4149  
4150 \family roman
4151 \emph on
4152 allowed
4153 \emph default
4154 , you will get a
4155 \family default
4156  
4157 \family roman
4158 \emph on
4159 char
4160 \family default
4161 \emph default
4162  
4163 \family roman
4164 followed by the other, not allowed key, as output.
4165
4166 \family default
4167  Note that a 
4168 \begin_inset Flex CharStyle:MenuItem
4169 status collapsed
4170
4171 \begin_layout Plain Layout
4172
4173 \shape up
4174 Backspace
4175 \end_layout
4176
4177 \end_inset
4178
4179  cancels a dead key, so if 
4180 \family roman
4181 you hit
4182 \family default
4183  
4184 \family roman
4185 \emph on
4186 char
4187 \family default
4188 \emph default
4189  
4190 \begin_inset Flex CharStyle:Code
4191 status collapsed
4192
4193 \begin_layout Plain Layout
4194 Backspace
4195 \end_layout
4196
4197 \end_inset
4198
4199 , the cursor will not go one position backwards but will instead cancel
4200  the effect t
4201 \family roman
4202 hat
4203 \family default
4204  
4205 \family roman
4206 \shape up
4207 \emph on
4208 char
4209 \family default
4210 \shape default
4211 \emph default
4212  
4213 \family roman
4214 \shape up
4215 might have had on the next keystroke.
4216  
4217 \end_layout
4218
4219 \begin_layout Standard
4220 The following example specifies that the character ' is to be an acute accent,
4221  allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4222 \end_layout
4223
4224 \begin_layout LyX-Code
4225
4226 \backslash
4227 kmod ' acute aeiouAEIOU
4228 \end_layout
4229
4230 \begin_layout Labeling
4231 \labelwidthstring 00.00.0000
4232 \begin_inset Flex CharStyle:Code
4233 status collapsed
4234
4235 \begin_layout Plain Layout
4236 kxmod
4237 \end_layout
4238
4239 \end_inset
4240
4241  Specify an exception to the accent character
4242 \end_layout
4243
4244 \begin_layout LyX-Code
4245
4246 \backslash
4247 kxmod  
4248 \family roman
4249 \emph on
4250 accent char result
4251 \end_layout
4252
4253 \begin_layout Standard
4254 This defines an exce
4255 \family roman
4256 ption for
4257 \family default
4258  
4259 \family roman
4260 \emph on
4261 accent
4262 \family default
4263 \emph default
4264  
4265 \family roman
4266 on
4267 \family default
4268  
4269 \family roman
4270 \emph on
4271 char
4272 \emph default
4273 .
4274  T
4275 \shape up
4276 he
4277 \family default
4278 \shape default
4279  
4280 \family roman
4281 \shape up
4282 \emph on
4283 accent
4284 \family default
4285 \shape default
4286 \emph default
4287  
4288 \family roman
4289 \shape up
4290 must
4291 \family default
4292 \shape default
4293  
4294 \shape up
4295 have been assigned a keystroke with a previous
4296 \shape default
4297  
4298 \begin_inset Flex CharStyle:Code
4299 status collapsed
4300
4301 \begin_layout Plain Layout
4302
4303 \shape up
4304
4305 \backslash
4306 kmo
4307 \shape default
4308 d
4309 \end_layout
4310
4311 \end_inset
4312
4313  declar
4314 \family roman
4315 ation and
4316 \family default
4317  
4318 \family roman
4319 \emph on
4320 char
4321 \family default
4322 \emph default
4323  
4324 \family roman
4325 must not belong in the
4326 \family default
4327  
4328 \family roman
4329 \emph on
4330 allowed
4331 \family default
4332 \emph default
4333  
4334 \family roman
4335 set of
4336 \family default
4337  
4338 \family roman
4339 \emph on
4340 accent
4341 \emph default
4342 .
4343  When
4344 \family default
4345  
4346 \family roman
4347 \shape up
4348 you enter the
4349 \family default
4350 \shape default
4351  
4352 \family roman
4353 \shape up
4354 \emph on
4355 accent char
4356 \family default
4357 \shape default
4358 \emph default
4359  
4360 \family roman
4361 \shape up
4362 sequence,
4363 \family default
4364 \shape default
4365  
4366 \family roman
4367 \shape up
4368 \emph on
4369 result
4370 \emph default
4371  is produced.
4372  If such a declaration does not exist in
4373 \family default
4374 \shape default
4375  
4376 \shape up
4377 the
4378 \shape default
4379  
4380 \begin_inset Flex CharStyle:Code
4381 status collapsed
4382
4383 \begin_layout Plain Layout
4384
4385 \shape up
4386 .kmap
4387 \end_layout
4388
4389 \end_inset
4390
4391  file and yo
4392 \family roman
4393 u enter
4394 \family default
4395  
4396 \family roman
4397 \emph on
4398 accent char
4399 \emph default
4400 , you get
4401 \family default
4402  
4403 \family roman
4404 \emph on
4405 accent_key char
4406 \emph default
4407  where
4408 \family default
4409  
4410 \family roman
4411 \emph on
4412 accent_key
4413 \emph default
4414  is the first arg
4415 \family default
4416 ument of the 
4417 \begin_inset Flex CharStyle:Code
4418 status collapsed
4419
4420 \begin_layout Plain Layout
4421
4422 \shape up
4423
4424 \backslash
4425 kmod
4426 \end_layout
4427
4428 \end_inset
4429
4430  declaration.
4431  
4432 \end_layout
4433
4434 \begin_layout Standard
4435 The following command produces causes äi to be produced when you enter acute-i
4436  ('i):
4437 \end_layout
4438
4439 \begin_layout LyX-Code
4440
4441 \backslash
4442 kxmod acute i "
4443 \backslash
4444
4445 \backslash
4446 '{
4447 \backslash
4448
4449 \backslash
4450 i}"
4451 \end_layout
4452
4453 \begin_layout Labeling
4454 \labelwidthstring 00.00.0000
4455 \begin_inset Flex CharStyle:Code
4456 status collapsed
4457
4458 \begin_layout Plain Layout
4459 kcomb
4460 \end_layout
4461
4462 \end_inset
4463
4464  Combine two accent characters
4465 \end_layout
4466
4467 \begin_layout LyX-Code
4468
4469 \backslash
4470 kcomb 
4471 \family roman
4472 \emph on
4473 accent1 accent2 allowed
4474 \end_layout
4475
4476 \begin_layout Standard
4477 This one is getting pretty esoteric.
4478  It allows you to combine the effect 
4479 \family roman
4480 of
4481 \family default
4482  
4483 \family roman
4484 \emph on
4485 accent1
4486 \family default
4487 \emph default
4488  
4489 \family roman
4490 and
4491 \family default
4492  
4493 \family roman
4494 \emph on
4495 accent2
4496 \family default
4497 \emph default
4498  
4499 \family roman
4500 (in that order!) on
4501 \family default
4502  
4503 \family roman
4504 \emph on
4505 allowed
4506 \family default
4507 \emph default
4508  
4509 \family roman
4510 chars.
4511  The keystrokes for
4512 \family default
4513  
4514 \family roman
4515 \emph on
4516 accent1
4517 \family default
4518 \emph default
4519  
4520 \family roman
4521 and
4522 \family default
4523  
4524 \family roman
4525 \emph on
4526 accent2
4527 \family default
4528 \emph default
4529  
4530 \family roman
4531 must have be
4532 \family default
4533 en set with a 
4534 \begin_inset Flex CharStyle:Code
4535 status collapsed
4536
4537 \begin_layout Plain Layout
4538
4539 \shape up
4540
4541 \backslash
4542 kmod
4543 \end_layout
4544
4545 \end_inset
4546
4547  command at 
4548 \family roman
4549 a
4550 \family default
4551  
4552 \family roman
4553 \emph on
4554 previous
4555 \family default
4556 \emph default
4557  
4558 \family roman
4559 point in the
4560 \family default
4561  file.
4562  
4563 \end_layout
4564
4565 \begin_layout Standard
4566 Consider this example from the 
4567 \begin_inset Flex CharStyle:Code
4568 status collapsed
4569
4570 \begin_layout Plain Layout
4571
4572 \shape up
4573 greek.kmap
4574 \end_layout
4575
4576 \end_inset
4577
4578  file:
4579 \end_layout
4580
4581 \begin_layout LyX-Code
4582
4583 \backslash
4584 kmod ; acute aeioyvhAEIOYVH 
4585 \end_layout
4586
4587 \begin_layout LyX-Code
4588
4589 \backslash
4590 kmod : umlaut iyIY 
4591 \end_layout
4592
4593 \begin_layout LyX-Code
4594
4595 \backslash
4596 kcomb acute umlaut iyIY
4597 \end_layout
4598
4599 \begin_layout Standard
4600 This allows you to press 
4601 \begin_inset Flex CharStyle:MenuItem
4602 status collapsed
4603
4604 \begin_layout Plain Layout
4605
4606 \shape up
4607 ;:i
4608 \end_layout
4609
4610 \end_inset
4611
4612  and get the effect of 
4613 \begin_inset Flex CharStyle:Code
4614 status collapsed
4615
4616 \begin_layout Plain Layout
4617
4618 \shape up
4619
4620 \backslash
4621 '{
4622 \backslash
4623 "{i}}
4624 \end_layout
4625
4626 \end_inset
4627
4628 .
4629  
4630 \family roman
4631 \shape up
4632 A backspace
4633 \family default
4634 \shape default
4635  in this case cancels the last dead key, so if you press 
4636 \begin_inset Flex CharStyle:MenuItem
4637 status collapsed
4638
4639 \begin_layout Plain Layout
4640
4641 \shape up
4642 ;: Backspace i
4643 \end_layout
4644
4645 \end_inset
4646
4647  you get 
4648 \begin_inset Flex CharStyle:Code
4649 status collapsed
4650
4651 \begin_layout Plain Layout
4652
4653 \shape up
4654
4655 \backslash
4656 '{i}
4657 \end_layout
4658
4659 \end_inset
4660
4661 .
4662 \end_layout
4663
4664 \begin_layout Subsection
4665 The .cdef File
4666 \end_layout
4667
4668 \begin_layout Standard
4669 After the 
4670 \begin_inset Flex CharStyle:Code
4671 status collapsed
4672
4673 \begin_layout Plain Layout
4674
4675 \shape up
4676 .kmap
4677 \end_layout
4678
4679 \end_inset
4680
4681  mapping is performed, a 
4682 \begin_inset Flex CharStyle:Code
4683 status collapsed
4684
4685 \begin_layout Plain Layout
4686
4687 \shape up
4688 .cde
4689 \shape default
4690 f
4691 \end_layout
4692
4693 \end_inset
4694
4695  file maps the strings that the symbols generate to characters in the current
4696  font.
4697  The LyX distribution currently includes at least the 
4698 \begin_inset Flex CharStyle:Code
4699 status collapsed
4700
4701 \begin_layout Plain Layout
4702
4703 \shape up
4704 iso8859-1.cdef
4705 \end_layout
4706
4707 \end_inset
4708
4709  and 
4710 \begin_inset Flex CharStyle:Code
4711 status collapsed
4712
4713 \begin_layout Plain Layout
4714
4715 \shape up
4716 iso8859-2.cdef
4717 \end_layout
4718
4719 \end_inset
4720
4721  files.
4722 \end_layout
4723
4724 \begin_layout Standard
4725 In general the 
4726 \begin_inset Flex CharStyle:Code
4727 status collapsed
4728
4729 \begin_layout Plain Layout
4730
4731 \shape up
4732 .cdef
4733 \end_layout
4734
4735 \end_inset
4736
4737  file is a sequence of declarations of the form
4738 \end_layout
4739
4740 \begin_layout LyX-Code
4741
4742 \family roman
4743 \emph on
4744 char_index_in_set
4745 \family default
4746 \emph default
4747  
4748 \family roman
4749 \emph on
4750  string
4751 \end_layout
4752
4753 \begin_layout Standard
4754 For example, in order to map 
4755 \begin_inset Flex CharStyle:MenuItem
4756 status collapsed
4757
4758 \begin_layout Plain Layout
4759
4760 \shape up
4761
4762 \backslash
4763 '{e}
4764 \end_layout
4765
4766 \end_inset
4767
4768  to the corresponding character in the iso-8859-1 set (233), the following
4769  declaration is used
4770 \end_layout
4771
4772 \begin_layout LyX-Code
4773 233 "
4774 \backslash
4775
4776 \backslash
4777 '{e}"
4778 \end_layout
4779
4780 \begin_layout Standard
4781 with 
4782 \begin_inset Flex CharStyle:Code
4783 status collapsed
4784
4785 \begin_layout Plain Layout
4786
4787 \backslash
4788
4789 \end_layout
4790
4791 \end_inset
4792
4793  and 
4794 \begin_inset Flex CharStyle:Code
4795 status collapsed
4796
4797 \begin_layout Plain Layout
4798 "
4799 \end_layout
4800
4801 \end_inset
4802
4803  being escap
4804 \family roman
4805 ed in
4806 \family default
4807  
4808 \family roman
4809 \emph on
4810 string
4811 \emph default
4812 .
4813  Note that
4814 \family default
4815  the same character can apply to more than one string.
4816  In the 
4817 \begin_inset Flex CharStyle:Code
4818 status collapsed
4819
4820 \begin_layout Plain Layout
4821 i
4822 \shape up
4823 so-8859-7.cdef
4824 \end_layout
4825
4826 \end_inset
4827
4828  file you have
4829 \end_layout
4830
4831 \begin_layout LyX-Code
4832 192 "
4833 \backslash
4834
4835 \backslash
4836 '{
4837 \backslash
4838
4839 \backslash
4840
4841 \backslash
4842 "{i}}"
4843 \begin_inset Newline newline
4844 \end_inset
4845
4846 192 "
4847 \backslash
4848
4849 \backslash
4850
4851 \backslash
4852 "{
4853 \backslash
4854
4855 \backslash
4856 '{i}}"
4857 \end_layout
4858
4859 \begin_layout Standard
4860 If LyX cannot find a mapping for the string produced by the keystroke or
4861  a deadkey sequence, it will check if it looks like an accented char and
4862  try to draw an accent over the character on screen.
4863 \end_layout
4864
4865 \begin_layout Subsection
4866 Dead Keys
4867 \end_layout
4868
4869 \begin_layout Standard
4870 There is a second way to add support for international characters through
4871  so-called dead-keys.
4872  A dead-key works in combination with a letter to produce an accented character.
4873  Here, we'll explain how to create a really simple dead-key to illustrate
4874  how they work.
4875 \end_layout
4876
4877 \begin_layout Standard
4878 Suppose you happen to need the circumflex character, 
4879 \begin_inset Quotes eld
4880 \end_inset
4881
4882  ̂
4883 \begin_inset Quotes erd
4884 \end_inset
4885
4886 .
4887  You could bind the 
4888 \begin_inset Flex CharStyle:MenuItem
4889 status collapsed
4890
4891 \begin_layout Plain Layout
4892 ^
4893 \end_layout
4894
4895 \end_inset
4896
4897 -key [a.k.a.
4898 \begin_inset space ~
4899 \end_inset
4900
4901
4902 \begin_inset Flex CharStyle:MenuItem
4903 status collapsed
4904
4905 \begin_layout Plain Layout
4906 Shift-6
4907 \end_layout
4908
4909 \end_inset
4910
4911 ] to the LyX command 
4912 \begin_inset Flex CharStyle:Code
4913 status collapsed
4914
4915 \begin_layout Plain Layout
4916 accent-circumflex
4917 \end_layout
4918
4919 \end_inset
4920
4921  in your 
4922 \begin_inset Flex CharStyle:Code
4923 status collapsed
4924
4925 \begin_layout Plain Layout
4926 lyxrc
4927 \end_layout
4928
4929 \end_inset
4930
4931  file.
4932  Now, whenever you type the 
4933 \begin_inset Flex CharStyle:MenuItem
4934 status collapsed
4935
4936 \begin_layout Plain Layout
4937 ^
4938 \end_layout
4939
4940 \end_inset
4941
4942 -key followed by a letter, that letter will have a circumflex accent on
4943  it.
4944  For example, the sequence 
4945 \begin_inset Quotes eld
4946 \end_inset
4947
4948
4949 \begin_inset Flex CharStyle:MenuItem
4950 status collapsed
4951
4952 \begin_layout Plain Layout
4953 ^e
4954 \end_layout
4955
4956 \end_inset
4957
4958
4959 \begin_inset Quotes erd
4960 \end_inset
4961
4962  produces the letter: 
4963 \begin_inset Quotes eld
4964 \end_inset
4965
4966 ê
4967 \begin_inset Quotes erd
4968 \end_inset
4969
4970 .
4971  If you tried to type 
4972 \begin_inset Quotes eld
4973 \end_inset
4974
4975
4976 \begin_inset Flex CharStyle:MenuItem
4977 status collapsed
4978
4979 \begin_layout Plain Layout
4980 ^t
4981 \end_layout
4982
4983 \end_inset
4984
4985
4986 \begin_inset Quotes erd
4987 \end_inset
4988
4989 , however, LyX will complain with a beep, since a 
4990 \begin_inset Quotes eld
4991 \end_inset
4992
4993
4994 \begin_inset Flex CharStyle:MenuItem
4995 status collapsed
4996
4997 \begin_layout Plain Layout
4998 t
4999 \end_layout
5000
5001 \end_inset
5002
5003
5004 \begin_inset Quotes erd
5005 \end_inset
5006
5007  never takes a circumflex accent.
5008  Hitting 
5009 \begin_inset Flex CharStyle:MenuItem
5010 status collapsed
5011
5012 \begin_layout Plain Layout
5013 Space
5014 \end_layout
5015
5016 \end_inset
5017
5018  after a dead-key produces the bare-accent.
5019  Please note this last point! If you bind a key to a dead-key, you'll need
5020  to rebind the character on that key to yet another key.
5021  Binding the 
5022 \begin_inset Flex CharStyle:MenuItem
5023 status collapsed
5024
5025 \begin_layout Plain Layout
5026 ,-key
5027 \end_layout
5028
5029 \end_inset
5030
5031  to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5032 \end_layout
5033
5034 \begin_layout Standard
5035 One common way to bind dead-keys is to use 
5036 \begin_inset Flex CharStyle:MenuItem
5037 status collapsed
5038
5039 \begin_layout Plain Layout
5040 Meta-
5041 \end_layout
5042
5043 \end_inset
5044
5045
5046 \begin_inset Flex CharStyle:MenuItem
5047 status collapsed
5048
5049 \begin_layout Plain Layout
5050 Ctrl-
5051 \end_layout
5052
5053 \end_inset
5054
5055 , and 
5056 \begin_inset Flex CharStyle:MenuItem
5057 status collapsed
5058
5059 \begin_layout Plain Layout
5060 Shift-
5061 \end_layout
5062
5063 \end_inset
5064
5065  in combination with an accent, like 
5066 \begin_inset Quotes eld
5067 \end_inset
5068
5069
5070 \begin_inset Flex CharStyle:MenuItem
5071 status collapsed
5072
5073 \begin_layout Plain Layout
5074 ~
5075 \end_layout
5076
5077 \end_inset
5078
5079
5080 \begin_inset Quotes erd
5081 \end_inset
5082
5083  or 
5084 \begin_inset Quotes eld
5085 \end_inset
5086
5087
5088 \begin_inset Flex CharStyle:MenuItem
5089 status collapsed
5090
5091 \begin_layout Plain Layout
5092 ,
5093 \end_layout
5094
5095 \end_inset
5096
5097
5098 \begin_inset Quotes erd
5099 \end_inset
5100
5101  or 
5102 \begin_inset Quotes eld
5103 \end_inset
5104
5105
5106 \begin_inset Flex CharStyle:MenuItem
5107 status collapsed
5108
5109 \begin_layout Plain Layout
5110 ^
5111 \end_layout
5112
5113 \end_inset
5114
5115
5116 \begin_inset Quotes erd
5117 \end_inset
5118
5119 .
5120  Another way involves using 
5121 \begin_inset Flex CharStyle:Code
5122 status collapsed
5123
5124 \begin_layout Plain Layout
5125 xmodmap
5126 \end_layout
5127
5128 \end_inset
5129
5130  and 
5131 \begin_inset Flex CharStyle:Code
5132 status collapsed
5133
5134 \begin_layout Plain Layout
5135 xkeycaps
5136 \end_layout
5137
5138 \end_inset
5139
5140  to set up the special 
5141 \begin_inset Flex CharStyle:Code
5142 status collapsed
5143
5144 \begin_layout Plain Layout
5145 Mode_Switch
5146 \end_layout
5147
5148 \end_inset
5149
5150  key.
5151  The 
5152 \begin_inset Flex CharStyle:Code
5153 status collapsed
5154
5155 \begin_layout Plain Layout
5156 Mode_Switch
5157 \end_layout
5158
5159 \end_inset
5160
5161  acts in some ways just like 
5162 \begin_inset Flex CharStyle:MenuItem
5163 status collapsed
5164
5165 \begin_layout Plain Layout
5166 Shift
5167 \end_layout
5168
5169 \end_inset
5170
5171  and permits you to bind keys to accented characters.
5172  You can also turn keys into dead-keys by binding them to something like
5173  
5174 \begin_inset Flex CharStyle:Code
5175 status collapsed
5176
5177 \begin_layout Plain Layout
5178 usldead_cedilla
5179 \end_layout
5180
5181 \end_inset
5182
5183  and then binding this symbolic key to the corresponding LyX command.
5184 \begin_inset Foot
5185 status collapsed
5186
5187 \begin_layout Plain Layout
5188 Note from 
5189 \noun on
5190 John Weiss
5191 \noun default
5192 : This is exactly what I do in my 
5193 \begin_inset Flex CharStyle:Code
5194 status collapsed
5195
5196 \begin_layout Plain Layout
5197 ~/.lyx/lyxrc
5198 \end_layout
5199
5200 \end_inset
5201
5202  and my 
5203 \begin_inset Flex CharStyle:Code
5204 status collapsed
5205
5206 \begin_layout Plain Layout
5207 ~/.xmodmap
5208 \end_layout
5209
5210 \end_inset
5211
5212  files.
5213  I have my 
5214 \begin_inset Flex CharStyle:MenuItem
5215 status collapsed
5216
5217 \begin_layout Plain Layout
5218 Scroll
5219 \begin_inset space ~
5220 \end_inset
5221
5222 Lock
5223 \end_layout
5224
5225 \end_inset
5226
5227  key set up as 
5228 \begin_inset Flex CharStyle:Code
5229 status collapsed
5230
5231 \begin_layout Plain Layout
5232 Mode_Shift
5233 \end_layout
5234
5235 \end_inset
5236
5237  and a bunch of these 
5238 \begin_inset Quotes eld
5239 \end_inset
5240
5241
5242 \begin_inset Flex CharStyle:Code
5243 status collapsed
5244
5245 \begin_layout Plain Layout
5246 usldead_*
5247 \end_layout
5248
5249 \end_inset
5250
5251
5252 \begin_inset Quotes erd
5253 \end_inset
5254
5255  symbolic keys bound such things as 
5256 \begin_inset Flex CharStyle:MenuItem
5257 status collapsed
5258
5259 \begin_layout Plain Layout
5260 Scroll
5261 \begin_inset space ~
5262 \end_inset
5263
5264 Lock-^
5265 \end_layout
5266
5267 \end_inset
5268
5269  and 
5270 \begin_inset Flex CharStyle:MenuItem
5271 status collapsed
5272
5273 \begin_layout Plain Layout
5274 Scroll
5275 \begin_inset space ~
5276 \end_inset
5277
5278 Lock-~
5279 \end_layout
5280
5281 \end_inset
5282
5283 .
5284  This is how I produce my accented characters.
5285 \end_layout
5286
5287 \end_inset
5288
5289  You can make just about anything into the 
5290 \begin_inset Flex CharStyle:Code
5291 status collapsed
5292
5293 \begin_layout Plain Layout
5294 Mode_Switch
5295 \end_layout
5296
5297 \end_inset
5298
5299  key: One of the 
5300 \begin_inset Flex CharStyle:MenuItem
5301 status collapsed
5302
5303 \begin_layout Plain Layout
5304 Ctrl-
5305 \end_layout
5306
5307 \end_inset
5308
5309  keys, a spare function key, etc.
5310  As for the LyX commands that produce accents, check the entry for 
5311 \begin_inset Flex CharStyle:Code
5312 status collapsed
5313
5314 \begin_layout Plain Layout
5315 accent-acute
5316 \end_layout
5317
5318 \end_inset
5319
5320  in the 
5321 \emph on
5322 Reference Manual
5323 \emph default
5324 .
5325  You'll find the complete list there.
5326 \end_layout
5327
5328 \begin_layout Subsection
5329 Saving your Language Configuration
5330 \end_layout
5331
5332 \begin_layout Standard
5333 You can edit your preferences so that your desired language environment
5334  is automatically configured when LyX starts up, via the 
5335 \begin_inset Flex CharStyle:MenuItem
5336 status collapsed
5337
5338 \begin_layout Plain Layout
5339 Edit\SpecialChar \menuseparator
5340 Preferences
5341 \end_layout
5342
5343 \end_inset
5344
5345  dialog.
5346 \end_layout
5347
5348 \begin_layout Chapter
5349 Installing New Document Classes, Layouts, and Templates 
5350 \begin_inset CommandInset label
5351 LatexCommand label
5352 name "chap:textclass"
5353
5354 \end_inset
5355
5356
5357 \begin_inset OptArg
5358 status collapsed
5359
5360 \begin_layout Plain Layout
5361 Installing New Document Classes
5362 \end_layout
5363
5364 \end_inset
5365
5366
5367 \end_layout
5368
5369 \begin_layout Standard
5370 In this chapter, we describe the procedures for creating and installing
5371  new LyX layout and template files, as well as offer a refresher on correctly
5372  installing new LaTeX document classes.
5373  Some definitions: a document class is a LaTeX file (usually ending in 
5374 \begin_inset Flex CharStyle:Code
5375 status collapsed
5376
5377 \begin_layout Plain Layout
5378 .cls
5379 \end_layout
5380
5381 \end_inset
5382
5383  or 
5384 \begin_inset Flex CharStyle:Code
5385 status collapsed
5386
5387 \begin_layout Plain Layout
5388 .sty
5389 \end_layout
5390
5391 \end_inset
5392
5393 ) that describes the format of a document such as an article, report, journal
5394  preprint, etc, and all the commands needed to realize that format.
5395  A layout file is a LyX file that corresponds to a LaTeX document class
5396  and that tells LyX how to 
5397 \begin_inset Quotes eld
5398 \end_inset
5399
5400 draw
5401 \begin_inset Quotes erd
5402 \end_inset
5403
5404  things on the screen to make the display look something like the final
5405  printed page.
5406  More precisely, a layout file describes a 
5407 \begin_inset Quotes eld
5408 \end_inset
5409
5410 text class
5411 \begin_inset Quotes erd
5412 \end_inset
5413
5414  which is the internal construct LyX uses to render the screen display.
5415  
5416 \begin_inset Quotes eld
5417 \end_inset
5418
5419 Layout
5420 \begin_inset Quotes erd
5421 \end_inset
5422
5423  and 
5424 \begin_inset Quotes eld
5425 \end_inset
5426
5427 text class
5428 \begin_inset Quotes erd
5429 \end_inset
5430
5431  can be used somewhat interchangeably, but it is better to refer to the
5432  file as the layout, and the thing living in LyX's memory as the text class.
5433  A template file is simply a LyX document that contains a set of predefined
5434  entries for a given document class---entries that are generally required
5435  for that class.
5436  Templates are especially useful for things like journal manuscripts that
5437  are to be submitted electronically.
5438 \end_layout
5439
5440 \begin_layout Section
5441 Installing a new LaTeX package
5442 \end_layout
5443
5444 \begin_layout Standard
5445 Some installations may not include a LaTeX package that you would like to
5446  use within LyX.
5447  For example, you might need FoilTeX, a package for preparing slides or
5448  viewgraphs for overhead projectors.
5449  Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5450  a user interface for that.
5451  For example on MiKTeX you start its program 
5452 \begin_inset Quotes eld
5453 \end_inset
5454
5455 Browse Packages
5456 \begin_inset Quotes erd
5457 \end_inset
5458
5459  to get a list of available packages.
5460  To install one, right click on it or use the installing toolbar button.
5461  When the package you want to install is not in the list, but you have it
5462  in form of a 
5463 \begin_inset Flex CharStyle:Code
5464 status collapsed
5465
5466 \begin_layout Plain Layout
5467 .cls
5468 \end_layout
5469
5470 \end_inset
5471
5472  or 
5473 \begin_inset Flex CharStyle:Code
5474 status collapsed
5475
5476 \begin_layout Plain Layout
5477 .sty
5478 \end_layout
5479
5480 \end_inset
5481
5482 -file, then copy these files to a subfolder of your LaTeX distribution,
5483  for example to the folder 
5484 \family sans
5485 ~
5486 \backslash
5487 tex
5488 \backslash
5489 latex
5490 \family default
5491 .
5492  Then update the file name database of your LaTeX-distribution.
5493  For example on MiKTeX this is done by pressing the button 
5494 \family sans
5495 Refresh
5496 \begin_inset space ~
5497 \end_inset
5498
5499 FNDB
5500 \family default
5501  that you find in MiKTeX's 
5502 \begin_inset Quotes eld
5503 \end_inset
5504
5505 Settings
5506 \begin_inset Quotes erd
5507 \end_inset
5508
5509  program.
5510  In both cases you need afterwards to reconfigure LyX using the menu 
5511 \begin_inset Flex CharStyle:MenuItem
5512 status collapsed
5513
5514 \begin_layout Plain Layout
5515 Tools\SpecialChar \menuseparator
5516 Reconfigure
5517 \end_layout
5518
5519 \end_inset
5520
5521  and then to restart LyX.
5522 \end_layout
5523
5524 \begin_layout Standard
5525 If your LaTeX distribution doesn't provide a user interface, then you can
5526  follow these steps by using a UNIX/Linux console.
5527 \end_layout
5528
5529 \begin_layout Enumerate
5530 Get the package from 
5531 \begin_inset CommandInset href
5532 LatexCommand href
5533 name "CTAN"
5534 target "http://www.ctan.org/"
5535
5536 \end_inset
5537
5538  or wherever.
5539 \end_layout
5540
5541 \begin_layout Enumerate
5542 You can install this package in several different places.
5543  If you want it to be available for all users on your system, then you should
5544  install it in your `local' TeX tree; if you want (or need) it to be available
5545  just for you, then you can install it in your own `user' TeX tree.
5546  Where these should be created, if they do not already exist, depends upon
5547  the details of your system.
5548  To find out, look in the file 
5549 \begin_inset Flex CharStyle:Code
5550 status collapsed
5551
5552 \begin_layout Plain Layout
5553 texmf.cnf
5554 \end_layout
5555
5556 \end_inset
5557
5558 .
5559 \begin_inset Foot
5560 status collapsed
5561
5562 \begin_layout Plain Layout
5563 This usually lives in the directory 
5564 \begin_inset Flex CharStyle:Code
5565 status collapsed
5566
5567 \begin_layout Plain Layout
5568 $TEXMF/web2c
5569 \end_layout
5570
5571 \end_inset
5572
5573 , though you can run 
5574 \begin_inset Flex CharStyle:Code
5575 status collapsed
5576
5577 \begin_layout Plain Layout
5578 kpsewhich texmf.cnf
5579 \end_layout
5580
5581 \end_inset
5582
5583  to locate it.
5584 \end_layout
5585
5586 \end_inset
5587
5588  The location of the `local' TeX tree is defined by 
5589 \begin_inset Flex CharStyle:Code
5590 status collapsed
5591
5592 \begin_layout Plain Layout
5593 TEXMFLOCAL
5594 \end_layout
5595
5596 \end_inset
5597
5598 ; this is usually somewhere like 
5599 \begin_inset Flex CharStyle:Code
5600 status collapsed
5601
5602 \begin_layout Plain Layout
5603 /usr/local/share/texmf/
5604 \end_layout
5605
5606 \end_inset
5607
5608 .
5609  The `user' TeX tree is defined by 
5610 \begin_inset Flex CharStyle:Code
5611 status collapsed
5612
5613 \begin_layout Plain Layout
5614 TEXMFHOME
5615 \end_layout
5616
5617 \end_inset
5618
5619  and is commonly at 
5620 \begin_inset Flex CharStyle:Code
5621 status collapsed
5622
5623 \begin_layout Plain Layout
5624 $HOME/texmf/
5625 \end_layout
5626
5627 \end_inset
5628
5629 .
5630  (If these variables are not predefined, you can define them.) You'll probably
5631  need root permissions to create or modify the `local' tree; but your `user'
5632  tree shouldn't have such limitations.
5633 \end_layout
5634
5635 \begin_layout Enumerate
5636 Make sure 
5637 \begin_inset Flex CharStyle:Code
5638 status collapsed
5639
5640 \begin_layout Plain Layout
5641 TEXMF
5642 \end_layout
5643
5644 \end_inset
5645
5646  includes the 
5647 \begin_inset Flex CharStyle:Code
5648 status collapsed
5649
5650 \begin_layout Plain Layout
5651 TEXMFLOCAL
5652 \end_layout
5653
5654 \end_inset
5655
5656  and 
5657 \begin_inset Flex CharStyle:Code
5658 status collapsed
5659
5660 \begin_layout Plain Layout
5661 TEXMFHOME
5662 \end_layout
5663
5664 \end_inset
5665
5666  variables; e.
5667 \begin_inset space \thinspace{}
5668 \end_inset
5669
5670 g.
5671 \begin_inset Newline newline
5672 \end_inset
5673
5674
5675 \begin_inset Flex CharStyle:Code
5676 status collapsed
5677
5678 \begin_layout Plain Layout
5679 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5680 \end_layout
5681
5682 \end_inset
5683
5684
5685 \begin_inset Newline newline
5686 \end_inset
5687
5688 But, again, most of this will 
5689 \begin_inset Quotes eld
5690 \end_inset
5691
5692 just work
5693 \begin_inset Quotes erd
5694 \end_inset
5695
5696 .
5697 \end_layout
5698
5699 \begin_layout Enumerate
5700 Create your local
5701 \begin_inset Foot
5702 status collapsed
5703
5704 \begin_layout Plain Layout
5705 We'll assume henceforth that you're defining `local' TeX tree.
5706  If you're defining a user tree, just adjust as necessary.
5707 \end_layout
5708
5709 \end_inset
5710
5711  TeX tree.
5712  You must follow the directory structure of your existing 
5713 \begin_inset Flex CharStyle:Code
5714 status collapsed
5715
5716 \begin_layout Plain Layout
5717 texmf
5718 \end_layout
5719
5720 \end_inset
5721
5722  directory, which will be found at 
5723 \begin_inset Flex CharStyle:Code
5724 status collapsed
5725
5726 \begin_layout Plain Layout
5727 TEXMFMAIN
5728 \end_layout
5729
5730 \end_inset
5731
5732 .
5733  For example, latex packages should go under 
5734 \begin_inset Flex CharStyle:Code
5735 status collapsed
5736
5737 \begin_layout Plain Layout
5738 $TEXMFLOCAL/tex/latex/
5739 \end_layout
5740
5741 \end_inset
5742
5743 .
5744 \end_layout
5745
5746 \begin_layout Enumerate
5747 Install the package.
5748  For example, you would unpack the FoilTeX tarball and copy it to 
5749 \begin_inset Flex CharStyle:Code
5750 status collapsed
5751
5752 \begin_layout Plain Layout
5753 $TEXMFLOCAL/tex/latex/foiltex
5754 \end_layout
5755
5756 \end_inset
5757
5758 .
5759  The 
5760 \begin_inset Flex CharStyle:Code
5761 status collapsed
5762
5763 \begin_layout Plain Layout
5764 foiltex
5765 \end_layout
5766
5767 \end_inset
5768
5769  directory contains various files.
5770 \end_layout
5771
5772 \begin_layout Enumerate
5773 Run: 
5774 \begin_inset Flex CharStyle:Code
5775 status collapsed
5776
5777 \begin_layout Plain Layout
5778 texhash
5779 \end_layout
5780
5781 \end_inset
5782
5783 .
5784  This should create 
5785 \begin_inset Flex CharStyle:Code
5786 status collapsed
5787
5788 \begin_layout Plain Layout
5789 $TEXMFLOCAL/ls-R
5790 \end_layout
5791
5792 \end_inset
5793
5794  amongst others.
5795 \end_layout
5796
5797 \begin_layout Standard
5798 Your package is now installed and available to LaTeX.
5799  To make it available to LyX, you need to create a Layout file, if one is
5800  not already available.
5801  (See the next section.) Once you have a layout file, you need only reconfigure
5802  (
5803 \begin_inset Flex CharStyle:MenuItem
5804 status collapsed
5805
5806 \begin_layout Plain Layout
5807 Tools\SpecialChar \menuseparator
5808 Reconfigure
5809 \end_layout
5810
5811 \end_inset
5812
5813 ) and then restart LyX.
5814  You should then see your new package---for example 
5815 \begin_inset Flex CharStyle:MenuItem
5816 status collapsed
5817
5818 \begin_layout Plain Layout
5819 slides (FoilTeX)
5820 \end_layout
5821
5822 \end_inset
5823
5824 ---under 
5825 \begin_inset Flex CharStyle:MenuItem
5826 status collapsed
5827
5828 \begin_layout Plain Layout
5829 Document\SpecialChar \menuseparator
5830 Settings
5831 \end_layout
5832
5833 \end_inset
5834
5835  in the 
5836 \begin_inset Flex CharStyle:MenuItem
5837 status collapsed
5838
5839 \begin_layout Plain Layout
5840 Document Class
5841 \end_layout
5842
5843 \end_inset
5844
5845  drop box.
5846  
5847 \end_layout
5848
5849 \begin_layout Section
5850 Layouts
5851 \end_layout
5852
5853 \begin_layout Standard
5854 This section describes how to write and install your own LyX layout files
5855  and walks through the 
5856 \begin_inset Flex CharStyle:Code
5857 status collapsed
5858
5859 \begin_layout Plain Layout
5860 article
5861 \end_layout
5862
5863 \end_inset
5864
5865  text class format as an example.
5866  The 
5867 \begin_inset Flex CharStyle:Code
5868 status collapsed
5869
5870 \begin_layout Plain Layout
5871 .layout
5872 \end_layout
5873
5874 \end_inset
5875
5876  files describe what paragraph and character styles are available for a
5877  given document class and how LyX should display them.
5878  We try to provide a thorough description of the process here; however,
5879  there are so many different types of documents supported by LaTeX classes
5880  that we can't hope to cover every different possibility or problem you
5881  might encounter.
5882  (The LyX users' list is frequented by people with lots of experience with
5883  layout design who are willing to share what they've learned.)
5884 \end_layout
5885
5886 \begin_layout Standard
5887 As you prepare to write a new layout, it is extremely helpful to look at
5888  the example layouts distributed with LyX.
5889  If you use a nice LaTeX document class that might be of interest for others,
5890  too, and have a nice corresponding LyX layout, feel free to contribute
5891  the stuff to us, so we may put it into the distribution.
5892  There is also a 
5893 \begin_inset CommandInset href
5894 LatexCommand href
5895 name "section on the LyX wiki"
5896 target "http://wiki.lyx.org/Layouts/Layouts"
5897
5898 \end_inset
5899
5900  for this kind of material.
5901 \end_layout
5902
5903 \begin_layout Standard
5904 All the tags described in this chapter are case-insensitive; this means
5905  that 
5906 \begin_inset Flex CharStyle:Code
5907 status collapsed
5908
5909 \begin_layout Plain Layout
5910 Style
5911 \end_layout
5912
5913 \end_inset
5914
5915
5916 \begin_inset Flex CharStyle:Code
5917 status collapsed
5918
5919 \begin_layout Plain Layout
5920 style
5921 \end_layout
5922
5923 \end_inset
5924
5925  and 
5926 \begin_inset Flex CharStyle:Code
5927 status collapsed
5928
5929 \begin_layout Plain Layout
5930 StYlE
5931 \end_layout
5932
5933 \end_inset
5934
5935  are really the same command.
5936  The possible values are printed in brackets after the feature's name.
5937  The default value if a feature isn't specified inside a text class-description
5938  is typeset 
5939 \begin_inset Flex CharStyle:Code
5940 status collapsed
5941
5942 \begin_layout Plain Layout
5943
5944 \emph on
5945 emphasized
5946 \end_layout
5947
5948 \end_inset
5949
5950 .
5951  If the argument has a data type like 
5952 \begin_inset Quotes eld
5953 \end_inset
5954
5955 string
5956 \begin_inset Quotes erd
5957 \end_inset
5958
5959  or 
5960 \begin_inset Quotes eld
5961 \end_inset
5962
5963 float
5964 \begin_inset Quotes erd
5965 \end_inset
5966
5967 , the default is shown like this: 
5968 \begin_inset Flex CharStyle:Code
5969 status collapsed
5970
5971 \begin_layout Plain Layout
5972 float=
5973 \emph on
5974 default
5975 \end_layout
5976
5977 \end_inset
5978
5979 .
5980 \end_layout
5981
5982 \begin_layout Subsection
5983 \begin_inset CommandInset label
5984 LatexCommand label
5985 name "sub:Layout-modules"
5986
5987 \end_inset
5988
5989 Layout modules
5990 \end_layout
5991
5992 \begin_layout Standard
5993 Similar to layout files, and new with LyX 1.6, are layout 
5994 \emph on
5995 modules
5996 \emph default
5997 .
5998  Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5999  some modules---such as the endnotes module---provide support for just such
6000  a package.
6001  In a sense, layout modules are similar to included files---files like 
6002 \begin_inset Flex CharStyle:Code
6003 status collapsed
6004
6005 \begin_layout Plain Layout
6006 stdsections.inc
6007 \end_layout
6008
6009 \end_inset
6010
6011 ---in that modules are not specific to a given document layout but may be
6012  used with many different layouts.
6013  The difference is that using a layout module does not require editing the
6014  layout file.
6015  Rather, modules are selected in the 
6016 \begin_inset Flex CharStyle:MenuItem
6017 status collapsed
6018
6019 \begin_layout Plain Layout
6020 Document\SpecialChar \menuseparator
6021 Settings
6022 \end_layout
6023
6024 \end_inset
6025
6026  dialog.
6027 \end_layout
6028
6029 \begin_layout Standard
6030 Building modules is the easiest way to get started with layout editing,
6031  since it can be as simple as adding a single new paragraph or flex inset.
6032  But modules may, in principle, contain anything a layout file can contain.
6033 \end_layout
6034
6035 \begin_layout Standard
6036 A module must begin with a line like the following:
6037 \end_layout
6038
6039 \begin_layout LyX-Code
6040 #
6041 \backslash
6042 DeclareLyXModule[endnotes.sty]{Endnotes} 
6043 \end_layout
6044
6045 \begin_layout Standard
6046 The argument in square brackets is optional: It declares any LaTeX packages
6047  on which the module depends.
6048  The mandatory argument, in curly brackets, is the name of the module, as
6049  it should appear in 
6050 \begin_inset Flex CharStyle:MenuItem
6051 status collapsed
6052
6053 \begin_layout Plain Layout
6054 Document\SpecialChar \menuseparator
6055 Settings
6056 \end_layout
6057
6058 \end_inset
6059
6060 .
6061  
6062 \end_layout
6063
6064 \begin_layout Standard
6065 The module declaration should then be followed by lines like the following:
6066 \end_layout
6067
6068 \begin_layout LyX-Code
6069 #DescriptionBegin 
6070 \end_layout
6071
6072 \begin_layout LyX-Code
6073 #Adds an endnote command, in addition to footnotes.
6074  
6075 \end_layout
6076
6077 \begin_layout LyX-Code
6078 #You will need to add  
6079 \backslash
6080 theendnotes in TeX code where you 
6081 \end_layout
6082
6083 \begin_layout LyX-Code
6084 #want the endnotes to appear.
6085  
6086 \end_layout
6087
6088 \begin_layout LyX-Code
6089 #DescriptionEnd 
6090 \end_layout
6091
6092 \begin_layout LyX-Code
6093 #Requires: somemodule | othermodule
6094 \end_layout
6095
6096 \begin_layout LyX-Code
6097 #Excludes: badmodule
6098 \end_layout
6099
6100 \begin_layout Standard
6101 The description is used in 
6102 \begin_inset Flex CharStyle:MenuItem
6103 status collapsed
6104
6105 \begin_layout Plain Layout
6106 Document\SpecialChar \menuseparator
6107 Settings
6108 \end_layout
6109
6110 \end_inset
6111
6112  to provide the user with information about what the module does.
6113  The 
6114 \begin_inset Flex CharStyle:Code
6115 status collapsed
6116
6117 \begin_layout Plain Layout
6118 Requires
6119 \end_layout
6120
6121 \end_inset
6122
6123  line is used to identify other modules with which this one must be used;
6124  the 
6125 \begin_inset Flex CharStyle:Code
6126 status collapsed
6127
6128 \begin_layout Plain Layout
6129 Excludes
6130 \end_layout
6131
6132 \end_inset
6133
6134  line is used to identify modules with which this one may not be used.
6135  Both are optional, and, as shown, multiple modules should be separated
6136  with the pipe symbol: |.
6137  Note that the required modules are treated disjunctively: 
6138 \emph on
6139 at least one
6140 \emph default
6141  of the required modules must be used.
6142  Similarly, 
6143 \emph on
6144 no
6145 \emph default
6146  excluded module may be used.
6147  Note that modules are identified here by their 
6148 \emph on
6149 filenames
6150 \emph default
6151  without the .module extension.
6152  So 
6153 \begin_inset Flex CharStyle:Code
6154 status collapsed
6155
6156 \begin_layout Plain Layout
6157 somemodule
6158 \end_layout
6159
6160 \end_inset
6161
6162  is really 
6163 \begin_inset Flex CharStyle:Code
6164 status collapsed
6165
6166 \begin_layout Plain Layout
6167 somemodule.module
6168 \end_layout
6169
6170 \end_inset
6171
6172 .
6173 \end_layout
6174
6175 \begin_layout Standard
6176 After creating a new module, you will need to reconfigure and then restart
6177  LyX for the module to appear in the menu.
6178  However, changes you make to the module will be seen immediately, if you
6179  open 
6180 \begin_inset Flex CharStyle:MenuItem
6181 status collapsed
6182
6183 \begin_layout Plain Layout
6184 Document\SpecialChar \menuseparator
6185 Settings
6186 \end_layout
6187
6188 \end_inset
6189
6190 , highlight something, and then hit 
6191 \begin_inset Quotes eld
6192 \end_inset
6193
6194 OK
6195 \begin_inset Quotes erd
6196 \end_inset
6197
6198 .
6199  
6200 \emph on
6201 It is strongly recommended that you save your work before doing so
6202 \emph default
6203 .
6204  In fact, 
6205 \emph on
6206 it is strongly recommended that you not attempt to edit modules while simultaneo
6207 usly working on documents
6208 \emph default
6209 .
6210  Though of course the developers strive to keep LyX stable in such situations,
6211  syntax errors and the like in your module file could cause strange behavior.
6212 \end_layout
6213
6214 \begin_layout Subsection
6215 Supporting new document classes
6216 \end_layout
6217
6218 \begin_layout Standard
6219 There are two situations you are likely to encounter when wanting to support
6220  a new LaTeX document class, involving LaTeX2e class (
6221 \begin_inset Flex CharStyle:Code
6222 status collapsed
6223
6224 \begin_layout Plain Layout
6225 .cls
6226 \end_layout
6227
6228 \end_inset
6229
6230 ) and style (
6231 \begin_inset Flex CharStyle:Code
6232 status collapsed
6233
6234 \begin_layout Plain Layout
6235 .sty
6236 \end_layout
6237
6238 \end_inset
6239
6240 ) files.
6241  Supporting a style file is usually fairly easy.
6242  Supporting a new document class is a bit harder.
6243 \end_layout
6244
6245 \begin_layout Subsection
6246 A layout for a 
6247 \begin_inset Flex CharStyle:MenuItem
6248 status collapsed
6249
6250 \begin_layout Plain Layout
6251 sty
6252 \end_layout
6253
6254 \end_inset
6255
6256  file
6257 \end_layout
6258
6259 \begin_layout Standard
6260 If your new document class is provided as a style file that is used in conjuncti
6261 on with an existing, supported document class---for the sake of the example,
6262  we'll assume that the style file is called 
6263 \begin_inset Flex CharStyle:MenuItem
6264 status collapsed
6265
6266 \begin_layout Plain Layout
6267 myclass.sty
6268 \end_layout
6269
6270 \end_inset
6271
6272  and it is meant to be used with 
6273 \begin_inset Flex CharStyle:MenuItem
6274 status collapsed
6275
6276 \begin_layout Plain Layout
6277 report.cls
6278 \end_layout
6279
6280 \end_inset
6281
6282 , which is a standard class---start by copying the existing class's layout
6283  file into your local directory:
6284 \end_layout
6285
6286 \begin_layout LyX-Code
6287 cp report.layout ~/.lyx/layouts/myclass.layout
6288 \end_layout
6289
6290 \begin_layout Standard
6291 Then edit 
6292 \begin_inset Flex CharStyle:Code
6293 status collapsed
6294
6295 \begin_layout Plain Layout
6296 myclass.layout
6297 \end_layout
6298
6299 \end_inset
6300
6301  and change the line: 
6302 \end_layout
6303
6304 \begin_layout LyX-Code
6305
6306 \backslash
6307 DeclareLaTeXClass{report}
6308 \end_layout
6309
6310 \begin_layout Standard
6311 to read
6312 \end_layout
6313
6314 \begin_layout LyX-Code
6315
6316 \backslash
6317 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6318 \end_layout
6319
6320 \begin_layout Standard
6321 Then add:
6322 \end_layout
6323
6324 \begin_layout LyX-Code
6325 Preamble 
6326 \begin_inset Newline newline
6327 \end_inset
6328
6329     
6330 \backslash
6331 usepackage{myclass}
6332 \begin_inset Newline newline
6333 \end_inset
6334
6335 EndPreamble
6336 \end_layout
6337
6338 \begin_layout Standard
6339 near the top of the file.
6340 \end_layout
6341
6342 \begin_layout Standard
6343 Start LyX and select 
6344 \begin_inset Flex CharStyle:MenuItem
6345 status collapsed
6346
6347 \begin_layout Plain Layout
6348 Tools\SpecialChar \menuseparator
6349 Reconfigure
6350 \end_layout
6351
6352 \end_inset
6353
6354 .
6355  Then restart LyX and try creating a new document.
6356  You should see "
6357 \begin_inset Flex CharStyle:MenuItem
6358 status collapsed
6359
6360 \begin_layout Plain Layout
6361 report (myclass)
6362 \end_layout
6363
6364 \end_inset
6365
6366 " as a document class option in the 
6367 \begin_inset Flex CharStyle:MenuItem
6368 status collapsed
6369
6370 \begin_layout Plain Layout
6371 Document\SpecialChar \menuseparator
6372 Settings
6373 \end_layout
6374
6375 \end_inset
6376
6377  dialog.
6378  It is likely that some of the sectioning commands and such in your new
6379  class will work differently from how they worked in the base class---
6380 \begin_inset Flex CharStyle:Code
6381 status collapsed
6382
6383 \begin_layout Plain Layout
6384 report
6385 \end_layout
6386
6387 \end_inset
6388
6389  in this example---so you can fiddle around with the settings for the different
6390  sections if you wish.
6391 \end_layout
6392
6393 \begin_layout Subsection
6394 Layout for a 
6395 \begin_inset Flex CharStyle:MenuItem
6396 status collapsed
6397
6398 \begin_layout Plain Layout
6399 cls
6400 \end_layout
6401
6402 \end_inset
6403
6404  file
6405 \end_layout
6406
6407 \begin_layout Standard
6408 There are two possibilities here.
6409  One is that the class file is itself based upon an existing document class.
6410  For example, many thesis classes are based upon 
6411 \begin_inset Flex CharStyle:MenuItem
6412 status collapsed
6413
6414 \begin_layout Plain Layout
6415 book.cls
6416 \end_layout
6417
6418 \end_inset
6419
6420 .
6421  To see whether yours is, look for a line like
6422 \end_layout
6423
6424 \begin_layout LyX-Code
6425
6426 \backslash
6427 LoadClass{book}
6428 \end_layout
6429
6430 \begin_layout Standard
6431 in the file.
6432  If so, then you may proceed largely as in the previous section, though
6433  the DeclareLaTeXClass line will be different.
6434  If your new class is thesis, and it is based upon book, then the line should
6435  read:
6436 \begin_inset Foot
6437 status collapsed
6438
6439 \begin_layout Plain Layout
6440 And it will be easiest if you save the file to 
6441 \begin_inset Flex CharStyle:Code
6442 status collapsed
6443
6444 \begin_layout Plain Layout
6445 thesis.layout
6446 \end_layout
6447
6448 \end_inset
6449
6450 : LyX assumes that the document class has the same name as the layout file.
6451  
6452 \end_layout
6453
6454 \end_inset
6455
6456
6457 \end_layout
6458
6459 \begin_layout LyX-Code
6460
6461 \backslash
6462 DeclareLaTeXClass[thesis,book]{thesis}
6463 \end_layout
6464
6465 \begin_layout Standard
6466 If, on the other hand, the new class is not based upon an existing class,
6467  you will probably have to 
6468 \begin_inset Quotes eld
6469 \end_inset
6470
6471 roll your own
6472 \begin_inset Quotes erd
6473 \end_inset
6474
6475  layout.
6476  We strongly suggest copying an existing layout file which uses a similar
6477  LaTeX class and then modifying it, if you can do so.
6478  At least use an existing file as a starting point so you can find out what
6479  items you need to worry about.
6480  Again, the specifics are covered below.
6481 \end_layout
6482
6483 \begin_layout Section
6484 Declaring a new text class
6485 \end_layout
6486
6487 \begin_layout Standard
6488 When it's finally time to get your hands dirty and create or edit your own
6489  layout file, the following sections describe what you're up against.
6490  Our advice is to go slowly, save and test often, listen to soothing music,
6491  and enjoy one or two of your favorite adult beverages; more if you are
6492  getting particularly stuck.
6493  It's really not that hard, except that the multitude of options can become
6494  overwhelming if you try to do to much in one sitting.
6495  Go have another adult beverage, just for good measure.
6496 \end_layout
6497
6498 \begin_layout Standard
6499 Here we go!
6500 \end_layout
6501
6502 \begin_layout Standard
6503 Lines in a layout file which begin with a 
6504 \begin_inset Flex CharStyle:Code
6505 status collapsed
6506
6507 \begin_layout Plain Layout
6508 #
6509 \end_layout
6510
6511 \end_inset
6512
6513  are comments.
6514  There is one exception to this rule: all layouts should begin with lines
6515  like:
6516 \end_layout
6517
6518 \begin_layout LyX-Code
6519
6520 \size small
6521 #% Do not delete the line below; configure depends on this 
6522 \end_layout
6523
6524 \begin_layout LyX-Code
6525
6526 \size small
6527 #  
6528 \backslash
6529 DeclareLaTeXClass{article}
6530 \end_layout
6531
6532 \begin_layout Standard
6533 The second line is used when you configure LyX.
6534  The layout file is read by the LaTeX script 
6535 \begin_inset Flex CharStyle:Code
6536 status collapsed
6537
6538 \begin_layout Plain Layout
6539 chkconfig.ltx
6540 \end_layout
6541
6542 \end_inset
6543
6544 , in a special mode where 
6545 \begin_inset Flex CharStyle:Code
6546 status collapsed
6547
6548 \begin_layout Plain Layout
6549 #
6550 \end_layout
6551
6552 \end_inset
6553
6554  is ignored.
6555  The first line is just a LaTeX comment, and the second one contains the
6556  declaration of the text class.
6557  If these lines appear in a file named 
6558 \begin_inset Flex CharStyle:Code
6559 status collapsed
6560
6561 \begin_layout Plain Layout
6562 article.layout
6563 \end_layout
6564
6565 \end_inset
6566
6567 , then they define a text class of name 
6568 \begin_inset Flex CharStyle:Code
6569 status collapsed
6570
6571 \begin_layout Plain Layout
6572 article
6573 \end_layout
6574
6575 \end_inset
6576
6577  (the name of the layout file) which uses the LaTeX document class 
6578 \begin_inset Flex CharStyle:Code
6579 status collapsed
6580
6581 \begin_layout Plain Layout
6582 article.cls
6583 \end_layout
6584
6585 \end_inset
6586
6587  (the default is to use the same name as the layout).
6588  The string 
6589 \begin_inset Quotes eld
6590 \end_inset
6591
6592 article
6593 \begin_inset Quotes erd
6594 \end_inset
6595
6596  that appears above is used as a description of the text class in the 
6597 \begin_inset Flex CharStyle:MenuItem
6598 status collapsed
6599
6600 \begin_layout Plain Layout
6601 Document\SpecialChar \menuseparator
6602 Settings
6603 \end_layout
6604
6605 \end_inset
6606
6607  dialog.
6608 \end_layout
6609
6610 \begin_layout Standard
6611 Let's assume that you wrote your own text class that uses the 
6612 \begin_inset Flex CharStyle:Code
6613 status collapsed
6614
6615 \begin_layout Plain Layout
6616 article.cls
6617 \end_layout
6618
6619 \end_inset
6620
6621  document class, but where you changed the appearance of the section headings.
6622  If you put it in a file 
6623 \begin_inset Flex CharStyle:Code
6624 status collapsed
6625
6626 \begin_layout Plain Layout
6627 myarticle.layout
6628 \end_layout
6629
6630 \end_inset
6631
6632 , the header of this file should be:
6633 \end_layout
6634
6635 \begin_layout LyX-Code
6636
6637 \size small
6638 #% Do not delete the line below; configure depends on this 
6639 \end_layout
6640
6641 \begin_layout LyX-Code
6642
6643 \size small
6644 #  
6645 \backslash
6646 DeclareLaTeXClass[article]{article (with my own headings)}
6647 \end_layout
6648
6649 \begin_layout Standard
6650 This declares a text class 
6651 \begin_inset Flex CharStyle:Code
6652 status collapsed
6653
6654 \begin_layout Plain Layout
6655 myarticle
6656 \end_layout
6657
6658 \end_inset
6659
6660 , associated with the LaTeX document class 
6661 \begin_inset Flex CharStyle:Code
6662 status collapsed
6663
6664 \begin_layout Plain Layout
6665 article.cls
6666 \end_layout
6667
6668 \end_inset
6669
6670  and described as 
6671 \begin_inset Quotes eld
6672 \end_inset
6673
6674 article (with my own headings)
6675 \begin_inset Quotes erd
6676 \end_inset
6677
6678 .
6679  If your text class depends on several packages, you can declare it as:
6680 \end_layout
6681
6682 \begin_layout LyX-Code
6683
6684 \size small
6685 #% Do not delete the line below; configure depends on this 
6686 \end_layout
6687
6688 \begin_layout LyX-Code
6689
6690 \size small
6691 #  
6692 \backslash
6693 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6694 \end_layout
6695
6696 \begin_layout Standard
6697 This indicates that your text class uses the foo.sty package.
6698  Finally, it is also possible to declare classes for DocBook code.
6699  Typical declarations will look like
6700 \end_layout
6701
6702 \begin_layout LyX-Code
6703
6704 \size small
6705 #% Do not delete the line below; configure depends on this 
6706 \end_layout
6707
6708 \begin_layout LyX-Code
6709
6710 \size small
6711
6712 \backslash
6713 DeclareDocBookClass[article]{SGML (DocBook article)}
6714 \end_layout
6715
6716 \begin_layout Standard
6717 Note that these declarations can also be given an optional parameter declaring
6718  the name of the document class (but not a list).
6719 \end_layout
6720
6721 \begin_layout Standard
6722 So, to be as explicit as possible, the form of the layout declaration is:
6723 \end_layout
6724
6725 \begin_layout LyX-Code
6726
6727 \size small
6728 #  
6729 \backslash
6730 DeclareLaTeXClass[class,package.sty]{layout description}
6731 \end_layout
6732
6733 \begin_layout Standard
6734 The class need only be specified if the name of the LaTeX class file and
6735  the name of the layout file are different; if the name of the class file
6736  is not specified, then LyX will simply assume that it is the same as the
6737  name of the layout file.
6738 \end_layout
6739
6740 \begin_layout Standard
6741 When the text class has been modified to your taste, all you have to do
6742  is to copy it either to 
6743 \begin_inset Flex CharStyle:Code
6744 status collapsed
6745
6746 \begin_layout Plain Layout
6747 LyXDir/layouts/
6748 \end_layout
6749
6750 \end_inset
6751
6752  or to 
6753 \begin_inset Flex CharStyle:Code
6754 status collapsed
6755
6756 \begin_layout Plain Layout
6757 UserDir/layouts
6758 \end_layout
6759
6760 \end_inset
6761
6762 , run 
6763 \begin_inset Flex CharStyle:MenuItem
6764 status collapsed
6765
6766 \begin_layout Plain Layout
6767 Tools\SpecialChar \menuseparator
6768 Reconfigure
6769 \end_layout
6770
6771 \end_inset
6772
6773 , exit LyX and restart it.
6774  Then your new text class should be available along with the others.
6775 \end_layout
6776
6777 \begin_layout Standard
6778 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6779  you made to your layout files.
6780  As a result, editing layout files could be very time consuming.
6781  Beginning with 1.6, however, you can force a reload of the layout currently
6782  in use by using the LyX function 
6783 \begin_inset Flex CharStyle:MenuItem
6784 status collapsed
6785
6786 \begin_layout Plain Layout
6787 layout-reload
6788 \end_layout
6789
6790 \end_inset
6791
6792 .
6793  There is no default binding for this function---though, of course, you
6794  can bind it to a key yourself.
6795  If you want to use this function, then, you should simply enter it in the
6796  mini-buffer.
6797  
6798 \emph on
6799 Warning
6800 \emph default
6801 : This is very much an `advanced feature'.
6802  It is 
6803 \emph on
6804 strongly
6805 \emph default
6806  recommended that you save your work before using this function.
6807  In fact, it is 
6808 \emph on
6809 strongly
6810 \emph default
6811  recommended that you not attempt to edit your layout while simultaneously
6812  working on a document that you care about.
6813  Use a test document.
6814  Syntax errors and the like in your layout file could cause peculiar behavior.
6815  In particular, such errors could cause LyX to regard the current layout
6816  as invalid and to attempt to switch to some other layout.
6817  The LyX team strives to keep LyX stable in such situations, but safe is
6818  better than sorry.
6819 \end_layout
6820
6821 \begin_layout Subsection
6822 File format
6823 \end_layout
6824
6825 \begin_layout Standard
6826 The first non-comment line must contain the file format number:
6827 \end_layout
6828
6829 \begin_layout Description
6830 \begin_inset Flex CharStyle:Code
6831 status collapsed
6832
6833 \begin_layout Plain Layout
6834 Format
6835 \end_layout
6836
6837 \end_inset
6838
6839  [
6840 \begin_inset Flex CharStyle:Code
6841 status collapsed
6842
6843 \begin_layout Plain Layout
6844 int
6845 \end_layout
6846
6847 \end_inset
6848
6849 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6850  don't have an explicit file format).
6851  The file format that is documented here is format 8.
6852 \end_layout
6853
6854 \begin_layout Subsection
6855 General text class parameters
6856 \end_layout
6857
6858 \begin_layout Standard
6859 These are the general parameters which describe the form of the entire document:
6860 \end_layout
6861
6862 \begin_layout Description
6863 \begin_inset Flex CharStyle:Code
6864 status collapsed
6865
6866 \begin_layout Plain Layout
6867 AddToPreamble
6868 \end_layout
6869
6870 \end_inset
6871
6872  Adds information to the document preamble.
6873  Must end with 
6874 \begin_inset Quotes eld
6875 \end_inset
6876
6877
6878 \begin_inset Flex CharStyle:Code
6879 status collapsed
6880
6881 \begin_layout Plain Layout
6882 EndPreamble
6883 \end_layout
6884
6885 \end_inset
6886
6887
6888 \begin_inset Quotes erd
6889 \end_inset
6890
6891 .
6892 \end_layout
6893
6894 \begin_layout Description
6895 \begin_inset Flex CharStyle:Code
6896 status collapsed
6897
6898 \begin_layout Plain Layout
6899 ClassOptions
6900 \end_layout
6901
6902 \end_inset
6903
6904  Describes various global options supported by the document class.
6905  See Section
6906 \begin_inset space ~
6907 \end_inset
6908
6909
6910 \begin_inset CommandInset ref
6911 LatexCommand ref
6912 reference "sec:classoptions"
6913
6914 \end_inset
6915
6916  for a description.
6917  Must end with 
6918 \begin_inset Quotes eld
6919 \end_inset
6920
6921
6922 \begin_inset Flex CharStyle:Code
6923 status collapsed
6924
6925 \begin_layout Plain Layout
6926 End
6927 \end_layout
6928
6929 \end_inset
6930
6931
6932 \begin_inset Quotes erd
6933 \end_inset
6934
6935 .
6936 \end_layout
6937
6938 \begin_layout Description
6939 \begin_inset Flex CharStyle:Code
6940 status collapsed
6941
6942 \begin_layout Plain Layout
6943 Columns
6944 \end_layout
6945
6946 \end_inset
6947
6948  [
6949 \begin_inset Flex CharStyle:Code
6950 status collapsed
6951
6952 \begin_layout Plain Layout
6953
6954 \emph on
6955 1
6956 \end_layout
6957
6958 \end_inset
6959
6960
6961 \begin_inset Flex CharStyle:Code
6962 status collapsed
6963
6964 \begin_layout Plain Layout
6965 2
6966 \end_layout
6967
6968 \end_inset
6969
6970 ] Whether the class should default to having one or two columns.
6971  Can be changed in the 
6972 \begin_inset Flex CharStyle:MenuItem
6973 status collapsed
6974
6975 \begin_layout Plain Layout
6976 Document\SpecialChar \menuseparator
6977 Settings
6978 \end_layout
6979
6980 \end_inset
6981
6982  dialog.
6983 \end_layout
6984
6985 \begin_layout Description
6986 \begin_inset Flex CharStyle:Code
6987 status collapsed
6988
6989 \begin_layout Plain Layout
6990 Counter
6991 \end_layout
6992
6993 \end_inset
6994
6995  This sequence defines a new counter.
6996  See Section
6997 \begin_inset space ~
6998 \end_inset
6999
7000
7001 \begin_inset CommandInset ref
7002 LatexCommand ref
7003 reference "sec:counter"
7004
7005 \end_inset
7006
7007  for details.
7008  Must end with 
7009 \begin_inset Quotes eld
7010 \end_inset
7011
7012
7013 \begin_inset Flex CharStyle:Code
7014 status collapsed
7015
7016 \begin_layout Plain Layout
7017 End
7018 \end_layout
7019
7020 \end_inset
7021
7022
7023 \begin_inset Quotes erd
7024 \end_inset
7025
7026 .
7027 \end_layout
7028
7029 \begin_layout Description
7030 \begin_inset Flex CharStyle:Code
7031 status collapsed
7032
7033 \begin_layout Plain Layout
7034 DefaultFont
7035 \end_layout
7036
7037 \end_inset
7038
7039  Sets the default font used to display the document.
7040  See Section
7041 \begin_inset space ~
7042 \end_inset
7043
7044
7045 \begin_inset CommandInset ref
7046 LatexCommand ref
7047 reference "sec:fonts"
7048
7049 \end_inset
7050
7051  for how to declare fonts.
7052  Must end with 
7053 \begin_inset Quotes eld
7054 \end_inset
7055
7056
7057 \begin_inset Flex CharStyle:Code
7058 status collapsed
7059
7060 \begin_layout Plain Layout
7061 EndFont
7062 \end_layout
7063
7064 \end_inset
7065
7066
7067 \begin_inset Quotes erd
7068 \end_inset
7069
7070 .
7071 \end_layout
7072
7073 \begin_layout Description
7074 \begin_inset Flex CharStyle:Code
7075 status collapsed
7076
7077 \begin_layout Plain Layout
7078 DefaultModule
7079 \end_layout
7080
7081 \end_inset
7082
7083  [
7084 \begin_inset Flex CharStyle:Code
7085 status collapsed
7086
7087 \begin_layout Plain Layout
7088 string]
7089 \end_layout
7090
7091 \end_inset
7092
7093  Specifies a module to be included by default with this document class,
7094  which should be specified by filename without the 
7095 \begin_inset Flex CharStyle:Code
7096 status collapsed
7097
7098 \begin_layout Plain Layout
7099 .module
7100 \end_layout
7101
7102 \end_inset
7103
7104  extension.
7105  The user can still remove the module, but it will be active at the outset.
7106  (This applies only when new files are created, or when this class is chosen
7107  for an existing document.)
7108 \end_layout
7109
7110 \begin_layout Description
7111 \begin_inset Flex CharStyle:Code
7112 status collapsed
7113
7114 \begin_layout Plain Layout
7115 DefaultStyle
7116 \end_layout
7117
7118 \end_inset
7119
7120  [
7121 \begin_inset Flex CharStyle:Code
7122 status collapsed
7123
7124 \begin_layout Plain Layout
7125 string
7126 \end_layout
7127
7128 \end_inset
7129
7130 ] This is the style that will be assigned to new paragraphs, usually 
7131 \begin_inset Flex CharStyle:MenuItem
7132 status collapsed
7133
7134 \begin_layout Plain Layout
7135 Standard
7136 \end_layout
7137
7138 \end_inset
7139
7140 .
7141  This will default to the first defined style if not given, but you are
7142  highly encouraged to use this directive.
7143 \end_layout
7144
7145 \begin_layout Description
7146 \begin_inset Flex CharStyle:Code
7147 status collapsed
7148
7149 \begin_layout Plain Layout
7150 ExcludesModule
7151 \end_layout
7152
7153 \end_inset
7154
7155  [
7156 \begin_inset Flex CharStyle:Code
7157 status collapsed
7158
7159 \begin_layout Plain Layout
7160 string
7161 \end_layout
7162
7163 \end_inset
7164
7165 ] Indicates that the module in question---which should be specified by filename
7166  without the 
7167 \begin_inset Flex CharStyle:Code
7168 status collapsed
7169
7170 \begin_layout Plain Layout
7171 .module
7172 \end_layout
7173
7174 \end_inset
7175
7176  extension---cannot be used with this document class.
7177  This might be used in a journal-specific layout file to prevent, say, the
7178  use of the 
7179 \begin_inset Flex CharStyle:Code
7180 status collapsed
7181
7182 \begin_layout Plain Layout
7183 theorems-sec
7184 \end_layout
7185
7186 \end_inset
7187
7188  module that numbers theorems by section.
7189  This tag may 
7190 \emph on
7191 not
7192 \emph default
7193  be used in a module.
7194  Modules have their own way of excluding other modules (see 
7195 \begin_inset CommandInset ref
7196 LatexCommand ref
7197 reference "sub:Layout-modules"
7198
7199 \end_inset
7200
7201 ).
7202 \end_layout
7203
7204 \begin_layout Description
7205 \begin_inset Flex CharStyle:Code
7206 status collapsed
7207
7208 \begin_layout Plain Layout
7209 Float
7210 \end_layout
7211
7212 \end_inset
7213
7214  Defines a new float.
7215  See Section
7216 \begin_inset space ~
7217 \end_inset
7218
7219
7220 \begin_inset CommandInset ref
7221 LatexCommand ref
7222 reference "sec:floats"
7223
7224 \end_inset
7225
7226  for details.
7227  Must end with 
7228 \begin_inset Quotes eld
7229 \end_inset
7230
7231
7232 \begin_inset Flex CharStyle:Code
7233 status collapsed
7234
7235 \begin_layout Plain Layout
7236 End
7237 \end_layout
7238
7239 \end_inset
7240
7241
7242 \begin_inset Quotes erd
7243 \end_inset
7244
7245 .
7246 \end_layout
7247
7248 \begin_layout Description
7249 \begin_inset Flex CharStyle:Code
7250 status collapsed
7251
7252 \begin_layout Plain Layout
7253 Input
7254 \end_layout
7255
7256 \end_inset
7257
7258  As its name implies, this command allows you to include another layout
7259  definition file within yours to avoid duplicating commands.
7260  Common examples are the standard layout files, for example, 
7261 \begin_inset Flex CharStyle:Code
7262 status collapsed
7263
7264 \begin_layout Plain Layout
7265 stdclass.inc
7266 \end_layout
7267
7268 \end_inset
7269
7270 , which contains most of the basic layouts.
7271 \end_layout
7272
7273 \begin_layout Description
7274 \begin_inset Flex CharStyle:Code
7275 status collapsed
7276
7277 \begin_layout Plain Layout
7278 InsetLayout
7279 \end_layout
7280
7281 \end_inset
7282
7283  This section (re-)defines the layout of an inset.
7284  It can be applied to an existing inset of to a new, user-defined inset,
7285  e.
7286 \begin_inset space \thinspace{}
7287 \end_inset
7288
7289 g.
7290 \begin_inset space \space{}
7291 \end_inset
7292
7293 a new character style.
7294  See Section
7295 \begin_inset space ~
7296 \end_inset
7297
7298
7299 \begin_inset CommandInset ref
7300 LatexCommand ref
7301 reference "sec:charstyle"
7302
7303 \end_inset
7304
7305  for more information.
7306  Must end with 
7307 \begin_inset Quotes eld
7308 \end_inset
7309
7310
7311 \begin_inset Flex CharStyle:Code
7312 status collapsed
7313
7314 \begin_layout Plain Layout
7315 End
7316 \end_layout
7317
7318 \end_inset
7319
7320
7321 \begin_inset Quotes erd
7322 \end_inset
7323
7324 .
7325 \end_layout
7326
7327 \begin_layout Description
7328 \begin_inset Flex CharStyle:Code
7329 status collapsed
7330
7331 \begin_layout Plain Layout
7332 LeftMargin
7333 \end_layout
7334
7335 \end_inset
7336
7337  A string that indicates the width of the left margin on the screen, for
7338  example, 
7339 \begin_inset Quotes eld
7340 \end_inset
7341
7342 MMMMM
7343 \begin_inset Quotes erd
7344 \end_inset
7345
7346 .
7347 \end_layout
7348
7349 \begin_layout Description
7350 \begin_inset Flex CharStyle:Code
7351 status collapsed
7352
7353 \begin_layout Plain Layout
7354 NoFloat
7355 \end_layout
7356
7357 \end_inset
7358
7359  This command deletes an existing float.
7360  This is particularly useful when you want to suppress a float that has
7361  be defined in an input file.
7362 \end_layout
7363
7364 \begin_layout Description
7365 \begin_inset Flex CharStyle:Code
7366 status collapsed
7367
7368 \begin_layout Plain Layout
7369 NoStyle
7370 \end_layout
7371
7372 \end_inset
7373
7374  This command deletes an existing style.
7375  This is particularly useful when you want to suppress a style that has
7376  be defined in an input file.
7377 \end_layout
7378
7379 \begin_layout Description
7380 \begin_inset Flex CharStyle:Code
7381 status collapsed
7382
7383 \begin_layout Plain Layout
7384 OutputType
7385 \end_layout
7386
7387 \end_inset
7388
7389  A string indicating what sort of output documents using this class will
7390  produce.
7391  At present, the options are: `docbook', `latex', and `literate'.
7392 \end_layout
7393
7394 \begin_layout Description
7395 \begin_inset Flex CharStyle:Code
7396 status collapsed
7397
7398 \begin_layout Plain Layout
7399
7400 \series medium
7401 PageStyle
7402 \end_layout
7403
7404 \end_inset
7405
7406  [
7407 \emph on
7408
7409 \begin_inset Flex CharStyle:Code
7410 status collapsed
7411
7412 \begin_layout Plain Layout
7413
7414 \emph on
7415 plain
7416 \end_layout
7417
7418 \end_inset
7419
7420
7421 \emph default
7422
7423 \begin_inset Flex CharStyle:Code
7424 status collapsed
7425
7426 \begin_layout Plain Layout
7427 empty
7428 \end_layout
7429
7430 \end_inset
7431
7432
7433 \begin_inset Flex CharStyle:Code
7434 status collapsed
7435
7436 \begin_layout Plain Layout
7437 headings
7438 \end_layout
7439
7440 \end_inset
7441
7442 ] The class default pagestyle.
7443  Can be changed in the 
7444 \begin_inset Flex CharStyle:MenuItem
7445 status collapsed
7446
7447 \begin_layout Plain Layout
7448 Document\SpecialChar \menuseparator
7449 Settings
7450 \end_layout
7451
7452 \end_inset
7453
7454  dialog.
7455 \end_layout
7456
7457 \begin_layout Description
7458 \begin_inset Flex CharStyle:Code
7459 status collapsed
7460
7461 \begin_layout Plain Layout
7462 Preamble
7463 \end_layout
7464
7465 \end_inset
7466
7467  Sets the preamble for the LaTeX document.
7468  Note that this will completely override any prior 
7469 \begin_inset Flex CharStyle:Code
7470 status collapsed
7471
7472 \begin_layout Plain Layout
7473 Preamble
7474 \end_layout
7475
7476 \end_inset
7477
7478  or 
7479 \begin_inset Flex CharStyle:Code
7480 status collapsed
7481
7482 \begin_layout Plain Layout
7483 AddToPreamble
7484 \end_layout
7485
7486 \end_inset
7487
7488  declarations.
7489  Must end with 
7490 \begin_inset Quotes eld
7491 \end_inset
7492
7493
7494 \begin_inset Flex CharStyle:Code
7495 status collapsed
7496
7497 \begin_layout Plain Layout
7498 EndPreamble
7499 \end_layout
7500
7501 \end_inset
7502
7503
7504 \begin_inset Quotes erd
7505 \end_inset
7506
7507 .
7508 \end_layout
7509
7510 \begin_layout Description
7511 \begin_inset Flex CharStyle:Code
7512 status collapsed
7513
7514 \begin_layout Plain Layout
7515 Provides
7516 \end_layout
7517
7518 \end_inset
7519
7520  
7521 \begin_inset CommandInset label
7522 LatexCommand label
7523 name "des:Provides"
7524
7525 \end_inset
7526
7527 [
7528 \begin_inset Flex CharStyle:Code
7529 status collapsed
7530
7531 \begin_layout Plain Layout
7532 string
7533 \end_layout
7534
7535 \end_inset
7536
7537 ] [
7538 \begin_inset Flex CharStyle:Code
7539 status collapsed
7540
7541 \begin_layout Plain Layout
7542
7543 \emph on
7544 0
7545 \end_layout
7546
7547 \end_inset
7548
7549
7550 \begin_inset Flex CharStyle:Code
7551 status collapsed
7552
7553 \begin_layout Plain Layout
7554 1
7555 \end_layout
7556
7557 \end_inset
7558
7559 ] Whether the class already provides the feature 
7560 \begin_inset Flex CharStyle:Code
7561 status collapsed
7562
7563 \begin_layout Plain Layout
7564 string
7565 \end_layout
7566
7567 \end_inset
7568
7569 .
7570  A feature is in general the name of a package (
7571 \begin_inset Flex CharStyle:Code
7572 status collapsed
7573
7574 \begin_layout Plain Layout
7575 amsmath
7576 \end_layout
7577
7578 \end_inset
7579
7580
7581 \begin_inset Flex CharStyle:Code
7582 status collapsed
7583
7584 \begin_layout Plain Layout
7585 makeidx
7586 \end_layout
7587
7588 \end_inset
7589
7590 , \SpecialChar \ldots{}
7591 ) or a macro (
7592 \begin_inset Flex CharStyle:Code
7593 status collapsed
7594
7595 \begin_layout Plain Layout
7596 url
7597 \end_layout
7598
7599 \end_inset
7600
7601
7602 \begin_inset Flex CharStyle:Code
7603 status collapsed
7604
7605 \begin_layout Plain Layout
7606 boldsymbol
7607 \end_layout
7608
7609 \end_inset
7610
7611 ,\SpecialChar \ldots{}
7612 ); the complete list of supported features is unfortunately not documented
7613  outside the LyX source code---but see 
7614 \begin_inset Flex CharStyle:Code
7615 status collapsed
7616
7617 \begin_layout Plain Layout
7618 LaTeXFeatures.cpp
7619 \end_layout
7620
7621 \end_inset
7622
7623  if you're interested.
7624  
7625 \begin_inset Flex CharStyle:MenuItem
7626 status collapsed
7627
7628 \begin_layout Plain Layout
7629 Help\SpecialChar \menuseparator
7630 LaTeX Configuration
7631 \end_layout
7632
7633 \end_inset
7634
7635  also gives an overview of the supported packages.
7636 \end_layout
7637
7638 \begin_layout Description
7639 \begin_inset Flex CharStyle:Code
7640 status collapsed
7641
7642 \begin_layout Plain Layout
7643 ProvidesModule
7644 \end_layout
7645
7646 \end_inset
7647
7648  [
7649 \begin_inset Flex CharStyle:Code
7650 status collapsed
7651
7652 \begin_layout Plain Layout
7653 string
7654 \end_layout
7655
7656 \end_inset
7657
7658 ] Indicates that this layout provides the functionality of the module mentioned,
7659  which should be specified by the filename without the 
7660 \begin_inset Flex CharStyle:Code
7661 status collapsed
7662
7663 \begin_layout Plain Layout
7664 .module
7665 \end_layout
7666
7667 \end_inset
7668
7669  extension.
7670  This will typically be used if the layout includes the module directly,
7671  rather than using the 
7672 \begin_inset Flex CharStyle:Code
7673 status collapsed
7674
7675 \begin_layout Plain Layout
7676 DefaultModule
7677 \end_layout
7678
7679 \end_inset
7680
7681  tag to indicate that it ought to be used.
7682  It could be used in a module that provided an alternate implementation
7683  of the same functionality.
7684 \end_layout
7685
7686 \begin_layout Description
7687 \begin_inset Flex CharStyle:Code
7688 status collapsed
7689
7690 \begin_layout Plain Layout
7691 Requires
7692 \end_layout
7693
7694 \end_inset
7695
7696  [
7697 \begin_inset Flex CharStyle:Code
7698 status collapsed
7699
7700 \begin_layout Plain Layout
7701 string
7702 \end_layout
7703
7704 \end_inset
7705
7706 ] Whether the class requires the feature 
7707 \begin_inset Flex CharStyle:Code
7708 status collapsed
7709
7710 \begin_layout Plain Layout
7711 string
7712 \end_layout
7713
7714 \end_inset
7715
7716 .
7717  Multiple features must be separated by commas.
7718  Note that you can only request supported features.
7719  (See the description of the 
7720 \begin_inset Flex CharStyle:Code
7721 status collapsed
7722
7723 \begin_layout Plain Layout
7724 Provides
7725 \end_layout
7726
7727 \end_inset
7728
7729  tag 
7730 \begin_inset CommandInset ref
7731 LatexCommand vpageref
7732 reference "des:Provides"
7733
7734 \end_inset
7735
7736  for details.) 
7737 \end_layout
7738
7739 \begin_layout Description
7740 \begin_inset Flex CharStyle:Code
7741 status collapsed
7742
7743 \begin_layout Plain Layout
7744 RightMargin
7745 \end_layout
7746
7747 \end_inset
7748
7749  A string that indicates the width of the right margin on the screen, for
7750  example, 
7751 \begin_inset Quotes eld
7752 \end_inset
7753
7754 MMMMM
7755 \begin_inset Quotes erd
7756 \end_inset
7757
7758 .
7759 \end_layout
7760
7761 \begin_layout Description
7762 \begin_inset Flex CharStyle:Code
7763 status collapsed
7764
7765 \begin_layout Plain Layout
7766 SecNumDepth
7767 \end_layout
7768
7769 \end_inset
7770
7771  Sets which divisions get numbered.
7772  Corresponds to the 
7773 \begin_inset Flex CharStyle:Code
7774 status collapsed
7775
7776 \begin_layout Plain Layout
7777 secnumdepth
7778 \end_layout
7779
7780 \end_inset
7781
7782  counter in LaTeX.
7783 \end_layout
7784
7785 \begin_layout Description
7786 \begin_inset Flex CharStyle:Code
7787 status collapsed
7788
7789 \begin_layout Plain Layout
7790 Sides
7791 \end_layout
7792
7793 \end_inset
7794
7795  [
7796 \emph on
7797
7798 \begin_inset Flex CharStyle:Code
7799 status collapsed
7800
7801 \begin_layout Plain Layout
7802
7803 \emph on
7804 1
7805 \end_layout
7806
7807 \end_inset
7808
7809
7810 \emph default
7811
7812 \begin_inset Flex CharStyle:Code
7813 status collapsed
7814
7815 \begin_layout Plain Layout
7816 2
7817 \end_layout
7818
7819 \end_inset
7820
7821 ] Whether the class-default should be printing on one or both sides of the
7822  paper.
7823  Can be changed in the 
7824 \begin_inset Flex CharStyle:MenuItem
7825 status collapsed
7826
7827 \begin_layout Plain Layout
7828 Document\SpecialChar \menuseparator
7829 Settings
7830 \end_layout
7831
7832 \end_inset
7833
7834  dialog.
7835 \end_layout
7836
7837 \begin_layout Description
7838 \begin_inset Flex CharStyle:Code
7839 status collapsed
7840
7841 \begin_layout Plain Layout
7842 Style
7843 \end_layout
7844
7845 \end_inset
7846
7847  This sequence defines a new paragraph style.
7848  If the style already exists, it will redefine some of its parameters instead.
7849  See Section
7850 \begin_inset space ~
7851 \end_inset
7852
7853
7854 \begin_inset CommandInset ref
7855 LatexCommand ref
7856 reference "sec:style"
7857
7858 \end_inset
7859
7860  for details.
7861  Must end with 
7862 \begin_inset Quotes eld
7863 \end_inset
7864
7865
7866 \begin_inset Flex CharStyle:Code
7867 status collapsed
7868
7869 \begin_layout Plain Layout
7870 End
7871 \end_layout
7872
7873 \end_inset
7874
7875
7876 \begin_inset Quotes erd
7877 \end_inset
7878
7879 .
7880 \end_layout
7881
7882 \begin_layout Description
7883 \begin_inset Flex CharStyle:Code
7884 status collapsed
7885
7886 \begin_layout Plain Layout
7887 TitleLatexName
7888 \end_layout
7889
7890 \end_inset
7891
7892  [
7893 \begin_inset Flex CharStyle:Code
7894 status collapsed
7895
7896 \begin_layout Plain Layout
7897 string="maketitle"
7898 \end_layout
7899
7900 \end_inset
7901
7902 ] The name of the command or environment to be used with 
7903 \begin_inset Flex CharStyle:Code
7904 status collapsed
7905
7906 \begin_layout Plain Layout
7907 TitleLatexType
7908 \end_layout
7909
7910 \end_inset
7911
7912 .
7913 \end_layout
7914
7915 \begin_layout Description
7916 \begin_inset Flex CharStyle:Code
7917 status collapsed
7918
7919 \begin_layout Plain Layout
7920 TitleLatexType
7921 \end_layout
7922
7923 \end_inset
7924
7925  [
7926 \begin_inset Flex CharStyle:Code
7927 status collapsed
7928
7929 \begin_layout Plain Layout
7930
7931 \emph on
7932 CommandAfter
7933 \end_layout
7934
7935 \end_inset
7936
7937
7938 \begin_inset Flex CharStyle:Code
7939 status collapsed
7940
7941 \begin_layout Plain Layout
7942 Environment
7943 \end_layout
7944
7945 \end_inset
7946
7947 ] Indicates what kind of markup is used to define the title of a document.
7948  
7949 \begin_inset Flex CharStyle:Code
7950 status collapsed
7951
7952 \begin_layout Plain Layout
7953 CommandAfter
7954 \end_layout
7955
7956 \end_inset
7957
7958  means that the macro with name 
7959 \begin_inset Flex CharStyle:Code
7960 status collapsed
7961
7962 \begin_layout Plain Layout
7963 TitleLatexName
7964 \end_layout
7965
7966 \end_inset
7967
7968  will be inserted after the last layout which has 
7969 \begin_inset Quotes eld
7970 \end_inset
7971
7972
7973 \begin_inset Flex CharStyle:Code
7974 status collapsed
7975
7976 \begin_layout Plain Layout
7977 InTitle 1
7978 \end_layout
7979
7980 \end_inset
7981
7982
7983 \begin_inset Quotes erd
7984 \end_inset
7985
7986 .
7987  
7988 \begin_inset Flex CharStyle:Code
7989 status collapsed
7990
7991 \begin_layout Plain Layout
7992 Environment
7993 \end_layout
7994
7995 \end_inset
7996
7997  corresponds to the case where the block of paragraphs which have 
7998 \begin_inset Quotes eld
7999 \end_inset
8000
8001
8002 \begin_inset Flex CharStyle:Code
8003 status collapsed
8004
8005 \begin_layout Plain Layout
8006 InTitle 1
8007 \end_layout
8008
8009 \end_inset
8010
8011
8012 \begin_inset Quotes erd
8013 \end_inset
8014
8015  should be enclosed into the 
8016 \begin_inset Flex CharStyle:Code
8017 status collapsed
8018
8019 \begin_layout Plain Layout
8020 TitleLatexName
8021 \end_layout
8022
8023 \end_inset
8024
8025  environment.
8026 \end_layout
8027
8028 \begin_layout Description
8029 \begin_inset Flex CharStyle:Code
8030 status collapsed
8031
8032 \begin_layout Plain Layout
8033 TocDepth
8034 \end_layout
8035
8036 \end_inset
8037
8038  Sets which divisions are included in the table of contents.
8039  Corresponds to the 
8040 \begin_inset Flex CharStyle:Code
8041 status collapsed
8042
8043 \begin_layout Plain Layout
8044 tocdepth
8045 \end_layout
8046
8047 \end_inset
8048
8049  counter in LaTeX.
8050 \end_layout
8051
8052 \begin_layout Subsection
8053 \begin_inset Flex CharStyle:Code
8054 status collapsed
8055
8056 \begin_layout Plain Layout
8057 ClassOptions
8058 \end_layout
8059
8060 \end_inset
8061
8062  section
8063 \end_layout
8064
8065 \begin_layout Standard
8066 \begin_inset CommandInset label
8067 LatexCommand label
8068 name "sec:classoptions"
8069
8070 \end_inset
8071
8072 The 
8073 \begin_inset Flex CharStyle:Code
8074 status collapsed
8075
8076 \begin_layout Plain Layout
8077 ClassOptions
8078 \end_layout
8079
8080 \end_inset
8081
8082  section can contain the following entries:
8083 \end_layout
8084
8085 \begin_layout Description
8086 \begin_inset Flex CharStyle:Code
8087 status collapsed
8088
8089 \begin_layout Plain Layout
8090 FontSize
8091 \end_layout
8092
8093 \end_inset
8094
8095  [
8096 \begin_inset Flex CharStyle:Code
8097 status collapsed
8098
8099 \begin_layout Plain Layout
8100 string="10|11|12"
8101 \end_layout
8102
8103 \end_inset
8104
8105 ] The list of available font sizes for the document's main font, separated
8106  by 
8107 \begin_inset Quotes eld
8108 \end_inset
8109
8110
8111 \begin_inset Flex CharStyle:Code
8112 status collapsed
8113
8114 \begin_layout Plain Layout
8115 |
8116 \end_layout
8117
8118 \end_inset
8119
8120
8121 \begin_inset Quotes erd
8122 \end_inset
8123
8124 .
8125 \end_layout
8126
8127 \begin_layout Description
8128 \begin_inset Flex CharStyle:Code
8129 status collapsed
8130
8131 \begin_layout Plain Layout
8132 Header
8133 \end_layout
8134
8135 \end_inset
8136
8137  Used to set the DTD line with XML-based output classes.
8138  E.
8139 \begin_inset space \thinspace{}
8140 \end_inset
8141
8142 g.: PUBLIC 
8143 \begin_inset Quotes eld
8144 \end_inset
8145
8146 -//OASIS//DTD DocBook V4.2//EN
8147 \begin_inset Quotes erd
8148 \end_inset
8149
8150 .
8151 \end_layout
8152
8153 \begin_layout Description
8154 \begin_inset Flex CharStyle:Code
8155 status collapsed
8156
8157 \begin_layout Plain Layout
8158 PageStyle
8159 \end_layout
8160
8161 \end_inset
8162
8163  [
8164 \begin_inset Flex CharStyle:Code
8165 status collapsed
8166
8167 \begin_layout Plain Layout
8168 string="empty|plain|headings|fancy"
8169 \end_layout
8170
8171 \end_inset
8172
8173 ] The list of available page styles, separated by 
8174 \begin_inset Quotes eld
8175 \end_inset
8176
8177
8178 \begin_inset Flex CharStyle:Code
8179 status collapsed
8180
8181 \begin_layout Plain Layout
8182 |
8183 \end_layout
8184
8185 \end_inset
8186
8187
8188 \begin_inset Quotes erd
8189 \end_inset
8190
8191 .
8192 \end_layout
8193
8194 \begin_layout Description
8195 \begin_inset Flex CharStyle:Code
8196 status collapsed
8197
8198 \begin_layout Plain Layout
8199 Other
8200 \end_layout
8201
8202 \end_inset
8203
8204  [
8205 \begin_inset Flex CharStyle:Code
8206 status collapsed
8207
8208 \begin_layout Plain Layout
8209 string=""
8210 \end_layout
8211
8212 \end_inset
8213
8214 ] Some document class options, separated by a comma, that will be added
8215  to the optional part of the 
8216 \begin_inset Flex CharStyle:Code
8217 status collapsed
8218
8219 \begin_layout Plain Layout
8220
8221 \backslash
8222 documentclass
8223 \end_layout
8224
8225 \end_inset
8226
8227  command.
8228 \end_layout
8229
8230 \begin_layout Standard
8231 The 
8232 \begin_inset Flex CharStyle:Code
8233 status collapsed
8234
8235 \begin_layout Plain Layout
8236 ClassOptions
8237 \end_layout
8238
8239 \end_inset
8240
8241  section must end with 
8242 \begin_inset Quotes eld
8243 \end_inset
8244
8245
8246 \begin_inset Flex CharStyle:Code
8247 status collapsed
8248
8249 \begin_layout Plain Layout
8250 End
8251 \end_layout
8252
8253 \end_inset
8254
8255
8256 \begin_inset Quotes erd
8257 \end_inset
8258
8259 .
8260 \end_layout
8261
8262 \begin_layout Subsection
8263 Paragraph Styles
8264 \end_layout
8265
8266 \begin_layout Standard
8267 \begin_inset CommandInset label
8268 LatexCommand label
8269 name "sec:style"
8270
8271 \end_inset
8272
8273 A paragraph style description looks like this:
8274 \begin_inset Foot
8275 status collapsed
8276
8277 \begin_layout Plain Layout
8278 Note that this will either define a new layout or modify an existing one.
8279 \end_layout
8280
8281 \end_inset
8282
8283
8284 \end_layout
8285
8286 \begin_layout LyX-Code
8287 Style 
8288 \family roman
8289 \emph on
8290 name
8291 \end_layout
8292
8293 \begin_layout LyX-Code
8294  ...
8295 \end_layout
8296
8297 \begin_layout LyX-Code
8298 End
8299 \end_layout
8300
8301 \begin_layout Standard
8302 where the following commands are allowed:
8303 \end_layout
8304
8305 \begin_layout Description
8306 \begin_inset Flex CharStyle:Code
8307 status collapsed
8308
8309 \begin_layout Plain Layout
8310 Align
8311 \end_layout
8312
8313 \end_inset
8314
8315  [
8316 \begin_inset Flex CharStyle:Code
8317 status collapsed
8318
8319 \begin_layout Plain Layout
8320
8321 \emph on
8322 block
8323 \emph default
8324 , left, right, center
8325 \end_layout
8326
8327 \end_inset
8328
8329 ] Paragraph alignment.
8330 \end_layout
8331
8332 \begin_layout Description
8333 \begin_inset Flex CharStyle:Code
8334 status collapsed
8335
8336 \begin_layout Plain Layout
8337 AlignPossible
8338 \end_layout
8339
8340 \end_inset
8341
8342  [
8343 \begin_inset Flex CharStyle:Code
8344 status collapsed
8345
8346 \begin_layout Plain Layout
8347
8348 \emph on
8349 block
8350 \emph default
8351 , left, right, center
8352 \end_layout
8353
8354 \end_inset
8355
8356 ] A comma separated list of permitted alignments.
8357  (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8358  sense.
8359  For example a right-aligned or centered enumeration isn't possible.)
8360 \end_layout
8361
8362 \begin_layout Description
8363 \begin_inset Flex CharStyle:Code
8364 status collapsed
8365
8366 \begin_layout Plain Layout
8367 BottomSep
8368 \end_layout
8369
8370 \end_inset
8371
8372  [
8373 \begin_inset Flex CharStyle:Code
8374 status collapsed
8375
8376 \begin_layout Plain Layout
8377 float=0
8378 \end_layout
8379
8380 \end_inset
8381
8382 ]
8383 \begin_inset Foot
8384 status collapsed
8385
8386 \begin_layout Plain Layout
8387 Note that a `float' here is a real number, such as: 1.5.
8388 \end_layout
8389
8390 \end_inset
8391
8392  The vertical space with which the last of a chain of paragraphs with this
8393  layout is separated from the following paragraph.
8394  If the next paragraph has another layout, the separations are not simply
8395  added, but the maximum is taken.
8396 \end_layout
8397
8398 \begin_layout Description
8399 \begin_inset Flex CharStyle:Code
8400 status collapsed
8401
8402 \begin_layout Plain Layout
8403 Category
8404 \end_layout
8405
8406 \end_inset
8407
8408  
8409 \begin_inset Flex CharStyle:Code
8410 status collapsed
8411
8412 \begin_layout Plain Layout
8413 [string]
8414 \end_layout
8415
8416 \end_inset
8417
8418  The category for this style.
8419  This is used to group related styles in the Layout combobox on the toolbar.
8420  Any string can be used, but you may want to use existing categories with
8421  your own styles.
8422  
8423 \end_layout
8424
8425 \begin_layout Description
8426 \begin_inset Flex CharStyle:Code
8427 status collapsed
8428
8429 \begin_layout Plain Layout
8430 CommandDepth
8431 \end_layout
8432
8433 \end_inset
8434
8435  Depth of XML command.
8436  Used only with XML-type formats.
8437 \end_layout
8438
8439 \begin_layout Description
8440 \begin_inset Flex CharStyle:Code
8441 status collapsed
8442
8443 \begin_layout Plain Layout
8444 CopyStyle
8445 \end_layout
8446
8447 \end_inset
8448
8449  
8450 \begin_inset CommandInset label
8451 LatexCommand label
8452 name "des:CopyStyle"
8453
8454 \end_inset
8455
8456
8457 \begin_inset Flex CharStyle:Code
8458 status collapsed
8459
8460 \begin_layout Plain Layout
8461 [string]
8462 \end_layout
8463
8464 \end_inset
8465
8466  Copies all the features of an existing style into the current one.
8467  
8468 \end_layout
8469
8470 \begin_layout Description
8471 \begin_inset Flex CharStyle:Code
8472 status collapsed
8473
8474 \begin_layout Plain Layout
8475 DependsOn
8476 \end_layout
8477
8478 \end_inset
8479
8480  The name of a style whose preamble should be output 
8481 \emph on
8482 before
8483 \emph default
8484  this one.
8485  This allows to ensure some ordering of the preamble snippets when macros
8486  definitions depend on one another.
8487 \begin_inset Foot
8488 status collapsed
8489
8490 \begin_layout Plain Layout
8491 Note that, besides that functionality, there is no way to ensure any ordering
8492  of preambles.
8493  The ordering that you see in a given version of LyX may change without
8494  warning in later versions.
8495 \end_layout
8496
8497 \end_inset
8498
8499
8500 \end_layout
8501
8502 \begin_layout Description
8503 \begin_inset Flex CharStyle:Code
8504 status collapsed
8505
8506 \begin_layout Plain Layout
8507 EndLabeltype
8508 \end_layout
8509
8510 \end_inset
8511
8512  [
8513 \begin_inset Flex CharStyle:Code
8514 status collapsed
8515
8516 \begin_layout Plain Layout
8517
8518 \emph on
8519 No_Label
8520 \emph default
8521 , Box, Filled_Box, Static
8522 \end_layout
8523
8524 \end_inset
8525
8526 ] The type of label that stands at the end of the paragraph (or sequence
8527  of paragraphs if 
8528 \begin_inset Flex CharStyle:Code
8529 status collapsed
8530
8531 \begin_layout Plain Layout
8532 LatexType
8533 \end_layout
8534
8535 \end_inset
8536
8537  is 
8538 \begin_inset Flex CharStyle:Code
8539 status collapsed
8540
8541 \begin_layout Plain Layout
8542 Environment
8543 \end_layout
8544
8545 \end_inset
8546
8547
8548 \begin_inset Flex CharStyle:Code
8549 status collapsed
8550
8551 \begin_layout Plain Layout
8552 Item_Environment
8553 \end_layout
8554
8555 \end_inset
8556
8557  or 
8558 \begin_inset Flex CharStyle:Code
8559 status collapsed
8560
8561 \begin_layout Plain Layout
8562 List_Environment
8563 \end_layout
8564
8565 \end_inset
8566
8567 ).
8568  
8569 \begin_inset Flex CharStyle:Code
8570 status collapsed
8571
8572 \begin_layout Plain Layout
8573 No_Label
8574 \end_layout
8575
8576 \end_inset
8577
8578  means 
8579 \begin_inset Quotes eld
8580 \end_inset
8581
8582 nothing
8583 \begin_inset Quotes erd
8584 \end_inset
8585
8586
8587 \begin_inset Flex CharStyle:Code
8588 status collapsed
8589
8590 \begin_layout Plain Layout
8591 Box
8592 \end_layout
8593
8594 \end_inset
8595
8596  (resp.
8597 \begin_inset Flex CharStyle:Code
8598 status collapsed
8599
8600 \begin_layout Plain Layout
8601 \begin_inset space ~
8602 \end_inset
8603
8604 Filled_Box
8605 \end_layout
8606
8607 \end_inset
8608
8609 ) is a white (resp.
8610 \begin_inset space ~
8611 \end_inset
8612
8613 black) square suitable for end of proof markers, 
8614 \begin_inset Flex CharStyle:Code
8615 status collapsed
8616
8617 \begin_layout Plain Layout
8618 Static
8619 \end_layout
8620
8621 \end_inset
8622
8623  is an explicit text string.
8624 \end_layout
8625
8626 \begin_layout Description
8627 \begin_inset Flex CharStyle:Code
8628 status collapsed
8629
8630 \begin_layout Plain Layout
8631 EndLabelString
8632 \end_layout
8633
8634 \end_inset
8635
8636  [
8637 \begin_inset Flex CharStyle:Code
8638 status collapsed
8639
8640 \begin_layout Plain Layout
8641 string=""
8642 \end_layout
8643
8644 \end_inset
8645
8646 ] The string used for a label with a 
8647 \begin_inset Flex CharStyle:Code
8648 status collapsed
8649
8650 \begin_layout Plain Layout
8651 Static
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 EndLabelType
8662 \end_layout
8663
8664 \end_inset
8665
8666 .
8667  
8668 \end_layout
8669
8670 \begin_layout Description
8671 \begin_inset Flex CharStyle:Code
8672 status collapsed
8673
8674 \begin_layout Plain Layout
8675 Fill_Bottom
8676 \end_layout
8677
8678 \end_inset
8679
8680  [
8681 \begin_inset Flex CharStyle:Code
8682 status collapsed
8683
8684 \begin_layout Plain Layout
8685
8686 \emph on
8687 0
8688 \emph default
8689 ,1
8690 \end_layout
8691
8692 \end_inset
8693
8694 ] Similar to 
8695 \begin_inset Flex CharStyle:Code
8696 status collapsed
8697
8698 \begin_layout Plain Layout
8699 Fill_Top
8700 \end_layout
8701
8702 \end_inset
8703
8704 .
8705 \end_layout
8706
8707 \begin_layout Description
8708 \begin_inset Flex CharStyle:Code
8709 status collapsed
8710
8711 \begin_layout Plain Layout
8712 Fill_Top
8713 \end_layout
8714
8715 \end_inset
8716
8717  [
8718 \begin_inset Flex CharStyle:Code
8719 status collapsed
8720
8721 \begin_layout Plain Layout
8722
8723 \emph on
8724 0
8725 \emph default
8726 ,1
8727 \end_layout
8728
8729 \end_inset
8730
8731 ] With this parameter the 
8732 \begin_inset Flex CharStyle:MenuItem
8733 status collapsed
8734
8735 \begin_layout Plain Layout
8736 Fill
8737 \end_layout
8738
8739 \end_inset
8740
8741  value of the 
8742 \begin_inset Quotes eld
8743 \end_inset
8744
8745 Vertical space above
8746 \begin_inset Quotes erd
8747 \end_inset
8748
8749  list of the 
8750 \begin_inset Flex CharStyle:MenuItem
8751 status collapsed
8752
8753 \begin_layout Plain Layout
8754 Edit\SpecialChar \menuseparator
8755 Paragraph
8756 \begin_inset space ~
8757 \end_inset
8758
8759 Settings
8760 \end_layout
8761
8762 \end_inset
8763
8764  dialog can be set when initializing a paragraph with this style.
8765 \begin_inset Foot
8766 status collapsed
8767
8768 \begin_layout Plain Layout
8769
8770 \emph on
8771 Note from Jean-Marc:
8772 \emph default
8773  I'm not sure that this setting has much use, and it should probably be
8774  removed in later versions.
8775 \end_layout
8776
8777 \end_inset
8778
8779  
8780 \end_layout
8781
8782 \begin_layout Description
8783 \begin_inset Flex CharStyle:Code
8784 status collapsed
8785
8786 \begin_layout Plain Layout
8787 Font
8788 \end_layout
8789
8790 \end_inset
8791
8792  The font used for both the text body 
8793 \emph on
8794 and
8795 \emph default
8796  the label.
8797  See section
8798 \begin_inset space ~
8799 \end_inset
8800
8801
8802 \begin_inset CommandInset ref
8803 LatexCommand ref
8804 reference "sec:fonts"
8805
8806 \end_inset
8807
8808 .
8809  Note that defining this font automatically defines the 
8810 \begin_inset Flex CharStyle:Code
8811 status collapsed
8812
8813 \begin_layout Plain Layout
8814 LabelFont
8815 \end_layout
8816
8817 \end_inset
8818
8819  to the same value.
8820  So you should define this one first if you also want to define 
8821 \begin_inset Flex CharStyle:Code
8822 status collapsed
8823
8824 \begin_layout Plain Layout
8825 LabelFont
8826 \end_layout
8827
8828 \end_inset
8829
8830 .
8831 \end_layout
8832
8833 \begin_layout Description
8834 \begin_inset Flex CharStyle:Code
8835 status collapsed
8836
8837 \begin_layout Plain Layout
8838 FreeSpacing
8839 \end_layout
8840
8841 \end_inset
8842
8843  
8844 \begin_inset CommandInset label
8845 LatexCommand label
8846 name "des:FreeSpacing"
8847
8848 \end_inset
8849
8850 [
8851 \emph on
8852
8853 \begin_inset Flex CharStyle:Code
8854 status collapsed
8855
8856 \begin_layout Plain Layout
8857
8858 \emph on
8859 0
8860 \end_layout
8861
8862 \end_inset
8863
8864
8865 \emph default
8866
8867 \begin_inset Flex CharStyle:Code
8868 status collapsed
8869
8870 \begin_layout Plain Layout
8871 1
8872 \end_layout
8873
8874 \end_inset
8875
8876 ] Usually LyX doesn't allow you to insert more than one space between words,
8877  since a space is considered as the separation between two words, not a
8878  character or symbol of its own.
8879  This is a very fine thing but sometimes annoying, for example, when typing
8880  program code or plain LaTeX code.
8881  For this reason, 
8882 \begin_inset Flex CharStyle:Code
8883 status collapsed
8884
8885 \begin_layout Plain Layout
8886 FreeSpacing
8887 \end_layout
8888
8889 \end_inset
8890
8891  can be enabled.
8892  Note that LyX will create protected blanks for the additional blanks when
8893  in another mode than LaTeX-mode.
8894 \end_layout
8895
8896 \begin_layout Description
8897 \begin_inset Flex CharStyle:Code
8898 status collapsed
8899
8900 \begin_layout Plain Layout
8901 InnerTag
8902 \end_layout
8903
8904 \end_inset
8905
8906  [[FIXME]] (Used only with XML-type formats.)
8907 \end_layout
8908
8909 \begin_layout Description
8910 \begin_inset Flex CharStyle:Code
8911 status collapsed
8912
8913 \begin_layout Plain Layout
8914 InTitle
8915 \end_layout
8916
8917 \end_inset
8918
8919  
8920 \begin_inset Flex CharStyle:Code
8921 status collapsed
8922
8923 \begin_layout Plain Layout
8924 [1, 0]
8925 \end_layout
8926
8927 \end_inset
8928
8929  If 1, marks the layout as being part of a title block (see also the 
8930 \begin_inset Flex CharStyle:Code
8931 status collapsed
8932
8933 \begin_layout Plain Layout
8934 TitleLatexType
8935 \end_layout
8936
8937 \end_inset
8938
8939  and 
8940 \begin_inset Flex CharStyle:Code
8941 status collapsed
8942
8943 \begin_layout Plain Layout
8944 TitleLatexName
8945 \end_layout
8946
8947 \end_inset
8948
8949  global entries).
8950 \end_layout
8951
8952 \begin_layout Description
8953 \begin_inset Flex CharStyle:Code
8954 status collapsed
8955
8956 \begin_layout Plain Layout
8957 ItemSep
8958 \end_layout
8959
8960 \end_inset
8961
8962  [
8963 \begin_inset Flex CharStyle:Code
8964 status collapsed
8965
8966 \begin_layout Plain Layout
8967 float=0
8968 \end_layout
8969
8970 \end_inset
8971
8972 ] This provides extra space between paragraphs that have the same layout.
8973  If you put other layouts into an environment, each is separated with the
8974  environment's 
8975 \begin_inset Flex CharStyle:Code
8976 status collapsed
8977
8978 \begin_layout Plain Layout
8979 Parsep
8980 \end_layout
8981
8982 \end_inset
8983
8984 .
8985  But the whole items of the environment are additionally separated with
8986  this 
8987 \begin_inset Flex CharStyle:Code
8988 status collapsed
8989
8990 \begin_layout Plain Layout
8991 Itemsep
8992 \end_layout
8993
8994 \end_inset
8995
8996 .
8997  Note that this is a
8998 \emph on
8999  multiplier.
9000 \end_layout
9001
9002 \begin_layout Description
9003 \begin_inset Flex CharStyle:Code
9004 status collapsed
9005
9006 \begin_layout Plain Layout
9007 ItemTag
9008 \end_layout
9009
9010 \end_inset
9011
9012  [[FIXME]] (Used only with XML-type formats.)
9013 \end_layout
9014
9015 \begin_layout Description
9016 \begin_inset Flex CharStyle:Code
9017 status collapsed
9018
9019 \begin_layout Plain Layout
9020 KeepEmpty
9021 \end_layout
9022
9023 \end_inset
9024
9025  
9026 \begin_inset CommandInset label
9027 LatexCommand label
9028 name "des:KeepEmpty"
9029
9030 \end_inset
9031
9032 [
9033 \emph on
9034
9035 \begin_inset Flex CharStyle:Code
9036 status collapsed
9037
9038 \begin_layout Plain Layout
9039
9040 \emph on
9041 0
9042 \end_layout
9043
9044 \end_inset
9045
9046
9047 \emph default
9048
9049 \begin_inset Flex CharStyle:Code
9050 status collapsed
9051
9052 \begin_layout Plain Layout
9053 1
9054 \end_layout
9055
9056 \end_inset
9057
9058 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9059  lead to empty LaTeX output.
9060  There are some cases where this could be desirable however: in a letter
9061  template, the required fields can be provided as empty fields, so that
9062  people do not forget them; in some special classes, a layout can be used
9063  as some kind of break, which does not contain actual text.
9064 \end_layout
9065
9066 \begin_layout Description
9067 \begin_inset Flex CharStyle:Code
9068 status collapsed
9069
9070 \begin_layout Plain Layout
9071 LabelBottomsep
9072 \end_layout
9073
9074 \end_inset
9075
9076  [float=0] The vertical space between the label and the text body.
9077  Only used for labels that are above the text body (
9078 \begin_inset Flex CharStyle:Code
9079 status collapsed
9080
9081 \begin_layout Plain Layout
9082 Top_Environment
9083 \end_layout
9084
9085 \end_inset
9086
9087
9088 \begin_inset Flex CharStyle:Code
9089 status collapsed
9090
9091 \begin_layout Plain Layout
9092 Centered_Top_Environment
9093 \end_layout
9094
9095 \end_inset
9096
9097 ).
9098 \end_layout
9099
9100 \begin_layout Description
9101 \begin_inset Flex CharStyle:Code
9102 status collapsed
9103
9104 \begin_layout Plain Layout
9105 LabelCounter
9106 \end_layout
9107
9108 \end_inset
9109
9110  [
9111 \begin_inset Flex CharStyle:Code
9112 status collapsed
9113
9114 \begin_layout Plain Layout
9115 string=""
9116 \end_layout
9117
9118 \end_inset
9119
9120 ]
9121 \begin_inset Newline newline
9122 \end_inset
9123
9124 The name of the counter for automatic numbering (see Section 
9125 \begin_inset CommandInset ref
9126 LatexCommand ref
9127 reference "sec:counter"
9128
9129 \end_inset
9130
9131  for details).
9132  This must be given if 
9133 \begin_inset Flex CharStyle:Code
9134 status collapsed
9135
9136 \begin_layout Plain Layout
9137 Labeltype
9138 \end_layout
9139
9140 \end_inset
9141
9142  is 
9143 \begin_inset Flex CharStyle:Code
9144 status collapsed
9145
9146 \begin_layout Plain Layout
9147 Counter
9148 \end_layout
9149
9150 \end_inset
9151
9152 .
9153 \end_layout
9154
9155 \begin_layout Description
9156 \begin_inset Flex CharStyle:Code
9157 status collapsed
9158
9159 \begin_layout Plain Layout
9160 LabelFont
9161 \end_layout
9162
9163 \end_inset
9164
9165  The font used for the label.
9166  See section
9167 \begin_inset space ~
9168 \end_inset
9169
9170
9171 \begin_inset CommandInset ref
9172 LatexCommand ref
9173 reference "sec:fonts"
9174
9175 \end_inset
9176
9177 .
9178 \end_layout
9179
9180 \begin_layout Description
9181 \begin_inset Flex CharStyle:Code
9182 status collapsed
9183
9184 \begin_layout Plain Layout
9185 LabelIndent
9186 \end_layout
9187
9188 \end_inset
9189
9190  Text that indicates how far a label should be indented.
9191 \end_layout
9192
9193 \begin_layout Description
9194 \begin_inset Flex CharStyle:Code
9195 status collapsed
9196
9197 \begin_layout Plain Layout
9198 Labelsep
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 horizontal space between the label and the text body.
9214  Only used for labels that are not above the text body.
9215 \end_layout
9216
9217 \begin_layout Description
9218 \begin_inset Flex CharStyle:Code
9219 status collapsed
9220
9221 \begin_layout Plain Layout
9222 LabelString
9223 \end_layout
9224
9225 \end_inset
9226
9227  [
9228 \begin_inset Flex CharStyle:Code
9229 status collapsed
9230
9231 \begin_layout Plain Layout
9232 string=""
9233 \end_layout
9234
9235 \end_inset
9236
9237 ] The string used for a label with a 
9238 \begin_inset Flex CharStyle:Code
9239 status collapsed
9240
9241 \begin_layout Plain Layout
9242 Static
9243 \end_layout
9244
9245 \end_inset
9246
9247  labeltype.
9248  When 
9249 \begin_inset Flex CharStyle:Code
9250 status collapsed
9251
9252 \begin_layout Plain Layout
9253 LabelCounter
9254 \end_layout
9255
9256 \end_inset
9257
9258  is set, this string can be contain the special formatting commands described
9259  in Section 
9260 \begin_inset CommandInset ref
9261 LatexCommand ref
9262 reference "sec:counter"
9263
9264 \end_inset
9265
9266 .
9267 \begin_inset Foot
9268 status collapsed
9269
9270 \begin_layout Plain Layout
9271 For the sake of backwards compatibility, the string 
9272 \begin_inset Flex CharStyle:Code
9273 status collapsed
9274
9275 \begin_layout Plain Layout
9276 @
9277 \emph on
9278 style-name
9279 \emph default
9280 @
9281 \end_layout
9282
9283 \end_inset
9284
9285  will be replaced by the expanded 
9286 \begin_inset Flex CharStyle:Code
9287 status collapsed
9288
9289 \begin_layout Plain Layout
9290 LabelString
9291 \end_layout
9292
9293 \end_inset
9294
9295  of style 
9296 \begin_inset Flex CharStyle:Code
9297 status collapsed
9298
9299 \begin_layout Plain Layout
9300
9301 \emph on
9302 style-name
9303 \end_layout
9304
9305 \end_inset
9306
9307 .
9308  This feature is now obsolete and should be replaced by the mechanisms of
9309  Section 
9310 \begin_inset CommandInset ref
9311 LatexCommand ref
9312 reference "sec:counter"
9313
9314 \end_inset
9315
9316 .
9317 \end_layout
9318
9319 \end_inset
9320
9321
9322 \end_layout
9323
9324 \begin_layout Description
9325 \begin_inset Flex CharStyle:Code
9326 status collapsed
9327
9328 \begin_layout Plain Layout
9329 LabelStringAppendix
9330 \end_layout
9331
9332 \end_inset
9333
9334  [
9335 \begin_inset Flex CharStyle:Code
9336 status collapsed
9337
9338 \begin_layout Plain Layout
9339 string=""
9340 \end_layout
9341
9342 \end_inset
9343
9344 ] This is used inside the appendix instead of 
9345 \begin_inset Flex CharStyle:Code
9346 status collapsed
9347
9348 \begin_layout Plain Layout
9349 LabelString
9350 \end_layout
9351
9352 \end_inset
9353
9354 .
9355  Note that every 
9356 \begin_inset Flex CharStyle:Code
9357 status collapsed
9358
9359 \begin_layout Plain Layout
9360 LabelString
9361 \end_layout
9362
9363 \end_inset
9364
9365  statement resets 
9366 \begin_inset Flex CharStyle:Code
9367 status collapsed
9368
9369 \begin_layout Plain Layout
9370 LabelStringAppendix
9371 \end_layout
9372
9373 \end_inset
9374
9375  too.
9376 \end_layout
9377
9378 \begin_layout Description
9379 \begin_inset Flex CharStyle:Code
9380 status collapsed
9381
9382 \begin_layout Plain Layout
9383 LabelTag
9384 \end_layout
9385
9386 \end_inset
9387
9388  [FIXME] (Used only with XML-type formats.)
9389 \end_layout
9390
9391 \begin_layout Description
9392 \begin_inset Flex CharStyle:Code
9393 status collapsed
9394
9395 \begin_layout Plain Layout
9396 Labeltype
9397 \end_layout
9398
9399 \end_inset
9400
9401  [
9402 \begin_inset Flex CharStyle:Code
9403 status collapsed
9404
9405 \begin_layout Plain Layout
9406
9407 \emph on
9408 No_Label
9409 \emph default
9410 , Manual, Static, Top_Environment, 
9411 \begin_inset Newline newline
9412 \end_inset
9413
9414 Centered_Top_Environment, Sensitive, Counter
9415 \end_layout
9416
9417 \end_inset
9418
9419
9420 \begin_inset Newline newline
9421 \end_inset
9422
9423
9424 \begin_inset Flex CharStyle:Code
9425 status collapsed
9426
9427 \begin_layout Plain Layout
9428 Manual
9429 \end_layout
9430
9431 \end_inset
9432
9433  means the label is the very first word (up to the first real blank).
9434 \begin_inset Foot
9435 status collapsed
9436
9437 \begin_layout Plain Layout
9438 Use protected spaces if you want more than one word as the label.
9439 \end_layout
9440
9441 \end_inset
9442
9443  
9444 \begin_inset Flex CharStyle:Code
9445 status collapsed
9446
9447 \begin_layout Plain Layout
9448 Static
9449 \end_layout
9450
9451 \end_inset
9452
9453  means it is defined in the layout (see 
9454 \begin_inset Flex CharStyle:Code
9455 status collapsed
9456
9457 \begin_layout Plain Layout
9458 LabelString
9459 \end_layout
9460
9461 \end_inset
9462
9463 ).
9464  
9465 \begin_inset Flex CharStyle:Code
9466 status collapsed
9467
9468 \begin_layout Plain Layout
9469 Top_Environment
9470 \end_layout
9471
9472 \end_inset
9473
9474  and 
9475 \begin_inset Flex CharStyle:Code
9476 status collapsed
9477
9478 \begin_layout Plain Layout
9479 Centered_Top_Environment
9480 \end_layout
9481
9482 \end_inset
9483
9484  are special cases of 
9485 \begin_inset Flex CharStyle:Code
9486 status collapsed
9487
9488 \begin_layout Plain Layout
9489 Static
9490 \end_layout
9491
9492 \end_inset
9493
9494 .
9495  The label will be printed above the paragraph, but only at the top of an
9496  environment or the top of a chain of paragraphs with this layout.
9497  Usage is for example the 
9498 \begin_inset Flex CharStyle:MenuItem
9499 status collapsed
9500
9501 \begin_layout Plain Layout
9502 Abstract
9503 \end_layout
9504
9505 \end_inset
9506
9507  layout or the 
9508 \begin_inset Flex CharStyle:MenuItem
9509 status collapsed
9510
9511 \begin_layout Plain Layout
9512 Bibliography
9513 \end_layout
9514
9515 \end_inset
9516
9517  layout.
9518  This is also the case for 
9519 \begin_inset Flex CharStyle:Code
9520 status collapsed
9521
9522 \begin_layout Plain Layout
9523 Manual
9524 \end_layout
9525
9526 \end_inset
9527
9528  labels with latex type 
9529 \begin_inset Flex CharStyle:Code
9530 status collapsed
9531
9532 \begin_layout Plain Layout
9533 Environment
9534 \end_layout
9535
9536 \end_inset
9537
9538 , in order to make layouts for theorems work correctly.
9539  
9540 \begin_inset Flex CharStyle:Code
9541 status collapsed
9542
9543 \begin_layout Plain Layout
9544 Sensitive
9545 \end_layout
9546
9547 \end_inset
9548
9549  is a special case for the caption-labels 
9550 \begin_inset Quotes eld
9551 \end_inset
9552
9553 Figure
9554 \begin_inset Quotes erd
9555 \end_inset
9556
9557  and 
9558 \begin_inset Quotes eld
9559 \end_inset
9560
9561 Table
9562 \begin_inset Quotes erd
9563 \end_inset
9564
9565 .
9566  
9567 \begin_inset Flex CharStyle:Code
9568 status collapsed
9569
9570 \begin_layout Plain Layout
9571 Sensitive
9572 \end_layout
9573
9574 \end_inset
9575
9576  means the (hardcoded) label string depends on the kind of float.
9577  The 
9578 \begin_inset Flex CharStyle:Code
9579 status collapsed
9580
9581 \begin_layout Plain Layout
9582 Counter
9583 \end_layout
9584
9585 \end_inset
9586
9587  label type defines automatically numbered labels.
9588  See Section 
9589 \begin_inset CommandInset ref
9590 LatexCommand ref
9591 reference "sec:counter"
9592
9593 \end_inset
9594
9595 .
9596 \end_layout
9597
9598 \begin_layout Description
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  The name of the corresponding LaTeX stuff.
9609  Either the environment or command name.
9610 \end_layout
9611
9612 \begin_layout Description
9613 \begin_inset Flex CharStyle:Code
9614 status collapsed
9615
9616 \begin_layout Plain Layout
9617 LatexParam
9618 \end_layout
9619
9620 \end_inset
9621
9622  An optional parameter for the corresponding 
9623 \begin_inset Flex CharStyle:Code
9624 status collapsed
9625
9626 \begin_layout Plain Layout
9627 LatexName
9628 \end_layout
9629
9630 \end_inset
9631
9632  stuff.
9633  This parameter cannot be changed from within LyX.
9634 \end_layout
9635
9636 \begin_layout Description
9637 \begin_inset Flex CharStyle:Code
9638 status collapsed
9639
9640 \begin_layout Plain Layout
9641 LatexType
9642 \end_layout
9643
9644 \end_inset
9645
9646  
9647 \begin_inset CommandInset label
9648 LatexCommand label
9649 name "des:LatexType"
9650
9651 \end_inset
9652
9653 [
9654 \begin_inset Flex CharStyle:Code
9655 status collapsed
9656
9657 \begin_layout Plain Layout
9658
9659 \emph on
9660 Paragraph
9661 \emph default
9662 , Command, Environment, Item_Environment,
9663 \end_layout
9664
9665 \end_inset
9666
9667  
9668 \begin_inset Flex CharStyle:Code
9669 status collapsed
9670
9671 \begin_layout Plain Layout
9672 List_Environment
9673 \end_layout
9674
9675 \end_inset
9676
9677 ] How the layout should be translated into LaTeX.
9678  
9679 \begin_inset Flex CharStyle:Code
9680 status collapsed
9681
9682 \begin_layout Plain Layout
9683 Paragraph
9684 \end_layout
9685
9686 \end_inset
9687
9688  means nothing special.
9689  
9690 \begin_inset Flex CharStyle:Code
9691 status collapsed
9692
9693 \begin_layout Plain Layout
9694 Command
9695 \end_layout
9696
9697 \end_inset
9698
9699  means 
9700 \begin_inset Flex CharStyle:Code
9701 status collapsed
9702
9703 \begin_layout Plain Layout
9704
9705 \backslash
9706
9707 \emph on
9708 LatexName
9709 \emph default
9710 {\SpecialChar \ldots{}
9711 }
9712 \end_layout
9713
9714 \end_inset
9715
9716  and 
9717 \begin_inset Flex CharStyle:Code
9718 status collapsed
9719
9720 \begin_layout Plain Layout
9721 Environment
9722 \end_layout
9723
9724 \end_inset
9725
9726  means 
9727 \begin_inset Flex CharStyle:Code
9728 status collapsed
9729
9730 \begin_layout Plain Layout
9731
9732 \backslash
9733 begin{
9734 \emph on
9735 LatexName
9736 \emph default
9737 }\SpecialChar \ldots{}
9738
9739 \backslash
9740 end{
9741 \emph on
9742 LatexName
9743 \emph default
9744 }
9745 \end_layout
9746
9747 \end_inset
9748
9749 .
9750  
9751 \begin_inset Flex CharStyle:Code
9752 status collapsed
9753
9754 \begin_layout Plain Layout
9755 Item_Environment
9756 \end_layout
9757
9758 \end_inset
9759
9760  is the same as 
9761 \begin_inset Flex CharStyle:Code
9762 status collapsed
9763
9764 \begin_layout Plain Layout
9765 Environment
9766 \end_layout
9767
9768 \end_inset
9769
9770 , except that a 
9771 \begin_inset Flex CharStyle:Code
9772 status collapsed
9773
9774 \begin_layout Plain Layout
9775
9776 \backslash
9777 item
9778 \end_layout
9779
9780 \end_inset
9781
9782  is generated for each paragraph of this environment.
9783  
9784 \begin_inset Flex CharStyle:Code
9785 status collapsed
9786
9787 \begin_layout Plain Layout
9788 List_Environment
9789 \end_layout
9790
9791 \end_inset
9792
9793  is the same as 
9794 \begin_inset Flex CharStyle:Code
9795 status collapsed
9796
9797 \begin_layout Plain Layout
9798 Item_Environment
9799 \end_layout
9800
9801 \end_inset
9802
9803 , except that 
9804 \begin_inset Flex CharStyle:Code
9805 status collapsed
9806
9807 \begin_layout Plain Layout
9808 LabelWidthString
9809 \end_layout
9810
9811 \end_inset
9812
9813  is passed as an argument to the environment.
9814  
9815 \begin_inset Flex CharStyle:Code
9816 status collapsed
9817
9818 \begin_layout Plain Layout
9819 LabelWidthString
9820 \end_layout
9821
9822 \end_inset
9823
9824  can be defined in the 
9825 \begin_inset Flex CharStyle:MenuItem
9826 status collapsed
9827
9828 \begin_layout Plain Layout
9829
9830 \bar under
9831 L
9832 \bar default
9833 ayout\SpecialChar \menuseparator
9834
9835 \bar under
9836 P
9837 \bar default
9838 aragraph
9839 \end_layout
9840
9841 \end_inset
9842
9843  dialog.
9844  
9845 \begin_inset Flex CharStyle:Code
9846 status collapsed
9847
9848 \begin_layout Plain Layout
9849
9850 \emph on
9851 LatexType
9852 \end_layout
9853
9854 \end_inset
9855
9856  is perhaps a bit misleading, since these rules apply to SGML classes, too.
9857  Visit the SGML class files for specific examples.
9858 \end_layout
9859
9860 \begin_layout Standard
9861 Putting the last few things together, the LaTeX output will be either: 
9862 \end_layout
9863
9864 \begin_layout LyX-Code
9865
9866 \backslash
9867 latexname[latexparam]{\SpecialChar \ldots{}
9868 }
9869 \end_layout
9870
9871 \begin_layout Standard
9872 or: 
9873 \end_layout
9874
9875 \begin_layout LyX-Code
9876
9877 \backslash
9878 begin{latexname}[latexparam] \SpecialChar \ldots{}
9879  
9880 \backslash
9881 end{latexname}.
9882 \end_layout
9883
9884 \begin_layout Standard
9885 depending upon the LaTeX type.
9886 \end_layout
9887
9888 \begin_layout Description
9889 \begin_inset Flex CharStyle:Code
9890 status collapsed
9891
9892 \begin_layout Plain Layout
9893 LeftMargin
9894 \end_layout
9895
9896 \end_inset
9897
9898  [
9899 \begin_inset Flex CharStyle:Code
9900 status collapsed
9901
9902 \begin_layout Plain Layout
9903 string=""
9904 \end_layout
9905
9906 \end_inset
9907
9908 ] If you put layouts into environments, the leftmargins are not simply added,
9909  but added with a factor 
9910 \begin_inset Formula $\frac{4}{depth+4}$
9911 \end_inset
9912
9913 .
9914  Note that this parameter is also used when the margin is defined as 
9915 \begin_inset Flex CharStyle:Code
9916 status collapsed
9917
9918 \begin_layout Plain Layout
9919 Manual
9920 \end_layout
9921
9922 \end_inset
9923
9924  or 
9925 \begin_inset Flex CharStyle:Code
9926 status collapsed
9927
9928 \begin_layout Plain Layout
9929 Dynamic
9930 \end_layout
9931
9932 \end_inset
9933
9934 .
9935  Then it is added to the manual or dynamic margin.
9936  
9937 \begin_inset Newline newline
9938 \end_inset
9939
9940 The argument is passed as a string.
9941  For example 
9942 \begin_inset Quotes eld
9943 \end_inset
9944
9945
9946 \begin_inset Flex CharStyle:Code
9947 status collapsed
9948
9949 \begin_layout Plain Layout
9950 MM
9951 \end_layout
9952
9953 \end_inset
9954
9955
9956 \begin_inset Quotes erd
9957 \end_inset
9958
9959  means that the paragraph is indented with the width of 
9960 \begin_inset Quotes eld
9961 \end_inset
9962
9963
9964 \begin_inset Flex CharStyle:Code
9965 status collapsed
9966
9967 \begin_layout Plain Layout
9968 MM
9969 \end_layout
9970
9971 \end_inset
9972
9973
9974 \begin_inset Quotes erd
9975 \end_inset
9976
9977  in the normal font.
9978  You can get a negative width by prefixing the string with 
9979 \begin_inset Quotes eld
9980 \end_inset
9981
9982
9983 \begin_inset Flex CharStyle:Code
9984 status collapsed
9985
9986 \begin_layout Plain Layout
9987 -
9988 \end_layout
9989
9990 \end_inset
9991
9992
9993 \begin_inset Quotes erd
9994 \end_inset
9995
9996 .
9997  This way was chosen so that the look is the same with each used screen
9998  font.
9999  
10000 \end_layout
10001
10002 \begin_layout Description
10003 \begin_inset Flex CharStyle:Code
10004 status collapsed
10005
10006 \begin_layout Plain Layout
10007 Margin
10008 \end_layout
10009
10010 \end_inset
10011
10012  [
10013 \begin_inset Flex CharStyle:Code
10014 status collapsed
10015
10016 \begin_layout Plain Layout
10017
10018 \emph on
10019 Static
10020 \emph default
10021 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10022 \end_layout
10023
10024 \end_inset
10025
10026
10027 \begin_inset Newline newline
10028 \end_inset
10029
10030 The kind of margin that the layout has on the left side.
10031  
10032 \begin_inset Flex CharStyle:Code
10033 status collapsed
10034
10035 \begin_layout Plain Layout
10036 Static
10037 \end_layout
10038
10039 \end_inset
10040
10041  just means a fixed margin.
10042  
10043 \begin_inset Flex CharStyle:Code
10044 status collapsed
10045
10046 \begin_layout Plain Layout
10047 Manual
10048 \end_layout
10049
10050 \end_inset
10051
10052  means that the left margin depends on the string entered in the 
10053 \begin_inset Flex CharStyle:MenuItem
10054 status collapsed
10055
10056 \begin_layout Plain Layout
10057 Edit\SpecialChar \menuseparator
10058 Paragraph
10059 \begin_inset space ~
10060 \end_inset
10061
10062 Settings
10063 \end_layout
10064
10065 \end_inset
10066
10067  dialog.
10068  This is used to typeset nice lists without tabulators.
10069  
10070 \begin_inset Flex CharStyle:Code
10071 status collapsed
10072
10073 \begin_layout Plain Layout
10074 Dynamic
10075 \end_layout
10076
10077 \end_inset
10078
10079  means that the margin depends on the size of the label.
10080  This is used for automatic enumerated headlines.
10081  It is obvious that the headline 
10082 \begin_inset Quotes eld
10083 \end_inset
10084
10085 5.4.3.2.1 Very long headline
10086 \begin_inset Quotes erd
10087 \end_inset
10088
10089  must have a wider left margin (as wide as 
10090 \begin_inset Quotes eld
10091 \end_inset
10092
10093 5.4.3.2.1
10094 \begin_inset Quotes erd
10095 \end_inset
10096
10097  plus the space) than 
10098 \begin_inset Quotes eld
10099 \end_inset
10100
10101 3.2 Very long headline
10102 \begin_inset Quotes erd
10103 \end_inset
10104
10105 , even if standard 
10106 \begin_inset Quotes eld
10107 \end_inset
10108
10109 word processors
10110 \begin_inset Quotes erd
10111 \end_inset
10112
10113  are not able to do this.
10114  
10115 \begin_inset Flex CharStyle:Code
10116 status collapsed
10117
10118 \begin_layout Plain Layout
10119 First_Dynamic
10120 \end_layout
10121
10122 \end_inset
10123
10124  is similar, but only the very first row of the paragraph is dynamic, while
10125  the others are static; this is used, for example, for descriptions.
10126  
10127 \begin_inset Flex CharStyle:Code
10128 status collapsed
10129
10130 \begin_layout Plain Layout
10131 Right_Address_Box
10132 \end_layout
10133
10134 \end_inset
10135
10136  means the margin is chosen in a way that the longest row of this paragraph
10137  fits to the right margin.
10138  This is used to typeset an address on the right edge of the page.
10139 \end_layout
10140
10141 \begin_layout Description
10142 \begin_inset Flex CharStyle:Code
10143 status collapsed
10144
10145 \begin_layout Plain Layout
10146 NeedProtect
10147 \end_layout
10148
10149 \end_inset
10150
10151  [
10152 \begin_inset Flex CharStyle:Code
10153 status collapsed
10154
10155 \begin_layout Plain Layout
10156
10157 \emph on
10158 0
10159 \end_layout
10160
10161 \end_inset
10162
10163 ,
10164 \begin_inset Flex CharStyle:Code
10165 status collapsed
10166
10167 \begin_layout Plain Layout
10168 1
10169 \end_layout
10170
10171 \end_inset
10172
10173 ] Whether fragile commands in this layout should be 
10174 \begin_inset Flex CharStyle:Code
10175 status collapsed
10176
10177 \begin_layout Plain Layout
10178
10179 \backslash
10180 protect
10181 \end_layout
10182
10183 \end_inset
10184
10185 'ed.
10186  (Note: This is 
10187 \emph on
10188 not
10189 \emph default
10190  whether this command should itself be protected.)
10191 \end_layout
10192
10193 \begin_layout Description
10194 \begin_inset Flex CharStyle:Code
10195 status collapsed
10196
10197 \begin_layout Plain Layout
10198 Newline
10199 \end_layout
10200
10201 \end_inset
10202
10203  [
10204 \begin_inset Flex CharStyle:Code
10205 status collapsed
10206
10207 \begin_layout Plain Layout
10208 0
10209 \end_layout
10210
10211 \end_inset
10212
10213
10214 \begin_inset Flex CharStyle:Code
10215 status collapsed
10216
10217 \begin_layout Plain Layout
10218
10219 \emph on
10220 1
10221 \end_layout
10222
10223 \end_inset
10224
10225 ] Whether newlines are translated into LaTeX newlines (
10226 \begin_inset Flex CharStyle:Code
10227 status collapsed
10228
10229 \begin_layout Plain Layout
10230
10231 \backslash
10232
10233 \backslash
10234
10235 \end_layout
10236
10237 \end_inset
10238
10239 ) or not.
10240  The translation can be switched off to allow more comfortable LaTeX editing
10241  inside LyX.
10242 \end_layout
10243
10244 \begin_layout Description
10245 \begin_inset Flex CharStyle:Code
10246 status collapsed
10247
10248 \begin_layout Plain Layout
10249 NextNoIndent
10250 \end_layout
10251
10252 \end_inset
10253
10254  [
10255 \begin_inset Flex CharStyle:Code
10256 status collapsed
10257
10258 \begin_layout Plain Layout
10259 1
10260 \end_layout
10261
10262 \end_inset
10263
10264
10265 \begin_inset Flex CharStyle:Code
10266 status collapsed
10267
10268 \begin_layout Plain Layout
10269
10270 \emph on
10271 0
10272 \end_layout
10273
10274 \end_inset
10275
10276 ] Whether the following Paragraph is allowed to indent its very first row.
10277  
10278 \begin_inset Flex CharStyle:Code
10279 status collapsed
10280
10281 \begin_layout Plain Layout
10282 1
10283 \end_layout
10284
10285 \end_inset
10286
10287  means that it is not allowed to do so; 
10288 \begin_inset Flex CharStyle:Code
10289 status collapsed
10290
10291 \begin_layout Plain Layout
10292 0
10293 \end_layout
10294
10295 \end_inset
10296
10297  means it could do so if it wants to.
10298 \end_layout
10299
10300 \begin_layout Description
10301 \begin_inset Flex CharStyle:Code
10302 status collapsed
10303
10304 \begin_layout Plain Layout
10305 ObsoletedBy
10306 \end_layout
10307
10308 \end_inset
10309
10310  Name of a layout that has replaced this layout.
10311  This is used to rename a layout, while keeping backward compatibility.
10312 \end_layout
10313
10314 \begin_layout Description
10315 \begin_inset Flex CharStyle:Code
10316 status collapsed
10317
10318 \begin_layout Plain Layout
10319 OptionalArgs
10320 \end_layout
10321
10322 \end_inset
10323
10324  [
10325 \begin_inset Flex CharStyle:Code
10326 status collapsed
10327
10328 \begin_layout Plain Layout
10329 int=0
10330 \end_layout
10331
10332 \end_inset
10333
10334 ] The number of optional arguments that can be used with this layout.
10335  This is useful for things like section headings, and only makes sense with
10336  LaTeX.
10337 \end_layout
10338
10339 \begin_layout Description
10340 \begin_inset Flex CharStyle:Code
10341 status collapsed
10342
10343 \begin_layout Plain Layout
10344 ParIndent
10345 \end_layout
10346
10347 \end_inset
10348
10349  [
10350 \begin_inset Flex CharStyle:Code
10351 status collapsed
10352
10353 \begin_layout Plain Layout
10354 string=""
10355 \end_layout
10356
10357 \end_inset
10358
10359 ] The indent of the very first line of a paragraph.
10360  The 
10361 \begin_inset Flex CharStyle:Code
10362 status collapsed
10363
10364 \begin_layout Plain Layout
10365 Parindent
10366 \end_layout
10367
10368 \end_inset
10369
10370  will be fixed for a certain layout.
10371  The exception is Standard layout, since the indentation of a Standard layout
10372  paragraph can be prohibited with 
10373 \begin_inset Flex CharStyle:Code
10374 status collapsed
10375
10376 \begin_layout Plain Layout
10377 NextNoIndent
10378 \end_layout
10379
10380 \end_inset
10381
10382 .
10383  Also, Standard layout paragraphs inside environments use the 
10384 \begin_inset Flex CharStyle:Code
10385 status collapsed
10386
10387 \begin_layout Plain Layout
10388 Parindent
10389 \end_layout
10390
10391 \end_inset
10392
10393  of the environment, not their native one.
10394  For example, Standard paragraphs inside an enumeration are not indented.
10395 \end_layout
10396
10397 \begin_layout Description
10398 \begin_inset Flex CharStyle:Code
10399 status collapsed
10400
10401 \begin_layout Plain Layout
10402 Parsep
10403 \end_layout
10404
10405 \end_inset
10406
10407  [
10408 \begin_inset Flex CharStyle:Code
10409 status collapsed
10410
10411 \begin_layout Plain Layout
10412 float=0
10413 \end_layout
10414
10415 \end_inset
10416
10417 ] The vertical space between two paragraphs of this layout.
10418 \end_layout
10419
10420 \begin_layout Description
10421 \begin_inset Flex CharStyle:Code
10422 status collapsed
10423
10424 \begin_layout Plain Layout
10425 Parskip
10426 \end_layout
10427
10428 \end_inset
10429
10430  [
10431 \begin_inset Flex CharStyle:Code
10432 status collapsed
10433
10434 \begin_layout Plain Layout
10435 float=0
10436 \end_layout
10437
10438 \end_inset
10439
10440 ] LyX allows the user to choose either 
10441 \begin_inset Quotes eld
10442 \end_inset
10443
10444 indent
10445 \begin_inset Quotes erd
10446 \end_inset
10447
10448  or 
10449 \begin_inset Quotes eld
10450 \end_inset
10451
10452 skip
10453 \begin_inset Quotes erd
10454 \end_inset
10455
10456  to typeset a document.
10457  When 
10458 \begin_inset Quotes eld
10459 \end_inset
10460
10461 indent
10462 \begin_inset Quotes erd
10463 \end_inset
10464
10465  is chosen, this value is completely ignored.
10466  When 
10467 \begin_inset Quotes eld
10468 \end_inset
10469
10470 skip
10471 \begin_inset Quotes erd
10472 \end_inset
10473
10474  is chosen, the parindent of a LaTeXtype 
10475 \begin_inset Quotes eld
10476 \end_inset
10477
10478 Paragraph
10479 \begin_inset Quotes erd
10480 \end_inset
10481
10482  layout is ignored and all paragraphs are separated by this parskip argument.
10483  The vertical space is calculated with 
10484 \begin_inset Flex CharStyle:Code
10485 status collapsed
10486
10487 \begin_layout Plain Layout
10488 value
10489 \begin_inset space ~
10490 \end_inset
10491
10492 * DefaultHeight
10493 \end_layout
10494
10495 \end_inset
10496
10497  where 
10498 \begin_inset Flex CharStyle:Code
10499 status collapsed
10500
10501 \begin_layout Plain Layout
10502 DefaultHeight
10503 \end_layout
10504
10505 \end_inset
10506
10507  is the height of a row with the normal font.
10508  This way, the look stays the same with different screen fonts.
10509 \end_layout
10510
10511 \begin_layout Description
10512 \begin_inset Flex CharStyle:Code
10513 status collapsed
10514
10515 \begin_layout Plain Layout
10516 PassThru
10517 \end_layout
10518
10519 \end_inset
10520
10521  
10522 \begin_inset CommandInset label
10523 LatexCommand label
10524 name "des:PathThru"
10525
10526 \end_inset
10527
10528 [
10529 \emph on
10530
10531 \begin_inset Flex CharStyle:Code
10532 status collapsed
10533
10534 \begin_layout Plain Layout
10535
10536 \emph on
10537 0
10538 \end_layout
10539
10540 \end_inset
10541
10542
10543 \emph default
10544
10545 \begin_inset Flex CharStyle:Code
10546 status collapsed
10547
10548 \begin_layout Plain Layout
10549 1
10550 \end_layout
10551
10552 \end_inset
10553
10554 ] Whether the contents of this paragraph should be output in raw form, meaning
10555  without special translations that LaTeX would require.
10556 \end_layout
10557
10558 \begin_layout Description
10559 \begin_inset Flex CharStyle:Code
10560 status collapsed
10561
10562 \begin_layout Plain Layout
10563 Preamble
10564 \end_layout
10565
10566 \end_inset
10567
10568  
10569 \begin_inset CommandInset label
10570 LatexCommand label
10571 name "des:Preamble"
10572
10573 \end_inset
10574
10575 Information to be included in the LaTeX preamble when this style is used.
10576  Used to define macros, load packages, etc., required by this particular
10577  style.
10578  Must end with 
10579 \begin_inset Quotes eld
10580 \end_inset
10581
10582
10583 \begin_inset Flex CharStyle:Code
10584 status collapsed
10585
10586 \begin_layout Plain Layout
10587 EndPreamble
10588 \end_layout
10589
10590 \end_inset
10591
10592
10593 \begin_inset Quotes erd
10594 \end_inset
10595
10596 .
10597 \end_layout
10598
10599 \begin_layout Description
10600 \begin_inset Flex CharStyle:Code
10601 status collapsed
10602
10603 \begin_layout Plain Layout
10604 Requires 
10605 \end_layout
10606
10607 \end_inset
10608
10609 [
10610 \begin_inset Flex CharStyle:Code
10611 status collapsed
10612
10613 \begin_layout Plain Layout
10614 string
10615 \end_layout
10616
10617 \end_inset
10618
10619
10620 \begin_inset CommandInset label
10621 LatexCommand label
10622 name "des:Requires"
10623
10624 \end_inset
10625
10626 Whether the layout requires the feature 
10627 \begin_inset Flex CharStyle:Code
10628 status collapsed
10629
10630 \begin_layout Plain Layout
10631 string
10632 \end_layout
10633
10634 \end_inset
10635
10636 .
10637  See the description of 
10638 \begin_inset Flex CharStyle:Code
10639 status collapsed
10640
10641 \begin_layout Plain Layout
10642 Provides
10643 \end_layout
10644
10645 \end_inset
10646
10647  
10648 \begin_inset CommandInset ref
10649 LatexCommand vpageref
10650 reference "des:Provides"
10651
10652 \end_inset
10653
10654  for information on `features'.
10655  
10656 \end_layout
10657
10658 \begin_layout Description
10659 \begin_inset Flex CharStyle:Code
10660 status collapsed
10661
10662 \begin_layout Plain Layout
10663 RightMargin
10664 \end_layout
10665
10666 \end_inset
10667
10668  [
10669 \begin_inset Flex CharStyle:Code
10670 status collapsed
10671
10672 \begin_layout Plain Layout
10673 string=""
10674 \end_layout
10675
10676 \end_inset
10677
10678 ] Similar to 
10679 \begin_inset Flex CharStyle:Code
10680 status collapsed
10681
10682 \begin_layout Plain Layout
10683 LeftMargin
10684 \end_layout
10685
10686 \end_inset
10687
10688 .
10689 \end_layout
10690
10691 \begin_layout Description
10692 \begin_inset Flex CharStyle:Code
10693 status collapsed
10694
10695 \begin_layout Plain Layout
10696 Spacing
10697 \end_layout
10698
10699 \end_inset
10700
10701  [
10702 \begin_inset Flex CharStyle:Code
10703 status collapsed
10704
10705 \begin_layout Plain Layout
10706
10707 \emph on
10708 single
10709 \emph default
10710 , onehalf, double, other
10711 \end_layout
10712
10713 \end_inset
10714
10715  
10716 \emph on
10717 value
10718 \emph default
10719 ] This defines what the default spacing should be in the layout.
10720  The arguments 
10721 \begin_inset Flex CharStyle:Code
10722 status collapsed
10723
10724 \begin_layout Plain Layout
10725 single
10726 \end_layout
10727
10728 \end_inset
10729
10730
10731 \begin_inset Flex CharStyle:Code
10732 status collapsed
10733
10734 \begin_layout Plain Layout
10735 onehalf
10736 \end_layout
10737
10738 \end_inset
10739
10740  and 
10741 \begin_inset Flex CharStyle:Code
10742 status collapsed
10743
10744 \begin_layout Plain Layout
10745 double
10746 \end_layout
10747
10748 \end_inset
10749
10750  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10751  If you specify the argument 
10752 \begin_inset Flex CharStyle:Code
10753 status collapsed
10754
10755 \begin_layout Plain Layout
10756 other
10757 \end_layout
10758
10759 \end_inset
10760
10761 , then you should also provide a numerical argument which will be the actual
10762  multiplier value.
10763  Note that, contrary to other parameters, 
10764 \begin_inset Flex CharStyle:Code
10765 status collapsed
10766
10767 \begin_layout Plain Layout
10768 Spacing
10769 \end_layout
10770
10771 \end_inset
10772
10773  implies the generation of specific LaTeX code, using the package 
10774 \family roman
10775
10776 \begin_inset Flex CharStyle:Code
10777 status collapsed
10778
10779 \begin_layout Plain Layout
10780 setspace.sty
10781 \end_layout
10782
10783 \end_inset
10784
10785 .
10786 \end_layout
10787
10788 \begin_layout Description
10789 \begin_inset Flex CharStyle:Code
10790 status collapsed
10791
10792 \begin_layout Plain Layout
10793 TextFont
10794 \end_layout
10795
10796 \end_inset
10797
10798  The font used for the text body .
10799  See section 
10800 \begin_inset CommandInset ref
10801 LatexCommand ref
10802 reference "sec:fonts"
10803
10804 \end_inset
10805
10806 .
10807 \end_layout
10808
10809 \begin_layout Description
10810 \begin_inset Flex CharStyle:Code
10811 status collapsed
10812
10813 \begin_layout Plain Layout
10814
10815 \series medium
10816 TocLevel [int]
10817 \end_layout
10818
10819 \end_inset
10820
10821  The level of the style in the table of contents.
10822  This is used for automatic numbering of section headings.
10823 \end_layout
10824
10825 \begin_layout Description
10826 \begin_inset Flex CharStyle:Code
10827 status collapsed
10828
10829 \begin_layout Plain Layout
10830 TopSep
10831 \end_layout
10832
10833 \end_inset
10834
10835  [
10836 \begin_inset Flex CharStyle:Code
10837 status collapsed
10838
10839 \begin_layout Plain Layout
10840 float=0
10841 \end_layout
10842
10843 \end_inset
10844
10845 ] The vertical space with which the very first of a chain of paragraphs
10846  with this layout is separated from the previous paragraph.
10847  If the previous paragraph has another layout, the separations are not simply
10848  added, but the maximum is taken.
10849 \end_layout
10850
10851 \begin_layout Subsection
10852 Floats
10853 \end_layout
10854
10855 \begin_layout Standard
10856 \begin_inset CommandInset label
10857 LatexCommand label
10858 name "sec:floats"
10859
10860 \end_inset
10861
10862 Since version 1.3.0 of LyX, it is has been both possible and necessary to
10863  define the floats (
10864 \begin_inset Flex CharStyle:MenuItem
10865 status collapsed
10866
10867 \begin_layout Plain Layout
10868 figure
10869 \end_layout
10870
10871 \end_inset
10872
10873
10874 \begin_inset Flex CharStyle:MenuItem
10875 status collapsed
10876
10877 \begin_layout Plain Layout
10878 table
10879 \end_layout
10880
10881 \end_inset
10882
10883 , \SpecialChar \ldots{}
10884 ) in the text class itself.
10885  Standard floats are included in the file 
10886 \begin_inset Flex CharStyle:Code
10887 status collapsed
10888
10889 \begin_layout Plain Layout
10890 stdfloats.inc
10891 \end_layout
10892
10893 \end_inset
10894
10895 , so you may have to do no more than add
10896 \end_layout
10897
10898 \begin_layout LyX-Code
10899 Input stdfloats.inc
10900 \end_layout
10901
10902 \begin_layout Standard
10903 to your layout file.
10904  If you want to implement a text class that proposes some other float types
10905  (like the AGU class bundled with LyX), the information below will hopefully
10906  help you:
10907 \end_layout
10908
10909 \begin_layout Description
10910 \begin_inset Flex CharStyle:Code
10911 status collapsed
10912
10913 \begin_layout Plain Layout
10914 Extension
10915 \end_layout
10916
10917 \end_inset
10918
10919  [
10920 \begin_inset Flex CharStyle:Code
10921 status collapsed
10922
10923 \begin_layout Plain Layout
10924 string
10925 \end_layout
10926
10927 \end_inset
10928
10929 =
10930 \begin_inset Quotes erd
10931 \end_inset
10932
10933
10934 \begin_inset Quotes erd
10935 \end_inset
10936
10937 ] The file name extension of an auxiliary file for the list of figures (or
10938  whatever).
10939  LaTeX writes the captions to this file.
10940 \end_layout
10941
10942 \begin_layout Description
10943 \begin_inset Flex CharStyle:Code
10944 status collapsed
10945
10946 \begin_layout Plain Layout
10947 GuiName
10948 \end_layout
10949
10950 \end_inset
10951
10952  [
10953 \begin_inset Flex CharStyle:Code
10954 status collapsed
10955
10956 \begin_layout Plain Layout
10957 string
10958 \end_layout
10959
10960 \end_inset
10961
10962 =
10963 \begin_inset Quotes erd
10964 \end_inset
10965
10966
10967 \begin_inset Quotes erd
10968 \end_inset
10969
10970 ] The string that will be used in the menus and also for the caption.
10971 \end_layout
10972
10973 \begin_layout Description
10974 \begin_inset Flex CharStyle:Code
10975 status collapsed
10976
10977 \begin_layout Plain Layout
10978 LaTeXBuiltin
10979 \end_layout
10980
10981 \end_inset
10982
10983  [
10984 \begin_inset Flex CharStyle:Code
10985 status collapsed
10986
10987 \begin_layout Plain Layout
10988
10989 \emph on
10990 0
10991 \end_layout
10992
10993 \end_inset
10994
10995
10996 \begin_inset Flex CharStyle:Code
10997 status collapsed
10998
10999 \begin_layout Plain Layout
11000 1
11001 \end_layout
11002
11003 \end_inset
11004
11005 ] Set to 
11006 \begin_inset Flex CharStyle:Code
11007 status collapsed
11008
11009 \begin_layout Plain Layout
11010 1
11011 \end_layout
11012
11013 \end_inset
11014
11015  if the float is already defined by the LaTeX document class.
11016  If this is set to 
11017 \begin_inset Flex CharStyle:Code
11018 status collapsed
11019
11020 \begin_layout Plain Layout
11021 0
11022 \end_layout
11023
11024 \end_inset
11025
11026 , the float will be defined using the LaTeX package 
11027 \begin_inset Flex CharStyle:Code
11028 status collapsed
11029
11030 \begin_layout Plain Layout
11031 float
11032 \end_layout
11033
11034 \end_inset
11035
11036 .
11037 \end_layout
11038
11039 \begin_layout Description
11040 \begin_inset Flex CharStyle:Code
11041 status collapsed
11042
11043 \begin_layout Plain Layout
11044 ListName
11045 \end_layout
11046
11047 \end_inset
11048
11049  [
11050 \begin_inset Flex CharStyle:Code
11051 status collapsed
11052
11053 \begin_layout Plain Layout
11054 string
11055 \end_layout
11056
11057 \end_inset
11058
11059 =
11060 \begin_inset Quotes erd
11061 \end_inset
11062
11063
11064 \begin_inset Quotes erd
11065 \end_inset
11066
11067 ] The heading used for the list of floats.
11068 \end_layout
11069
11070 \begin_layout Description
11071 \begin_inset Flex CharStyle:Code
11072 status collapsed
11073
11074 \begin_layout Plain Layout
11075 NumberWithin
11076 \end_layout
11077
11078 \end_inset
11079
11080  [
11081 \begin_inset Flex CharStyle:Code
11082 status collapsed
11083
11084 \begin_layout Plain Layout
11085 string
11086 \end_layout
11087
11088 \end_inset
11089
11090 =
11091 \begin_inset Quotes erd
11092 \end_inset
11093
11094
11095 \begin_inset Quotes erd
11096 \end_inset
11097
11098 ] This (optional) argument determines whether floats of this class will
11099  be numbered within some sectional unit of the document.
11100  For example, if within is equal to 
11101 \begin_inset Flex CharStyle:Code
11102 status collapsed
11103
11104 \begin_layout Plain Layout
11105 chapter
11106 \end_layout
11107
11108 \end_inset
11109
11110 , the floats will be numbered within chapters.
11111  
11112 \end_layout
11113
11114 \begin_layout Description
11115 \begin_inset Flex CharStyle:Code
11116 status collapsed
11117
11118 \begin_layout Plain Layout
11119 Placement
11120 \end_layout
11121
11122 \end_inset
11123
11124  [
11125 \begin_inset Flex CharStyle:Code
11126 status collapsed
11127
11128 \begin_layout Plain Layout
11129 string
11130 \end_layout
11131
11132 \end_inset
11133
11134 =
11135 \begin_inset Quotes erd
11136 \end_inset
11137
11138
11139 \begin_inset Quotes erd
11140 \end_inset
11141
11142 ] The default placement for the given class of floats.
11143  The string should be as in standard LaTeX: 
11144 \begin_inset Flex CharStyle:Code
11145 status collapsed
11146
11147 \begin_layout Plain Layout
11148 t
11149 \end_layout
11150
11151 \end_inset
11152
11153
11154 \begin_inset Flex CharStyle:Code
11155 status collapsed
11156
11157 \begin_layout Plain Layout
11158 b
11159 \end_layout
11160
11161 \end_inset
11162
11163
11164 \begin_inset Flex CharStyle:Code
11165 status collapsed
11166
11167 \begin_layout Plain Layout
11168 p
11169 \end_layout
11170
11171 \end_inset
11172
11173  and 
11174 \begin_inset Flex CharStyle:Code
11175 status collapsed
11176
11177 \begin_layout Plain Layout
11178 h
11179 \end_layout
11180
11181 \end_inset
11182
11183  for top, bottom, page, and here, respectively.
11184 \begin_inset Foot
11185 status collapsed
11186
11187 \begin_layout Plain Layout
11188 Note that the order of these letters in the string is irrelevant, like in
11189  LaTeX.
11190 \end_layout
11191
11192 \end_inset
11193
11194  On top of that there is a new type, 
11195 \begin_inset Flex CharStyle:Code
11196 status collapsed
11197
11198 \begin_layout Plain Layout
11199 H
11200 \end_layout
11201
11202 \end_inset
11203
11204 , which does not really correspond to a float, since it means: put it 
11205 \begin_inset Quotes eld
11206 \end_inset
11207
11208 here
11209 \begin_inset Quotes erd
11210 \end_inset
11211
11212  and nowhere else.
11213  Note however that the 
11214 \begin_inset Flex CharStyle:Code
11215 status collapsed
11216
11217 \begin_layout Plain Layout
11218 H
11219 \end_layout
11220
11221 \end_inset
11222
11223  specifier is special and, because of implementation details, cannot be
11224  used in non-built in float types.
11225  If you do not understand what this means, just use 
11226 \begin_inset Quotes eld
11227 \end_inset
11228
11229
11230 \begin_inset Flex CharStyle:Code
11231 status collapsed
11232
11233 \begin_layout Plain Layout
11234 tbp
11235 \end_layout
11236
11237 \end_inset
11238
11239
11240 \begin_inset Quotes erd
11241 \end_inset
11242
11243 .
11244 \end_layout
11245
11246 \begin_layout Description
11247 \begin_inset Flex CharStyle:Code
11248 status collapsed
11249
11250 \begin_layout Plain Layout
11251 Style
11252 \end_layout
11253
11254 \end_inset
11255
11256  [
11257 \begin_inset Flex CharStyle:Code
11258 status collapsed
11259
11260 \begin_layout Plain Layout
11261 string
11262 \end_layout
11263
11264 \end_inset
11265
11266 =
11267 \begin_inset Quotes erd
11268 \end_inset
11269
11270
11271 \begin_inset Quotes erd
11272 \end_inset
11273
11274 ] The style used when defining the float using 
11275 \begin_inset Flex CharStyle:Code
11276 status collapsed
11277
11278 \begin_layout Plain Layout
11279
11280 \backslash
11281 newfloat
11282 \end_layout
11283
11284 \end_inset
11285
11286 .
11287 \end_layout
11288
11289 \begin_layout Description
11290 \begin_inset Flex CharStyle:Code
11291 status collapsed
11292
11293 \begin_layout Plain Layout
11294 Type
11295 \end_layout
11296
11297 \end_inset
11298
11299  [
11300 \begin_inset Flex CharStyle:Code
11301 status collapsed
11302
11303 \begin_layout Plain Layout
11304 string
11305 \end_layout
11306
11307 \end_inset
11308
11309 =
11310 \begin_inset Quotes erd
11311 \end_inset
11312
11313
11314 \begin_inset Quotes erd
11315 \end_inset
11316
11317 ] The 
11318 \begin_inset Quotes eld
11319 \end_inset
11320
11321 type
11322 \begin_inset Quotes erd
11323 \end_inset
11324
11325  of the new class of floats, like program or algorithm.
11326  After the appropriate 
11327 \begin_inset Flex CharStyle:Code
11328 status collapsed
11329
11330 \begin_layout Plain Layout
11331
11332 \backslash
11333 newfloat
11334 \end_layout
11335
11336 \end_inset
11337
11338 , commands such as 
11339 \begin_inset Flex CharStyle:Code
11340 status collapsed
11341
11342 \begin_layout Plain Layout
11343
11344 \backslash
11345 begin{program}
11346 \end_layout
11347
11348 \end_inset
11349
11350  or 
11351 \begin_inset Flex CharStyle:Code
11352 status collapsed
11353
11354 \begin_layout Plain Layout
11355
11356 \backslash
11357 end{algorithm*}
11358 \end_layout
11359
11360 \end_inset
11361
11362  will be available.
11363 \end_layout
11364
11365 \begin_layout Standard
11366 Note that defining a float with type 
11367 \begin_inset Flex CharStyle:Code
11368 status collapsed
11369
11370 \begin_layout Plain Layout
11371
11372 \emph on
11373 type
11374 \end_layout
11375
11376 \end_inset
11377
11378  automatically defines the corresponding counter with name 
11379 \begin_inset Flex CharStyle:Code
11380 status collapsed
11381
11382 \begin_layout Plain Layout
11383
11384 \emph on
11385 type
11386 \end_layout
11387
11388 \end_inset
11389
11390 .
11391 \end_layout
11392
11393 \begin_layout Subsection
11394 Flex insets and InsetLayout
11395 \end_layout
11396
11397 \begin_layout Standard
11398 \begin_inset CommandInset label
11399 LatexCommand label
11400 name "sec:charstyle"
11401
11402 \end_inset
11403
11404 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11405  these are called Flex insets.
11406  
11407 \end_layout
11408
11409 \begin_layout Standard
11410 Flex insets come in three different kinds: 
11411 \end_layout
11412
11413 \begin_layout Itemize
11414 character style (
11415 \begin_inset Flex CharStyle:Code
11416 status collapsed
11417
11418 \begin_layout Plain Layout
11419 CharStyle
11420 \end_layout
11421
11422 \end_inset
11423
11424 ): These define semantic markup corresponding to such LaTeX commands as
11425  
11426 \begin_inset Flex CharStyle:Code
11427 status collapsed
11428
11429 \begin_layout Plain Layout
11430
11431 \backslash
11432 noun
11433 \end_layout
11434
11435 \end_inset
11436
11437  and 
11438 \begin_inset Flex CharStyle:Code
11439 status collapsed
11440
11441 \begin_layout Plain Layout
11442
11443 \backslash
11444 code
11445 \end_layout
11446
11447 \end_inset
11448
11449 .
11450 \end_layout
11451
11452 \begin_layout Itemize
11453 user custom (
11454 \begin_inset Flex CharStyle:Code
11455 status collapsed
11456
11457 \begin_layout Plain Layout
11458 Custom
11459 \end_layout
11460
11461 \end_inset
11462
11463 ): These can be used to define custom collapsible insets, similar to TeX
11464  code, footnote, and the like.
11465  An obvious example is an endnote inset, which is defined in the 
11466 \begin_inset Flex CharStyle:Code
11467 status collapsed
11468
11469 \begin_layout Plain Layout
11470 endnote
11471 \end_layout
11472
11473 \end_inset
11474
11475  module.
11476 \end_layout
11477
11478 \begin_layout Itemize
11479 XML elements (
11480 \begin_inset Flex CharStyle:Code
11481 status collapsed
11482
11483 \begin_layout Plain Layout
11484 Element
11485 \end_layout
11486
11487 \end_inset
11488
11489 ): For use with DocBook classes.
11490 \end_layout
11491
11492 \begin_layout Standard
11493 Flex insets are defined using the 
11494 \begin_inset Flex CharStyle:Code
11495 status collapsed
11496
11497 \begin_layout Plain Layout
11498 InsetLayout
11499 \end_layout
11500
11501 \end_inset
11502
11503  tag, which shall be explained in a moment.
11504 \end_layout
11505
11506 \begin_layout Standard
11507 The 
11508 \begin_inset Flex CharStyle:Code
11509 status collapsed
11510
11511 \begin_layout Plain Layout
11512 InsetLayout
11513 \end_layout
11514
11515 \end_inset
11516
11517  tag also serves another function: It can be used to customize the general
11518  layout of many different types of insets.
11519  Currently, 
11520 \begin_inset Flex CharStyle:Code
11521 status collapsed
11522
11523 \begin_layout Plain Layout
11524 InsetLayout
11525 \end_layout
11526
11527 \end_inset
11528
11529  can be used to customize the layout parameters for footnotes, marginal
11530  notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11531  boxes, tables, algorithms, URLs, and optional arguments, as well as to
11532  define Flex insets.
11533 \end_layout
11534
11535 \begin_layout Standard
11536 The 
11537 \begin_inset Flex CharStyle:Code
11538 status collapsed
11539
11540 \begin_layout Plain Layout
11541 InsetLayout
11542 \end_layout
11543
11544 \end_inset
11545
11546  definition must begin with a line of the form:
11547 \end_layout
11548
11549 \begin_layout LyX-Code
11550 InsetLayout <Type>
11551 \end_layout
11552
11553 \begin_layout Standard
11554 Here 
11555 \begin_inset Flex CharStyle:Code
11556 status collapsed
11557
11558 \begin_layout Plain Layout
11559 <Type>
11560 \end_layout
11561
11562 \end_inset
11563
11564  indicates the inset whose layout is being defined, and here there are two
11565  cases.
11566 \end_layout
11567
11568 \begin_layout Enumerate
11569 The layout for a pre-existing inset is being modified.
11570  In this case, can be 
11571 \begin_inset Flex CharStyle:Code
11572 status collapsed
11573
11574 \begin_layout Plain Layout
11575 <Type>
11576 \end_layout
11577
11578 \end_inset
11579
11580  any one of the following: 
11581 \begin_inset Flex CharStyle:Code
11582 status collapsed
11583
11584 \begin_layout Plain Layout
11585 Algorithm
11586 \end_layout
11587
11588 \end_inset
11589
11590
11591 \begin_inset Flex CharStyle:Code
11592 status collapsed
11593
11594 \begin_layout Plain Layout
11595 Branch
11596 \end_layout
11597
11598 \end_inset
11599
11600
11601 \begin_inset Flex CharStyle:Code
11602 status collapsed
11603
11604 \begin_layout Plain Layout
11605 Box
11606 \end_layout
11607
11608 \end_inset
11609
11610
11611 \begin_inset Flex CharStyle:Code
11612 status collapsed
11613
11614 \begin_layout Plain Layout
11615 Box:shaded
11616 \end_layout
11617
11618 \end_inset
11619
11620
11621 \begin_inset Flex CharStyle:Code
11622 status collapsed
11623
11624 \begin_layout Plain Layout
11625 ERT
11626 \end_layout
11627
11628 \end_inset
11629
11630
11631 \begin_inset Flex CharStyle:Code
11632 status collapsed
11633
11634 \begin_layout Plain Layout
11635 Figure
11636 \end_layout
11637
11638 \end_inset
11639
11640
11641 \begin_inset Flex CharStyle:Code
11642 status collapsed
11643
11644 \begin_layout Plain Layout
11645 Foot
11646 \end_layout
11647
11648 \end_inset
11649
11650
11651 \begin_inset Flex CharStyle:Code
11652 status collapsed
11653
11654 \begin_layout Plain Layout
11655 Index
11656 \end_layout
11657
11658 \end_inset
11659
11660
11661 \begin_inset Flex CharStyle:Code
11662 status collapsed
11663
11664 \begin_layout Plain Layout
11665 Info
11666 \end_layout
11667
11668 \end_inset
11669
11670
11671 \begin_inset Flex CharStyle:Code
11672 status collapsed
11673
11674 \begin_layout Plain Layout
11675 Info:menu
11676 \end_layout
11677
11678 \end_inset
11679
11680
11681 \begin_inset Flex CharStyle:Code
11682 status collapsed
11683
11684 \begin_layout Plain Layout
11685 Info:shortcut
11686 \end_layout
11687
11688 \end_inset
11689
11690
11691 \begin_inset Flex CharStyle:Code
11692 status collapsed
11693
11694 \begin_layout Plain Layout
11695 Info:shortcuts
11696 \end_layout
11697
11698 \end_inset
11699
11700
11701 \begin_inset Flex CharStyle:Code
11702 status collapsed
11703
11704 \begin_layout Plain Layout
11705 Listings
11706 \end_layout
11707
11708 \end_inset
11709
11710
11711 \begin_inset Flex CharStyle:Code
11712 status collapsed
11713
11714 \begin_layout Plain Layout
11715 Marginal
11716 \end_layout
11717
11718 \end_inset
11719
11720
11721 \begin_inset Flex CharStyle:Code
11722 status collapsed
11723
11724 \begin_layout Plain Layout
11725 Note:Comment
11726 \end_layout
11727
11728 \end_inset
11729
11730
11731 \begin_inset Flex CharStyle:Code
11732 status collapsed
11733
11734 \begin_layout Plain Layout
11735 Note:Note
11736 \end_layout
11737
11738 \end_inset
11739
11740
11741 \begin_inset Flex CharStyle:Code
11742 status collapsed
11743
11744 \begin_layout Plain Layout
11745 Note:GreyedOut
11746 \end_layout
11747
11748 \end_inset
11749
11750
11751 \begin_inset Flex CharStyle:Code
11752 status collapsed
11753
11754 \begin_layout Plain Layout
11755 OptArg
11756 \end_layout
11757
11758 \end_inset
11759
11760
11761 \begin_inset Flex CharStyle:Code
11762 status collapsed
11763
11764 \begin_layout Plain Layout
11765 Table
11766 \end_layout
11767
11768 \end_inset
11769
11770 , or 
11771 \begin_inset Flex CharStyle:Code
11772 status collapsed
11773
11774 \begin_layout Plain Layout
11775 URL
11776 \end_layout
11777
11778 \end_inset
11779
11780 .
11781  
11782 \end_layout
11783
11784 \begin_layout Enumerate
11785 The layout for a Flex inset is being defined.
11786  In this case, 
11787 \begin_inset Flex CharStyle:Code
11788 status collapsed
11789
11790 \begin_layout Plain Layout
11791 <Type>
11792 \end_layout
11793
11794 \end_inset
11795
11796  can be any valid identifier not used by a pre-existing inset.
11797  Note that the definition of a flex inset must
11798 \emph on
11799  als
11800 \emph default
11801 o include a 
11802 \begin_inset Flex CharStyle:Code
11803 status collapsed
11804
11805 \begin_layout Plain Layout
11806 LyXType
11807 \end_layout
11808
11809 \end_inset
11810
11811  entry.
11812 \end_layout
11813
11814 \begin_layout Standard
11815 The 
11816 \begin_inset Flex CharStyle:Code
11817 status collapsed
11818
11819 \begin_layout Plain Layout
11820 InsetLayout
11821 \end_layout
11822
11823 \end_inset
11824
11825  definition can contain the following entries:
11826 \end_layout
11827
11828 \begin_layout Description
11829 \begin_inset Flex CharStyle:Code
11830 status collapsed
11831
11832 \begin_layout Plain Layout
11833 BgColor
11834 \end_layout
11835
11836 \end_inset
11837
11838  The color for the inset's background.
11839  The valid colors are defined in 
11840 \begin_inset Flex CharStyle:Code
11841 status collapsed
11842
11843 \begin_layout Plain Layout
11844 src/ColorCode.h
11845 \end_layout
11846
11847 \end_inset
11848
11849 .
11850 \end_layout
11851
11852 \begin_layout Description
11853 \begin_inset Flex CharStyle:Code
11854 status collapsed
11855
11856 \begin_layout Plain Layout
11857 CopyStyle
11858 \end_layout
11859
11860 \end_inset
11861
11862  As with paragraph styles (see page 
11863 \begin_inset CommandInset ref
11864 LatexCommand ref
11865 reference "des:CopyStyle"
11866
11867 \end_inset
11868
11869 ).
11870 \end_layout
11871
11872 \begin_layout Description
11873 \begin_inset Flex CharStyle:Code
11874 status collapsed
11875
11876 \begin_layout Plain Layout
11877 CustomPars
11878 \end_layout
11879
11880 \end_inset
11881
11882  [
11883 \begin_inset Flex CharStyle:Code
11884 status collapsed
11885
11886 \begin_layout Plain Layout
11887
11888 \emph on
11889 0
11890 \end_layout
11891
11892 \end_inset
11893
11894 ,
11895 \begin_inset Flex CharStyle:Code
11896 status collapsed
11897
11898 \begin_layout Plain Layout
11899 1
11900 \end_layout
11901
11902 \end_inset
11903
11904 ] Indicates whether the user may employ the Paragraph Settings dialog to
11905  customize the paragraph.
11906 \end_layout
11907
11908 \begin_layout Description
11909 \begin_inset Flex CharStyle:Code
11910 status collapsed
11911
11912 \begin_layout Plain Layout
11913 Decoration
11914 \end_layout
11915
11916 \end_inset
11917
11918  can be 
11919 \begin_inset Flex CharStyle:Code
11920 status collapsed
11921
11922 \begin_layout Plain Layout
11923 Classic
11924 \end_layout
11925
11926 \end_inset
11927
11928
11929 \begin_inset Flex CharStyle:Code
11930 status collapsed
11931
11932 \begin_layout Plain Layout
11933 Minimalistic
11934 \end_layout
11935
11936 \end_inset
11937
11938 , or 
11939 \begin_inset Flex CharStyle:Code
11940 status collapsed
11941
11942 \begin_layout Plain Layout
11943 Conglomerate
11944 \end_layout
11945
11946 \end_inset
11947
11948 , describing the rendering style used for the inset's frame and buttons.
11949  Footnotes generally use 
11950 \begin_inset Flex CharStyle:Code
11951 status collapsed
11952
11953 \begin_layout Plain Layout
11954 Classic
11955 \end_layout
11956
11957 \end_inset
11958
11959 , ERT insets generally 
11960 \begin_inset Flex CharStyle:Code
11961 status collapsed
11962
11963 \begin_layout Plain Layout
11964 Minimalistic
11965 \end_layout
11966
11967 \end_inset
11968
11969 , and character styles 
11970 \begin_inset Flex CharStyle:Code
11971 status collapsed
11972
11973 \begin_layout Plain Layout
11974 Conglomerate
11975 \end_layout
11976
11977 \end_inset
11978
11979 .
11980 \end_layout
11981
11982 \begin_layout Description
11983 \begin_inset Flex CharStyle:Code
11984 status collapsed
11985
11986 \begin_layout Plain Layout
11987 End
11988 \end_layout
11989
11990 \end_inset
11991
11992  Required at the end of the InsetLayout declarations.
11993 \end_layout
11994
11995 \begin_layout Description
11996 \begin_inset Flex CharStyle:Code
11997 status collapsed
11998
11999 \begin_layout Plain Layout
12000 Font
12001 \end_layout
12002
12003 \end_inset
12004
12005  The font used for both the text body 
12006 \emph on
12007 and
12008 \emph default
12009  the label.
12010  See section
12011 \begin_inset space ~
12012 \end_inset
12013
12014
12015 \begin_inset CommandInset ref
12016 LatexCommand ref
12017 reference "sec:fonts"
12018
12019 \end_inset
12020
12021 .
12022  Note that defining this font automatically defines the 
12023 \begin_inset Flex CharStyle:Code
12024 status collapsed
12025
12026 \begin_layout Plain Layout
12027 LabelFont
12028 \end_layout
12029
12030 \end_inset
12031
12032  to the same value, so define this first and define 
12033 \begin_inset Flex CharStyle:Code
12034 status collapsed
12035
12036 \begin_layout Plain Layout
12037 LabelFont
12038 \end_layout
12039
12040 \end_inset
12041
12042  later if you want them to be different.
12043 \end_layout
12044
12045 \begin_layout Description
12046 \begin_inset Flex CharStyle:Code
12047 status collapsed
12048
12049 \begin_layout Plain Layout
12050 ForceLTR
12051 \end_layout
12052
12053 \end_inset
12054
12055  Force the 
12056 \begin_inset Quotes eld
12057 \end_inset
12058
12059 latex
12060 \begin_inset Quotes erd
12061 \end_inset
12062
12063  language, leading to Left-to-Right (latin) output, e.
12064 \begin_inset space \thinspace{}
12065 \end_inset
12066
12067 g.
12068 \begin_inset space \space{}
12069 \end_inset
12070
12071 in TeX code or URL.
12072  A kludge.
12073 \end_layout
12074
12075 \begin_layout Description
12076 \begin_inset Flex CharStyle:Code
12077 status collapsed
12078
12079 \begin_layout Plain Layout
12080 ForcePlain
12081 \end_layout
12082
12083 \end_inset
12084
12085  [
12086 \begin_inset Flex CharStyle:Code
12087 status collapsed
12088
12089 \begin_layout Plain Layout
12090
12091 \emph on
12092 0
12093 \end_layout
12094
12095 \end_inset
12096
12097 ,
12098 \begin_inset Flex CharStyle:Code
12099 status collapsed
12100
12101 \begin_layout Plain Layout
12102 1
12103 \end_layout
12104
12105 \end_inset
12106
12107 ] Indicates whether the PlainLayout should be used or, instead, the user
12108  can change the paragraph style used in the inset.
12109 \end_layout
12110
12111 \begin_layout Description
12112 \begin_inset Flex CharStyle:Code
12113 status collapsed
12114
12115 \begin_layout Plain Layout
12116 FreeSpacing
12117 \end_layout
12118
12119 \end_inset
12120
12121  As with paragraph styles (see page 
12122 \begin_inset CommandInset ref
12123 LatexCommand pageref
12124 reference "des:FreeSpacing"
12125
12126 \end_inset
12127
12128 ).
12129 \end_layout
12130
12131 \begin_layout Description
12132 \begin_inset Flex CharStyle:Code
12133 status collapsed
12134
12135 \begin_layout Plain Layout
12136 KeepEmpty
12137 \end_layout
12138
12139 \end_inset
12140
12141  As with paragraph styles (see page 
12142 \begin_inset CommandInset ref
12143 LatexCommand pageref
12144 reference "des:KeepEmpty"
12145
12146 \end_inset
12147
12148 ).
12149 \end_layout
12150
12151 \begin_layout Description
12152 \begin_inset Flex CharStyle:Code
12153 status collapsed
12154
12155 \begin_layout Plain Layout
12156 LabelFont
12157 \end_layout
12158
12159 \end_inset
12160
12161  The font used for the label.
12162  See section
12163 \begin_inset space ~
12164 \end_inset
12165
12166
12167 \begin_inset CommandInset ref
12168 LatexCommand ref
12169 reference "sec:fonts"
12170
12171 \end_inset
12172
12173 .
12174  Note that this definition can never appear before 
12175 \begin_inset Flex CharStyle:Code
12176 status collapsed
12177
12178 \begin_layout Plain Layout
12179 Font
12180 \end_layout
12181
12182 \end_inset
12183
12184 , lest it be ineffective.
12185 \end_layout
12186
12187 \begin_layout Description
12188 \begin_inset Flex CharStyle:Code
12189 status collapsed
12190
12191 \begin_layout Plain Layout
12192 LabelString
12193 \end_layout
12194
12195 \end_inset
12196
12197  What will be displayed on the button or elsewhere as the inset label.
12198  Some inset types (TeX code and Branch) modify this label on the fly.
12199 \end_layout
12200
12201 \begin_layout Description
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  The name of the corresponding LaTeX stuff.
12212  Either the environment or command name.
12213 \end_layout
12214
12215 \begin_layout Description
12216 \begin_inset Flex CharStyle:Code
12217 status collapsed
12218
12219 \begin_layout Plain Layout
12220 LatexParam
12221 \end_layout
12222
12223 \end_inset
12224
12225  The optional parameter for the corresponding 
12226 \begin_inset Flex CharStyle:Code
12227 status collapsed
12228
12229 \begin_layout Plain Layout
12230 LatexName
12231 \end_layout
12232
12233 \end_inset
12234
12235  stuff, including possible bracket pairs like 
12236 \begin_inset Flex CharStyle:Code
12237 status collapsed
12238
12239 \begin_layout Plain Layout
12240 []
12241 \end_layout
12242
12243 \end_inset
12244
12245 .
12246  This parameter cannot be changed from within LyX.
12247 \end_layout
12248
12249 \begin_layout Description
12250 \begin_inset Flex CharStyle:Code
12251 status collapsed
12252
12253 \begin_layout Plain Layout
12254 LatexType
12255 \end_layout
12256
12257 \end_inset
12258
12259  As with paragraph styles (see page 
12260 \begin_inset CommandInset ref
12261 LatexCommand pageref
12262 reference "des:LatexType"
12263
12264 \end_inset
12265
12266 ).
12267 \end_layout
12268
12269 \begin_layout Description
12270 \begin_inset Flex CharStyle:Code
12271 status collapsed
12272
12273 \begin_layout Plain Layout
12274 LyxType 
12275 \end_layout
12276
12277 \end_inset
12278
12279  Can be 
12280 \begin_inset Flex CharStyle:Code
12281 status collapsed
12282
12283 \begin_layout Plain Layout
12284 charstyle
12285 \end_layout
12286
12287 \end_inset
12288
12289
12290 \begin_inset Flex CharStyle:Code
12291 status collapsed
12292
12293 \begin_layout Plain Layout
12294 custom
12295 \end_layout
12296
12297 \end_inset
12298
12299
12300 \begin_inset Flex CharStyle:Code
12301 status collapsed
12302
12303 \begin_layout Plain Layout
12304 element
12305 \end_layout
12306
12307 \end_inset
12308
12309 , or 
12310 \begin_inset Flex CharStyle:Code
12311 status collapsed
12312
12313 \begin_layout Plain Layout
12314 end
12315 \end_layout
12316
12317 \end_inset
12318
12319  (indicating a dummy definition ending definitions of charstyles, etc).
12320  This entry is required in and is only meaningful for Flex insets.
12321  Among other things, it determines on which menu this inset will appear.
12322 \end_layout
12323
12324 \begin_layout Description
12325 \begin_inset Flex CharStyle:Code
12326 status collapsed
12327
12328 \begin_layout Plain Layout
12329 MultiPar
12330 \end_layout
12331
12332 \end_inset
12333
12334  [
12335 \begin_inset Flex CharStyle:Code
12336 status collapsed
12337
12338 \begin_layout Plain Layout
12339
12340 \emph on
12341 0
12342 \end_layout
12343
12344 \end_inset
12345
12346 ,
12347 \begin_inset Flex CharStyle:Code
12348 status collapsed
12349
12350 \begin_layout Plain Layout
12351 1
12352 \end_layout
12353
12354 \end_inset
12355
12356 ] Whether multiple paragraphs are permitted in this inset.
12357  This will also set CustomPars to the same value and ForcePlain to the opposite
12358  value.
12359  These can be reset to other values, if they are used 
12360 \emph on
12361 after
12362 \emph default
12363  MultiPar.
12364 \end_layout
12365
12366 \begin_layout Description
12367 \begin_inset Flex CharStyle:Code
12368 status collapsed
12369
12370 \begin_layout Plain Layout
12371 NeedProtect
12372 \end_layout
12373
12374 \end_inset
12375
12376  [
12377 \begin_inset Flex CharStyle:Code
12378 status collapsed
12379
12380 \begin_layout Plain Layout
12381
12382 \emph on
12383 0
12384 \end_layout
12385
12386 \end_inset
12387
12388 ,
12389 \begin_inset Flex CharStyle:Code
12390 status collapsed
12391
12392 \begin_layout Plain Layout
12393 1
12394 \end_layout
12395
12396 \end_inset
12397
12398 ] Whether fragile commands in this layout should be 
12399 \begin_inset Flex CharStyle:Code
12400 status collapsed
12401
12402 \begin_layout Plain Layout
12403
12404 \backslash
12405 protect
12406 \end_layout
12407
12408 \end_inset
12409
12410 'ed.
12411  (Note: This is 
12412 \emph on
12413 not
12414 \emph default
12415  whether the command should itself be protected.)
12416 \end_layout
12417
12418 \begin_layout Description
12419 \begin_inset Flex CharStyle:Code
12420 status collapsed
12421
12422 \begin_layout Plain Layout
12423 PassThru
12424 \end_layout
12425
12426 \end_inset
12427
12428  [
12429 \begin_inset Flex CharStyle:Code
12430 status collapsed
12431
12432 \begin_layout Plain Layout
12433
12434 \emph on
12435 0
12436 \end_layout
12437
12438 \end_inset
12439
12440 ,
12441 \begin_inset Flex CharStyle:Code
12442 status collapsed
12443
12444 \begin_layout Plain Layout
12445 1
12446 \end_layout
12447
12448 \end_inset
12449
12450 ] As with paragraph styles (see page 
12451 \begin_inset CommandInset ref
12452 LatexCommand ref
12453 reference "des:PathThru"
12454
12455 \end_inset
12456
12457 ).
12458 \end_layout
12459
12460 \begin_layout Description
12461 \begin_inset Flex CharStyle:Code
12462 status collapsed
12463
12464 \begin_layout Plain Layout
12465 Preamble
12466 \end_layout
12467
12468 \end_inset
12469
12470  As with paragraph styles (see page 
12471 \begin_inset CommandInset ref
12472 LatexCommand pageref
12473 reference "des:Preamble"
12474
12475 \end_inset
12476
12477 ).
12478 \end_layout
12479
12480 \begin_layout Description
12481 \begin_inset Flex CharStyle:Code
12482 status collapsed
12483
12484 \begin_layout Plain Layout
12485 Requires 
12486 \end_layout
12487
12488 \end_inset
12489
12490  [
12491 \begin_inset Flex CharStyle:Code
12492 status collapsed
12493
12494 \begin_layout Plain Layout
12495 string
12496 \end_layout
12497
12498 \end_inset
12499
12500 ] As with paragraph styles (see page 
12501 \begin_inset CommandInset ref
12502 LatexCommand pageref
12503 reference "des:Requires"
12504
12505 \end_inset
12506
12507 ).
12508 \end_layout
12509
12510 \begin_layout Subsection
12511 Counters
12512 \end_layout
12513
12514 \begin_layout Standard
12515 \begin_inset CommandInset label
12516 LatexCommand label
12517 name "sec:counter"
12518
12519 \end_inset
12520
12521 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12522  counters (
12523 \begin_inset Flex CharStyle:MenuItem
12524 status collapsed
12525
12526 \begin_layout Plain Layout
12527 chapter
12528 \end_layout
12529
12530 \end_inset
12531
12532
12533 \begin_inset Flex CharStyle:MenuItem
12534 status collapsed
12535
12536 \begin_layout Plain Layout
12537 figure
12538 \end_layout
12539
12540 \end_inset
12541
12542 , \SpecialChar \ldots{}
12543 ) in the text class itself.
12544  The standard counters are defined in the file 
12545 \begin_inset Flex CharStyle:Code
12546 status collapsed
12547
12548 \begin_layout Plain Layout
12549 stdcounters.inc
12550 \end_layout
12551
12552 \end_inset
12553
12554 , so you may have to do no more than add
12555 \end_layout
12556
12557 \begin_layout LyX-Code
12558 Input stdcounters.inc
12559 \end_layout
12560
12561 \begin_layout Standard
12562 to your layout file to get them to work.
12563  But if you want to define custom counters, then you can do so.
12564  The counter declaration must begin with:
12565 \end_layout
12566
12567 \begin_layout LyX-Code
12568 Counter name
12569 \end_layout
12570
12571 \begin_layout Standard
12572 where of course `name' is replaced by the name of the counter.
12573  And it must end with 
12574 \begin_inset Quotes eld
12575 \end_inset
12576
12577
12578 \begin_inset Flex CharStyle:Code
12579 status collapsed
12580
12581 \begin_layout Plain Layout
12582 End
12583 \end_layout
12584
12585 \end_inset
12586
12587
12588 \begin_inset Quotes erd
12589 \end_inset
12590
12591 .
12592  The following parameters can also be used:
12593 \end_layout
12594
12595 \begin_layout Description
12596 \begin_inset Flex CharStyle:Code
12597 status collapsed
12598
12599 \begin_layout Plain Layout
12600 LabelString [string=""]
12601 \end_layout
12602
12603 \end_inset
12604
12605  when this is defined, this string defines how the counter is displayed.
12606  Setting this value sets 
12607 \begin_inset Flex CharStyle:Code
12608 status collapsed
12609
12610 \begin_layout Plain Layout
12611 LabelStringAppendix
12612 \end_layout
12613
12614 \end_inset
12615
12616  to the same value.
12617  The following special constructs can be used in the string:
12618 \end_layout
12619
12620 \begin_deeper
12621 \begin_layout Itemize
12622 \begin_inset Flex CharStyle:Code
12623 status collapsed
12624
12625 \begin_layout Plain Layout
12626
12627 \backslash
12628 thecounter
12629 \end_layout
12630
12631 \end_inset
12632
12633  will be replaced by the expansion of the 
12634 \begin_inset Flex CharStyle:Code
12635 status collapsed
12636
12637 \begin_layout Plain Layout
12638 LabelString
12639 \end_layout
12640
12641 \end_inset
12642
12643  (or 
12644 \begin_inset Flex CharStyle:Code
12645 status collapsed
12646
12647 \begin_layout Plain Layout
12648 LabelStringAppendix
12649 \end_layout
12650
12651 \end_inset
12652
12653 ) of the counter 
12654 \begin_inset Flex CharStyle:Code
12655 status collapsed
12656
12657 \begin_layout Plain Layout
12658 counter
12659 \end_layout
12660
12661 \end_inset
12662
12663 .
12664  
12665 \end_layout
12666
12667 \begin_layout Itemize
12668 counter values can be expressed using LaTeX-like macros 
12669 \begin_inset Flex CharStyle:Code
12670 status collapsed
12671
12672 \begin_layout Plain Layout
12673
12674 \backslash
12675
12676 \emph on
12677 numbertype
12678 \emph default
12679 {
12680 \emph on
12681 counter
12682 \emph default
12683 }
12684 \end_layout
12685
12686 \end_inset
12687
12688 , where 
12689 \begin_inset Flex CharStyle:Code
12690 status collapsed
12691
12692 \begin_layout Plain Layout
12693
12694 \emph on
12695 numbertype
12696 \end_layout
12697
12698 \end_inset
12699
12700  can be:
12701 \begin_inset Foot
12702 status collapsed
12703
12704 \begin_layout Plain Layout
12705
12706 \family roman
12707 \series medium
12708 \shape up
12709 \size normal
12710 \emph off
12711 \bar no
12712 \noun off
12713 \color none
12714 Actually, the situation is a bit more complicated: any
12715 \family default
12716 \series default
12717 \shape default
12718 \emph default
12719 \bar default
12720  
12721 \size default
12722 \emph on
12723 \noun default
12724 \color inherit
12725 numbertype
12726 \family roman
12727 \series medium
12728 \shape up
12729 \size normal
12730 \emph off
12731 \bar no
12732 \noun off
12733  other than those described below will produce arabic numerals.
12734  It would not be surprising to see this change in the future.
12735 \end_layout
12736
12737 \end_inset
12738
12739  
12740 \begin_inset Flex CharStyle:Code
12741 status collapsed
12742
12743 \begin_layout Plain Layout
12744 arabic
12745 \end_layout
12746
12747 \end_inset
12748
12749 : 1, 2, 3,\SpecialChar \ldots{}
12750
12751 \begin_inset Flex CharStyle:Code
12752 status collapsed
12753
12754 \begin_layout Plain Layout
12755 alph
12756 \end_layout
12757
12758 \end_inset
12759
12760  for lower-case letters: a, b, c, \SpecialChar \ldots{}
12761
12762 \begin_inset Flex CharStyle:Code
12763 status collapsed
12764
12765 \begin_layout Plain Layout
12766 Alph
12767 \end_layout
12768
12769 \end_inset
12770
12771  for upper-case letters: A, B, C, \SpecialChar \ldots{}
12772
12773 \begin_inset Flex CharStyle:Code
12774 status collapsed
12775
12776 \begin_layout Plain Layout
12777 roman
12778 \end_layout
12779
12780 \end_inset
12781
12782  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
12783
12784 \begin_inset Flex CharStyle:Code
12785 status collapsed
12786
12787 \begin_layout Plain Layout
12788 Roman
12789 \end_layout
12790
12791 \end_inset
12792
12793  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
12794
12795 \begin_inset Flex CharStyle:Code
12796 status collapsed
12797
12798 \begin_layout Plain Layout
12799 hebrew
12800 \end_layout
12801
12802 \end_inset
12803
12804  for hebrew numerals.
12805 \end_layout
12806
12807 \end_deeper
12808 \begin_layout Standard
12809 If LabelString is not defined, a default value is constructed as follows:
12810  if the counter has a master counter 
12811 \begin_inset Flex CharStyle:Code
12812 status collapsed
12813
12814 \begin_layout Plain Layout
12815 master
12816 \end_layout
12817
12818 \end_inset
12819
12820  (defined via 
12821 \begin_inset Flex CharStyle:Code
12822 status collapsed
12823
12824 \begin_layout Plain Layout
12825 Within
12826 \end_layout
12827
12828 \end_inset
12829
12830 ), the string 
12831 \begin_inset Flex CharStyle:Code
12832 status collapsed
12833
12834 \begin_layout Plain Layout
12835
12836 \backslash
12837 themaster.
12838 \backslash
12839 arabic{counter}
12840 \end_layout
12841
12842 \end_inset
12843
12844  is used; otherwise the string 
12845 \begin_inset Flex CharStyle:Code
12846 status collapsed
12847
12848 \begin_layout Plain Layout
12849
12850 \backslash
12851 arabic{counter}
12852 \end_layout
12853
12854 \end_inset
12855
12856  is used.
12857 \end_layout
12858
12859 \begin_layout Description
12860 \begin_inset Flex CharStyle:Code
12861 status collapsed
12862
12863 \begin_layout Plain Layout
12864 LabelStringAppendix [string=""]
12865 \end_layout
12866
12867 \end_inset
12868
12869  Same as 
12870 \begin_inset Flex CharStyle:Code
12871 status collapsed
12872
12873 \begin_layout Plain Layout
12874 LabelString
12875 \end_layout
12876
12877 \end_inset
12878
12879 , but for use in the Appendix.
12880 \end_layout
12881
12882 \begin_layout Description
12883 \begin_inset Flex CharStyle:Code
12884 status collapsed
12885
12886 \begin_layout Plain Layout
12887 Within
12888 \end_layout
12889
12890 \end_inset
12891
12892  [
12893 \begin_inset Flex CharStyle:Code
12894 status collapsed
12895
12896 \begin_layout Plain Layout
12897 string
12898 \end_layout
12899
12900 \end_inset
12901
12902 =
12903 \begin_inset Quotes erd
12904 \end_inset
12905
12906
12907 \begin_inset Quotes erd
12908 \end_inset
12909
12910 ] If this is set to the name of another counter, the present counter will
12911  be reset every time the other one is increased.
12912  For example, 
12913 \begin_inset Flex CharStyle:Code
12914 status collapsed
12915
12916 \begin_layout Plain Layout
12917 subsection
12918 \end_layout
12919
12920 \end_inset
12921
12922  is numbered inside 
12923 \begin_inset Flex CharStyle:Code
12924 status collapsed
12925
12926 \begin_layout Plain Layout
12927 section
12928 \end_layout
12929
12930 \end_inset
12931
12932 .
12933 \end_layout
12934
12935 \begin_layout Subsection
12936 Font description
12937 \end_layout
12938
12939 \begin_layout Standard
12940 \begin_inset CommandInset label
12941 LatexCommand label
12942 name "sec:fonts"
12943
12944 \end_inset
12945
12946 A font description looks like this:
12947 \end_layout
12948
12949 \begin_layout LyX-Code
12950 Font 
12951 \family roman
12952 \emph on
12953 or
12954 \family default
12955 \emph default
12956  LabelFont
12957 \end_layout
12958
12959 \begin_layout LyX-Code
12960  ...
12961 \end_layout
12962
12963 \begin_layout LyX-Code
12964 EndFont
12965 \end_layout
12966
12967 \begin_layout Standard
12968 The following commands are available:
12969 \end_layout
12970
12971 \begin_layout Description
12972 \begin_inset Flex CharStyle:Code
12973 status collapsed
12974
12975 \begin_layout Plain Layout
12976 Color
12977 \end_layout
12978
12979 \end_inset
12980
12981  [
12982 \begin_inset Flex CharStyle:Code
12983 status collapsed
12984
12985 \begin_layout Plain Layout
12986
12987 \emph on
12988 none
12989 \end_layout
12990
12991 \end_inset
12992
12993
12994 \begin_inset Flex CharStyle:Code
12995 status collapsed
12996
12997 \begin_layout Plain Layout
12998 black
12999 \end_layout
13000
13001 \end_inset
13002
13003
13004 \begin_inset Flex CharStyle:Code
13005 status collapsed
13006
13007 \begin_layout Plain Layout
13008 white
13009 \end_layout
13010
13011 \end_inset
13012
13013
13014 \begin_inset Flex CharStyle:Code
13015 status collapsed
13016
13017 \begin_layout Plain Layout
13018 red
13019 \end_layout
13020
13021 \end_inset
13022
13023
13024 \begin_inset Flex CharStyle:Code
13025 status collapsed
13026
13027 \begin_layout Plain Layout
13028 green
13029 \end_layout
13030
13031 \end_inset
13032
13033
13034 \begin_inset Flex CharStyle:Code
13035 status collapsed
13036
13037 \begin_layout Plain Layout
13038 blue
13039 \end_layout
13040
13041 \end_inset
13042
13043
13044 \begin_inset Flex CharStyle:Code
13045 status collapsed
13046
13047 \begin_layout Plain Layout
13048 cyan
13049 \end_layout
13050
13051 \end_inset
13052
13053
13054 \begin_inset Flex CharStyle:Code
13055 status collapsed
13056
13057 \begin_layout Plain Layout
13058 magenta
13059 \end_layout
13060
13061 \end_inset
13062
13063
13064 \begin_inset Flex CharStyle:Code
13065 status collapsed
13066
13067 \begin_layout Plain Layout
13068 yellow
13069 \end_layout
13070
13071 \end_inset
13072
13073 ]
13074 \end_layout
13075
13076 \begin_layout Description
13077 \begin_inset Flex CharStyle:Code
13078 status collapsed
13079
13080 \begin_layout Plain Layout
13081 Family
13082 \end_layout
13083
13084 \end_inset
13085
13086  [
13087 \emph on
13088
13089 \begin_inset Flex CharStyle:Code
13090 status collapsed
13091
13092 \begin_layout Plain Layout
13093
13094 \emph on
13095 Roman
13096 \end_layout
13097
13098 \end_inset
13099
13100
13101 \emph default
13102
13103 \begin_inset Flex CharStyle:Code
13104 status collapsed
13105
13106 \begin_layout Plain Layout
13107 Sans
13108 \end_layout
13109
13110 \end_inset
13111
13112
13113 \begin_inset Flex CharStyle:Code
13114 status collapsed
13115
13116 \begin_layout Plain Layout
13117 Typewriter
13118 \end_layout
13119
13120 \end_inset
13121
13122
13123 \end_layout
13124
13125 \begin_layout Description
13126 \begin_inset Flex CharStyle:Code
13127 status collapsed
13128
13129 \begin_layout Plain Layout
13130 Misc
13131 \end_layout
13132
13133 \end_inset
13134
13135  [
13136 \begin_inset Flex CharStyle:Code
13137 status collapsed
13138
13139 \begin_layout Plain Layout
13140 string
13141 \end_layout
13142
13143 \end_inset
13144
13145 ] Valid argument are: 
13146 \begin_inset Flex CharStyle:Code
13147 status collapsed
13148
13149 \begin_layout Plain Layout
13150 emph
13151 \end_layout
13152
13153 \end_inset
13154
13155
13156 \begin_inset Flex CharStyle:Code
13157 status collapsed
13158
13159 \begin_layout Plain Layout
13160 noun
13161 \end_layout
13162
13163 \end_inset
13164
13165
13166 \begin_inset Flex CharStyle:Code
13167 status collapsed
13168
13169 \begin_layout Plain Layout
13170 underbar
13171 \end_layout
13172
13173 \end_inset
13174
13175
13176 \begin_inset Flex CharStyle:Code
13177 status collapsed
13178
13179 \begin_layout Plain Layout
13180 no_emph
13181 \end_layout
13182
13183 \end_inset
13184
13185
13186 \begin_inset Flex CharStyle:Code
13187 status collapsed
13188
13189 \begin_layout Plain Layout
13190 no_noun
13191 \end_layout
13192
13193 \end_inset
13194
13195  and 
13196 \begin_inset Flex CharStyle:Code
13197 status collapsed
13198
13199 \begin_layout Plain Layout
13200 no_bar
13201 \end_layout
13202
13203 \end_inset
13204
13205 .
13206  Each of these turns on or off the corresponding attribute.
13207 \end_layout
13208
13209 \begin_layout Description
13210 \begin_inset Flex CharStyle:Code
13211 status collapsed
13212
13213 \begin_layout Plain Layout
13214 Series
13215 \end_layout
13216
13217 \end_inset
13218
13219  [
13220 \emph on
13221
13222 \begin_inset Flex CharStyle:Code
13223 status collapsed
13224
13225 \begin_layout Plain Layout
13226
13227 \emph on
13228 Medium
13229 \end_layout
13230
13231 \end_inset
13232
13233
13234 \emph default
13235
13236 \begin_inset Flex CharStyle:Code
13237 status collapsed
13238
13239 \begin_layout Plain Layout
13240 Bold
13241 \end_layout
13242
13243 \end_inset
13244
13245
13246 \end_layout
13247
13248 \begin_layout Description
13249 \begin_inset Flex CharStyle:Code
13250 status collapsed
13251
13252 \begin_layout Plain Layout
13253 Shape
13254 \end_layout
13255
13256 \end_inset
13257
13258  [
13259 \emph on
13260
13261 \begin_inset Flex CharStyle:Code
13262 status collapsed
13263
13264 \begin_layout Plain Layout
13265
13266 \emph on
13267 Up
13268 \end_layout
13269
13270 \end_inset
13271
13272
13273 \emph default
13274
13275 \begin_inset Flex CharStyle:Code
13276 status collapsed
13277
13278 \begin_layout Plain Layout
13279 Italic
13280 \end_layout
13281
13282 \end_inset
13283
13284
13285 \begin_inset Flex CharStyle:Code
13286 status collapsed
13287
13288 \begin_layout Plain Layout
13289 SmallCaps
13290 \end_layout
13291
13292 \end_inset
13293
13294
13295 \begin_inset Flex CharStyle:Code
13296 status collapsed
13297
13298 \begin_layout Plain Layout
13299 Slanted
13300 \end_layout
13301
13302 \end_inset
13303
13304
13305 \end_layout
13306
13307 \begin_layout Description
13308 \begin_inset Flex CharStyle:Code
13309 status collapsed
13310
13311 \begin_layout Plain Layout
13312 Size
13313 \end_layout
13314
13315 \end_inset
13316
13317  [
13318 \begin_inset Flex CharStyle:Code
13319 status collapsed
13320
13321 \begin_layout Plain Layout
13322 tiny
13323 \end_layout
13324
13325 \end_inset
13326
13327
13328 \begin_inset Flex CharStyle:Code
13329 status collapsed
13330
13331 \begin_layout Plain Layout
13332 small
13333 \end_layout
13334
13335 \end_inset
13336
13337
13338 \begin_inset Flex CharStyle:Code
13339 status collapsed
13340
13341 \begin_layout Plain Layout
13342
13343 \emph on
13344 normal
13345 \end_layout
13346
13347 \end_inset
13348
13349
13350 \begin_inset Flex CharStyle:Code
13351 status collapsed
13352
13353 \begin_layout Plain Layout
13354 large
13355 \end_layout
13356
13357 \end_inset
13358
13359
13360 \begin_inset Flex CharStyle:Code
13361 status collapsed
13362
13363 \begin_layout Plain Layout
13364 larger
13365 \end_layout
13366
13367 \end_inset
13368
13369
13370 \begin_inset Flex CharStyle:Code
13371 status collapsed
13372
13373 \begin_layout Plain Layout
13374 largest
13375 \end_layout
13376
13377 \end_inset
13378
13379
13380 \begin_inset Flex CharStyle:Code
13381 status collapsed
13382
13383 \begin_layout Plain Layout
13384 huge
13385 \end_layout
13386
13387 \end_inset
13388
13389
13390 \begin_inset Flex CharStyle:Code
13391 status collapsed
13392
13393 \begin_layout Plain Layout
13394 giant
13395 \end_layout
13396
13397 \end_inset
13398
13399 ]
13400 \end_layout
13401
13402 \begin_layout Subsection
13403 Upgrading old layout files
13404 \end_layout
13405
13406 \begin_layout Standard
13407 The file format of layout files changes from time to time, so old layout
13408  files need to be converted.
13409  This process has been automated since LyX 1.4.0: If LyX reads an old format
13410  layout file it will call the conversion tool 
13411 \begin_inset Flex CharStyle:Code
13412 status collapsed
13413
13414 \begin_layout Plain Layout
13415 LyXDir/scripts/layout2layout.py
13416 \end_layout
13417
13418 \end_inset
13419
13420  and convert it to a temporary file in current format.
13421  The original file is left untouched.
13422  If you want to convert the layout file permanently, just call the converter
13423  by hand:
13424 \end_layout
13425
13426 \begin_layout LyX-Code
13427 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13428 \end_layout
13429
13430 \begin_layout Standard
13431 (You need to replace 
13432 \begin_inset Flex CharStyle:Code
13433 status collapsed
13434
13435 \begin_layout Plain Layout
13436 $LyXDir
13437 \end_layout
13438
13439 \end_inset
13440
13441  with the name of your LyX system directory, unless you happen to have defined
13442  such an environment variable.) Then copy 
13443 \begin_inset Flex CharStyle:Code
13444 status collapsed
13445
13446 \begin_layout Plain Layout
13447 myclassnew.layout
13448 \end_layout
13449
13450 \end_inset
13451
13452  to 
13453 \begin_inset Flex CharStyle:Code
13454 status collapsed
13455
13456 \begin_layout Plain Layout
13457 UserDir/layouts/
13458 \end_layout
13459
13460 \end_inset
13461
13462 .
13463 \end_layout
13464
13465 \begin_layout Standard
13466 The automatic conversion only handles syntax changes.
13467  It cannot handle the case where the contents of included files was changed,
13468  so these will have to be converted separately.
13469 \end_layout
13470
13471 \begin_layout Section
13472 Creating Templates
13473 \begin_inset CommandInset label
13474 LatexCommand label
13475 name "sec:templates"
13476
13477 \end_inset
13478
13479
13480 \end_layout
13481
13482 \begin_layout Standard
13483 Templates are created just like usual documents.
13484  The only difference is that usual documents contain all possible settings,
13485  including the font scheme and the paper size.
13486  Usually a user doesn't want a template to overwrite his defaults in these
13487  cases.
13488  For that reason, the designer of a template should remove the corresponding
13489  commands like 
13490 \begin_inset Flex CharStyle:Code
13491 status collapsed
13492
13493 \begin_layout Plain Layout
13494
13495 \backslash
13496 fontscheme
13497 \end_layout
13498
13499 \end_inset
13500
13501  or 
13502 \begin_inset Flex CharStyle:Code
13503 status collapsed
13504
13505 \begin_layout Plain Layout
13506
13507 \backslash
13508 papersize
13509 \end_layout
13510
13511 \end_inset
13512
13513  from the template LyX file.
13514  This can be done with any simple text-editor, for example 
13515 \begin_inset Flex CharStyle:Code
13516 status collapsed
13517
13518 \begin_layout Plain Layout
13519 vi
13520 \end_layout
13521
13522 \end_inset
13523
13524  or 
13525 \begin_inset Flex CharStyle:Code
13526 status collapsed
13527
13528 \begin_layout Plain Layout
13529 xedit
13530 \end_layout
13531
13532 \end_inset
13533
13534 .
13535  
13536 \end_layout
13537
13538 \begin_layout Standard
13539 Put the edited template files you create in 
13540 \begin_inset Flex CharStyle:Code
13541 status collapsed
13542
13543 \begin_layout Plain Layout
13544 UserDir/templates/
13545 \end_layout
13546
13547 \end_inset
13548
13549 , copy the ones you use from the global template directory in 
13550 \begin_inset Flex CharStyle:Code
13551 status collapsed
13552
13553 \begin_layout Plain Layout
13554 LyXDir/templates/
13555 \end_layout
13556
13557 \end_inset
13558
13559  to the same place, and redefine the template path in the 
13560 \begin_inset Flex CharStyle:MenuItem
13561 status collapsed
13562
13563 \begin_layout Plain Layout
13564 Tools\SpecialChar \menuseparator
13565 Preferences\SpecialChar \menuseparator
13566 Paths
13567 \end_layout
13568
13569 \end_inset
13570
13571  dialog.
13572 \end_layout
13573
13574 \begin_layout Standard
13575 Note that there is a template which has a particular meaning: 
13576 \begin_inset Flex CharStyle:Code
13577 status collapsed
13578
13579 \begin_layout Plain Layout
13580 defaults.lyx
13581 \end_layout
13582
13583 \end_inset
13584
13585 .
13586  This template is loaded every time you create a new document with 
13587 \begin_inset Flex CharStyle:MenuItem
13588 status collapsed
13589
13590 \begin_layout Plain Layout
13591 File\SpecialChar \menuseparator
13592 New
13593 \end_layout
13594
13595 \end_inset
13596
13597  in order to provide useful defaults.
13598  To create this template from inside LyX, all you have to do is to open
13599  a document with the correct settings, and use the 
13600 \begin_inset Flex CharStyle:MenuItem
13601 status collapsed
13602
13603 \begin_layout Plain Layout
13604 Save as Document Defaults
13605 \end_layout
13606
13607 \end_inset
13608
13609  button.
13610 \end_layout
13611
13612 \begin_layout Chapter
13613 Including External Material
13614 \end_layout
13615
13616 \begin_layout Standard
13617 \begin_inset Box Shadowbox
13618 position "t"
13619 hor_pos "c"
13620 has_inner_box 1
13621 inner_pos "t"
13622 use_parbox 0
13623 width "100col%"
13624 special "none"
13625 height "1in"
13626 height_special "totalheight"
13627 status open
13628
13629 \begin_layout Plain Layout
13630 WARNING: This portion of the documentation has not been updated for some
13631  time.
13632  We certainly hope that it is still accurate, but there are no guarantees.
13633 \end_layout
13634
13635 \end_inset
13636
13637
13638 \end_layout
13639
13640 \begin_layout Standard
13641 The use of material from sources external to LyX is covered in detail in
13642  the 
13643 \emph on
13644 Embedded Objects
13645 \emph default
13646  manual.
13647  This part of the manual covers what needs to happen behind the scenes for
13648  new sorts of material to be included.
13649 \end_layout
13650
13651 \begin_layout Section
13652 How does it work?
13653 \end_layout
13654
13655 \begin_layout Standard
13656 The external material feature is based on the concept of a 
13657 \emph on
13658 template
13659 \emph default
13660 .
13661  A template is a specification of how LyX should interface with a certain
13662  kind of material.
13663  As bundled, LyX comes with predefined templates for Xfig figures, various
13664  raster format images, chess diagrams, and LilyPond music notation.
13665  You can check the actual list by using the menu 
13666 \begin_inset Flex CharStyle:MenuItem
13667 status collapsed
13668
13669 \begin_layout Plain Layout
13670 Insert\SpecialChar \menuseparator
13671 File\SpecialChar \menuseparator
13672 External Material
13673 \end_layout
13674
13675 \end_inset
13676
13677 .
13678  Furthermore, it is possible to roll your own template to support a specific
13679  kind of material.
13680  Later we'll describe in more detail what is involved, and hopefully you
13681  will submit all the templates you create so we can include them in a later
13682  LyX version.
13683 \end_layout
13684
13685 \begin_layout Standard
13686 Another basic idea of the external material feature is to distinguish between
13687  the original file that serves as a base for final material and the produced
13688  file that is included in your exported or printed document.
13689  For example, consider the case of a figure produced with 
13690 \begin_inset Flex CharStyle:Code
13691 status collapsed
13692
13693 \begin_layout Plain Layout
13694 Xfig
13695 \end_layout
13696
13697 \end_inset
13698
13699 .
13700  The Xfig application itself works on an original file with the 
13701 \begin_inset Flex CharStyle:Code
13702 status collapsed
13703
13704 \begin_layout Plain Layout
13705 .fig
13706 \end_layout
13707
13708 \end_inset
13709
13710  extension.
13711  Within Xfig, you create and change your figure, and when you are done,
13712  you save the 
13713 \begin_inset Flex CharStyle:Code
13714 status collapsed
13715
13716 \begin_layout Plain Layout
13717 fig
13718 \end_layout
13719
13720 \end_inset
13721
13722 -file.
13723  When you want to include the figure in your document, you invoke 
13724 \begin_inset Flex CharStyle:Code
13725 status collapsed
13726
13727 \begin_layout Plain Layout
13728 transfig
13729 \end_layout
13730
13731 \end_inset
13732
13733  in order to create a PostScript file that can readily be included in your
13734  LaTeX file.
13735  In this case, the 
13736 \begin_inset Flex CharStyle:Code
13737 status collapsed
13738
13739 \begin_layout Plain Layout
13740 .fig
13741 \end_layout
13742
13743 \end_inset
13744
13745  file is the original file, and the PostScript file is the produced file.
13746 \end_layout
13747
13748 \begin_layout Standard
13749 This distinction is important in order to allow updating of the material
13750  while you are in the process of writing the document.
13751  Furthermore, it provides us with the flexibility that is needed to support
13752  multiple export formats.
13753  For instance, in the case of a plain text file, it is not exactly an award-winn
13754 ing idea to include the figure as raw PostScript.
13755  Instead, you'd either prefer to just include a reference to the figure
13756  or try to invoke some graphics to ASCII converter to make the final result
13757  look similar to the real graphics.
13758  The external material management allows you to do this, because it is parametri
13759 zed on the different export formats that LyX supports.
13760 \end_layout
13761
13762 \begin_layout Standard
13763 Besides supporting the production of different products according to the
13764  exported format, it supports tight integration with editing and viewing
13765  applications.
13766  In the case of an Xfig figure, you are able to invoke Xfig on the original
13767  file with a single click from within the external material dialog in LyX,
13768  and also preview the produced PostScript file with Ghostview with another
13769  click.
13770  No more fiddling around with the command line and/or file browsers to locate
13771  and manipulate the original or produced files.
13772  In this way, you are finally able to take full advantage of the many different
13773  applications that are relevant to use when you write your documents, and
13774  ultimately be more productive.
13775 \end_layout
13776
13777 \begin_layout Section
13778 The external template configuration file
13779 \end_layout
13780
13781 \begin_layout Standard
13782 It is relatively easy to add custom external template definitions to LyX.
13783  However, be aware that doing this in an careless manner most probably 
13784 \emph on
13785 will
13786 \emph default
13787  introduce an easily exploitable security hole.
13788  So before you do this, please read the discussion about security in section
13789  
13790 \begin_inset CommandInset ref
13791 LatexCommand ref
13792 reference "sec:Security-discussion"
13793
13794 \end_inset
13795
13796 .
13797 \end_layout
13798
13799 \begin_layout Standard
13800 Having said that, we encourage you to submit any interesting templates that
13801  you create.
13802  
13803 \end_layout
13804
13805 \begin_layout Standard
13806 The external templates are defined in the 
13807 \begin_inset Flex CharStyle:Code
13808 status collapsed
13809
13810 \begin_layout Plain Layout
13811 LyXDir/lib/external_templates
13812 \end_layout
13813
13814 \end_inset
13815
13816  file.
13817  You can place your own version in 
13818 \begin_inset Flex CharStyle:Code
13819 status collapsed
13820
13821 \begin_layout Plain Layout
13822 UserDir/external_templates
13823 \end_layout
13824
13825 \end_inset
13826
13827 .
13828 \end_layout
13829
13830 \begin_layout Standard
13831 A typical template looks like this:
13832 \end_layout
13833
13834 \begin_layout LyX-Code
13835 Template XFig
13836 \end_layout
13837
13838 \begin_layout LyX-Code
13839 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
13840 \end_layout
13841
13842 \begin_layout LyX-Code
13843 HelpText
13844 \end_layout
13845
13846 \begin_layout LyX-Code
13847 An XFig figure.
13848 \end_layout
13849
13850 \begin_layout LyX-Code
13851 HelpTextEnd
13852 \end_layout
13853
13854 \begin_layout LyX-Code
13855 InputFormat fig
13856 \end_layout
13857
13858 \begin_layout LyX-Code
13859 FileFilter "*.fig"
13860 \end_layout
13861
13862 \begin_layout LyX-Code
13863 AutomaticProduction true
13864 \end_layout
13865
13866 \begin_layout LyX-Code
13867 Transform Rotate
13868 \end_layout
13869
13870 \begin_layout LyX-Code
13871 Transform Resize
13872 \end_layout
13873
13874 \begin_layout LyX-Code
13875 Format LaTeX
13876 \end_layout
13877
13878 \begin_layout LyX-Code
13879 TransformCommand Rotate RotationLatexCommand
13880 \end_layout
13881
13882 \begin_layout LyX-Code
13883 TransformCommand Resize ResizeLatexCommand
13884 \end_layout
13885
13886 \begin_layout LyX-Code
13887 Product "$$RotateFront$$ResizeFront
13888 \end_layout
13889
13890 \begin_layout LyX-Code
13891          
13892 \backslash
13893
13894 \backslash
13895 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
13896 \end_layout
13897
13898 \begin_layout LyX-Code
13899          $$ResizeBack$$RotateBack"
13900 \end_layout
13901
13902 \begin_layout LyX-Code
13903 UpdateFormat pstex
13904 \end_layout
13905
13906 \begin_layout LyX-Code
13907 UpdateResult "$$AbsPath$$Basename.pstex_t"
13908 \end_layout
13909
13910 \begin_layout LyX-Code
13911 Requirement "graphicx"
13912 \end_layout
13913
13914 \begin_layout LyX-Code
13915 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
13916 \end_layout
13917
13918 \begin_layout LyX-Code
13919 ReferencedFile latex "$$AbsPath$$Basename.eps"
13920 \end_layout
13921
13922 \begin_layout LyX-Code
13923 ReferencedFile dvi "$$AbsPath$$Basename.eps"
13924 \end_layout
13925
13926 \begin_layout LyX-Code
13927 FormatEnd
13928 \end_layout
13929
13930 \begin_layout LyX-Code
13931 Format PDFLaTeX
13932 \end_layout
13933
13934 \begin_layout LyX-Code
13935 TransformCommand Rotate RotationLatexCommand
13936 \end_layout
13937
13938 \begin_layout LyX-Code
13939 TransformCommand Resize ResizeLatexCommand
13940 \end_layout
13941
13942 \begin_layout LyX-Code
13943 Product "$$RotateFront$$ResizeFront
13944 \end_layout
13945
13946 \begin_layout LyX-Code
13947          
13948 \backslash
13949
13950 \backslash
13951 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
13952 \end_layout
13953
13954 \begin_layout LyX-Code
13955          $$ResizeBack$$RotateBack"
13956 \end_layout
13957
13958 \begin_layout LyX-Code
13959 UpdateFormat pdftex
13960 \end_layout
13961
13962 \begin_layout LyX-Code
13963 UpdateResult "$$AbsPath$$Basename.pdftex_t"
13964 \end_layout
13965
13966 \begin_layout LyX-Code
13967 Requirement "graphicx"
13968 \end_layout
13969
13970 \begin_layout LyX-Code
13971 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
13972 \end_layout
13973
13974 \begin_layout LyX-Code
13975 ReferencedFile latex "$$AbsPath$$Basename.pdf"
13976 \end_layout
13977
13978 \begin_layout LyX-Code
13979 FormatEnd
13980 \end_layout
13981
13982 \begin_layout LyX-Code
13983 Format Ascii
13984 \end_layout
13985
13986 \begin_layout LyX-Code
13987 Product "$$Contents(
13988 \backslash
13989 "$$AbsPath$$Basename.asc
13990 \backslash
13991 ")"
13992 \end_layout
13993
13994 \begin_layout LyX-Code
13995 UpdateFormat asciixfig
13996 \end_layout
13997
13998 \begin_layout LyX-Code
13999 UpdateResult "$$AbsPath$$Basename.asc"
14000 \end_layout
14001
14002 \begin_layout LyX-Code
14003 FormatEnd
14004 \end_layout
14005
14006 \begin_layout LyX-Code
14007 Format DocBook
14008 \end_layout
14009
14010 \begin_layout LyX-Code
14011 Product "<graphic fileref=
14012 \backslash
14013 "$$AbsOrRelPathMaster$$Basename.eps
14014 \backslash
14015 ">
14016 \end_layout
14017
14018 \begin_layout LyX-Code
14019          </graphic>"
14020 \end_layout
14021
14022 \begin_layout LyX-Code
14023 UpdateFormat eps
14024 \end_layout
14025
14026 \begin_layout LyX-Code
14027 UpdateResult "$$AbsPath$$Basename.eps"
14028 \end_layout
14029
14030 \begin_layout LyX-Code
14031 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14032 \end_layout
14033
14034 \begin_layout LyX-Code
14035 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14036 \end_layout
14037
14038 \begin_layout LyX-Code
14039 FormatEnd
14040 \end_layout
14041
14042 \begin_layout LyX-Code
14043 Product "[XFig: $$FName]"
14044 \end_layout
14045
14046 \begin_layout LyX-Code
14047 FormatEnd
14048 \end_layout
14049
14050 \begin_layout LyX-Code
14051 TemplateEnd
14052 \end_layout
14053
14054 \begin_layout Standard
14055 As you can see, the template is enclosed in 
14056 \begin_inset Flex CharStyle:Code
14057 status collapsed
14058
14059 \begin_layout Plain Layout
14060 Template
14061 \end_layout
14062
14063 \end_inset
14064
14065  \SpecialChar \ldots{}
14066  
14067 \begin_inset Flex CharStyle:Code
14068 status collapsed
14069
14070 \begin_layout Plain Layout
14071 TemplateEnd
14072 \end_layout
14073
14074 \end_inset
14075
14076 .
14077  It contains a header specifying some general settings and, for each supported
14078  primary document file format, a section 
14079 \begin_inset Flex CharStyle:Code
14080 status collapsed
14081
14082 \begin_layout Plain Layout
14083 Format
14084 \end_layout
14085
14086 \end_inset
14087
14088  \SpecialChar \ldots{}
14089  
14090 \begin_inset Flex CharStyle:Code
14091 status collapsed
14092
14093 \begin_layout Plain Layout
14094 FormatEnd
14095 \end_layout
14096
14097 \end_inset
14098
14099 .
14100 \end_layout
14101
14102 \begin_layout Subsection
14103 The template header
14104 \end_layout
14105
14106 \begin_layout Description
14107 \begin_inset Flex CharStyle:Code
14108 status collapsed
14109
14110 \begin_layout Plain Layout
14111 AutomaticProduction
14112 \begin_inset space ~
14113 \end_inset
14114
14115 true|false
14116 \end_layout
14117
14118 \end_inset
14119
14120  Whether the file represented by the template must be generated by LyX.
14121  This command must occur exactly once.
14122 \end_layout
14123
14124 \begin_layout Description
14125 \begin_inset Flex CharStyle:Code
14126 status collapsed
14127
14128 \begin_layout Plain Layout
14129 FileFilter
14130 \begin_inset space ~
14131 \end_inset
14132
14133 <pattern>
14134 \end_layout
14135
14136 \end_inset
14137
14138  A glob pattern that is used in the file dialog to filter out the desired
14139  files.
14140  If there is more than one possible file extension (e.
14141 \begin_inset space \thinspace{}
14142 \end_inset
14143
14144 g.
14145 \begin_inset space \space{}
14146 \end_inset
14147
14148 tgif has 
14149 \begin_inset Flex CharStyle:Code
14150 status collapsed
14151
14152 \begin_layout Plain Layout
14153 .obj
14154 \end_layout
14155
14156 \end_inset
14157
14158  and 
14159 \begin_inset Flex CharStyle:Code
14160 status collapsed
14161
14162 \begin_layout Plain Layout
14163 .tgo
14164 \end_layout
14165
14166 \end_inset
14167
14168 ), use something like 
14169 \begin_inset Flex CharStyle:Code
14170 status collapsed
14171
14172 \begin_layout Plain Layout
14173 "*.{obj,tgo}"
14174 \end_layout
14175
14176 \end_inset
14177
14178 .
14179  This command must occur exactly once.
14180 \end_layout
14181
14182 \begin_layout Description
14183 \begin_inset Flex CharStyle:Code
14184 status collapsed
14185
14186 \begin_layout Plain Layout
14187 GuiName
14188 \begin_inset space ~
14189 \end_inset
14190
14191 <guiname>
14192 \end_layout
14193
14194 \end_inset
14195
14196  The text that is displayed on the button.
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 HelpText
14206 \begin_inset space ~
14207 \end_inset
14208
14209 <text>
14210 \begin_inset space ~
14211 \end_inset
14212
14213 HelpTextEnd
14214 \end_layout
14215
14216 \end_inset
14217
14218  The help text that is used in the External dialog.
14219  Provide enough information to explain to the user just what the template
14220  can provide him with.
14221  This command must occur exactly once.
14222 \end_layout
14223
14224 \begin_layout Description
14225 \begin_inset Flex CharStyle:Code
14226 status collapsed
14227
14228 \begin_layout Plain Layout
14229 InputFormat
14230 \begin_inset space ~
14231 \end_inset
14232
14233 <format>
14234 \end_layout
14235
14236 \end_inset
14237
14238  The file format of the original file.
14239  This must be the name of a format that is known to LyX (see section 
14240 \begin_inset CommandInset ref
14241 LatexCommand ref
14242 reference "sub:Formats"
14243
14244 \end_inset
14245
14246 ).
14247  Use 
14248 \begin_inset Quotes eld
14249 \end_inset
14250
14251
14252 \begin_inset Flex CharStyle:Code
14253 status collapsed
14254
14255 \begin_layout Plain Layout
14256 *
14257 \end_layout
14258
14259 \end_inset
14260
14261
14262 \begin_inset Quotes erd
14263 \end_inset
14264
14265  if the template can handle original files of more than one format.
14266  LyX will attempt to interrogate the file itself in order to deduce its
14267  format in this case.
14268  This command must occur exactly once.
14269 \end_layout
14270
14271 \begin_layout Description
14272 \begin_inset Flex CharStyle:Code
14273 status collapsed
14274
14275 \begin_layout Plain Layout
14276 Template
14277 \begin_inset space ~
14278 \end_inset
14279
14280 <id>
14281 \end_layout
14282
14283 \end_inset
14284
14285  A unique name for the template.
14286  It must not contain substitution macros (see below).
14287 \end_layout
14288
14289 \begin_layout Description
14290 \begin_inset Flex CharStyle:Code
14291 status collapsed
14292
14293 \begin_layout Plain Layout
14294 Transform
14295 \begin_inset space ~
14296 \end_inset
14297
14298 Rotate|Resize|Clip|Extra
14299 \end_layout
14300
14301 \end_inset
14302
14303  This command specifies which transformations are supported by this template.
14304  It may occur zero or more times.
14305  This command enables the corresponding tabs in the external dialog.
14306  Each 
14307 \begin_inset Flex CharStyle:Code
14308 status collapsed
14309
14310 \begin_layout Plain Layout
14311 Transform
14312 \end_layout
14313
14314 \end_inset
14315
14316  command must have either a corresponding 
14317 \begin_inset Flex CharStyle:Code
14318 status collapsed
14319
14320 \begin_layout Plain Layout
14321 TransformCommand
14322 \end_layout
14323
14324 \end_inset
14325
14326  or a 
14327 \begin_inset Flex CharStyle:Code
14328 status collapsed
14329
14330 \begin_layout Plain Layout
14331 TransformOption
14332 \end_layout
14333
14334 \end_inset
14335
14336  command in the 
14337 \begin_inset Flex CharStyle:Code
14338 status collapsed
14339
14340 \begin_layout Plain Layout
14341 Format
14342 \end_layout
14343
14344 \end_inset
14345
14346  section.
14347  Otherwise the transformation will not be supported by that format.
14348 \end_layout
14349
14350 \begin_layout Subsection
14351 The Format section
14352 \end_layout
14353
14354 \begin_layout Description
14355 \begin_inset Flex CharStyle:Code
14356 status collapsed
14357
14358 \begin_layout Plain Layout
14359 Format
14360 \begin_inset space ~
14361 \end_inset
14362
14363 LaTeX|PDFLaTeX|PlainText|DocBook
14364 \end_layout
14365
14366 \end_inset
14367
14368  The primary document file format that this format definition is for.
14369  Not every template has a sensible representation in all document file formats.
14370  Please define nevertheless a 
14371 \begin_inset Flex CharStyle:Code
14372 status collapsed
14373
14374 \begin_layout Plain Layout
14375 Format
14376 \end_layout
14377
14378 \end_inset
14379
14380  section for all formats.
14381  Use a dummy text when no representation is available.
14382  Then you can at least see a reference to the external material in the exported
14383  document.
14384 \end_layout
14385
14386 \begin_layout Description
14387 \begin_inset Flex CharStyle:Code
14388 status collapsed
14389
14390 \begin_layout Plain Layout
14391 Option
14392 \begin_inset space ~
14393 \end_inset
14394
14395 <name>
14396 \begin_inset space ~
14397 \end_inset
14398
14399 <value>
14400 \end_layout
14401
14402 \end_inset
14403
14404  This command defines an additional macro 
14405 \begin_inset Flex CharStyle:Code
14406 status collapsed
14407
14408 \begin_layout Plain Layout
14409 $$<name>
14410 \end_layout
14411
14412 \end_inset
14413
14414  for substitution in 
14415 \begin_inset Flex CharStyle:Code
14416 status collapsed
14417
14418 \begin_layout Plain Layout
14419 Product
14420 \end_layout
14421
14422 \end_inset
14423
14424 .
14425  
14426 \begin_inset Flex CharStyle:Code
14427 status collapsed
14428
14429 \begin_layout Plain Layout
14430 <value>
14431 \end_layout
14432
14433 \end_inset
14434
14435  itself may contain substitution macros.
14436  The advantage over using 
14437 \begin_inset Flex CharStyle:Code
14438 status collapsed
14439
14440 \begin_layout Plain Layout
14441 <value>
14442 \end_layout
14443
14444 \end_inset
14445
14446  directly in 
14447 \begin_inset Flex CharStyle:Code
14448 status collapsed
14449
14450 \begin_layout Plain Layout
14451 Product
14452 \end_layout
14453
14454 \end_inset
14455
14456  is that the substituted value of 
14457 \begin_inset Flex CharStyle:Code
14458 status collapsed
14459
14460 \begin_layout Plain Layout
14461 $$<name>
14462 \end_layout
14463
14464 \end_inset
14465
14466  is sanitized so that it is a valid optional argument in the document format.
14467  This command may occur zero or more times.
14468 \end_layout
14469
14470 \begin_layout Description
14471 \begin_inset Flex CharStyle:Code
14472 status collapsed
14473
14474 \begin_layout Plain Layout
14475 Product
14476 \begin_inset space ~
14477 \end_inset
14478
14479 <text>
14480 \end_layout
14481
14482 \end_inset
14483
14484  The text that is inserted in the exported document.
14485  This is actually the most important command and can be quite complex.
14486  This command must occur exactly once.
14487 \end_layout
14488
14489 \begin_layout Description
14490 \begin_inset Flex CharStyle:Code
14491 status collapsed
14492
14493 \begin_layout Plain Layout
14494 Preamble
14495 \begin_inset space ~
14496 \end_inset
14497
14498 <name>
14499 \end_layout
14500
14501 \end_inset
14502
14503  This command specifies a preamble snippet that will be included in the
14504  LaTeX preamble.
14505  It has to be defined using 
14506 \begin_inset Flex CharStyle:Code
14507 status collapsed
14508
14509 \begin_layout Plain Layout
14510 PreambleDef
14511 \end_layout
14512
14513 \end_inset
14514
14515  \SpecialChar \ldots{}
14516  
14517 \begin_inset Flex CharStyle:Code
14518 status collapsed
14519
14520 \begin_layout Plain Layout
14521 PreambleDefEnd
14522 \end_layout
14523
14524 \end_inset
14525
14526 .
14527  This command may occur 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 ReferencedFile
14536 \begin_inset space ~
14537 \end_inset
14538
14539 <format>
14540 \begin_inset space ~
14541 \end_inset
14542
14543 <filename>
14544 \end_layout
14545
14546 \end_inset
14547
14548  This command denotes files that are created by the conversion process and
14549  are needed for a particular export format.
14550  If the filename is relative, it is interpreted relative to the master document.
14551  This command may be given zero or more times.
14552 \end_layout
14553
14554 \begin_layout Description
14555 \begin_inset Flex CharStyle:Code
14556 status collapsed
14557
14558 \begin_layout Plain Layout
14559 Requirement
14560 \begin_inset space ~
14561 \end_inset
14562
14563 <package>
14564 \end_layout
14565
14566 \end_inset
14567
14568  The name of a required LaTeX package.
14569  The package is included via 
14570 \begin_inset Flex CharStyle:Code
14571 status collapsed
14572
14573 \begin_layout Plain Layout
14574
14575 \backslash
14576 usepackage{}
14577 \end_layout
14578
14579 \end_inset
14580
14581  in the LaTeX preamble.
14582  This command may occur zero or more times.
14583 \end_layout
14584
14585 \begin_layout Description
14586 \begin_inset Flex CharStyle:Code
14587 status collapsed
14588
14589 \begin_layout Plain Layout
14590 TransformCommand
14591 \begin_inset space ~
14592 \end_inset
14593
14594 Rotate
14595 \begin_inset space ~
14596 \end_inset
14597
14598 RotationLatexCommand
14599 \end_layout
14600
14601 \end_inset
14602
14603  This command specifies that the built in LaTeX command should be used for
14604  rotation.
14605  This command may occur once or not at all.
14606 \end_layout
14607
14608 \begin_layout Description
14609 \begin_inset Flex CharStyle:Code
14610 status collapsed
14611
14612 \begin_layout Plain Layout
14613 TransformCommand
14614 \begin_inset space ~
14615 \end_inset
14616
14617 Resize
14618 \begin_inset space ~
14619 \end_inset
14620
14621 ResizeLatexCommand
14622 \end_layout
14623
14624 \end_inset
14625
14626  This command specifies that the built in LaTeX command should be used for
14627  resizing.
14628  This command may occur once or not at all.
14629 \end_layout
14630
14631 \begin_layout Description
14632 \begin_inset Flex CharStyle:Code
14633 status collapsed
14634
14635 \begin_layout Plain Layout
14636 TransformOption
14637 \begin_inset space ~
14638 \end_inset
14639
14640 Rotate
14641 \begin_inset space ~
14642 \end_inset
14643
14644 RotationLatexOption
14645 \end_layout
14646
14647 \end_inset
14648
14649  This command specifies that rotation is done via an optional argument.
14650  This command may occur once or not at all.
14651 \end_layout
14652
14653 \begin_layout Description
14654 \begin_inset Flex CharStyle:Code
14655 status collapsed
14656
14657 \begin_layout Plain Layout
14658 TransformOption
14659 \begin_inset space ~
14660 \end_inset
14661
14662 Resize
14663 \begin_inset space ~
14664 \end_inset
14665
14666 ResizeLatexOption
14667 \end_layout
14668
14669 \end_inset
14670
14671  This command specifies that resizing is done via an optional argument.
14672  This command may occur once or not at all.
14673 \end_layout
14674
14675 \begin_layout Description
14676 \begin_inset Flex CharStyle:Code
14677 status collapsed
14678
14679 \begin_layout Plain Layout
14680 TransformOption
14681 \begin_inset space ~
14682 \end_inset
14683
14684 Clip
14685 \begin_inset space ~
14686 \end_inset
14687
14688 ClipLatexOption
14689 \end_layout
14690
14691 \end_inset
14692
14693  This command specifies that clipping is done via an optional argument.
14694  This command may occur once or not at all.
14695 \end_layout
14696
14697 \begin_layout Description
14698 \begin_inset Flex CharStyle:Code
14699 status collapsed
14700
14701 \begin_layout Plain Layout
14702 TransformOption
14703 \begin_inset space ~
14704 \end_inset
14705
14706 Extra
14707 \begin_inset space ~
14708 \end_inset
14709
14710 ExtraLatexOption
14711 \end_layout
14712
14713 \end_inset
14714
14715  This command specifies that an extra optional argument is used.
14716  This command may occur once or not at all.
14717 \end_layout
14718
14719 \begin_layout Description
14720 \begin_inset Flex CharStyle:Code
14721 status collapsed
14722
14723 \begin_layout Plain Layout
14724 UpdateFormat
14725 \begin_inset space ~
14726 \end_inset
14727
14728 <format>
14729 \end_layout
14730
14731 \end_inset
14732
14733  The file format of the converted file.
14734  This must be the name of a format that is known to LyX (see the 
14735 \begin_inset Flex CharStyle:MenuItem
14736 status collapsed
14737
14738 \begin_layout Plain Layout
14739
14740 \bar under
14741 T
14742 \bar default
14743 ools\SpecialChar \menuseparator
14744
14745 \bar under
14746 P
14747 \bar default
14748 references:Conversion
14749 \end_layout
14750
14751 \end_inset
14752
14753  dialog).
14754  This command must occur exactly once.
14755 \end_layout
14756
14757 \begin_layout Description
14758 \begin_inset Flex CharStyle:Code
14759 status collapsed
14760
14761 \begin_layout Plain Layout
14762 UpdateResult
14763 \begin_inset space ~
14764 \end_inset
14765
14766 <filename>
14767 \end_layout
14768
14769 \end_inset
14770
14771  The file name of the converted file.
14772  The file name must be absolute.
14773  This command must occur exactly once.
14774 \end_layout
14775
14776 \begin_layout Subsection
14777 Preamble definitions
14778 \end_layout
14779
14780 \begin_layout Standard
14781 The external template configuration file may contain additional preamble
14782  definitions enclosed by 
14783 \begin_inset Flex CharStyle:Code
14784 status collapsed
14785
14786 \begin_layout Plain Layout
14787 PreambleDef
14788 \end_layout
14789
14790 \end_inset
14791
14792  \SpecialChar \ldots{}
14793  
14794 \begin_inset Flex CharStyle:Code
14795 status collapsed
14796
14797 \begin_layout Plain Layout
14798 PreambleDefEnd
14799 \end_layout
14800
14801 \end_inset
14802
14803 .
14804  They can be used by the templates in the 
14805 \begin_inset Flex CharStyle:Code
14806 status collapsed
14807
14808 \begin_layout Plain Layout
14809 Format
14810 \end_layout
14811
14812 \end_inset
14813
14814  section.
14815 \end_layout
14816
14817 \begin_layout Section
14818 The substitution mechanism
14819 \end_layout
14820
14821 \begin_layout Standard
14822 When the external material facility invokes an external program, it is done
14823  on the basis of a command defined in the template configuration file.
14824  These commands can contain various macros that are expanded before execution.
14825  Execution always take place in the directory of the containing document.
14826 \end_layout
14827
14828 \begin_layout Standard
14829 Also, whenever external material is to be displayed, the name will be produced
14830  by the substitution mechanism, and most other commands in the template
14831  definition support substitution as well.
14832 \end_layout
14833
14834 \begin_layout Standard
14835 The available macros are the following:
14836 \end_layout
14837
14838 \begin_layout Description
14839 \begin_inset Flex CharStyle:Code
14840 status collapsed
14841
14842 \begin_layout Plain Layout
14843 $$AbsOrRelPathMaster
14844 \end_layout
14845
14846 \end_inset
14847
14848  The file path, absolute or relative to the master LyX document.
14849 \end_layout
14850
14851 \begin_layout Description
14852 \begin_inset Flex CharStyle:Code
14853 status collapsed
14854
14855 \begin_layout Plain Layout
14856 $$AbsOrRelPathParent
14857 \end_layout
14858
14859 \end_inset
14860
14861  The file path, absolute or relative to the LyX document.
14862 \end_layout
14863
14864 \begin_layout Description
14865 \begin_inset Flex CharStyle:Code
14866 status collapsed
14867
14868 \begin_layout Plain Layout
14869 $$AbsPath
14870 \end_layout
14871
14872 \end_inset
14873
14874  The absolute file path.
14875 \end_layout
14876
14877 \begin_layout Description
14878 \begin_inset Flex CharStyle:Code
14879 status collapsed
14880
14881 \begin_layout Plain Layout
14882 $$Basename
14883 \end_layout
14884
14885 \end_inset
14886
14887  The filename without path and without the extension.
14888 \end_layout
14889
14890 \begin_layout Description
14891 \begin_inset Flex CharStyle:Code
14892 status collapsed
14893
14894 \begin_layout Plain Layout
14895 $$Contents(
14896 \begin_inset Quotes eld
14897 \end_inset
14898
14899 filename.ext
14900 \begin_inset Quotes erd
14901 \end_inset
14902
14903 )
14904 \end_layout
14905
14906 \end_inset
14907
14908  This macro will expand to the contents of the file with the name 
14909 \begin_inset Flex CharStyle:Code
14910 status collapsed
14911
14912 \begin_layout Plain Layout
14913 filename.ext
14914 \end_layout
14915
14916 \end_inset
14917
14918 .
14919 \end_layout
14920
14921 \begin_layout Description
14922 \begin_inset Flex CharStyle:Code
14923 status collapsed
14924
14925 \begin_layout Plain Layout
14926 $$Extension
14927 \end_layout
14928
14929 \end_inset
14930
14931  The file extension (including the dot).
14932 \end_layout
14933
14934 \begin_layout Description
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  The filename of the file specified in the external material dialog.
14945  This is either an absolute name, or it is relative to the LyX document.
14946 \end_layout
14947
14948 \begin_layout Description
14949 \begin_inset Flex CharStyle:Code
14950 status collapsed
14951
14952 \begin_layout Plain Layout
14953 $$FPath
14954 \end_layout
14955
14956 \end_inset
14957
14958  The path part of 
14959 \begin_inset Flex CharStyle:Code
14960 status collapsed
14961
14962 \begin_layout Plain Layout
14963 $$FName
14964 \end_layout
14965
14966 \end_inset
14967
14968  (absolute name or relative to the LyX document).
14969 \end_layout
14970
14971 \begin_layout Description
14972 \begin_inset Flex CharStyle:Code
14973 status collapsed
14974
14975 \begin_layout Plain Layout
14976 $$RelPathMaster
14977 \end_layout
14978
14979 \end_inset
14980
14981  The file path, relative to the master LyX document.
14982 \end_layout
14983
14984 \begin_layout Description
14985 \begin_inset Flex CharStyle:Code
14986 status collapsed
14987
14988 \begin_layout Plain Layout
14989 $$RelPathParent
14990 \end_layout
14991
14992 \end_inset
14993
14994  The file path, relative to the LyX document.
14995 \end_layout
14996
14997 \begin_layout Description
14998 \begin_inset Flex CharStyle:Code
14999 status collapsed
15000
15001 \begin_layout Plain Layout
15002 $$Sysdir
15003 \end_layout
15004
15005 \end_inset
15006
15007  This macro will expand to the absolute path of the system directory.
15008  This is typically used to point to the various helper scripts that are
15009  bundled with LyX.
15010 \end_layout
15011
15012 \begin_layout Description
15013 \begin_inset Flex CharStyle:Code
15014 status collapsed
15015
15016 \begin_layout Plain Layout
15017 $$Tempname
15018 \end_layout
15019
15020 \end_inset
15021
15022  A name and full path to a temporary file which will be automatically deleted
15023  whenever the containing document is closed, or the external material insertion
15024  deleted.
15025 \end_layout
15026
15027 \begin_layout Standard
15028 All path macros contain a trailing directory separator, so you can construct
15029  e.
15030 \begin_inset space \thinspace{}
15031 \end_inset
15032
15033 g.
15034 \begin_inset space \space{}
15035 \end_inset
15036
15037 the absolute filename with 
15038 \begin_inset Flex CharStyle:Code
15039 status collapsed
15040
15041 \begin_layout Plain Layout
15042 $$AbsPath$$Basename$$Extension
15043 \end_layout
15044
15045 \end_inset
15046
15047 .
15048 \end_layout
15049
15050 \begin_layout Standard
15051 The macros above are substituted in all commands unless otherwise noted.
15052  The command 
15053 \begin_inset Flex CharStyle:Code
15054 status collapsed
15055
15056 \begin_layout Plain Layout
15057 Product
15058 \end_layout
15059
15060 \end_inset
15061
15062  supports additionally the following substitutions if they are enabled by
15063  the 
15064 \begin_inset Flex CharStyle:Code
15065 status collapsed
15066
15067 \begin_layout Plain Layout
15068 Transform
15069 \end_layout
15070
15071 \end_inset
15072
15073  and 
15074 \begin_inset Flex CharStyle:Code
15075 status collapsed
15076
15077 \begin_layout Plain Layout
15078 TransformCommand
15079 \end_layout
15080
15081 \end_inset
15082
15083  commands:
15084 \end_layout
15085
15086 \begin_layout Description
15087 \begin_inset Flex CharStyle:Code
15088 status collapsed
15089
15090 \begin_layout Plain Layout
15091 $$ResizeFront
15092 \end_layout
15093
15094 \end_inset
15095
15096  The front part of the resize command.
15097 \end_layout
15098
15099 \begin_layout Description
15100 \begin_inset Flex CharStyle:Code
15101 status collapsed
15102
15103 \begin_layout Plain Layout
15104 $$ResizeBack
15105 \end_layout
15106
15107 \end_inset
15108
15109  The back part of the resize command.
15110 \end_layout
15111
15112 \begin_layout Description
15113 \begin_inset Flex CharStyle:Code
15114 status collapsed
15115
15116 \begin_layout Plain Layout
15117 $$RotateFront
15118 \end_layout
15119
15120 \end_inset
15121
15122  The front part of the rotation command.
15123 \end_layout
15124
15125 \begin_layout Description
15126 \begin_inset Flex CharStyle:Code
15127 status collapsed
15128
15129 \begin_layout Plain Layout
15130 $$RotateBack
15131 \end_layout
15132
15133 \end_inset
15134
15135  The back part of the rotation command.
15136 \end_layout
15137
15138 \begin_layout Standard
15139 The value string of the 
15140 \begin_inset Flex CharStyle:Code
15141 status collapsed
15142
15143 \begin_layout Plain Layout
15144 Option
15145 \end_layout
15146
15147 \end_inset
15148
15149  command supports additionally the following substitutions if they are enabled
15150  by the 
15151 \begin_inset Flex CharStyle:Code
15152 status collapsed
15153
15154 \begin_layout Plain Layout
15155 Transform
15156 \end_layout
15157
15158 \end_inset
15159
15160  and 
15161 \begin_inset Flex CharStyle:Code
15162 status collapsed
15163
15164 \begin_layout Plain Layout
15165 TransformOption
15166 \end_layout
15167
15168 \end_inset
15169
15170  commands:
15171 \end_layout
15172
15173 \begin_layout Description
15174 \begin_inset Flex CharStyle:Code
15175 status collapsed
15176
15177 \begin_layout Plain Layout
15178 $$Clip
15179 \end_layout
15180
15181 \end_inset
15182
15183  The clip option.
15184 \end_layout
15185
15186 \begin_layout Description
15187 \begin_inset Flex CharStyle:Code
15188 status collapsed
15189
15190 \begin_layout Plain Layout
15191 $$Extra
15192 \end_layout
15193
15194 \end_inset
15195
15196  The extra option.
15197 \end_layout
15198
15199 \begin_layout Description
15200 \begin_inset Flex CharStyle:Code
15201 status collapsed
15202
15203 \begin_layout Plain Layout
15204 $$Resize
15205 \end_layout
15206
15207 \end_inset
15208
15209  The resize option.
15210 \end_layout
15211
15212 \begin_layout Description
15213 \begin_inset Flex CharStyle:Code
15214 status collapsed
15215
15216 \begin_layout Plain Layout
15217 $$Rotate
15218 \end_layout
15219
15220 \end_inset
15221
15222  The rotation option.
15223 \end_layout
15224
15225 \begin_layout Standard
15226 You may ask why there are so many path macros.
15227  There are mainly two reasons:
15228 \end_layout
15229
15230 \begin_layout Enumerate
15231 Relative and absolute file names should remain relative or absolute, respectivel
15232 y.
15233  Users may have reasons to prefer either form.
15234  Relative names are useful for portable documents that should work on different
15235  machines, for example.
15236  Absolute names may be required by some programs.
15237 \end_layout
15238
15239 \begin_layout Enumerate
15240 LaTeX treats relative file names differently than LyX and other programs
15241  in nested included files.
15242  For LyX, a relative file name is always relative to the document that contains
15243  the file name.
15244  For LaTeX, it is always relative to the master document.
15245  These two definitions are identical if you have only one document, but
15246  differ if you have a master document that includes part documents.
15247  That means that relative filenames must be transformed when presented to
15248  LaTeX.
15249  Fortunately LyX does this automatically for you if you choose the right
15250  macros.
15251 \end_layout
15252
15253 \begin_layout Standard
15254 So which path macro should be used in new template definitions? The rule
15255  is not difficult:
15256 \end_layout
15257
15258 \begin_layout Itemize
15259 Use 
15260 \begin_inset Flex CharStyle:Code
15261 status collapsed
15262
15263 \begin_layout Plain Layout
15264 $$AbsPath
15265 \end_layout
15266
15267 \end_inset
15268
15269  if an absolute path is required.
15270 \end_layout
15271
15272 \begin_layout Itemize
15273 Use 
15274 \begin_inset Flex CharStyle:Code
15275 status collapsed
15276
15277 \begin_layout Plain Layout
15278 $$AbsOrRelPathMaster
15279 \end_layout
15280
15281 \end_inset
15282
15283  if the substituted string is some kind of LaTeX input.
15284 \end_layout
15285
15286 \begin_layout Itemize
15287 Else use 
15288 \begin_inset Flex CharStyle:Code
15289 status collapsed
15290
15291 \begin_layout Plain Layout
15292 $$AbsOrRelPathParent
15293 \end_layout
15294
15295 \end_inset
15296
15297  in order to preserve the user's choice.
15298 \end_layout
15299
15300 \begin_layout Standard
15301 There are special cases where this rule does not work and e.
15302 \begin_inset space \thinspace{}
15303 \end_inset
15304
15305 g.
15306 \begin_inset space \space{}
15307 \end_inset
15308
15309 relative names are needed, but normally it will work just fine.
15310  One example for such a case is the command 
15311 \begin_inset Flex CharStyle:Code
15312 status collapsed
15313
15314 \begin_layout Plain Layout
15315 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15316 \end_layout
15317
15318 \end_inset
15319
15320  in the XFig template above: We can't use the absolute name because the
15321  copier for 
15322 \begin_inset Flex CharStyle:Code
15323 status collapsed
15324
15325 \begin_layout Plain Layout
15326 .pstex_t
15327 \end_layout
15328
15329 \end_inset
15330
15331  files needs the relative name in order to rewrite the file content.
15332 \end_layout
15333
15334 \begin_layout Section
15335 \begin_inset CommandInset label
15336 LatexCommand label
15337 name "sec:Security-discussion"
15338
15339 \end_inset
15340
15341 Security discussion
15342 \end_layout
15343
15344 \begin_layout Standard
15345 \begin_inset Box Shadowbox
15346 position "t"
15347 hor_pos "c"
15348 has_inner_box 1
15349 inner_pos "t"
15350 use_parbox 0
15351 width "100col%"
15352 special "none"
15353 height "1in"
15354 height_special "totalheight"
15355 status open
15356
15357 \begin_layout Plain Layout
15358 WARNING: This section is definitely outdated.
15359 \end_layout
15360
15361 \end_inset
15362
15363
15364 \end_layout
15365
15366 \begin_layout Standard
15367 The external material feature interfaces with a lot of external programs
15368  and does so automatically, so we have to consider the security implications
15369  of this.
15370  In particular, since you have the option of including your own filenames
15371  and/or parameter strings and those are expanded into a command, it seems
15372  that it would be possible to create a malicious document which executes
15373  arbitrary commands when a user views or prints the document.
15374  This is something we definitely want to avoid.
15375 \end_layout
15376
15377 \begin_layout Standard
15378 However, since the external program commands are specified in the template
15379  configuration file only, there are no security issues if LyX is properly
15380  configured with safe templates only.
15381  This is so because the external programs are invoked with the 
15382 \begin_inset Flex CharStyle:Code
15383 status collapsed
15384
15385 \begin_layout Plain Layout
15386 execvp
15387 \end_layout
15388
15389 \end_inset
15390
15391 -system call rather than the 
15392 \begin_inset Flex CharStyle:Code
15393 status collapsed
15394
15395 \begin_layout Plain Layout
15396 system
15397 \end_layout
15398
15399 \end_inset
15400
15401  system-call, so it's not possible to execute arbitrary commands from the
15402  filename or parameter section via the shell.
15403 \end_layout
15404
15405 \begin_layout Standard
15406 This also implies that you are restricted in what command strings you can
15407  use in the external material templates.
15408  In particular, pipes and redirection are not readily available.
15409  This has to be so if LyX should remain safe.
15410  If you want to use some of the shell features, you should write a safe
15411  script to do this in a controlled manner, and then invoke the script from
15412  the command string.
15413  In the 
15414 \begin_inset Flex CharStyle:Code
15415 status collapsed
15416
15417 \begin_layout Plain Layout
15418 lib/scripts
15419 \end_layout
15420
15421 \end_inset
15422
15423  directory of the LyX installation, you can find a safe wrapper script 
15424 \begin_inset Flex CharStyle:Code
15425 status collapsed
15426
15427 \begin_layout Plain Layout
15428 general_command_wrapper.py
15429 \end_layout
15430
15431 \end_inset
15432
15433  that supports redirection of input and output.
15434  That can serve as an example for how to write safe template scripts.
15435  For a more advanced example that uses 
15436 \begin_inset Flex CharStyle:Code
15437 status collapsed
15438
15439 \begin_layout Plain Layout
15440 fork
15441 \end_layout
15442
15443 \end_inset
15444
15445  and friends, take a look at the 
15446 \begin_inset Flex CharStyle:Code
15447 status collapsed
15448
15449 \begin_layout Plain Layout
15450 pic2ascii.py
15451 \end_layout
15452
15453 \end_inset
15454
15455  converter script.
15456 \end_layout
15457
15458 \begin_layout Standard
15459 It is possible to design a template that interacts directly with the shell,
15460  but since this would allow a malicious user to execute arbitrary commands
15461  by writing clever filenames and/or parameters, we generally recommend that
15462  you only use safe scripts that work with the 
15463 \begin_inset Flex CharStyle:Code
15464 status collapsed
15465
15466 \begin_layout Plain Layout
15467 execvp
15468 \end_layout
15469
15470 \end_inset
15471
15472  system call in a controlled manner.
15473  Of course, for use in a controlled environment, it can be tempting to just
15474  fall back to use ordinary shell scripts.
15475  If you do so, be aware that you 
15476 \emph on
15477 will
15478 \emph default
15479  provide an easily exploitable security hole in your system.
15480  Of course it stands to reason that such unsafe templates will never be
15481  included in the standard LyX distribution, although we do encourage people
15482  to submit new templates in the open source tradition.
15483  But LyX as shipped from the official distribution channels will never have
15484  unsafe templates.
15485 \end_layout
15486
15487 \begin_layout Standard
15488 Including external material provides a lot of power, and you have to be
15489  careful not to introduce security hazards with this power.
15490  A subtle error in a single line in an innocent looking script can open
15491  the door to huge security problems.
15492  So if you do not fully understand the issues, we recommend that you consult
15493  a knowledgeable security professional or the LyX development team if you
15494  have any questions about whether a given template is safe or not.
15495  And do this before you use it in an uncontrolled environment.
15496 \end_layout
15497
15498 \end_body
15499 \end_document