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