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