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