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