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