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