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