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