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