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