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