]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
6eb16e80337e802bfae76dfabb3a8718b5fc726b
[lyx.git] / lib / doc / Customization.lyx
1 #LyX 1.6.0rc2 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 7.
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 collapsed
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 Subsection
9189 \begin_inset Flex CharStyle:Code
9190 status collapsed
9191
9192 \begin_layout Plain Layout
9193 ClassOptions
9194 \end_layout
9195
9196 \end_inset
9197
9198  section
9199 \end_layout
9200
9201 \begin_layout Standard
9202 \begin_inset CommandInset label
9203 LatexCommand label
9204 name "sec:classoptions"
9205
9206 \end_inset
9207
9208 The 
9209 \begin_inset Flex CharStyle:Code
9210 status collapsed
9211
9212 \begin_layout Plain Layout
9213 ClassOptions
9214 \end_layout
9215
9216 \end_inset
9217
9218  section can contain the following entries:
9219 \end_layout
9220
9221 \begin_layout Description
9222 \begin_inset Flex CharStyle:Code
9223 status collapsed
9224
9225 \begin_layout Plain Layout
9226 FontSize
9227 \end_layout
9228
9229 \end_inset
9230
9231  [
9232 \begin_inset Flex CharStyle:Code
9233 status collapsed
9234
9235 \begin_layout Plain Layout
9236 string="10|11|12"
9237 \end_layout
9238
9239 \end_inset
9240
9241 ] The list of available font sizes for the document's main font, separated
9242  by 
9243 \begin_inset Quotes eld
9244 \end_inset
9245
9246
9247 \begin_inset Flex CharStyle:Code
9248 status collapsed
9249
9250 \begin_layout Plain Layout
9251 |
9252 \end_layout
9253
9254 \end_inset
9255
9256
9257 \begin_inset Quotes erd
9258 \end_inset
9259
9260 .
9261 \end_layout
9262
9263 \begin_layout Description
9264 \begin_inset Flex CharStyle:Code
9265 status collapsed
9266
9267 \begin_layout Plain Layout
9268 Header
9269 \end_layout
9270
9271 \end_inset
9272
9273  [[FIXME]]
9274 \end_layout
9275
9276 \begin_layout Description
9277 \begin_inset Flex CharStyle:Code
9278 status collapsed
9279
9280 \begin_layout Plain Layout
9281 PageStyle
9282 \end_layout
9283
9284 \end_inset
9285
9286  [
9287 \begin_inset Flex CharStyle:Code
9288 status collapsed
9289
9290 \begin_layout Plain Layout
9291 string="empty|plain|headings|fancy"
9292 \end_layout
9293
9294 \end_inset
9295
9296 ] The list of available page styles, separated by 
9297 \begin_inset Quotes eld
9298 \end_inset
9299
9300
9301 \begin_inset Flex CharStyle:Code
9302 status collapsed
9303
9304 \begin_layout Plain Layout
9305 |
9306 \end_layout
9307
9308 \end_inset
9309
9310
9311 \begin_inset Quotes erd
9312 \end_inset
9313
9314 .
9315 \end_layout
9316
9317 \begin_layout Description
9318 \begin_inset Flex CharStyle:Code
9319 status collapsed
9320
9321 \begin_layout Plain Layout
9322 Other
9323 \end_layout
9324
9325 \end_inset
9326
9327  [
9328 \begin_inset Flex CharStyle:Code
9329 status collapsed
9330
9331 \begin_layout Plain Layout
9332 string=""
9333 \end_layout
9334
9335 \end_inset
9336
9337 ] Some document class options, separated by a comma, that will be added
9338  to the optional part of the 
9339 \begin_inset Flex CharStyle:Code
9340 status collapsed
9341
9342 \begin_layout Plain Layout
9343
9344 \backslash
9345 documentclass
9346 \end_layout
9347
9348 \end_inset
9349
9350  command.
9351 \end_layout
9352
9353 \begin_layout Standard
9354 The 
9355 \begin_inset Flex CharStyle:Code
9356 status collapsed
9357
9358 \begin_layout Plain Layout
9359 ClassOptions
9360 \end_layout
9361
9362 \end_inset
9363
9364  section must end with 
9365 \begin_inset Quotes eld
9366 \end_inset
9367
9368
9369 \begin_inset Flex CharStyle:Code
9370 status collapsed
9371
9372 \begin_layout Plain Layout
9373 End
9374 \end_layout
9375
9376 \end_inset
9377
9378
9379 \begin_inset Quotes erd
9380 \end_inset
9381
9382 .
9383 \end_layout
9384
9385 \begin_layout Subsection
9386 Paragraph Styles
9387 \end_layout
9388
9389 \begin_layout Standard
9390 \begin_inset CommandInset label
9391 LatexCommand label
9392 name "sec:style"
9393
9394 \end_inset
9395
9396 A paragraph style description looks like this:
9397 \begin_inset Foot
9398 status collapsed
9399
9400 \begin_layout Plain Layout
9401 Note that this will either define a new layout or modify an existing one.
9402 \end_layout
9403
9404 \end_inset
9405
9406
9407 \end_layout
9408
9409 \begin_layout LyX-Code
9410 Style 
9411 \family roman
9412 \emph on
9413 name
9414 \end_layout
9415
9416 \begin_layout LyX-Code
9417  ...
9418 \end_layout
9419
9420 \begin_layout LyX-Code
9421 End
9422 \end_layout
9423
9424 \begin_layout Standard
9425 where the following commands are allowed:
9426 \end_layout
9427
9428 \begin_layout Description
9429 \begin_inset Flex CharStyle:Code
9430 status collapsed
9431
9432 \begin_layout Plain Layout
9433 Align
9434 \end_layout
9435
9436 \end_inset
9437
9438  [
9439 \begin_inset Flex CharStyle:Code
9440 status collapsed
9441
9442 \begin_layout Plain Layout
9443
9444 \emph on
9445 block
9446 \emph default
9447 , left, right, center
9448 \end_layout
9449
9450 \end_inset
9451
9452 ] Paragraph alignment.
9453 \end_layout
9454
9455 \begin_layout Description
9456 \begin_inset Flex CharStyle:Code
9457 status collapsed
9458
9459 \begin_layout Plain Layout
9460 AlignPossible
9461 \end_layout
9462
9463 \end_inset
9464
9465  [
9466 \begin_inset Flex CharStyle:Code
9467 status collapsed
9468
9469 \begin_layout Plain Layout
9470
9471 \emph on
9472 block
9473 \emph default
9474 , left, right, center
9475 \end_layout
9476
9477 \end_inset
9478
9479 ] A comma separated list of permitted alignments.
9480  (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9481  sense.
9482  For example a right-aligned or centered enumeration isn't possible.)
9483 \end_layout
9484
9485 \begin_layout Description
9486 \begin_inset Flex CharStyle:Code
9487 status collapsed
9488
9489 \begin_layout Plain Layout
9490 BottomSep
9491 \end_layout
9492
9493 \end_inset
9494
9495  [
9496 \begin_inset Flex CharStyle:Code
9497 status collapsed
9498
9499 \begin_layout Plain Layout
9500 float=0
9501 \end_layout
9502
9503 \end_inset
9504
9505 ]
9506 \begin_inset Foot
9507 status collapsed
9508
9509 \begin_layout Plain Layout
9510 Note that a `float' here is a real number, such as: 1.5.
9511 \end_layout
9512
9513 \end_inset
9514
9515  The vertical space with which the last of a chain of paragraphs with this
9516  layout is separated from the following paragraph.
9517  If the next paragraph has another layout, the separations are not simply
9518  added, but the maximum is taken.
9519 \end_layout
9520
9521 \begin_layout Description
9522 \begin_inset Flex CharStyle:Code
9523 status collapsed
9524
9525 \begin_layout Plain Layout
9526 Category
9527 \end_layout
9528
9529 \end_inset
9530
9531  
9532 \begin_inset Flex CharStyle:Code
9533 status collapsed
9534
9535 \begin_layout Plain Layout
9536 [string]
9537 \end_layout
9538
9539 \end_inset
9540
9541  The category for this style.
9542  This is used to group related styles in the Layout combobox on the toolbar.
9543  Any string can be used, but you may want to use existing categories with
9544  your own styles.
9545  
9546 \end_layout
9547
9548 \begin_layout Description
9549 \begin_inset Flex CharStyle:Code
9550 status collapsed
9551
9552 \begin_layout Plain Layout
9553 CommandDepth
9554 \end_layout
9555
9556 \end_inset
9557
9558  [[FIXME]]
9559 \end_layout
9560
9561 \begin_layout Description
9562 \begin_inset Flex CharStyle:Code
9563 status collapsed
9564
9565 \begin_layout Plain Layout
9566 CopyStyle
9567 \end_layout
9568
9569 \end_inset
9570
9571  
9572 \begin_inset CommandInset label
9573 LatexCommand label
9574 name "des:CopyStyle"
9575
9576 \end_inset
9577
9578
9579 \begin_inset Flex CharStyle:Code
9580 status collapsed
9581
9582 \begin_layout Plain Layout
9583 [string]
9584 \end_layout
9585
9586 \end_inset
9587
9588  Copies all the features of an existing style into the current one.
9589  
9590 \end_layout
9591
9592 \begin_layout Description
9593 \begin_inset Flex CharStyle:Code
9594 status collapsed
9595
9596 \begin_layout Plain Layout
9597 DependsOn
9598 \end_layout
9599
9600 \end_inset
9601
9602  The name of a style whose preamble should be output 
9603 \emph on
9604 before
9605 \emph default
9606  this one.
9607  This allows to ensure some ordering of the preamble snippets when macros
9608  definitions depend on one another.
9609 \begin_inset Foot
9610 status collapsed
9611
9612 \begin_layout Plain Layout
9613 Note that, besides that functionality, there is no way to ensure any ordering
9614  of preambles.
9615  The ordering that you see in a given version of LyX may change without
9616  warning in later versions.
9617 \end_layout
9618
9619 \end_inset
9620
9621
9622 \end_layout
9623
9624 \begin_layout Description
9625 \begin_inset Flex CharStyle:Code
9626 status collapsed
9627
9628 \begin_layout Plain Layout
9629 EndLabeltype
9630 \end_layout
9631
9632 \end_inset
9633
9634  [
9635 \begin_inset Flex CharStyle:Code
9636 status collapsed
9637
9638 \begin_layout Plain Layout
9639
9640 \emph on
9641 No_Label
9642 \emph default
9643 , Box, Filled_Box, Static
9644 \end_layout
9645
9646 \end_inset
9647
9648 ] The type of label that stands at the end of the paragraph (or sequence
9649  of paragraphs if 
9650 \begin_inset Flex CharStyle:Code
9651 status collapsed
9652
9653 \begin_layout Plain Layout
9654 LatexType
9655 \end_layout
9656
9657 \end_inset
9658
9659  is 
9660 \begin_inset Flex CharStyle:Code
9661 status collapsed
9662
9663 \begin_layout Plain Layout
9664 Environment
9665 \end_layout
9666
9667 \end_inset
9668
9669
9670 \begin_inset Flex CharStyle:Code
9671 status collapsed
9672
9673 \begin_layout Plain Layout
9674 Item_Environment
9675 \end_layout
9676
9677 \end_inset
9678
9679  or 
9680 \begin_inset Flex CharStyle:Code
9681 status collapsed
9682
9683 \begin_layout Plain Layout
9684 List_Environment
9685 \end_layout
9686
9687 \end_inset
9688
9689 ).
9690  
9691 \begin_inset Flex CharStyle:Code
9692 status collapsed
9693
9694 \begin_layout Plain Layout
9695 No_Label
9696 \end_layout
9697
9698 \end_inset
9699
9700  means 
9701 \begin_inset Quotes eld
9702 \end_inset
9703
9704 nothing
9705 \begin_inset Quotes erd
9706 \end_inset
9707
9708
9709 \begin_inset Flex CharStyle:Code
9710 status collapsed
9711
9712 \begin_layout Plain Layout
9713 Box
9714 \end_layout
9715
9716 \end_inset
9717
9718  (resp.
9719 \begin_inset Flex CharStyle:Code
9720 status collapsed
9721
9722 \begin_layout Plain Layout
9723 \begin_inset space ~
9724 \end_inset
9725
9726 Filled_Box
9727 \end_layout
9728
9729 \end_inset
9730
9731 ) is a white (resp.
9732 \begin_inset space ~
9733 \end_inset
9734
9735 black) square suitable for end of proof markers, 
9736 \begin_inset Flex CharStyle:Code
9737 status collapsed
9738
9739 \begin_layout Plain Layout
9740 Static
9741 \end_layout
9742
9743 \end_inset
9744
9745  is an explicit text string.
9746 \end_layout
9747
9748 \begin_layout Description
9749 \begin_inset Flex CharStyle:Code
9750 status collapsed
9751
9752 \begin_layout Plain Layout
9753 EndLabelString
9754 \end_layout
9755
9756 \end_inset
9757
9758  [
9759 \begin_inset Flex CharStyle:Code
9760 status collapsed
9761
9762 \begin_layout Plain Layout
9763 string=""
9764 \end_layout
9765
9766 \end_inset
9767
9768 ] The string used for a label with a 
9769 \begin_inset Flex CharStyle:Code
9770 status collapsed
9771
9772 \begin_layout Plain Layout
9773 Static
9774 \end_layout
9775
9776 \end_inset
9777
9778  
9779 \begin_inset Flex CharStyle:Code
9780 status collapsed
9781
9782 \begin_layout Plain Layout
9783 EndLabelType
9784 \end_layout
9785
9786 \end_inset
9787
9788 .
9789  
9790 \end_layout
9791
9792 \begin_layout Description
9793 \begin_inset Flex CharStyle:Code
9794 status collapsed
9795
9796 \begin_layout Plain Layout
9797 Fill_Bottom
9798 \end_layout
9799
9800 \end_inset
9801
9802  [
9803 \begin_inset Flex CharStyle:Code
9804 status collapsed
9805
9806 \begin_layout Plain Layout
9807
9808 \emph on
9809 0
9810 \emph default
9811 ,1
9812 \end_layout
9813
9814 \end_inset
9815
9816 ] Similar to 
9817 \begin_inset Flex CharStyle:Code
9818 status collapsed
9819
9820 \begin_layout Plain Layout
9821 Fill_Top
9822 \end_layout
9823
9824 \end_inset
9825
9826 .
9827 \end_layout
9828
9829 \begin_layout Description
9830 \begin_inset Flex CharStyle:Code
9831 status collapsed
9832
9833 \begin_layout Plain Layout
9834 Fill_Top
9835 \end_layout
9836
9837 \end_inset
9838
9839  [
9840 \begin_inset Flex CharStyle:Code
9841 status collapsed
9842
9843 \begin_layout Plain Layout
9844
9845 \emph on
9846 0
9847 \emph default
9848 ,1
9849 \end_layout
9850
9851 \end_inset
9852
9853 ] With this parameter the 
9854 \begin_inset Flex CharStyle:MenuItem
9855 status collapsed
9856
9857 \begin_layout Plain Layout
9858 Fill
9859 \end_layout
9860
9861 \end_inset
9862
9863  value of the 
9864 \begin_inset Quotes eld
9865 \end_inset
9866
9867 Vertical space above
9868 \begin_inset Quotes erd
9869 \end_inset
9870
9871  list of the 
9872 \begin_inset Flex CharStyle:MenuItem
9873 status collapsed
9874
9875 \begin_layout Plain Layout
9876
9877 \bar under
9878 E
9879 \bar default
9880 dit\SpecialChar \menuseparator
9881
9882 \bar under
9883 P
9884 \bar default
9885 aragraph
9886 \begin_inset space ~
9887 \end_inset
9888
9889 Settings
9890 \end_layout
9891
9892 \end_inset
9893
9894  dialog can be set when initializing a paragraph with this style.
9895 \begin_inset Foot
9896 status collapsed
9897
9898 \begin_layout Plain Layout
9899
9900 \emph on
9901 Note from Jean-Marc:
9902 \emph default
9903  I'm not sure that this setting has much use, and it should probably be
9904  removed in later versions.
9905 \end_layout
9906
9907 \end_inset
9908
9909  
9910 \end_layout
9911
9912 \begin_layout Description
9913 \begin_inset Flex CharStyle:Code
9914 status collapsed
9915
9916 \begin_layout Plain Layout
9917 Font
9918 \end_layout
9919
9920 \end_inset
9921
9922  The font used for both the text body 
9923 \emph on
9924 and
9925 \emph default
9926  the label.
9927  See section
9928 \begin_inset space ~
9929 \end_inset
9930
9931
9932 \begin_inset CommandInset ref
9933 LatexCommand ref
9934 reference "sec:fonts"
9935
9936 \end_inset
9937
9938 .
9939  Note that defining this font automatically defines the 
9940 \begin_inset Flex CharStyle:Code
9941 status collapsed
9942
9943 \begin_layout Plain Layout
9944 LabelFont
9945 \end_layout
9946
9947 \end_inset
9948
9949  to the same value.
9950  So you should define this one first if you also want to define 
9951 \begin_inset Flex CharStyle:Code
9952 status collapsed
9953
9954 \begin_layout Plain Layout
9955 LabelFont
9956 \end_layout
9957
9958 \end_inset
9959
9960 .
9961 \end_layout
9962
9963 \begin_layout Description
9964 \begin_inset Flex CharStyle:Code
9965 status collapsed
9966
9967 \begin_layout Plain Layout
9968 FreeSpacing
9969 \end_layout
9970
9971 \end_inset
9972
9973  
9974 \begin_inset CommandInset label
9975 LatexCommand label
9976 name "des:FreeSpacing"
9977
9978 \end_inset
9979
9980 [
9981 \emph on
9982
9983 \begin_inset Flex CharStyle:Code
9984 status collapsed
9985
9986 \begin_layout Plain Layout
9987
9988 \emph on
9989 0
9990 \end_layout
9991
9992 \end_inset
9993
9994
9995 \emph default
9996
9997 \begin_inset Flex CharStyle:Code
9998 status collapsed
9999
10000 \begin_layout Plain Layout
10001 1
10002 \end_layout
10003
10004 \end_inset
10005
10006 ] Usually LyX doesn't allow you to insert more than one space between words,
10007  since a space is considered as the separation between two words, not a
10008  character or symbol of its own.
10009  This is a very fine thing but sometimes annoying, for example, when typing
10010  program code or plain LaTeX code.
10011  For this reason, 
10012 \begin_inset Flex CharStyle:Code
10013 status collapsed
10014
10015 \begin_layout Plain Layout
10016 FreeSpacing
10017 \end_layout
10018
10019 \end_inset
10020
10021  can be enabled.
10022  Note that LyX will create protected blanks for the additional blanks when
10023  in another mode than LaTeX-mode.
10024 \end_layout
10025
10026 \begin_layout Description
10027 \begin_inset Flex CharStyle:Code
10028 status collapsed
10029
10030 \begin_layout Plain Layout
10031 InnerTag
10032 \end_layout
10033
10034 \end_inset
10035
10036  [[FIXME]]
10037 \end_layout
10038
10039 \begin_layout Description
10040 \begin_inset Flex CharStyle:Code
10041 status collapsed
10042
10043 \begin_layout Plain Layout
10044 InTitle
10045 \end_layout
10046
10047 \end_inset
10048
10049  
10050 \begin_inset Flex CharStyle:Code
10051 status collapsed
10052
10053 \begin_layout Plain Layout
10054 [1, 0]
10055 \end_layout
10056
10057 \end_inset
10058
10059  If 1, marks the layout as being part of a title block (see also the 
10060 \begin_inset Flex CharStyle:Code
10061 status collapsed
10062
10063 \begin_layout Plain Layout
10064 TitleLatexType
10065 \end_layout
10066
10067 \end_inset
10068
10069  and 
10070 \begin_inset Flex CharStyle:Code
10071 status collapsed
10072
10073 \begin_layout Plain Layout
10074 TitleLatexName
10075 \end_layout
10076
10077 \end_inset
10078
10079  global entries).
10080 \end_layout
10081
10082 \begin_layout Description
10083 \begin_inset Flex CharStyle:Code
10084 status collapsed
10085
10086 \begin_layout Plain Layout
10087 ItemSep
10088 \end_layout
10089
10090 \end_inset
10091
10092  [
10093 \begin_inset Flex CharStyle:Code
10094 status collapsed
10095
10096 \begin_layout Plain Layout
10097 float=0
10098 \end_layout
10099
10100 \end_inset
10101
10102 ] This provides extra space between paragraphs that have the same layout.
10103  If you put other layouts into an environment, each is separated with the
10104  environment's 
10105 \begin_inset Flex CharStyle:Code
10106 status collapsed
10107
10108 \begin_layout Plain Layout
10109 Parsep
10110 \end_layout
10111
10112 \end_inset
10113
10114 .
10115  But the whole items of the environment are additionally separated with
10116  this 
10117 \begin_inset Flex CharStyle:Code
10118 status collapsed
10119
10120 \begin_layout Plain Layout
10121 Itemsep
10122 \end_layout
10123
10124 \end_inset
10125
10126 .
10127  Note that this is a
10128 \emph on
10129  multiplier.
10130 \end_layout
10131
10132 \begin_layout Description
10133 \begin_inset Flex CharStyle:Code
10134 status collapsed
10135
10136 \begin_layout Plain Layout
10137 ItemTag
10138 \end_layout
10139
10140 \end_inset
10141
10142  [[FIXME]]
10143 \end_layout
10144
10145 \begin_layout Description
10146 \begin_inset Flex CharStyle:Code
10147 status collapsed
10148
10149 \begin_layout Plain Layout
10150 KeepEmpty
10151 \end_layout
10152
10153 \end_inset
10154
10155  
10156 \begin_inset CommandInset label
10157 LatexCommand label
10158 name "des:KeepEmpty"
10159
10160 \end_inset
10161
10162 [
10163 \emph on
10164
10165 \begin_inset Flex CharStyle:Code
10166 status collapsed
10167
10168 \begin_layout Plain Layout
10169
10170 \emph on
10171 0
10172 \end_layout
10173
10174 \end_inset
10175
10176
10177 \emph default
10178
10179 \begin_inset Flex CharStyle:Code
10180 status collapsed
10181
10182 \begin_layout Plain Layout
10183 1
10184 \end_layout
10185
10186 \end_inset
10187
10188 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10189  lead to empty LaTeX output.
10190  There are some cases where this could be desirable however: in a letter
10191  template, the required fields can be provided as empty fields, so that
10192  people do not forget them; in some special classes, a layout can be used
10193  as some kind of break, which does not contain actual text.
10194 \end_layout
10195
10196 \begin_layout Description
10197 \begin_inset Flex CharStyle:Code
10198 status collapsed
10199
10200 \begin_layout Plain Layout
10201 LabelBottomsep
10202 \end_layout
10203
10204 \end_inset
10205
10206  [float=0] The vertical space between the label and the text body.
10207  Only used for labels that are above the text body (
10208 \begin_inset Flex CharStyle:Code
10209 status collapsed
10210
10211 \begin_layout Plain Layout
10212 Top_Environment
10213 \end_layout
10214
10215 \end_inset
10216
10217
10218 \begin_inset Flex CharStyle:Code
10219 status collapsed
10220
10221 \begin_layout Plain Layout
10222 Centered_Top_Environment
10223 \end_layout
10224
10225 \end_inset
10226
10227 ).
10228 \end_layout
10229
10230 \begin_layout Description
10231 \begin_inset Flex CharStyle:Code
10232 status collapsed
10233
10234 \begin_layout Plain Layout
10235 LabelCounter
10236 \end_layout
10237
10238 \end_inset
10239
10240  [
10241 \begin_inset Flex CharStyle:Code
10242 status collapsed
10243
10244 \begin_layout Plain Layout
10245 string=""
10246 \end_layout
10247
10248 \end_inset
10249
10250 ]
10251 \begin_inset Newline newline
10252 \end_inset
10253
10254 The name of the counter for automatic numbering (see Section 
10255 \begin_inset CommandInset ref
10256 LatexCommand ref
10257 reference "sec:counter"
10258
10259 \end_inset
10260
10261  for details).
10262  This must be given if 
10263 \begin_inset Flex CharStyle:Code
10264 status collapsed
10265
10266 \begin_layout Plain Layout
10267 Labeltype
10268 \end_layout
10269
10270 \end_inset
10271
10272  is 
10273 \begin_inset Flex CharStyle:Code
10274 status collapsed
10275
10276 \begin_layout Plain Layout
10277 Counter
10278 \end_layout
10279
10280 \end_inset
10281
10282 .
10283 \end_layout
10284
10285 \begin_layout Description
10286 \begin_inset Flex CharStyle:Code
10287 status collapsed
10288
10289 \begin_layout Plain Layout
10290 LabelFont
10291 \end_layout
10292
10293 \end_inset
10294
10295  The font used for the label.
10296  See section
10297 \begin_inset space ~
10298 \end_inset
10299
10300
10301 \begin_inset CommandInset ref
10302 LatexCommand ref
10303 reference "sec:fonts"
10304
10305 \end_inset
10306
10307 .
10308 \end_layout
10309
10310 \begin_layout Description
10311 \begin_inset Flex CharStyle:Code
10312 status collapsed
10313
10314 \begin_layout Plain Layout
10315 Labelsep
10316 \end_layout
10317
10318 \end_inset
10319
10320  [
10321 \begin_inset Flex CharStyle:Code
10322 status collapsed
10323
10324 \begin_layout Plain Layout
10325 string=""
10326 \end_layout
10327
10328 \end_inset
10329
10330 ] The horizontal space between the label and the text body.
10331  Only used for labels that are not above the text body.
10332 \end_layout
10333
10334 \begin_layout Description
10335 \begin_inset Flex CharStyle:Code
10336 status collapsed
10337
10338 \begin_layout Plain Layout
10339 LabelString
10340 \end_layout
10341
10342 \end_inset
10343
10344  [
10345 \begin_inset Flex CharStyle:Code
10346 status collapsed
10347
10348 \begin_layout Plain Layout
10349 string=""
10350 \end_layout
10351
10352 \end_inset
10353
10354 ] The string used for a label with a 
10355 \begin_inset Flex CharStyle:Code
10356 status collapsed
10357
10358 \begin_layout Plain Layout
10359 Static
10360 \end_layout
10361
10362 \end_inset
10363
10364  labeltype.
10365  When 
10366 \begin_inset Flex CharStyle:Code
10367 status collapsed
10368
10369 \begin_layout Plain Layout
10370 LabelCounter
10371 \end_layout
10372
10373 \end_inset
10374
10375  is set, this string can be contain the special formatting commands described
10376  in Section 
10377 \begin_inset CommandInset ref
10378 LatexCommand ref
10379 reference "sec:counter"
10380
10381 \end_inset
10382
10383 .
10384 \begin_inset Foot
10385 status collapsed
10386
10387 \begin_layout Plain Layout
10388 For the sake of backwards compatibility, the string 
10389 \begin_inset Flex CharStyle:Code
10390 status collapsed
10391
10392 \begin_layout Plain Layout
10393 @
10394 \emph on
10395 style-name
10396 \emph default
10397 @
10398 \end_layout
10399
10400 \end_inset
10401
10402  will be replaced by the expanded 
10403 \begin_inset Flex CharStyle:Code
10404 status collapsed
10405
10406 \begin_layout Plain Layout
10407 LabelString
10408 \end_layout
10409
10410 \end_inset
10411
10412  of style 
10413 \begin_inset Flex CharStyle:Code
10414 status collapsed
10415
10416 \begin_layout Plain Layout
10417
10418 \emph on
10419 style-name
10420 \end_layout
10421
10422 \end_inset
10423
10424 .
10425  This feature is now obsolete and should be replaced by the mechanisms of
10426  Section 
10427 \begin_inset CommandInset ref
10428 LatexCommand ref
10429 reference "sec:counter"
10430
10431 \end_inset
10432
10433 .
10434 \end_layout
10435
10436 \end_inset
10437
10438
10439 \end_layout
10440
10441 \begin_layout Description
10442 \begin_inset Flex CharStyle:Code
10443 status collapsed
10444
10445 \begin_layout Plain Layout
10446 LabelStringAppendix
10447 \end_layout
10448
10449 \end_inset
10450
10451  [
10452 \begin_inset Flex CharStyle:Code
10453 status collapsed
10454
10455 \begin_layout Plain Layout
10456 string=""
10457 \end_layout
10458
10459 \end_inset
10460
10461 ] This is used inside the appendix instead of 
10462 \begin_inset Flex CharStyle:Code
10463 status collapsed
10464
10465 \begin_layout Plain Layout
10466 LabelString
10467 \end_layout
10468
10469 \end_inset
10470
10471 .
10472  Note that every 
10473 \begin_inset Flex CharStyle:Code
10474 status collapsed
10475
10476 \begin_layout Plain Layout
10477 LabelString
10478 \end_layout
10479
10480 \end_inset
10481
10482  statement resets 
10483 \begin_inset Flex CharStyle:Code
10484 status collapsed
10485
10486 \begin_layout Plain Layout
10487 LabelStringAppendix
10488 \end_layout
10489
10490 \end_inset
10491
10492  too.
10493 \end_layout
10494
10495 \begin_layout Description
10496 \begin_inset Flex CharStyle:Code
10497 status collapsed
10498
10499 \begin_layout Plain Layout
10500 Labeltype
10501 \end_layout
10502
10503 \end_inset
10504
10505  [
10506 \begin_inset Flex CharStyle:Code
10507 status collapsed
10508
10509 \begin_layout Plain Layout
10510
10511 \emph on
10512 No_Label
10513 \emph default
10514 , Manual, Static, Top_Environment, 
10515 \begin_inset Newline newline
10516 \end_inset
10517
10518 Centered_Top_Environment, Sensitive, Counter
10519 \end_layout
10520
10521 \end_inset
10522
10523
10524 \begin_inset Newline newline
10525 \end_inset
10526
10527
10528 \begin_inset Flex CharStyle:Code
10529 status collapsed
10530
10531 \begin_layout Plain Layout
10532 Manual
10533 \end_layout
10534
10535 \end_inset
10536
10537  means the label is the very first word (up to the first real blank).
10538 \begin_inset Foot
10539 status collapsed
10540
10541 \begin_layout Plain Layout
10542 Use protected spaces if you want more than one word as the label.
10543 \end_layout
10544
10545 \end_inset
10546
10547  
10548 \begin_inset Flex CharStyle:Code
10549 status collapsed
10550
10551 \begin_layout Plain Layout
10552 Static
10553 \end_layout
10554
10555 \end_inset
10556
10557  means it is defined in the layout (see 
10558 \begin_inset Flex CharStyle:Code
10559 status collapsed
10560
10561 \begin_layout Plain Layout
10562 LabelString
10563 \end_layout
10564
10565 \end_inset
10566
10567 ).
10568  
10569 \begin_inset Flex CharStyle:Code
10570 status collapsed
10571
10572 \begin_layout Plain Layout
10573 Top_Environment
10574 \end_layout
10575
10576 \end_inset
10577
10578  and 
10579 \begin_inset Flex CharStyle:Code
10580 status collapsed
10581
10582 \begin_layout Plain Layout
10583 Centered_Top_Environment
10584 \end_layout
10585
10586 \end_inset
10587
10588  are special cases of 
10589 \begin_inset Flex CharStyle:Code
10590 status collapsed
10591
10592 \begin_layout Plain Layout
10593 Static
10594 \end_layout
10595
10596 \end_inset
10597
10598 .
10599  The label will be printed above the paragraph, but only at the top of an
10600  environment or the top of a chain of paragraphs with this layout.
10601  Usage is for example the 
10602 \begin_inset Flex CharStyle:MenuItem
10603 status collapsed
10604
10605 \begin_layout Plain Layout
10606 Abstract
10607 \end_layout
10608
10609 \end_inset
10610
10611  layout or the 
10612 \begin_inset Flex CharStyle:MenuItem
10613 status collapsed
10614
10615 \begin_layout Plain Layout
10616 Bibliography
10617 \end_layout
10618
10619 \end_inset
10620
10621  layout.
10622  This is also the case for 
10623 \begin_inset Flex CharStyle:Code
10624 status collapsed
10625
10626 \begin_layout Plain Layout
10627 Manual
10628 \end_layout
10629
10630 \end_inset
10631
10632  labels with latex type 
10633 \begin_inset Flex CharStyle:Code
10634 status collapsed
10635
10636 \begin_layout Plain Layout
10637 Environment
10638 \end_layout
10639
10640 \end_inset
10641
10642 , in order to make layouts for theorems work correctly.
10643  
10644 \begin_inset Flex CharStyle:Code
10645 status collapsed
10646
10647 \begin_layout Plain Layout
10648 Sensitive
10649 \end_layout
10650
10651 \end_inset
10652
10653  is a special case for the caption-labels 
10654 \begin_inset Quotes eld
10655 \end_inset
10656
10657 Figure
10658 \begin_inset Quotes erd
10659 \end_inset
10660
10661  and 
10662 \begin_inset Quotes eld
10663 \end_inset
10664
10665 Table
10666 \begin_inset Quotes erd
10667 \end_inset
10668
10669 .
10670  
10671 \begin_inset Flex CharStyle:Code
10672 status collapsed
10673
10674 \begin_layout Plain Layout
10675 Sensitive
10676 \end_layout
10677
10678 \end_inset
10679
10680  means the (hardcoded) label string depends on the kind of float.
10681  The 
10682 \begin_inset Flex CharStyle:Code
10683 status collapsed
10684
10685 \begin_layout Plain Layout
10686 Counter
10687 \end_layout
10688
10689 \end_inset
10690
10691  label type defines automatically numbered labels.
10692  See Section 
10693 \begin_inset CommandInset ref
10694 LatexCommand ref
10695 reference "sec:counter"
10696
10697 \end_inset
10698
10699 .
10700 \end_layout
10701
10702 \begin_layout Description
10703 \begin_inset Flex CharStyle:Code
10704 status collapsed
10705
10706 \begin_layout Plain Layout
10707 LatexFooter
10708 \end_layout
10709
10710 \end_inset
10711
10712  [[FIXME]]
10713 \end_layout
10714
10715 \begin_layout Description
10716 \begin_inset Flex CharStyle:Code
10717 status collapsed
10718
10719 \begin_layout Plain Layout
10720 LatexHeader
10721 \end_layout
10722
10723 \end_inset
10724
10725  [[FIXME]]
10726 \end_layout
10727
10728 \begin_layout Description
10729 \begin_inset Flex CharStyle:Code
10730 status collapsed
10731
10732 \begin_layout Plain Layout
10733 LatexName
10734 \end_layout
10735
10736 \end_inset
10737
10738  
10739 \begin_inset CommandInset label
10740 LatexCommand label
10741 name "des:LatexName"
10742
10743 \end_inset
10744
10745 The name of the corresponding LaTeX stuff.
10746  Either the environment or command name.
10747 \end_layout
10748
10749 \begin_layout Description
10750 \begin_inset Flex CharStyle:Code
10751 status collapsed
10752
10753 \begin_layout Plain Layout
10754 LatexParagraph
10755 \end_layout
10756
10757 \end_inset
10758
10759  [[FIXME]]
10760 \end_layout
10761
10762 \begin_layout Description
10763 \begin_inset Flex CharStyle:Code
10764 status collapsed
10765
10766 \begin_layout Plain Layout
10767 LatexParam
10768 \end_layout
10769
10770 \end_inset
10771
10772  
10773 \begin_inset CommandInset label
10774 LatexCommand label
10775 name "des:LatexParam"
10776
10777 \end_inset
10778
10779 An optional parameter for the corresponding 
10780 \begin_inset Flex CharStyle:Code
10781 status collapsed
10782
10783 \begin_layout Plain Layout
10784 LatexName
10785 \end_layout
10786
10787 \end_inset
10788
10789  stuff.
10790  This parameter cannot be changed from within LyX.
10791 \end_layout
10792
10793 \begin_layout Description
10794 \begin_inset Flex CharStyle:Code
10795 status collapsed
10796
10797 \begin_layout Plain Layout
10798 LatexType
10799 \end_layout
10800
10801 \end_inset
10802
10803  
10804 \begin_inset CommandInset label
10805 LatexCommand label
10806 name "des:LatexType"
10807
10808 \end_inset
10809
10810 [
10811 \begin_inset Flex CharStyle:Code
10812 status collapsed
10813
10814 \begin_layout Plain Layout
10815
10816 \emph on
10817 Paragraph
10818 \emph default
10819 , Command, Environment, Item_Environment,
10820 \end_layout
10821
10822 \end_inset
10823
10824  
10825 \begin_inset Flex CharStyle:Code
10826 status collapsed
10827
10828 \begin_layout Plain Layout
10829 List_Environment
10830 \end_layout
10831
10832 \end_inset
10833
10834 ] How the layout should be translated into LaTeX.
10835  
10836 \begin_inset Flex CharStyle:Code
10837 status collapsed
10838
10839 \begin_layout Plain Layout
10840 Paragraph
10841 \end_layout
10842
10843 \end_inset
10844
10845  means nothing special.
10846  
10847 \begin_inset Flex CharStyle:Code
10848 status collapsed
10849
10850 \begin_layout Plain Layout
10851 Command
10852 \end_layout
10853
10854 \end_inset
10855
10856  means 
10857 \begin_inset Flex CharStyle:Code
10858 status collapsed
10859
10860 \begin_layout Plain Layout
10861
10862 \backslash
10863
10864 \emph on
10865 LatexName
10866 \emph default
10867 {\SpecialChar \ldots{}
10868 }
10869 \end_layout
10870
10871 \end_inset
10872
10873  and 
10874 \begin_inset Flex CharStyle:Code
10875 status collapsed
10876
10877 \begin_layout Plain Layout
10878 Environment
10879 \end_layout
10880
10881 \end_inset
10882
10883  means 
10884 \begin_inset Flex CharStyle:Code
10885 status collapsed
10886
10887 \begin_layout Plain Layout
10888
10889 \backslash
10890 begin{
10891 \emph on
10892 LatexName
10893 \emph default
10894 }\SpecialChar \ldots{}
10895
10896 \backslash
10897 end{
10898 \emph on
10899 LatexName
10900 \emph default
10901 }
10902 \end_layout
10903
10904 \end_inset
10905
10906 .
10907  
10908 \begin_inset Flex CharStyle:Code
10909 status collapsed
10910
10911 \begin_layout Plain Layout
10912 Item_Environment
10913 \end_layout
10914
10915 \end_inset
10916
10917  is the same as 
10918 \begin_inset Flex CharStyle:Code
10919 status collapsed
10920
10921 \begin_layout Plain Layout
10922 Environment
10923 \end_layout
10924
10925 \end_inset
10926
10927 , except that a 
10928 \begin_inset Flex CharStyle:Code
10929 status collapsed
10930
10931 \begin_layout Plain Layout
10932
10933 \backslash
10934 item
10935 \end_layout
10936
10937 \end_inset
10938
10939  is generated for each paragraph of this environment.
10940  
10941 \begin_inset Flex CharStyle:Code
10942 status collapsed
10943
10944 \begin_layout Plain Layout
10945 List_Environment
10946 \end_layout
10947
10948 \end_inset
10949
10950  is the same as 
10951 \begin_inset Flex CharStyle:Code
10952 status collapsed
10953
10954 \begin_layout Plain Layout
10955 Item_Environment
10956 \end_layout
10957
10958 \end_inset
10959
10960 , except that 
10961 \begin_inset Flex CharStyle:Code
10962 status collapsed
10963
10964 \begin_layout Plain Layout
10965 LabelWidthString
10966 \end_layout
10967
10968 \end_inset
10969
10970  is passed as an argument to the environment.
10971  
10972 \begin_inset Flex CharStyle:Code
10973 status collapsed
10974
10975 \begin_layout Plain Layout
10976 LabelWidthString
10977 \end_layout
10978
10979 \end_inset
10980
10981  can be defined in the 
10982 \begin_inset Flex CharStyle:MenuItem
10983 status collapsed
10984
10985 \begin_layout Plain Layout
10986
10987 \bar under
10988 L
10989 \bar default
10990 ayout\SpecialChar \menuseparator
10991
10992 \bar under
10993 P
10994 \bar default
10995 aragraph
10996 \end_layout
10997
10998 \end_inset
10999
11000  dialog.
11001  
11002 \begin_inset Flex CharStyle:Code
11003 status collapsed
11004
11005 \begin_layout Plain Layout
11006
11007 \emph on
11008 LatexType
11009 \end_layout
11010
11011 \end_inset
11012
11013  is perhaps a bit misleading, since these rules apply to SGML classes, too.
11014  Visit the SGML class files for specific examples.
11015 \end_layout
11016
11017 \begin_layout Standard
11018 Putting the last few things together, the LaTeX output will be either: 
11019 \end_layout
11020
11021 \begin_layout LyX-Code
11022
11023 \backslash
11024 latexname[latexparam]{\SpecialChar \ldots{}
11025 }
11026 \end_layout
11027
11028 \begin_layout Standard
11029 or: 
11030 \end_layout
11031
11032 \begin_layout LyX-Code
11033
11034 \backslash
11035 begin{latexname}[latexparam] \SpecialChar \ldots{}
11036  
11037 \backslash
11038 end{latexname}.
11039 \end_layout
11040
11041 \begin_layout Standard
11042 depending upon the LaTex type.
11043 \end_layout
11044
11045 \begin_layout Description
11046 \begin_inset Flex CharStyle:Code
11047 status collapsed
11048
11049 \begin_layout Plain Layout
11050 LeftMargin
11051 \end_layout
11052
11053 \end_inset
11054
11055  [
11056 \begin_inset Flex CharStyle:Code
11057 status collapsed
11058
11059 \begin_layout Plain Layout
11060 string=""
11061 \end_layout
11062
11063 \end_inset
11064
11065 ] If you put layouts into environments, the leftmargins are not simply added,
11066  but added with a factor 
11067 \begin_inset Formula $\frac{4}{depth+4}$
11068 \end_inset
11069
11070 .
11071  Note that this parameter is also used when the margin is defined as 
11072 \begin_inset Flex CharStyle:Code
11073 status collapsed
11074
11075 \begin_layout Plain Layout
11076 Manual
11077 \end_layout
11078
11079 \end_inset
11080
11081  or 
11082 \begin_inset Flex CharStyle:Code
11083 status collapsed
11084
11085 \begin_layout Plain Layout
11086 Dynamic
11087 \end_layout
11088
11089 \end_inset
11090
11091 .
11092  Then it is added to the manual or dynamic margin.
11093  
11094 \begin_inset Newline newline
11095 \end_inset
11096
11097 The argument is passed as a string.
11098  For example 
11099 \begin_inset Quotes eld
11100 \end_inset
11101
11102
11103 \begin_inset Flex CharStyle:Code
11104 status collapsed
11105
11106 \begin_layout Plain Layout
11107 MM
11108 \end_layout
11109
11110 \end_inset
11111
11112
11113 \begin_inset Quotes erd
11114 \end_inset
11115
11116  means that the paragraph is indented with the width of 
11117 \begin_inset Quotes eld
11118 \end_inset
11119
11120
11121 \begin_inset Flex CharStyle:Code
11122 status collapsed
11123
11124 \begin_layout Plain Layout
11125 MM
11126 \end_layout
11127
11128 \end_inset
11129
11130
11131 \begin_inset Quotes erd
11132 \end_inset
11133
11134  in the normal font.
11135  You can get a negative width by prefixing the string with 
11136 \begin_inset Quotes eld
11137 \end_inset
11138
11139
11140 \begin_inset Flex CharStyle:Code
11141 status collapsed
11142
11143 \begin_layout Plain Layout
11144 -
11145 \end_layout
11146
11147 \end_inset
11148
11149
11150 \begin_inset Quotes erd
11151 \end_inset
11152
11153 .
11154  This way was chosen so that the look is the same with each used screen
11155  font.
11156  
11157 \end_layout
11158
11159 \begin_layout Description
11160 \begin_inset Flex CharStyle:Code
11161 status collapsed
11162
11163 \begin_layout Plain Layout
11164 Margin
11165 \end_layout
11166
11167 \end_inset
11168
11169  [
11170 \begin_inset Flex CharStyle:Code
11171 status collapsed
11172
11173 \begin_layout Plain Layout
11174
11175 \emph on
11176 Static
11177 \emph default
11178 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11179 \end_layout
11180
11181 \end_inset
11182
11183
11184 \begin_inset Newline newline
11185 \end_inset
11186
11187 The kind of margin that the layout has on the left side.
11188  
11189 \begin_inset Flex CharStyle:Code
11190 status collapsed
11191
11192 \begin_layout Plain Layout
11193 Static
11194 \end_layout
11195
11196 \end_inset
11197
11198  just means a fixed margin.
11199  
11200 \begin_inset Flex CharStyle:Code
11201 status collapsed
11202
11203 \begin_layout Plain Layout
11204 Manual
11205 \end_layout
11206
11207 \end_inset
11208
11209  means that the left margin depends on the string entered in the 
11210 \begin_inset Flex CharStyle:MenuItem
11211 status collapsed
11212
11213 \begin_layout Plain Layout
11214
11215 \bar under
11216 E
11217 \bar default
11218 dit\SpecialChar \menuseparator
11219
11220 \bar under
11221 P
11222 \bar default
11223 aragraph
11224 \begin_inset space ~
11225 \end_inset
11226
11227 Settings
11228 \end_layout
11229
11230 \end_inset
11231
11232  dialog.
11233  This is used to typeset nice lists without tabulators.
11234  
11235 \begin_inset Flex CharStyle:Code
11236 status collapsed
11237
11238 \begin_layout Plain Layout
11239 Dynamic
11240 \end_layout
11241
11242 \end_inset
11243
11244  means that the margin depends on the size of the label.
11245  This is used for automatic enumerated headlines.
11246  It is obvious that the headline 
11247 \begin_inset Quotes eld
11248 \end_inset
11249
11250 5.4.3.2.1 Very long headline
11251 \begin_inset Quotes erd
11252 \end_inset
11253
11254  must have a wider left margin (as wide as 
11255 \begin_inset Quotes eld
11256 \end_inset
11257
11258 5.4.3.2.1
11259 \begin_inset Quotes erd
11260 \end_inset
11261
11262  plus the space) than 
11263 \begin_inset Quotes eld
11264 \end_inset
11265
11266 3.2 Very long headline
11267 \begin_inset Quotes erd
11268 \end_inset
11269
11270 , even if standard 
11271 \begin_inset Quotes eld
11272 \end_inset
11273
11274 word processors
11275 \begin_inset Quotes erd
11276 \end_inset
11277
11278  are not able to do this.
11279  
11280 \begin_inset Flex CharStyle:Code
11281 status collapsed
11282
11283 \begin_layout Plain Layout
11284 First_Dynamic
11285 \end_layout
11286
11287 \end_inset
11288
11289  is similar, but only the very first row of the paragraph is dynamic, while
11290  the others are static; this is used, for example, for descriptions.
11291  
11292 \begin_inset Flex CharStyle:Code
11293 status collapsed
11294
11295 \begin_layout Plain Layout
11296 Right_Address_Box
11297 \end_layout
11298
11299 \end_inset
11300
11301  means the margin is chosen in a way that the longest row of this paragraph
11302  fits to the right margin.
11303  This is used to typeset an address on the right edge of the page.
11304 \end_layout
11305
11306 \begin_layout Description
11307 \begin_inset Flex CharStyle:Code
11308 status collapsed
11309
11310 \begin_layout Plain Layout
11311 NeedProtect
11312 \end_layout
11313
11314 \end_inset
11315
11316  
11317 \begin_inset CommandInset label
11318 LatexCommand label
11319 name "des:NeedProtect"
11320
11321 \end_inset
11322
11323 [
11324 \begin_inset Flex CharStyle:Code
11325 status collapsed
11326
11327 \begin_layout Plain Layout
11328
11329 \emph on
11330 0
11331 \end_layout
11332
11333 \end_inset
11334
11335 ,
11336 \begin_inset Flex CharStyle:Code
11337 status collapsed
11338
11339 \begin_layout Plain Layout
11340 1
11341 \end_layout
11342
11343 \end_inset
11344
11345 ] Whether fragile commands in this layout should be 
11346 \begin_inset Flex CharStyle:Code
11347 status collapsed
11348
11349 \begin_layout Plain Layout
11350
11351 \backslash
11352 protect
11353 \end_layout
11354
11355 \end_inset
11356
11357 'ed.
11358  (Note: This is 
11359 \emph on
11360 not
11361 \emph default
11362  whether this command should itself be protected.)
11363 \end_layout
11364
11365 \begin_layout Description
11366 \begin_inset Flex CharStyle:Code
11367 status collapsed
11368
11369 \begin_layout Plain Layout
11370 Newline
11371 \end_layout
11372
11373 \end_inset
11374
11375  [
11376 \begin_inset Flex CharStyle:Code
11377 status collapsed
11378
11379 \begin_layout Plain Layout
11380 0
11381 \end_layout
11382
11383 \end_inset
11384
11385
11386 \begin_inset Flex CharStyle:Code
11387 status collapsed
11388
11389 \begin_layout Plain Layout
11390
11391 \emph on
11392 1
11393 \end_layout
11394
11395 \end_inset
11396
11397 ] Whether newlines are translated into LaTeX newlines (
11398 \begin_inset Flex CharStyle:Code
11399 status collapsed
11400
11401 \begin_layout Plain Layout
11402
11403 \backslash
11404
11405 \backslash
11406
11407 \end_layout
11408
11409 \end_inset
11410
11411 ) or not.
11412  The translation can be switched off to allow more comfortable LaTeX editing
11413  inside LyX.
11414 \end_layout
11415
11416 \begin_layout Description
11417 \begin_inset Flex CharStyle:Code
11418 status collapsed
11419
11420 \begin_layout Plain Layout
11421 NextNoIndent
11422 \end_layout
11423
11424 \end_inset
11425
11426  [
11427 \begin_inset Flex CharStyle:Code
11428 status collapsed
11429
11430 \begin_layout Plain Layout
11431 1
11432 \end_layout
11433
11434 \end_inset
11435
11436
11437 \begin_inset Flex CharStyle:Code
11438 status collapsed
11439
11440 \begin_layout Plain Layout
11441
11442 \emph on
11443 0
11444 \end_layout
11445
11446 \end_inset
11447
11448 ] Whether the following Paragraph is allowed to indent its very first row.
11449  
11450 \begin_inset Flex CharStyle:Code
11451 status collapsed
11452
11453 \begin_layout Plain Layout
11454 1
11455 \end_layout
11456
11457 \end_inset
11458
11459  means that it is not allowed to do so; 
11460 \begin_inset Flex CharStyle:Code
11461 status collapsed
11462
11463 \begin_layout Plain Layout
11464 0
11465 \end_layout
11466
11467 \end_inset
11468
11469  means it could do so if it wants to.
11470 \end_layout
11471
11472 \begin_layout Description
11473 \begin_inset Flex CharStyle:Code
11474 status collapsed
11475
11476 \begin_layout Plain Layout
11477 ObsoletedBy
11478 \end_layout
11479
11480 \end_inset
11481
11482  [[FIXME]]
11483 \end_layout
11484
11485 \begin_layout Description
11486 \begin_inset Flex CharStyle:Code
11487 status collapsed
11488
11489 \begin_layout Plain Layout
11490 OptionalArgs
11491 \end_layout
11492
11493 \end_inset
11494
11495  [
11496 \begin_inset Flex CharStyle:Code
11497 status collapsed
11498
11499 \begin_layout Plain Layout
11500 int=0
11501 \end_layout
11502
11503 \end_inset
11504
11505 ] The number of optional arguments that can be used with this layout.
11506  This is useful for things like section headings, and only makes sense with
11507  LaTeX.
11508 \end_layout
11509
11510 \begin_layout Description
11511 \begin_inset Flex CharStyle:Code
11512 status collapsed
11513
11514 \begin_layout Plain Layout
11515 ParIndent
11516 \end_layout
11517
11518 \end_inset
11519
11520  [
11521 \begin_inset Flex CharStyle:Code
11522 status collapsed
11523
11524 \begin_layout Plain Layout
11525 string=""
11526 \end_layout
11527
11528 \end_inset
11529
11530 ] The indent of the very first line of a paragraph.
11531  The 
11532 \begin_inset Flex CharStyle:Code
11533 status collapsed
11534
11535 \begin_layout Plain Layout
11536 Parindent
11537 \end_layout
11538
11539 \end_inset
11540
11541  will be fixed for a certain layout.
11542  The exception is Standard layout, since the indentation of a Standard layout
11543  paragraph can be prohibited with 
11544 \begin_inset Flex CharStyle:Code
11545 status collapsed
11546
11547 \begin_layout Plain Layout
11548 NextNoIndent
11549 \end_layout
11550
11551 \end_inset
11552
11553 .
11554  Also, Standard layout paragraphs inside environments use the 
11555 \begin_inset Flex CharStyle:Code
11556 status collapsed
11557
11558 \begin_layout Plain Layout
11559 Parindent
11560 \end_layout
11561
11562 \end_inset
11563
11564  of the environment, not their native one.
11565  For example, Standard paragraphs inside an enumeration are not indented.
11566 \end_layout
11567
11568 \begin_layout Description
11569 \begin_inset Flex CharStyle:Code
11570 status collapsed
11571
11572 \begin_layout Plain Layout
11573 Parsep
11574 \end_layout
11575
11576 \end_inset
11577
11578  [
11579 \begin_inset Flex CharStyle:Code
11580 status collapsed
11581
11582 \begin_layout Plain Layout
11583 float=0
11584 \end_layout
11585
11586 \end_inset
11587
11588 ] The vertical space between two paragraphs of this layout.
11589 \end_layout
11590
11591 \begin_layout Description
11592 \begin_inset Flex CharStyle:Code
11593 status collapsed
11594
11595 \begin_layout Plain Layout
11596 Parskip
11597 \end_layout
11598
11599 \end_inset
11600
11601  [
11602 \begin_inset Flex CharStyle:Code
11603 status collapsed
11604
11605 \begin_layout Plain Layout
11606 float=0
11607 \end_layout
11608
11609 \end_inset
11610
11611 ] LyX allows the user to choose either 
11612 \begin_inset Quotes eld
11613 \end_inset
11614
11615 indent
11616 \begin_inset Quotes erd
11617 \end_inset
11618
11619  or 
11620 \begin_inset Quotes eld
11621 \end_inset
11622
11623 skip
11624 \begin_inset Quotes erd
11625 \end_inset
11626
11627  to typeset a document.
11628  When 
11629 \begin_inset Quotes eld
11630 \end_inset
11631
11632 indent
11633 \begin_inset Quotes erd
11634 \end_inset
11635
11636  is chosen, this value is completely ignored.
11637  When 
11638 \begin_inset Quotes eld
11639 \end_inset
11640
11641 skip
11642 \begin_inset Quotes erd
11643 \end_inset
11644
11645  is chosen, the parindent of a LaTeXtype 
11646 \begin_inset Quotes eld
11647 \end_inset
11648
11649 Paragraph
11650 \begin_inset Quotes erd
11651 \end_inset
11652
11653  layout is ignored and all paragraphs are separated by this parskip argument.
11654  The vertical space is calculated with 
11655 \begin_inset Flex CharStyle:Code
11656 status collapsed
11657
11658 \begin_layout Plain Layout
11659 value
11660 \begin_inset space ~
11661 \end_inset
11662
11663 * DefaultHeight
11664 \end_layout
11665
11666 \end_inset
11667
11668  where 
11669 \begin_inset Flex CharStyle:Code
11670 status collapsed
11671
11672 \begin_layout Plain Layout
11673 DefaultHeight
11674 \end_layout
11675
11676 \end_inset
11677
11678  is the height of a row with the normal font.
11679  This way, the look stays the same with different screen fonts.
11680 \end_layout
11681
11682 \begin_layout Description
11683 \begin_inset Flex CharStyle:Code
11684 status collapsed
11685
11686 \begin_layout Plain Layout
11687 PassThru
11688 \end_layout
11689
11690 \end_inset
11691
11692  
11693 \begin_inset CommandInset label
11694 LatexCommand label
11695 name "des:PassThru"
11696
11697 \end_inset
11698
11699 [
11700 \emph on
11701
11702 \begin_inset Flex CharStyle:Code
11703 status collapsed
11704
11705 \begin_layout Plain Layout
11706
11707 \emph on
11708 0
11709 \end_layout
11710
11711 \end_inset
11712
11713
11714 \emph default
11715
11716 \begin_inset Flex CharStyle:Code
11717 status collapsed
11718
11719 \begin_layout Plain Layout
11720 1
11721 \end_layout
11722
11723 \end_inset
11724
11725 ] Whether the contents of this paragraph should be output in raw form, meaning
11726  without special translations that LaTeX would require.
11727 \end_layout
11728
11729 \begin_layout Description
11730 \begin_inset Flex CharStyle:Code
11731 status collapsed
11732
11733 \begin_layout Plain Layout
11734 Preamble
11735 \end_layout
11736
11737 \end_inset
11738
11739  
11740 \begin_inset CommandInset label
11741 LatexCommand label
11742 name "des:Preamble"
11743
11744 \end_inset
11745
11746 Information to be included in the LaTeX preamable when this style is used.
11747  Used to define macros, load packages, etc., required by this particular
11748  style.
11749  Must end with 
11750 \begin_inset Quotes eld
11751 \end_inset
11752
11753
11754 \begin_inset Flex CharStyle:Code
11755 status collapsed
11756
11757 \begin_layout Plain Layout
11758 EndPreamble
11759 \end_layout
11760
11761 \end_inset
11762
11763
11764 \begin_inset Quotes erd
11765 \end_inset
11766
11767 .
11768 \end_layout
11769
11770 \begin_layout Description
11771 \begin_inset Flex CharStyle:Code
11772 status collapsed
11773
11774 \begin_layout Plain Layout
11775 Requires 
11776 \end_layout
11777
11778 \end_inset
11779
11780 [
11781 \begin_inset Flex CharStyle:Code
11782 status collapsed
11783
11784 \begin_layout Plain Layout
11785 string
11786 \end_layout
11787
11788 \end_inset
11789
11790
11791 \begin_inset CommandInset label
11792 LatexCommand label
11793 name "des:Requires"
11794
11795 \end_inset
11796
11797 Whether the layout requires the feature 
11798 \begin_inset Flex CharStyle:Code
11799 status collapsed
11800
11801 \begin_layout Plain Layout
11802 string
11803 \end_layout
11804
11805 \end_inset
11806
11807 .
11808  See the description of 
11809 \begin_inset Flex CharStyle:Code
11810 status collapsed
11811
11812 \begin_layout Plain Layout
11813 Provides
11814 \end_layout
11815
11816 \end_inset
11817
11818  above (page 
11819 \begin_inset CommandInset ref
11820 LatexCommand pageref
11821 reference "des:FreeSpacing"
11822
11823 \end_inset
11824
11825 ) for information on `features'.
11826  
11827 \end_layout
11828
11829 \begin_layout Description
11830 \begin_inset Flex CharStyle:Code
11831 status collapsed
11832
11833 \begin_layout Plain Layout
11834 RightMargin
11835 \end_layout
11836
11837 \end_inset
11838
11839  [
11840 \begin_inset Flex CharStyle:Code
11841 status collapsed
11842
11843 \begin_layout Plain Layout
11844 string=""
11845 \end_layout
11846
11847 \end_inset
11848
11849 ] Similar to 
11850 \begin_inset Flex CharStyle:Code
11851 status collapsed
11852
11853 \begin_layout Plain Layout
11854 LeftMargin
11855 \end_layout
11856
11857 \end_inset
11858
11859 .
11860 \end_layout
11861
11862 \begin_layout Description
11863 \begin_inset Flex CharStyle:Code
11864 status collapsed
11865
11866 \begin_layout Plain Layout
11867 Spacing
11868 \end_layout
11869
11870 \end_inset
11871
11872  [
11873 \begin_inset Flex CharStyle:Code
11874 status collapsed
11875
11876 \begin_layout Plain Layout
11877
11878 \emph on
11879 single
11880 \emph default
11881 , onehalf, double, other
11882 \end_layout
11883
11884 \end_inset
11885
11886  
11887 \emph on
11888 value
11889 \emph default
11890 ] This defines what the default spacing should be in the layout.
11891  The arguments 
11892 \begin_inset Flex CharStyle:Code
11893 status collapsed
11894
11895 \begin_layout Plain Layout
11896 single
11897 \end_layout
11898
11899 \end_inset
11900
11901
11902 \begin_inset Flex CharStyle:Code
11903 status collapsed
11904
11905 \begin_layout Plain Layout
11906 onehalf
11907 \end_layout
11908
11909 \end_inset
11910
11911  and 
11912 \begin_inset Flex CharStyle:Code
11913 status collapsed
11914
11915 \begin_layout Plain Layout
11916 double
11917 \end_layout
11918
11919 \end_inset
11920
11921  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11922  If you specify the argument 
11923 \begin_inset Flex CharStyle:Code
11924 status collapsed
11925
11926 \begin_layout Plain Layout
11927 other
11928 \end_layout
11929
11930 \end_inset
11931
11932 , then you should also provide a numerical argument which will be the actual
11933  multiplier value.
11934  Note that, contrary to other parameters, 
11935 \begin_inset Flex CharStyle:Code
11936 status collapsed
11937
11938 \begin_layout Plain Layout
11939 Spacing
11940 \end_layout
11941
11942 \end_inset
11943
11944  implies the generation of specific LaTeX code, using the package 
11945 \family roman
11946
11947 \begin_inset Flex CharStyle:Code
11948 status collapsed
11949
11950 \begin_layout Plain Layout
11951 setspace.sty
11952 \end_layout
11953
11954 \end_inset
11955
11956 .
11957 \end_layout
11958
11959 \begin_layout Description
11960 \begin_inset Flex CharStyle:Code
11961 status collapsed
11962
11963 \begin_layout Plain Layout
11964 TextFont
11965 \end_layout
11966
11967 \end_inset
11968
11969  The font used for the text body .
11970  See section 
11971 \begin_inset CommandInset ref
11972 LatexCommand ref
11973 reference "sec:fonts"
11974
11975 \end_inset
11976
11977 .
11978 \end_layout
11979
11980 \begin_layout Description
11981 Need
11982 \begin_inset Flex CharStyle:Code
11983 status collapsed
11984
11985 \begin_layout Plain Layout
11986
11987 \series medium
11988 TocLevel [int]
11989 \end_layout
11990
11991 \end_inset
11992
11993  The level of the style in the table of contents.
11994  This is used for automatic numbering of section headings.
11995 \end_layout
11996
11997 \begin_layout Description
11998 \begin_inset Flex CharStyle:Code
11999 status collapsed
12000
12001 \begin_layout Plain Layout
12002 TopSep
12003 \end_layout
12004
12005 \end_inset
12006
12007  [
12008 \begin_inset Flex CharStyle:Code
12009 status collapsed
12010
12011 \begin_layout Plain Layout
12012 float=0
12013 \end_layout
12014
12015 \end_inset
12016
12017 ] The vertical space with which the very first of a chain of paragraphs
12018  with this layout is separated from the previous paragraph.
12019  If the previous paragraph has another layout, the separations are not simply
12020  added, but the maximum is taken.
12021 \end_layout
12022
12023 \begin_layout Subsection
12024 Floats
12025 \end_layout
12026
12027 \begin_layout Standard
12028 \begin_inset CommandInset label
12029 LatexCommand label
12030 name "sec:floats"
12031
12032 \end_inset
12033
12034 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12035  define the floats (
12036 \begin_inset Flex CharStyle:MenuItem
12037 status collapsed
12038
12039 \begin_layout Plain Layout
12040 figure
12041 \end_layout
12042
12043 \end_inset
12044
12045
12046 \begin_inset Flex CharStyle:MenuItem
12047 status collapsed
12048
12049 \begin_layout Plain Layout
12050 table
12051 \end_layout
12052
12053 \end_inset
12054
12055 , \SpecialChar \ldots{}
12056 ) in the text class itself.
12057  Standard floats are included in the file 
12058 \begin_inset Flex CharStyle:Code
12059 status collapsed
12060
12061 \begin_layout Plain Layout
12062 stdfloats.inc
12063 \end_layout
12064
12065 \end_inset
12066
12067 , so you may have to do no more than add
12068 \end_layout
12069
12070 \begin_layout LyX-Code
12071 Input stdfloats.inc
12072 \end_layout
12073
12074 \begin_layout Standard
12075 to your layout file.
12076  If you want to implement a text class that proposes some other float types
12077  (like the AGU class bundled with LyX), the information below will hopefully
12078  help you:
12079 \end_layout
12080
12081 \begin_layout Description
12082 \begin_inset Flex CharStyle:Code
12083 status collapsed
12084
12085 \begin_layout Plain Layout
12086 Extension
12087 \end_layout
12088
12089 \end_inset
12090
12091  [
12092 \begin_inset Flex CharStyle:Code
12093 status collapsed
12094
12095 \begin_layout Plain Layout
12096 string
12097 \end_layout
12098
12099 \end_inset
12100
12101 =
12102 \begin_inset Quotes erd
12103 \end_inset
12104
12105
12106 \begin_inset Quotes erd
12107 \end_inset
12108
12109 ] The file name extension of an auxiliary file for the list of figures (or
12110  whatever).
12111  LaTeX writes the captions to this file.
12112 \end_layout
12113
12114 \begin_layout Description
12115 \begin_inset Flex CharStyle:Code
12116 status collapsed
12117
12118 \begin_layout Plain Layout
12119 GuiName
12120 \end_layout
12121
12122 \end_inset
12123
12124  [
12125 \begin_inset Flex CharStyle:Code
12126 status collapsed
12127
12128 \begin_layout Plain Layout
12129 string
12130 \end_layout
12131
12132 \end_inset
12133
12134 =
12135 \begin_inset Quotes erd
12136 \end_inset
12137
12138
12139 \begin_inset Quotes erd
12140 \end_inset
12141
12142 ] The string that will be used in the menus and also for the caption.
12143 \end_layout
12144
12145 \begin_layout Description
12146 \begin_inset Flex CharStyle:Code
12147 status collapsed
12148
12149 \begin_layout Plain Layout
12150 LaTeXBuiltin
12151 \end_layout
12152
12153 \end_inset
12154
12155  [
12156 \begin_inset Flex CharStyle:Code
12157 status collapsed
12158
12159 \begin_layout Plain Layout
12160
12161 \emph on
12162 0
12163 \end_layout
12164
12165 \end_inset
12166
12167
12168 \begin_inset Flex CharStyle:Code
12169 status collapsed
12170
12171 \begin_layout Plain Layout
12172 1
12173 \end_layout
12174
12175 \end_inset
12176
12177 ] Set to 
12178 \begin_inset Flex CharStyle:Code
12179 status collapsed
12180
12181 \begin_layout Plain Layout
12182 1
12183 \end_layout
12184
12185 \end_inset
12186
12187  if the float is already defined by the LaTeX document class.
12188  If this is set to 
12189 \begin_inset Flex CharStyle:Code
12190 status collapsed
12191
12192 \begin_layout Plain Layout
12193 0
12194 \end_layout
12195
12196 \end_inset
12197
12198 , the float will be defined using the LaTeX package 
12199 \begin_inset Flex CharStyle:Code
12200 status collapsed
12201
12202 \begin_layout Plain Layout
12203 float
12204 \end_layout
12205
12206 \end_inset
12207
12208 .
12209 \end_layout
12210
12211 \begin_layout Description
12212 \begin_inset Flex CharStyle:Code
12213 status collapsed
12214
12215 \begin_layout Plain Layout
12216 ListName
12217 \end_layout
12218
12219 \end_inset
12220
12221  [
12222 \begin_inset Flex CharStyle:Code
12223 status collapsed
12224
12225 \begin_layout Plain Layout
12226 string
12227 \end_layout
12228
12229 \end_inset
12230
12231 =
12232 \begin_inset Quotes erd
12233 \end_inset
12234
12235
12236 \begin_inset Quotes erd
12237 \end_inset
12238
12239 ] The heading used for the list of floats.
12240 \end_layout
12241
12242 \begin_layout Description
12243 \begin_inset Flex CharStyle:Code
12244 status collapsed
12245
12246 \begin_layout Plain Layout
12247 NumberWithin
12248 \end_layout
12249
12250 \end_inset
12251
12252  [
12253 \begin_inset Flex CharStyle:Code
12254 status collapsed
12255
12256 \begin_layout Plain Layout
12257 string
12258 \end_layout
12259
12260 \end_inset
12261
12262 =
12263 \begin_inset Quotes erd
12264 \end_inset
12265
12266
12267 \begin_inset Quotes erd
12268 \end_inset
12269
12270 ] This (optional) argument determines whether floats of this class will
12271  be numbered within some sectional unit of the document.
12272  For example, if within is equal to 
12273 \begin_inset Flex CharStyle:Code
12274 status collapsed
12275
12276 \begin_layout Plain Layout
12277 chapter
12278 \end_layout
12279
12280 \end_inset
12281
12282 , the floats will be numbered within chapters.
12283  
12284 \end_layout
12285
12286 \begin_layout Description
12287 \begin_inset Flex CharStyle:Code
12288 status collapsed
12289
12290 \begin_layout Plain Layout
12291 Placement
12292 \end_layout
12293
12294 \end_inset
12295
12296  [
12297 \begin_inset Flex CharStyle:Code
12298 status collapsed
12299
12300 \begin_layout Plain Layout
12301 string
12302 \end_layout
12303
12304 \end_inset
12305
12306 =
12307 \begin_inset Quotes erd
12308 \end_inset
12309
12310
12311 \begin_inset Quotes erd
12312 \end_inset
12313
12314 ] The default placement for the given class of floats.
12315  The string should be as in standard LaTeX: 
12316 \begin_inset Flex CharStyle:Code
12317 status collapsed
12318
12319 \begin_layout Plain Layout
12320 t
12321 \end_layout
12322
12323 \end_inset
12324
12325
12326 \begin_inset Flex CharStyle:Code
12327 status collapsed
12328
12329 \begin_layout Plain Layout
12330 b
12331 \end_layout
12332
12333 \end_inset
12334
12335
12336 \begin_inset Flex CharStyle:Code
12337 status collapsed
12338
12339 \begin_layout Plain Layout
12340 p
12341 \end_layout
12342
12343 \end_inset
12344
12345  and 
12346 \begin_inset Flex CharStyle:Code
12347 status collapsed
12348
12349 \begin_layout Plain Layout
12350 h
12351 \end_layout
12352
12353 \end_inset
12354
12355  for top, bottom, page, and here, respectively.
12356 \begin_inset Foot
12357 status collapsed
12358
12359 \begin_layout Plain Layout
12360 Note that the order of these letters in the string is irrelevant, like in
12361  LaTeX.
12362 \end_layout
12363
12364 \end_inset
12365
12366  On top of that there is a new type, 
12367 \begin_inset Flex CharStyle:Code
12368 status collapsed
12369
12370 \begin_layout Plain Layout
12371 H
12372 \end_layout
12373
12374 \end_inset
12375
12376 , which does not really correspond to a float, since it means: put it 
12377 \begin_inset Quotes eld
12378 \end_inset
12379
12380 here
12381 \begin_inset Quotes erd
12382 \end_inset
12383
12384  and nowhere else.
12385  Note however that the 
12386 \begin_inset Flex CharStyle:Code
12387 status collapsed
12388
12389 \begin_layout Plain Layout
12390 H
12391 \end_layout
12392
12393 \end_inset
12394
12395  specifier is special and, because of implementation details, cannot be
12396  used in non-builtin float types.
12397  If you do not understand what this means, just use 
12398 \begin_inset Quotes eld
12399 \end_inset
12400
12401
12402 \begin_inset Flex CharStyle:Code
12403 status collapsed
12404
12405 \begin_layout Plain Layout
12406 tbp
12407 \end_layout
12408
12409 \end_inset
12410
12411
12412 \begin_inset Quotes erd
12413 \end_inset
12414
12415 .
12416 \end_layout
12417
12418 \begin_layout Description
12419 \begin_inset Flex CharStyle:Code
12420 status collapsed
12421
12422 \begin_layout Plain Layout
12423 Style
12424 \end_layout
12425
12426 \end_inset
12427
12428  [
12429 \begin_inset Flex CharStyle:Code
12430 status collapsed
12431
12432 \begin_layout Plain Layout
12433 string
12434 \end_layout
12435
12436 \end_inset
12437
12438 =
12439 \begin_inset Quotes erd
12440 \end_inset
12441
12442
12443 \begin_inset Quotes erd
12444 \end_inset
12445
12446 ] The style used when defining the float using 
12447 \begin_inset Flex CharStyle:Code
12448 status collapsed
12449
12450 \begin_layout Plain Layout
12451
12452 \backslash
12453 newfloat
12454 \end_layout
12455
12456 \end_inset
12457
12458 .
12459 \end_layout
12460
12461 \begin_layout Description
12462 \begin_inset Flex CharStyle:Code
12463 status collapsed
12464
12465 \begin_layout Plain Layout
12466 Type
12467 \end_layout
12468
12469 \end_inset
12470
12471  [
12472 \begin_inset Flex CharStyle:Code
12473 status collapsed
12474
12475 \begin_layout Plain Layout
12476 string
12477 \end_layout
12478
12479 \end_inset
12480
12481 =
12482 \begin_inset Quotes erd
12483 \end_inset
12484
12485
12486 \begin_inset Quotes erd
12487 \end_inset
12488
12489 ] The 
12490 \begin_inset Quotes eld
12491 \end_inset
12492
12493 type
12494 \begin_inset Quotes erd
12495 \end_inset
12496
12497  of the new class of floats, like program or algorithm.
12498  After the appropriate 
12499 \begin_inset Flex CharStyle:Code
12500 status collapsed
12501
12502 \begin_layout Plain Layout
12503
12504 \backslash
12505 newfloat
12506 \end_layout
12507
12508 \end_inset
12509
12510 , commands such as 
12511 \begin_inset Flex CharStyle:Code
12512 status collapsed
12513
12514 \begin_layout Plain Layout
12515
12516 \backslash
12517 begin{program}
12518 \end_layout
12519
12520 \end_inset
12521
12522  or 
12523 \begin_inset Flex CharStyle:Code
12524 status collapsed
12525
12526 \begin_layout Plain Layout
12527
12528 \backslash
12529 end{algorithm*}
12530 \end_layout
12531
12532 \end_inset
12533
12534  will be available.
12535 \end_layout
12536
12537 \begin_layout Standard
12538 Note that defining a float with type 
12539 \begin_inset Flex CharStyle:Code
12540 status collapsed
12541
12542 \begin_layout Plain Layout
12543
12544 \emph on
12545 type
12546 \end_layout
12547
12548 \end_inset
12549
12550  automatically defines the corresponding counter with name 
12551 \begin_inset Flex CharStyle:Code
12552 status collapsed
12553
12554 \begin_layout Plain Layout
12555
12556 \emph on
12557 type
12558 \end_layout
12559
12560 \end_inset
12561
12562 .
12563 \end_layout
12564
12565 \begin_layout Subsection
12566 Inset layouts and Flex insets
12567 \end_layout
12568
12569 \begin_layout Standard
12570 \begin_inset CommandInset label
12571 LatexCommand label
12572 name "sec:charstyle"
12573
12574 \end_inset
12575
12576 LyX has supported character styles since version 1.4.0; since version 1.6.0
12577  these are called Flex insets.
12578  
12579 \end_layout
12580
12581 \begin_layout Standard
12582 Furthermore, it is possible to define the general layout of many different
12583  types of insets.
12584  Currently, InsetLayout can be used to customize the  layout parameters
12585  for footnotes, marginal notes, note insets, ERT insets, branches, listings,
12586  indexes, boxes, tables, algorithms, URLs, and optional arguments, as well
12587  as Flex insets.
12588  
12589 \end_layout
12590
12591 \begin_layout Standard
12592 Flex insets come in three different kinds: 
12593 \end_layout
12594
12595 \begin_layout Itemize
12596 character style (
12597 \begin_inset Flex CharStyle:Code
12598 status collapsed
12599
12600 \begin_layout Plain Layout
12601 CharStyle
12602 \end_layout
12603
12604 \end_inset
12605
12606 ): These define semantic markup corresponding to such LaTeX commands as
12607  
12608 \begin_inset Flex CharStyle:Code
12609 status collapsed
12610
12611 \begin_layout Plain Layout
12612
12613 \backslash
12614 noun
12615 \end_layout
12616
12617 \end_inset
12618
12619  and 
12620 \begin_inset Flex CharStyle:Code
12621 status collapsed
12622
12623 \begin_layout Plain Layout
12624
12625 \backslash
12626 code
12627 \end_layout
12628
12629 \end_inset
12630
12631 .
12632 \end_layout
12633
12634 \begin_layout Itemize
12635 user custom (
12636 \begin_inset Flex CharStyle:Code
12637 status collapsed
12638
12639 \begin_layout Plain Layout
12640 Custom
12641 \end_layout
12642
12643 \end_inset
12644
12645 ): These can be used to define custom collapsable insets, similar to ERT,
12646  footnote, and the like.
12647 \end_layout
12648
12649 \begin_layout Itemize
12650 XML elements (
12651 \begin_inset Flex CharStyle:Code
12652 status collapsed
12653
12654 \begin_layout Plain Layout
12655 Element
12656 \end_layout
12657
12658 \end_inset
12659
12660 ): For use with DocBook classes.
12661 \end_layout
12662
12663 \begin_layout Standard
12664 The 
12665 \begin_inset Flex CharStyle:Code
12666 status collapsed
12667
12668 \begin_layout Plain Layout
12669 InsetLayout
12670 \end_layout
12671
12672 \end_inset
12673
12674  definition starting line is of the form
12675 \end_layout
12676
12677 \begin_layout LyX-Code
12678 InsetLayout <Type> <Name>
12679 \end_layout
12680
12681 \begin_layout Standard
12682 where 
12683 \begin_inset Flex CharStyle:Code
12684 status collapsed
12685
12686 \begin_layout Plain Layout
12687 <Type>
12688 \end_layout
12689
12690 \end_inset
12691
12692  can be 
12693 \begin_inset Flex CharStyle:Code
12694 status collapsed
12695
12696 \begin_layout Plain Layout
12697 Algorithm
12698 \end_layout
12699
12700 \end_inset
12701
12702
12703 \begin_inset Flex CharStyle:Code
12704 status collapsed
12705
12706 \begin_layout Plain Layout
12707 Branch
12708 \end_layout
12709
12710 \end_inset
12711
12712
12713 \begin_inset Flex CharStyle:Code
12714 status collapsed
12715
12716 \begin_layout Plain Layout
12717 Box
12718 \end_layout
12719
12720 \end_inset
12721
12722
12723 \begin_inset Flex CharStyle:Code
12724 status collapsed
12725
12726 \begin_layout Plain Layout
12727 ERT
12728 \end_layout
12729
12730 \end_inset
12731
12732
12733 \begin_inset Flex CharStyle:Code
12734 status collapsed
12735
12736 \begin_layout Plain Layout
12737 Figure
12738 \end_layout
12739
12740 \end_inset
12741
12742
12743 \begin_inset Flex CharStyle:Code
12744 status collapsed
12745
12746 \begin_layout Plain Layout
12747 Foot
12748 \end_layout
12749
12750 \end_inset
12751
12752
12753 \begin_inset Flex CharStyle:Code
12754 status collapsed
12755
12756 \begin_layout Plain Layout
12757 Index
12758 \end_layout
12759
12760 \end_inset
12761
12762
12763 \begin_inset Flex CharStyle:Code
12764 status collapsed
12765
12766 \begin_layout Plain Layout
12767 Listings
12768 \end_layout
12769
12770 \end_inset
12771
12772
12773 \begin_inset Flex CharStyle:Code
12774 status collapsed
12775
12776 \begin_layout Plain Layout
12777 Marginal
12778 \end_layout
12779
12780 \end_inset
12781
12782
12783 \begin_inset Flex CharStyle:Code
12784 status collapsed
12785
12786 \begin_layout Plain Layout
12787 Note:Comment
12788 \end_layout
12789
12790 \end_inset
12791
12792
12793 \begin_inset Flex CharStyle:Code
12794 status collapsed
12795
12796 \begin_layout Plain Layout
12797 Note:Note
12798 \end_layout
12799
12800 \end_inset
12801
12802
12803 \begin_inset Flex CharStyle:Code
12804 status collapsed
12805
12806 \begin_layout Plain Layout
12807 Note:GreyedOut
12808 \end_layout
12809
12810 \end_inset
12811
12812
12813 \begin_inset Flex CharStyle:Code
12814 status collapsed
12815
12816 \begin_layout Plain Layout
12817 OptArg
12818 \end_layout
12819
12820 \end_inset
12821
12822
12823 \begin_inset Flex CharStyle:Code
12824 status collapsed
12825
12826 \begin_layout Plain Layout
12827 Table
12828 \end_layout
12829
12830 \end_inset
12831
12832
12833 \begin_inset Flex CharStyle:Code
12834 status collapsed
12835
12836 \begin_layout Plain Layout
12837 URL
12838 \end_layout
12839
12840 \end_inset
12841
12842 , or 
12843 \begin_inset Flex CharStyle:Code
12844 status collapsed
12845
12846 \begin_layout Plain Layout
12847 Flex
12848 \end_layout
12849
12850 \end_inset
12851
12852 .
12853  If 
12854 \begin_inset Flex CharStyle:Code
12855 status collapsed
12856
12857 \begin_layout Plain Layout
12858 <Type>
12859 \end_layout
12860
12861 \end_inset
12862
12863  is 
12864 \begin_inset Flex CharStyle:Code
12865 status collapsed
12866
12867 \begin_layout Plain Layout
12868 Flex
12869 \end_layout
12870
12871 \end_inset
12872
12873 , then 
12874 \begin_inset Flex CharStyle:Code
12875 status collapsed
12876
12877 \begin_layout Plain Layout
12878 <Name>
12879 \end_layout
12880
12881 \end_inset
12882
12883  should have the form 
12884 \begin_inset Flex CharStyle:Code
12885 status collapsed
12886
12887 \begin_layout Plain Layout
12888 SubType:StyleName
12889 \end_layout
12890
12891 \end_inset
12892
12893 , where 
12894 \begin_inset Flex CharStyle:Code
12895 status collapsed
12896
12897 \begin_layout Plain Layout
12898 SubType
12899 \end_layout
12900
12901 \end_inset
12902
12903  is either 
12904 \begin_inset Flex CharStyle:Code
12905 status collapsed
12906
12907 \begin_layout Plain Layout
12908 CharStyle
12909 \end_layout
12910
12911 \end_inset
12912
12913
12914 \begin_inset Flex CharStyle:Code
12915 status collapsed
12916
12917 \begin_layout Plain Layout
12918 Custom
12919 \end_layout
12920
12921 \end_inset
12922
12923 , or 
12924 \begin_inset Flex CharStyle:Code
12925 status collapsed
12926
12927 \begin_layout Plain Layout
12928 Element
12929 \end_layout
12930
12931 \end_inset
12932
12933 , and 
12934 \begin_inset Flex CharStyle:Code
12935 status collapsed
12936
12937 \begin_layout Plain Layout
12938 StyleName
12939 \end_layout
12940
12941 \end_inset
12942
12943  is any valid identifier.
12944  
12945 \end_layout
12946
12947 \begin_layout Standard
12948 The following 
12949 \begin_inset Flex CharStyle:Code
12950 status collapsed
12951
12952 \begin_layout Plain Layout
12953 InsetLayout
12954 \end_layout
12955
12956 \end_inset
12957
12958  section can contain the following entries:
12959 \end_layout
12960
12961 \begin_layout Description
12962 \begin_inset Flex CharStyle:Code
12963 status collapsed
12964
12965 \begin_layout Plain Layout
12966 BgColor
12967 \end_layout
12968
12969 \end_inset
12970
12971  The color for the inset's background.
12972  These valid colors are defined in 
12973 \begin_inset Flex CharStyle:Code
12974 status collapsed
12975
12976 \begin_layout Plain Layout
12977 src/ColorCode.h
12978 \end_layout
12979
12980 \end_inset
12981
12982 .
12983 \end_layout
12984
12985 \begin_layout Description
12986 \begin_inset Flex CharStyle:Code
12987 status collapsed
12988
12989 \begin_layout Plain Layout
12990 CopyStyle
12991 \end_layout
12992
12993 \end_inset
12994
12995  As with paragraph styles (see page 
12996 \begin_inset CommandInset ref
12997 LatexCommand ref
12998 reference "des:CopyStyle"
12999
13000 \end_inset
13001
13002 ).
13003 \end_layout
13004
13005 \begin_layout Description
13006 \begin_inset Flex CharStyle:Code
13007 status collapsed
13008
13009 \begin_layout Plain Layout
13010 Decoration
13011 \end_layout
13012
13013 \end_inset
13014
13015  can be 
13016 \begin_inset Flex CharStyle:Code
13017 status collapsed
13018
13019 \begin_layout Plain Layout
13020 Classic
13021 \end_layout
13022
13023 \end_inset
13024
13025
13026 \begin_inset Flex CharStyle:Code
13027 status collapsed
13028
13029 \begin_layout Plain Layout
13030 Minimalistic
13031 \end_layout
13032
13033 \end_inset
13034
13035 , or 
13036 \begin_inset Flex CharStyle:Code
13037 status collapsed
13038
13039 \begin_layout Plain Layout
13040 Conglomerate
13041 \end_layout
13042
13043 \end_inset
13044
13045 , describing the rendering style used for the inset's frame and buttons.
13046  Footnotes generally use 
13047 \begin_inset Flex CharStyle:Code
13048 status collapsed
13049
13050 \begin_layout Plain Layout
13051 Classic
13052 \end_layout
13053
13054 \end_inset
13055
13056 ; ERT insets generally use 
13057 \begin_inset Flex CharStyle:Code
13058 status collapsed
13059
13060 \begin_layout Plain Layout
13061 Minimalistic
13062 \end_layout
13063
13064 \end_inset
13065
13066 ; and character styles use 
13067 \begin_inset Flex CharStyle:Code
13068 status collapsed
13069
13070 \begin_layout Plain Layout
13071 Conglomerate
13072 \end_layout
13073
13074 \end_inset
13075
13076 .
13077 \end_layout
13078
13079 \begin_layout Description
13080 \begin_inset Flex CharStyle:Code
13081 status collapsed
13082
13083 \begin_layout Plain Layout
13084 Font
13085 \end_layout
13086
13087 \end_inset
13088
13089  The font used for both the text body 
13090 \emph on
13091 and
13092 \emph default
13093  the label.
13094  See section
13095 \begin_inset space ~
13096 \end_inset
13097
13098
13099 \begin_inset CommandInset ref
13100 LatexCommand ref
13101 reference "sec:fonts"
13102
13103 \end_inset
13104
13105 .
13106  Note that defining this font automatically defines the 
13107 \begin_inset Flex CharStyle:Code
13108 status collapsed
13109
13110 \begin_layout Plain Layout
13111 LabelFont
13112 \end_layout
13113
13114 \end_inset
13115
13116  to the same value, so define this first and define 
13117 \begin_inset Flex CharStyle:Code
13118 status collapsed
13119
13120 \begin_layout Plain Layout
13121 LabelFont
13122 \end_layout
13123
13124 \end_inset
13125
13126  later if you want them to be different.
13127 \end_layout
13128
13129 \begin_layout Description
13130 \begin_inset Flex CharStyle:Code
13131 status collapsed
13132
13133 \begin_layout Plain Layout
13134 ForceLTR
13135 \end_layout
13136
13137 \end_inset
13138
13139  [[FIXME]]
13140 \end_layout
13141
13142 \begin_layout Description
13143 \begin_inset Flex CharStyle:Code
13144 status collapsed
13145
13146 \begin_layout Plain Layout
13147 FreeSpacing
13148 \end_layout
13149
13150 \end_inset
13151
13152  As with paragraph styles (see page 
13153 \begin_inset CommandInset ref
13154 LatexCommand pageref
13155 reference "des:FreeSpacing"
13156
13157 \end_inset
13158
13159 ).
13160 \end_layout
13161
13162 \begin_layout Description
13163 \begin_inset Flex CharStyle:Code
13164 status collapsed
13165
13166 \begin_layout Plain Layout
13167 KeepEmpty
13168 \end_layout
13169
13170 \end_inset
13171
13172  As with paragraph styles (see page 
13173 \begin_inset CommandInset ref
13174 LatexCommand pageref
13175 reference "des:KeepEmpty"
13176
13177 \end_inset
13178
13179 ).
13180 \end_layout
13181
13182 \begin_layout Description
13183 \begin_inset Flex CharStyle:Code
13184 status collapsed
13185
13186 \begin_layout Plain Layout
13187 LabelString
13188 \end_layout
13189
13190 \end_inset
13191
13192  What will be displayed on the button or elsewhere as the inset label.
13193  Some inset types (ERT and Branch) modify this label on the fly.
13194 \end_layout
13195
13196 \begin_layout Description
13197 \begin_inset Flex CharStyle:Code
13198 status collapsed
13199
13200 \begin_layout Plain Layout
13201 LabelFont
13202 \end_layout
13203
13204 \end_inset
13205
13206  The font used for the label.
13207  See section
13208 \begin_inset space ~
13209 \end_inset
13210
13211
13212 \begin_inset CommandInset ref
13213 LatexCommand ref
13214 reference "sec:fonts"
13215
13216 \end_inset
13217
13218 .
13219  Note that this definition can never appear before 
13220 \begin_inset Flex CharStyle:Code
13221 status collapsed
13222
13223 \begin_layout Plain Layout
13224 Font
13225 \end_layout
13226
13227 \end_inset
13228
13229 , lest it be ineffective.
13230 \end_layout
13231
13232 \begin_layout Description
13233 \begin_inset Flex CharStyle:Code
13234 status collapsed
13235
13236 \begin_layout Plain Layout
13237 LatexName
13238 \end_layout
13239
13240 \end_inset
13241
13242  The name of the corresponding LaTeX stuff.
13243  Either the environment or command name.
13244 \end_layout
13245
13246 \begin_layout Description
13247 \begin_inset Flex CharStyle:Code
13248 status collapsed
13249
13250 \begin_layout Plain Layout
13251 LatexParam
13252 \end_layout
13253
13254 \end_inset
13255
13256  The optional parameter for the corresponding 
13257 \begin_inset Flex CharStyle:Code
13258 status collapsed
13259
13260 \begin_layout Plain Layout
13261 LatexName
13262 \end_layout
13263
13264 \end_inset
13265
13266  stuff, including possible bracket pairs like 
13267 \begin_inset Flex CharStyle:Code
13268 status collapsed
13269
13270 \begin_layout Plain Layout
13271 []
13272 \end_layout
13273
13274 \end_inset
13275
13276 .
13277  This parameter cannot be changed from within LyX.
13278 \end_layout
13279
13280 \begin_layout Description
13281 \begin_inset Flex CharStyle:Code
13282 status collapsed
13283
13284 \begin_layout Plain Layout
13285 LatexType
13286 \end_layout
13287
13288 \end_inset
13289
13290  As with paragraph styles (see page 
13291 \begin_inset CommandInset ref
13292 LatexCommand pageref
13293 reference "des:LatexType"
13294
13295 \end_inset
13296
13297 ).
13298 \end_layout
13299
13300 \begin_layout Description
13301 \begin_inset Flex CharStyle:Code
13302 status collapsed
13303
13304 \begin_layout Plain Layout
13305 LyxType 
13306 \end_layout
13307
13308 \end_inset
13309
13310  Can be 
13311 \begin_inset Flex CharStyle:Code
13312 status collapsed
13313
13314 \begin_layout Plain Layout
13315 charstyle
13316 \end_layout
13317
13318 \end_inset
13319
13320
13321 \begin_inset Flex CharStyle:Code
13322 status collapsed
13323
13324 \begin_layout Plain Layout
13325 custom
13326 \end_layout
13327
13328 \end_inset
13329
13330
13331 \begin_inset Flex CharStyle:Code
13332 status collapsed
13333
13334 \begin_layout Plain Layout
13335 element
13336 \end_layout
13337
13338 \end_inset
13339
13340
13341 \begin_inset Flex CharStyle:Code
13342 status collapsed
13343
13344 \begin_layout Plain Layout
13345 end
13346 \end_layout
13347
13348 \end_inset
13349
13350  (indicating a dummy definition ending definitions of charstyles etc.).
13351  This entry is only meaningful for Flex (user definable) insets.
13352 \end_layout
13353
13354 \begin_layout Description
13355 \begin_inset Flex CharStyle:Code
13356 status collapsed
13357
13358 \begin_layout Plain Layout
13359 NeedProtect
13360 \end_layout
13361
13362 \end_inset
13363
13364  [
13365 \begin_inset Flex CharStyle:Code
13366 status collapsed
13367
13368 \begin_layout Plain Layout
13369
13370 \emph on
13371 0
13372 \end_layout
13373
13374 \end_inset
13375
13376 ,
13377 \begin_inset Flex CharStyle:Code
13378 status collapsed
13379
13380 \begin_layout Plain Layout
13381 1
13382 \end_layout
13383
13384 \end_inset
13385
13386 ] Whether fragile commands in this layout should be 
13387 \begin_inset Flex CharStyle:Code
13388 status collapsed
13389
13390 \begin_layout Plain Layout
13391
13392 \backslash
13393 protect
13394 \end_layout
13395
13396 \end_inset
13397
13398 'ed.
13399  (Note: This is 
13400 \emph on
13401 not
13402 \emph default
13403  whether this command should itself be protected.)
13404 \end_layout
13405
13406 \begin_layout Description
13407 \begin_inset Flex CharStyle:Code
13408 status collapsed
13409
13410 \begin_layout Plain Layout
13411 Preamble
13412 \end_layout
13413
13414 \end_inset
13415
13416  As with paragraph styles (see page 
13417 \begin_inset CommandInset ref
13418 LatexCommand pageref
13419 reference "des:Preamble"
13420
13421 \end_inset
13422
13423 ).
13424 \end_layout
13425
13426 \begin_layout Description
13427 \begin_inset Flex CharStyle:Code
13428 status collapsed
13429
13430 \begin_layout Plain Layout
13431 Requires 
13432 \end_layout
13433
13434 \end_inset
13435
13436  [
13437 \begin_inset Flex CharStyle:Code
13438 status collapsed
13439
13440 \begin_layout Plain Layout
13441 string
13442 \end_layout
13443
13444 \end_inset
13445
13446 ] As with paragraph styles (see page 
13447 \begin_inset CommandInset ref
13448 LatexCommand pageref
13449 reference "des:Requires"
13450
13451 \end_inset
13452
13453 ).
13454 \end_layout
13455
13456 \begin_layout Subsection
13457 Counters
13458 \end_layout
13459
13460 \begin_layout Standard
13461 \begin_inset CommandInset label
13462 LatexCommand label
13463 name "sec:counter"
13464
13465 \end_inset
13466
13467 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13468  counters (
13469 \begin_inset Flex CharStyle:MenuItem
13470 status collapsed
13471
13472 \begin_layout Plain Layout
13473 chapter
13474 \end_layout
13475
13476 \end_inset
13477
13478
13479 \begin_inset Flex CharStyle:MenuItem
13480 status collapsed
13481
13482 \begin_layout Plain Layout
13483 figure
13484 \end_layout
13485
13486 \end_inset
13487
13488 , \SpecialChar \ldots{}
13489 ) in the text class itself.
13490  The standard counters are defined in the file 
13491 \begin_inset Flex CharStyle:Code
13492 status collapsed
13493
13494 \begin_layout Plain Layout
13495 stdcounters.inc
13496 \end_layout
13497
13498 \end_inset
13499
13500 , so you may have to do no more than add
13501 \end_layout
13502
13503 \begin_layout LyX-Code
13504 Input stdcounters.inc
13505 \end_layout
13506
13507 \begin_layout Standard
13508 to your layout file to get them to work.
13509  But if you want to define custom counters, then you can do so, using the
13510  following parameters:
13511 \end_layout
13512
13513 \begin_layout Description
13514 \begin_inset Flex CharStyle:Code
13515 status collapsed
13516
13517 \begin_layout Plain Layout
13518 LabelString [string=""]
13519 \end_layout
13520
13521 \end_inset
13522
13523  when this is defined, this string defines how the counter is displayed.
13524  Setting this value sets 
13525 \begin_inset Flex CharStyle:Code
13526 status collapsed
13527
13528 \begin_layout Plain Layout
13529 LabelStringAppendix
13530 \end_layout
13531
13532 \end_inset
13533
13534  to the same value.
13535  The following special constructs can be used in the string:
13536 \end_layout
13537
13538 \begin_deeper
13539 \begin_layout Itemize
13540 \begin_inset Flex CharStyle:Code
13541 status collapsed
13542
13543 \begin_layout Plain Layout
13544
13545 \backslash
13546 thecounter
13547 \end_layout
13548
13549 \end_inset
13550
13551  will be replaced by the expansion of the 
13552 \begin_inset Flex CharStyle:Code
13553 status collapsed
13554
13555 \begin_layout Plain Layout
13556 LabelString
13557 \end_layout
13558
13559 \end_inset
13560
13561  (or 
13562 \begin_inset Flex CharStyle:Code
13563 status collapsed
13564
13565 \begin_layout Plain Layout
13566 LabelStringAppendix
13567 \end_layout
13568
13569 \end_inset
13570
13571 ) of the counter 
13572 \begin_inset Flex CharStyle:Code
13573 status collapsed
13574
13575 \begin_layout Plain Layout
13576 counter
13577 \end_layout
13578
13579 \end_inset
13580
13581 .
13582  
13583 \end_layout
13584
13585 \begin_layout Itemize
13586 counter values can be expressed using LaTeX-like macros 
13587 \begin_inset Flex CharStyle:Code
13588 status collapsed
13589
13590 \begin_layout Plain Layout
13591
13592 \backslash
13593
13594 \emph on
13595 numbertype
13596 \emph default
13597 {
13598 \emph on
13599 counter
13600 \emph default
13601 }
13602 \end_layout
13603
13604 \end_inset
13605
13606 , where 
13607 \begin_inset Flex CharStyle:Code
13608 status collapsed
13609
13610 \begin_layout Plain Layout
13611
13612 \emph on
13613 numbertype
13614 \end_layout
13615
13616 \end_inset
13617
13618  can be:
13619 \begin_inset Foot
13620 status collapsed
13621
13622 \begin_layout Plain Layout
13623
13624 \family roman
13625 \series medium
13626 \shape up
13627 \size normal
13628 \emph off
13629 \bar no
13630 \noun off
13631 \color none
13632 Actually, the situation is a bit more complicated: any
13633 \family default
13634 \series default
13635 \shape default
13636 \emph default
13637 \bar default
13638  
13639 \size default
13640 \emph on
13641 \noun default
13642 \color inherit
13643 numbertype
13644 \family roman
13645 \series medium
13646 \shape up
13647 \size normal
13648 \emph off
13649 \bar no
13650 \noun off
13651  other than those descibed below will produce arabic numerals.
13652  It would not be surprising to see this change in the future.
13653 \end_layout
13654
13655 \end_inset
13656
13657  
13658 \begin_inset Flex CharStyle:Code
13659 status collapsed
13660
13661 \begin_layout Plain Layout
13662 arabic
13663 \end_layout
13664
13665 \end_inset
13666
13667 : 1, 2, 3,\SpecialChar \ldots{}
13668
13669 \begin_inset Flex CharStyle:Code
13670 status collapsed
13671
13672 \begin_layout Plain Layout
13673 alph
13674 \end_layout
13675
13676 \end_inset
13677
13678  for lower-case letters: a, b, c, \SpecialChar \ldots{}
13679
13680 \begin_inset Flex CharStyle:Code
13681 status collapsed
13682
13683 \begin_layout Plain Layout
13684 Alph
13685 \end_layout
13686
13687 \end_inset
13688
13689  for upper-case letters: A, B, C, \SpecialChar \ldots{}
13690
13691 \begin_inset Flex CharStyle:Code
13692 status collapsed
13693
13694 \begin_layout Plain Layout
13695 roman
13696 \end_layout
13697
13698 \end_inset
13699
13700  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13701
13702 \begin_inset Flex CharStyle:Code
13703 status collapsed
13704
13705 \begin_layout Plain Layout
13706 Roman
13707 \end_layout
13708
13709 \end_inset
13710
13711  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13712
13713 \begin_inset Flex CharStyle:Code
13714 status collapsed
13715
13716 \begin_layout Plain Layout
13717 hebrew
13718 \end_layout
13719
13720 \end_inset
13721
13722  for hebrew numerals.
13723 \end_layout
13724
13725 \end_deeper
13726 \begin_layout Standard
13727 If LabelString is not defined, a default value is constructed as follows:
13728  if the counter has a master counter 
13729 \begin_inset Flex CharStyle:Code
13730 status collapsed
13731
13732 \begin_layout Plain Layout
13733 master
13734 \end_layout
13735
13736 \end_inset
13737
13738  (defined via 
13739 \begin_inset Flex CharStyle:Code
13740 status collapsed
13741
13742 \begin_layout Plain Layout
13743 Within
13744 \end_layout
13745
13746 \end_inset
13747
13748 ), the string 
13749 \begin_inset Flex CharStyle:Code
13750 status collapsed
13751
13752 \begin_layout Plain Layout
13753
13754 \backslash
13755 themaster.
13756 \backslash
13757 arabic{counter}
13758 \end_layout
13759
13760 \end_inset
13761
13762  is used; otherwise the string 
13763 \begin_inset Flex CharStyle:Code
13764 status collapsed
13765
13766 \begin_layout Plain Layout
13767
13768 \backslash
13769 arabic{counter}
13770 \end_layout
13771
13772 \end_inset
13773
13774  is used.
13775 \end_layout
13776
13777 \begin_layout Description
13778 \begin_inset Flex CharStyle:Code
13779 status collapsed
13780
13781 \begin_layout Plain Layout
13782 LabelStringAppendix [string=""]
13783 \end_layout
13784
13785 \end_inset
13786
13787  Same as 
13788 \begin_inset Flex CharStyle:Code
13789 status collapsed
13790
13791 \begin_layout Plain Layout
13792 LabelString
13793 \end_layout
13794
13795 \end_inset
13796
13797 .
13798 \end_layout
13799
13800 \begin_layout Description
13801 \begin_inset Flex CharStyle:Code
13802 status collapsed
13803
13804 \begin_layout Plain Layout
13805 Name
13806 \end_layout
13807
13808 \end_inset
13809
13810  [
13811 \begin_inset Flex CharStyle:Code
13812 status collapsed
13813
13814 \begin_layout Plain Layout
13815 string
13816 \end_layout
13817
13818 \end_inset
13819
13820 =
13821 \begin_inset Quotes erd
13822 \end_inset
13823
13824
13825 \begin_inset Quotes erd
13826 \end_inset
13827
13828 ] The name of the counter.
13829 \end_layout
13830
13831 \begin_layout Description
13832 \begin_inset Flex CharStyle:Code
13833 status collapsed
13834
13835 \begin_layout Plain Layout
13836 Within
13837 \end_layout
13838
13839 \end_inset
13840
13841  [
13842 \begin_inset Flex CharStyle:Code
13843 status collapsed
13844
13845 \begin_layout Plain Layout
13846 string
13847 \end_layout
13848
13849 \end_inset
13850
13851 =
13852 \begin_inset Quotes erd
13853 \end_inset
13854
13855
13856 \begin_inset Quotes erd
13857 \end_inset
13858
13859 ] If this is set to the name of another counter, the present counter will
13860  be reset everytime the other one is increased.
13861  For example, 
13862 \begin_inset Flex CharStyle:Code
13863 status collapsed
13864
13865 \begin_layout Plain Layout
13866 subsection
13867 \end_layout
13868
13869 \end_inset
13870
13871  is numbered inside 
13872 \begin_inset Flex CharStyle:Code
13873 status collapsed
13874
13875 \begin_layout Plain Layout
13876 section
13877 \end_layout
13878
13879 \end_inset
13880
13881 .
13882 \end_layout
13883
13884 \begin_layout Subsection
13885 Font description
13886 \end_layout
13887
13888 \begin_layout Standard
13889 \begin_inset CommandInset label
13890 LatexCommand label
13891 name "sec:fonts"
13892
13893 \end_inset
13894
13895 A font description looks like this:
13896 \end_layout
13897
13898 \begin_layout LyX-Code
13899 Font 
13900 \family roman
13901 \emph on
13902 or
13903 \family default
13904 \emph default
13905  LabelFont
13906 \end_layout
13907
13908 \begin_layout LyX-Code
13909  ...
13910 \end_layout
13911
13912 \begin_layout LyX-Code
13913 EndFont
13914 \end_layout
13915
13916 \begin_layout Standard
13917 The following commands are available:
13918 \end_layout
13919
13920 \begin_layout Description
13921 \begin_inset Flex CharStyle:Code
13922 status collapsed
13923
13924 \begin_layout Plain Layout
13925 Color
13926 \end_layout
13927
13928 \end_inset
13929
13930  [
13931 \begin_inset Flex CharStyle:Code
13932 status collapsed
13933
13934 \begin_layout Plain Layout
13935
13936 \emph on
13937 none
13938 \end_layout
13939
13940 \end_inset
13941
13942
13943 \begin_inset Flex CharStyle:Code
13944 status collapsed
13945
13946 \begin_layout Plain Layout
13947 black
13948 \end_layout
13949
13950 \end_inset
13951
13952
13953 \begin_inset Flex CharStyle:Code
13954 status collapsed
13955
13956 \begin_layout Plain Layout
13957 white
13958 \end_layout
13959
13960 \end_inset
13961
13962
13963 \begin_inset Flex CharStyle:Code
13964 status collapsed
13965
13966 \begin_layout Plain Layout
13967 red
13968 \end_layout
13969
13970 \end_inset
13971
13972
13973 \begin_inset Flex CharStyle:Code
13974 status collapsed
13975
13976 \begin_layout Plain Layout
13977 green
13978 \end_layout
13979
13980 \end_inset
13981
13982
13983 \begin_inset Flex CharStyle:Code
13984 status collapsed
13985
13986 \begin_layout Plain Layout
13987 blue
13988 \end_layout
13989
13990 \end_inset
13991
13992
13993 \begin_inset Flex CharStyle:Code
13994 status collapsed
13995
13996 \begin_layout Plain Layout
13997 cyan
13998 \end_layout
13999
14000 \end_inset
14001
14002
14003 \begin_inset Flex CharStyle:Code
14004 status collapsed
14005
14006 \begin_layout Plain Layout
14007 magenta
14008 \end_layout
14009
14010 \end_inset
14011
14012
14013 \begin_inset Flex CharStyle:Code
14014 status collapsed
14015
14016 \begin_layout Plain Layout
14017 yellow
14018 \end_layout
14019
14020 \end_inset
14021
14022 ]
14023 \end_layout
14024
14025 \begin_layout Description
14026 \begin_inset Flex CharStyle:Code
14027 status collapsed
14028
14029 \begin_layout Plain Layout
14030 Family
14031 \end_layout
14032
14033 \end_inset
14034
14035  [
14036 \emph on
14037
14038 \begin_inset Flex CharStyle:Code
14039 status collapsed
14040
14041 \begin_layout Plain Layout
14042
14043 \emph on
14044 Roman
14045 \end_layout
14046
14047 \end_inset
14048
14049
14050 \emph default
14051
14052 \begin_inset Flex CharStyle:Code
14053 status collapsed
14054
14055 \begin_layout Plain Layout
14056 Sans
14057 \end_layout
14058
14059 \end_inset
14060
14061
14062 \begin_inset Flex CharStyle:Code
14063 status collapsed
14064
14065 \begin_layout Plain Layout
14066 Typewriter
14067 \end_layout
14068
14069 \end_inset
14070
14071
14072 \end_layout
14073
14074 \begin_layout Description
14075 \begin_inset Flex CharStyle:Code
14076 status collapsed
14077
14078 \begin_layout Plain Layout
14079 Misc
14080 \end_layout
14081
14082 \end_inset
14083
14084  [
14085 \begin_inset Flex CharStyle:Code
14086 status collapsed
14087
14088 \begin_layout Plain Layout
14089 string
14090 \end_layout
14091
14092 \end_inset
14093
14094 ] Valid argument sare: 
14095 \begin_inset Flex CharStyle:Code
14096 status collapsed
14097
14098 \begin_layout Plain Layout
14099 emph
14100 \end_layout
14101
14102 \end_inset
14103
14104
14105 \begin_inset Flex CharStyle:Code
14106 status collapsed
14107
14108 \begin_layout Plain Layout
14109 noun
14110 \end_layout
14111
14112 \end_inset
14113
14114
14115 \begin_inset Flex CharStyle:Code
14116 status collapsed
14117
14118 \begin_layout Plain Layout
14119 underbar
14120 \end_layout
14121
14122 \end_inset
14123
14124
14125 \begin_inset Flex CharStyle:Code
14126 status collapsed
14127
14128 \begin_layout Plain Layout
14129 no_emph
14130 \end_layout
14131
14132 \end_inset
14133
14134
14135 \begin_inset Flex CharStyle:Code
14136 status collapsed
14137
14138 \begin_layout Plain Layout
14139 no_noun
14140 \end_layout
14141
14142 \end_inset
14143
14144  and 
14145 \begin_inset Flex CharStyle:Code
14146 status collapsed
14147
14148 \begin_layout Plain Layout
14149 no_bar
14150 \end_layout
14151
14152 \end_inset
14153
14154 .
14155  Each of these turns on or off the corresponding attribute.
14156 \end_layout
14157
14158 \begin_layout Description
14159 \begin_inset Flex CharStyle:Code
14160 status collapsed
14161
14162 \begin_layout Plain Layout
14163 Series
14164 \end_layout
14165
14166 \end_inset
14167
14168  [
14169 \emph on
14170
14171 \begin_inset Flex CharStyle:Code
14172 status collapsed
14173
14174 \begin_layout Plain Layout
14175
14176 \emph on
14177 Medium
14178 \end_layout
14179
14180 \end_inset
14181
14182
14183 \emph default
14184
14185 \begin_inset Flex CharStyle:Code
14186 status collapsed
14187
14188 \begin_layout Plain Layout
14189 Bold
14190 \end_layout
14191
14192 \end_inset
14193
14194
14195 \end_layout
14196
14197 \begin_layout Description
14198 \begin_inset Flex CharStyle:Code
14199 status collapsed
14200
14201 \begin_layout Plain Layout
14202 Shape
14203 \end_layout
14204
14205 \end_inset
14206
14207  [
14208 \emph on
14209
14210 \begin_inset Flex CharStyle:Code
14211 status collapsed
14212
14213 \begin_layout Plain Layout
14214
14215 \emph on
14216 Up
14217 \end_layout
14218
14219 \end_inset
14220
14221
14222 \emph default
14223
14224 \begin_inset Flex CharStyle:Code
14225 status collapsed
14226
14227 \begin_layout Plain Layout
14228 Italic
14229 \end_layout
14230
14231 \end_inset
14232
14233
14234 \begin_inset Flex CharStyle:Code
14235 status collapsed
14236
14237 \begin_layout Plain Layout
14238 SmallCaps
14239 \end_layout
14240
14241 \end_inset
14242
14243
14244 \begin_inset Flex CharStyle:Code
14245 status collapsed
14246
14247 \begin_layout Plain Layout
14248 Slanted
14249 \end_layout
14250
14251 \end_inset
14252
14253
14254 \end_layout
14255
14256 \begin_layout Description
14257 \begin_inset Flex CharStyle:Code
14258 status collapsed
14259
14260 \begin_layout Plain Layout
14261 Size
14262 \end_layout
14263
14264 \end_inset
14265
14266  [
14267 \begin_inset Flex CharStyle:Code
14268 status collapsed
14269
14270 \begin_layout Plain Layout
14271 tiny
14272 \end_layout
14273
14274 \end_inset
14275
14276
14277 \begin_inset Flex CharStyle:Code
14278 status collapsed
14279
14280 \begin_layout Plain Layout
14281 small
14282 \end_layout
14283
14284 \end_inset
14285
14286
14287 \begin_inset Flex CharStyle:Code
14288 status collapsed
14289
14290 \begin_layout Plain Layout
14291
14292 \emph on
14293 normal
14294 \end_layout
14295
14296 \end_inset
14297
14298
14299 \begin_inset Flex CharStyle:Code
14300 status collapsed
14301
14302 \begin_layout Plain Layout
14303 large
14304 \end_layout
14305
14306 \end_inset
14307
14308
14309 \begin_inset Flex CharStyle:Code
14310 status collapsed
14311
14312 \begin_layout Plain Layout
14313 larger
14314 \end_layout
14315
14316 \end_inset
14317
14318
14319 \begin_inset Flex CharStyle:Code
14320 status collapsed
14321
14322 \begin_layout Plain Layout
14323 largest
14324 \end_layout
14325
14326 \end_inset
14327
14328
14329 \begin_inset Flex CharStyle:Code
14330 status collapsed
14331
14332 \begin_layout Plain Layout
14333 huge
14334 \end_layout
14335
14336 \end_inset
14337
14338
14339 \begin_inset Flex CharStyle:Code
14340 status collapsed
14341
14342 \begin_layout Plain Layout
14343 giant
14344 \end_layout
14345
14346 \end_inset
14347
14348 ]
14349 \end_layout
14350
14351 \begin_layout Subsection
14352 Upgrading old layout files
14353 \end_layout
14354
14355 \begin_layout Standard
14356 The file format of layout files changes from time to time, so old layout
14357  files need to be converted.
14358  This process has been automated since LyX 1.4.0: If LyX reads an old format
14359  layout file it will call the conversion tool 
14360 \begin_inset Flex CharStyle:Code
14361 status collapsed
14362
14363 \begin_layout Plain Layout
14364 LyXDir/scripts/layout2layout.py
14365 \end_layout
14366
14367 \end_inset
14368
14369  and convert it to a temporary file in current format.
14370  The original file is left untouched.
14371  If you want to convert the layout file permanently, just call the converter
14372  by hand:
14373 \end_layout
14374
14375 \begin_layout LyX-Code
14376 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14377 \end_layout
14378
14379 \begin_layout Standard
14380 (You need to replace 
14381 \begin_inset Flex CharStyle:Code
14382 status collapsed
14383
14384 \begin_layout Plain Layout
14385 $LyXDir
14386 \end_layout
14387
14388 \end_inset
14389
14390  with the name of your LyX system directory, unless you happen to have defined
14391  such an environment variable.) Then copy 
14392 \begin_inset Flex CharStyle:Code
14393 status collapsed
14394
14395 \begin_layout Plain Layout
14396 myclassnew.layout
14397 \end_layout
14398
14399 \end_inset
14400
14401  to 
14402 \begin_inset Flex CharStyle:Code
14403 status collapsed
14404
14405 \begin_layout Plain Layout
14406 UserDir/layouts/
14407 \end_layout
14408
14409 \end_inset
14410
14411 .
14412 \end_layout
14413
14414 \begin_layout Standard
14415 The automatic conversion only handles syntax changes.
14416  It cannot handle the case where the contents of included files was changed,
14417  so these will have to be converted separately.
14418 \end_layout
14419
14420 \begin_layout Section
14421 Creating Templates
14422 \begin_inset CommandInset label
14423 LatexCommand label
14424 name "sec:templates"
14425
14426 \end_inset
14427
14428
14429 \end_layout
14430
14431 \begin_layout Standard
14432 Templates are created just like usual documents.
14433  The only difference is that usual documents contain all possible settings,
14434  including the font scheme and the paper size.
14435  Usually a user doesn't want a template to overwrite his defaults in these
14436  cases.
14437  For that reason, the designer of a template should remove the corresponding
14438  commands like 
14439 \begin_inset Flex CharStyle:Code
14440 status collapsed
14441
14442 \begin_layout Plain Layout
14443
14444 \backslash
14445 fontscheme
14446 \end_layout
14447
14448 \end_inset
14449
14450  or 
14451 \begin_inset Flex CharStyle:Code
14452 status collapsed
14453
14454 \begin_layout Plain Layout
14455
14456 \backslash
14457 papersize
14458 \end_layout
14459
14460 \end_inset
14461
14462  from the template LyX file.
14463  This can be done with any simple text-editor, for example 
14464 \begin_inset Flex CharStyle:Code
14465 status collapsed
14466
14467 \begin_layout Plain Layout
14468 vi
14469 \end_layout
14470
14471 \end_inset
14472
14473  or 
14474 \begin_inset Flex CharStyle:Code
14475 status collapsed
14476
14477 \begin_layout Plain Layout
14478 xedit
14479 \end_layout
14480
14481 \end_inset
14482
14483 .
14484  
14485 \end_layout
14486
14487 \begin_layout Standard
14488 Put the edited template files you create in 
14489 \begin_inset Flex CharStyle:Code
14490 status collapsed
14491
14492 \begin_layout Plain Layout
14493 UserDir/templates/
14494 \end_layout
14495
14496 \end_inset
14497
14498 , copy the ones you use from the global template directory in 
14499 \begin_inset Flex CharStyle:Code
14500 status collapsed
14501
14502 \begin_layout Plain Layout
14503 LyXDir/templates/
14504 \end_layout
14505
14506 \end_inset
14507
14508  to the same place, and redefine the template path in the 
14509 \begin_inset Flex CharStyle:MenuItem
14510 status collapsed
14511
14512 \begin_layout Plain Layout
14513
14514 \bar under
14515 T
14516 \family sans
14517 \bar default
14518 ools
14519 \family default
14520 \SpecialChar \menuseparator
14521
14522 \bar under
14523 P
14524 \bar default
14525 references\SpecialChar \menuseparator
14526 Paths
14527 \end_layout
14528
14529 \end_inset
14530
14531  dialog.
14532 \end_layout
14533
14534 \begin_layout Standard
14535 Note that there is a template which has a particular meaning: 
14536 \begin_inset Flex CharStyle:Code
14537 status collapsed
14538
14539 \begin_layout Plain Layout
14540 defaults.lyx
14541 \end_layout
14542
14543 \end_inset
14544
14545 .
14546  This template is loaded everytime you create a new document with 
14547 \begin_inset Flex CharStyle:MenuItem
14548 status collapsed
14549
14550 \begin_layout Plain Layout
14551
14552 \bar under
14553 F
14554 \bar default
14555 ile
14556 \end_layout
14557
14558 \end_inset
14559
14560 \SpecialChar \menuseparator
14561
14562 \begin_inset Flex CharStyle:MenuItem
14563 status collapsed
14564
14565 \begin_layout Plain Layout
14566
14567 \bar under
14568 N
14569 \bar default
14570 ew
14571 \end_layout
14572
14573 \end_inset
14574
14575  in order to provide useful defaults.
14576  To create this template from inside LyX, all you have to do is to open
14577  a document with the correct settings, and use the 
14578 \begin_inset Flex CharStyle:MenuItem
14579 status collapsed
14580
14581 \begin_layout Plain Layout
14582 Sa
14583 \bar under
14584 v
14585 \bar default
14586 e as Document Defaults
14587 \end_layout
14588
14589 \end_inset
14590
14591  button.
14592 \end_layout
14593
14594 \begin_layout Chapter
14595 Including External Material
14596 \end_layout
14597
14598 \begin_layout Standard
14599 The use of material from sources external to LyX is covered in detail in
14600  the 
14601 \emph on
14602 Embedded Objects
14603 \emph default
14604  manual.
14605  This part of the manual covers what needs to happen behind the scenes for
14606  new sorts of material to be included.
14607 \end_layout
14608
14609 \begin_layout Section
14610 How does it work?
14611 \end_layout
14612
14613 \begin_layout Standard
14614 The external material feature is based on the concept of a 
14615 \emph on
14616 template
14617 \emph default
14618 .
14619  A template is a specification of how LyX should interface with a certain
14620  kind of material.
14621  As bundled, LyX comes with predefined templates for Xfig figures, various
14622  raster format images, chess diagrams, and LilyPond music notation.
14623  You can check the actual list by using the menu 
14624 \begin_inset Flex CharStyle:MenuItem
14625 status collapsed
14626
14627 \begin_layout Plain Layout
14628 Insert\SpecialChar \menuseparator
14629 File\SpecialChar \menuseparator
14630 External Material
14631 \end_layout
14632
14633 \end_inset
14634
14635 .
14636  Furthermore, it is possible to roll your own template to support a specific
14637  kind of material.
14638  Later we'll describe in more detail what is involved, and hopefully you
14639  will submit all the templates you create so we can include them in a later
14640  LyX version.
14641 \end_layout
14642
14643 \begin_layout Standard
14644 Another basic idea of the external material feature is to distinguish between
14645  the original file that serves as a base for final material and the produced
14646  file that is included in your exported or printed document.
14647  For example, consider the case of a figure produced with 
14648 \begin_inset Flex CharStyle:Code
14649 status collapsed
14650
14651 \begin_layout Plain Layout
14652 Xfig
14653 \end_layout
14654
14655 \end_inset
14656
14657 .
14658  The Xfig application itself works on an original file with the 
14659 \begin_inset Flex CharStyle:Code
14660 status collapsed
14661
14662 \begin_layout Plain Layout
14663 .fig
14664 \end_layout
14665
14666 \end_inset
14667
14668  extension.
14669  Within XFig, you create and change your figure, and when you are done,
14670  you save the 
14671 \begin_inset Flex CharStyle:Code
14672 status collapsed
14673
14674 \begin_layout Plain Layout
14675 fig
14676 \end_layout
14677
14678 \end_inset
14679
14680 -file.
14681  When you want to include the figure in your document, you invoke 
14682 \begin_inset Flex CharStyle:Code
14683 status collapsed
14684
14685 \begin_layout Plain Layout
14686 transfig
14687 \end_layout
14688
14689 \end_inset
14690
14691  in order to create a PostScript file that can readily be included in your
14692  LaTeX file.
14693  In this case, the 
14694 \begin_inset Flex CharStyle:Code
14695 status collapsed
14696
14697 \begin_layout Plain Layout
14698 .fig
14699 \end_layout
14700
14701 \end_inset
14702
14703  file is the original file, and the PostScript file is the produced file.
14704 \end_layout
14705
14706 \begin_layout Standard
14707 This distinction is important in order to allow updating of the material
14708  while you are in the process of writing the document.
14709  Furthermore, it provides us with the flexibility that is needed to support
14710  multiple export formats.
14711  For instance, in the case of a plain text file, it is not exactly an award-winn
14712 ing idea to include the figure as raw PostScript®.
14713  Instead, you'd either prefer to just include a reference to the figure
14714  or try to invoke some graphics to Ascii converter to make the final result
14715  look similar to the real graphics.
14716  The external material management allows you to do this, because it is parameter
14717 ized on the different export formats that LyX supports.
14718 \end_layout
14719
14720 \begin_layout Standard
14721 Besides supporting the production of different products according to the
14722  exported format, it supports tight integration with editing and viewing
14723  applications.
14724  In the case of an XFig figure, you are able to invoke Xfig on the original
14725  file with a single click from within the external material dialog in LyX,
14726  and also preview the produced PostScript file with ghostview with another
14727  click.
14728  No more fiddling around with the command line and/or file browsers to locate
14729  and manipulate the original or produced files.
14730  In this way, you are finally able to take full advantage of the many different
14731  applications that are relevant to use when you write your documents, and
14732  ultimately be more productive.
14733 \end_layout
14734
14735 \begin_layout Section
14736 The external template configuration file
14737 \end_layout
14738
14739 \begin_layout Standard
14740 It is relatively easy to add custom external template definitions to LyX.
14741  However, be aware that doing this in an careless manner most probably 
14742 \emph on
14743 will
14744 \emph default
14745  introduce an easily exploitable security hole.
14746  So before you do this, please read the discussion about security in section
14747  
14748 \begin_inset CommandInset ref
14749 LatexCommand ref
14750 reference "sec:Security-discussion"
14751
14752 \end_inset
14753
14754 .
14755 \end_layout
14756
14757 \begin_layout Standard
14758 Having said that, we encourage you to submit any interesting templates that
14759  you create.
14760  
14761 \end_layout
14762
14763 \begin_layout Standard
14764 The external templates are defined in the 
14765 \begin_inset Flex CharStyle:Code
14766 status collapsed
14767
14768 \begin_layout Plain Layout
14769 LyXDir/lib/external_templates
14770 \end_layout
14771
14772 \end_inset
14773
14774  file.
14775  You can place your own version in 
14776 \begin_inset Flex CharStyle:Code
14777 status collapsed
14778
14779 \begin_layout Plain Layout
14780 UserDir/external_templates
14781 \end_layout
14782
14783 \end_inset
14784
14785 .
14786 \end_layout
14787
14788 \begin_layout Standard
14789 A typical template looks like this:
14790 \end_layout
14791
14792 \begin_layout LyX-Code
14793 Template XFig
14794 \end_layout
14795
14796 \begin_layout LyX-Code
14797 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14798 \end_layout
14799
14800 \begin_layout LyX-Code
14801 HelpText
14802 \end_layout
14803
14804 \begin_layout LyX-Code
14805 An XFig figure.
14806 \end_layout
14807
14808 \begin_layout LyX-Code
14809 HelpTextEnd
14810 \end_layout
14811
14812 \begin_layout LyX-Code
14813 InputFormat fig
14814 \end_layout
14815
14816 \begin_layout LyX-Code
14817 FileFilter "*.fig"
14818 \end_layout
14819
14820 \begin_layout LyX-Code
14821 AutomaticProduction true
14822 \end_layout
14823
14824 \begin_layout LyX-Code
14825 Transform Rotate
14826 \end_layout
14827
14828 \begin_layout LyX-Code
14829 Transform Resize
14830 \end_layout
14831
14832 \begin_layout LyX-Code
14833 Format LaTeX
14834 \end_layout
14835
14836 \begin_layout LyX-Code
14837 TransformCommand Rotate RotationLatexCommand
14838 \end_layout
14839
14840 \begin_layout LyX-Code
14841 TransformCommand Resize ResizeLatexCommand
14842 \end_layout
14843
14844 \begin_layout LyX-Code
14845 Product "$$RotateFront$$ResizeFront
14846 \end_layout
14847
14848 \begin_layout LyX-Code
14849          
14850 \backslash
14851
14852 \backslash
14853 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14854 \end_layout
14855
14856 \begin_layout LyX-Code
14857          $$ResizeBack$$RotateBack"
14858 \end_layout
14859
14860 \begin_layout LyX-Code
14861 UpdateFormat pstex
14862 \end_layout
14863
14864 \begin_layout LyX-Code
14865 UpdateResult "$$AbsPath$$Basename.pstex_t"
14866 \end_layout
14867
14868 \begin_layout LyX-Code
14869 Requirement "graphicx"
14870 \end_layout
14871
14872 \begin_layout LyX-Code
14873 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14874 \end_layout
14875
14876 \begin_layout LyX-Code
14877 ReferencedFile latex "$$AbsPath$$Basename.eps"
14878 \end_layout
14879
14880 \begin_layout LyX-Code
14881 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14882 \end_layout
14883
14884 \begin_layout LyX-Code
14885 FormatEnd
14886 \end_layout
14887
14888 \begin_layout LyX-Code
14889 Format PDFLaTeX
14890 \end_layout
14891
14892 \begin_layout LyX-Code
14893 TransformCommand Rotate RotationLatexCommand
14894 \end_layout
14895
14896 \begin_layout LyX-Code
14897 TransformCommand Resize ResizeLatexCommand
14898 \end_layout
14899
14900 \begin_layout LyX-Code
14901 Product "$$RotateFront$$ResizeFront
14902 \end_layout
14903
14904 \begin_layout LyX-Code
14905          
14906 \backslash
14907
14908 \backslash
14909 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14910 \end_layout
14911
14912 \begin_layout LyX-Code
14913          $$ResizeBack$$RotateBack"
14914 \end_layout
14915
14916 \begin_layout LyX-Code
14917 UpdateFormat pdftex
14918 \end_layout
14919
14920 \begin_layout LyX-Code
14921 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14922 \end_layout
14923
14924 \begin_layout LyX-Code
14925 Requirement "graphicx"
14926 \end_layout
14927
14928 \begin_layout LyX-Code
14929 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14930 \end_layout
14931
14932 \begin_layout LyX-Code
14933 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14934 \end_layout
14935
14936 \begin_layout LyX-Code
14937 FormatEnd
14938 \end_layout
14939
14940 \begin_layout LyX-Code
14941 Format Ascii
14942 \end_layout
14943
14944 \begin_layout LyX-Code
14945 Product "$$Contents(
14946 \backslash
14947 "$$AbsPath$$Basename.asc
14948 \backslash
14949 ")"
14950 \end_layout
14951
14952 \begin_layout LyX-Code
14953 UpdateFormat asciixfig
14954 \end_layout
14955
14956 \begin_layout LyX-Code
14957 UpdateResult "$$AbsPath$$Basename.asc"
14958 \end_layout
14959
14960 \begin_layout LyX-Code
14961 FormatEnd
14962 \end_layout
14963
14964 \begin_layout LyX-Code
14965 Format DocBook
14966 \end_layout
14967
14968 \begin_layout LyX-Code
14969 Product "<graphic fileref=
14970 \backslash
14971 "$$AbsOrRelPathMaster$$Basename.eps
14972 \backslash
14973 ">
14974 \end_layout
14975
14976 \begin_layout LyX-Code
14977          </graphic>"
14978 \end_layout
14979
14980 \begin_layout LyX-Code
14981 UpdateFormat eps
14982 \end_layout
14983
14984 \begin_layout LyX-Code
14985 UpdateResult "$$AbsPath$$Basename.eps"
14986 \end_layout
14987
14988 \begin_layout LyX-Code
14989 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14990 \end_layout
14991
14992 \begin_layout LyX-Code
14993 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14994 \end_layout
14995
14996 \begin_layout LyX-Code
14997 FormatEnd
14998 \end_layout
14999
15000 \begin_layout LyX-Code
15001 Product "[XFig: $$FName]"
15002 \end_layout
15003
15004 \begin_layout LyX-Code
15005 FormatEnd
15006 \end_layout
15007
15008 \begin_layout LyX-Code
15009 TemplateEnd
15010 \end_layout
15011
15012 \begin_layout Standard
15013 As you can see, the template is enclosed in 
15014 \begin_inset Flex CharStyle:Code
15015 status collapsed
15016
15017 \begin_layout Plain Layout
15018 Template
15019 \end_layout
15020
15021 \end_inset
15022
15023  \SpecialChar \ldots{}
15024  
15025 \begin_inset Flex CharStyle:Code
15026 status collapsed
15027
15028 \begin_layout Plain Layout
15029 TemplateEnd
15030 \end_layout
15031
15032 \end_inset
15033
15034 .
15035  It contains a header specifying some general settings and, for each supported
15036  primary document file format, a section 
15037 \begin_inset Flex CharStyle:Code
15038 status collapsed
15039
15040 \begin_layout Plain Layout
15041 Format
15042 \end_layout
15043
15044 \end_inset
15045
15046  \SpecialChar \ldots{}
15047  
15048 \begin_inset Flex CharStyle:Code
15049 status collapsed
15050
15051 \begin_layout Plain Layout
15052 FormatEnd
15053 \end_layout
15054
15055 \end_inset
15056
15057 .
15058 \end_layout
15059
15060 \begin_layout Subsection
15061 The template header
15062 \end_layout
15063
15064 \begin_layout Description
15065 \begin_inset Flex CharStyle:Code
15066 status collapsed
15067
15068 \begin_layout Plain Layout
15069 AutomaticProduction
15070 \begin_inset space ~
15071 \end_inset
15072
15073 true|false
15074 \end_layout
15075
15076 \end_inset
15077
15078  Whether the file represented by the template must be generated by LyX.
15079  This command must occur exactly once.
15080 \end_layout
15081
15082 \begin_layout Description
15083 \begin_inset Flex CharStyle:Code
15084 status collapsed
15085
15086 \begin_layout Plain Layout
15087 FileFilter
15088 \begin_inset space ~
15089 \end_inset
15090
15091 <pattern>
15092 \end_layout
15093
15094 \end_inset
15095
15096  A glob pattern that is used in the file dialog to filter out the desired
15097  files.
15098  If there is more than one possible file extension (e.g.
15099 \begin_inset space ~
15100 \end_inset
15101
15102 tgif has 
15103 \begin_inset Flex CharStyle:Code
15104 status collapsed
15105
15106 \begin_layout Plain Layout
15107 .obj
15108 \end_layout
15109
15110 \end_inset
15111
15112  and 
15113 \begin_inset Flex CharStyle:Code
15114 status collapsed
15115
15116 \begin_layout Plain Layout
15117 .tgo
15118 \end_layout
15119
15120 \end_inset
15121
15122 ), use something like 
15123 \begin_inset Flex CharStyle:Code
15124 status collapsed
15125
15126 \begin_layout Plain Layout
15127 "*.{obj,tgo}"
15128 \end_layout
15129
15130 \end_inset
15131
15132 .
15133  This command must occur exactly once.
15134 \end_layout
15135
15136 \begin_layout Description
15137 \begin_inset Flex CharStyle:Code
15138 status collapsed
15139
15140 \begin_layout Plain Layout
15141 GuiName
15142 \begin_inset space ~
15143 \end_inset
15144
15145 <guiname>
15146 \end_layout
15147
15148 \end_inset
15149
15150  The text that is displayed on the button.
15151  This command must occur exactly once.
15152 \end_layout
15153
15154 \begin_layout Description
15155 \begin_inset Flex CharStyle:Code
15156 status collapsed
15157
15158 \begin_layout Plain Layout
15159 HelpText
15160 \begin_inset space ~
15161 \end_inset
15162
15163 <text>
15164 \begin_inset space ~
15165 \end_inset
15166
15167 HelpTextEnd
15168 \end_layout
15169
15170 \end_inset
15171
15172  The help text that is used in the External dialog.
15173  Provide enough information to explain to the user just what the template
15174  can provide him with.
15175  This command must occur exactly once.
15176 \end_layout
15177
15178 \begin_layout Description
15179 \begin_inset Flex CharStyle:Code
15180 status collapsed
15181
15182 \begin_layout Plain Layout
15183 InputFormat
15184 \begin_inset space ~
15185 \end_inset
15186
15187 <format>
15188 \end_layout
15189
15190 \end_inset
15191
15192  The file format of the original file.
15193  This must be the name of a format that is known to LyX (see section 
15194 \begin_inset CommandInset ref
15195 LatexCommand ref
15196 reference "sub:Formats"
15197
15198 \end_inset
15199
15200 ).
15201  Use 
15202 \begin_inset Quotes eld
15203 \end_inset
15204
15205
15206 \begin_inset Flex CharStyle:Code
15207 status collapsed
15208
15209 \begin_layout Plain Layout
15210 *
15211 \end_layout
15212
15213 \end_inset
15214
15215
15216 \begin_inset Quotes erd
15217 \end_inset
15218
15219  if the template can handle original files of more than one format.
15220  LyX will attempt to interrogate the file itself in order to deduce its
15221  format in this case.
15222  This command must occur exactly once.
15223 \end_layout
15224
15225 \begin_layout Description
15226 \begin_inset Flex CharStyle:Code
15227 status collapsed
15228
15229 \begin_layout Plain Layout
15230 Template
15231 \begin_inset space ~
15232 \end_inset
15233
15234 <id>
15235 \end_layout
15236
15237 \end_inset
15238
15239  A unique name for the template.
15240  It must not contain substitution macros (see below).
15241 \end_layout
15242
15243 \begin_layout Description
15244 \begin_inset Flex CharStyle:Code
15245 status collapsed
15246
15247 \begin_layout Plain Layout
15248 Transform
15249 \begin_inset space ~
15250 \end_inset
15251
15252 Rotate|Resize|Clip|Extra
15253 \end_layout
15254
15255 \end_inset
15256
15257  This command specifies which transformations are supported by this template.
15258  It may occur zero or more times.
15259  This command enables the corresponding tabs in the external dialog.
15260  Each 
15261 \begin_inset Flex CharStyle:Code
15262 status collapsed
15263
15264 \begin_layout Plain Layout
15265 Transform
15266 \end_layout
15267
15268 \end_inset
15269
15270  command must have either a corresponding 
15271 \begin_inset Flex CharStyle:Code
15272 status collapsed
15273
15274 \begin_layout Plain Layout
15275 TransformCommand
15276 \end_layout
15277
15278 \end_inset
15279
15280  or a 
15281 \begin_inset Flex CharStyle:Code
15282 status collapsed
15283
15284 \begin_layout Plain Layout
15285 TransformOption
15286 \end_layout
15287
15288 \end_inset
15289
15290  command in the 
15291 \begin_inset Flex CharStyle:Code
15292 status collapsed
15293
15294 \begin_layout Plain Layout
15295 Format
15296 \end_layout
15297
15298 \end_inset
15299
15300  section.
15301  Otherwise the transformation will not be supported by that format.
15302 \end_layout
15303
15304 \begin_layout Subsection
15305 The Format section
15306 \end_layout
15307
15308 \begin_layout Description
15309 \begin_inset Flex CharStyle:Code
15310 status collapsed
15311
15312 \begin_layout Plain Layout
15313 Format
15314 \begin_inset space ~
15315 \end_inset
15316
15317 LaTeX|PDFLaTeX|PlainText|DocBook
15318 \end_layout
15319
15320 \end_inset
15321
15322  The primary document file format that this format definition is for.
15323  Not every template has a sensible representation in all document file formats.
15324  Please define nevertheless a 
15325 \begin_inset Flex CharStyle:Code
15326 status collapsed
15327
15328 \begin_layout Plain Layout
15329 Format
15330 \end_layout
15331
15332 \end_inset
15333
15334  section for all formats.
15335  Use a dummy text when no representation is available.
15336  Then you can at least see a reference to the external material in the exported
15337  document.
15338 \end_layout
15339
15340 \begin_layout Description
15341 \begin_inset Flex CharStyle:Code
15342 status collapsed
15343
15344 \begin_layout Plain Layout
15345 Option
15346 \begin_inset space ~
15347 \end_inset
15348
15349 <name>
15350 \begin_inset space ~
15351 \end_inset
15352
15353 <value>
15354 \end_layout
15355
15356 \end_inset
15357
15358  This command defines an additional macro 
15359 \begin_inset Flex CharStyle:Code
15360 status collapsed
15361
15362 \begin_layout Plain Layout
15363 $$<name>
15364 \end_layout
15365
15366 \end_inset
15367
15368  for substitution in 
15369 \begin_inset Flex CharStyle:Code
15370 status collapsed
15371
15372 \begin_layout Plain Layout
15373 Product
15374 \end_layout
15375
15376 \end_inset
15377
15378 .
15379  
15380 \begin_inset Flex CharStyle:Code
15381 status collapsed
15382
15383 \begin_layout Plain Layout
15384 <value>
15385 \end_layout
15386
15387 \end_inset
15388
15389  itself may contain substitution macros.
15390  The advantage over using 
15391 \begin_inset Flex CharStyle:Code
15392 status collapsed
15393
15394 \begin_layout Plain Layout
15395 <value>
15396 \end_layout
15397
15398 \end_inset
15399
15400  directly in 
15401 \begin_inset Flex CharStyle:Code
15402 status collapsed
15403
15404 \begin_layout Plain Layout
15405 Product
15406 \end_layout
15407
15408 \end_inset
15409
15410  is that the substituted value of 
15411 \begin_inset Flex CharStyle:Code
15412 status collapsed
15413
15414 \begin_layout Plain Layout
15415 $$<name>
15416 \end_layout
15417
15418 \end_inset
15419
15420  is sanitized so that it is a valid optional argument in the document format.
15421  This command may occur zero or more times.
15422 \end_layout
15423
15424 \begin_layout Description
15425 \begin_inset Flex CharStyle:Code
15426 status collapsed
15427
15428 \begin_layout Plain Layout
15429 Product
15430 \begin_inset space ~
15431 \end_inset
15432
15433 <text>
15434 \end_layout
15435
15436 \end_inset
15437
15438  The text that is inserted in the exported document.
15439  This is actually the most important command and can be quite complex.
15440  This command must occur exactly once.
15441 \end_layout
15442
15443 \begin_layout Description
15444 \begin_inset Flex CharStyle:Code
15445 status collapsed
15446
15447 \begin_layout Plain Layout
15448 Preamble
15449 \begin_inset space ~
15450 \end_inset
15451
15452 <name>
15453 \end_layout
15454
15455 \end_inset
15456
15457  This command specifies a preamble snippet that will be included in the
15458  LaTeX preamble.
15459  It has to be defined using 
15460 \begin_inset Flex CharStyle:Code
15461 status collapsed
15462
15463 \begin_layout Plain Layout
15464 PreambleDef
15465 \end_layout
15466
15467 \end_inset
15468
15469  \SpecialChar \ldots{}
15470  
15471 \begin_inset Flex CharStyle:Code
15472 status collapsed
15473
15474 \begin_layout Plain Layout
15475 PreambleDefEnd
15476 \end_layout
15477
15478 \end_inset
15479
15480 .
15481  This command may occur zero or more times.
15482 \end_layout
15483
15484 \begin_layout Description
15485 \begin_inset Flex CharStyle:Code
15486 status collapsed
15487
15488 \begin_layout Plain Layout
15489 ReferencedFile
15490 \begin_inset space ~
15491 \end_inset
15492
15493 <format>
15494 \begin_inset space ~
15495 \end_inset
15496
15497 <filename>
15498 \end_layout
15499
15500 \end_inset
15501
15502  This command denotes files that are created by the conversion process and
15503  are needed for a particular export format.
15504  If the filename is relative, it is interpreted relative to the master document.
15505  This command may be given zero or more times.
15506 \end_layout
15507
15508 \begin_layout Description
15509 \begin_inset Flex CharStyle:Code
15510 status collapsed
15511
15512 \begin_layout Plain Layout
15513 Requirement
15514 \begin_inset space ~
15515 \end_inset
15516
15517 <package>
15518 \end_layout
15519
15520 \end_inset
15521
15522  The name of a required LaTeX package.
15523  The package is included via 
15524 \begin_inset Flex CharStyle:Code
15525 status collapsed
15526
15527 \begin_layout Plain Layout
15528
15529 \backslash
15530 usepackage{}
15531 \end_layout
15532
15533 \end_inset
15534
15535  in the LaTeX preamble.
15536  This command may occur zero or more times.
15537 \end_layout
15538
15539 \begin_layout Description
15540 \begin_inset Flex CharStyle:Code
15541 status collapsed
15542
15543 \begin_layout Plain Layout
15544 TransformCommand
15545 \begin_inset space ~
15546 \end_inset
15547
15548 Rotate
15549 \begin_inset space ~
15550 \end_inset
15551
15552 RotationLatexCommand
15553 \end_layout
15554
15555 \end_inset
15556
15557  This command specifies that the built in LaTeX command should be used for
15558  rotation.
15559  This command may occur once or not at all.
15560 \end_layout
15561
15562 \begin_layout Description
15563 \begin_inset Flex CharStyle:Code
15564 status collapsed
15565
15566 \begin_layout Plain Layout
15567 TransformCommand
15568 \begin_inset space ~
15569 \end_inset
15570
15571 Resize
15572 \begin_inset space ~
15573 \end_inset
15574
15575 ResizeLatexCommand
15576 \end_layout
15577
15578 \end_inset
15579
15580  This command specifies that the built in LaTeX command should be used for
15581  resizing.
15582  This command may occur once or not at all.
15583 \end_layout
15584
15585 \begin_layout Description
15586 \begin_inset Flex CharStyle:Code
15587 status collapsed
15588
15589 \begin_layout Plain Layout
15590 TransformOption
15591 \begin_inset space ~
15592 \end_inset
15593
15594 Rotate
15595 \begin_inset space ~
15596 \end_inset
15597
15598 RotationLatexOption
15599 \end_layout
15600
15601 \end_inset
15602
15603  This command specifies that rotation is done via an optional argument.
15604  This command may occur once or not at all.
15605 \end_layout
15606
15607 \begin_layout Description
15608 \begin_inset Flex CharStyle:Code
15609 status collapsed
15610
15611 \begin_layout Plain Layout
15612 TransformOption
15613 \begin_inset space ~
15614 \end_inset
15615
15616 Resize
15617 \begin_inset space ~
15618 \end_inset
15619
15620 ResizeLatexOption
15621 \end_layout
15622
15623 \end_inset
15624
15625  This command specifies that resizing is done via an optional argument.
15626  This command may occur once or not at all.
15627 \end_layout
15628
15629 \begin_layout Description
15630 \begin_inset Flex CharStyle:Code
15631 status collapsed
15632
15633 \begin_layout Plain Layout
15634 TransformOption
15635 \begin_inset space ~
15636 \end_inset
15637
15638 Clip
15639 \begin_inset space ~
15640 \end_inset
15641
15642 ClipLatexOption
15643 \end_layout
15644
15645 \end_inset
15646
15647  This command specifies that clipping is done via an optional argument.
15648  This command may occur once or not at all.
15649 \end_layout
15650
15651 \begin_layout Description
15652 \begin_inset Flex CharStyle:Code
15653 status collapsed
15654
15655 \begin_layout Plain Layout
15656 TransformOption
15657 \begin_inset space ~
15658 \end_inset
15659
15660 Extra
15661 \begin_inset space ~
15662 \end_inset
15663
15664 ExtraLatexOption
15665 \end_layout
15666
15667 \end_inset
15668
15669  This command specifies that an extra optional argument is used.
15670  This command may occur once or not at all.
15671 \end_layout
15672
15673 \begin_layout Description
15674 \begin_inset Flex CharStyle:Code
15675 status collapsed
15676
15677 \begin_layout Plain Layout
15678 UpdateFormat
15679 \begin_inset space ~
15680 \end_inset
15681
15682 <format>
15683 \end_layout
15684
15685 \end_inset
15686
15687  The file format of the converted file.
15688  This must be the name of a format that is known to LyX (see the 
15689 \begin_inset Flex CharStyle:MenuItem
15690 status collapsed
15691
15692 \begin_layout Plain Layout
15693
15694 \bar under
15695 T
15696 \bar default
15697 ools\SpecialChar \menuseparator
15698
15699 \bar under
15700 P
15701 \bar default
15702 references:Conversion
15703 \end_layout
15704
15705 \end_inset
15706
15707  dialog).
15708  This command must occur exactly once.
15709 \end_layout
15710
15711 \begin_layout Description
15712 \begin_inset Flex CharStyle:Code
15713 status collapsed
15714
15715 \begin_layout Plain Layout
15716 UpdateResult
15717 \begin_inset space ~
15718 \end_inset
15719
15720 <filename>
15721 \end_layout
15722
15723 \end_inset
15724
15725  The file name of the converted file.
15726  The file name must be absolute.
15727  This command must occur exactly once.
15728 \end_layout
15729
15730 \begin_layout Subsection
15731 Preamble definitions
15732 \end_layout
15733
15734 \begin_layout Standard
15735 The external template configuration file may contain additional preamble
15736  definitions enclosed by 
15737 \begin_inset Flex CharStyle:Code
15738 status collapsed
15739
15740 \begin_layout Plain Layout
15741 PreambleDef
15742 \end_layout
15743
15744 \end_inset
15745
15746  \SpecialChar \ldots{}
15747  
15748 \begin_inset Flex CharStyle:Code
15749 status collapsed
15750
15751 \begin_layout Plain Layout
15752 PreambleDefEnd
15753 \end_layout
15754
15755 \end_inset
15756
15757 .
15758  They can be used by the templates in the 
15759 \begin_inset Flex CharStyle:Code
15760 status collapsed
15761
15762 \begin_layout Plain Layout
15763 Format
15764 \end_layout
15765
15766 \end_inset
15767
15768  section.
15769 \end_layout
15770
15771 \begin_layout Section
15772 The substitution mechanism
15773 \end_layout
15774
15775 \begin_layout Standard
15776 When the external material facility invokes an external program, it is done
15777  on the basis of a command defined in the template configuration file.
15778  These commands can contain various macros that are expanded before execution.
15779  Execution always take place in the directory of the containing document.
15780 \end_layout
15781
15782 \begin_layout Standard
15783 Also, whenever external material is to be displayed, the name will be produced
15784  by the substitution mechanism, and most other commands in the template
15785  definition support substitution as well.
15786 \end_layout
15787
15788 \begin_layout Standard
15789 The available macros are the following:
15790 \end_layout
15791
15792 \begin_layout Description
15793 \begin_inset Flex CharStyle:Code
15794 status collapsed
15795
15796 \begin_layout Plain Layout
15797 $$AbsOrRelPathMaster
15798 \end_layout
15799
15800 \end_inset
15801
15802  The file path, absolute or relative to the master LyX document.
15803 \end_layout
15804
15805 \begin_layout Description
15806 \begin_inset Flex CharStyle:Code
15807 status collapsed
15808
15809 \begin_layout Plain Layout
15810 $$AbsOrRelPathParent
15811 \end_layout
15812
15813 \end_inset
15814
15815  The file path, absolute or relative to the LyX document.
15816 \end_layout
15817
15818 \begin_layout Description
15819 \begin_inset Flex CharStyle:Code
15820 status collapsed
15821
15822 \begin_layout Plain Layout
15823 $$AbsPath
15824 \end_layout
15825
15826 \end_inset
15827
15828  The absolute file path.
15829 \end_layout
15830
15831 \begin_layout Description
15832 \begin_inset Flex CharStyle:Code
15833 status collapsed
15834
15835 \begin_layout Plain Layout
15836 $$Basename
15837 \end_layout
15838
15839 \end_inset
15840
15841  The filename without path and without the extension.
15842 \end_layout
15843
15844 \begin_layout Description
15845 \begin_inset Flex CharStyle:Code
15846 status collapsed
15847
15848 \begin_layout Plain Layout
15849 $$Contents(
15850 \begin_inset Quotes eld
15851 \end_inset
15852
15853 filename.ext
15854 \begin_inset Quotes erd
15855 \end_inset
15856
15857 )
15858 \end_layout
15859
15860 \end_inset
15861
15862  This macro will expand to the contents of the file with the name 
15863 \begin_inset Flex CharStyle:Code
15864 status collapsed
15865
15866 \begin_layout Plain Layout
15867 filename.ext
15868 \end_layout
15869
15870 \end_inset
15871
15872 .
15873 \end_layout
15874
15875 \begin_layout Description
15876 \begin_inset Flex CharStyle:Code
15877 status collapsed
15878
15879 \begin_layout Plain Layout
15880 $$Extension
15881 \end_layout
15882
15883 \end_inset
15884
15885  The file extension (including the dot).
15886 \end_layout
15887
15888 \begin_layout Description
15889 \begin_inset Flex CharStyle:Code
15890 status collapsed
15891
15892 \begin_layout Plain Layout
15893 $$FName
15894 \end_layout
15895
15896 \end_inset
15897
15898  The filename of the file specified in the external material dialog.
15899  This is either an absolute name, or it is relative to the LyX document.
15900 \end_layout
15901
15902 \begin_layout Description
15903 \begin_inset Flex CharStyle:Code
15904 status collapsed
15905
15906 \begin_layout Plain Layout
15907 $$FPath
15908 \end_layout
15909
15910 \end_inset
15911
15912  The path part of 
15913 \begin_inset Flex CharStyle:Code
15914 status collapsed
15915
15916 \begin_layout Plain Layout
15917 $$FName
15918 \end_layout
15919
15920 \end_inset
15921
15922  (absolute name or relative to the LyX document).
15923 \end_layout
15924
15925 \begin_layout Description
15926 \begin_inset Flex CharStyle:Code
15927 status collapsed
15928
15929 \begin_layout Plain Layout
15930 $$RelPathMaster
15931 \end_layout
15932
15933 \end_inset
15934
15935  The file path, relative to the master LyX document.
15936 \end_layout
15937
15938 \begin_layout Description
15939 \begin_inset Flex CharStyle:Code
15940 status collapsed
15941
15942 \begin_layout Plain Layout
15943 $$RelPathParent
15944 \end_layout
15945
15946 \end_inset
15947
15948  The file path, 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 $$Sysdir
15957 \end_layout
15958
15959 \end_inset
15960
15961  This macro will expand to the absolute path of the system directory.
15962  This is typically used to point to the various helper scripts that are
15963  bundled with LyX.
15964 \end_layout
15965
15966 \begin_layout Description
15967 \begin_inset Flex CharStyle:Code
15968 status collapsed
15969
15970 \begin_layout Plain Layout
15971 $$Tempname
15972 \end_layout
15973
15974 \end_inset
15975
15976  A name and full path to a temporary file which will be automatically deleted
15977  whenever the containing document is closed, or the external material insertion
15978  deleted.
15979 \end_layout
15980
15981 \begin_layout Standard
15982 All path macros contain a trailing directory separator, so you can construct
15983  e.g.
15984  the absolute filename with 
15985 \begin_inset Flex CharStyle:Code
15986 status collapsed
15987
15988 \begin_layout Plain Layout
15989 $$AbsPath$$Basename$$Extension
15990 \end_layout
15991
15992 \end_inset
15993
15994 .
15995 \end_layout
15996
15997 \begin_layout Standard
15998 The macros above are substituted in all commands unless otherwise noted.
15999  The command 
16000 \begin_inset Flex CharStyle:Code
16001 status collapsed
16002
16003 \begin_layout Plain Layout
16004 Product
16005 \end_layout
16006
16007 \end_inset
16008
16009  supports additionally the following substitutions if they are enabled by
16010  the 
16011 \begin_inset Flex CharStyle:Code
16012 status collapsed
16013
16014 \begin_layout Plain Layout
16015 Transform
16016 \end_layout
16017
16018 \end_inset
16019
16020  and 
16021 \begin_inset Flex CharStyle:Code
16022 status collapsed
16023
16024 \begin_layout Plain Layout
16025 TransformCommand
16026 \end_layout
16027
16028 \end_inset
16029
16030  commands:
16031 \end_layout
16032
16033 \begin_layout Description
16034 \begin_inset Flex CharStyle:Code
16035 status collapsed
16036
16037 \begin_layout Plain Layout
16038 $$ResizeFront
16039 \end_layout
16040
16041 \end_inset
16042
16043  The front part of the resize command.
16044 \end_layout
16045
16046 \begin_layout Description
16047 \begin_inset Flex CharStyle:Code
16048 status collapsed
16049
16050 \begin_layout Plain Layout
16051 $$ResizeBack
16052 \end_layout
16053
16054 \end_inset
16055
16056  The back part of the resize command.
16057 \end_layout
16058
16059 \begin_layout Description
16060 \begin_inset Flex CharStyle:Code
16061 status collapsed
16062
16063 \begin_layout Plain Layout
16064 $$RotateFront
16065 \end_layout
16066
16067 \end_inset
16068
16069  The front part of the rotation 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 $$RotateBack
16078 \end_layout
16079
16080 \end_inset
16081
16082  The back part of the rotation command.
16083 \end_layout
16084
16085 \begin_layout Standard
16086 The value string of the 
16087 \begin_inset Flex CharStyle:Code
16088 status collapsed
16089
16090 \begin_layout Plain Layout
16091 Option
16092 \end_layout
16093
16094 \end_inset
16095
16096  command supports additionally the following substitutions if they are enabled
16097  by the 
16098 \begin_inset Flex CharStyle:Code
16099 status collapsed
16100
16101 \begin_layout Plain Layout
16102 Transform
16103 \end_layout
16104
16105 \end_inset
16106
16107  and 
16108 \begin_inset Flex CharStyle:Code
16109 status collapsed
16110
16111 \begin_layout Plain Layout
16112 TransformOption
16113 \end_layout
16114
16115 \end_inset
16116
16117  commands:
16118 \end_layout
16119
16120 \begin_layout Description
16121 \begin_inset Flex CharStyle:Code
16122 status collapsed
16123
16124 \begin_layout Plain Layout
16125 $$Clip
16126 \end_layout
16127
16128 \end_inset
16129
16130  The clip option.
16131 \end_layout
16132
16133 \begin_layout Description
16134 \begin_inset Flex CharStyle:Code
16135 status collapsed
16136
16137 \begin_layout Plain Layout
16138 $$Extra
16139 \end_layout
16140
16141 \end_inset
16142
16143  The extra option.
16144 \end_layout
16145
16146 \begin_layout Description
16147 \begin_inset Flex CharStyle:Code
16148 status collapsed
16149
16150 \begin_layout Plain Layout
16151 $$Resize
16152 \end_layout
16153
16154 \end_inset
16155
16156  The resize 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 $$Rotate
16165 \end_layout
16166
16167 \end_inset
16168
16169  The rotation option.
16170 \end_layout
16171
16172 \begin_layout Standard
16173 You may ask why there are so many path macros.
16174  There are mainly two reasons:
16175 \end_layout
16176
16177 \begin_layout Enumerate
16178 Relative and absolute file names should remain relative or absolute, respectivel
16179 y.
16180  Users may have reasons to prefer either form.
16181  Relative names are useful for portable documents that should work on different
16182  machines, for example.
16183  Absolute names may be required by some programs.
16184 \end_layout
16185
16186 \begin_layout Enumerate
16187 LaTeX treats relative file names differently than LyX and other programs
16188  in nested included files.
16189  For LyX, a relative file name is always relative to the document that contains
16190  the file name.
16191  For LaTeX, it is always relative to the master document.
16192  These two definitions are identical if you have only one document, but
16193  differ if you have a master document that includes part documents.
16194  That means that relative filenames must be transformed when presented to
16195  LaTeX.
16196  Fortunately LyX does this automatically for you if you choose the right
16197  macros.
16198 \end_layout
16199
16200 \begin_layout Standard
16201 So which path macro should be used in new template definitions? The rule
16202  is not difficult:
16203 \end_layout
16204
16205 \begin_layout Itemize
16206 Use 
16207 \begin_inset Flex CharStyle:Code
16208 status collapsed
16209
16210 \begin_layout Plain Layout
16211 $$AbsPath
16212 \end_layout
16213
16214 \end_inset
16215
16216  if an absolute path is required.
16217 \end_layout
16218
16219 \begin_layout Itemize
16220 Use 
16221 \begin_inset Flex CharStyle:Code
16222 status collapsed
16223
16224 \begin_layout Plain Layout
16225 $$AbsOrRelPathMaster
16226 \end_layout
16227
16228 \end_inset
16229
16230  if the substituted string is some kind of LaTeX input.
16231 \end_layout
16232
16233 \begin_layout Itemize
16234 Else use 
16235 \begin_inset Flex CharStyle:Code
16236 status collapsed
16237
16238 \begin_layout Plain Layout
16239 $$AbsOrRelPathParent
16240 \end_layout
16241
16242 \end_inset
16243
16244  in order to preserve the user's choice.
16245 \end_layout
16246
16247 \begin_layout Standard
16248 There are special cases where this rule does not work and e.g.
16249 \begin_inset space ~
16250 \end_inset
16251
16252 relative names are needed, but normally it will work just fine.
16253  One example for such a case is the command 
16254 \begin_inset Flex CharStyle:Code
16255 status collapsed
16256
16257 \begin_layout Plain Layout
16258 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16259 \end_layout
16260
16261 \end_inset
16262
16263  in the XFig template above: We can't use the absolute name because the
16264  copier for 
16265 \begin_inset Flex CharStyle:Code
16266 status collapsed
16267
16268 \begin_layout Plain Layout
16269 .pstex_t
16270 \end_layout
16271
16272 \end_inset
16273
16274  files needs the relative name in order to rewrite the file content.
16275 \end_layout
16276
16277 \begin_layout Section
16278 \begin_inset CommandInset label
16279 LatexCommand label
16280 name "sec:Security-discussion"
16281
16282 \end_inset
16283
16284 Security discussion
16285 \end_layout
16286
16287 \begin_layout Standard
16288 \begin_inset Note Note
16289 status collapsed
16290
16291 \begin_layout Plain Layout
16292 This section is outdated
16293 \end_layout
16294
16295 \end_inset
16296
16297 The external material feature interfaces with a lot of external programs
16298  and does so automatically, so we have to consider the security implications
16299  of this.
16300  In particular, since you have the option of including your own filenames
16301  and/or parameter strings and those are expanded into a command, it seems
16302  that it would be possible to create a malicious document which executes
16303  arbitrary commands when a user views or prints the document.
16304  This is something we definately want to avoid.
16305 \end_layout
16306
16307 \begin_layout Standard
16308 However, since the external program commands are specified in the template
16309  configuration file only, there are no security issues if LyX is properly
16310  configured with safe templates only.
16311  This is so because the external programs are invoked with the 
16312 \begin_inset Flex CharStyle:Code
16313 status collapsed
16314
16315 \begin_layout Plain Layout
16316 execvp
16317 \end_layout
16318
16319 \end_inset
16320
16321 -system call rather than the 
16322 \begin_inset Flex CharStyle:Code
16323 status collapsed
16324
16325 \begin_layout Plain Layout
16326 system
16327 \end_layout
16328
16329 \end_inset
16330
16331  system-call, so it's not possible to execute arbitrary commands from the
16332  filename or parameter section via the shell.
16333 \end_layout
16334
16335 \begin_layout Standard
16336 This also implies that you are restricted in what command strings you can
16337  use in the external material templates.
16338  In particular, pipes and redirection are not readily available.
16339  This has to be so if LyX should remain safe.
16340  If you want to use some of the shell features, you should write a safe
16341  script to do this in a controlled manner, and then invoke the script from
16342  the command string.
16343  In the 
16344 \begin_inset Flex CharStyle:Code
16345 status collapsed
16346
16347 \begin_layout Plain Layout
16348 lib/scripts
16349 \end_layout
16350
16351 \end_inset
16352
16353  directory of the LyX installation, you can find a safe wrapper script 
16354 \begin_inset Flex CharStyle:Code
16355 status collapsed
16356
16357 \begin_layout Plain Layout
16358 general_command_wrapper.py
16359 \end_layout
16360
16361 \end_inset
16362
16363  that supports redirection of input and output.
16364  That can serve as an example for how to write safe template scripts.
16365  For a more advanced example that uses 
16366 \begin_inset Flex CharStyle:Code
16367 status collapsed
16368
16369 \begin_layout Plain Layout
16370 fork
16371 \end_layout
16372
16373 \end_inset
16374
16375  and friends, take a look at the 
16376 \begin_inset Flex CharStyle:Code
16377 status collapsed
16378
16379 \begin_layout Plain Layout
16380 pic2ascii.py
16381 \end_layout
16382
16383 \end_inset
16384
16385  converter script.
16386 \end_layout
16387
16388 \begin_layout Standard
16389 It is possible to design a template that interacts directly with the shell,
16390  but since this would allow a malicious user to execute arbitrary commands
16391  by writing clever filenames and/or parameters, we generally recommend that
16392  you only use safe scripts that work with the 
16393 \begin_inset Flex CharStyle:Code
16394 status collapsed
16395
16396 \begin_layout Plain Layout
16397 execvp
16398 \end_layout
16399
16400 \end_inset
16401
16402  system call in a controlled manner.
16403  Of course, for use in a controlled environment, it can be tempting to just
16404  fall back to use ordinary shell scripts.
16405  If you do so, be aware that you 
16406 \emph on
16407 will
16408 \emph default
16409  provide an easily exploitable security hole in your system.
16410  Of course it stands to reason that such unsafe templates will never be
16411  included in the standard LyX distribution, although we do encourage people
16412  to submit new templates in the open source tradition.
16413  But LyX as shipped from the official distribution channels will never have
16414  unsafe templates.
16415 \end_layout
16416
16417 \begin_layout Standard
16418 Including external material provides a lot of power, and you have to be
16419  careful not to introduce security hazards with this power.
16420  A subtle error in a single line in an innocent looking script can open
16421  the door to huge security problems.
16422  So if you do not fully understand the issues, we recommend that you consult
16423  a knowledgable security professional or the LyX development team if you
16424  have any questions about whether a given template is safe or not.
16425  And do this before you use it in an uncontrolled environment.
16426 \end_layout
16427
16428 \begin_layout Chapter
16429 The LyX Server
16430 \end_layout
16431
16432 \begin_layout Section
16433 Introduction
16434 \end_layout
16435
16436 \begin_layout Standard
16437 The LyX server is a method implemented in LyX that will enable other programs
16438  to talk to LyX, invoke LyX commands, and retrieve information about the
16439  LyX internal state.
16440  This is only intended for advanced users, but they should find it useful.
16441  Please note that, at present, 
16442 \emph on
16443 the server does not work on Windows
16444 \emph default
16445 .
16446 \begin_inset Foot
16447 status collapsed
16448
16449 \begin_layout Plain Layout
16450 There is no principled reason it cannot do so.
16451  But none of the developers on Windows® have yet implemented this functionality
16452  there.
16453 \end_layout
16454
16455 \end_inset
16456
16457
16458 \end_layout
16459
16460 \begin_layout Section
16461 Starting the LyX Server
16462 \end_layout
16463
16464 \begin_layout Standard
16465 The LyX server works through the use of a pair of named pipes.
16466  These are usually located in 
16467 \begin_inset Flex CharStyle:Code
16468 status collapsed
16469
16470 \begin_layout Plain Layout
16471 UserDir
16472 \end_layout
16473
16474 \end_inset
16475
16476  and have the names 
16477 \begin_inset Quotes eld
16478 \end_inset
16479
16480
16481 \begin_inset Flex CharStyle:Code
16482 status collapsed
16483
16484 \begin_layout Plain Layout
16485 .lyxpipe.in
16486 \end_layout
16487
16488 \end_inset
16489
16490
16491 \begin_inset Quotes erd
16492 \end_inset
16493
16494  and 
16495 \begin_inset Quotes eld
16496 \end_inset
16497
16498
16499 \begin_inset Flex CharStyle:Code
16500 status collapsed
16501
16502 \begin_layout Plain Layout
16503 .lyxpipe.out
16504 \end_layout
16505
16506 \end_inset
16507
16508
16509 \begin_inset Quotes erd
16510 \end_inset
16511
16512 .
16513  External programs write into 
16514 \begin_inset Flex CharStyle:Code
16515 status collapsed
16516
16517 \begin_layout Plain Layout
16518 .lyxpipe.in
16519 \end_layout
16520
16521 \end_inset
16522
16523  and read back data from 
16524 \begin_inset Flex CharStyle:Code
16525 status collapsed
16526
16527 \begin_layout Plain Layout
16528 .lyxpipe.out
16529 \end_layout
16530
16531 \end_inset
16532
16533 .
16534  The stem of the pipe names can be defined in the 
16535 \begin_inset Flex CharStyle:MenuItem
16536 status collapsed
16537
16538 \begin_layout Plain Layout
16539
16540 \bar under
16541 T
16542 \bar default
16543 ools\SpecialChar \menuseparator
16544
16545 \bar under
16546 P
16547 \bar default
16548 references
16549 \end_layout
16550
16551 \end_inset
16552
16553  dialog, for example 
16554 \begin_inset Flex CharStyle:Code
16555 status collapsed
16556
16557 \begin_layout Plain Layout
16558 "/home/myhome/.lyxpipe"
16559 \end_layout
16560
16561 \end_inset
16562
16563 .
16564 \end_layout
16565
16566 \begin_layout Standard
16567 LyX will add the '
16568 \begin_inset Flex CharStyle:Code
16569 status collapsed
16570
16571 \begin_layout Plain Layout
16572 .in
16573 \end_layout
16574
16575 \end_inset
16576
16577 ' and '
16578 \begin_inset Flex CharStyle:Code
16579 status collapsed
16580
16581 \begin_layout Plain Layout
16582 .out
16583 \end_layout
16584
16585 \end_inset
16586
16587 ' to create the pipes.
16588  The above setting also has the effect of activating the LyX server.
16589  If one of the pipes already exists, LyX will assume that another LyX process
16590  is already running and will not start the server.
16591  To have several LyX processes with servers at the same time, you have to
16592  change the configuration between the start of the programs.
16593 \end_layout
16594
16595 \begin_layout Standard
16596 If you are developing a client program, you might find it useful to enable
16597  debugging information from the LyX server.
16598  Do this by starting LyX as lyx -dbg lyxserver.
16599 \end_layout
16600
16601 \begin_layout Standard
16602 Warning: if LyX crashes, it may not manage to remove the pipes; in this
16603  case you must remove them manually.
16604  If LyX starts and the pipes exist already, it will not start any server.
16605 \end_layout
16606
16607 \begin_layout Standard
16608 Other than this, there are a few points to consider:
16609 \end_layout
16610
16611 \begin_layout Itemize
16612 Both server and clients must run on UNIX or OS/2 machines.
16613  Communications between LyX on UNIX and clients on OS/2 or vice versa is
16614  not possible right now.
16615 \end_layout
16616
16617 \begin_layout Itemize
16618 On OS/2, only one client can connect to LyXServer at a time.
16619 \end_layout
16620
16621 \begin_layout Itemize
16622 On OS/2, clients must open inpipe with 
16623 \begin_inset Flex CharStyle:Code
16624 status collapsed
16625
16626 \begin_layout Plain Layout
16627 O_WRONLY
16628 \end_layout
16629
16630 \end_inset
16631
16632
16633 \end_layout
16634
16635 \begin_layout Standard
16636 mode.
16637 \end_layout
16638
16639 \begin_layout Standard
16640 You can find a complete example client written in C in the source distribution
16641  as 
16642 \begin_inset Flex CharStyle:Code
16643 status collapsed
16644
16645 \begin_layout Plain Layout
16646 development/lyxserver/server_monitor.c
16647 \end_layout
16648
16649 \end_inset
16650
16651 .
16652 \end_layout
16653
16654 \begin_layout Section
16655 Normal communication
16656 \end_layout
16657
16658 \begin_layout Standard
16659 To issue a LyX call, the client writes a line of ASCII text into the input
16660  pipe.
16661  This line has the following format:
16662 \end_layout
16663
16664 \begin_layout Quote
16665 LYXCMD:
16666 \emph on
16667 clientname
16668 \emph default
16669 :
16670 \emph on
16671 function
16672 \emph default
16673 :
16674 \emph on
16675 argument
16676 \end_layout
16677
16678 \begin_layout Description
16679
16680 \emph on
16681 clientname
16682 \emph default
16683  is a name that the client can choose arbitrarily.
16684  Its only use is that LyX will echo it if it sends an answer---so a client
16685  can dispatch results from different requesters.
16686 \end_layout
16687
16688 \begin_layout Description
16689
16690 \emph on
16691 function
16692 \emph default
16693  is the function you want LyX to perform.
16694  It is the same as the commands you'd use in the minibuffer.
16695 \end_layout
16696
16697 \begin_layout Description
16698
16699 \emph on
16700 argument
16701 \emph default
16702  is an optional argument which is meaningful only to some functions (for
16703  instance 
16704 \begin_inset Quotes eld
16705 \end_inset
16706
16707 self-insert
16708 \begin_inset Quotes erd
16709 \end_inset
16710
16711  which will insert the argument as text at the cursor position.)
16712 \end_layout
16713
16714 \begin_layout Standard
16715 The answer from LyX will arrive in the output pipe and be of the form
16716 \end_layout
16717
16718 \begin_layout Quote
16719 INFO:
16720 \emph on
16721 clientname
16722 \emph default
16723 :
16724 \emph on
16725 function
16726 \emph default
16727 :
16728 \emph on
16729 data
16730 \end_layout
16731
16732 \begin_layout Standard
16733 where 
16734 \emph on
16735 clientname
16736 \emph default
16737  and 
16738 \emph on
16739 function
16740 \emph default
16741  are just echoed from the command request, while 
16742 \emph on
16743 data
16744 \emph default
16745  is more or less useful information filled according to how the command
16746  execution worked out.
16747  Some commands will return information about the internal state of LyX,
16748  such as 
16749 \begin_inset Quotes eld
16750 \end_inset
16751
16752 font-state
16753 \begin_inset Quotes erd
16754 \end_inset
16755
16756 , while other will return an empty data-response.
16757  This means that the command execution went fine.
16758 \end_layout
16759
16760 \begin_layout Standard
16761 In case of errors, the response from LyX will have this form
16762 \end_layout
16763
16764 \begin_layout Quote
16765 ERROR:
16766 \emph on
16767 clientname
16768 \emph default
16769 :
16770 \emph on
16771 function
16772 \emph default
16773 :
16774 \emph on
16775 error message
16776 \end_layout
16777
16778 \begin_layout Standard
16779 where the 
16780 \emph on
16781 error message
16782 \emph default
16783  should contain an explanation of why the command failed.
16784 \end_layout
16785
16786 \begin_layout Standard
16787 Examples:
16788 \end_layout
16789
16790 \begin_layout LyX-Code
16791 echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
16792 \end_layout
16793
16794 \begin_layout LyX-Code
16795 echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
16796 \begin_inset Newline newline
16797 \end_inset
16798
16799 read a <~/.lyxpipe.out
16800 \begin_inset Newline newline
16801 \end_inset
16802
16803 echo $a
16804 \end_layout
16805
16806 \begin_layout Section
16807 Notification
16808 \end_layout
16809
16810 \begin_layout Standard
16811 LyX can notify clients of events going on asynchronously.
16812  Currently it will only do this if the user binds a key sequence with the
16813  function 
16814 \begin_inset Quotes eld
16815 \end_inset
16816
16817 notify
16818 \begin_inset Quotes erd
16819 \end_inset
16820
16821 .
16822  The format of the string LyX sends is as follows:
16823 \end_layout
16824
16825 \begin_layout Quote
16826 \begin_inset Flex CharStyle:Code
16827 status collapsed
16828
16829 \begin_layout Plain Layout
16830 NOTIFY:
16831 \end_layout
16832
16833 \end_inset
16834
16835
16836 \emph on
16837 key-sequence
16838 \end_layout
16839
16840 \begin_layout Standard
16841 where 
16842 \emph on
16843 key-sequence
16844 \emph default
16845  is the printed representation of the key sequence that was actually typed
16846  by the user.
16847 \end_layout
16848
16849 \begin_layout Standard
16850 This mechanism can be used to extend LyX's command set and implement macros:
16851  bind some key sequence to 
16852 \begin_inset Quotes eld
16853 \end_inset
16854
16855 notify
16856 \begin_inset Quotes erd
16857 \end_inset
16858
16859 , start a client that listens on the out pipe, dispatches the command according
16860  to the sequence and starts a function that may use LyX calls and LyX requests
16861  to issue a command or a series of commands to LyX.
16862 \end_layout
16863
16864 \begin_layout Section
16865 The simple LyX Server Protocol
16866 \end_layout
16867
16868 \begin_layout Standard
16869 LyX implements a simple protocol that can be used for session management.
16870  All messages are of the form
16871 \end_layout
16872
16873 \begin_layout Quote
16874 LYXSRV:
16875 \emph on
16876 clientname
16877 \emph default
16878 :
16879 \emph on
16880 protocol message
16881 \end_layout
16882
16883 \begin_layout Standard
16884 where 
16885 \emph on
16886 protocol message
16887 \emph default
16888  can be 
16889 \begin_inset Quotes eld
16890 \end_inset
16891
16892 hello
16893 \begin_inset Quotes erd
16894 \end_inset
16895
16896  or 
16897 \begin_inset Quotes eld
16898 \end_inset
16899
16900 bye
16901 \begin_inset Quotes erd
16902 \end_inset
16903
16904 .
16905  If 
16906 \begin_inset Quotes eld
16907 \end_inset
16908
16909 hello
16910 \begin_inset Quotes erd
16911 \end_inset
16912
16913  is received from a client, LyX will report back to inform the client that
16914  it's listening to it's messages, while 
16915 \begin_inset Quotes eld
16916 \end_inset
16917
16918 bye
16919 \begin_inset Quotes erd
16920 \end_inset
16921
16922  sent from LyX will inform clients that LyX is closing.
16923 \end_layout
16924
16925 \end_body
16926 \end_document