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