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