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