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