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