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