]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
4a3aa122e0dbd145135b20ca048a09dca1d7f21d
[lyx.git] / lib / doc / Customization.lyx
1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
2 \lyxformat 348
3 \begin_document
4 \begin_header
5 \textclass scrbook
6 \begin_preamble
7 % DO NOT ALTER THIS PREAMBLE!!!
8 %
9 % This preamble is designed to ensure that the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected.  If you
12 % have problems LaTeXing this file, please contact 
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
15
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
18
19  % set fonts for nicer pdf view
20  \IfFileExists{lmodern.sty}
21   {\usepackage{lmodern}}{}
22
23 \fi % end if pdflatex is used
24
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
29   \frontmatter
30   \pdfbookmark[1]{\contentsname}{}
31   \myTOC
32   \mainmatter }
33
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36   L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
37   {LyX}}
38
39 % used for multi-column text
40 \usepackage{multicol}
41 \usepackage{inputenc}
42 \end_preamble
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
45 \begin_modules
46 logicalmkup
47 \end_modules
48 \begin_local_layout
49 Format 7
50 InsetLayout CharStyle:MenuItem
51 LyxType               charstyle
52 LabelString           menu
53 LatexType             command
54 LatexName             menuitem
55 Font
56 Family              Sans
57 EndFont
58 Preamble
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
60 EndPreamble
61 End
62 \end_local_layout
63 \language english
64 \inputencoding auto
65 \font_roman default
66 \font_sans default
67 \font_typewriter default
68 \font_default_family default
69 \font_sc false
70 \font_osf false
71 \font_sf_scale 100
72 \font_tt_scale 100
73
74 \graphics default
75 \paperfontsize 12
76 \spacing single
77 \use_hyperref true
78 \pdf_title "LyX Configuration Manual"
79 \pdf_author "LyX Team"
80 \pdf_subject "LyX-documentation Customization"
81 \pdf_keywords "LyX, documentation, customization"
82 \pdf_bookmarks true
83 \pdf_bookmarksnumbered true
84 \pdf_bookmarksopen true
85 \pdf_bookmarksopenlevel 1
86 \pdf_breaklinks false
87 \pdf_pdfborder false
88 \pdf_colorlinks true
89 \pdf_backref false
90 \pdf_pdfusetitle false
91 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
92 \papersize default
93 \use_geometry false
94 \use_amsmath 0
95 \use_esint 0
96 \cite_engine basic
97 \use_bibtopic false
98 \paperorientation portrait
99 \branch OutDated
100 \selected 0
101 \color #f5fae7
102 \end_branch
103 \secnumdepth 3
104 \tocdepth 3
105 \paragraph_separation indent
106 \defskip medskip
107 \quotes_language english
108 \papercolumns 1
109 \papersides 2
110 \paperpagestyle headings
111 \tracking_changes false
112 \output_changes false
113 \author "" 
114 \author "" 
115 \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 2.0.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 12.
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 I18NPreamble
8893 \end_layout
8894
8895 \end_inset
8896
8897  Language dependent information to be included in the LaTeX preamble when
8898  this style is used.
8899  Note that this will completely override any prior 
8900 \begin_inset Flex CharStyle:Code
8901 status collapsed
8902
8903 \begin_layout Plain Layout
8904 I18NPreamble
8905 \end_layout
8906
8907 \end_inset
8908
8909  declarations.
8910  Must end with 
8911 \begin_inset Quotes eld
8912 \end_inset
8913
8914
8915 \begin_inset Flex CharStyle:Code
8916 status collapsed
8917
8918 \begin_layout Plain Layout
8919 EndI18NPreamble
8920 \end_layout
8921
8922 \end_inset
8923
8924
8925 \begin_inset Quotes erd
8926 \end_inset
8927
8928 .
8929  The contents of this tag will occur once in the LaTeX preamble for each
8930  language used by the document.
8931  Each time, the following substitutions are made:
8932 \end_layout
8933
8934 \begin_deeper
8935 \begin_layout Itemize
8936 \begin_inset Flex CharStyle:Code
8937 status collapsed
8938
8939 \begin_layout Plain Layout
8940 $$lang
8941 \end_layout
8942
8943 \end_inset
8944
8945  is replaced by the language name (as used by the babel package).
8946 \end_layout
8947
8948 \begin_layout Itemize
8949 The 
8950 \begin_inset Quotes eld
8951 \end_inset
8952
8953 Function
8954 \begin_inset Quotes erd
8955 \end_inset
8956
8957  
8958 \begin_inset Flex CharStyle:Code
8959 status collapsed
8960
8961 \begin_layout Plain Layout
8962 _()
8963 \end_layout
8964
8965 \end_inset
8966
8967  replaces its argument by the translation of the argument to the current
8968  language.
8969 \end_layout
8970
8971 \begin_layout Standard
8972 If the style defines text that appears in the typeset document, it may use
8973  
8974 \begin_inset Flex CharStyle:Code
8975 status collapsed
8976
8977 \begin_layout Plain Layout
8978 I18NPreamble
8979 \end_layout
8980
8981 \end_inset
8982
8983  to support non-english and even multilanguage documents correctly.
8984  The following excerpt (from the 
8985 \begin_inset Flex CharStyle:Code
8986 status collapsed
8987
8988 \begin_layout Plain Layout
8989 theorems-ams.inc
8990 \end_layout
8991
8992 \end_inset
8993
8994  file) shows how this works:
8995 \end_layout
8996
8997 \begin_layout LyX-Code
8998 Preamble
8999 \end_layout
9000
9001 \begin_layout LyX-Code
9002   
9003 \backslash
9004 providecommand{
9005 \backslash
9006 claimname}{Claim}
9007 \end_layout
9008
9009 \begin_layout LyX-Code
9010   
9011 \backslash
9012 theoremstyle{remark}
9013 \end_layout
9014
9015 \begin_layout LyX-Code
9016   
9017 \backslash
9018 newtheorem{claim}[thm]{
9019 \backslash
9020 protect
9021 \backslash
9022 claimname}
9023 \end_layout
9024
9025 \begin_layout LyX-Code
9026 EndPreamble
9027 \end_layout
9028
9029 \begin_layout LyX-Code
9030 I18nPreamble
9031 \end_layout
9032
9033 \begin_layout LyX-Code
9034   
9035 \backslash
9036 AtBeginDocument{
9037 \backslash
9038 ifx
9039 \backslash
9040 LdfInit
9041 \backslash
9042 undefined
9043 \backslash
9044 relax
9045 \backslash
9046 else%
9047 \end_layout
9048
9049 \begin_layout LyX-Code
9050   
9051 \backslash
9052 addto
9053 \backslash
9054 captions$$lang{
9055 \backslash
9056 renewcommand{
9057 \backslash
9058 claimname}{_(Claim)}}%
9059 \end_layout
9060
9061 \begin_layout LyX-Code
9062   
9063 \backslash
9064 fi}
9065 \end_layout
9066
9067 \begin_layout LyX-Code
9068 EndI18nPreamble
9069 \end_layout
9070
9071 \begin_layout Standard
9072 The key to correct translation of the user visible text is the definition
9073  of the command 
9074 \begin_inset Flex CharStyle:Code
9075 status collapsed
9076
9077 \begin_layout Plain Layout
9078
9079 \backslash
9080 claimname
9081 \end_layout
9082
9083 \end_inset
9084
9085  in the standard preamble.
9086  This command holds the name of the theorem that will appear in the output.
9087  The 
9088 \begin_inset Flex CharStyle:Code
9089 status collapsed
9090
9091 \begin_layout Plain Layout
9092 I18NPreamble
9093 \end_layout
9094
9095 \end_inset
9096
9097  then uses the commands offered by the babel package to redefine 
9098 \begin_inset Flex CharStyle:Code
9099 status collapsed
9100
9101 \begin_layout Plain Layout
9102
9103 \backslash
9104 claimname
9105 \end_layout
9106
9107 \end_inset
9108
9109  for each used language.
9110  The 
9111 \begin_inset Flex CharStyle:Code
9112 status collapsed
9113
9114 \begin_layout Plain Layout
9115
9116 \backslash
9117 ifx
9118 \backslash
9119 LdfInit
9120 \end_layout
9121
9122 \end_inset
9123
9124  test ensures that no LaTeX error occurs in documents that do not use babel.
9125  Since LyX loads babel after the style-specific preamble, the whole command
9126  is deferred to the actual start of the document with 
9127 \begin_inset Flex CharStyle:Code
9128 status collapsed
9129
9130 \begin_layout Plain Layout
9131
9132 \backslash
9133 AtBeginDocument
9134 \end_layout
9135
9136 \end_inset
9137
9138 .
9139 \end_layout
9140
9141 \end_deeper
9142 \begin_layout Description
9143 \begin_inset Flex CharStyle:Code
9144 status collapsed
9145
9146 \begin_layout Plain Layout
9147 InnerTag
9148 \end_layout
9149
9150 \end_inset
9151
9152  [[FIXME]] (Used only with XML-type formats.)
9153 \end_layout
9154
9155 \begin_layout Description
9156 \begin_inset Flex CharStyle:Code
9157 status collapsed
9158
9159 \begin_layout Plain Layout
9160 InTitle
9161 \end_layout
9162
9163 \end_inset
9164
9165  
9166 \begin_inset Flex CharStyle:Code
9167 status collapsed
9168
9169 \begin_layout Plain Layout
9170 [1, 0]
9171 \end_layout
9172
9173 \end_inset
9174
9175  If 1, marks the layout as being part of a title block (see also the 
9176 \begin_inset Flex CharStyle:Code
9177 status collapsed
9178
9179 \begin_layout Plain Layout
9180 TitleLatexType
9181 \end_layout
9182
9183 \end_inset
9184
9185  and 
9186 \begin_inset Flex CharStyle:Code
9187 status collapsed
9188
9189 \begin_layout Plain Layout
9190 TitleLatexName
9191 \end_layout
9192
9193 \end_inset
9194
9195  global entries).
9196 \end_layout
9197
9198 \begin_layout Description
9199 \begin_inset Flex CharStyle:Code
9200 status collapsed
9201
9202 \begin_layout Plain Layout
9203 ItemSep
9204 \end_layout
9205
9206 \end_inset
9207
9208  [
9209 \begin_inset Flex CharStyle:Code
9210 status collapsed
9211
9212 \begin_layout Plain Layout
9213 float=0
9214 \end_layout
9215
9216 \end_inset
9217
9218 ] This provides extra space between paragraphs that have the same layout.
9219  If you put other layouts into an environment, each is separated with the
9220  environment's 
9221 \begin_inset Flex CharStyle:Code
9222 status collapsed
9223
9224 \begin_layout Plain Layout
9225 Parsep
9226 \end_layout
9227
9228 \end_inset
9229
9230 .
9231  But the whole items of the environment are additionally separated with
9232  this 
9233 \begin_inset Flex CharStyle:Code
9234 status collapsed
9235
9236 \begin_layout Plain Layout
9237 Itemsep
9238 \end_layout
9239
9240 \end_inset
9241
9242 .
9243  Note that this is a
9244 \emph on
9245  multiplier.
9246 \end_layout
9247
9248 \begin_layout Description
9249 \begin_inset Flex CharStyle:Code
9250 status collapsed
9251
9252 \begin_layout Plain Layout
9253 ItemTag
9254 \end_layout
9255
9256 \end_inset
9257
9258  [[FIXME]] (Used only with XML-type formats.)
9259 \end_layout
9260
9261 \begin_layout Description
9262 \begin_inset Flex CharStyle:Code
9263 status collapsed
9264
9265 \begin_layout Plain Layout
9266 KeepEmpty
9267 \end_layout
9268
9269 \end_inset
9270
9271  
9272 \begin_inset CommandInset label
9273 LatexCommand label
9274 name "des:KeepEmpty"
9275
9276 \end_inset
9277
9278 [
9279 \emph on
9280
9281 \begin_inset Flex CharStyle:Code
9282 status collapsed
9283
9284 \begin_layout Plain Layout
9285
9286 \emph on
9287 0
9288 \end_layout
9289
9290 \end_inset
9291
9292
9293 \emph default
9294
9295 \begin_inset Flex CharStyle:Code
9296 status collapsed
9297
9298 \begin_layout Plain Layout
9299 1
9300 \end_layout
9301
9302 \end_inset
9303
9304 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9305  lead to empty LaTeX output.
9306  There are some cases where this could be desirable however: in a letter
9307  template, the required fields can be provided as empty fields, so that
9308  people do not forget them; in some special classes, a layout can be used
9309  as some kind of break, which does not contain actual text.
9310 \end_layout
9311
9312 \begin_layout Description
9313 \begin_inset Flex CharStyle:Code
9314 status collapsed
9315
9316 \begin_layout Plain Layout
9317 LabelBottomsep
9318 \end_layout
9319
9320 \end_inset
9321
9322  [float=0] The vertical space between the label and the text body.
9323  Only used for labels that are above the text body (
9324 \begin_inset Flex CharStyle:Code
9325 status collapsed
9326
9327 \begin_layout Plain Layout
9328 Top_Environment
9329 \end_layout
9330
9331 \end_inset
9332
9333
9334 \begin_inset Flex CharStyle:Code
9335 status collapsed
9336
9337 \begin_layout Plain Layout
9338 Centered_Top_Environment
9339 \end_layout
9340
9341 \end_inset
9342
9343 ).
9344 \end_layout
9345
9346 \begin_layout Description
9347 \begin_inset Flex CharStyle:Code
9348 status collapsed
9349
9350 \begin_layout Plain Layout
9351 LabelCounter
9352 \end_layout
9353
9354 \end_inset
9355
9356  [
9357 \begin_inset Flex CharStyle:Code
9358 status collapsed
9359
9360 \begin_layout Plain Layout
9361 string=""
9362 \end_layout
9363
9364 \end_inset
9365
9366 ]
9367 \begin_inset Newline newline
9368 \end_inset
9369
9370 The name of the counter for automatic numbering (see Section 
9371 \begin_inset CommandInset ref
9372 LatexCommand ref
9373 reference "sec:counter"
9374
9375 \end_inset
9376
9377  for details).
9378  This must be given if 
9379 \begin_inset Flex CharStyle:Code
9380 status collapsed
9381
9382 \begin_layout Plain Layout
9383 Labeltype
9384 \end_layout
9385
9386 \end_inset
9387
9388  is 
9389 \begin_inset Flex CharStyle:Code
9390 status collapsed
9391
9392 \begin_layout Plain Layout
9393 Counter
9394 \end_layout
9395
9396 \end_inset
9397
9398 .
9399 \end_layout
9400
9401 \begin_layout Description
9402 \begin_inset Flex CharStyle:Code
9403 status collapsed
9404
9405 \begin_layout Plain Layout
9406 LabelFont
9407 \end_layout
9408
9409 \end_inset
9410
9411  The font used for the label.
9412  See section
9413 \begin_inset space ~
9414 \end_inset
9415
9416
9417 \begin_inset CommandInset ref
9418 LatexCommand ref
9419 reference "sec:fonts"
9420
9421 \end_inset
9422
9423 .
9424 \end_layout
9425
9426 \begin_layout Description
9427 \begin_inset Flex CharStyle:Code
9428 status collapsed
9429
9430 \begin_layout Plain Layout
9431 LabelIndent
9432 \end_layout
9433
9434 \end_inset
9435
9436  Text that indicates how far a label should be indented.
9437 \end_layout
9438
9439 \begin_layout Description
9440 \begin_inset Flex CharStyle:Code
9441 status collapsed
9442
9443 \begin_layout Plain Layout
9444 Labelsep
9445 \end_layout
9446
9447 \end_inset
9448
9449  [
9450 \begin_inset Flex CharStyle:Code
9451 status collapsed
9452
9453 \begin_layout Plain Layout
9454 string=""
9455 \end_layout
9456
9457 \end_inset
9458
9459 ] The horizontal space between the label and the text body.
9460  Only used for labels that are not above the text body.
9461 \end_layout
9462
9463 \begin_layout Description
9464 \begin_inset Flex CharStyle:Code
9465 status collapsed
9466
9467 \begin_layout Plain Layout
9468 LabelString
9469 \end_layout
9470
9471 \end_inset
9472
9473  [
9474 \begin_inset Flex CharStyle:Code
9475 status collapsed
9476
9477 \begin_layout Plain Layout
9478 string=""
9479 \end_layout
9480
9481 \end_inset
9482
9483 ] The string used for a label with a 
9484 \begin_inset Flex CharStyle:Code
9485 status collapsed
9486
9487 \begin_layout Plain Layout
9488 Static
9489 \end_layout
9490
9491 \end_inset
9492
9493  labeltype.
9494  When 
9495 \begin_inset Flex CharStyle:Code
9496 status collapsed
9497
9498 \begin_layout Plain Layout
9499 LabelCounter
9500 \end_layout
9501
9502 \end_inset
9503
9504  is set, this string can be contain the special formatting commands described
9505  in Section 
9506 \begin_inset CommandInset ref
9507 LatexCommand ref
9508 reference "sec:counter"
9509
9510 \end_inset
9511
9512 .
9513 \begin_inset Foot
9514 status collapsed
9515
9516 \begin_layout Plain Layout
9517 For the sake of backwards compatibility, the string 
9518 \begin_inset Flex CharStyle:Code
9519 status collapsed
9520
9521 \begin_layout Plain Layout
9522 @
9523 \emph on
9524 style-name
9525 \emph default
9526 @
9527 \end_layout
9528
9529 \end_inset
9530
9531  will be replaced by the expanded 
9532 \begin_inset Flex CharStyle:Code
9533 status collapsed
9534
9535 \begin_layout Plain Layout
9536 LabelString
9537 \end_layout
9538
9539 \end_inset
9540
9541  of style 
9542 \begin_inset Flex CharStyle:Code
9543 status collapsed
9544
9545 \begin_layout Plain Layout
9546
9547 \emph on
9548 style-name
9549 \end_layout
9550
9551 \end_inset
9552
9553 .
9554  This feature is now obsolete and should be replaced by the mechanisms of
9555  Section 
9556 \begin_inset CommandInset ref
9557 LatexCommand ref
9558 reference "sec:counter"
9559
9560 \end_inset
9561
9562 .
9563 \end_layout
9564
9565 \end_inset
9566
9567
9568 \end_layout
9569
9570 \begin_layout Description
9571 \begin_inset Flex CharStyle:Code
9572 status collapsed
9573
9574 \begin_layout Plain Layout
9575 LabelStringAppendix
9576 \end_layout
9577
9578 \end_inset
9579
9580  [
9581 \begin_inset Flex CharStyle:Code
9582 status collapsed
9583
9584 \begin_layout Plain Layout
9585 string=""
9586 \end_layout
9587
9588 \end_inset
9589
9590 ] This is used inside the appendix instead of 
9591 \begin_inset Flex CharStyle:Code
9592 status collapsed
9593
9594 \begin_layout Plain Layout
9595 LabelString
9596 \end_layout
9597
9598 \end_inset
9599
9600 .
9601  Note that every 
9602 \begin_inset Flex CharStyle:Code
9603 status collapsed
9604
9605 \begin_layout Plain Layout
9606 LabelString
9607 \end_layout
9608
9609 \end_inset
9610
9611  statement resets 
9612 \begin_inset Flex CharStyle:Code
9613 status collapsed
9614
9615 \begin_layout Plain Layout
9616 LabelStringAppendix
9617 \end_layout
9618
9619 \end_inset
9620
9621  too.
9622 \end_layout
9623
9624 \begin_layout Description
9625 \begin_inset Flex CharStyle:Code
9626 status collapsed
9627
9628 \begin_layout Plain Layout
9629 LabelTag
9630 \end_layout
9631
9632 \end_inset
9633
9634  [FIXME] (Used only with XML-type formats.)
9635 \end_layout
9636
9637 \begin_layout Description
9638 \begin_inset Flex CharStyle:Code
9639 status collapsed
9640
9641 \begin_layout Plain Layout
9642 Labeltype
9643 \end_layout
9644
9645 \end_inset
9646
9647  [
9648 \begin_inset Flex CharStyle:Code
9649 status collapsed
9650
9651 \begin_layout Plain Layout
9652
9653 \emph on
9654 No_Label
9655 \emph default
9656 , Manual, Static, Top_Environment, 
9657 \begin_inset Newline newline
9658 \end_inset
9659
9660 Centered_Top_Environment, Sensitive, Counter
9661 \end_layout
9662
9663 \end_inset
9664
9665
9666 \begin_inset Newline newline
9667 \end_inset
9668
9669
9670 \begin_inset Flex CharStyle:Code
9671 status collapsed
9672
9673 \begin_layout Plain Layout
9674 Manual
9675 \end_layout
9676
9677 \end_inset
9678
9679  means the label is the very first word (up to the first real blank).
9680 \begin_inset Foot
9681 status collapsed
9682
9683 \begin_layout Plain Layout
9684 Use protected spaces if you want more than one word as the label.
9685 \end_layout
9686
9687 \end_inset
9688
9689  
9690 \begin_inset Flex CharStyle:Code
9691 status collapsed
9692
9693 \begin_layout Plain Layout
9694 Static
9695 \end_layout
9696
9697 \end_inset
9698
9699  means it is defined in the layout (see 
9700 \begin_inset Flex CharStyle:Code
9701 status collapsed
9702
9703 \begin_layout Plain Layout
9704 LabelString
9705 \end_layout
9706
9707 \end_inset
9708
9709 ).
9710  
9711 \begin_inset Flex CharStyle:Code
9712 status collapsed
9713
9714 \begin_layout Plain Layout
9715 Top_Environment
9716 \end_layout
9717
9718 \end_inset
9719
9720  and 
9721 \begin_inset Flex CharStyle:Code
9722 status collapsed
9723
9724 \begin_layout Plain Layout
9725 Centered_Top_Environment
9726 \end_layout
9727
9728 \end_inset
9729
9730  are special cases of 
9731 \begin_inset Flex CharStyle:Code
9732 status collapsed
9733
9734 \begin_layout Plain Layout
9735 Static
9736 \end_layout
9737
9738 \end_inset
9739
9740 .
9741  The label will be printed above the paragraph, but only at the top of an
9742  environment or the top of a chain of paragraphs with this layout.
9743  Usage is for example the 
9744 \begin_inset Flex CharStyle:MenuItem
9745 status collapsed
9746
9747 \begin_layout Plain Layout
9748 Abstract
9749 \end_layout
9750
9751 \end_inset
9752
9753  layout or the 
9754 \begin_inset Flex CharStyle:MenuItem
9755 status collapsed
9756
9757 \begin_layout Plain Layout
9758 Bibliography
9759 \end_layout
9760
9761 \end_inset
9762
9763  layout.
9764  This is also the case for 
9765 \begin_inset Flex CharStyle:Code
9766 status collapsed
9767
9768 \begin_layout Plain Layout
9769 Manual
9770 \end_layout
9771
9772 \end_inset
9773
9774  labels with latex type 
9775 \begin_inset Flex CharStyle:Code
9776 status collapsed
9777
9778 \begin_layout Plain Layout
9779 Environment
9780 \end_layout
9781
9782 \end_inset
9783
9784 , in order to make layouts for theorems work correctly.
9785  
9786 \begin_inset Flex CharStyle:Code
9787 status collapsed
9788
9789 \begin_layout Plain Layout
9790 Sensitive
9791 \end_layout
9792
9793 \end_inset
9794
9795  is a special case for the caption-labels 
9796 \begin_inset Quotes eld
9797 \end_inset
9798
9799 Figure
9800 \begin_inset Quotes erd
9801 \end_inset
9802
9803  and 
9804 \begin_inset Quotes eld
9805 \end_inset
9806
9807 Table
9808 \begin_inset Quotes erd
9809 \end_inset
9810
9811 .
9812  
9813 \begin_inset Flex CharStyle:Code
9814 status collapsed
9815
9816 \begin_layout Plain Layout
9817 Sensitive
9818 \end_layout
9819
9820 \end_inset
9821
9822  means the (hardcoded) label string depends on the kind of float.
9823  The 
9824 \begin_inset Flex CharStyle:Code
9825 status collapsed
9826
9827 \begin_layout Plain Layout
9828 Counter
9829 \end_layout
9830
9831 \end_inset
9832
9833  label type defines automatically numbered labels.
9834  See Section 
9835 \begin_inset CommandInset ref
9836 LatexCommand ref
9837 reference "sec:counter"
9838
9839 \end_inset
9840
9841 .
9842 \end_layout
9843
9844 \begin_layout Description
9845 \begin_inset Flex CharStyle:Code
9846 status collapsed
9847
9848 \begin_layout Plain Layout
9849 LatexName
9850 \end_layout
9851
9852 \end_inset
9853
9854  The name of the corresponding LaTeX stuff.
9855  Either the environment or command name.
9856 \end_layout
9857
9858 \begin_layout Description
9859 \begin_inset Flex CharStyle:Code
9860 status collapsed
9861
9862 \begin_layout Plain Layout
9863 LatexParam
9864 \end_layout
9865
9866 \end_inset
9867
9868  An optional parameter for the corresponding 
9869 \begin_inset Flex CharStyle:Code
9870 status collapsed
9871
9872 \begin_layout Plain Layout
9873 LatexName
9874 \end_layout
9875
9876 \end_inset
9877
9878  stuff.
9879  This parameter cannot be changed from within LyX.
9880 \end_layout
9881
9882 \begin_layout Description
9883 \begin_inset Flex CharStyle:Code
9884 status collapsed
9885
9886 \begin_layout Plain Layout
9887 LatexType
9888 \end_layout
9889
9890 \end_inset
9891
9892  
9893 \begin_inset CommandInset label
9894 LatexCommand label
9895 name "des:LatexType"
9896
9897 \end_inset
9898
9899 [
9900 \begin_inset Flex CharStyle:Code
9901 status collapsed
9902
9903 \begin_layout Plain Layout
9904
9905 \emph on
9906 Paragraph
9907 \emph default
9908 , Command, Environment, Item_Environment,
9909 \end_layout
9910
9911 \end_inset
9912
9913  
9914 \begin_inset Flex CharStyle:Code
9915 status collapsed
9916
9917 \begin_layout Plain Layout
9918 List_Environment
9919 \end_layout
9920
9921 \end_inset
9922
9923 ] How the layout should be translated into LaTeX.
9924  
9925 \begin_inset Flex CharStyle:Code
9926 status collapsed
9927
9928 \begin_layout Plain Layout
9929 Paragraph
9930 \end_layout
9931
9932 \end_inset
9933
9934  means nothing special.
9935  
9936 \begin_inset Flex CharStyle:Code
9937 status collapsed
9938
9939 \begin_layout Plain Layout
9940 Command
9941 \end_layout
9942
9943 \end_inset
9944
9945  means 
9946 \begin_inset Flex CharStyle:Code
9947 status collapsed
9948
9949 \begin_layout Plain Layout
9950
9951 \backslash
9952
9953 \emph on
9954 LatexName
9955 \emph default
9956 {\SpecialChar \ldots{}
9957 }
9958 \end_layout
9959
9960 \end_inset
9961
9962  and 
9963 \begin_inset Flex CharStyle:Code
9964 status collapsed
9965
9966 \begin_layout Plain Layout
9967 Environment
9968 \end_layout
9969
9970 \end_inset
9971
9972  means 
9973 \begin_inset Flex CharStyle:Code
9974 status collapsed
9975
9976 \begin_layout Plain Layout
9977
9978 \backslash
9979 begin{
9980 \emph on
9981 LatexName
9982 \emph default
9983 }\SpecialChar \ldots{}
9984
9985 \backslash
9986 end{
9987 \emph on
9988 LatexName
9989 \emph default
9990 }
9991 \end_layout
9992
9993 \end_inset
9994
9995 .
9996  
9997 \begin_inset Flex CharStyle:Code
9998 status collapsed
9999
10000 \begin_layout Plain Layout
10001 Item_Environment
10002 \end_layout
10003
10004 \end_inset
10005
10006  is the same as 
10007 \begin_inset Flex CharStyle:Code
10008 status collapsed
10009
10010 \begin_layout Plain Layout
10011 Environment
10012 \end_layout
10013
10014 \end_inset
10015
10016 , except that a 
10017 \begin_inset Flex CharStyle:Code
10018 status collapsed
10019
10020 \begin_layout Plain Layout
10021
10022 \backslash
10023 item
10024 \end_layout
10025
10026 \end_inset
10027
10028  is generated for each paragraph of this environment.
10029  
10030 \begin_inset Flex CharStyle:Code
10031 status collapsed
10032
10033 \begin_layout Plain Layout
10034 List_Environment
10035 \end_layout
10036
10037 \end_inset
10038
10039  is the same as 
10040 \begin_inset Flex CharStyle:Code
10041 status collapsed
10042
10043 \begin_layout Plain Layout
10044 Item_Environment
10045 \end_layout
10046
10047 \end_inset
10048
10049 , except that 
10050 \begin_inset Flex CharStyle:Code
10051 status collapsed
10052
10053 \begin_layout Plain Layout
10054 LabelWidthString
10055 \end_layout
10056
10057 \end_inset
10058
10059  is passed as an argument to the environment.
10060  
10061 \begin_inset Flex CharStyle:Code
10062 status collapsed
10063
10064 \begin_layout Plain Layout
10065 LabelWidthString
10066 \end_layout
10067
10068 \end_inset
10069
10070  can be defined in the 
10071 \begin_inset Flex CharStyle:MenuItem
10072 status collapsed
10073
10074 \begin_layout Plain Layout
10075
10076 \bar under
10077 L
10078 \bar default
10079 ayout\SpecialChar \menuseparator
10080
10081 \bar under
10082 P
10083 \bar default
10084 aragraph
10085 \end_layout
10086
10087 \end_inset
10088
10089  dialog.
10090  
10091 \begin_inset Flex CharStyle:Code
10092 status collapsed
10093
10094 \begin_layout Plain Layout
10095
10096 \emph on
10097 LatexType
10098 \end_layout
10099
10100 \end_inset
10101
10102  is perhaps a bit misleading, since these rules apply to SGML classes, too.
10103  Visit the SGML class files for specific examples.
10104 \end_layout
10105
10106 \begin_layout Standard
10107 Putting the last few things together, the LaTeX output will be either: 
10108 \end_layout
10109
10110 \begin_layout LyX-Code
10111
10112 \backslash
10113 latexname[latexparam]{\SpecialChar \ldots{}
10114 }
10115 \end_layout
10116
10117 \begin_layout Standard
10118 or: 
10119 \end_layout
10120
10121 \begin_layout LyX-Code
10122
10123 \backslash
10124 begin{latexname}[latexparam] \SpecialChar \ldots{}
10125  
10126 \backslash
10127 end{latexname}.
10128 \end_layout
10129
10130 \begin_layout Standard
10131 depending upon the LaTeX type.
10132 \end_layout
10133
10134 \begin_layout Description
10135 \begin_inset Flex CharStyle:Code
10136 status collapsed
10137
10138 \begin_layout Plain Layout
10139 LeftMargin
10140 \end_layout
10141
10142 \end_inset
10143
10144  [
10145 \begin_inset Flex CharStyle:Code
10146 status collapsed
10147
10148 \begin_layout Plain Layout
10149 string=""
10150 \end_layout
10151
10152 \end_inset
10153
10154 ] If you put layouts into environments, the leftmargins are not simply added,
10155  but added with a factor 
10156 \begin_inset Formula $\frac{4}{depth+4}$
10157 \end_inset
10158
10159 .
10160  Note that this parameter is also used when the margin is defined as 
10161 \begin_inset Flex CharStyle:Code
10162 status collapsed
10163
10164 \begin_layout Plain Layout
10165 Manual
10166 \end_layout
10167
10168 \end_inset
10169
10170  or 
10171 \begin_inset Flex CharStyle:Code
10172 status collapsed
10173
10174 \begin_layout Plain Layout
10175 Dynamic
10176 \end_layout
10177
10178 \end_inset
10179
10180 .
10181  Then it is added to the manual or dynamic margin.
10182  
10183 \begin_inset Newline newline
10184 \end_inset
10185
10186 The argument is passed as a string.
10187  For example 
10188 \begin_inset Quotes eld
10189 \end_inset
10190
10191
10192 \begin_inset Flex CharStyle:Code
10193 status collapsed
10194
10195 \begin_layout Plain Layout
10196 MM
10197 \end_layout
10198
10199 \end_inset
10200
10201
10202 \begin_inset Quotes erd
10203 \end_inset
10204
10205  means that the paragraph is indented with the width of 
10206 \begin_inset Quotes eld
10207 \end_inset
10208
10209
10210 \begin_inset Flex CharStyle:Code
10211 status collapsed
10212
10213 \begin_layout Plain Layout
10214 MM
10215 \end_layout
10216
10217 \end_inset
10218
10219
10220 \begin_inset Quotes erd
10221 \end_inset
10222
10223  in the normal font.
10224  You can get a negative width by prefixing the string with 
10225 \begin_inset Quotes eld
10226 \end_inset
10227
10228
10229 \begin_inset Flex CharStyle:Code
10230 status collapsed
10231
10232 \begin_layout Plain Layout
10233 -
10234 \end_layout
10235
10236 \end_inset
10237
10238
10239 \begin_inset Quotes erd
10240 \end_inset
10241
10242 .
10243  This way was chosen so that the look is the same with each used screen
10244  font.
10245  
10246 \end_layout
10247
10248 \begin_layout Description
10249 \begin_inset Flex CharStyle:Code
10250 status collapsed
10251
10252 \begin_layout Plain Layout
10253 Margin
10254 \end_layout
10255
10256 \end_inset
10257
10258  [
10259 \begin_inset Flex CharStyle:Code
10260 status collapsed
10261
10262 \begin_layout Plain Layout
10263
10264 \emph on
10265 Static
10266 \emph default
10267 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10268 \end_layout
10269
10270 \end_inset
10271
10272
10273 \begin_inset Newline newline
10274 \end_inset
10275
10276 The kind of margin that the layout has on the left side.
10277  
10278 \begin_inset Flex CharStyle:Code
10279 status collapsed
10280
10281 \begin_layout Plain Layout
10282 Static
10283 \end_layout
10284
10285 \end_inset
10286
10287  just means a fixed margin.
10288  
10289 \begin_inset Flex CharStyle:Code
10290 status collapsed
10291
10292 \begin_layout Plain Layout
10293 Manual
10294 \end_layout
10295
10296 \end_inset
10297
10298  means that the left margin depends on the string entered in the 
10299 \begin_inset Flex CharStyle:MenuItem
10300 status collapsed
10301
10302 \begin_layout Plain Layout
10303 Edit\SpecialChar \menuseparator
10304 Paragraph
10305 \begin_inset space ~
10306 \end_inset
10307
10308 Settings
10309 \end_layout
10310
10311 \end_inset
10312
10313  dialog.
10314  This is used to typeset nice lists without tabulators.
10315  
10316 \begin_inset Flex CharStyle:Code
10317 status collapsed
10318
10319 \begin_layout Plain Layout
10320 Dynamic
10321 \end_layout
10322
10323 \end_inset
10324
10325  means that the margin depends on the size of the label.
10326  This is used for automatic enumerated headlines.
10327  It is obvious that the headline 
10328 \begin_inset Quotes eld
10329 \end_inset
10330
10331 5.4.3.2.1 Very long headline
10332 \begin_inset Quotes erd
10333 \end_inset
10334
10335  must have a wider left margin (as wide as 
10336 \begin_inset Quotes eld
10337 \end_inset
10338
10339 5.4.3.2.1
10340 \begin_inset Quotes erd
10341 \end_inset
10342
10343  plus the space) than 
10344 \begin_inset Quotes eld
10345 \end_inset
10346
10347 3.2 Very long headline
10348 \begin_inset Quotes erd
10349 \end_inset
10350
10351 , even if standard 
10352 \begin_inset Quotes eld
10353 \end_inset
10354
10355 word processors
10356 \begin_inset Quotes erd
10357 \end_inset
10358
10359  are not able to do this.
10360  
10361 \begin_inset Flex CharStyle:Code
10362 status collapsed
10363
10364 \begin_layout Plain Layout
10365 First_Dynamic
10366 \end_layout
10367
10368 \end_inset
10369
10370  is similar, but only the very first row of the paragraph is dynamic, while
10371  the others are static; this is used, for example, for descriptions.
10372  
10373 \begin_inset Flex CharStyle:Code
10374 status collapsed
10375
10376 \begin_layout Plain Layout
10377 Right_Address_Box
10378 \end_layout
10379
10380 \end_inset
10381
10382  means the margin is chosen in a way that the longest row of this paragraph
10383  fits to the right margin.
10384  This is used to typeset an address on the right edge of the page.
10385 \end_layout
10386
10387 \begin_layout Description
10388 \begin_inset Flex CharStyle:Code
10389 status collapsed
10390
10391 \begin_layout Plain Layout
10392 NeedProtect
10393 \end_layout
10394
10395 \end_inset
10396
10397  [
10398 \begin_inset Flex CharStyle:Code
10399 status collapsed
10400
10401 \begin_layout Plain Layout
10402
10403 \emph on
10404 0
10405 \end_layout
10406
10407 \end_inset
10408
10409 ,
10410 \begin_inset Flex CharStyle:Code
10411 status collapsed
10412
10413 \begin_layout Plain Layout
10414 1
10415 \end_layout
10416
10417 \end_inset
10418
10419 ] Whether fragile commands in this layout should be 
10420 \begin_inset Flex CharStyle:Code
10421 status collapsed
10422
10423 \begin_layout Plain Layout
10424
10425 \backslash
10426 protect
10427 \end_layout
10428
10429 \end_inset
10430
10431 'ed.
10432  (Note: This is 
10433 \emph on
10434 not
10435 \emph default
10436  whether this command should itself be protected.)
10437 \end_layout
10438
10439 \begin_layout Description
10440 \begin_inset Flex CharStyle:Code
10441 status collapsed
10442
10443 \begin_layout Plain Layout
10444 Newline
10445 \end_layout
10446
10447 \end_inset
10448
10449  [
10450 \begin_inset Flex CharStyle:Code
10451 status collapsed
10452
10453 \begin_layout Plain Layout
10454 0
10455 \end_layout
10456
10457 \end_inset
10458
10459
10460 \begin_inset Flex CharStyle:Code
10461 status collapsed
10462
10463 \begin_layout Plain Layout
10464
10465 \emph on
10466 1
10467 \end_layout
10468
10469 \end_inset
10470
10471 ] Whether newlines are translated into LaTeX newlines (
10472 \begin_inset Flex CharStyle:Code
10473 status collapsed
10474
10475 \begin_layout Plain Layout
10476
10477 \backslash
10478
10479 \backslash
10480
10481 \end_layout
10482
10483 \end_inset
10484
10485 ) or not.
10486  The translation can be switched off to allow more comfortable LaTeX editing
10487  inside LyX.
10488 \end_layout
10489
10490 \begin_layout Description
10491 \begin_inset Flex CharStyle:Code
10492 status collapsed
10493
10494 \begin_layout Plain Layout
10495 NextNoIndent
10496 \end_layout
10497
10498 \end_inset
10499
10500  [
10501 \begin_inset Flex CharStyle:Code
10502 status collapsed
10503
10504 \begin_layout Plain Layout
10505 1
10506 \end_layout
10507
10508 \end_inset
10509
10510
10511 \begin_inset Flex CharStyle:Code
10512 status collapsed
10513
10514 \begin_layout Plain Layout
10515
10516 \emph on
10517 0
10518 \end_layout
10519
10520 \end_inset
10521
10522 ] Whether the following Paragraph is allowed to indent its very first row.
10523  
10524 \begin_inset Flex CharStyle:Code
10525 status collapsed
10526
10527 \begin_layout Plain Layout
10528 1
10529 \end_layout
10530
10531 \end_inset
10532
10533  means that it is not allowed to do so; 
10534 \begin_inset Flex CharStyle:Code
10535 status collapsed
10536
10537 \begin_layout Plain Layout
10538 0
10539 \end_layout
10540
10541 \end_inset
10542
10543  means it could do so if it wants to.
10544 \end_layout
10545
10546 \begin_layout Description
10547 \begin_inset Flex CharStyle:Code
10548 status collapsed
10549
10550 \begin_layout Plain Layout
10551 ObsoletedBy
10552 \end_layout
10553
10554 \end_inset
10555
10556  Name of a layout that has replaced this layout.
10557  This is used to rename a layout, while keeping backward compatibility.
10558 \end_layout
10559
10560 \begin_layout Description
10561 \begin_inset Flex CharStyle:Code
10562 status collapsed
10563
10564 \begin_layout Plain Layout
10565 OptionalArgs
10566 \end_layout
10567
10568 \end_inset
10569
10570  [
10571 \begin_inset Flex CharStyle:Code
10572 status collapsed
10573
10574 \begin_layout Plain Layout
10575 int=0
10576 \end_layout
10577
10578 \end_inset
10579
10580 ] The number of optional arguments that can be used with this layout.
10581  This is useful for things like section headings, and only makes sense with
10582  LaTeX.
10583 \end_layout
10584
10585 \begin_layout Description
10586 \begin_inset Flex CharStyle:Code
10587 status collapsed
10588
10589 \begin_layout Plain Layout
10590 ParIndent
10591 \end_layout
10592
10593 \end_inset
10594
10595  [
10596 \begin_inset Flex CharStyle:Code
10597 status collapsed
10598
10599 \begin_layout Plain Layout
10600 string=""
10601 \end_layout
10602
10603 \end_inset
10604
10605 ] The indent of the very first line of a paragraph.
10606  The 
10607 \begin_inset Flex CharStyle:Code
10608 status collapsed
10609
10610 \begin_layout Plain Layout
10611 Parindent
10612 \end_layout
10613
10614 \end_inset
10615
10616  will be fixed for a certain layout.
10617  The exception is Standard layout, since the indentation of a Standard layout
10618  paragraph can be prohibited with 
10619 \begin_inset Flex CharStyle:Code
10620 status collapsed
10621
10622 \begin_layout Plain Layout
10623 NextNoIndent
10624 \end_layout
10625
10626 \end_inset
10627
10628 .
10629  Also, Standard layout paragraphs inside environments use the 
10630 \begin_inset Flex CharStyle:Code
10631 status collapsed
10632
10633 \begin_layout Plain Layout
10634 Parindent
10635 \end_layout
10636
10637 \end_inset
10638
10639  of the environment, not their native one.
10640  For example, Standard paragraphs inside an enumeration are not indented.
10641 \end_layout
10642
10643 \begin_layout Description
10644 \begin_inset Flex CharStyle:Code
10645 status collapsed
10646
10647 \begin_layout Plain Layout
10648 Parsep
10649 \end_layout
10650
10651 \end_inset
10652
10653  [
10654 \begin_inset Flex CharStyle:Code
10655 status collapsed
10656
10657 \begin_layout Plain Layout
10658 float=0
10659 \end_layout
10660
10661 \end_inset
10662
10663 ] The vertical space between two paragraphs of this layout.
10664 \end_layout
10665
10666 \begin_layout Description
10667 \begin_inset Flex CharStyle:Code
10668 status collapsed
10669
10670 \begin_layout Plain Layout
10671 Parskip
10672 \end_layout
10673
10674 \end_inset
10675
10676  [
10677 \begin_inset Flex CharStyle:Code
10678 status collapsed
10679
10680 \begin_layout Plain Layout
10681 float=0
10682 \end_layout
10683
10684 \end_inset
10685
10686 ] LyX allows the user to choose either 
10687 \begin_inset Quotes eld
10688 \end_inset
10689
10690 indent
10691 \begin_inset Quotes erd
10692 \end_inset
10693
10694  or 
10695 \begin_inset Quotes eld
10696 \end_inset
10697
10698 skip
10699 \begin_inset Quotes erd
10700 \end_inset
10701
10702  to typeset a document.
10703  When 
10704 \begin_inset Quotes eld
10705 \end_inset
10706
10707 indent
10708 \begin_inset Quotes erd
10709 \end_inset
10710
10711  is chosen, this value is completely ignored.
10712  When 
10713 \begin_inset Quotes eld
10714 \end_inset
10715
10716 skip
10717 \begin_inset Quotes erd
10718 \end_inset
10719
10720  is chosen, the parindent of a LaTeXtype 
10721 \begin_inset Quotes eld
10722 \end_inset
10723
10724 Paragraph
10725 \begin_inset Quotes erd
10726 \end_inset
10727
10728  layout is ignored and all paragraphs are separated by this parskip argument.
10729  The vertical space is calculated with 
10730 \begin_inset Flex CharStyle:Code
10731 status collapsed
10732
10733 \begin_layout Plain Layout
10734 value
10735 \begin_inset space ~
10736 \end_inset
10737
10738 * DefaultHeight
10739 \end_layout
10740
10741 \end_inset
10742
10743  where 
10744 \begin_inset Flex CharStyle:Code
10745 status collapsed
10746
10747 \begin_layout Plain Layout
10748 DefaultHeight
10749 \end_layout
10750
10751 \end_inset
10752
10753  is the height of a row with the normal font.
10754  This way, the look stays the same with different screen fonts.
10755 \end_layout
10756
10757 \begin_layout Description
10758 \begin_inset Flex CharStyle:Code
10759 status collapsed
10760
10761 \begin_layout Plain Layout
10762 PassThru
10763 \end_layout
10764
10765 \end_inset
10766
10767  
10768 \begin_inset CommandInset label
10769 LatexCommand label
10770 name "des:PathThru"
10771
10772 \end_inset
10773
10774 [
10775 \emph on
10776
10777 \begin_inset Flex CharStyle:Code
10778 status collapsed
10779
10780 \begin_layout Plain Layout
10781
10782 \emph on
10783 0
10784 \end_layout
10785
10786 \end_inset
10787
10788
10789 \emph default
10790
10791 \begin_inset Flex CharStyle:Code
10792 status collapsed
10793
10794 \begin_layout Plain Layout
10795 1
10796 \end_layout
10797
10798 \end_inset
10799
10800 ] Whether the contents of this paragraph should be output in raw form, meaning
10801  without special translations that LaTeX would require.
10802 \end_layout
10803
10804 \begin_layout Description
10805 \begin_inset Flex CharStyle:Code
10806 status collapsed
10807
10808 \begin_layout Plain Layout
10809 Preamble
10810 \end_layout
10811
10812 \end_inset
10813
10814  
10815 \begin_inset CommandInset label
10816 LatexCommand label
10817 name "des:Preamble"
10818
10819 \end_inset
10820
10821 Information to be included in the LaTeX preamble when this style is used.
10822  Used to define macros, load packages, etc., required by this particular
10823  style.
10824  Must end with 
10825 \begin_inset Quotes eld
10826 \end_inset
10827
10828
10829 \begin_inset Flex CharStyle:Code
10830 status collapsed
10831
10832 \begin_layout Plain Layout
10833 EndPreamble
10834 \end_layout
10835
10836 \end_inset
10837
10838
10839 \begin_inset Quotes erd
10840 \end_inset
10841
10842 .
10843 \end_layout
10844
10845 \begin_layout Description
10846 \begin_inset Flex CharStyle:Code
10847 status collapsed
10848
10849 \begin_layout Plain Layout
10850 Requires 
10851 \end_layout
10852
10853 \end_inset
10854
10855 [
10856 \begin_inset Flex CharStyle:Code
10857 status collapsed
10858
10859 \begin_layout Plain Layout
10860 string
10861 \end_layout
10862
10863 \end_inset
10864
10865
10866 \begin_inset CommandInset label
10867 LatexCommand label
10868 name "des:Requires"
10869
10870 \end_inset
10871
10872 Whether the layout requires the feature 
10873 \begin_inset Flex CharStyle:Code
10874 status collapsed
10875
10876 \begin_layout Plain Layout
10877 string
10878 \end_layout
10879
10880 \end_inset
10881
10882 .
10883  See the description of 
10884 \begin_inset Flex CharStyle:Code
10885 status collapsed
10886
10887 \begin_layout Plain Layout
10888 Provides
10889 \end_layout
10890
10891 \end_inset
10892
10893  above (page 
10894 \begin_inset CommandInset ref
10895 LatexCommand pageref
10896 reference "des:FreeSpacing"
10897
10898 \end_inset
10899
10900 ) for information on `features'.
10901  
10902 \end_layout
10903
10904 \begin_layout Description
10905 \begin_inset Flex CharStyle:Code
10906 status collapsed
10907
10908 \begin_layout Plain Layout
10909 RightMargin
10910 \end_layout
10911
10912 \end_inset
10913
10914  [
10915 \begin_inset Flex CharStyle:Code
10916 status collapsed
10917
10918 \begin_layout Plain Layout
10919 string=""
10920 \end_layout
10921
10922 \end_inset
10923
10924 ] Similar to 
10925 \begin_inset Flex CharStyle:Code
10926 status collapsed
10927
10928 \begin_layout Plain Layout
10929 LeftMargin
10930 \end_layout
10931
10932 \end_inset
10933
10934 .
10935 \end_layout
10936
10937 \begin_layout Description
10938 \begin_inset Flex CharStyle:Code
10939 status collapsed
10940
10941 \begin_layout Plain Layout
10942 Spacing
10943 \end_layout
10944
10945 \end_inset
10946
10947  [
10948 \begin_inset Flex CharStyle:Code
10949 status collapsed
10950
10951 \begin_layout Plain Layout
10952
10953 \emph on
10954 single
10955 \emph default
10956 , onehalf, double, other
10957 \end_layout
10958
10959 \end_inset
10960
10961  
10962 \emph on
10963 value
10964 \emph default
10965 ] This defines what the default spacing should be in the layout.
10966  The arguments 
10967 \begin_inset Flex CharStyle:Code
10968 status collapsed
10969
10970 \begin_layout Plain Layout
10971 single
10972 \end_layout
10973
10974 \end_inset
10975
10976
10977 \begin_inset Flex CharStyle:Code
10978 status collapsed
10979
10980 \begin_layout Plain Layout
10981 onehalf
10982 \end_layout
10983
10984 \end_inset
10985
10986  and 
10987 \begin_inset Flex CharStyle:Code
10988 status collapsed
10989
10990 \begin_layout Plain Layout
10991 double
10992 \end_layout
10993
10994 \end_inset
10995
10996  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10997  If you specify the argument 
10998 \begin_inset Flex CharStyle:Code
10999 status collapsed
11000
11001 \begin_layout Plain Layout
11002 other
11003 \end_layout
11004
11005 \end_inset
11006
11007 , then you should also provide a numerical argument which will be the actual
11008  multiplier value.
11009  Note that, contrary to other parameters, 
11010 \begin_inset Flex CharStyle:Code
11011 status collapsed
11012
11013 \begin_layout Plain Layout
11014 Spacing
11015 \end_layout
11016
11017 \end_inset
11018
11019  implies the generation of specific LaTeX code, using the package 
11020 \family roman
11021
11022 \begin_inset Flex CharStyle:Code
11023 status collapsed
11024
11025 \begin_layout Plain Layout
11026 setspace.sty
11027 \end_layout
11028
11029 \end_inset
11030
11031 .
11032 \end_layout
11033
11034 \begin_layout Description
11035 \begin_inset Flex CharStyle:Code
11036 status collapsed
11037
11038 \begin_layout Plain Layout
11039 TextFont
11040 \end_layout
11041
11042 \end_inset
11043
11044  The font used for the text body .
11045  See section 
11046 \begin_inset CommandInset ref
11047 LatexCommand ref
11048 reference "sec:fonts"
11049
11050 \end_inset
11051
11052 .
11053 \end_layout
11054
11055 \begin_layout Description
11056 \begin_inset Flex CharStyle:Code
11057 status collapsed
11058
11059 \begin_layout Plain Layout
11060
11061 \series medium
11062 TocLevel [int]
11063 \end_layout
11064
11065 \end_inset
11066
11067  The level of the style in the table of contents.
11068  This is used for automatic numbering of section headings.
11069 \end_layout
11070
11071 \begin_layout Description
11072 \begin_inset Flex CharStyle:Code
11073 status collapsed
11074
11075 \begin_layout Plain Layout
11076 TopSep
11077 \end_layout
11078
11079 \end_inset
11080
11081  [
11082 \begin_inset Flex CharStyle:Code
11083 status collapsed
11084
11085 \begin_layout Plain Layout
11086 float=0
11087 \end_layout
11088
11089 \end_inset
11090
11091 ] The vertical space with which the very first of a chain of paragraphs
11092  with this layout is separated from the previous paragraph.
11093  If the previous paragraph has another layout, the separations are not simply
11094  added, but the maximum is taken.
11095 \end_layout
11096
11097 \begin_layout Subsection
11098 Floats
11099 \end_layout
11100
11101 \begin_layout Standard
11102 \begin_inset CommandInset label
11103 LatexCommand label
11104 name "sec:floats"
11105
11106 \end_inset
11107
11108 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11109  define the floats (
11110 \begin_inset Flex CharStyle:MenuItem
11111 status collapsed
11112
11113 \begin_layout Plain Layout
11114 figure
11115 \end_layout
11116
11117 \end_inset
11118
11119
11120 \begin_inset Flex CharStyle:MenuItem
11121 status collapsed
11122
11123 \begin_layout Plain Layout
11124 table
11125 \end_layout
11126
11127 \end_inset
11128
11129 , \SpecialChar \ldots{}
11130 ) in the text class itself.
11131  Standard floats are included in the file 
11132 \begin_inset Flex CharStyle:Code
11133 status collapsed
11134
11135 \begin_layout Plain Layout
11136 stdfloats.inc
11137 \end_layout
11138
11139 \end_inset
11140
11141 , so you may have to do no more than add
11142 \end_layout
11143
11144 \begin_layout LyX-Code
11145 Input stdfloats.inc
11146 \end_layout
11147
11148 \begin_layout Standard
11149 to your layout file.
11150  If you want to implement a text class that proposes some other float types
11151  (like the AGU class bundled with LyX), the information below will hopefully
11152  help you:
11153 \end_layout
11154
11155 \begin_layout Description
11156 \begin_inset Flex CharStyle:Code
11157 status collapsed
11158
11159 \begin_layout Plain Layout
11160 Extension
11161 \end_layout
11162
11163 \end_inset
11164
11165  [
11166 \begin_inset Flex CharStyle:Code
11167 status collapsed
11168
11169 \begin_layout Plain Layout
11170 string
11171 \end_layout
11172
11173 \end_inset
11174
11175 =
11176 \begin_inset Quotes erd
11177 \end_inset
11178
11179
11180 \begin_inset Quotes erd
11181 \end_inset
11182
11183 ] The file name extension of an auxiliary file for the list of figures (or
11184  whatever).
11185  LaTeX writes the captions to this file.
11186 \end_layout
11187
11188 \begin_layout Description
11189 \begin_inset Flex CharStyle:Code
11190 status collapsed
11191
11192 \begin_layout Plain Layout
11193 GuiName
11194 \end_layout
11195
11196 \end_inset
11197
11198  [
11199 \begin_inset Flex CharStyle:Code
11200 status collapsed
11201
11202 \begin_layout Plain Layout
11203 string
11204 \end_layout
11205
11206 \end_inset
11207
11208 =
11209 \begin_inset Quotes erd
11210 \end_inset
11211
11212
11213 \begin_inset Quotes erd
11214 \end_inset
11215
11216 ] The string that will be used in the menus and also for the caption.
11217 \end_layout
11218
11219 \begin_layout Description
11220 \begin_inset Flex CharStyle:Code
11221 status collapsed
11222
11223 \begin_layout Plain Layout
11224 LaTeXBuiltin
11225 \end_layout
11226
11227 \end_inset
11228
11229  [
11230 \begin_inset Flex CharStyle:Code
11231 status collapsed
11232
11233 \begin_layout Plain Layout
11234
11235 \emph on
11236 0
11237 \end_layout
11238
11239 \end_inset
11240
11241
11242 \begin_inset Flex CharStyle:Code
11243 status collapsed
11244
11245 \begin_layout Plain Layout
11246 1
11247 \end_layout
11248
11249 \end_inset
11250
11251 ] Set to 
11252 \begin_inset Flex CharStyle:Code
11253 status collapsed
11254
11255 \begin_layout Plain Layout
11256 1
11257 \end_layout
11258
11259 \end_inset
11260
11261  if the float is already defined by the LaTeX document class.
11262  If this is set to 
11263 \begin_inset Flex CharStyle:Code
11264 status collapsed
11265
11266 \begin_layout Plain Layout
11267 0
11268 \end_layout
11269
11270 \end_inset
11271
11272 , the float will be defined using the LaTeX package 
11273 \begin_inset Flex CharStyle:Code
11274 status collapsed
11275
11276 \begin_layout Plain Layout
11277 float
11278 \end_layout
11279
11280 \end_inset
11281
11282 .
11283 \end_layout
11284
11285 \begin_layout Description
11286 \begin_inset Flex CharStyle:Code
11287 status collapsed
11288
11289 \begin_layout Plain Layout
11290 ListName
11291 \end_layout
11292
11293 \end_inset
11294
11295  [
11296 \begin_inset Flex CharStyle:Code
11297 status collapsed
11298
11299 \begin_layout Plain Layout
11300 string
11301 \end_layout
11302
11303 \end_inset
11304
11305 =
11306 \begin_inset Quotes erd
11307 \end_inset
11308
11309
11310 \begin_inset Quotes erd
11311 \end_inset
11312
11313 ] The heading used for the list of floats.
11314 \end_layout
11315
11316 \begin_layout Description
11317 \begin_inset Flex CharStyle:Code
11318 status collapsed
11319
11320 \begin_layout Plain Layout
11321 NumberWithin
11322 \end_layout
11323
11324 \end_inset
11325
11326  [
11327 \begin_inset Flex CharStyle:Code
11328 status collapsed
11329
11330 \begin_layout Plain Layout
11331 string
11332 \end_layout
11333
11334 \end_inset
11335
11336 =
11337 \begin_inset Quotes erd
11338 \end_inset
11339
11340
11341 \begin_inset Quotes erd
11342 \end_inset
11343
11344 ] This (optional) argument determines whether floats of this class will
11345  be numbered within some sectional unit of the document.
11346  For example, if within is equal to 
11347 \begin_inset Flex CharStyle:Code
11348 status collapsed
11349
11350 \begin_layout Plain Layout
11351 chapter
11352 \end_layout
11353
11354 \end_inset
11355
11356 , the floats will be numbered within chapters.
11357  
11358 \end_layout
11359
11360 \begin_layout Description
11361 \begin_inset Flex CharStyle:Code
11362 status collapsed
11363
11364 \begin_layout Plain Layout
11365 Placement
11366 \end_layout
11367
11368 \end_inset
11369
11370  [
11371 \begin_inset Flex CharStyle:Code
11372 status collapsed
11373
11374 \begin_layout Plain Layout
11375 string
11376 \end_layout
11377
11378 \end_inset
11379
11380 =
11381 \begin_inset Quotes erd
11382 \end_inset
11383
11384
11385 \begin_inset Quotes erd
11386 \end_inset
11387
11388 ] The default placement for the given class of floats.
11389  The string should be as in standard LaTeX: 
11390 \begin_inset Flex CharStyle:Code
11391 status collapsed
11392
11393 \begin_layout Plain Layout
11394 t
11395 \end_layout
11396
11397 \end_inset
11398
11399
11400 \begin_inset Flex CharStyle:Code
11401 status collapsed
11402
11403 \begin_layout Plain Layout
11404 b
11405 \end_layout
11406
11407 \end_inset
11408
11409
11410 \begin_inset Flex CharStyle:Code
11411 status collapsed
11412
11413 \begin_layout Plain Layout
11414 p
11415 \end_layout
11416
11417 \end_inset
11418
11419  and 
11420 \begin_inset Flex CharStyle:Code
11421 status collapsed
11422
11423 \begin_layout Plain Layout
11424 h
11425 \end_layout
11426
11427 \end_inset
11428
11429  for top, bottom, page, and here, respectively.
11430 \begin_inset Foot
11431 status collapsed
11432
11433 \begin_layout Plain Layout
11434 Note that the order of these letters in the string is irrelevant, like in
11435  LaTeX.
11436 \end_layout
11437
11438 \end_inset
11439
11440  On top of that there is a new type, 
11441 \begin_inset Flex CharStyle:Code
11442 status collapsed
11443
11444 \begin_layout Plain Layout
11445 H
11446 \end_layout
11447
11448 \end_inset
11449
11450 , which does not really correspond to a float, since it means: put it 
11451 \begin_inset Quotes eld
11452 \end_inset
11453
11454 here
11455 \begin_inset Quotes erd
11456 \end_inset
11457
11458  and nowhere else.
11459  Note however that the 
11460 \begin_inset Flex CharStyle:Code
11461 status collapsed
11462
11463 \begin_layout Plain Layout
11464 H
11465 \end_layout
11466
11467 \end_inset
11468
11469  specifier is special and, because of implementation details, cannot be
11470  used in non-built in float types.
11471  If you do not understand what this means, just use 
11472 \begin_inset Quotes eld
11473 \end_inset
11474
11475
11476 \begin_inset Flex CharStyle:Code
11477 status collapsed
11478
11479 \begin_layout Plain Layout
11480 tbp
11481 \end_layout
11482
11483 \end_inset
11484
11485
11486 \begin_inset Quotes erd
11487 \end_inset
11488
11489 .
11490 \end_layout
11491
11492 \begin_layout Description
11493 \begin_inset Flex CharStyle:Code
11494 status collapsed
11495
11496 \begin_layout Plain Layout
11497 Style
11498 \end_layout
11499
11500 \end_inset
11501
11502  [
11503 \begin_inset Flex CharStyle:Code
11504 status collapsed
11505
11506 \begin_layout Plain Layout
11507 string
11508 \end_layout
11509
11510 \end_inset
11511
11512 =
11513 \begin_inset Quotes erd
11514 \end_inset
11515
11516
11517 \begin_inset Quotes erd
11518 \end_inset
11519
11520 ] The style used when defining the float using 
11521 \begin_inset Flex CharStyle:Code
11522 status collapsed
11523
11524 \begin_layout Plain Layout
11525
11526 \backslash
11527 newfloat
11528 \end_layout
11529
11530 \end_inset
11531
11532 .
11533 \end_layout
11534
11535 \begin_layout Description
11536 \begin_inset Flex CharStyle:Code
11537 status collapsed
11538
11539 \begin_layout Plain Layout
11540 Type
11541 \end_layout
11542
11543 \end_inset
11544
11545  [
11546 \begin_inset Flex CharStyle:Code
11547 status collapsed
11548
11549 \begin_layout Plain Layout
11550 string
11551 \end_layout
11552
11553 \end_inset
11554
11555 =
11556 \begin_inset Quotes erd
11557 \end_inset
11558
11559
11560 \begin_inset Quotes erd
11561 \end_inset
11562
11563 ] The 
11564 \begin_inset Quotes eld
11565 \end_inset
11566
11567 type
11568 \begin_inset Quotes erd
11569 \end_inset
11570
11571  of the new class of floats, like program or algorithm.
11572  After the appropriate 
11573 \begin_inset Flex CharStyle:Code
11574 status collapsed
11575
11576 \begin_layout Plain Layout
11577
11578 \backslash
11579 newfloat
11580 \end_layout
11581
11582 \end_inset
11583
11584 , commands such as 
11585 \begin_inset Flex CharStyle:Code
11586 status collapsed
11587
11588 \begin_layout Plain Layout
11589
11590 \backslash
11591 begin{program}
11592 \end_layout
11593
11594 \end_inset
11595
11596  or 
11597 \begin_inset Flex CharStyle:Code
11598 status collapsed
11599
11600 \begin_layout Plain Layout
11601
11602 \backslash
11603 end{algorithm*}
11604 \end_layout
11605
11606 \end_inset
11607
11608  will be available.
11609 \end_layout
11610
11611 \begin_layout Standard
11612 Note that defining a float with type 
11613 \begin_inset Flex CharStyle:Code
11614 status collapsed
11615
11616 \begin_layout Plain Layout
11617
11618 \emph on
11619 type
11620 \end_layout
11621
11622 \end_inset
11623
11624  automatically defines the corresponding counter with name 
11625 \begin_inset Flex CharStyle:Code
11626 status collapsed
11627
11628 \begin_layout Plain Layout
11629
11630 \emph on
11631 type
11632 \end_layout
11633
11634 \end_inset
11635
11636 .
11637 \end_layout
11638
11639 \begin_layout Subsection
11640 Flex insets and InsetLayout
11641 \end_layout
11642
11643 \begin_layout Standard
11644 \begin_inset CommandInset label
11645 LatexCommand label
11646 name "sec:charstyle"
11647
11648 \end_inset
11649
11650 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11651  these are called Flex insets.
11652  
11653 \end_layout
11654
11655 \begin_layout Standard
11656 Flex insets come in three different kinds: 
11657 \end_layout
11658
11659 \begin_layout Itemize
11660 character style (
11661 \begin_inset Flex CharStyle:Code
11662 status collapsed
11663
11664 \begin_layout Plain Layout
11665 CharStyle
11666 \end_layout
11667
11668 \end_inset
11669
11670 ): These define semantic markup corresponding to such LaTeX commands as
11671  
11672 \begin_inset Flex CharStyle:Code
11673 status collapsed
11674
11675 \begin_layout Plain Layout
11676
11677 \backslash
11678 noun
11679 \end_layout
11680
11681 \end_inset
11682
11683  and 
11684 \begin_inset Flex CharStyle:Code
11685 status collapsed
11686
11687 \begin_layout Plain Layout
11688
11689 \backslash
11690 code
11691 \end_layout
11692
11693 \end_inset
11694
11695 .
11696 \end_layout
11697
11698 \begin_layout Itemize
11699 user custom (
11700 \begin_inset Flex CharStyle:Code
11701 status collapsed
11702
11703 \begin_layout Plain Layout
11704 Custom
11705 \end_layout
11706
11707 \end_inset
11708
11709 ): These can be used to define custom collapsible insets, similar to TeX
11710  code, footnote, and the like.
11711  An obvious example is an endnote inset, which is defined in the 
11712 \begin_inset Flex CharStyle:Code
11713 status collapsed
11714
11715 \begin_layout Plain Layout
11716 endnote
11717 \end_layout
11718
11719 \end_inset
11720
11721  module.
11722 \end_layout
11723
11724 \begin_layout Itemize
11725 XML elements (
11726 \begin_inset Flex CharStyle:Code
11727 status collapsed
11728
11729 \begin_layout Plain Layout
11730 Element
11731 \end_layout
11732
11733 \end_inset
11734
11735 ): For use with DocBook classes.
11736 \end_layout
11737
11738 \begin_layout Standard
11739 Flex insets are defined using the 
11740 \begin_inset Flex CharStyle:Code
11741 status collapsed
11742
11743 \begin_layout Plain Layout
11744 InsetLayout
11745 \end_layout
11746
11747 \end_inset
11748
11749  tag, which shall be explained in a moment.
11750 \end_layout
11751
11752 \begin_layout Standard
11753 The 
11754 \begin_inset Flex CharStyle:Code
11755 status collapsed
11756
11757 \begin_layout Plain Layout
11758 InsetLayout
11759 \end_layout
11760
11761 \end_inset
11762
11763  tag also serves another function: It can be used to customize the general
11764  layout of many different types of insets.
11765  Currently, 
11766 \begin_inset Flex CharStyle:Code
11767 status collapsed
11768
11769 \begin_layout Plain Layout
11770 InsetLayout
11771 \end_layout
11772
11773 \end_inset
11774
11775  can be used to customize the layout parameters for footnotes, marginal
11776  notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11777  boxes, tables, algorithms, URLs, and optional arguments, as well as to
11778  define Flex insets.
11779 \end_layout
11780
11781 \begin_layout Standard
11782 The 
11783 \begin_inset Flex CharStyle:Code
11784 status collapsed
11785
11786 \begin_layout Plain Layout
11787 InsetLayout
11788 \end_layout
11789
11790 \end_inset
11791
11792  definition must begin with a line of the form:
11793 \end_layout
11794
11795 \begin_layout LyX-Code
11796 InsetLayout <Type>
11797 \end_layout
11798
11799 \begin_layout Standard
11800 Here 
11801 \begin_inset Flex CharStyle:Code
11802 status collapsed
11803
11804 \begin_layout Plain Layout
11805 <Type>
11806 \end_layout
11807
11808 \end_inset
11809
11810  indicates the inset whose layout is being defined, and here there are two
11811  cases.
11812 \end_layout
11813
11814 \begin_layout Enumerate
11815 The layout for a pre-existing inset is being modified.
11816  In this case, can be 
11817 \begin_inset Flex CharStyle:Code
11818 status collapsed
11819
11820 \begin_layout Plain Layout
11821 <Type>
11822 \end_layout
11823
11824 \end_inset
11825
11826  any one of the following: 
11827 \begin_inset Flex CharStyle:Code
11828 status collapsed
11829
11830 \begin_layout Plain Layout
11831 Algorithm
11832 \end_layout
11833
11834 \end_inset
11835
11836
11837 \begin_inset Flex CharStyle:Code
11838 status collapsed
11839
11840 \begin_layout Plain Layout
11841 Branch
11842 \end_layout
11843
11844 \end_inset
11845
11846
11847 \begin_inset Flex CharStyle:Code
11848 status collapsed
11849
11850 \begin_layout Plain Layout
11851 Box
11852 \end_layout
11853
11854 \end_inset
11855
11856
11857 \begin_inset Flex CharStyle:Code
11858 status collapsed
11859
11860 \begin_layout Plain Layout
11861 Box:shaded
11862 \end_layout
11863
11864 \end_inset
11865
11866
11867 \begin_inset Flex CharStyle:Code
11868 status collapsed
11869
11870 \begin_layout Plain Layout
11871 ERT
11872 \end_layout
11873
11874 \end_inset
11875
11876
11877 \begin_inset Flex CharStyle:Code
11878 status collapsed
11879
11880 \begin_layout Plain Layout
11881 Figure
11882 \end_layout
11883
11884 \end_inset
11885
11886
11887 \begin_inset Flex CharStyle:Code
11888 status collapsed
11889
11890 \begin_layout Plain Layout
11891 Foot
11892 \end_layout
11893
11894 \end_inset
11895
11896
11897 \begin_inset Flex CharStyle:Code
11898 status collapsed
11899
11900 \begin_layout Plain Layout
11901 Index
11902 \end_layout
11903
11904 \end_inset
11905
11906
11907 \begin_inset Flex CharStyle:Code
11908 status collapsed
11909
11910 \begin_layout Plain Layout
11911 Info
11912 \end_layout
11913
11914 \end_inset
11915
11916
11917 \begin_inset Flex CharStyle:Code
11918 status collapsed
11919
11920 \begin_layout Plain Layout
11921 Info:menu
11922 \end_layout
11923
11924 \end_inset
11925
11926
11927 \begin_inset Flex CharStyle:Code
11928 status collapsed
11929
11930 \begin_layout Plain Layout
11931 Info:shortcut
11932 \end_layout
11933
11934 \end_inset
11935
11936
11937 \begin_inset Flex CharStyle:Code
11938 status collapsed
11939
11940 \begin_layout Plain Layout
11941 Info:shortcuts
11942 \end_layout
11943
11944 \end_inset
11945
11946
11947 \begin_inset Flex CharStyle:Code
11948 status collapsed
11949
11950 \begin_layout Plain Layout
11951 Listings
11952 \end_layout
11953
11954 \end_inset
11955
11956
11957 \begin_inset Flex CharStyle:Code
11958 status collapsed
11959
11960 \begin_layout Plain Layout
11961 Marginal
11962 \end_layout
11963
11964 \end_inset
11965
11966
11967 \begin_inset Flex CharStyle:Code
11968 status collapsed
11969
11970 \begin_layout Plain Layout
11971 Note:Comment
11972 \end_layout
11973
11974 \end_inset
11975
11976
11977 \begin_inset Flex CharStyle:Code
11978 status collapsed
11979
11980 \begin_layout Plain Layout
11981 Note:Note
11982 \end_layout
11983
11984 \end_inset
11985
11986
11987 \begin_inset Flex CharStyle:Code
11988 status collapsed
11989
11990 \begin_layout Plain Layout
11991 Note:GreyedOut
11992 \end_layout
11993
11994 \end_inset
11995
11996
11997 \begin_inset Flex CharStyle:Code
11998 status collapsed
11999
12000 \begin_layout Plain Layout
12001 OptArg
12002 \end_layout
12003
12004 \end_inset
12005
12006
12007 \begin_inset Flex CharStyle:Code
12008 status collapsed
12009
12010 \begin_layout Plain Layout
12011 Table
12012 \end_layout
12013
12014 \end_inset
12015
12016 , or 
12017 \begin_inset Flex CharStyle:Code
12018 status collapsed
12019
12020 \begin_layout Plain Layout
12021 URL
12022 \end_layout
12023
12024 \end_inset
12025
12026 .
12027  
12028 \end_layout
12029
12030 \begin_layout Enumerate
12031 The layout for a Flex inset is being defined.
12032  In this case, 
12033 \begin_inset Flex CharStyle:Code
12034 status collapsed
12035
12036 \begin_layout Plain Layout
12037 <Type>
12038 \end_layout
12039
12040 \end_inset
12041
12042  can be any valid identifier not used by a pre-existing inset.
12043  Note that the definition of a flex inset must
12044 \emph on
12045  als
12046 \emph default
12047 o include a 
12048 \begin_inset Flex CharStyle:Code
12049 status collapsed
12050
12051 \begin_layout Plain Layout
12052 LyXType
12053 \end_layout
12054
12055 \end_inset
12056
12057  entry.
12058 \end_layout
12059
12060 \begin_layout Standard
12061 The 
12062 \begin_inset Flex CharStyle:Code
12063 status collapsed
12064
12065 \begin_layout Plain Layout
12066 InsetLayout
12067 \end_layout
12068
12069 \end_inset
12070
12071  definition can contain the following entries:
12072 \end_layout
12073
12074 \begin_layout Description
12075 \begin_inset Flex CharStyle:Code
12076 status collapsed
12077
12078 \begin_layout Plain Layout
12079 BgColor
12080 \end_layout
12081
12082 \end_inset
12083
12084  The color for the inset's background.
12085  The valid colors are defined in 
12086 \begin_inset Flex CharStyle:Code
12087 status collapsed
12088
12089 \begin_layout Plain Layout
12090 src/ColorCode.h
12091 \end_layout
12092
12093 \end_inset
12094
12095 .
12096 \end_layout
12097
12098 \begin_layout Description
12099 \begin_inset Flex CharStyle:Code
12100 status collapsed
12101
12102 \begin_layout Plain Layout
12103 CopyStyle
12104 \end_layout
12105
12106 \end_inset
12107
12108  As with paragraph styles (see page 
12109 \begin_inset CommandInset ref
12110 LatexCommand ref
12111 reference "des:CopyStyle"
12112
12113 \end_inset
12114
12115 ).
12116 \end_layout
12117
12118 \begin_layout Description
12119 \begin_inset Flex CharStyle:Code
12120 status collapsed
12121
12122 \begin_layout Plain Layout
12123 CustomPars
12124 \end_layout
12125
12126 \end_inset
12127
12128  [
12129 \begin_inset Flex CharStyle:Code
12130 status collapsed
12131
12132 \begin_layout Plain Layout
12133
12134 \emph on
12135 0
12136 \end_layout
12137
12138 \end_inset
12139
12140 ,
12141 \begin_inset Flex CharStyle:Code
12142 status collapsed
12143
12144 \begin_layout Plain Layout
12145 1
12146 \end_layout
12147
12148 \end_inset
12149
12150 ] Indicates whether the user may employ the Paragraph Settings dialog to
12151  customize the paragraph.
12152 \end_layout
12153
12154 \begin_layout Description
12155 \begin_inset Flex CharStyle:Code
12156 status collapsed
12157
12158 \begin_layout Plain Layout
12159 Decoration
12160 \end_layout
12161
12162 \end_inset
12163
12164  can be 
12165 \begin_inset Flex CharStyle:Code
12166 status collapsed
12167
12168 \begin_layout Plain Layout
12169 Classic
12170 \end_layout
12171
12172 \end_inset
12173
12174
12175 \begin_inset Flex CharStyle:Code
12176 status collapsed
12177
12178 \begin_layout Plain Layout
12179 Minimalistic
12180 \end_layout
12181
12182 \end_inset
12183
12184 , or 
12185 \begin_inset Flex CharStyle:Code
12186 status collapsed
12187
12188 \begin_layout Plain Layout
12189 Conglomerate
12190 \end_layout
12191
12192 \end_inset
12193
12194 , describing the rendering style used for the inset's frame and buttons.
12195  Footnotes generally use 
12196 \begin_inset Flex CharStyle:Code
12197 status collapsed
12198
12199 \begin_layout Plain Layout
12200 Classic
12201 \end_layout
12202
12203 \end_inset
12204
12205 , ERT insets generally 
12206 \begin_inset Flex CharStyle:Code
12207 status collapsed
12208
12209 \begin_layout Plain Layout
12210 Minimalistic
12211 \end_layout
12212
12213 \end_inset
12214
12215 , and character styles 
12216 \begin_inset Flex CharStyle:Code
12217 status collapsed
12218
12219 \begin_layout Plain Layout
12220 Conglomerate
12221 \end_layout
12222
12223 \end_inset
12224
12225 .
12226 \end_layout
12227
12228 \begin_layout Description
12229 \begin_inset Flex CharStyle:Code
12230 status collapsed
12231
12232 \begin_layout Plain Layout
12233 End
12234 \end_layout
12235
12236 \end_inset
12237
12238  Required at the end of the InsetLayout declarations.
12239 \end_layout
12240
12241 \begin_layout Description
12242 \begin_inset Flex CharStyle:Code
12243 status collapsed
12244
12245 \begin_layout Plain Layout
12246 Font
12247 \end_layout
12248
12249 \end_inset
12250
12251  The font used for both the text body 
12252 \emph on
12253 and
12254 \emph default
12255  the label.
12256  See section
12257 \begin_inset space ~
12258 \end_inset
12259
12260
12261 \begin_inset CommandInset ref
12262 LatexCommand ref
12263 reference "sec:fonts"
12264
12265 \end_inset
12266
12267 .
12268  Note that defining this font automatically defines the 
12269 \begin_inset Flex CharStyle:Code
12270 status collapsed
12271
12272 \begin_layout Plain Layout
12273 LabelFont
12274 \end_layout
12275
12276 \end_inset
12277
12278  to the same value, so define this first and define 
12279 \begin_inset Flex CharStyle:Code
12280 status collapsed
12281
12282 \begin_layout Plain Layout
12283 LabelFont
12284 \end_layout
12285
12286 \end_inset
12287
12288  later if you want them to be different.
12289 \end_layout
12290
12291 \begin_layout Description
12292 \begin_inset Flex CharStyle:Code
12293 status collapsed
12294
12295 \begin_layout Plain Layout
12296 ForceLTR
12297 \end_layout
12298
12299 \end_inset
12300
12301  Force the 
12302 \begin_inset Quotes eld
12303 \end_inset
12304
12305 latex
12306 \begin_inset Quotes erd
12307 \end_inset
12308
12309  language, leading to Left-to-Right (latin) output, e.
12310 \begin_inset space \thinspace{}
12311 \end_inset
12312
12313 g.
12314 \begin_inset space \space{}
12315 \end_inset
12316
12317 in TeX code or URL.
12318  A kludge.
12319 \end_layout
12320
12321 \begin_layout Description
12322 \begin_inset Flex CharStyle:Code
12323 status collapsed
12324
12325 \begin_layout Plain Layout
12326 ForcePlain
12327 \end_layout
12328
12329 \end_inset
12330
12331  [
12332 \begin_inset Flex CharStyle:Code
12333 status collapsed
12334
12335 \begin_layout Plain Layout
12336
12337 \emph on
12338 0
12339 \end_layout
12340
12341 \end_inset
12342
12343 ,
12344 \begin_inset Flex CharStyle:Code
12345 status collapsed
12346
12347 \begin_layout Plain Layout
12348 1
12349 \end_layout
12350
12351 \end_inset
12352
12353 ] Indicates whether the PlainLayout should be used or, instead, the user
12354  can change the paragraph style used in the inset.
12355 \end_layout
12356
12357 \begin_layout Description
12358 \begin_inset Flex CharStyle:Code
12359 status collapsed
12360
12361 \begin_layout Plain Layout
12362 FreeSpacing
12363 \end_layout
12364
12365 \end_inset
12366
12367  As with paragraph styles (see page 
12368 \begin_inset CommandInset ref
12369 LatexCommand pageref
12370 reference "des:FreeSpacing"
12371
12372 \end_inset
12373
12374 ).
12375 \end_layout
12376
12377 \begin_layout Description
12378 \begin_inset Flex CharStyle:Code
12379 status collapsed
12380
12381 \begin_layout Plain Layout
12382 KeepEmpty
12383 \end_layout
12384
12385 \end_inset
12386
12387  As with paragraph styles (see page 
12388 \begin_inset CommandInset ref
12389 LatexCommand pageref
12390 reference "des:KeepEmpty"
12391
12392 \end_inset
12393
12394 ).
12395 \end_layout
12396
12397 \begin_layout Description
12398 \begin_inset Flex CharStyle:Code
12399 status collapsed
12400
12401 \begin_layout Plain Layout
12402 LabelFont
12403 \end_layout
12404
12405 \end_inset
12406
12407  The font used for the label.
12408  See section
12409 \begin_inset space ~
12410 \end_inset
12411
12412
12413 \begin_inset CommandInset ref
12414 LatexCommand ref
12415 reference "sec:fonts"
12416
12417 \end_inset
12418
12419 .
12420  Note that this definition can never appear before 
12421 \begin_inset Flex CharStyle:Code
12422 status collapsed
12423
12424 \begin_layout Plain Layout
12425 Font
12426 \end_layout
12427
12428 \end_inset
12429
12430 , lest it be ineffective.
12431 \end_layout
12432
12433 \begin_layout Description
12434 \begin_inset Flex CharStyle:Code
12435 status collapsed
12436
12437 \begin_layout Plain Layout
12438 LabelString
12439 \end_layout
12440
12441 \end_inset
12442
12443  What will be displayed on the button or elsewhere as the inset label.
12444  Some inset types (TeX code and Branch) modify this label on the fly.
12445 \end_layout
12446
12447 \begin_layout Description
12448 \begin_inset Flex CharStyle:Code
12449 status collapsed
12450
12451 \begin_layout Plain Layout
12452 LatexName
12453 \end_layout
12454
12455 \end_inset
12456
12457  The name of the corresponding LaTeX stuff.
12458  Either the environment or command name.
12459 \end_layout
12460
12461 \begin_layout Description
12462 \begin_inset Flex CharStyle:Code
12463 status collapsed
12464
12465 \begin_layout Plain Layout
12466 LatexParam
12467 \end_layout
12468
12469 \end_inset
12470
12471  The optional parameter for the corresponding 
12472 \begin_inset Flex CharStyle:Code
12473 status collapsed
12474
12475 \begin_layout Plain Layout
12476 LatexName
12477 \end_layout
12478
12479 \end_inset
12480
12481  stuff, including possible bracket pairs like 
12482 \begin_inset Flex CharStyle:Code
12483 status collapsed
12484
12485 \begin_layout Plain Layout
12486 []
12487 \end_layout
12488
12489 \end_inset
12490
12491 .
12492  This parameter cannot be changed from within LyX.
12493 \end_layout
12494
12495 \begin_layout Description
12496 \begin_inset Flex CharStyle:Code
12497 status collapsed
12498
12499 \begin_layout Plain Layout
12500 LatexType
12501 \end_layout
12502
12503 \end_inset
12504
12505  As with paragraph styles (see page 
12506 \begin_inset CommandInset ref
12507 LatexCommand pageref
12508 reference "des:LatexType"
12509
12510 \end_inset
12511
12512 ).
12513 \end_layout
12514
12515 \begin_layout Description
12516 \begin_inset Flex CharStyle:Code
12517 status collapsed
12518
12519 \begin_layout Plain Layout
12520 LyxType 
12521 \end_layout
12522
12523 \end_inset
12524
12525  Can be 
12526 \begin_inset Flex CharStyle:Code
12527 status collapsed
12528
12529 \begin_layout Plain Layout
12530 charstyle
12531 \end_layout
12532
12533 \end_inset
12534
12535
12536 \begin_inset Flex CharStyle:Code
12537 status collapsed
12538
12539 \begin_layout Plain Layout
12540 custom
12541 \end_layout
12542
12543 \end_inset
12544
12545
12546 \begin_inset Flex CharStyle:Code
12547 status collapsed
12548
12549 \begin_layout Plain Layout
12550 element
12551 \end_layout
12552
12553 \end_inset
12554
12555 , or 
12556 \begin_inset Flex CharStyle:Code
12557 status collapsed
12558
12559 \begin_layout Plain Layout
12560 end
12561 \end_layout
12562
12563 \end_inset
12564
12565  (indicating a dummy definition ending definitions of charstyles, etc).
12566  This entry is required in and is only meaningful for Flex insets.
12567  Among other things, it determines on which menu this inset will appear.
12568 \end_layout
12569
12570 \begin_layout Description
12571 \begin_inset Flex CharStyle:Code
12572 status collapsed
12573
12574 \begin_layout Plain Layout
12575 MultiPar
12576 \end_layout
12577
12578 \end_inset
12579
12580  [
12581 \begin_inset Flex CharStyle:Code
12582 status collapsed
12583
12584 \begin_layout Plain Layout
12585
12586 \emph on
12587 0
12588 \end_layout
12589
12590 \end_inset
12591
12592 ,
12593 \begin_inset Flex CharStyle:Code
12594 status collapsed
12595
12596 \begin_layout Plain Layout
12597 1
12598 \end_layout
12599
12600 \end_inset
12601
12602 ] Whether multiple paragraphs are permitted in this inset.
12603  This will also set CustomPars to the same value and ForcePlain to the opposite
12604  value.
12605  These can be reset to other values, if they are used 
12606 \emph on
12607 after
12608 \emph default
12609  MultiPar.
12610 \end_layout
12611
12612 \begin_layout Description
12613 \begin_inset Flex CharStyle:Code
12614 status collapsed
12615
12616 \begin_layout Plain Layout
12617 NeedProtect
12618 \end_layout
12619
12620 \end_inset
12621
12622  [
12623 \begin_inset Flex CharStyle:Code
12624 status collapsed
12625
12626 \begin_layout Plain Layout
12627
12628 \emph on
12629 0
12630 \end_layout
12631
12632 \end_inset
12633
12634 ,
12635 \begin_inset Flex CharStyle:Code
12636 status collapsed
12637
12638 \begin_layout Plain Layout
12639 1
12640 \end_layout
12641
12642 \end_inset
12643
12644 ] Whether fragile commands in this layout should be 
12645 \begin_inset Flex CharStyle:Code
12646 status collapsed
12647
12648 \begin_layout Plain Layout
12649
12650 \backslash
12651 protect
12652 \end_layout
12653
12654 \end_inset
12655
12656 'ed.
12657  (Note: This is 
12658 \emph on
12659 not
12660 \emph default
12661  whether the command should itself be protected.)
12662 \end_layout
12663
12664 \begin_layout Description
12665 \begin_inset Flex CharStyle:Code
12666 status collapsed
12667
12668 \begin_layout Plain Layout
12669 PassThru
12670 \end_layout
12671
12672 \end_inset
12673
12674  [
12675 \begin_inset Flex CharStyle:Code
12676 status collapsed
12677
12678 \begin_layout Plain Layout
12679
12680 \emph on
12681 0
12682 \end_layout
12683
12684 \end_inset
12685
12686 ,
12687 \begin_inset Flex CharStyle:Code
12688 status collapsed
12689
12690 \begin_layout Plain Layout
12691 1
12692 \end_layout
12693
12694 \end_inset
12695
12696 ] As with paragraph styles (see page 
12697 \begin_inset CommandInset ref
12698 LatexCommand ref
12699 reference "des:PathThru"
12700
12701 \end_inset
12702
12703 ).
12704 \end_layout
12705
12706 \begin_layout Description
12707 \begin_inset Flex CharStyle:Code
12708 status collapsed
12709
12710 \begin_layout Plain Layout
12711 Preamble
12712 \end_layout
12713
12714 \end_inset
12715
12716  As with paragraph styles (see page 
12717 \begin_inset CommandInset ref
12718 LatexCommand pageref
12719 reference "des:Preamble"
12720
12721 \end_inset
12722
12723 ).
12724 \end_layout
12725
12726 \begin_layout Description
12727 \begin_inset Flex CharStyle:Code
12728 status collapsed
12729
12730 \begin_layout Plain Layout
12731 Requires 
12732 \end_layout
12733
12734 \end_inset
12735
12736  [
12737 \begin_inset Flex CharStyle:Code
12738 status collapsed
12739
12740 \begin_layout Plain Layout
12741 string
12742 \end_layout
12743
12744 \end_inset
12745
12746 ] As with paragraph styles (see page 
12747 \begin_inset CommandInset ref
12748 LatexCommand pageref
12749 reference "des:Requires"
12750
12751 \end_inset
12752
12753 ).
12754 \end_layout
12755
12756 \begin_layout Subsection
12757 Counters
12758 \end_layout
12759
12760 \begin_layout Standard
12761 \begin_inset CommandInset label
12762 LatexCommand label
12763 name "sec:counter"
12764
12765 \end_inset
12766
12767 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12768  counters (
12769 \begin_inset Flex CharStyle:MenuItem
12770 status collapsed
12771
12772 \begin_layout Plain Layout
12773 chapter
12774 \end_layout
12775
12776 \end_inset
12777
12778
12779 \begin_inset Flex CharStyle:MenuItem
12780 status collapsed
12781
12782 \begin_layout Plain Layout
12783 figure
12784 \end_layout
12785
12786 \end_inset
12787
12788 , \SpecialChar \ldots{}
12789 ) in the text class itself.
12790  The standard counters are defined in the file 
12791 \begin_inset Flex CharStyle:Code
12792 status collapsed
12793
12794 \begin_layout Plain Layout
12795 stdcounters.inc
12796 \end_layout
12797
12798 \end_inset
12799
12800 , so you may have to do no more than add
12801 \end_layout
12802
12803 \begin_layout LyX-Code
12804 Input stdcounters.inc
12805 \end_layout
12806
12807 \begin_layout Standard
12808 to your layout file to get them to work.
12809  But if you want to define custom counters, then you can do so.
12810  The counter declaration must begin with:
12811 \end_layout
12812
12813 \begin_layout LyX-Code
12814 Counter name
12815 \end_layout
12816
12817 \begin_layout Standard
12818 where of course `name' is replaced by the name of the counter.
12819  And it must end with 
12820 \begin_inset Quotes eld
12821 \end_inset
12822
12823
12824 \begin_inset Flex CharStyle:Code
12825 status collapsed
12826
12827 \begin_layout Plain Layout
12828 End
12829 \end_layout
12830
12831 \end_inset
12832
12833
12834 \begin_inset Quotes erd
12835 \end_inset
12836
12837 .
12838  The following parameters can also be used:
12839 \end_layout
12840
12841 \begin_layout Description
12842 \begin_inset Flex CharStyle:Code
12843 status collapsed
12844
12845 \begin_layout Plain Layout
12846 LabelString [string=""]
12847 \end_layout
12848
12849 \end_inset
12850
12851  when this is defined, this string defines how the counter is displayed.
12852  Setting this value sets 
12853 \begin_inset Flex CharStyle:Code
12854 status collapsed
12855
12856 \begin_layout Plain Layout
12857 LabelStringAppendix
12858 \end_layout
12859
12860 \end_inset
12861
12862  to the same value.
12863  The following special constructs can be used in the string:
12864 \end_layout
12865
12866 \begin_deeper
12867 \begin_layout Itemize
12868 \begin_inset Flex CharStyle:Code
12869 status collapsed
12870
12871 \begin_layout Plain Layout
12872
12873 \backslash
12874 thecounter
12875 \end_layout
12876
12877 \end_inset
12878
12879  will be replaced by the expansion of the 
12880 \begin_inset Flex CharStyle:Code
12881 status collapsed
12882
12883 \begin_layout Plain Layout
12884 LabelString
12885 \end_layout
12886
12887 \end_inset
12888
12889  (or 
12890 \begin_inset Flex CharStyle:Code
12891 status collapsed
12892
12893 \begin_layout Plain Layout
12894 LabelStringAppendix
12895 \end_layout
12896
12897 \end_inset
12898
12899 ) of the counter 
12900 \begin_inset Flex CharStyle:Code
12901 status collapsed
12902
12903 \begin_layout Plain Layout
12904 counter
12905 \end_layout
12906
12907 \end_inset
12908
12909 .
12910  
12911 \end_layout
12912
12913 \begin_layout Itemize
12914 counter values can be expressed using LaTeX-like macros 
12915 \begin_inset Flex CharStyle:Code
12916 status collapsed
12917
12918 \begin_layout Plain Layout
12919
12920 \backslash
12921
12922 \emph on
12923 numbertype
12924 \emph default
12925 {
12926 \emph on
12927 counter
12928 \emph default
12929 }
12930 \end_layout
12931
12932 \end_inset
12933
12934 , where 
12935 \begin_inset Flex CharStyle:Code
12936 status collapsed
12937
12938 \begin_layout Plain Layout
12939
12940 \emph on
12941 numbertype
12942 \end_layout
12943
12944 \end_inset
12945
12946  can be:
12947 \begin_inset Foot
12948 status collapsed
12949
12950 \begin_layout Plain Layout
12951
12952 \family roman
12953 \series medium
12954 \shape up
12955 \size normal
12956 \emph off
12957 \bar no
12958 \noun off
12959 \color none
12960 Actually, the situation is a bit more complicated: any
12961 \family default
12962 \series default
12963 \shape default
12964 \emph default
12965 \bar default
12966  
12967 \size default
12968 \emph on
12969 \noun default
12970 \color inherit
12971 numbertype
12972 \family roman
12973 \series medium
12974 \shape up
12975 \size normal
12976 \emph off
12977 \bar no
12978 \noun off
12979  other than those described below will produce arabic numerals.
12980  It would not be surprising to see this change in the future.
12981 \end_layout
12982
12983 \end_inset
12984
12985  
12986 \begin_inset Flex CharStyle:Code
12987 status collapsed
12988
12989 \begin_layout Plain Layout
12990 arabic
12991 \end_layout
12992
12993 \end_inset
12994
12995 : 1, 2, 3,\SpecialChar \ldots{}
12996
12997 \begin_inset Flex CharStyle:Code
12998 status collapsed
12999
13000 \begin_layout Plain Layout
13001 alph
13002 \end_layout
13003
13004 \end_inset
13005
13006  for lower-case letters: a, b, c, \SpecialChar \ldots{}
13007
13008 \begin_inset Flex CharStyle:Code
13009 status collapsed
13010
13011 \begin_layout Plain Layout
13012 Alph
13013 \end_layout
13014
13015 \end_inset
13016
13017  for upper-case letters: A, B, C, \SpecialChar \ldots{}
13018
13019 \begin_inset Flex CharStyle:Code
13020 status collapsed
13021
13022 \begin_layout Plain Layout
13023 roman
13024 \end_layout
13025
13026 \end_inset
13027
13028  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13029
13030 \begin_inset Flex CharStyle:Code
13031 status collapsed
13032
13033 \begin_layout Plain Layout
13034 Roman
13035 \end_layout
13036
13037 \end_inset
13038
13039  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13040
13041 \begin_inset Flex CharStyle:Code
13042 status collapsed
13043
13044 \begin_layout Plain Layout
13045 hebrew
13046 \end_layout
13047
13048 \end_inset
13049
13050  for hebrew numerals.
13051 \end_layout
13052
13053 \end_deeper
13054 \begin_layout Standard
13055 If LabelString is not defined, a default value is constructed as follows:
13056  if the counter has a master counter 
13057 \begin_inset Flex CharStyle:Code
13058 status collapsed
13059
13060 \begin_layout Plain Layout
13061 master
13062 \end_layout
13063
13064 \end_inset
13065
13066  (defined via 
13067 \begin_inset Flex CharStyle:Code
13068 status collapsed
13069
13070 \begin_layout Plain Layout
13071 Within
13072 \end_layout
13073
13074 \end_inset
13075
13076 ), the string 
13077 \begin_inset Flex CharStyle:Code
13078 status collapsed
13079
13080 \begin_layout Plain Layout
13081
13082 \backslash
13083 themaster.
13084 \backslash
13085 arabic{counter}
13086 \end_layout
13087
13088 \end_inset
13089
13090  is used; otherwise the string 
13091 \begin_inset Flex CharStyle:Code
13092 status collapsed
13093
13094 \begin_layout Plain Layout
13095
13096 \backslash
13097 arabic{counter}
13098 \end_layout
13099
13100 \end_inset
13101
13102  is used.
13103 \end_layout
13104
13105 \begin_layout Description
13106 \begin_inset Flex CharStyle:Code
13107 status collapsed
13108
13109 \begin_layout Plain Layout
13110 LabelStringAppendix [string=""]
13111 \end_layout
13112
13113 \end_inset
13114
13115  Same as 
13116 \begin_inset Flex CharStyle:Code
13117 status collapsed
13118
13119 \begin_layout Plain Layout
13120 LabelString
13121 \end_layout
13122
13123 \end_inset
13124
13125 , but for use in the Appendix.
13126 \end_layout
13127
13128 \begin_layout Description
13129 \begin_inset Flex CharStyle:Code
13130 status collapsed
13131
13132 \begin_layout Plain Layout
13133 Within
13134 \end_layout
13135
13136 \end_inset
13137
13138  [
13139 \begin_inset Flex CharStyle:Code
13140 status collapsed
13141
13142 \begin_layout Plain Layout
13143 string
13144 \end_layout
13145
13146 \end_inset
13147
13148 =
13149 \begin_inset Quotes erd
13150 \end_inset
13151
13152
13153 \begin_inset Quotes erd
13154 \end_inset
13155
13156 ] If this is set to the name of another counter, the present counter will
13157  be reset every time the other one is increased.
13158  For example, 
13159 \begin_inset Flex CharStyle:Code
13160 status collapsed
13161
13162 \begin_layout Plain Layout
13163 subsection
13164 \end_layout
13165
13166 \end_inset
13167
13168  is numbered inside 
13169 \begin_inset Flex CharStyle:Code
13170 status collapsed
13171
13172 \begin_layout Plain Layout
13173 section
13174 \end_layout
13175
13176 \end_inset
13177
13178 .
13179 \end_layout
13180
13181 \begin_layout Subsection
13182 Font description
13183 \end_layout
13184
13185 \begin_layout Standard
13186 \begin_inset CommandInset label
13187 LatexCommand label
13188 name "sec:fonts"
13189
13190 \end_inset
13191
13192 A font description looks like this:
13193 \end_layout
13194
13195 \begin_layout LyX-Code
13196 Font 
13197 \family roman
13198 \emph on
13199 or
13200 \family default
13201 \emph default
13202  LabelFont
13203 \end_layout
13204
13205 \begin_layout LyX-Code
13206  ...
13207 \end_layout
13208
13209 \begin_layout LyX-Code
13210 EndFont
13211 \end_layout
13212
13213 \begin_layout Standard
13214 The following commands are available:
13215 \end_layout
13216
13217 \begin_layout Description
13218 \begin_inset Flex CharStyle:Code
13219 status collapsed
13220
13221 \begin_layout Plain Layout
13222 Color
13223 \end_layout
13224
13225 \end_inset
13226
13227  [
13228 \begin_inset Flex CharStyle:Code
13229 status collapsed
13230
13231 \begin_layout Plain Layout
13232
13233 \emph on
13234 none
13235 \end_layout
13236
13237 \end_inset
13238
13239
13240 \begin_inset Flex CharStyle:Code
13241 status collapsed
13242
13243 \begin_layout Plain Layout
13244 black
13245 \end_layout
13246
13247 \end_inset
13248
13249
13250 \begin_inset Flex CharStyle:Code
13251 status collapsed
13252
13253 \begin_layout Plain Layout
13254 white
13255 \end_layout
13256
13257 \end_inset
13258
13259
13260 \begin_inset Flex CharStyle:Code
13261 status collapsed
13262
13263 \begin_layout Plain Layout
13264 red
13265 \end_layout
13266
13267 \end_inset
13268
13269
13270 \begin_inset Flex CharStyle:Code
13271 status collapsed
13272
13273 \begin_layout Plain Layout
13274 green
13275 \end_layout
13276
13277 \end_inset
13278
13279
13280 \begin_inset Flex CharStyle:Code
13281 status collapsed
13282
13283 \begin_layout Plain Layout
13284 blue
13285 \end_layout
13286
13287 \end_inset
13288
13289
13290 \begin_inset Flex CharStyle:Code
13291 status collapsed
13292
13293 \begin_layout Plain Layout
13294 cyan
13295 \end_layout
13296
13297 \end_inset
13298
13299
13300 \begin_inset Flex CharStyle:Code
13301 status collapsed
13302
13303 \begin_layout Plain Layout
13304 magenta
13305 \end_layout
13306
13307 \end_inset
13308
13309
13310 \begin_inset Flex CharStyle:Code
13311 status collapsed
13312
13313 \begin_layout Plain Layout
13314 yellow
13315 \end_layout
13316
13317 \end_inset
13318
13319 ]
13320 \end_layout
13321
13322 \begin_layout Description
13323 \begin_inset Flex CharStyle:Code
13324 status collapsed
13325
13326 \begin_layout Plain Layout
13327 Family
13328 \end_layout
13329
13330 \end_inset
13331
13332  [
13333 \emph on
13334
13335 \begin_inset Flex CharStyle:Code
13336 status collapsed
13337
13338 \begin_layout Plain Layout
13339
13340 \emph on
13341 Roman
13342 \end_layout
13343
13344 \end_inset
13345
13346
13347 \emph default
13348
13349 \begin_inset Flex CharStyle:Code
13350 status collapsed
13351
13352 \begin_layout Plain Layout
13353 Sans
13354 \end_layout
13355
13356 \end_inset
13357
13358
13359 \begin_inset Flex CharStyle:Code
13360 status collapsed
13361
13362 \begin_layout Plain Layout
13363 Typewriter
13364 \end_layout
13365
13366 \end_inset
13367
13368
13369 \end_layout
13370
13371 \begin_layout Description
13372 \begin_inset Flex CharStyle:Code
13373 status collapsed
13374
13375 \begin_layout Plain Layout
13376 Misc
13377 \end_layout
13378
13379 \end_inset
13380
13381  [
13382 \begin_inset Flex CharStyle:Code
13383 status collapsed
13384
13385 \begin_layout Plain Layout
13386 string
13387 \end_layout
13388
13389 \end_inset
13390
13391 ] Valid argument are: 
13392 \begin_inset Flex CharStyle:Code
13393 status collapsed
13394
13395 \begin_layout Plain Layout
13396 emph
13397 \end_layout
13398
13399 \end_inset
13400
13401
13402 \begin_inset Flex CharStyle:Code
13403 status collapsed
13404
13405 \begin_layout Plain Layout
13406 noun
13407 \end_layout
13408
13409 \end_inset
13410
13411
13412 \begin_inset Flex CharStyle:Code
13413 status collapsed
13414
13415 \begin_layout Plain Layout
13416 underbar
13417 \end_layout
13418
13419 \end_inset
13420
13421
13422 \begin_inset Flex CharStyle:Code
13423 status collapsed
13424
13425 \begin_layout Plain Layout
13426 no_emph
13427 \end_layout
13428
13429 \end_inset
13430
13431
13432 \begin_inset Flex CharStyle:Code
13433 status collapsed
13434
13435 \begin_layout Plain Layout
13436 no_noun
13437 \end_layout
13438
13439 \end_inset
13440
13441  and 
13442 \begin_inset Flex CharStyle:Code
13443 status collapsed
13444
13445 \begin_layout Plain Layout
13446 no_bar
13447 \end_layout
13448
13449 \end_inset
13450
13451 .
13452  Each of these turns on or off the corresponding attribute.
13453 \end_layout
13454
13455 \begin_layout Description
13456 \begin_inset Flex CharStyle:Code
13457 status collapsed
13458
13459 \begin_layout Plain Layout
13460 Series
13461 \end_layout
13462
13463 \end_inset
13464
13465  [
13466 \emph on
13467
13468 \begin_inset Flex CharStyle:Code
13469 status collapsed
13470
13471 \begin_layout Plain Layout
13472
13473 \emph on
13474 Medium
13475 \end_layout
13476
13477 \end_inset
13478
13479
13480 \emph default
13481
13482 \begin_inset Flex CharStyle:Code
13483 status collapsed
13484
13485 \begin_layout Plain Layout
13486 Bold
13487 \end_layout
13488
13489 \end_inset
13490
13491
13492 \end_layout
13493
13494 \begin_layout Description
13495 \begin_inset Flex CharStyle:Code
13496 status collapsed
13497
13498 \begin_layout Plain Layout
13499 Shape
13500 \end_layout
13501
13502 \end_inset
13503
13504  [
13505 \emph on
13506
13507 \begin_inset Flex CharStyle:Code
13508 status collapsed
13509
13510 \begin_layout Plain Layout
13511
13512 \emph on
13513 Up
13514 \end_layout
13515
13516 \end_inset
13517
13518
13519 \emph default
13520
13521 \begin_inset Flex CharStyle:Code
13522 status collapsed
13523
13524 \begin_layout Plain Layout
13525 Italic
13526 \end_layout
13527
13528 \end_inset
13529
13530
13531 \begin_inset Flex CharStyle:Code
13532 status collapsed
13533
13534 \begin_layout Plain Layout
13535 SmallCaps
13536 \end_layout
13537
13538 \end_inset
13539
13540
13541 \begin_inset Flex CharStyle:Code
13542 status collapsed
13543
13544 \begin_layout Plain Layout
13545 Slanted
13546 \end_layout
13547
13548 \end_inset
13549
13550
13551 \end_layout
13552
13553 \begin_layout Description
13554 \begin_inset Flex CharStyle:Code
13555 status collapsed
13556
13557 \begin_layout Plain Layout
13558 Size
13559 \end_layout
13560
13561 \end_inset
13562
13563  [
13564 \begin_inset Flex CharStyle:Code
13565 status collapsed
13566
13567 \begin_layout Plain Layout
13568 tiny
13569 \end_layout
13570
13571 \end_inset
13572
13573
13574 \begin_inset Flex CharStyle:Code
13575 status collapsed
13576
13577 \begin_layout Plain Layout
13578 small
13579 \end_layout
13580
13581 \end_inset
13582
13583
13584 \begin_inset Flex CharStyle:Code
13585 status collapsed
13586
13587 \begin_layout Plain Layout
13588
13589 \emph on
13590 normal
13591 \end_layout
13592
13593 \end_inset
13594
13595
13596 \begin_inset Flex CharStyle:Code
13597 status collapsed
13598
13599 \begin_layout Plain Layout
13600 large
13601 \end_layout
13602
13603 \end_inset
13604
13605
13606 \begin_inset Flex CharStyle:Code
13607 status collapsed
13608
13609 \begin_layout Plain Layout
13610 larger
13611 \end_layout
13612
13613 \end_inset
13614
13615
13616 \begin_inset Flex CharStyle:Code
13617 status collapsed
13618
13619 \begin_layout Plain Layout
13620 largest
13621 \end_layout
13622
13623 \end_inset
13624
13625
13626 \begin_inset Flex CharStyle:Code
13627 status collapsed
13628
13629 \begin_layout Plain Layout
13630 huge
13631 \end_layout
13632
13633 \end_inset
13634
13635
13636 \begin_inset Flex CharStyle:Code
13637 status collapsed
13638
13639 \begin_layout Plain Layout
13640 giant
13641 \end_layout
13642
13643 \end_inset
13644
13645 ]
13646 \end_layout
13647
13648 \begin_layout Subsection
13649 Upgrading old layout files
13650 \end_layout
13651
13652 \begin_layout Standard
13653 The file format of layout files changes from time to time, so old layout
13654  files need to be converted.
13655  This process has been automated since LyX 1.4.0: If LyX reads an old format
13656  layout file it will call the conversion tool 
13657 \begin_inset Flex CharStyle:Code
13658 status collapsed
13659
13660 \begin_layout Plain Layout
13661 LyXDir/scripts/layout2layout.py
13662 \end_layout
13663
13664 \end_inset
13665
13666  and convert it to a temporary file in current format.
13667  The original file is left untouched.
13668  If you want to convert the layout file permanently, just call the converter
13669  by hand:
13670 \end_layout
13671
13672 \begin_layout LyX-Code
13673 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13674 \end_layout
13675
13676 \begin_layout Standard
13677 (You need to replace 
13678 \begin_inset Flex CharStyle:Code
13679 status collapsed
13680
13681 \begin_layout Plain Layout
13682 $LyXDir
13683 \end_layout
13684
13685 \end_inset
13686
13687  with the name of your LyX system directory, unless you happen to have defined
13688  such an environment variable.) Then copy 
13689 \begin_inset Flex CharStyle:Code
13690 status collapsed
13691
13692 \begin_layout Plain Layout
13693 myclassnew.layout
13694 \end_layout
13695
13696 \end_inset
13697
13698  to 
13699 \begin_inset Flex CharStyle:Code
13700 status collapsed
13701
13702 \begin_layout Plain Layout
13703 UserDir/layouts/
13704 \end_layout
13705
13706 \end_inset
13707
13708 .
13709 \end_layout
13710
13711 \begin_layout Standard
13712 The automatic conversion only handles syntax changes.
13713  It cannot handle the case where the contents of included files was changed,
13714  so these will have to be converted separately.
13715 \end_layout
13716
13717 \begin_layout Section
13718 Creating Templates
13719 \begin_inset CommandInset label
13720 LatexCommand label
13721 name "sec:templates"
13722
13723 \end_inset
13724
13725
13726 \end_layout
13727
13728 \begin_layout Standard
13729 Templates are created just like usual documents.
13730  The only difference is that usual documents contain all possible settings,
13731  including the font scheme and the paper size.
13732  Usually a user doesn't want a template to overwrite his defaults in these
13733  cases.
13734  For that reason, the designer of a template should remove the corresponding
13735  commands like 
13736 \begin_inset Flex CharStyle:Code
13737 status collapsed
13738
13739 \begin_layout Plain Layout
13740
13741 \backslash
13742 fontscheme
13743 \end_layout
13744
13745 \end_inset
13746
13747  or 
13748 \begin_inset Flex CharStyle:Code
13749 status collapsed
13750
13751 \begin_layout Plain Layout
13752
13753 \backslash
13754 papersize
13755 \end_layout
13756
13757 \end_inset
13758
13759  from the template LyX file.
13760  This can be done with any simple text-editor, for example 
13761 \begin_inset Flex CharStyle:Code
13762 status collapsed
13763
13764 \begin_layout Plain Layout
13765 vi
13766 \end_layout
13767
13768 \end_inset
13769
13770  or 
13771 \begin_inset Flex CharStyle:Code
13772 status collapsed
13773
13774 \begin_layout Plain Layout
13775 xedit
13776 \end_layout
13777
13778 \end_inset
13779
13780 .
13781  
13782 \end_layout
13783
13784 \begin_layout Standard
13785 Put the edited template files you create in 
13786 \begin_inset Flex CharStyle:Code
13787 status collapsed
13788
13789 \begin_layout Plain Layout
13790 UserDir/templates/
13791 \end_layout
13792
13793 \end_inset
13794
13795 , copy the ones you use from the global template directory in 
13796 \begin_inset Flex CharStyle:Code
13797 status collapsed
13798
13799 \begin_layout Plain Layout
13800 LyXDir/templates/
13801 \end_layout
13802
13803 \end_inset
13804
13805  to the same place, and redefine the template path in the 
13806 \begin_inset Flex CharStyle:MenuItem
13807 status collapsed
13808
13809 \begin_layout Plain Layout
13810 Tools\SpecialChar \menuseparator
13811 Preferences\SpecialChar \menuseparator
13812 Paths
13813 \end_layout
13814
13815 \end_inset
13816
13817  dialog.
13818 \end_layout
13819
13820 \begin_layout Standard
13821 Note that there is a template which has a particular meaning: 
13822 \begin_inset Flex CharStyle:Code
13823 status collapsed
13824
13825 \begin_layout Plain Layout
13826 defaults.lyx
13827 \end_layout
13828
13829 \end_inset
13830
13831 .
13832  This template is loaded every time you create a new document with 
13833 \begin_inset Flex CharStyle:MenuItem
13834 status collapsed
13835
13836 \begin_layout Plain Layout
13837 File\SpecialChar \menuseparator
13838 New
13839 \end_layout
13840
13841 \end_inset
13842
13843  in order to provide useful defaults.
13844  To create this template from inside LyX, all you have to do is to open
13845  a document with the correct settings, and use the 
13846 \begin_inset Flex CharStyle:MenuItem
13847 status collapsed
13848
13849 \begin_layout Plain Layout
13850 Save as Document Defaults
13851 \end_layout
13852
13853 \end_inset
13854
13855  button.
13856 \end_layout
13857
13858 \begin_layout Chapter
13859 Including External Material
13860 \end_layout
13861
13862 \begin_layout Standard
13863 \begin_inset Box Shadowbox
13864 position "t"
13865 hor_pos "c"
13866 has_inner_box 1
13867 inner_pos "t"
13868 use_parbox 0
13869 width "100col%"
13870 special "none"
13871 height "1in"
13872 height_special "totalheight"
13873 status open
13874
13875 \begin_layout Plain Layout
13876 WARNING: This portion of the documentation has not been updated for some
13877  time.
13878  We certainly hope that it is still accurate, but there are no guarantees.
13879 \end_layout
13880
13881 \end_inset
13882
13883
13884 \end_layout
13885
13886 \begin_layout Standard
13887 The use of material from sources external to LyX is covered in detail in
13888  the 
13889 \emph on
13890 Embedded Objects
13891 \emph default
13892  manual.
13893  This part of the manual covers what needs to happen behind the scenes for
13894  new sorts of material to be included.
13895 \end_layout
13896
13897 \begin_layout Section
13898 How does it work?
13899 \end_layout
13900
13901 \begin_layout Standard
13902 The external material feature is based on the concept of a 
13903 \emph on
13904 template
13905 \emph default
13906 .
13907  A template is a specification of how LyX should interface with a certain
13908  kind of material.
13909  As bundled, LyX comes with predefined templates for Xfig figures, various
13910  raster format images, chess diagrams, and LilyPond music notation.
13911  You can check the actual list by using the menu 
13912 \begin_inset Flex CharStyle:MenuItem
13913 status collapsed
13914
13915 \begin_layout Plain Layout
13916 Insert\SpecialChar \menuseparator
13917 File\SpecialChar \menuseparator
13918 External Material
13919 \end_layout
13920
13921 \end_inset
13922
13923 .
13924  Furthermore, it is possible to roll your own template to support a specific
13925  kind of material.
13926  Later we'll describe in more detail what is involved, and hopefully you
13927  will submit all the templates you create so we can include them in a later
13928  LyX version.
13929 \end_layout
13930
13931 \begin_layout Standard
13932 Another basic idea of the external material feature is to distinguish between
13933  the original file that serves as a base for final material and the produced
13934  file that is included in your exported or printed document.
13935  For example, consider the case of a figure produced with 
13936 \begin_inset Flex CharStyle:Code
13937 status collapsed
13938
13939 \begin_layout Plain Layout
13940 Xfig
13941 \end_layout
13942
13943 \end_inset
13944
13945 .
13946  The Xfig application itself works on an original file with the 
13947 \begin_inset Flex CharStyle:Code
13948 status collapsed
13949
13950 \begin_layout Plain Layout
13951 .fig
13952 \end_layout
13953
13954 \end_inset
13955
13956  extension.
13957  Within Xfig, you create and change your figure, and when you are done,
13958  you save the 
13959 \begin_inset Flex CharStyle:Code
13960 status collapsed
13961
13962 \begin_layout Plain Layout
13963 fig
13964 \end_layout
13965
13966 \end_inset
13967
13968 -file.
13969  When you want to include the figure in your document, you invoke 
13970 \begin_inset Flex CharStyle:Code
13971 status collapsed
13972
13973 \begin_layout Plain Layout
13974 transfig
13975 \end_layout
13976
13977 \end_inset
13978
13979  in order to create a PostScript file that can readily be included in your
13980  LaTeX file.
13981  In this case, the 
13982 \begin_inset Flex CharStyle:Code
13983 status collapsed
13984
13985 \begin_layout Plain Layout
13986 .fig
13987 \end_layout
13988
13989 \end_inset
13990
13991  file is the original file, and the PostScript file is the produced file.
13992 \end_layout
13993
13994 \begin_layout Standard
13995 This distinction is important in order to allow updating of the material
13996  while you are in the process of writing the document.
13997  Furthermore, it provides us with the flexibility that is needed to support
13998  multiple export formats.
13999  For instance, in the case of a plain text file, it is not exactly an award-winn
14000 ing idea to include the figure as raw PostScript.
14001  Instead, you'd either prefer to just include a reference to the figure
14002  or try to invoke some graphics to ASCII converter to make the final result
14003  look similar to the real graphics.
14004  The external material management allows you to do this, because it is parametri
14005 zed on the different export formats that LyX supports.
14006 \end_layout
14007
14008 \begin_layout Standard
14009 Besides supporting the production of different products according to the
14010  exported format, it supports tight integration with editing and viewing
14011  applications.
14012  In the case of an Xfig figure, you are able to invoke Xfig on the original
14013  file with a single click from within the external material dialog in LyX,
14014  and also preview the produced PostScript file with Ghostview with another
14015  click.
14016  No more fiddling around with the command line and/or file browsers to locate
14017  and manipulate the original or produced files.
14018  In this way, you are finally able to take full advantage of the many different
14019  applications that are relevant to use when you write your documents, and
14020  ultimately be more productive.
14021 \end_layout
14022
14023 \begin_layout Section
14024 The external template configuration file
14025 \end_layout
14026
14027 \begin_layout Standard
14028 It is relatively easy to add custom external template definitions to LyX.
14029  However, be aware that doing this in an careless manner most probably 
14030 \emph on
14031 will
14032 \emph default
14033  introduce an easily exploitable security hole.
14034  So before you do this, please read the discussion about security in section
14035  
14036 \begin_inset CommandInset ref
14037 LatexCommand ref
14038 reference "sec:Security-discussion"
14039
14040 \end_inset
14041
14042 .
14043 \end_layout
14044
14045 \begin_layout Standard
14046 Having said that, we encourage you to submit any interesting templates that
14047  you create.
14048  
14049 \end_layout
14050
14051 \begin_layout Standard
14052 The external templates are defined in the 
14053 \begin_inset Flex CharStyle:Code
14054 status collapsed
14055
14056 \begin_layout Plain Layout
14057 LyXDir/lib/external_templates
14058 \end_layout
14059
14060 \end_inset
14061
14062  file.
14063  You can place your own version in 
14064 \begin_inset Flex CharStyle:Code
14065 status collapsed
14066
14067 \begin_layout Plain Layout
14068 UserDir/external_templates
14069 \end_layout
14070
14071 \end_inset
14072
14073 .
14074 \end_layout
14075
14076 \begin_layout Standard
14077 A typical template looks like this:
14078 \end_layout
14079
14080 \begin_layout LyX-Code
14081 Template XFig
14082 \end_layout
14083
14084 \begin_layout LyX-Code
14085 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14086 \end_layout
14087
14088 \begin_layout LyX-Code
14089 HelpText
14090 \end_layout
14091
14092 \begin_layout LyX-Code
14093 An XFig figure.
14094 \end_layout
14095
14096 \begin_layout LyX-Code
14097 HelpTextEnd
14098 \end_layout
14099
14100 \begin_layout LyX-Code
14101 InputFormat fig
14102 \end_layout
14103
14104 \begin_layout LyX-Code
14105 FileFilter "*.fig"
14106 \end_layout
14107
14108 \begin_layout LyX-Code
14109 AutomaticProduction true
14110 \end_layout
14111
14112 \begin_layout LyX-Code
14113 Transform Rotate
14114 \end_layout
14115
14116 \begin_layout LyX-Code
14117 Transform Resize
14118 \end_layout
14119
14120 \begin_layout LyX-Code
14121 Format LaTeX
14122 \end_layout
14123
14124 \begin_layout LyX-Code
14125 TransformCommand Rotate RotationLatexCommand
14126 \end_layout
14127
14128 \begin_layout LyX-Code
14129 TransformCommand Resize ResizeLatexCommand
14130 \end_layout
14131
14132 \begin_layout LyX-Code
14133 Product "$$RotateFront$$ResizeFront
14134 \end_layout
14135
14136 \begin_layout LyX-Code
14137          
14138 \backslash
14139
14140 \backslash
14141 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14142 \end_layout
14143
14144 \begin_layout LyX-Code
14145          $$ResizeBack$$RotateBack"
14146 \end_layout
14147
14148 \begin_layout LyX-Code
14149 UpdateFormat pstex
14150 \end_layout
14151
14152 \begin_layout LyX-Code
14153 UpdateResult "$$AbsPath$$Basename.pstex_t"
14154 \end_layout
14155
14156 \begin_layout LyX-Code
14157 Requirement "graphicx"
14158 \end_layout
14159
14160 \begin_layout LyX-Code
14161 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14162 \end_layout
14163
14164 \begin_layout LyX-Code
14165 ReferencedFile latex "$$AbsPath$$Basename.eps"
14166 \end_layout
14167
14168 \begin_layout LyX-Code
14169 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14170 \end_layout
14171
14172 \begin_layout LyX-Code
14173 FormatEnd
14174 \end_layout
14175
14176 \begin_layout LyX-Code
14177 Format PDFLaTeX
14178 \end_layout
14179
14180 \begin_layout LyX-Code
14181 TransformCommand Rotate RotationLatexCommand
14182 \end_layout
14183
14184 \begin_layout LyX-Code
14185 TransformCommand Resize ResizeLatexCommand
14186 \end_layout
14187
14188 \begin_layout LyX-Code
14189 Product "$$RotateFront$$ResizeFront
14190 \end_layout
14191
14192 \begin_layout LyX-Code
14193          
14194 \backslash
14195
14196 \backslash
14197 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14198 \end_layout
14199
14200 \begin_layout LyX-Code
14201          $$ResizeBack$$RotateBack"
14202 \end_layout
14203
14204 \begin_layout LyX-Code
14205 UpdateFormat pdftex
14206 \end_layout
14207
14208 \begin_layout LyX-Code
14209 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14210 \end_layout
14211
14212 \begin_layout LyX-Code
14213 Requirement "graphicx"
14214 \end_layout
14215
14216 \begin_layout LyX-Code
14217 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14218 \end_layout
14219
14220 \begin_layout LyX-Code
14221 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14222 \end_layout
14223
14224 \begin_layout LyX-Code
14225 FormatEnd
14226 \end_layout
14227
14228 \begin_layout LyX-Code
14229 Format Ascii
14230 \end_layout
14231
14232 \begin_layout LyX-Code
14233 Product "$$Contents(
14234 \backslash
14235 "$$AbsPath$$Basename.asc
14236 \backslash
14237 ")"
14238 \end_layout
14239
14240 \begin_layout LyX-Code
14241 UpdateFormat asciixfig
14242 \end_layout
14243
14244 \begin_layout LyX-Code
14245 UpdateResult "$$AbsPath$$Basename.asc"
14246 \end_layout
14247
14248 \begin_layout LyX-Code
14249 FormatEnd
14250 \end_layout
14251
14252 \begin_layout LyX-Code
14253 Format DocBook
14254 \end_layout
14255
14256 \begin_layout LyX-Code
14257 Product "<graphic fileref=
14258 \backslash
14259 "$$AbsOrRelPathMaster$$Basename.eps
14260 \backslash
14261 ">
14262 \end_layout
14263
14264 \begin_layout LyX-Code
14265          </graphic>"
14266 \end_layout
14267
14268 \begin_layout LyX-Code
14269 UpdateFormat eps
14270 \end_layout
14271
14272 \begin_layout LyX-Code
14273 UpdateResult "$$AbsPath$$Basename.eps"
14274 \end_layout
14275
14276 \begin_layout LyX-Code
14277 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14278 \end_layout
14279
14280 \begin_layout LyX-Code
14281 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14282 \end_layout
14283
14284 \begin_layout LyX-Code
14285 FormatEnd
14286 \end_layout
14287
14288 \begin_layout LyX-Code
14289 Product "[XFig: $$FName]"
14290 \end_layout
14291
14292 \begin_layout LyX-Code
14293 FormatEnd
14294 \end_layout
14295
14296 \begin_layout LyX-Code
14297 TemplateEnd
14298 \end_layout
14299
14300 \begin_layout Standard
14301 As you can see, the template is enclosed in 
14302 \begin_inset Flex CharStyle:Code
14303 status collapsed
14304
14305 \begin_layout Plain Layout
14306 Template
14307 \end_layout
14308
14309 \end_inset
14310
14311  \SpecialChar \ldots{}
14312  
14313 \begin_inset Flex CharStyle:Code
14314 status collapsed
14315
14316 \begin_layout Plain Layout
14317 TemplateEnd
14318 \end_layout
14319
14320 \end_inset
14321
14322 .
14323  It contains a header specifying some general settings and, for each supported
14324  primary document file format, a section 
14325 \begin_inset Flex CharStyle:Code
14326 status collapsed
14327
14328 \begin_layout Plain Layout
14329 Format
14330 \end_layout
14331
14332 \end_inset
14333
14334  \SpecialChar \ldots{}
14335  
14336 \begin_inset Flex CharStyle:Code
14337 status collapsed
14338
14339 \begin_layout Plain Layout
14340 FormatEnd
14341 \end_layout
14342
14343 \end_inset
14344
14345 .
14346 \end_layout
14347
14348 \begin_layout Subsection
14349 The template header
14350 \end_layout
14351
14352 \begin_layout Description
14353 \begin_inset Flex CharStyle:Code
14354 status collapsed
14355
14356 \begin_layout Plain Layout
14357 AutomaticProduction
14358 \begin_inset space ~
14359 \end_inset
14360
14361 true|false
14362 \end_layout
14363
14364 \end_inset
14365
14366  Whether the file represented by the template must be generated by LyX.
14367  This command must occur exactly once.
14368 \end_layout
14369
14370 \begin_layout Description
14371 \begin_inset Flex CharStyle:Code
14372 status collapsed
14373
14374 \begin_layout Plain Layout
14375 FileFilter
14376 \begin_inset space ~
14377 \end_inset
14378
14379 <pattern>
14380 \end_layout
14381
14382 \end_inset
14383
14384  A glob pattern that is used in the file dialog to filter out the desired
14385  files.
14386  If there is more than one possible file extension (e.
14387 \begin_inset space \thinspace{}
14388 \end_inset
14389
14390 g.
14391 \begin_inset space \space{}
14392 \end_inset
14393
14394 tgif has 
14395 \begin_inset Flex CharStyle:Code
14396 status collapsed
14397
14398 \begin_layout Plain Layout
14399 .obj
14400 \end_layout
14401
14402 \end_inset
14403
14404  and 
14405 \begin_inset Flex CharStyle:Code
14406 status collapsed
14407
14408 \begin_layout Plain Layout
14409 .tgo
14410 \end_layout
14411
14412 \end_inset
14413
14414 ), use something like 
14415 \begin_inset Flex CharStyle:Code
14416 status collapsed
14417
14418 \begin_layout Plain Layout
14419 "*.{obj,tgo}"
14420 \end_layout
14421
14422 \end_inset
14423
14424 .
14425  This command must occur exactly once.
14426 \end_layout
14427
14428 \begin_layout Description
14429 \begin_inset Flex CharStyle:Code
14430 status collapsed
14431
14432 \begin_layout Plain Layout
14433 GuiName
14434 \begin_inset space ~
14435 \end_inset
14436
14437 <guiname>
14438 \end_layout
14439
14440 \end_inset
14441
14442  The text that is displayed on the button.
14443  This command must occur exactly once.
14444 \end_layout
14445
14446 \begin_layout Description
14447 \begin_inset Flex CharStyle:Code
14448 status collapsed
14449
14450 \begin_layout Plain Layout
14451 HelpText
14452 \begin_inset space ~
14453 \end_inset
14454
14455 <text>
14456 \begin_inset space ~
14457 \end_inset
14458
14459 HelpTextEnd
14460 \end_layout
14461
14462 \end_inset
14463
14464  The help text that is used in the External dialog.
14465  Provide enough information to explain to the user just what the template
14466  can provide him with.
14467  This command must occur exactly once.
14468 \end_layout
14469
14470 \begin_layout Description
14471 \begin_inset Flex CharStyle:Code
14472 status collapsed
14473
14474 \begin_layout Plain Layout
14475 InputFormat
14476 \begin_inset space ~
14477 \end_inset
14478
14479 <format>
14480 \end_layout
14481
14482 \end_inset
14483
14484  The file format of the original file.
14485  This must be the name of a format that is known to LyX (see section 
14486 \begin_inset CommandInset ref
14487 LatexCommand ref
14488 reference "sub:Formats"
14489
14490 \end_inset
14491
14492 ).
14493  Use 
14494 \begin_inset Quotes eld
14495 \end_inset
14496
14497
14498 \begin_inset Flex CharStyle:Code
14499 status collapsed
14500
14501 \begin_layout Plain Layout
14502 *
14503 \end_layout
14504
14505 \end_inset
14506
14507
14508 \begin_inset Quotes erd
14509 \end_inset
14510
14511  if the template can handle original files of more than one format.
14512  LyX will attempt to interrogate the file itself in order to deduce its
14513  format in this case.
14514  This command must occur exactly once.
14515 \end_layout
14516
14517 \begin_layout Description
14518 \begin_inset Flex CharStyle:Code
14519 status collapsed
14520
14521 \begin_layout Plain Layout
14522 Template
14523 \begin_inset space ~
14524 \end_inset
14525
14526 <id>
14527 \end_layout
14528
14529 \end_inset
14530
14531  A unique name for the template.
14532  It must not contain substitution macros (see below).
14533 \end_layout
14534
14535 \begin_layout Description
14536 \begin_inset Flex CharStyle:Code
14537 status collapsed
14538
14539 \begin_layout Plain Layout
14540 Transform
14541 \begin_inset space ~
14542 \end_inset
14543
14544 Rotate|Resize|Clip|Extra
14545 \end_layout
14546
14547 \end_inset
14548
14549  This command specifies which transformations are supported by this template.
14550  It may occur zero or more times.
14551  This command enables the corresponding tabs in the external dialog.
14552  Each 
14553 \begin_inset Flex CharStyle:Code
14554 status collapsed
14555
14556 \begin_layout Plain Layout
14557 Transform
14558 \end_layout
14559
14560 \end_inset
14561
14562  command must have either a corresponding 
14563 \begin_inset Flex CharStyle:Code
14564 status collapsed
14565
14566 \begin_layout Plain Layout
14567 TransformCommand
14568 \end_layout
14569
14570 \end_inset
14571
14572  or a 
14573 \begin_inset Flex CharStyle:Code
14574 status collapsed
14575
14576 \begin_layout Plain Layout
14577 TransformOption
14578 \end_layout
14579
14580 \end_inset
14581
14582  command in the 
14583 \begin_inset Flex CharStyle:Code
14584 status collapsed
14585
14586 \begin_layout Plain Layout
14587 Format
14588 \end_layout
14589
14590 \end_inset
14591
14592  section.
14593  Otherwise the transformation will not be supported by that format.
14594 \end_layout
14595
14596 \begin_layout Subsection
14597 The Format section
14598 \end_layout
14599
14600 \begin_layout Description
14601 \begin_inset Flex CharStyle:Code
14602 status collapsed
14603
14604 \begin_layout Plain Layout
14605 Format
14606 \begin_inset space ~
14607 \end_inset
14608
14609 LaTeX|PDFLaTeX|PlainText|DocBook
14610 \end_layout
14611
14612 \end_inset
14613
14614  The primary document file format that this format definition is for.
14615  Not every template has a sensible representation in all document file formats.
14616  Please define nevertheless a 
14617 \begin_inset Flex CharStyle:Code
14618 status collapsed
14619
14620 \begin_layout Plain Layout
14621 Format
14622 \end_layout
14623
14624 \end_inset
14625
14626  section for all formats.
14627  Use a dummy text when no representation is available.
14628  Then you can at least see a reference to the external material in the exported
14629  document.
14630 \end_layout
14631
14632 \begin_layout Description
14633 \begin_inset Flex CharStyle:Code
14634 status collapsed
14635
14636 \begin_layout Plain Layout
14637 Option
14638 \begin_inset space ~
14639 \end_inset
14640
14641 <name>
14642 \begin_inset space ~
14643 \end_inset
14644
14645 <value>
14646 \end_layout
14647
14648 \end_inset
14649
14650  This command defines an additional macro 
14651 \begin_inset Flex CharStyle:Code
14652 status collapsed
14653
14654 \begin_layout Plain Layout
14655 $$<name>
14656 \end_layout
14657
14658 \end_inset
14659
14660  for substitution in 
14661 \begin_inset Flex CharStyle:Code
14662 status collapsed
14663
14664 \begin_layout Plain Layout
14665 Product
14666 \end_layout
14667
14668 \end_inset
14669
14670 .
14671  
14672 \begin_inset Flex CharStyle:Code
14673 status collapsed
14674
14675 \begin_layout Plain Layout
14676 <value>
14677 \end_layout
14678
14679 \end_inset
14680
14681  itself may contain substitution macros.
14682  The advantage over using 
14683 \begin_inset Flex CharStyle:Code
14684 status collapsed
14685
14686 \begin_layout Plain Layout
14687 <value>
14688 \end_layout
14689
14690 \end_inset
14691
14692  directly in 
14693 \begin_inset Flex CharStyle:Code
14694 status collapsed
14695
14696 \begin_layout Plain Layout
14697 Product
14698 \end_layout
14699
14700 \end_inset
14701
14702  is that the substituted value of 
14703 \begin_inset Flex CharStyle:Code
14704 status collapsed
14705
14706 \begin_layout Plain Layout
14707 $$<name>
14708 \end_layout
14709
14710 \end_inset
14711
14712  is sanitized so that it is a valid optional argument in the document format.
14713  This command may occur zero or more times.
14714 \end_layout
14715
14716 \begin_layout Description
14717 \begin_inset Flex CharStyle:Code
14718 status collapsed
14719
14720 \begin_layout Plain Layout
14721 Product
14722 \begin_inset space ~
14723 \end_inset
14724
14725 <text>
14726 \end_layout
14727
14728 \end_inset
14729
14730  The text that is inserted in the exported document.
14731  This is actually the most important command and can be quite complex.
14732  This command must occur exactly once.
14733 \end_layout
14734
14735 \begin_layout Description
14736 \begin_inset Flex CharStyle:Code
14737 status collapsed
14738
14739 \begin_layout Plain Layout
14740 Preamble
14741 \begin_inset space ~
14742 \end_inset
14743
14744 <name>
14745 \end_layout
14746
14747 \end_inset
14748
14749  This command specifies a preamble snippet that will be included in the
14750  LaTeX preamble.
14751  It has to be defined using 
14752 \begin_inset Flex CharStyle:Code
14753 status collapsed
14754
14755 \begin_layout Plain Layout
14756 PreambleDef
14757 \end_layout
14758
14759 \end_inset
14760
14761  \SpecialChar \ldots{}
14762  
14763 \begin_inset Flex CharStyle:Code
14764 status collapsed
14765
14766 \begin_layout Plain Layout
14767 PreambleDefEnd
14768 \end_layout
14769
14770 \end_inset
14771
14772 .
14773  This command may occur zero or more times.
14774 \end_layout
14775
14776 \begin_layout Description
14777 \begin_inset Flex CharStyle:Code
14778 status collapsed
14779
14780 \begin_layout Plain Layout
14781 ReferencedFile
14782 \begin_inset space ~
14783 \end_inset
14784
14785 <format>
14786 \begin_inset space ~
14787 \end_inset
14788
14789 <filename>
14790 \end_layout
14791
14792 \end_inset
14793
14794  This command denotes files that are created by the conversion process and
14795  are needed for a particular export format.
14796  If the filename is relative, it is interpreted relative to the master document.
14797  This command may be given zero or more times.
14798 \end_layout
14799
14800 \begin_layout Description
14801 \begin_inset Flex CharStyle:Code
14802 status collapsed
14803
14804 \begin_layout Plain Layout
14805 Requirement
14806 \begin_inset space ~
14807 \end_inset
14808
14809 <package>
14810 \end_layout
14811
14812 \end_inset
14813
14814  The name of a required LaTeX package.
14815  The package is included via 
14816 \begin_inset Flex CharStyle:Code
14817 status collapsed
14818
14819 \begin_layout Plain Layout
14820
14821 \backslash
14822 usepackage{}
14823 \end_layout
14824
14825 \end_inset
14826
14827  in the LaTeX preamble.
14828  This command may occur zero or more times.
14829 \end_layout
14830
14831 \begin_layout Description
14832 \begin_inset Flex CharStyle:Code
14833 status collapsed
14834
14835 \begin_layout Plain Layout
14836 TransformCommand
14837 \begin_inset space ~
14838 \end_inset
14839
14840 Rotate
14841 \begin_inset space ~
14842 \end_inset
14843
14844 RotationLatexCommand
14845 \end_layout
14846
14847 \end_inset
14848
14849  This command specifies that the built in LaTeX command should be used for
14850  rotation.
14851  This command may occur once or not at all.
14852 \end_layout
14853
14854 \begin_layout Description
14855 \begin_inset Flex CharStyle:Code
14856 status collapsed
14857
14858 \begin_layout Plain Layout
14859 TransformCommand
14860 \begin_inset space ~
14861 \end_inset
14862
14863 Resize
14864 \begin_inset space ~
14865 \end_inset
14866
14867 ResizeLatexCommand
14868 \end_layout
14869
14870 \end_inset
14871
14872  This command specifies that the built in LaTeX command should be used for
14873  resizing.
14874  This command may occur once or not at all.
14875 \end_layout
14876
14877 \begin_layout Description
14878 \begin_inset Flex CharStyle:Code
14879 status collapsed
14880
14881 \begin_layout Plain Layout
14882 TransformOption
14883 \begin_inset space ~
14884 \end_inset
14885
14886 Rotate
14887 \begin_inset space ~
14888 \end_inset
14889
14890 RotationLatexOption
14891 \end_layout
14892
14893 \end_inset
14894
14895  This command specifies that rotation is done via an optional argument.
14896  This command may occur once or not at all.
14897 \end_layout
14898
14899 \begin_layout Description
14900 \begin_inset Flex CharStyle:Code
14901 status collapsed
14902
14903 \begin_layout Plain Layout
14904 TransformOption
14905 \begin_inset space ~
14906 \end_inset
14907
14908 Resize
14909 \begin_inset space ~
14910 \end_inset
14911
14912 ResizeLatexOption
14913 \end_layout
14914
14915 \end_inset
14916
14917  This command specifies that resizing is done via an optional argument.
14918  This command may occur once or not at all.
14919 \end_layout
14920
14921 \begin_layout Description
14922 \begin_inset Flex CharStyle:Code
14923 status collapsed
14924
14925 \begin_layout Plain Layout
14926 TransformOption
14927 \begin_inset space ~
14928 \end_inset
14929
14930 Clip
14931 \begin_inset space ~
14932 \end_inset
14933
14934 ClipLatexOption
14935 \end_layout
14936
14937 \end_inset
14938
14939  This command specifies that clipping is done via an optional argument.
14940  This command may occur once or not at all.
14941 \end_layout
14942
14943 \begin_layout Description
14944 \begin_inset Flex CharStyle:Code
14945 status collapsed
14946
14947 \begin_layout Plain Layout
14948 TransformOption
14949 \begin_inset space ~
14950 \end_inset
14951
14952 Extra
14953 \begin_inset space ~
14954 \end_inset
14955
14956 ExtraLatexOption
14957 \end_layout
14958
14959 \end_inset
14960
14961  This command specifies that an extra optional argument is used.
14962  This command may occur once or not at all.
14963 \end_layout
14964
14965 \begin_layout Description
14966 \begin_inset Flex CharStyle:Code
14967 status collapsed
14968
14969 \begin_layout Plain Layout
14970 UpdateFormat
14971 \begin_inset space ~
14972 \end_inset
14973
14974 <format>
14975 \end_layout
14976
14977 \end_inset
14978
14979  The file format of the converted file.
14980  This must be the name of a format that is known to LyX (see the 
14981 \begin_inset Flex CharStyle:MenuItem
14982 status collapsed
14983
14984 \begin_layout Plain Layout
14985
14986 \bar under
14987 T
14988 \bar default
14989 ools\SpecialChar \menuseparator
14990
14991 \bar under
14992 P
14993 \bar default
14994 references:Conversion
14995 \end_layout
14996
14997 \end_inset
14998
14999  dialog).
15000  This command must occur exactly once.
15001 \end_layout
15002
15003 \begin_layout Description
15004 \begin_inset Flex CharStyle:Code
15005 status collapsed
15006
15007 \begin_layout Plain Layout
15008 UpdateResult
15009 \begin_inset space ~
15010 \end_inset
15011
15012 <filename>
15013 \end_layout
15014
15015 \end_inset
15016
15017  The file name of the converted file.
15018  The file name must be absolute.
15019  This command must occur exactly once.
15020 \end_layout
15021
15022 \begin_layout Subsection
15023 Preamble definitions
15024 \end_layout
15025
15026 \begin_layout Standard
15027 The external template configuration file may contain additional preamble
15028  definitions enclosed by 
15029 \begin_inset Flex CharStyle:Code
15030 status collapsed
15031
15032 \begin_layout Plain Layout
15033 PreambleDef
15034 \end_layout
15035
15036 \end_inset
15037
15038  \SpecialChar \ldots{}
15039  
15040 \begin_inset Flex CharStyle:Code
15041 status collapsed
15042
15043 \begin_layout Plain Layout
15044 PreambleDefEnd
15045 \end_layout
15046
15047 \end_inset
15048
15049 .
15050  They can be used by the templates in the 
15051 \begin_inset Flex CharStyle:Code
15052 status collapsed
15053
15054 \begin_layout Plain Layout
15055 Format
15056 \end_layout
15057
15058 \end_inset
15059
15060  section.
15061 \end_layout
15062
15063 \begin_layout Section
15064 The substitution mechanism
15065 \end_layout
15066
15067 \begin_layout Standard
15068 When the external material facility invokes an external program, it is done
15069  on the basis of a command defined in the template configuration file.
15070  These commands can contain various macros that are expanded before execution.
15071  Execution always take place in the directory of the containing document.
15072 \end_layout
15073
15074 \begin_layout Standard
15075 Also, whenever external material is to be displayed, the name will be produced
15076  by the substitution mechanism, and most other commands in the template
15077  definition support substitution as well.
15078 \end_layout
15079
15080 \begin_layout Standard
15081 The available macros are the following:
15082 \end_layout
15083
15084 \begin_layout Description
15085 \begin_inset Flex CharStyle:Code
15086 status collapsed
15087
15088 \begin_layout Plain Layout
15089 $$AbsOrRelPathMaster
15090 \end_layout
15091
15092 \end_inset
15093
15094  The file path, absolute or relative to the master LyX document.
15095 \end_layout
15096
15097 \begin_layout Description
15098 \begin_inset Flex CharStyle:Code
15099 status collapsed
15100
15101 \begin_layout Plain Layout
15102 $$AbsOrRelPathParent
15103 \end_layout
15104
15105 \end_inset
15106
15107  The file path, absolute or relative to the LyX document.
15108 \end_layout
15109
15110 \begin_layout Description
15111 \begin_inset Flex CharStyle:Code
15112 status collapsed
15113
15114 \begin_layout Plain Layout
15115 $$AbsPath
15116 \end_layout
15117
15118 \end_inset
15119
15120  The absolute file path.
15121 \end_layout
15122
15123 \begin_layout Description
15124 \begin_inset Flex CharStyle:Code
15125 status collapsed
15126
15127 \begin_layout Plain Layout
15128 $$Basename
15129 \end_layout
15130
15131 \end_inset
15132
15133  The filename without path and without the extension.
15134 \end_layout
15135
15136 \begin_layout Description
15137 \begin_inset Flex CharStyle:Code
15138 status collapsed
15139
15140 \begin_layout Plain Layout
15141 $$Contents(
15142 \begin_inset Quotes eld
15143 \end_inset
15144
15145 filename.ext
15146 \begin_inset Quotes erd
15147 \end_inset
15148
15149 )
15150 \end_layout
15151
15152 \end_inset
15153
15154  This macro will expand to the contents of the file with the name 
15155 \begin_inset Flex CharStyle:Code
15156 status collapsed
15157
15158 \begin_layout Plain Layout
15159 filename.ext
15160 \end_layout
15161
15162 \end_inset
15163
15164 .
15165 \end_layout
15166
15167 \begin_layout Description
15168 \begin_inset Flex CharStyle:Code
15169 status collapsed
15170
15171 \begin_layout Plain Layout
15172 $$Extension
15173 \end_layout
15174
15175 \end_inset
15176
15177  The file extension (including the dot).
15178 \end_layout
15179
15180 \begin_layout Description
15181 \begin_inset Flex CharStyle:Code
15182 status collapsed
15183
15184 \begin_layout Plain Layout
15185 $$FName
15186 \end_layout
15187
15188 \end_inset
15189
15190  The filename of the file specified in the external material dialog.
15191  This is either an absolute name, or it is relative to the LyX document.
15192 \end_layout
15193
15194 \begin_layout Description
15195 \begin_inset Flex CharStyle:Code
15196 status collapsed
15197
15198 \begin_layout Plain Layout
15199 $$FPath
15200 \end_layout
15201
15202 \end_inset
15203
15204  The path part of 
15205 \begin_inset Flex CharStyle:Code
15206 status collapsed
15207
15208 \begin_layout Plain Layout
15209 $$FName
15210 \end_layout
15211
15212 \end_inset
15213
15214  (absolute name or relative to the LyX document).
15215 \end_layout
15216
15217 \begin_layout Description
15218 \begin_inset Flex CharStyle:Code
15219 status collapsed
15220
15221 \begin_layout Plain Layout
15222 $$RelPathMaster
15223 \end_layout
15224
15225 \end_inset
15226
15227  The file path, relative to the master LyX document.
15228 \end_layout
15229
15230 \begin_layout Description
15231 \begin_inset Flex CharStyle:Code
15232 status collapsed
15233
15234 \begin_layout Plain Layout
15235 $$RelPathParent
15236 \end_layout
15237
15238 \end_inset
15239
15240  The file path, relative to the LyX document.
15241 \end_layout
15242
15243 \begin_layout Description
15244 \begin_inset Flex CharStyle:Code
15245 status collapsed
15246
15247 \begin_layout Plain Layout
15248 $$Sysdir
15249 \end_layout
15250
15251 \end_inset
15252
15253  This macro will expand to the absolute path of the system directory.
15254  This is typically used to point to the various helper scripts that are
15255  bundled with LyX.
15256 \end_layout
15257
15258 \begin_layout Description
15259 \begin_inset Flex CharStyle:Code
15260 status collapsed
15261
15262 \begin_layout Plain Layout
15263 $$Tempname
15264 \end_layout
15265
15266 \end_inset
15267
15268  A name and full path to a temporary file which will be automatically deleted
15269  whenever the containing document is closed, or the external material insertion
15270  deleted.
15271 \end_layout
15272
15273 \begin_layout Standard
15274 All path macros contain a trailing directory separator, so you can construct
15275  e.
15276 \begin_inset space \thinspace{}
15277 \end_inset
15278
15279 g.
15280 \begin_inset space \space{}
15281 \end_inset
15282
15283 the absolute filename with 
15284 \begin_inset Flex CharStyle:Code
15285 status collapsed
15286
15287 \begin_layout Plain Layout
15288 $$AbsPath$$Basename$$Extension
15289 \end_layout
15290
15291 \end_inset
15292
15293 .
15294 \end_layout
15295
15296 \begin_layout Standard
15297 The macros above are substituted in all commands unless otherwise noted.
15298  The command 
15299 \begin_inset Flex CharStyle:Code
15300 status collapsed
15301
15302 \begin_layout Plain Layout
15303 Product
15304 \end_layout
15305
15306 \end_inset
15307
15308  supports additionally the following substitutions if they are enabled by
15309  the 
15310 \begin_inset Flex CharStyle:Code
15311 status collapsed
15312
15313 \begin_layout Plain Layout
15314 Transform
15315 \end_layout
15316
15317 \end_inset
15318
15319  and 
15320 \begin_inset Flex CharStyle:Code
15321 status collapsed
15322
15323 \begin_layout Plain Layout
15324 TransformCommand
15325 \end_layout
15326
15327 \end_inset
15328
15329  commands:
15330 \end_layout
15331
15332 \begin_layout Description
15333 \begin_inset Flex CharStyle:Code
15334 status collapsed
15335
15336 \begin_layout Plain Layout
15337 $$ResizeFront
15338 \end_layout
15339
15340 \end_inset
15341
15342  The front part of the resize command.
15343 \end_layout
15344
15345 \begin_layout Description
15346 \begin_inset Flex CharStyle:Code
15347 status collapsed
15348
15349 \begin_layout Plain Layout
15350 $$ResizeBack
15351 \end_layout
15352
15353 \end_inset
15354
15355  The back part of the resize command.
15356 \end_layout
15357
15358 \begin_layout Description
15359 \begin_inset Flex CharStyle:Code
15360 status collapsed
15361
15362 \begin_layout Plain Layout
15363 $$RotateFront
15364 \end_layout
15365
15366 \end_inset
15367
15368  The front part of the rotation command.
15369 \end_layout
15370
15371 \begin_layout Description
15372 \begin_inset Flex CharStyle:Code
15373 status collapsed
15374
15375 \begin_layout Plain Layout
15376 $$RotateBack
15377 \end_layout
15378
15379 \end_inset
15380
15381  The back part of the rotation command.
15382 \end_layout
15383
15384 \begin_layout Standard
15385 The value string of the 
15386 \begin_inset Flex CharStyle:Code
15387 status collapsed
15388
15389 \begin_layout Plain Layout
15390 Option
15391 \end_layout
15392
15393 \end_inset
15394
15395  command supports additionally the following substitutions if they are enabled
15396  by the 
15397 \begin_inset Flex CharStyle:Code
15398 status collapsed
15399
15400 \begin_layout Plain Layout
15401 Transform
15402 \end_layout
15403
15404 \end_inset
15405
15406  and 
15407 \begin_inset Flex CharStyle:Code
15408 status collapsed
15409
15410 \begin_layout Plain Layout
15411 TransformOption
15412 \end_layout
15413
15414 \end_inset
15415
15416  commands:
15417 \end_layout
15418
15419 \begin_layout Description
15420 \begin_inset Flex CharStyle:Code
15421 status collapsed
15422
15423 \begin_layout Plain Layout
15424 $$Clip
15425 \end_layout
15426
15427 \end_inset
15428
15429  The clip option.
15430 \end_layout
15431
15432 \begin_layout Description
15433 \begin_inset Flex CharStyle:Code
15434 status collapsed
15435
15436 \begin_layout Plain Layout
15437 $$Extra
15438 \end_layout
15439
15440 \end_inset
15441
15442  The extra option.
15443 \end_layout
15444
15445 \begin_layout Description
15446 \begin_inset Flex CharStyle:Code
15447 status collapsed
15448
15449 \begin_layout Plain Layout
15450 $$Resize
15451 \end_layout
15452
15453 \end_inset
15454
15455  The resize option.
15456 \end_layout
15457
15458 \begin_layout Description
15459 \begin_inset Flex CharStyle:Code
15460 status collapsed
15461
15462 \begin_layout Plain Layout
15463 $$Rotate
15464 \end_layout
15465
15466 \end_inset
15467
15468  The rotation option.
15469 \end_layout
15470
15471 \begin_layout Standard
15472 You may ask why there are so many path macros.
15473  There are mainly two reasons:
15474 \end_layout
15475
15476 \begin_layout Enumerate
15477 Relative and absolute file names should remain relative or absolute, respectivel
15478 y.
15479  Users may have reasons to prefer either form.
15480  Relative names are useful for portable documents that should work on different
15481  machines, for example.
15482  Absolute names may be required by some programs.
15483 \end_layout
15484
15485 \begin_layout Enumerate
15486 LaTeX treats relative file names differently than LyX and other programs
15487  in nested included files.
15488  For LyX, a relative file name is always relative to the document that contains
15489  the file name.
15490  For LaTeX, it is always relative to the master document.
15491  These two definitions are identical if you have only one document, but
15492  differ if you have a master document that includes part documents.
15493  That means that relative filenames must be transformed when presented to
15494  LaTeX.
15495  Fortunately LyX does this automatically for you if you choose the right
15496  macros.
15497 \end_layout
15498
15499 \begin_layout Standard
15500 So which path macro should be used in new template definitions? The rule
15501  is not difficult:
15502 \end_layout
15503
15504 \begin_layout Itemize
15505 Use 
15506 \begin_inset Flex CharStyle:Code
15507 status collapsed
15508
15509 \begin_layout Plain Layout
15510 $$AbsPath
15511 \end_layout
15512
15513 \end_inset
15514
15515  if an absolute path is required.
15516 \end_layout
15517
15518 \begin_layout Itemize
15519 Use 
15520 \begin_inset Flex CharStyle:Code
15521 status collapsed
15522
15523 \begin_layout Plain Layout
15524 $$AbsOrRelPathMaster
15525 \end_layout
15526
15527 \end_inset
15528
15529  if the substituted string is some kind of LaTeX input.
15530 \end_layout
15531
15532 \begin_layout Itemize
15533 Else use 
15534 \begin_inset Flex CharStyle:Code
15535 status collapsed
15536
15537 \begin_layout Plain Layout
15538 $$AbsOrRelPathParent
15539 \end_layout
15540
15541 \end_inset
15542
15543  in order to preserve the user's choice.
15544 \end_layout
15545
15546 \begin_layout Standard
15547 There are special cases where this rule does not work and e.
15548 \begin_inset space \thinspace{}
15549 \end_inset
15550
15551 g.
15552 \begin_inset space \space{}
15553 \end_inset
15554
15555 relative names are needed, but normally it will work just fine.
15556  One example for such a case is the command 
15557 \begin_inset Flex CharStyle:Code
15558 status collapsed
15559
15560 \begin_layout Plain Layout
15561 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15562 \end_layout
15563
15564 \end_inset
15565
15566  in the XFig template above: We can't use the absolute name because the
15567  copier for 
15568 \begin_inset Flex CharStyle:Code
15569 status collapsed
15570
15571 \begin_layout Plain Layout
15572 .pstex_t
15573 \end_layout
15574
15575 \end_inset
15576
15577  files needs the relative name in order to rewrite the file content.
15578 \end_layout
15579
15580 \begin_layout Section
15581 \begin_inset CommandInset label
15582 LatexCommand label
15583 name "sec:Security-discussion"
15584
15585 \end_inset
15586
15587 Security discussion
15588 \end_layout
15589
15590 \begin_layout Standard
15591 \begin_inset Box Shadowbox
15592 position "t"
15593 hor_pos "c"
15594 has_inner_box 1
15595 inner_pos "t"
15596 use_parbox 0
15597 width "100col%"
15598 special "none"
15599 height "1in"
15600 height_special "totalheight"
15601 status open
15602
15603 \begin_layout Plain Layout
15604 WARNING: This section is definitely outdated.
15605 \end_layout
15606
15607 \end_inset
15608
15609
15610 \end_layout
15611
15612 \begin_layout Standard
15613 The external material feature interfaces with a lot of external programs
15614  and does so automatically, so we have to consider the security implications
15615  of this.
15616  In particular, since you have the option of including your own filenames
15617  and/or parameter strings and those are expanded into a command, it seems
15618  that it would be possible to create a malicious document which executes
15619  arbitrary commands when a user views or prints the document.
15620  This is something we definitely want to avoid.
15621 \end_layout
15622
15623 \begin_layout Standard
15624 However, since the external program commands are specified in the template
15625  configuration file only, there are no security issues if LyX is properly
15626  configured with safe templates only.
15627  This is so because the external programs are invoked with the 
15628 \begin_inset Flex CharStyle:Code
15629 status collapsed
15630
15631 \begin_layout Plain Layout
15632 execvp
15633 \end_layout
15634
15635 \end_inset
15636
15637 -system call rather than the 
15638 \begin_inset Flex CharStyle:Code
15639 status collapsed
15640
15641 \begin_layout Plain Layout
15642 system
15643 \end_layout
15644
15645 \end_inset
15646
15647  system-call, so it's not possible to execute arbitrary commands from the
15648  filename or parameter section via the shell.
15649 \end_layout
15650
15651 \begin_layout Standard
15652 This also implies that you are restricted in what command strings you can
15653  use in the external material templates.
15654  In particular, pipes and redirection are not readily available.
15655  This has to be so if LyX should remain safe.
15656  If you want to use some of the shell features, you should write a safe
15657  script to do this in a controlled manner, and then invoke the script from
15658  the command string.
15659  In the 
15660 \begin_inset Flex CharStyle:Code
15661 status collapsed
15662
15663 \begin_layout Plain Layout
15664 lib/scripts
15665 \end_layout
15666
15667 \end_inset
15668
15669  directory of the LyX installation, you can find a safe wrapper script 
15670 \begin_inset Flex CharStyle:Code
15671 status collapsed
15672
15673 \begin_layout Plain Layout
15674 general_command_wrapper.py
15675 \end_layout
15676
15677 \end_inset
15678
15679  that supports redirection of input and output.
15680  That can serve as an example for how to write safe template scripts.
15681  For a more advanced example that uses 
15682 \begin_inset Flex CharStyle:Code
15683 status collapsed
15684
15685 \begin_layout Plain Layout
15686 fork
15687 \end_layout
15688
15689 \end_inset
15690
15691  and friends, take a look at the 
15692 \begin_inset Flex CharStyle:Code
15693 status collapsed
15694
15695 \begin_layout Plain Layout
15696 pic2ascii.py
15697 \end_layout
15698
15699 \end_inset
15700
15701  converter script.
15702 \end_layout
15703
15704 \begin_layout Standard
15705 It is possible to design a template that interacts directly with the shell,
15706  but since this would allow a malicious user to execute arbitrary commands
15707  by writing clever filenames and/or parameters, we generally recommend that
15708  you only use safe scripts that work with the 
15709 \begin_inset Flex CharStyle:Code
15710 status collapsed
15711
15712 \begin_layout Plain Layout
15713 execvp
15714 \end_layout
15715
15716 \end_inset
15717
15718  system call in a controlled manner.
15719  Of course, for use in a controlled environment, it can be tempting to just
15720  fall back to use ordinary shell scripts.
15721  If you do so, be aware that you 
15722 \emph on
15723 will
15724 \emph default
15725  provide an easily exploitable security hole in your system.
15726  Of course it stands to reason that such unsafe templates will never be
15727  included in the standard LyX distribution, although we do encourage people
15728  to submit new templates in the open source tradition.
15729  But LyX as shipped from the official distribution channels will never have
15730  unsafe templates.
15731 \end_layout
15732
15733 \begin_layout Standard
15734 Including external material provides a lot of power, and you have to be
15735  careful not to introduce security hazards with this power.
15736  A subtle error in a single line in an innocent looking script can open
15737  the door to huge security problems.
15738  So if you do not fully understand the issues, we recommend that you consult
15739  a knowledgeable security professional or the LyX development team if you
15740  have any questions about whether a given template is safe or not.
15741  And do this before you use it in an uncontrolled environment.
15742 \end_layout
15743
15744 \end_body
15745 \end_document