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