]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
support for formal math script
[lyx.git] / lib / doc / Customization.lyx
1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
2 \lyxformat 394
3 \begin_document
4 \begin_header
5 \textclass scrbook
6 \begin_preamble
7 % DO NOT ALTER THIS PREAMBLE!!!
8 %
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected.  If you
12 % have problems LaTeXing this file, please contact 
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
15
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
18
19  % set fonts for nicer pdf view
20  \IfFileExists{lmodern.sty}
21   {\usepackage{lmodern}}{}
22
23 \fi % end if pdflatex is used
24
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
29   \frontmatter
30   \pdfbookmark[1]{\contentsname}{}
31   \myTOC
32   \mainmatter }
33
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36   L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
37   {LyX}}
38
39 % used for multi-column text
40 \usepackage{multicol}
41 \usepackage{inputenc}
42 \end_preamble
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
45 \begin_modules
46 logicalmkup
47 \end_modules
48 \maintain_unincluded_children false
49 \begin_local_layout
50 Format 7
51 InsetLayout CharStyle:MenuItem
52 LyxType               charstyle
53 LabelString           menu
54 LatexType             command
55 LatexName             menuitem
56 Font
57 Family              Sans
58 EndFont
59 Preamble
60 \newcommand*{\menuitem}[1]{{\sffamily #1}}
61 EndPreamble
62 End
63 \end_local_layout
64 \language english
65 \inputencoding auto
66 \fontencoding global
67 \font_roman default
68 \font_sans default
69 \font_typewriter default
70 \font_default_family default
71 \use_xetex false
72 \font_sc false
73 \font_osf false
74 \font_sf_scale 100
75 \font_tt_scale 100
76
77 \graphics default
78 \default_output_format default
79 \output_sync 0
80 \bibtex_command default
81 \index_command default
82 \paperfontsize 12
83 \spacing single
84 \use_hyperref true
85 \pdf_title "LyX Configuration Manual"
86 \pdf_author "LyX Team"
87 \pdf_subject "LyX-documentation Customization"
88 \pdf_keywords "LyX, documentation, customization"
89 \pdf_bookmarks true
90 \pdf_bookmarksnumbered true
91 \pdf_bookmarksopen true
92 \pdf_bookmarksopenlevel 1
93 \pdf_breaklinks false
94 \pdf_pdfborder false
95 \pdf_colorlinks true
96 \pdf_backref false
97 \pdf_pdfusetitle false
98 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
99 \papersize default
100 \use_geometry false
101 \use_amsmath 0
102 \use_esint 0
103 \use_mhchem 1
104 \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 prettyref
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 Browse Packages
5471 \begin_inset Quotes erd
5472 \end_inset
5473
5474  to get a list of available packages.
5475  To install one, right click on it or use the toolbar button to install
5476  it.
5477  
5478 \end_layout
5479
5480 \begin_layout Standard
5481 If your LaTeX distribution doesn't provide such a `package manager', or
5482  if the file is not available from your distribution, then you can follow
5483  these steps to install it manually.
5484 \end_layout
5485
5486 \begin_layout Enumerate
5487 Get the package from 
5488 \begin_inset CommandInset href
5489 LatexCommand href
5490 name "CTAN"
5491 target "http://www.ctan.org/"
5492
5493 \end_inset
5494
5495  or wherever.
5496 \end_layout
5497
5498 \begin_layout Enumerate
5499 You can install the package in several different places.
5500  If you want it to be available for all users on your system, then you should
5501  install it in your `local' TeX tree; if you want (or need) it to be available
5502  just for you, then you can install it in your own `user' TeX tree.
5503  Where these trees should be created, if they do not already exist, depends
5504  upon the details of your system.
5505  To find out where they are, look in the file 
5506 \begin_inset Flex CharStyle:Code
5507 status collapsed
5508
5509 \begin_layout Plain Layout
5510 texmf.cnf
5511 \end_layout
5512
5513 \end_inset
5514
5515 .
5516 \begin_inset Foot
5517 status collapsed
5518
5519 \begin_layout Plain Layout
5520 This usually lives in the directory 
5521 \begin_inset Flex CharStyle:Code
5522 status collapsed
5523
5524 \begin_layout Plain Layout
5525 $TEXMF/web2c
5526 \end_layout
5527
5528 \end_inset
5529
5530 , though you can run 
5531 \begin_inset Flex CharStyle:Code
5532 status collapsed
5533
5534 \begin_layout Plain Layout
5535 kpsewhich texmf.cnf
5536 \end_layout
5537
5538 \end_inset
5539
5540  to locate it.
5541 \end_layout
5542
5543 \end_inset
5544
5545  The location of the `local' TeX tree is defined by the 
5546 \begin_inset Flex CharStyle:Code
5547 status collapsed
5548
5549 \begin_layout Plain Layout
5550 TEXMFLOCAL
5551 \end_layout
5552
5553 \end_inset
5554
5555  variable; this is usually somewhere like 
5556 \begin_inset Flex URL
5557 status collapsed
5558
5559 \begin_layout Plain Layout
5560
5561 /usr/local/share/texmf/
5562 \end_layout
5563
5564 \end_inset
5565
5566 .
5567  The location of the `user' TeX tree is defined by 
5568 \begin_inset Flex CharStyle:Code
5569 status collapsed
5570
5571 \begin_layout Plain Layout
5572 TEXMFHOME
5573 \end_layout
5574
5575 \end_inset
5576
5577  and is commonly 
5578 \begin_inset Flex CharStyle:Code
5579 status collapsed
5580
5581 \begin_layout Plain Layout
5582 $HOME/texmf/
5583 \end_layout
5584
5585 \end_inset
5586
5587 .
5588  (If these variables are not predefined, you can define them.) You'll probably
5589  need root permissions to create or modify the `local' tree, but your `user'
5590  tree shouldn't have such limitations.
5591 \end_layout
5592
5593 \begin_layout Enumerate
5594 Make sure 
5595 \begin_inset Flex CharStyle:Code
5596 status collapsed
5597
5598 \begin_layout Plain Layout
5599 TEXMF
5600 \end_layout
5601
5602 \end_inset
5603
5604  includes the 
5605 \begin_inset Flex CharStyle:Code
5606 status collapsed
5607
5608 \begin_layout Plain Layout
5609 TEXMFLOCAL
5610 \end_layout
5611
5612 \end_inset
5613
5614  and 
5615 \begin_inset Flex CharStyle:Code
5616 status collapsed
5617
5618 \begin_layout Plain Layout
5619 TEXMFHOME
5620 \end_layout
5621
5622 \end_inset
5623
5624  variables; e.
5625 \begin_inset space \thinspace{}
5626 \end_inset
5627
5628 g.
5629 \begin_inset Newline newline
5630 \end_inset
5631
5632
5633 \begin_inset Flex CharStyle:Code
5634 status collapsed
5635
5636 \begin_layout Plain Layout
5637 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5638 \end_layout
5639
5640 \end_inset
5641
5642
5643 \begin_inset Newline newline
5644 \end_inset
5645
5646 It probably does.
5647 \end_layout
5648
5649 \begin_layout Enumerate
5650 Your local and user trees 
5651 \emph on
5652 must
5653 \emph default
5654  have the same sort of directory structure as your main existing 
5655 \begin_inset Flex CharStyle:Code
5656 status collapsed
5657
5658 \begin_layout Plain Layout
5659 texmf
5660 \end_layout
5661
5662 \end_inset
5663
5664  directory, which will be found at 
5665 \begin_inset Flex CharStyle:Code
5666 status collapsed
5667
5668 \begin_layout Plain Layout
5669 TEXMFMAIN
5670 \end_layout
5671
5672 \end_inset
5673
5674  (commonly, 
5675 \begin_inset Flex CharStyle:Code
5676 status collapsed
5677
5678 \begin_layout Plain Layout
5679 /usr/share/texmf/
5680 \end_layout
5681
5682 \end_inset
5683
5684 .) For example, latex packages should go under 
5685 \begin_inset Flex CharStyle:Code
5686 status collapsed
5687
5688 \begin_layout Plain Layout
5689 $TEXMFLOCAL/tex/latex/
5690 \end_layout
5691
5692 \end_inset
5693
5694  or 
5695 \begin_inset Flex CharStyle:Code
5696 status collapsed
5697
5698 \begin_layout Plain Layout
5699 $TEXMFHOME/tex/latex/
5700 \end_layout
5701
5702 \end_inset
5703
5704 .
5705  If you do not put them here, they probably will not work.
5706 \end_layout
5707
5708 \begin_layout Enumerate
5709 Once your tree is properly set up, you can install the package into an appropria
5710 te location.
5711  If you are lucky, your package will have been provided as a so-called `TDS'
5712  (TeX Directory Structure) zip file.
5713  To install it, you want to unzip it from the top of your tree.
5714  So, for example, you can copy the file 
5715 \begin_inset Flex CharStyle:Code
5716 status collapsed
5717
5718 \begin_layout Plain Layout
5719 newpkg.zip
5720 \end_layout
5721
5722 \end_inset
5723
5724  to 
5725 \begin_inset Flex CharStyle:Code
5726 status collapsed
5727
5728 \begin_layout Plain Layout
5729 /home/yourname/texmf/
5730 \end_layout
5731
5732 \end_inset
5733
5734  and then, from inside that directory, just run: 
5735 \begin_inset Flex CharStyle:Code
5736 status collapsed
5737
5738 \begin_layout Plain Layout
5739 unzip newpkg.zip
5740 \end_layout
5741
5742 \end_inset
5743
5744 .
5745  This will extract the needed files and copy them where they need to be.
5746 \begin_inset Newline newline
5747 \end_inset
5748
5749 If you do not have a TDS file, then you have to do this manually.
5750  For example, you might install the FoilTeX files into 
5751 \begin_inset Flex URL
5752 status collapsed
5753
5754 \begin_layout Plain Layout
5755
5756 $TEXMFLOCAL/tex/latex/contrib/foiltex
5757 \end_layout
5758
5759 \end_inset
5760
5761 .
5762  Why there? The CTAN download directories are themselves organized much
5763  like a TeX tree, and it isn't a bad idea to follow its structure when you
5764  install your own files.
5765  FoilTeX, as it happens, is found at 
5766 \begin_inset Flex URL
5767 status collapsed
5768
5769 \begin_layout Plain Layout
5770
5771 http://ctan.org/texarchive/macros/latex/contrib/foiltex/
5772 \end_layout
5773
5774 \end_inset
5775
5776 .
5777  
5778 \end_layout
5779
5780 \begin_layout Enumerate
5781 Finally, you must update the database TeX uses to find files.
5782  On MiKTeX, this is done by pressing the button 
5783 \family sans
5784 Refresh
5785 \begin_inset space ~
5786 \end_inset
5787
5788 FNDB
5789 \family default
5790  that you find in MiKTeX's 
5791 \begin_inset Quotes eld
5792 \end_inset
5793
5794 Settings
5795 \begin_inset Quotes erd
5796 \end_inset
5797
5798  program.
5799  
5800 \begin_inset Flex CharStyle:Code
5801 status collapsed
5802
5803 \begin_layout Plain Layout
5804 $TEXMFLOCAL/tex/latex/
5805 \end_layout
5806
5807 \end_inset
5808
5809 .
5810  Under TeXLive and the like, you should run 
5811 \begin_inset Flex CharStyle:Code
5812 status collapsed
5813
5814 \begin_layout Plain Layout
5815 texhash
5816 \end_layout
5817
5818 \end_inset
5819
5820  from a terminal, with root permissions if necessary.
5821  
5822 \end_layout
5823
5824 \begin_layout Standard
5825 Your package is now installed and available to LaTeX.
5826  You can verify this from a terminal by typing `
5827 \begin_inset Flex CharStyle:Code
5828 status collapsed
5829
5830 \begin_layout Plain Layout
5831 kpsewhich yourfile.ext
5832 \end_layout
5833
5834 \end_inset
5835
5836 '.
5837  To make LyX aware of it, however, you will need to reconfigure (
5838 \begin_inset Flex CharStyle:MenuItem
5839 status collapsed
5840
5841 \begin_layout Plain Layout
5842 Tools\SpecialChar \menuseparator
5843 Reconfigure
5844 \end_layout
5845
5846 \end_inset
5847
5848 ) and then restart LyX.
5849  If the new package was a document class, such as FoilTeX again, you will
5850  now see it available under 
5851 \begin_inset Flex CharStyle:MenuItem
5852 status collapsed
5853
5854 \begin_layout Plain Layout
5855 Document\SpecialChar \menuseparator
5856 Settings\SpecialChar \menuseparator
5857 Document Class
5858 \end_layout
5859
5860 \end_inset
5861
5862 , in this case as 
5863 \begin_inset Flex CharStyle:MenuItem
5864 status collapsed
5865
5866 \begin_layout Plain Layout
5867 slides (FoilTeX)
5868 \end_layout
5869
5870 \end_inset
5871
5872 .
5873 \end_layout
5874
5875 \begin_layout Standard
5876 What if there isn't a layout file is available for your new document class?
5877  Then, unfortunately, LyX will know nothing about it until you create a
5878  layout file yourself (or get someone else to do it).
5879  That is the topic of the next section.
5880 \end_layout
5881
5882 \begin_layout Section
5883 Types of layout files
5884 \end_layout
5885
5886 \begin_layout Standard
5887 This section describes the various sorts of LyX files that contain layout
5888  information.
5889  These files describe various paragraph and character styles, determining
5890  how LyX should display them and how they should be translated into LaTeX,
5891  DocBook, XHTML, or whatever output format is being used.
5892  
5893 \end_layout
5894
5895 \begin_layout Standard
5896 We shall try to provide a thorough description of the process of writing
5897  layout files here.
5898  However, there are so many different types of documents supported even
5899  by just LaTeX that we can't hope to cover every different possibility or
5900  problem you might encounter.
5901  The LyX users' list is frequented by people with lots of experience with
5902  layout design who are willing to share what they've learned, so please
5903  feel free to ask questions there.
5904 \end_layout
5905
5906 \begin_layout Standard
5907 As you prepare to write a new layout, it is extremely helpful to look at
5908  the layouts distributed with LyX.
5909  If you write a LyX layout for a LaTeX document class that might also be
5910  used by others, or write a module that might be useful to others, then
5911  you should consider posting your layout to the 
5912 \begin_inset CommandInset href
5913 LatexCommand href
5914 name "layout section on the LyX wiki"
5915 target "http://wiki.lyx.org/Layouts/Layouts"
5916
5917 \end_inset
5918
5919  or even to the LyX developers' list, so that it might be included in LyX
5920  itself.
5921 \begin_inset Foot
5922 status collapsed
5923
5924 \begin_layout Plain Layout
5925 Note that LyX is licensed under the General Public License, so any material
5926  that is contribued to LyX must be similarly licensed.
5927 \end_layout
5928
5929 \end_inset
5930
5931
5932 \end_layout
5933
5934 \begin_layout Subsection
5935 Layout modules
5936 \begin_inset CommandInset label
5937 LatexCommand label
5938 name "sub:Layout-modules"
5939
5940 \end_inset
5941
5942
5943 \end_layout
5944
5945 \begin_layout Standard
5946 We have spoken to this point about `layout files'.
5947  But there are different sorts of files that contain layout information.
5948  Layout files, strictly so called, have the 
5949 \begin_inset Flex CharStyle:Code
5950 status collapsed
5951
5952 \begin_layout Plain Layout
5953 .layout
5954 \end_layout
5955
5956 \end_inset
5957
5958  extension and provide LyX with information about document classes.
5959  As of LyX 1.6, however, layout information can also be contained in layout
5960  
5961 \emph on
5962 modules
5963 \emph default
5964 , which have the 
5965 \begin_inset Flex CharStyle:Code
5966 status collapsed
5967
5968 \begin_layout Plain Layout
5969 .module
5970 \end_layout
5971
5972 \end_inset
5973
5974  extension.
5975  Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5976  some modules—such as the 
5977 \begin_inset Flex CharStyle:Code
5978 status collapsed
5979
5980 \begin_layout Plain Layout
5981 endnotes
5982 \end_layout
5983
5984 \end_inset
5985
5986  module—specifcally provide support for one package.
5987  In a sense, layout modules are similar to included
5988 \begin_inset Foot
5989 status collapsed
5990
5991 \begin_layout Plain Layout
5992 These can have any extension, but by convention have the 
5993 \begin_inset Flex CharStyle:Code
5994 status collapsed
5995
5996 \begin_layout Plain Layout
5997 .inc
5998 \end_layout
5999
6000 \end_inset
6001
6002  extension.
6003 \end_layout
6004
6005 \end_inset
6006
6007  files—files like 
6008 \begin_inset Flex CharStyle:Code
6009 status collapsed
6010
6011 \begin_layout Plain Layout
6012 stdsections.inc
6013 \end_layout
6014
6015 \end_inset
6016
6017 —in that modules are not specific to a given document class but may be used
6018  with many different classes.
6019  The difference is that using an included file with 
6020 \begin_inset Flex CharStyle:Code
6021 status collapsed
6022
6023 \begin_layout Plain Layout
6024 article.cls
6025 \end_layout
6026
6027 \end_inset
6028
6029  requires editing that file.
6030  Modules, by contrast, are selected in the 
6031 \begin_inset Flex CharStyle:MenuItem
6032 status collapsed
6033
6034 \begin_layout Plain Layout
6035 Document\SpecialChar \menuseparator
6036 Settings
6037 \end_layout
6038
6039 \end_inset
6040
6041  dialog.
6042 \end_layout
6043
6044 \begin_layout Standard
6045 Building modules is the easiest way to get started with layout editing,
6046  since it can be as simple as adding a single new paragraph style or flex
6047  inset.
6048  But modules may, in principle, contain anything a layout file can contain.
6049 \end_layout
6050
6051 \begin_layout Standard
6052 After creating a new module and copying it to the 
6053 \begin_inset Flex CharStyle:Code
6054 status collapsed
6055
6056 \begin_layout Plain Layout
6057 layout/
6058 \end_layout
6059
6060 \end_inset
6061
6062  folder, you will need to reconfigure and then restart LyX for the module
6063  to appear in the menu.
6064  However, changes you make to the module will be seen immediately, if you
6065  open 
6066 \begin_inset Flex CharStyle:MenuItem
6067 status collapsed
6068
6069 \begin_layout Plain Layout
6070 Document\SpecialChar \menuseparator
6071 Settings
6072 \end_layout
6073
6074 \end_inset
6075
6076 , highlight something, and then hit 
6077 \begin_inset Quotes eld
6078 \end_inset
6079
6080 OK
6081 \begin_inset Quotes erd
6082 \end_inset
6083
6084 .
6085  
6086 \emph on
6087 It is strongly recommended that you save your work before doing this
6088 \emph default
6089 .
6090  In fact, 
6091 \emph on
6092 it is strongly recommended that you not attempt to edit modules while simultaneo
6093 usly working on actual documents
6094 \emph default
6095 .
6096  Though of course the developers strive to keep LyX stable in such situations,
6097  syntax errors and the like in your module file could cause strange behavior.
6098 \end_layout
6099
6100 \begin_layout Subsection
6101 Layout for 
6102 \begin_inset Flex CharStyle:MenuItem
6103 status collapsed
6104
6105 \begin_layout Plain Layout
6106 .sty
6107 \end_layout
6108
6109 \end_inset
6110
6111  files
6112 \end_layout
6113
6114 \begin_layout Standard
6115 There are two situations you are likely to encounter when wanting to support
6116  a new LaTeX document class, involving LaTeX2e class (
6117 \begin_inset Flex CharStyle:Code
6118 status collapsed
6119
6120 \begin_layout Plain Layout
6121 .cls
6122 \end_layout
6123
6124 \end_inset
6125
6126 ) and style (
6127 \begin_inset Flex CharStyle:Code
6128 status collapsed
6129
6130 \begin_layout Plain Layout
6131 .sty
6132 \end_layout
6133
6134 \end_inset
6135
6136 ) files.
6137  Supporting a style file is usually fairly easy.
6138  Supporting a new class file is a bit harder.
6139  We'll discuss the former in this section and the latter in the next.
6140  Similar remarks apply, of course, if you want to support a new DocBook
6141  DTD.
6142 \end_layout
6143
6144 \begin_layout Standard
6145 The easier case is the one in which your new document class is provided
6146  as a style file that is to be used in conjunction with an already supported
6147  document class.
6148  For the sake of the example, we'll assume that the style file is called
6149  
6150 \begin_inset Flex CharStyle:MenuItem
6151 status collapsed
6152
6153 \begin_layout Plain Layout
6154 myclass.sty
6155 \end_layout
6156
6157 \end_inset
6158
6159  and that it is meant to be used with 
6160 \begin_inset Flex CharStyle:MenuItem
6161 status collapsed
6162
6163 \begin_layout Plain Layout
6164 report.cls
6165 \end_layout
6166
6167 \end_inset
6168
6169 , which is a standard class.
6170  
6171 \end_layout
6172
6173 \begin_layout Standard
6174 Start by copying the existing class's layout file into your local directory:
6175 \begin_inset Foot
6176 status collapsed
6177
6178 \begin_layout Plain Layout
6179 Of course, which directory is your local directory will vary by platform,
6180  and LyX allows you to specify your local directory on startup, too, using
6181  the 
6182 \begin_inset Flex CharStyle:Code
6183 status collapsed
6184
6185 \begin_layout Plain Layout
6186 -userdir
6187 \end_layout
6188
6189 \end_inset
6190
6191  option.
6192 \end_layout
6193
6194 \end_inset
6195
6196
6197 \end_layout
6198
6199 \begin_layout LyX-Code
6200 cp report.layout ~/.lyx/layouts/myclass.layout
6201 \end_layout
6202
6203 \begin_layout Standard
6204 Then edit 
6205 \begin_inset Flex CharStyle:Code
6206 status collapsed
6207
6208 \begin_layout Plain Layout
6209 myclass.layout
6210 \end_layout
6211
6212 \end_inset
6213
6214  and change the line: 
6215 \end_layout
6216
6217 \begin_layout LyX-Code
6218
6219 \backslash
6220 DeclareLaTeXClass{report}
6221 \end_layout
6222
6223 \begin_layout Standard
6224 to read
6225 \end_layout
6226
6227 \begin_layout LyX-Code
6228
6229 \backslash
6230 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6231 \end_layout
6232
6233 \begin_layout Standard
6234 Then add:
6235 \end_layout
6236
6237 \begin_layout LyX-Code
6238 Preamble 
6239 \begin_inset Newline newline
6240 \end_inset
6241
6242     
6243 \backslash
6244 usepackage{myclass}
6245 \begin_inset Newline newline
6246 \end_inset
6247
6248 EndPreamble
6249 \end_layout
6250
6251 \begin_layout Standard
6252 near the top of the file.
6253 \end_layout
6254
6255 \begin_layout Standard
6256 Start LyX and select 
6257 \begin_inset Flex CharStyle:MenuItem
6258 status collapsed
6259
6260 \begin_layout Plain Layout
6261 Tools\SpecialChar \menuseparator
6262 Reconfigure
6263 \end_layout
6264
6265 \end_inset
6266
6267 .
6268  Then restart LyX and try creating a new document.
6269  You should see "
6270 \begin_inset Flex CharStyle:MenuItem
6271 status collapsed
6272
6273 \begin_layout Plain Layout
6274 report (myclass)
6275 \end_layout
6276
6277 \end_inset
6278
6279 " as a document class option in the 
6280 \begin_inset Flex CharStyle:MenuItem
6281 status collapsed
6282
6283 \begin_layout Plain Layout
6284 Document\SpecialChar \menuseparator
6285 Settings
6286 \end_layout
6287
6288 \end_inset
6289
6290  dialog.
6291  It is likely that some of the sectioning commands and such in your new
6292  class will work differently from how they worked in the base class—
6293 \begin_inset Flex CharStyle:Code
6294 status collapsed
6295
6296 \begin_layout Plain Layout
6297 report
6298 \end_layout
6299
6300 \end_inset
6301
6302  in this example—so you can fiddle around with the settings for the different
6303  sections if you wish.
6304  The layout information for sections is contained in 
6305 \begin_inset Flex CharStyle:Code
6306 status collapsed
6307
6308 \begin_layout Plain Layout
6309 stdsections.inc
6310 \end_layout
6311
6312 \end_inset
6313
6314 , but you do not need to copy and change this file.
6315  Instead, you can simply add your changes to your layout file, after the
6316  line 
6317 \begin_inset Flex CharStyle:Code
6318 status collapsed
6319
6320 \begin_layout Plain Layout
6321 Input stdclass.inc
6322 \end_layout
6323
6324 \end_inset
6325
6326 , which itself includes 
6327 \begin_inset Flex CharStyle:Code
6328 status collapsed
6329
6330 \begin_layout Plain Layout
6331 stdsections.inc
6332 \end_layout
6333
6334 \end_inset
6335
6336 .
6337  For example, you might add these lines:
6338 \end_layout
6339
6340 \begin_layout LyX-Code
6341 Style Chapter
6342 \end_layout
6343
6344 \begin_layout LyX-Code
6345     Font
6346 \end_layout
6347
6348 \begin_layout LyX-Code
6349         Family Sans
6350 \end_layout
6351
6352 \begin_layout LyX-Code
6353     EndFont
6354 \end_layout
6355
6356 \begin_layout LyX-Code
6357 End
6358 \end_layout
6359
6360 \begin_layout Standard
6361 to change the font for chapter headings to sans-serif.
6362  This will override (or, in this case, add to) the existing declaration
6363  for the Chapter style.
6364  
6365 \end_layout
6366
6367 \begin_layout Standard
6368 Your new package may also provide commands or environments not present in
6369  the base class.
6370  In this case, you will want to add these to the layout file.
6371  See 
6372 \begin_inset CommandInset ref
6373 LatexCommand ref
6374 reference "sec:TextClass"
6375
6376 \end_inset
6377
6378  for information on how to do so.
6379 \end_layout
6380
6381 \begin_layout Standard
6382 If 
6383 \begin_inset Flex CharStyle:MenuItem
6384 status collapsed
6385
6386 \begin_layout Plain Layout
6387 myclass.sty
6388 \end_layout
6389
6390 \end_inset
6391
6392  can be used with several different document classes, and even if it cannot,
6393  you might find it easiest just to write a module that you can load with
6394  the base class.
6395  The simplest possible such module would be:
6396 \end_layout
6397
6398 \begin_layout LyX-Code
6399 #
6400 \backslash
6401 DeclareLyXModule{My Package} 
6402 \end_layout
6403
6404 \begin_layout LyX-Code
6405 #DescriptionBegin 
6406 \end_layout
6407
6408 \begin_layout LyX-Code
6409 #Support for mypkg.sty.
6410 \end_layout
6411
6412 \begin_layout LyX-Code
6413 #DescriptionEnd 
6414 \begin_inset Newline newline
6415 \end_inset
6416
6417
6418 \end_layout
6419
6420 \begin_layout LyX-Code
6421 Format 21
6422 \begin_inset Newline newline
6423 \end_inset
6424
6425
6426 \end_layout
6427
6428 \begin_layout LyX-Code
6429 Preamble
6430 \begin_inset Newline newline
6431 \end_inset
6432
6433     
6434 \backslash
6435 usepackage{mypkg}
6436 \begin_inset Newline newline
6437 \end_inset
6438
6439 EndPreamble
6440 \end_layout
6441
6442 \begin_layout Standard
6443 A more complex module might modify the behavior of some existing constructs
6444  or define some new ones.
6445  Again, see 
6446 \begin_inset CommandInset ref
6447 LatexCommand ref
6448 reference "sec:TextClass"
6449
6450 \end_inset
6451
6452  for discussion.
6453 \end_layout
6454
6455 \begin_layout Subsection
6456 Layout for 
6457 \begin_inset Flex CharStyle:MenuItem
6458 status collapsed
6459
6460 \begin_layout Plain Layout
6461 .cls
6462 \end_layout
6463
6464 \end_inset
6465
6466  files
6467 \end_layout
6468
6469 \begin_layout Standard
6470 There are two possibilities here.
6471  One is that the class file is itself based upon an existing document class.
6472  For example, many thesis classes are based upon 
6473 \begin_inset Flex CharStyle:MenuItem
6474 status collapsed
6475
6476 \begin_layout Plain Layout
6477 book.cls
6478 \end_layout
6479
6480 \end_inset
6481
6482 .
6483  To see whether yours is, look for a line like
6484 \end_layout
6485
6486 \begin_layout LyX-Code
6487
6488 \backslash
6489 LoadClass{book}
6490 \end_layout
6491
6492 \begin_layout Standard
6493 in the file.
6494  If so, then you may proceed largely as in the previous section, though
6495  the 
6496 \begin_inset Flex CharStyle:Code
6497 status collapsed
6498
6499 \begin_layout Plain Layout
6500 DeclareLaTeXClass
6501 \end_layout
6502
6503 \end_inset
6504
6505  line will be different.
6506  If your new class is 
6507 \begin_inset Flex CharStyle:Code
6508 status collapsed
6509
6510 \begin_layout Plain Layout
6511 thesis
6512 \end_layout
6513
6514 \end_inset
6515
6516  and it is based upon 
6517 \begin_inset Flex CharStyle:Code
6518 status collapsed
6519
6520 \begin_layout Plain Layout
6521 book
6522 \end_layout
6523
6524 \end_inset
6525
6526 , then the line should read:
6527 \begin_inset Foot
6528 status collapsed
6529
6530 \begin_layout Plain Layout
6531 And it will be easiest if you save the file to 
6532 \begin_inset Flex CharStyle:Code
6533 status collapsed
6534
6535 \begin_layout Plain Layout
6536 thesis.layout
6537 \end_layout
6538
6539 \end_inset
6540
6541 : LyX assumes that the document class has the same name as the layout file.
6542  
6543 \end_layout
6544
6545 \end_inset
6546
6547
6548 \end_layout
6549
6550 \begin_layout LyX-Code
6551
6552 \backslash
6553 DeclareLaTeXClass[thesis,book]{thesis}
6554 \end_layout
6555
6556 \begin_layout Standard
6557 If, on the other hand, the new class is not based upon an existing class,
6558  you will probably have to 
6559 \begin_inset Quotes eld
6560 \end_inset
6561
6562 roll your own
6563 \begin_inset Quotes erd
6564 \end_inset
6565
6566  layout.
6567  We strongly suggest copying an existing layout file which uses a similar
6568  LaTeX class and then modifying it, if you can do so.
6569  At least use an existing file as a starting point so you can find out what
6570  items you need to worry about.
6571  Again, the specifics are covered below.
6572 \end_layout
6573
6574 \begin_layout Subsection
6575 Creating templates
6576 \begin_inset CommandInset label
6577 LatexCommand label
6578 name "sub:Creating-Templates"
6579
6580 \end_inset
6581
6582
6583 \end_layout
6584
6585 \begin_layout Standard
6586 Once you have written a layout file for a new document class, you might
6587  want to consider writing a 
6588 \emph on
6589 template
6590 \emph default
6591  for it, too.
6592  A template acts as a kind of tutorial for your layout, showing how it might
6593  be used, though containing dummy content.
6594  You can of course look at the various templates included with LyX for ideas.
6595 \end_layout
6596
6597 \begin_layout Standard
6598 Templates are created just like usual documents: using LyX.
6599  The only difference is that usual documents contain all possible settings,
6600  including the font scheme and the paper size.
6601  Usually a user doesn't want a template to overwrite his preferred settings
6602  for such parameters.
6603  For that reason, the designer of a template should remove the corresponding
6604  commands like 
6605 \begin_inset Flex CharStyle:Code
6606 status collapsed
6607
6608 \begin_layout Plain Layout
6609
6610 \backslash
6611 font_roman
6612 \end_layout
6613
6614 \end_inset
6615
6616  or 
6617 \begin_inset Flex CharStyle:Code
6618 status collapsed
6619
6620 \begin_layout Plain Layout
6621
6622 \backslash
6623 papersize
6624 \end_layout
6625
6626 \end_inset
6627
6628  from the template LyX file.
6629  This can be done with any simple text-editor, for example 
6630 \begin_inset Flex CharStyle:Code
6631 status collapsed
6632
6633 \begin_layout Plain Layout
6634 vi
6635 \end_layout
6636
6637 \end_inset
6638
6639  or 
6640 \begin_inset Flex CharStyle:Code
6641 status collapsed
6642
6643 \begin_layout Plain Layout
6644 notepad
6645 \end_layout
6646
6647 \end_inset
6648
6649 .
6650  
6651 \end_layout
6652
6653 \begin_layout Standard
6654 Put the edited template files you create in 
6655 \begin_inset Flex CharStyle:Code
6656 status collapsed
6657
6658 \begin_layout Plain Layout
6659 UserDir/templates/
6660 \end_layout
6661
6662 \end_inset
6663
6664 , copy the ones you use from the global template directory in 
6665 \begin_inset Flex CharStyle:Code
6666 status collapsed
6667
6668 \begin_layout Plain Layout
6669 LyXDir/templates/
6670 \end_layout
6671
6672 \end_inset
6673
6674  to the same place, and redefine the template path in the 
6675 \begin_inset Flex CharStyle:MenuItem
6676 status collapsed
6677
6678 \begin_layout Plain Layout
6679 Tools\SpecialChar \menuseparator
6680 Preferences\SpecialChar \menuseparator
6681 Paths
6682 \end_layout
6683
6684 \end_inset
6685
6686  dialog.
6687 \end_layout
6688
6689 \begin_layout Standard
6690 Note, by the way, that there is a template which has a particular meaning:
6691  
6692 \begin_inset Flex CharStyle:Code
6693 status collapsed
6694
6695 \begin_layout Plain Layout
6696 defaults.lyx
6697 \end_layout
6698
6699 \end_inset
6700
6701 .
6702  This template is loaded every time you create a new document with 
6703 \begin_inset Flex CharStyle:MenuItem
6704 status collapsed
6705
6706 \begin_layout Plain Layout
6707 File\SpecialChar \menuseparator
6708 New
6709 \end_layout
6710
6711 \end_inset
6712
6713  in order to provide useful defaults.
6714  To create this template from inside LyX, all you have to do is to open
6715  a document with the correct settings, and use the 
6716 \begin_inset Flex CharStyle:MenuItem
6717 status collapsed
6718
6719 \begin_layout Plain Layout
6720 Save as Document Defaults
6721 \end_layout
6722
6723 \end_inset
6724
6725  button.
6726 \end_layout
6727
6728 \begin_layout Subsection
6729 Upgrading old layout files
6730 \end_layout
6731
6732 \begin_layout Standard
6733 The format of layout files changes with each LyX release, so old layout
6734  files need to be converted to the new format.
6735  This process has been automated since LyX 1.4: If LyX reads a layout file
6736  in an older format, it automatically calls the script 
6737 \begin_inset Flex CharStyle:Code
6738 status collapsed
6739
6740 \begin_layout Plain Layout
6741 layout2layout.py
6742 \end_layout
6743
6744 \end_inset
6745
6746  to convert it to a temporary file in current format.
6747  The original file is left untouched.
6748  If you use the layout file often, then, you may want to convert it permanently,
6749  so that LyX does not have to do so itself every time.
6750  To do this, you can call the converter manually:
6751 \end_layout
6752
6753 \begin_layout LyX-Code
6754 mv myclass.layout myclass.old
6755 \end_layout
6756
6757 \begin_layout LyX-Code
6758 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6759 \end_layout
6760
6761 \begin_layout Standard
6762 You need to replace 
6763 \begin_inset Flex CharStyle:Code
6764 status collapsed
6765
6766 \begin_layout Plain Layout
6767 LyXDir
6768 \end_layout
6769
6770 \end_inset
6771
6772  with the name of your LyX system directory, of course.
6773 \end_layout
6774
6775 \begin_layout Standard
6776 Note that manual conversion does not affect included files, so these will
6777  have to be converted separately.
6778 \end_layout
6779
6780 \begin_layout Section
6781 \begin_inset CommandInset label
6782 LatexCommand label
6783 name "sec:TextClass"
6784
6785 \end_inset
6786
6787 The layout file format
6788 \end_layout
6789
6790 \begin_layout Standard
6791 When it's finally time to get your hands dirty and create or edit your own
6792  layout file, the following sections describe what you're up against.
6793  Our advice is to go slowly, save and test often, listen to soothing music,
6794  and enjoy one or two of your favorite adult beverages; more if you are
6795  getting particularly stuck.
6796  It's really not that hard, except that the multitude of options can become
6797  overwhelming if you try to do too much in one sitting.
6798  Go have another adult beverage, just for good measure.
6799 \end_layout
6800
6801 \begin_layout Standard
6802 Note that all the tags used in layout files are case-insensitive.
6803  This means that 
6804 \begin_inset Flex CharStyle:Code
6805 status collapsed
6806
6807 \begin_layout Plain Layout
6808 Style
6809 \end_layout
6810
6811 \end_inset
6812
6813
6814 \begin_inset Flex CharStyle:Code
6815 status collapsed
6816
6817 \begin_layout Plain Layout
6818 style
6819 \end_layout
6820
6821 \end_inset
6822
6823  and 
6824 \begin_inset Flex CharStyle:Code
6825 status collapsed
6826
6827 \begin_layout Plain Layout
6828 StYlE
6829 \end_layout
6830
6831 \end_inset
6832
6833  are really the same tag.
6834  The possible values are printed in brackets after the feature's name.
6835  The default value if a feature isn't specified inside a text class-description
6836  is typeset 
6837 \begin_inset Flex CharStyle:Code
6838 status collapsed
6839
6840 \begin_layout Plain Layout
6841
6842 \emph on
6843 emphasized
6844 \end_layout
6845
6846 \end_inset
6847
6848 .
6849  If the argument has a data type like 
6850 \begin_inset Quotes eld
6851 \end_inset
6852
6853 string
6854 \begin_inset Quotes erd
6855 \end_inset
6856
6857  or 
6858 \begin_inset Quotes eld
6859 \end_inset
6860
6861 float
6862 \begin_inset Quotes erd
6863 \end_inset
6864
6865 , the default is shown like this: 
6866 \begin_inset Flex CharStyle:Code
6867 status collapsed
6868
6869 \begin_layout Plain Layout
6870 float=
6871 \emph on
6872 default
6873 \end_layout
6874
6875 \end_inset
6876
6877 .
6878 \end_layout
6879
6880 \begin_layout Subsection
6881 The document class declaration
6882 \end_layout
6883
6884 \begin_layout Standard
6885 Lines in a layout file which begin with 
6886 \begin_inset Flex CharStyle:Code
6887 status collapsed
6888
6889 \begin_layout Plain Layout
6890 #
6891 \end_layout
6892
6893 \end_inset
6894
6895  are comments.
6896  There is one exception to this rule.
6897  All 
6898 \begin_inset Flex CharStyle:Code
6899 status collapsed
6900
6901 \begin_layout Plain Layout
6902 *.layout
6903 \end_layout
6904
6905 \end_inset
6906
6907  files should begin with a line like:
6908 \end_layout
6909
6910 \begin_layout LyX-Code
6911
6912 \size small
6913 #% Do not delete the line below; configure depends on this 
6914 \end_layout
6915
6916 \begin_layout LyX-Code
6917
6918 \size small
6919 #  
6920 \backslash
6921 DeclareLaTeXClass{article}
6922 \end_layout
6923
6924 \begin_layout Standard
6925 The second line is used when you (re)configure LyX.
6926  The layout file is read by the LaTeX script 
6927 \begin_inset Flex CharStyle:Code
6928 status collapsed
6929
6930 \begin_layout Plain Layout
6931 chkconfig.ltx
6932 \end_layout
6933
6934 \end_inset
6935
6936 , in a special mode where 
6937 \begin_inset Flex CharStyle:Code
6938 status collapsed
6939
6940 \begin_layout Plain Layout
6941 #
6942 \end_layout
6943
6944 \end_inset
6945
6946  is ignored.
6947  The first line is just a LaTeX comment, and the second one contains the
6948  declaration of the text class.
6949  If these lines appear in a file named 
6950 \begin_inset Flex CharStyle:Code
6951 status collapsed
6952
6953 \begin_layout Plain Layout
6954 article.layout
6955 \end_layout
6956
6957 \end_inset
6958
6959 , then they define a text class of name 
6960 \begin_inset Flex CharStyle:Code
6961 status collapsed
6962
6963 \begin_layout Plain Layout
6964 article
6965 \end_layout
6966
6967 \end_inset
6968
6969  (the name of the layout file) which uses the LaTeX document class 
6970 \begin_inset Flex CharStyle:Code
6971 status collapsed
6972
6973 \begin_layout Plain Layout
6974 article.cls
6975 \end_layout
6976
6977 \end_inset
6978
6979  (the default is to use the same name as the layout).
6980  The string 
6981 \begin_inset Quotes eld
6982 \end_inset
6983
6984 article
6985 \begin_inset Quotes erd
6986 \end_inset
6987
6988  that appears above is used as a description of the text class in the 
6989 \begin_inset Flex CharStyle:MenuItem
6990 status collapsed
6991
6992 \begin_layout Plain Layout
6993 Document\SpecialChar \menuseparator
6994 Settings
6995 \end_layout
6996
6997 \end_inset
6998
6999  dialog.
7000 \end_layout
7001
7002 \begin_layout Standard
7003 Let's assume that you wrote your own text class that uses the 
7004 \begin_inset Flex CharStyle:Code
7005 status collapsed
7006
7007 \begin_layout Plain Layout
7008 article.cls
7009 \end_layout
7010
7011 \end_inset
7012
7013  document class, but where you changed the appearance of the section headings.
7014  If you put it in a file 
7015 \begin_inset Flex CharStyle:Code
7016 status collapsed
7017
7018 \begin_layout Plain Layout
7019 myarticle.layout
7020 \end_layout
7021
7022 \end_inset
7023
7024 , the header of this file should be:
7025 \end_layout
7026
7027 \begin_layout LyX-Code
7028
7029 \size small
7030 #% Do not delete the line below; configure depends on this 
7031 \end_layout
7032
7033 \begin_layout LyX-Code
7034
7035 \size small
7036 #  
7037 \backslash
7038 DeclareLaTeXClass[article]{article (with my own headings)}
7039 \end_layout
7040
7041 \begin_layout Standard
7042 This declares a text class 
7043 \begin_inset Flex CharStyle:Code
7044 status collapsed
7045
7046 \begin_layout Plain Layout
7047 myarticle
7048 \end_layout
7049
7050 \end_inset
7051
7052 , associated with the LaTeX document class 
7053 \begin_inset Flex CharStyle:Code
7054 status collapsed
7055
7056 \begin_layout Plain Layout
7057 article.cls
7058 \end_layout
7059
7060 \end_inset
7061
7062  and described as 
7063 \begin_inset Quotes eld
7064 \end_inset
7065
7066 article (with my own headings)
7067 \begin_inset Quotes erd
7068 \end_inset
7069
7070 .
7071  If your text class depends on several packages, you can declare it as:
7072 \end_layout
7073
7074 \begin_layout LyX-Code
7075
7076 \size small
7077 #% Do not delete the line below; configure depends on this 
7078 \end_layout
7079
7080 \begin_layout LyX-Code
7081
7082 \size small
7083 #  
7084 \backslash
7085 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7086 \end_layout
7087
7088 \begin_layout Standard
7089 This indicates that your text class uses the 
7090 \begin_inset Flex CharStyle:Code
7091 status collapsed
7092
7093 \begin_layout Plain Layout
7094 foo.sty
7095 \end_layout
7096
7097 \end_inset
7098
7099  package.
7100  Finally, it is also possible to declare classes for DocBook code.
7101  Typical declarations will look like:
7102 \end_layout
7103
7104 \begin_layout LyX-Code
7105
7106 \size small
7107 #% Do not delete the line below; configure depends on this 
7108 \end_layout
7109
7110 \begin_layout LyX-Code
7111
7112 \size small
7113
7114 \backslash
7115 DeclareDocBookClass[article]{SGML (DocBook article)}
7116 \end_layout
7117
7118 \begin_layout Standard
7119 Note that these declarations can also be given an optional parameter declaring
7120  the name of the document class (but not a list).
7121 \end_layout
7122
7123 \begin_layout Standard
7124 So, to be as explicit as possible, the form of the layout declaration is:
7125 \end_layout
7126
7127 \begin_layout LyX-Code
7128
7129 \size small
7130 #  
7131 \backslash
7132 DeclareLaTeXClass[class,package.sty]{layout description}
7133 \end_layout
7134
7135 \begin_layout Standard
7136 The class need only be specified if the name of the LaTeX class file and
7137  the name of the layout file are different; if the name of the class file
7138  is not specified, then LyX will simply assume that it is the same as the
7139  name of the layout file.
7140 \end_layout
7141
7142 \begin_layout Standard
7143 When the text class has been modified to your taste, all you have to do
7144  is to copy it either to 
7145 \begin_inset Flex CharStyle:Code
7146 status collapsed
7147
7148 \begin_layout Plain Layout
7149 LyXDir/layouts/
7150 \end_layout
7151
7152 \end_inset
7153
7154  or to 
7155 \begin_inset Flex CharStyle:Code
7156 status collapsed
7157
7158 \begin_layout Plain Layout
7159 UserDir/layouts
7160 \end_layout
7161
7162 \end_inset
7163
7164 , run 
7165 \begin_inset Flex CharStyle:MenuItem
7166 status collapsed
7167
7168 \begin_layout Plain Layout
7169 Tools\SpecialChar \menuseparator
7170 Reconfigure
7171 \end_layout
7172
7173 \end_inset
7174
7175 , exit LyX and restart.
7176  Then your new text class should be available along with the others.
7177 \end_layout
7178
7179 \begin_layout Standard
7180 Once the layout file is installed, you can edit it and see your changes
7181  without having to reconfigure or to restart LyX.
7182  
7183 \begin_inset Foot
7184 status collapsed
7185
7186 \begin_layout Plain Layout
7187 In versions of LyX prior to 1.6, this was not true.
7188  As a result, editing layout files was very time consuming, since you had
7189  constantly to restart LyX to see changes.
7190 \end_layout
7191
7192 \end_inset
7193
7194  You can force a reload of the current layout by using the LyX function
7195  
7196 \begin_inset Flex CharStyle:MenuItem
7197 status collapsed
7198
7199 \begin_layout Plain Layout
7200 layout-reload
7201 \end_layout
7202
7203 \end_inset
7204
7205 .
7206  There is no default binding for this function—though, of course, you can
7207  bind it to a key yourself.
7208  But you will normally use this function simply by entering it in the mini-buffe
7209 r.
7210  
7211 \end_layout
7212
7213 \begin_layout Standard
7214
7215 \emph on
7216 Warning
7217 \emph default
7218
7219 \begin_inset Flex CharStyle:MenuItem
7220 status collapsed
7221
7222 \begin_layout Plain Layout
7223 layout-reload
7224 \end_layout
7225
7226 \end_inset
7227
7228  is very much an `advanced feature'.
7229  It is 
7230 \emph on
7231 strongly
7232 \emph default
7233  recommended that you save your work before using this function.
7234  In fact, it is 
7235 \emph on
7236 strongly
7237 \emph default
7238  recommended that you not attempt to edit layout information while simultaneousl
7239 y working on a document that you care about.
7240  Use a test document.
7241  Syntax errors and the like in your layout file could cause peculiar behavior.
7242  In particular, such errors could cause LyX to regard the current layout
7243  as invalid and to attempt to switch to some other layout.
7244 \begin_inset Foot
7245 status collapsed
7246
7247 \begin_layout Plain Layout
7248 Really bad syntax errors may even caused LyX to exit.
7249  This is because certain sorts of errors may make LyX unable to read 
7250 \emph on
7251 any
7252 \emph default
7253  layout information.
7254  Please be careful.
7255 \end_layout
7256
7257 \end_inset
7258
7259  The LyX team strives to keep LyX stable in such situations, but safe is
7260  better than sorry.
7261 \begin_inset Foot
7262 status collapsed
7263
7264 \begin_layout Plain Layout
7265 While we're giving advice: make regular backups.
7266  And be nice to your mother.
7267 \end_layout
7268
7269 \end_inset
7270
7271
7272 \end_layout
7273
7274 \begin_layout Subsection
7275 The Module declaration
7276 \end_layout
7277
7278 \begin_layout Standard
7279 A module must begin with a line like the following:
7280 \end_layout
7281
7282 \begin_layout LyX-Code
7283 #
7284 \backslash
7285 DeclareLyXModule[endnotes.sty]{Endnotes} 
7286 \end_layout
7287
7288 \begin_layout Standard
7289 The mandatory argument, in curly brackets, is the name of the module, as
7290  it should appear in 
7291 \begin_inset Flex CharStyle:MenuItem
7292 status collapsed
7293
7294 \begin_layout Plain Layout
7295 Document\SpecialChar \menuseparator
7296 Settings
7297 \end_layout
7298
7299 \end_inset
7300
7301 .
7302  The argument in square brackets is optional: It declares any LaTeX packages
7303  on which the module depends.
7304  Please note that only packages about which LyX knows should be listed in
7305  the square brackets.
7306 \begin_inset Foot
7307 status collapsed
7308
7309 \begin_layout Plain Layout
7310 The list of such packages is documented only in the source code.
7311 \end_layout
7312
7313 \end_inset
7314
7315  LyX will not check for arbitrary packages.
7316  It is also possible to use the form 
7317 \begin_inset Flex CharStyle:MenuItem
7318 status collapsed
7319
7320 \begin_layout Plain Layout
7321 from->to
7322 \end_layout
7323
7324 \end_inset
7325
7326  as an optional argument, which declares that the module can only be used
7327  when there exists a conversion chain between the formats `
7328 \begin_inset Flex CharStyle:Code
7329 status collapsed
7330
7331 \begin_layout Plain Layout
7332 from
7333 \end_layout
7334
7335 \end_inset
7336
7337 ' and `
7338 \begin_inset Flex CharStyle:Code
7339 status collapsed
7340
7341 \begin_layout Plain Layout
7342 to
7343 \end_layout
7344
7345 \end_inset
7346
7347 '.
7348 \end_layout
7349
7350 \begin_layout Standard
7351 The module declaration should then be followed by lines like the following:
7352 \end_layout
7353
7354 \begin_layout LyX-Code
7355 #DescriptionBegin 
7356 \end_layout
7357
7358 \begin_layout LyX-Code
7359 #Adds an endnote command, in addition to footnotes.
7360  
7361 \end_layout
7362
7363 \begin_layout LyX-Code
7364 #You will need to add  
7365 \backslash
7366 theendnotes in TeX code where you 
7367 \end_layout
7368
7369 \begin_layout LyX-Code
7370 #want the endnotes to appear.
7371  
7372 \end_layout
7373
7374 \begin_layout LyX-Code
7375 #DescriptionEnd 
7376 \end_layout
7377
7378 \begin_layout LyX-Code
7379 #Requires: somemodule | othermodule
7380 \end_layout
7381
7382 \begin_layout LyX-Code
7383 #Excludes: badmodule
7384 \end_layout
7385
7386 \begin_layout Standard
7387 The description is used in 
7388 \begin_inset Flex CharStyle:MenuItem
7389 status collapsed
7390
7391 \begin_layout Plain Layout
7392 Document\SpecialChar \menuseparator
7393 Settings
7394 \end_layout
7395
7396 \end_inset
7397
7398  to provide the user with information about what the module does.
7399  The 
7400 \begin_inset Flex CharStyle:Code
7401 status collapsed
7402
7403 \begin_layout Plain Layout
7404 Requires
7405 \end_layout
7406
7407 \end_inset
7408
7409  line is used to identify other modules with which this one must be used;
7410  the 
7411 \begin_inset Flex CharStyle:Code
7412 status collapsed
7413
7414 \begin_layout Plain Layout
7415 Excludes
7416 \end_layout
7417
7418 \end_inset
7419
7420  line is used to identify modules with which this one may not be used.
7421  Both are optional, and, as shown, multiple modules should be separated
7422  with the pipe symbol: |.
7423  Note that the required modules are treated disjunctively: 
7424 \emph on
7425 at least one
7426 \emph default
7427  of the required modules must be used.
7428  Similarly, 
7429 \emph on
7430 no
7431 \emph default
7432  excluded module may be used.
7433  Note that modules are identified here by their 
7434 \emph on
7435 filenames
7436 \emph default
7437  without the 
7438 \begin_inset Flex CharStyle:Code
7439 status collapsed
7440
7441 \begin_layout Plain Layout
7442 .module
7443 \end_layout
7444
7445 \end_inset
7446
7447  extension.
7448  So 
7449 \begin_inset Flex CharStyle:Code
7450 status collapsed
7451
7452 \begin_layout Plain Layout
7453 somemodule
7454 \end_layout
7455
7456 \end_inset
7457
7458  is really 
7459 \begin_inset Flex CharStyle:Code
7460 status collapsed
7461
7462 \begin_layout Plain Layout
7463 somemodule.module
7464 \end_layout
7465
7466 \end_inset
7467
7468 .
7469 \end_layout
7470
7471 \begin_layout Subsection
7472 File format
7473 \end_layout
7474
7475 \begin_layout Standard
7476 The first non-comment line of any layout file, included file, or module
7477  
7478 \emph on
7479 must
7480 \emph default
7481  contain the file format number:
7482 \end_layout
7483
7484 \begin_layout Description
7485 \begin_inset Flex CharStyle:Code
7486 status collapsed
7487
7488 \begin_layout Plain Layout
7489 Format
7490 \end_layout
7491
7492 \end_inset
7493
7494  [
7495 \begin_inset Flex CharStyle:Code
7496 status collapsed
7497
7498 \begin_layout Plain Layout
7499 int
7500 \end_layout
7501
7502 \end_inset
7503
7504 ] The format of the layout file.
7505 \end_layout
7506
7507 \begin_layout Standard
7508 This tag was introduced with LyX 1.4.0.
7509  Layout files from LyX 1.3.x and earlier don't have an explicit file format
7510  and are considered to be of format 1.
7511  The format for the present version of LyX is format 21.
7512  But each version of LyX is capable of reading earlier versions' layout
7513  files, just as they are capable of reading files produced by earlier versions
7514  of LyX.
7515  There is, however, no provision for converting to earlier formats.
7516  So LyX 1.6.x will not read layout files in format 21 but only files in format
7517  11 or earlier.
7518 \end_layout
7519
7520 \begin_layout Subsection
7521 \begin_inset CommandInset label
7522 LatexCommand label
7523 name "sub:General-text-class"
7524
7525 \end_inset
7526
7527 General text class parameters
7528 \end_layout
7529
7530 \begin_layout Standard
7531 These are general parameters that govern the behavior of an entire document
7532  class.
7533  (This does 
7534 \emph on
7535 not
7536 \emph default
7537  mean that they must appear in 
7538 \begin_inset Flex CharStyle:Code
7539 status collapsed
7540
7541 \begin_layout Plain Layout
7542 .layout
7543 \end_layout
7544
7545 \end_inset
7546
7547  files rather than in modules.
7548  A module can contain any layout tag.)
7549 \end_layout
7550
7551 \begin_layout Description
7552 \begin_inset Flex CharStyle:Code
7553 status collapsed
7554
7555 \begin_layout Plain Layout
7556 AddToHTMLPreamble
7557 \end_layout
7558
7559 \end_inset
7560
7561  Adds information that will be output in the 
7562 \begin_inset Flex CharStyle:Code
7563 status collapsed
7564
7565 \begin_layout Plain Layout
7566 <head>
7567 \end_layout
7568
7569 \end_inset
7570
7571  block when this document class is output to XHTML.
7572  Typically, this would be used to output CSS style information, but it can
7573  be used for anything that can appear in 
7574 \begin_inset Flex CharStyle:Code
7575 status collapsed
7576
7577 \begin_layout Plain Layout
7578 <head>
7579 \end_layout
7580
7581 \end_inset
7582
7583 .
7584  Must end with 
7585 \begin_inset Quotes eld
7586 \end_inset
7587
7588
7589 \begin_inset Flex CharStyle:Code
7590 status collapsed
7591
7592 \begin_layout Plain Layout
7593 EndPreamble
7594 \end_layout
7595
7596 \end_inset
7597
7598
7599 \begin_inset Quotes erd
7600 \end_inset
7601
7602 .
7603 \end_layout
7604
7605 \begin_layout Description
7606 \begin_inset Flex CharStyle:Code
7607 status collapsed
7608
7609 \begin_layout Plain Layout
7610 AddToPreamble
7611 \end_layout
7612
7613 \end_inset
7614
7615  Adds information to the document preamble.
7616  Must end with 
7617 \begin_inset Quotes eld
7618 \end_inset
7619
7620
7621 \begin_inset Flex CharStyle:Code
7622 status collapsed
7623
7624 \begin_layout Plain Layout
7625 EndPreamble
7626 \end_layout
7627
7628 \end_inset
7629
7630
7631 \begin_inset Quotes erd
7632 \end_inset
7633
7634 .
7635 \end_layout
7636
7637 \begin_layout Description
7638 \begin_inset Flex CharStyle:Code
7639 status collapsed
7640
7641 \begin_layout Plain Layout
7642 CiteFormat
7643 \end_layout
7644
7645 \end_inset
7646
7647  Defines formats for use in the display of bibliographic information.
7648  See Section 
7649 \begin_inset CommandInset ref
7650 LatexCommand ref
7651 reference "sub:Citation-format-description"
7652
7653 \end_inset
7654
7655  for details.
7656  Must end with 
7657 \begin_inset Quotes eld
7658 \end_inset
7659
7660
7661 \begin_inset Flex CharStyle:Code
7662 status collapsed
7663
7664 \begin_layout Plain Layout
7665 End
7666 \end_layout
7667
7668 \end_inset
7669
7670
7671 \begin_inset Quotes erd
7672 \end_inset
7673
7674 .
7675 \end_layout
7676
7677 \begin_layout Description
7678 \begin_inset Flex CharStyle:Code
7679 status collapsed
7680
7681 \begin_layout Plain Layout
7682 ClassOptions
7683 \end_layout
7684
7685 \end_inset
7686
7687  Describes various global options supported by the document class.
7688  See Section
7689 \begin_inset space ~
7690 \end_inset
7691
7692
7693 \begin_inset CommandInset ref
7694 LatexCommand ref
7695 reference "sub:ClassOptions"
7696
7697 \end_inset
7698
7699  for a description.
7700  Must end with 
7701 \begin_inset Quotes eld
7702 \end_inset
7703
7704
7705 \begin_inset Flex CharStyle:Code
7706 status collapsed
7707
7708 \begin_layout Plain Layout
7709 End
7710 \end_layout
7711
7712 \end_inset
7713
7714
7715 \begin_inset Quotes erd
7716 \end_inset
7717
7718 .
7719 \end_layout
7720
7721 \begin_layout Description
7722 \begin_inset Flex CharStyle:Code
7723 status collapsed
7724
7725 \begin_layout Plain Layout
7726 Columns
7727 \end_layout
7728
7729 \end_inset
7730
7731  [
7732 \begin_inset Flex CharStyle:Code
7733 status collapsed
7734
7735 \begin_layout Plain Layout
7736
7737 \emph on
7738 1
7739 \end_layout
7740
7741 \end_inset
7742
7743
7744 \begin_inset Flex CharStyle:Code
7745 status collapsed
7746
7747 \begin_layout Plain Layout
7748 2
7749 \end_layout
7750
7751 \end_inset
7752
7753 ] Whether the class should 
7754 \emph on
7755 default
7756 \emph default
7757  to having one or two columns.
7758  Can be changed in the 
7759 \begin_inset Flex CharStyle:MenuItem
7760 status collapsed
7761
7762 \begin_layout Plain Layout
7763 Document\SpecialChar \menuseparator
7764 Settings
7765 \end_layout
7766
7767 \end_inset
7768
7769  dialog.
7770 \end_layout
7771
7772 \begin_layout Description
7773 \begin_inset Flex CharStyle:Code
7774 status collapsed
7775
7776 \begin_layout Plain Layout
7777 Counter
7778 \end_layout
7779
7780 \end_inset
7781
7782  [
7783 \begin_inset Flex CharStyle:Code
7784 status collapsed
7785
7786 \begin_layout Plain Layout
7787 string
7788 \end_layout
7789
7790 \end_inset
7791
7792 ] This sequence defines the properties for a counter.
7793  If the counter does not yet exist, it is created; if it does exist, it
7794  is modified.
7795  Must end with 
7796 \begin_inset Quotes eld
7797 \end_inset
7798
7799
7800 \begin_inset Flex CharStyle:Code
7801 status collapsed
7802
7803 \begin_layout Plain Layout
7804 End
7805 \end_layout
7806
7807 \end_inset
7808
7809
7810 \begin_inset Quotes erd
7811 \end_inset
7812
7813 .
7814 \begin_inset Newline newline
7815 \end_inset
7816
7817 See Section
7818 \begin_inset space ~
7819 \end_inset
7820
7821
7822 \begin_inset CommandInset ref
7823 LatexCommand ref
7824 reference "sub:Counters"
7825
7826 \end_inset
7827
7828  for details on counters.
7829 \end_layout
7830
7831 \begin_layout Description
7832 \begin_inset Flex CharStyle:Code
7833 status collapsed
7834
7835 \begin_layout Plain Layout
7836 DefaultFont
7837 \end_layout
7838
7839 \end_inset
7840
7841  Sets the default font used to display the document.
7842  See Section
7843 \begin_inset space ~
7844 \end_inset
7845
7846
7847 \begin_inset CommandInset ref
7848 LatexCommand ref
7849 reference "sub:Font-description"
7850
7851 \end_inset
7852
7853  for how to declare fonts.
7854  Must end with 
7855 \begin_inset Quotes eld
7856 \end_inset
7857
7858
7859 \begin_inset Flex CharStyle:Code
7860 status collapsed
7861
7862 \begin_layout Plain Layout
7863 EndFont
7864 \end_layout
7865
7866 \end_inset
7867
7868
7869 \begin_inset Quotes erd
7870 \end_inset
7871
7872 .
7873 \end_layout
7874
7875 \begin_layout Description
7876 \begin_inset Flex CharStyle:Code
7877 status collapsed
7878
7879 \begin_layout Plain Layout
7880 DefaultModule
7881 \end_layout
7882
7883 \end_inset
7884
7885  [
7886 \begin_inset Flex CharStyle:Code
7887 status collapsed
7888
7889 \begin_layout Plain Layout
7890 string]
7891 \end_layout
7892
7893 \end_inset
7894
7895  Specifies a module to be included by default with this document class.
7896  The module should be specified by filename without the 
7897 \begin_inset Flex CharStyle:Code
7898 status collapsed
7899
7900 \begin_layout Plain Layout
7901 .module
7902 \end_layout
7903
7904 \end_inset
7905
7906  extension.
7907  The user can still remove the module, but it will be active at the outset.
7908  (This applies only when new files are created, or when this class is chosen
7909  for an existing document.)
7910 \end_layout
7911
7912 \begin_layout Description
7913 \begin_inset Flex CharStyle:Code
7914 status collapsed
7915
7916 \begin_layout Plain Layout
7917 DefaultStyle
7918 \end_layout
7919
7920 \end_inset
7921
7922  [
7923 \begin_inset Flex CharStyle:Code
7924 status collapsed
7925
7926 \begin_layout Plain Layout
7927 string
7928 \end_layout
7929
7930 \end_inset
7931
7932 ] This is the style that will be assigned to new paragraphs, usually 
7933 \begin_inset Flex CharStyle:MenuItem
7934 status collapsed
7935
7936 \begin_layout Plain Layout
7937 Standard
7938 \end_layout
7939
7940 \end_inset
7941
7942 .
7943  This will default to the first defined style if not given, but you are
7944  encouraged to use this directive.
7945 \end_layout
7946
7947 \begin_layout Description
7948 \begin_inset Flex CharStyle:Code
7949 status collapsed
7950
7951 \begin_layout Plain Layout
7952 ExcludesModule
7953 \end_layout
7954
7955 \end_inset
7956
7957  [
7958 \begin_inset Flex CharStyle:Code
7959 status collapsed
7960
7961 \begin_layout Plain Layout
7962 string
7963 \end_layout
7964
7965 \end_inset
7966
7967 ] This tag indicates that the module in question—which should be specified
7968  by filename without the 
7969 \begin_inset Flex CharStyle:Code
7970 status collapsed
7971
7972 \begin_layout Plain Layout
7973 .module
7974 \end_layout
7975
7976 \end_inset
7977
7978  extension—cannot be used with this document class.
7979  This might be used in a journal-specific layout file to prevent, say, the
7980  use of the 
7981 \begin_inset Flex CharStyle:Code
7982 status collapsed
7983
7984 \begin_layout Plain Layout
7985 theorems-sec
7986 \end_layout
7987
7988 \end_inset
7989
7990  module that numbers theorems by section.
7991  This tag may 
7992 \emph on
7993 not
7994 \emph default
7995  be used in a module.
7996  Modules have their own way of excluding other modules (see 
7997 \begin_inset CommandInset ref
7998 LatexCommand ref
7999 reference "sub:Layout-modules"
8000
8001 \end_inset
8002
8003 ).
8004 \end_layout
8005
8006 \begin_layout Description
8007 \begin_inset Flex CharStyle:Code
8008 status collapsed
8009
8010 \begin_layout Plain Layout
8011 Float
8012 \end_layout
8013
8014 \end_inset
8015
8016  Defines a new float.
8017  See Section
8018 \begin_inset space ~
8019 \end_inset
8020
8021
8022 \begin_inset CommandInset ref
8023 LatexCommand ref
8024 reference "sub:Floats"
8025
8026 \end_inset
8027
8028  for details.
8029  Must end with 
8030 \begin_inset Quotes eld
8031 \end_inset
8032
8033
8034 \begin_inset Flex CharStyle:Code
8035 status collapsed
8036
8037 \begin_layout Plain Layout
8038 End
8039 \end_layout
8040
8041 \end_inset
8042
8043
8044 \begin_inset Quotes erd
8045 \end_inset
8046
8047 .
8048 \end_layout
8049
8050 \begin_layout Description
8051 \begin_inset Flex CharStyle:Code
8052 status collapsed
8053
8054 \begin_layout Plain Layout
8055 HTMLPreamble
8056 \end_layout
8057
8058 \end_inset
8059
8060  Sets the information that will be output in the 
8061 \begin_inset Flex CharStyle:Code
8062 status collapsed
8063
8064 \begin_layout Plain Layout
8065 <head>
8066 \end_layout
8067
8068 \end_inset
8069
8070  block when this document class is output to XHTML.
8071  Note that this will completely override any prior 
8072 \begin_inset Flex CharStyle:Code
8073 status collapsed
8074
8075 \begin_layout Plain Layout
8076 HTMLPreamble
8077 \end_layout
8078
8079 \end_inset
8080
8081  or 
8082 \begin_inset Flex CharStyle:Code
8083 status collapsed
8084
8085 \begin_layout Plain Layout
8086 AddToHTMLPreamble
8087 \end_layout
8088
8089 \end_inset
8090
8091  declarations.
8092  (Use 
8093 \begin_inset Flex CharStyle:Code
8094 status collapsed
8095
8096 \begin_layout Plain Layout
8097 AddToHTMLPreamble
8098 \end_layout
8099
8100 \end_inset
8101
8102  if you just want to add material to the preamble.) Must end with 
8103 \begin_inset Quotes eld
8104 \end_inset
8105
8106
8107 \begin_inset Flex CharStyle:Code
8108 status collapsed
8109
8110 \begin_layout Plain Layout
8111 EndPreamble
8112 \end_layout
8113
8114 \end_inset
8115
8116
8117 \begin_inset Quotes erd
8118 \end_inset
8119
8120 .
8121 \end_layout
8122
8123 \begin_layout Description
8124 \begin_inset Flex CharStyle:Code
8125 status collapsed
8126
8127 \begin_layout Plain Layout
8128 HTMLTOCSection
8129 \end_layout
8130
8131 \end_inset
8132
8133  [
8134 \begin_inset Flex CharStyle:Code
8135 status collapsed
8136
8137 \begin_layout Plain Layout
8138 string
8139 \end_layout
8140
8141 \end_inset
8142
8143 ] The layout to use for the table of contents, bibliography, and so forth,
8144  when the document is output to HTML.
8145  For articles, this should normally be Section; for books, Chapter.
8146  If it is not given, then LyX will attempt to figure out which layout to
8147  use.
8148 \end_layout
8149
8150 \begin_layout Description
8151 \begin_inset Flex CharStyle:Code
8152 status collapsed
8153
8154 \begin_layout Plain Layout
8155 IfCounter
8156 \end_layout
8157
8158 \end_inset
8159
8160  [
8161 \begin_inset Flex CharStyle:Code
8162 status collapsed
8163
8164 \begin_layout Plain Layout
8165 string
8166 \end_layout
8167
8168 \end_inset
8169
8170 ] Modifies the properties of the given counter.
8171  If the counter does not exist, the section is ignored.
8172  Must end with 
8173 \begin_inset Quotes eld
8174 \end_inset
8175
8176
8177 \begin_inset Flex CharStyle:Code
8178 status collapsed
8179
8180 \begin_layout Plain Layout
8181 End
8182 \end_layout
8183
8184 \end_inset
8185
8186
8187 \begin_inset Quotes erd
8188 \end_inset
8189
8190 .
8191 \begin_inset Newline newline
8192 \end_inset
8193
8194 See Section
8195 \begin_inset space ~
8196 \end_inset
8197
8198
8199 \begin_inset CommandInset ref
8200 LatexCommand ref
8201 reference "sub:Counters"
8202
8203 \end_inset
8204
8205  for details on counters.
8206 \end_layout
8207
8208 \begin_layout Description
8209 \begin_inset Flex CharStyle:Code
8210 status collapsed
8211
8212 \begin_layout Plain Layout
8213 IfStyle
8214 \end_layout
8215
8216 \end_inset
8217
8218  [
8219 \begin_inset Flex CharStyle:Code
8220 status collapsed
8221
8222 \begin_layout Plain Layout
8223 string
8224 \end_layout
8225
8226 \end_inset
8227
8228 ] Modifies the properties of the given paragraph style.
8229  If the style does not exist, the section is ignored.
8230  Must end with 
8231 \begin_inset Quotes eld
8232 \end_inset
8233
8234
8235 \begin_inset Flex CharStyle:Code
8236 status collapsed
8237
8238 \begin_layout Plain Layout
8239 End
8240 \end_layout
8241
8242 \end_inset
8243
8244
8245 \begin_inset Quotes erd
8246 \end_inset
8247
8248 .
8249 \end_layout
8250
8251 \begin_layout Description
8252 \begin_inset Flex CharStyle:Code
8253 status collapsed
8254
8255 \begin_layout Plain Layout
8256 Input
8257 \end_layout
8258
8259 \end_inset
8260
8261  As its name implies, this command allows you to include another layout
8262  definition file within yours to avoid duplicating commands.
8263  Common examples are the standard layout files, for example, 
8264 \begin_inset Flex CharStyle:Code
8265 status collapsed
8266
8267 \begin_layout Plain Layout
8268 stdclass.inc
8269 \end_layout
8270
8271 \end_inset
8272
8273 , which contains most of the basic layouts.
8274 \end_layout
8275
8276 \begin_layout Description
8277 \begin_inset Flex CharStyle:Code
8278 status collapsed
8279
8280 \begin_layout Plain Layout
8281 InsetLayout
8282 \end_layout
8283
8284 \end_inset
8285
8286  This section (re-)defines the layout of an inset.
8287  It can be applied to an existing inset or to a new, user-defined inset,
8288  e.g., a new character style.
8289  Must end with 
8290 \begin_inset Quotes eld
8291 \end_inset
8292
8293
8294 \begin_inset Flex CharStyle:Code
8295 status collapsed
8296
8297 \begin_layout Plain Layout
8298 End
8299 \end_layout
8300
8301 \end_inset
8302
8303
8304 \begin_inset Quotes erd
8305 \end_inset
8306
8307 .
8308 \begin_inset Newline newline
8309 \end_inset
8310
8311 See Section
8312 \begin_inset space ~
8313 \end_inset
8314
8315
8316 \begin_inset CommandInset ref
8317 LatexCommand ref
8318 reference "sub:Flex-insets-and"
8319
8320 \end_inset
8321
8322  for more information.
8323  
8324 \end_layout
8325
8326 \begin_layout Description
8327 \begin_inset Flex CharStyle:Code
8328 status collapsed
8329
8330 \begin_layout Plain Layout
8331 LeftMargin
8332 \end_layout
8333
8334 \end_inset
8335
8336  [
8337 \begin_inset Flex CharStyle:Code
8338 status collapsed
8339
8340 \begin_layout Plain Layout
8341 string
8342 \end_layout
8343
8344 \end_inset
8345
8346 ] A string that indicates the width of the left margin on the screen, for
8347  example, 
8348 \begin_inset Quotes eld
8349 \end_inset
8350
8351 MMMMM
8352 \begin_inset Quotes erd
8353 \end_inset
8354
8355 .
8356  (Note that this is not a `length', like 
8357 \begin_inset Quotes eld
8358 \end_inset
8359
8360 2ex
8361 \begin_inset Quotes erd
8362 \end_inset
8363
8364 .)
8365 \end_layout
8366
8367 \begin_layout Description
8368 \begin_inset Flex CharStyle:Code
8369 status collapsed
8370
8371 \begin_layout Plain Layout
8372 NoFloat
8373 \end_layout
8374
8375 \end_inset
8376
8377  This command deletes an existing float.
8378  This is particularly useful when you want to suppress a float that has
8379  been defined in an input file.
8380 \end_layout
8381
8382 \begin_layout Description
8383 \begin_inset Flex CharStyle:Code
8384 status collapsed
8385
8386 \begin_layout Plain Layout
8387 NoStyle
8388 \end_layout
8389
8390 \end_inset
8391
8392  This command deletes an existing style.
8393  This is particularly useful when you want to suppress a style that has
8394  be defined in an input file.
8395 \end_layout
8396
8397 \begin_layout Description
8398 \begin_inset Flex CharStyle:Code
8399 status collapsed
8400
8401 \begin_layout Plain Layout
8402 OutputFormat
8403 \end_layout
8404
8405 \end_inset
8406
8407  A string indicating the file format (as defined in the Preferences dialog)
8408  produced by this class.
8409  It is mainly useful when 
8410 \begin_inset Flex CharStyle:Code
8411 status collapsed
8412
8413 \begin_layout Plain Layout
8414 OutputType
8415 \end_layout
8416
8417 \end_inset
8418
8419  is `literate' and one wants to define a new type of literate document.
8420  This string is reset to `docbook', `latex', or `literate' when the correspondin
8421
8422 \begin_inset Flex CharStyle:Code
8423 status collapsed
8424
8425 \begin_layout Plain Layout
8426 OutputType
8427 \end_layout
8428
8429 \end_inset
8430
8431  parameter is encountered.
8432 \end_layout
8433
8434 \begin_layout Description
8435 \begin_inset Flex CharStyle:Code
8436 status collapsed
8437
8438 \begin_layout Plain Layout
8439 OutputType
8440 \end_layout
8441
8442 \end_inset
8443
8444  A string indicating what sort of output documents using this class will
8445  produce.
8446  At present, the options are: `docbook', `latex', and `literate'.
8447 \end_layout
8448
8449 \begin_layout Description
8450 \begin_inset Flex CharStyle:Code
8451 status collapsed
8452
8453 \begin_layout Plain Layout
8454 PageStyle
8455 \end_layout
8456
8457 \end_inset
8458
8459  [
8460 \begin_inset Flex CharStyle:Code
8461 status collapsed
8462
8463 \begin_layout Plain Layout
8464
8465 \emph on
8466 plain
8467 \end_layout
8468
8469 \end_inset
8470
8471
8472 \begin_inset Flex CharStyle:Code
8473 status collapsed
8474
8475 \begin_layout Plain Layout
8476 empty
8477 \end_layout
8478
8479 \end_inset
8480
8481
8482 \begin_inset Flex CharStyle:Code
8483 status collapsed
8484
8485 \begin_layout Plain Layout
8486 headings
8487 \end_layout
8488
8489 \end_inset
8490
8491 ] The default pagestyle.
8492  Can be changed in the 
8493 \begin_inset Flex CharStyle:MenuItem
8494 status collapsed
8495
8496 \begin_layout Plain Layout
8497 Document\SpecialChar \menuseparator
8498 Settings
8499 \end_layout
8500
8501 \end_inset
8502
8503  dialog.
8504 \end_layout
8505
8506 \begin_layout Description
8507 \begin_inset Flex CharStyle:Code
8508 status collapsed
8509
8510 \begin_layout Plain Layout
8511 Preamble
8512 \end_layout
8513
8514 \end_inset
8515
8516  Sets the preamble for the LaTeX document.
8517  Note that this will completely override any prior 
8518 \begin_inset Flex CharStyle:Code
8519 status collapsed
8520
8521 \begin_layout Plain Layout
8522 Preamble
8523 \end_layout
8524
8525 \end_inset
8526
8527  or 
8528 \begin_inset Flex CharStyle:Code
8529 status collapsed
8530
8531 \begin_layout Plain Layout
8532 AddToPreamble
8533 \end_layout
8534
8535 \end_inset
8536
8537  declarations.
8538  (Use 
8539 \begin_inset Flex CharStyle:Code
8540 status collapsed
8541
8542 \begin_layout Plain Layout
8543 AddToPreamble
8544 \end_layout
8545
8546 \end_inset
8547
8548  if you just want to add material to the preamble.) Must end with 
8549 \begin_inset Quotes eld
8550 \end_inset
8551
8552
8553 \begin_inset Flex CharStyle:Code
8554 status collapsed
8555
8556 \begin_layout Plain Layout
8557 EndPreamble
8558 \end_layout
8559
8560 \end_inset
8561
8562
8563 \begin_inset Quotes erd
8564 \end_inset
8565
8566 .
8567 \end_layout
8568
8569 \begin_layout Description
8570 \begin_inset Flex CharStyle:Code
8571 status collapsed
8572
8573 \begin_layout Plain Layout
8574 Provides
8575 \end_layout
8576
8577 \end_inset
8578
8579  [
8580 \begin_inset Flex CharStyle:Code
8581 status collapsed
8582
8583 \begin_layout Plain Layout
8584 string
8585 \end_layout
8586
8587 \end_inset
8588
8589 ] [
8590 \begin_inset Flex CharStyle:Code
8591 status collapsed
8592
8593 \begin_layout Plain Layout
8594
8595 \emph on
8596 0
8597 \end_layout
8598
8599 \end_inset
8600
8601
8602 \begin_inset Flex CharStyle:Code
8603 status collapsed
8604
8605 \begin_layout Plain Layout
8606 1
8607 \end_layout
8608
8609 \end_inset
8610
8611 ] Whether the class already provides the feature 
8612 \begin_inset Flex CharStyle:Code
8613 status collapsed
8614
8615 \begin_layout Plain Layout
8616 string
8617 \end_layout
8618
8619 \end_inset
8620
8621 .
8622  A feature is in general the name of a package (
8623 \begin_inset Flex CharStyle:Code
8624 status collapsed
8625
8626 \begin_layout Plain Layout
8627 amsmath
8628 \end_layout
8629
8630 \end_inset
8631
8632
8633 \begin_inset Flex CharStyle:Code
8634 status collapsed
8635
8636 \begin_layout Plain Layout
8637 makeidx
8638 \end_layout
8639
8640 \end_inset
8641
8642 , \SpecialChar \ldots{}
8643 ) or a macro (
8644 \begin_inset Flex CharStyle:Code
8645 status collapsed
8646
8647 \begin_layout Plain Layout
8648 url
8649 \end_layout
8650
8651 \end_inset
8652
8653
8654 \begin_inset Flex CharStyle:Code
8655 status collapsed
8656
8657 \begin_layout Plain Layout
8658 boldsymbol
8659 \end_layout
8660
8661 \end_inset
8662
8663 ,\SpecialChar \ldots{}
8664 ); the complete list of supported features is unfortunately not documented
8665  outside the LyX source code—but see 
8666 \begin_inset Flex CharStyle:Code
8667 status collapsed
8668
8669 \begin_layout Plain Layout
8670 LaTeXFeatures.cpp
8671 \end_layout
8672
8673 \end_inset
8674
8675  if you're interested.
8676  
8677 \begin_inset Flex CharStyle:MenuItem
8678 status collapsed
8679
8680 \begin_layout Plain Layout
8681 Help\SpecialChar \menuseparator
8682 LaTeX Configuration
8683 \end_layout
8684
8685 \end_inset
8686
8687  also gives an overview of the supported packages.
8688 \end_layout
8689
8690 \begin_layout Description
8691 \begin_inset Flex CharStyle:Code
8692 status collapsed
8693
8694 \begin_layout Plain Layout
8695 ProvidesModule
8696 \end_layout
8697
8698 \end_inset
8699
8700  [
8701 \begin_inset Flex CharStyle:Code
8702 status collapsed
8703
8704 \begin_layout Plain Layout
8705 string
8706 \end_layout
8707
8708 \end_inset
8709
8710 ] Indicates that this layout provides the functionality of the module mentioned,
8711  which should be specified by the filename without the 
8712 \begin_inset Flex CharStyle:Code
8713 status collapsed
8714
8715 \begin_layout Plain Layout
8716 .module
8717 \end_layout
8718
8719 \end_inset
8720
8721  extension.
8722  This will typically be used if the layout includes the module directly,
8723  rather than using the 
8724 \begin_inset Flex CharStyle:Code
8725 status collapsed
8726
8727 \begin_layout Plain Layout
8728 DefaultModule
8729 \end_layout
8730
8731 \end_inset
8732
8733  tag to indicate that it ought to be used.
8734  It could also be used in a module that provided an alternate implementation
8735  of the same functionality.
8736 \end_layout
8737
8738 \begin_layout Description
8739 \begin_inset Flex CharStyle:Code
8740 status collapsed
8741
8742 \begin_layout Plain Layout
8743 Requires
8744 \end_layout
8745
8746 \end_inset
8747
8748  [
8749 \begin_inset Flex CharStyle:Code
8750 status collapsed
8751
8752 \begin_layout Plain Layout
8753 string
8754 \end_layout
8755
8756 \end_inset
8757
8758 ] Whether the class requires the feature 
8759 \begin_inset Flex CharStyle:Code
8760 status collapsed
8761
8762 \begin_layout Plain Layout
8763 string
8764 \end_layout
8765
8766 \end_inset
8767
8768 .
8769  Multiple features must be separated by commas.
8770  Note that you can only request supported features.
8771  (Again, see 
8772 \begin_inset Flex CharStyle:Code
8773 status collapsed
8774
8775 \begin_layout Plain Layout
8776 LaTeXFeatures.cpp
8777 \end_layout
8778
8779 \end_inset
8780
8781  for a list of these.)
8782 \end_layout
8783
8784 \begin_layout Description
8785 \begin_inset Flex CharStyle:Code
8786 status collapsed
8787
8788 \begin_layout Plain Layout
8789 RightMargin
8790 \end_layout
8791
8792 \end_inset
8793
8794  A string that indicates the width of the right margin on the screen, for
8795  example, 
8796 \begin_inset Quotes eld
8797 \end_inset
8798
8799 MMMMM
8800 \begin_inset Quotes erd
8801 \end_inset
8802
8803 .
8804 \end_layout
8805
8806 \begin_layout Description
8807 \begin_inset Flex CharStyle:Code
8808 status collapsed
8809
8810 \begin_layout Plain Layout
8811 SecNumDepth
8812 \end_layout
8813
8814 \end_inset
8815
8816  Sets which divisions get numbered.
8817  Corresponds to the 
8818 \begin_inset Flex CharStyle:Code
8819 status collapsed
8820
8821 \begin_layout Plain Layout
8822 secnumdepth
8823 \end_layout
8824
8825 \end_inset
8826
8827  counter in LaTeX.
8828 \end_layout
8829
8830 \begin_layout Description
8831 \begin_inset Flex CharStyle:Code
8832 status collapsed
8833
8834 \begin_layout Plain Layout
8835 Sides
8836 \end_layout
8837
8838 \end_inset
8839
8840  [
8841 \begin_inset Flex CharStyle:Code
8842 status collapsed
8843
8844 \begin_layout Plain Layout
8845
8846 \emph on
8847 1
8848 \end_layout
8849
8850 \end_inset
8851
8852
8853 \begin_inset Flex CharStyle:Code
8854 status collapsed
8855
8856 \begin_layout Plain Layout
8857 2
8858 \end_layout
8859
8860 \end_inset
8861
8862 ] Whether the class-default should be printing on one or both sides of the
8863  paper.
8864  Can be changed in the 
8865 \begin_inset Flex CharStyle:MenuItem
8866 status collapsed
8867
8868 \begin_layout Plain Layout
8869 Document\SpecialChar \menuseparator
8870 Settings
8871 \end_layout
8872
8873 \end_inset
8874
8875  dialog.
8876 \end_layout
8877
8878 \begin_layout Description
8879 \begin_inset Flex CharStyle:Code
8880 status collapsed
8881
8882 \begin_layout Plain Layout
8883 Style
8884 \end_layout
8885
8886 \end_inset
8887
8888  This sequence defines a paragraph style.
8889  If the style does not yet exist, it is created; if it does exist, its parameter
8890 s are modified.
8891  Must end with 
8892 \begin_inset Quotes eld
8893 \end_inset
8894
8895
8896 \begin_inset Flex CharStyle:Code
8897 status collapsed
8898
8899 \begin_layout Plain Layout
8900 End
8901 \end_layout
8902
8903 \end_inset
8904
8905
8906 \begin_inset Quotes erd
8907 \end_inset
8908
8909 .
8910 \begin_inset Newline newline
8911 \end_inset
8912
8913 See Section
8914 \begin_inset space ~
8915 \end_inset
8916
8917
8918 \begin_inset CommandInset ref
8919 LatexCommand ref
8920 reference "sub:Paragraph-Styles"
8921
8922 \end_inset
8923
8924  for details on paragraph styles.
8925 \end_layout
8926
8927 \begin_layout Description
8928 \begin_inset Flex CharStyle:Code
8929 status collapsed
8930
8931 \begin_layout Plain Layout
8932 TitleLatexName
8933 \end_layout
8934
8935 \end_inset
8936
8937  [
8938 \begin_inset Flex CharStyle:Code
8939 status collapsed
8940
8941 \begin_layout Plain Layout
8942 string="maketitle"
8943 \end_layout
8944
8945 \end_inset
8946
8947 ] The name of the command or environment to be used with 
8948 \begin_inset Flex CharStyle:Code
8949 status collapsed
8950
8951 \begin_layout Plain Layout
8952 TitleLatexType
8953 \end_layout
8954
8955 \end_inset
8956
8957 .
8958 \end_layout
8959
8960 \begin_layout Description
8961 \begin_inset Flex CharStyle:Code
8962 status collapsed
8963
8964 \begin_layout Plain Layout
8965 TitleLatexType
8966 \end_layout
8967
8968 \end_inset
8969
8970  [
8971 \begin_inset Flex CharStyle:Code
8972 status collapsed
8973
8974 \begin_layout Plain Layout
8975
8976 \emph on
8977 CommandAfter
8978 \end_layout
8979
8980 \end_inset
8981
8982
8983 \begin_inset Flex CharStyle:Code
8984 status collapsed
8985
8986 \begin_layout Plain Layout
8987 Environment
8988 \end_layout
8989
8990 \end_inset
8991
8992 ] Indicates what kind of markup is used to define the title of a document.
8993  
8994 \begin_inset Flex CharStyle:Code
8995 status collapsed
8996
8997 \begin_layout Plain Layout
8998 CommandAfter
8999 \end_layout
9000
9001 \end_inset
9002
9003  means that the macro with name 
9004 \begin_inset Flex CharStyle:Code
9005 status collapsed
9006
9007 \begin_layout Plain Layout
9008 TitleLatexName
9009 \end_layout
9010
9011 \end_inset
9012
9013  will be inserted after the last layout which has 
9014 \begin_inset Quotes eld
9015 \end_inset
9016
9017
9018 \begin_inset Flex CharStyle:Code
9019 status collapsed
9020
9021 \begin_layout Plain Layout
9022 InTitle 1
9023 \end_layout
9024
9025 \end_inset
9026
9027
9028 \begin_inset Quotes erd
9029 \end_inset
9030
9031 .
9032  
9033 \begin_inset Flex CharStyle:Code
9034 status collapsed
9035
9036 \begin_layout Plain Layout
9037 Environment
9038 \end_layout
9039
9040 \end_inset
9041
9042  corresponds to the case where the block of paragraphs which have 
9043 \begin_inset Quotes eld
9044 \end_inset
9045
9046
9047 \begin_inset Flex CharStyle:Code
9048 status collapsed
9049
9050 \begin_layout Plain Layout
9051 InTitle 1
9052 \end_layout
9053
9054 \end_inset
9055
9056
9057 \begin_inset Quotes erd
9058 \end_inset
9059
9060  should be enclosed into the 
9061 \begin_inset Flex CharStyle:Code
9062 status collapsed
9063
9064 \begin_layout Plain Layout
9065 TitleLatexName
9066 \end_layout
9067
9068 \end_inset
9069
9070  environment.
9071 \end_layout
9072
9073 \begin_layout Description
9074 \begin_inset Flex CharStyle:Code
9075 status collapsed
9076
9077 \begin_layout Plain Layout
9078 TocDepth
9079 \end_layout
9080
9081 \end_inset
9082
9083  Sets which divisions are included in the table of contents.
9084  Corresponds to the 
9085 \begin_inset Flex CharStyle:Code
9086 status collapsed
9087
9088 \begin_layout Plain Layout
9089 tocdepth
9090 \end_layout
9091
9092 \end_inset
9093
9094  counter in LaTeX.
9095 \end_layout
9096
9097 \begin_layout Subsection
9098 \begin_inset Flex CharStyle:Code
9099 status collapsed
9100
9101 \begin_layout Plain Layout
9102 ClassOptions
9103 \end_layout
9104
9105 \end_inset
9106
9107  section
9108 \begin_inset CommandInset label
9109 LatexCommand label
9110 name "sub:ClassOptions"
9111
9112 \end_inset
9113
9114
9115 \end_layout
9116
9117 \begin_layout Standard
9118 The 
9119 \begin_inset Flex CharStyle:Code
9120 status collapsed
9121
9122 \begin_layout Plain Layout
9123 ClassOptions
9124 \end_layout
9125
9126 \end_inset
9127
9128  section can contain the following entries:
9129 \end_layout
9130
9131 \begin_layout Description
9132 \begin_inset Flex CharStyle:Code
9133 status collapsed
9134
9135 \begin_layout Plain Layout
9136 FontSize
9137 \end_layout
9138
9139 \end_inset
9140
9141  [
9142 \begin_inset Flex CharStyle:Code
9143 status collapsed
9144
9145 \begin_layout Plain Layout
9146 string="10|11|12"
9147 \end_layout
9148
9149 \end_inset
9150
9151 ] The list of available font sizes for the document's main font, separated
9152  by 
9153 \begin_inset Quotes eld
9154 \end_inset
9155
9156
9157 \begin_inset Flex CharStyle:Code
9158 status collapsed
9159
9160 \begin_layout Plain Layout
9161 |
9162 \end_layout
9163
9164 \end_inset
9165
9166
9167 \begin_inset Quotes erd
9168 \end_inset
9169
9170 .
9171 \end_layout
9172
9173 \begin_layout Description
9174 \begin_inset Flex CharStyle:Code
9175 status collapsed
9176
9177 \begin_layout Plain Layout
9178 Header
9179 \end_layout
9180
9181 \end_inset
9182
9183  Used to set the DTD line with XML-based output classes.
9184  E.
9185 \begin_inset space \thinspace{}
9186 \end_inset
9187
9188 g.: PUBLIC 
9189 \begin_inset Quotes eld
9190 \end_inset
9191
9192 -//OASIS//DTD DocBook V4.2//EN
9193 \begin_inset Quotes erd
9194 \end_inset
9195
9196 .
9197 \end_layout
9198
9199 \begin_layout Description
9200 \begin_inset Flex CharStyle:Code
9201 status collapsed
9202
9203 \begin_layout Plain Layout
9204 PageStyle
9205 \end_layout
9206
9207 \end_inset
9208
9209  [
9210 \begin_inset Flex CharStyle:Code
9211 status collapsed
9212
9213 \begin_layout Plain Layout
9214 string="empty|plain|headings|fancy"
9215 \end_layout
9216
9217 \end_inset
9218
9219 ] The list of available page styles, separated by 
9220 \begin_inset Quotes eld
9221 \end_inset
9222
9223
9224 \begin_inset Flex CharStyle:Code
9225 status collapsed
9226
9227 \begin_layout Plain Layout
9228 |
9229 \end_layout
9230
9231 \end_inset
9232
9233
9234 \begin_inset Quotes erd
9235 \end_inset
9236
9237 .
9238 \end_layout
9239
9240 \begin_layout Description
9241 \begin_inset Flex CharStyle:Code
9242 status collapsed
9243
9244 \begin_layout Plain Layout
9245 Other
9246 \end_layout
9247
9248 \end_inset
9249
9250  [
9251 \begin_inset Flex CharStyle:Code
9252 status collapsed
9253
9254 \begin_layout Plain Layout
9255 string=""
9256 \end_layout
9257
9258 \end_inset
9259
9260 ] Some document class options, separated by a comma, that will be added
9261  to the optional part of the 
9262 \begin_inset Flex CharStyle:Code
9263 status collapsed
9264
9265 \begin_layout Plain Layout
9266
9267 \backslash
9268 documentclass
9269 \end_layout
9270
9271 \end_inset
9272
9273  command.
9274 \end_layout
9275
9276 \begin_layout Standard
9277 The 
9278 \begin_inset Flex CharStyle:Code
9279 status collapsed
9280
9281 \begin_layout Plain Layout
9282 ClassOptions
9283 \end_layout
9284
9285 \end_inset
9286
9287  section must end with 
9288 \begin_inset Quotes eld
9289 \end_inset
9290
9291
9292 \begin_inset Flex CharStyle:Code
9293 status collapsed
9294
9295 \begin_layout Plain Layout
9296 End
9297 \end_layout
9298
9299 \end_inset
9300
9301
9302 \begin_inset Quotes erd
9303 \end_inset
9304
9305 .
9306 \end_layout
9307
9308 \begin_layout Subsection
9309 Paragraph styles
9310 \begin_inset CommandInset label
9311 LatexCommand label
9312 name "sub:Paragraph-Styles"
9313
9314 \end_inset
9315
9316
9317 \end_layout
9318
9319 \begin_layout Standard
9320 A paragraph style description looks like this:
9321 \begin_inset Foot
9322 status collapsed
9323
9324 \begin_layout Plain Layout
9325 Note that this will either define a new layout or modify an existing one.
9326 \end_layout
9327
9328 \end_inset
9329
9330
9331 \end_layout
9332
9333 \begin_layout LyX-Code
9334 Style 
9335 \family roman
9336 \emph on
9337 name
9338 \end_layout
9339
9340 \begin_layout LyX-Code
9341  ...
9342 \end_layout
9343
9344 \begin_layout LyX-Code
9345 End
9346 \end_layout
9347
9348 \begin_layout Standard
9349 where the following commands are allowed:
9350 \end_layout
9351
9352 \begin_layout Description
9353 \begin_inset Flex CharStyle:Code
9354 status collapsed
9355
9356 \begin_layout Plain Layout
9357 Align
9358 \end_layout
9359
9360 \end_inset
9361
9362  [
9363 \begin_inset Flex CharStyle:Code
9364 status collapsed
9365
9366 \begin_layout Plain Layout
9367
9368 \emph on
9369 block
9370 \emph default
9371 , left, right, center
9372 \end_layout
9373
9374 \end_inset
9375
9376 ] Paragraph alignment.
9377 \end_layout
9378
9379 \begin_layout Description
9380 \begin_inset Flex CharStyle:Code
9381 status collapsed
9382
9383 \begin_layout Plain Layout
9384 AlignPossible
9385 \end_layout
9386
9387 \end_inset
9388
9389  [
9390 \begin_inset Flex CharStyle:Code
9391 status collapsed
9392
9393 \begin_layout Plain Layout
9394
9395 \emph on
9396 block
9397 \emph default
9398 , left, right, center
9399 \end_layout
9400
9401 \end_inset
9402
9403 ] A comma separated list of permitted alignments.
9404  (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9405  sense.
9406  For example a right-aligned or centered enumeration isn't possible.)
9407 \end_layout
9408
9409 \begin_layout Description
9410 \begin_inset Flex CharStyle:Code
9411 status collapsed
9412
9413 \begin_layout Plain Layout
9414 BabelPreamble
9415 \end_layout
9416
9417 \end_inset
9418
9419  Language dependent information to be included in the LaTeX preamble when
9420  this style is used.
9421  Note that this will completely override any prior 
9422 \begin_inset Flex CharStyle:Code
9423 status collapsed
9424
9425 \begin_layout Plain Layout
9426 BabelPreamble
9427 \end_layout
9428
9429 \end_inset
9430
9431  declarations.
9432  Must end with 
9433 \begin_inset Quotes eld
9434 \end_inset
9435
9436
9437 \begin_inset Flex CharStyle:Code
9438 status collapsed
9439
9440 \begin_layout Plain Layout
9441 EndBabelPreamble
9442 \end_layout
9443
9444 \end_inset
9445
9446
9447 \begin_inset Quotes erd
9448 \end_inset
9449
9450 .
9451  The contents of this tag will occur once in the LaTeX preamble for each
9452  language used by the document.
9453  Each time, the following substitutions are made:
9454 \end_layout
9455
9456 \begin_deeper
9457 \begin_layout Itemize
9458 \begin_inset Flex CharStyle:Code
9459 status collapsed
9460
9461 \begin_layout Plain Layout
9462 $$lang
9463 \end_layout
9464
9465 \end_inset
9466
9467  is replaced by the language name (as used by the babel package).
9468 \end_layout
9469
9470 \begin_layout Itemize
9471 The 
9472 \begin_inset Quotes eld
9473 \end_inset
9474
9475 Function
9476 \begin_inset Quotes erd
9477 \end_inset
9478
9479  
9480 \begin_inset Flex CharStyle:Code
9481 status collapsed
9482
9483 \begin_layout Plain Layout
9484 _()
9485 \end_layout
9486
9487 \end_inset
9488
9489  replaces its argument by the translation of the argument to the current
9490  language.
9491 \end_layout
9492
9493 \begin_layout Standard
9494 This preamble snippet will only be used if the document contains more than
9495  one language and the babel package is used.
9496 \end_layout
9497
9498 \end_deeper
9499 \begin_layout Description
9500 \begin_inset Flex CharStyle:Code
9501 status collapsed
9502
9503 \begin_layout Plain Layout
9504 BottomSep
9505 \end_layout
9506
9507 \end_inset
9508
9509  [
9510 \begin_inset Flex CharStyle:Code
9511 status collapsed
9512
9513 \begin_layout Plain Layout
9514 float=0
9515 \end_layout
9516
9517 \end_inset
9518
9519 ]
9520 \begin_inset Foot
9521 status collapsed
9522
9523 \begin_layout Plain Layout
9524 Note that a `float' here is a real number, such as: 1.5.
9525 \end_layout
9526
9527 \end_inset
9528
9529  The vertical space with which the last of a chain of paragraphs with this
9530  layout is separated from the following paragraph.
9531  If the next paragraph has another layout, the separations are not simply
9532  added, but the maximum is taken.
9533 \end_layout
9534
9535 \begin_layout Description
9536 \begin_inset Flex CharStyle:Code
9537 status collapsed
9538
9539 \begin_layout Plain Layout
9540 Category
9541 \end_layout
9542
9543 \end_inset
9544
9545  
9546 \begin_inset Flex CharStyle:Code
9547 status collapsed
9548
9549 \begin_layout Plain Layout
9550 [string]
9551 \end_layout
9552
9553 \end_inset
9554
9555  The category for this style.
9556  This is used to group related styles in the Layout combobox on the toolbar.
9557  Any string can be used, but you may want to use existing categories with
9558  your own styles.
9559  
9560 \end_layout
9561
9562 \begin_layout Description
9563 \begin_inset Flex CharStyle:Code
9564 status collapsed
9565
9566 \begin_layout Plain Layout
9567 CommandDepth
9568 \end_layout
9569
9570 \end_inset
9571
9572  Depth of XML command.
9573  Used only with XML-type formats.
9574 \end_layout
9575
9576 \begin_layout Description
9577 \begin_inset Flex CharStyle:Code
9578 status collapsed
9579
9580 \begin_layout Plain Layout
9581 CopyStyle
9582 \end_layout
9583
9584 \end_inset
9585
9586  
9587 \begin_inset CommandInset label
9588 LatexCommand label
9589 name "des:CopyStyle"
9590
9591 \end_inset
9592
9593
9594 \begin_inset Flex CharStyle:Code
9595 status collapsed
9596
9597 \begin_layout Plain Layout
9598 [string]
9599 \end_layout
9600
9601 \end_inset
9602
9603  Copies all the features of an existing style into the current one.
9604  
9605 \end_layout
9606
9607 \begin_layout Description
9608 \begin_inset Flex CharStyle:Code
9609 status collapsed
9610
9611 \begin_layout Plain Layout
9612 DependsOn
9613 \end_layout
9614
9615 \end_inset
9616
9617  The name of a style whose preamble should be output 
9618 \emph on
9619 before
9620 \emph default
9621  this one.
9622  This allows to ensure some ordering of the preamble snippets when macros
9623  definitions depend on one another.
9624 \begin_inset Foot
9625 status collapsed
9626
9627 \begin_layout Plain Layout
9628 Note that, besides that functionality, there is no way to ensure any ordering
9629  of preambles.
9630  The ordering that you see in a given version of LyX may change without
9631  warning in later versions.
9632 \end_layout
9633
9634 \end_inset
9635
9636
9637 \end_layout
9638
9639 \begin_layout Description
9640 \begin_inset Flex CharStyle:Code
9641 status collapsed
9642
9643 \begin_layout Plain Layout
9644 EndLabeltype
9645 \end_layout
9646
9647 \end_inset
9648
9649  [
9650 \begin_inset Flex CharStyle:Code
9651 status collapsed
9652
9653 \begin_layout Plain Layout
9654
9655 \emph on
9656 No_Label
9657 \emph default
9658 , Box, Filled_Box, Static
9659 \end_layout
9660
9661 \end_inset
9662
9663 ] The type of label that stands at the end of the paragraph (or sequence
9664  of paragraphs if 
9665 \begin_inset Flex CharStyle:Code
9666 status collapsed
9667
9668 \begin_layout Plain Layout
9669 LatexType
9670 \end_layout
9671
9672 \end_inset
9673
9674  is 
9675 \begin_inset Flex CharStyle:Code
9676 status collapsed
9677
9678 \begin_layout Plain Layout
9679 Environment
9680 \end_layout
9681
9682 \end_inset
9683
9684
9685 \begin_inset Flex CharStyle:Code
9686 status collapsed
9687
9688 \begin_layout Plain Layout
9689 Item_Environment
9690 \end_layout
9691
9692 \end_inset
9693
9694  or 
9695 \begin_inset Flex CharStyle:Code
9696 status collapsed
9697
9698 \begin_layout Plain Layout
9699 List_Environment
9700 \end_layout
9701
9702 \end_inset
9703
9704 ).
9705  
9706 \begin_inset Flex CharStyle:Code
9707 status collapsed
9708
9709 \begin_layout Plain Layout
9710 No_Label
9711 \end_layout
9712
9713 \end_inset
9714
9715  means 
9716 \begin_inset Quotes eld
9717 \end_inset
9718
9719 nothing
9720 \begin_inset Quotes erd
9721 \end_inset
9722
9723
9724 \begin_inset Flex CharStyle:Code
9725 status collapsed
9726
9727 \begin_layout Plain Layout
9728 Box
9729 \end_layout
9730
9731 \end_inset
9732
9733  (resp.
9734 \begin_inset Flex CharStyle:Code
9735 status collapsed
9736
9737 \begin_layout Plain Layout
9738 \begin_inset space ~
9739 \end_inset
9740
9741 Filled_Box
9742 \end_layout
9743
9744 \end_inset
9745
9746 ) is a white (resp.
9747 \begin_inset space ~
9748 \end_inset
9749
9750 black) square suitable for end of proof markers, 
9751 \begin_inset Flex CharStyle:Code
9752 status collapsed
9753
9754 \begin_layout Plain Layout
9755 Static
9756 \end_layout
9757
9758 \end_inset
9759
9760  is an explicit text string.
9761 \end_layout
9762
9763 \begin_layout Description
9764 \begin_inset Flex CharStyle:Code
9765 status collapsed
9766
9767 \begin_layout Plain Layout
9768 EndLabelString
9769 \end_layout
9770
9771 \end_inset
9772
9773  [
9774 \begin_inset Flex CharStyle:Code
9775 status collapsed
9776
9777 \begin_layout Plain Layout
9778 string=""
9779 \end_layout
9780
9781 \end_inset
9782
9783 ] The string used for a label with a 
9784 \begin_inset Flex CharStyle:Code
9785 status collapsed
9786
9787 \begin_layout Plain Layout
9788 Static
9789 \end_layout
9790
9791 \end_inset
9792
9793  
9794 \begin_inset Flex CharStyle:Code
9795 status collapsed
9796
9797 \begin_layout Plain Layout
9798 EndLabelType
9799 \end_layout
9800
9801 \end_inset
9802
9803 .
9804  
9805 \end_layout
9806
9807 \begin_layout Description
9808 \begin_inset Flex CharStyle:Code
9809 status collapsed
9810
9811 \begin_layout Plain Layout
9812 Fill_Bottom
9813 \end_layout
9814
9815 \end_inset
9816
9817  [
9818 \begin_inset Flex CharStyle:Code
9819 status collapsed
9820
9821 \begin_layout Plain Layout
9822
9823 \emph on
9824 0
9825 \emph default
9826 ,1
9827 \end_layout
9828
9829 \end_inset
9830
9831 ] Similar to 
9832 \begin_inset Flex CharStyle:Code
9833 status collapsed
9834
9835 \begin_layout Plain Layout
9836 Fill_Top
9837 \end_layout
9838
9839 \end_inset
9840
9841 .
9842 \end_layout
9843
9844 \begin_layout Description
9845 \begin_inset Flex CharStyle:Code
9846 status collapsed
9847
9848 \begin_layout Plain Layout
9849 Fill_Top
9850 \end_layout
9851
9852 \end_inset
9853
9854  [
9855 \begin_inset Flex CharStyle:Code
9856 status collapsed
9857
9858 \begin_layout Plain Layout
9859
9860 \emph on
9861 0
9862 \emph default
9863 ,1
9864 \end_layout
9865
9866 \end_inset
9867
9868 ] With this parameter the 
9869 \begin_inset Flex CharStyle:MenuItem
9870 status collapsed
9871
9872 \begin_layout Plain Layout
9873 Fill
9874 \end_layout
9875
9876 \end_inset
9877
9878  value of the 
9879 \begin_inset Quotes eld
9880 \end_inset
9881
9882 Vertical space above
9883 \begin_inset Quotes erd
9884 \end_inset
9885
9886  list of the 
9887 \begin_inset Flex CharStyle:MenuItem
9888 status collapsed
9889
9890 \begin_layout Plain Layout
9891 Edit\SpecialChar \menuseparator
9892 Paragraph
9893 \begin_inset space ~
9894 \end_inset
9895
9896 Settings
9897 \end_layout
9898
9899 \end_inset
9900
9901  dialog can be set when initializing a paragraph with this style.
9902 \begin_inset Foot
9903 status collapsed
9904
9905 \begin_layout Plain Layout
9906
9907 \emph on
9908 Note from Jean-Marc:
9909 \emph default
9910  I'm not sure that this setting has much use, and it should probably be
9911  removed in later versions.
9912 \end_layout
9913
9914 \end_inset
9915
9916  
9917 \end_layout
9918
9919 \begin_layout Description
9920 \begin_inset Flex CharStyle:Code
9921 status collapsed
9922
9923 \begin_layout Plain Layout
9924 Font
9925 \end_layout
9926
9927 \end_inset
9928
9929  The font used for both the text body 
9930 \emph on
9931 and
9932 \emph default
9933  the label.
9934  See section
9935 \begin_inset space ~
9936 \end_inset
9937
9938
9939 \begin_inset CommandInset ref
9940 LatexCommand ref
9941 reference "sub:Font-description"
9942
9943 \end_inset
9944
9945 .
9946  Note that defining this font automatically defines the 
9947 \begin_inset Flex CharStyle:Code
9948 status collapsed
9949
9950 \begin_layout Plain Layout
9951 LabelFont
9952 \end_layout
9953
9954 \end_inset
9955
9956  to the same value.
9957  So you should define this one first if you also want to define 
9958 \begin_inset Flex CharStyle:Code
9959 status collapsed
9960
9961 \begin_layout Plain Layout
9962 LabelFont
9963 \end_layout
9964
9965 \end_inset
9966
9967 .
9968 \end_layout
9969
9970 \begin_layout Description
9971 \begin_inset Flex CharStyle:Code
9972 status collapsed
9973
9974 \begin_layout Plain Layout
9975 FreeSpacing
9976 \end_layout
9977
9978 \end_inset
9979
9980  
9981 \begin_inset CommandInset label
9982 LatexCommand label
9983 name "des:FreeSpacing"
9984
9985 \end_inset
9986
9987 [
9988 \begin_inset Flex CharStyle:Code
9989 status collapsed
9990
9991 \begin_layout Plain Layout
9992
9993 \emph on
9994 0
9995 \end_layout
9996
9997 \end_inset
9998
9999
10000 \begin_inset Flex CharStyle:Code
10001 status collapsed
10002
10003 \begin_layout Plain Layout
10004 1
10005 \end_layout
10006
10007 \end_inset
10008
10009 ] Usually LyX doesn't allow you to insert more than one space between words,
10010  since a space is considered as the separation between two words, not a
10011  character or symbol of its own.
10012  This is a very fine thing but sometimes annoying, for example, when typing
10013  program code or plain LaTeX code.
10014  For this reason, 
10015 \begin_inset Flex CharStyle:Code
10016 status collapsed
10017
10018 \begin_layout Plain Layout
10019 FreeSpacing
10020 \end_layout
10021
10022 \end_inset
10023
10024  can be enabled.
10025  Note that LyX will create protected blanks for the additional blanks when
10026  in another mode than LaTeX-mode.
10027 \end_layout
10028
10029 \begin_layout Description
10030 \begin_inset Flex CharStyle:Code
10031 status collapsed
10032
10033 \begin_layout Plain Layout
10034 HTML*
10035 \end_layout
10036
10037 \end_inset
10038
10039  These tags are used with XHTML output.
10040  See 
10041 \begin_inset CommandInset ref
10042 LatexCommand prettyref
10043 reference "sub:Paragraph-Style-XHTML"
10044
10045 \end_inset
10046
10047 .
10048 \end_layout
10049
10050 \begin_layout Description
10051 \begin_inset Flex CharStyle:Code
10052 status collapsed
10053
10054 \begin_layout Plain Layout
10055 InnerTag
10056 \end_layout
10057
10058 \end_inset
10059
10060  [[FIXME]] (Used only with XML-type formats.)
10061 \end_layout
10062
10063 \begin_layout Description
10064 \begin_inset Flex CharStyle:Code
10065 status collapsed
10066
10067 \begin_layout Plain Layout
10068 InPreamble
10069 \end_layout
10070
10071 \end_inset
10072
10073  
10074 \begin_inset Flex CharStyle:Code
10075 status collapsed
10076
10077 \begin_layout Plain Layout
10078 [1, 0]
10079 \end_layout
10080
10081 \end_inset
10082
10083  If 1, marks the layout as to be included in the document preamble rather
10084  than in the document body.
10085  This is useful for document classes that want such information as the title
10086  and author to appear in the preamble.
10087  Note that this works only for layouts for which the 
10088 \begin_inset Flex CharStyle:Code
10089 status collapsed
10090
10091 \begin_layout Plain Layout
10092 LatexType
10093 \end_layout
10094
10095 \end_inset
10096
10097  is 
10098 \begin_inset Flex CharStyle:Code
10099 status collapsed
10100
10101 \begin_layout Plain Layout
10102 Command
10103 \end_layout
10104
10105 \end_inset
10106
10107 .
10108 \end_layout
10109
10110 \begin_layout Description
10111 \begin_inset Flex CharStyle:Code
10112 status collapsed
10113
10114 \begin_layout Plain Layout
10115 InTitle
10116 \end_layout
10117
10118 \end_inset
10119
10120  
10121 \begin_inset Flex CharStyle:Code
10122 status collapsed
10123
10124 \begin_layout Plain Layout
10125 [1, 0]
10126 \end_layout
10127
10128 \end_inset
10129
10130  If 1, marks the layout as being part of a title block (see also the 
10131 \begin_inset Flex CharStyle:Code
10132 status collapsed
10133
10134 \begin_layout Plain Layout
10135 TitleLatexType
10136 \end_layout
10137
10138 \end_inset
10139
10140  and 
10141 \begin_inset Flex CharStyle:Code
10142 status collapsed
10143
10144 \begin_layout Plain Layout
10145 TitleLatexName
10146 \end_layout
10147
10148 \end_inset
10149
10150  global entries).
10151 \end_layout
10152
10153 \begin_layout Description
10154 \begin_inset Flex CharStyle:Code
10155 status collapsed
10156
10157 \begin_layout Plain Layout
10158 ItemSep
10159 \end_layout
10160
10161 \end_inset
10162
10163  [
10164 \begin_inset Flex CharStyle:Code
10165 status collapsed
10166
10167 \begin_layout Plain Layout
10168 float=0
10169 \end_layout
10170
10171 \end_inset
10172
10173 ] This provides extra space between paragraphs that have the same layout.
10174  If you put other layouts into an environment, each is separated with the
10175  environment's 
10176 \begin_inset Flex CharStyle:Code
10177 status collapsed
10178
10179 \begin_layout Plain Layout
10180 Parsep
10181 \end_layout
10182
10183 \end_inset
10184
10185 .
10186  But the whole items of the environment are additionally separated with
10187  this 
10188 \begin_inset Flex CharStyle:Code
10189 status collapsed
10190
10191 \begin_layout Plain Layout
10192 Itemsep
10193 \end_layout
10194
10195 \end_inset
10196
10197 .
10198  Note that this is a
10199 \emph on
10200  multiplier.
10201 \end_layout
10202
10203 \begin_layout Description
10204 \begin_inset Flex CharStyle:Code
10205 status collapsed
10206
10207 \begin_layout Plain Layout
10208 ItemTag
10209 \end_layout
10210
10211 \end_inset
10212
10213  [[FIXME]] (Used only with XML-type formats.)
10214 \end_layout
10215
10216 \begin_layout Description
10217 \begin_inset Flex CharStyle:Code
10218 status collapsed
10219
10220 \begin_layout Plain Layout
10221 KeepEmpty
10222 \end_layout
10223
10224 \end_inset
10225
10226  
10227 \begin_inset CommandInset label
10228 LatexCommand label
10229 name "des:KeepEmpty"
10230
10231 \end_inset
10232
10233 [
10234 \begin_inset Flex CharStyle:Code
10235 status collapsed
10236
10237 \begin_layout Plain Layout
10238
10239 \emph on
10240 0
10241 \end_layout
10242
10243 \end_inset
10244
10245
10246 \begin_inset Flex CharStyle:Code
10247 status collapsed
10248
10249 \begin_layout Plain Layout
10250 1
10251 \end_layout
10252
10253 \end_inset
10254
10255 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10256  lead to empty LaTeX output.
10257  There are some cases where this could be desirable however: in a letter
10258  template, the required fields can be provided as empty fields, so that
10259  people do not forget them; in some special classes, a layout can be used
10260  as some kind of break, which does not contain actual text.
10261 \end_layout
10262
10263 \begin_layout Description
10264 \begin_inset Flex CharStyle:Code
10265 status collapsed
10266
10267 \begin_layout Plain Layout
10268 LabelBottomsep
10269 \end_layout
10270
10271 \end_inset
10272
10273  [float=0] The vertical space between the label and the text body.
10274  Only used for labels that are above the text body (
10275 \begin_inset Flex CharStyle:Code
10276 status collapsed
10277
10278 \begin_layout Plain Layout
10279 Top_Environment
10280 \end_layout
10281
10282 \end_inset
10283
10284
10285 \begin_inset Flex CharStyle:Code
10286 status collapsed
10287
10288 \begin_layout Plain Layout
10289 Centered_Top_Environment
10290 \end_layout
10291
10292 \end_inset
10293
10294 ).
10295 \end_layout
10296
10297 \begin_layout Description
10298 \begin_inset Flex CharStyle:Code
10299 status collapsed
10300
10301 \begin_layout Plain Layout
10302 LabelCounter
10303 \end_layout
10304
10305 \end_inset
10306
10307  [
10308 \begin_inset Flex CharStyle:Code
10309 status collapsed
10310
10311 \begin_layout Plain Layout
10312 string=""
10313 \end_layout
10314
10315 \end_inset
10316
10317 ]
10318 \begin_inset Newline newline
10319 \end_inset
10320
10321 The name of the counter for automatic numbering.
10322  
10323 \begin_inset Newline newline
10324 \end_inset
10325
10326 This 
10327 \emph on
10328 must
10329 \emph default
10330  be given if 
10331 \begin_inset Flex CharStyle:Code
10332 status collapsed
10333
10334 \begin_layout Plain Layout
10335 LabelType
10336 \end_layout
10337
10338 \end_inset
10339
10340  is 
10341 \begin_inset Flex CharStyle:Code
10342 status collapsed
10343
10344 \begin_layout Plain Layout
10345 Counter
10346 \end_layout
10347
10348 \end_inset
10349
10350 .
10351  In that case, the counter will be stepped each time the layout appears.
10352  
10353 \begin_inset Newline newline
10354 \end_inset
10355
10356 This 
10357 \emph on
10358 may
10359 \emph default
10360  also be given if 
10361 \begin_inset Flex CharStyle:Code
10362 status collapsed
10363
10364 \begin_layout Plain Layout
10365 LabelType
10366 \end_layout
10367
10368 \end_inset
10369
10370  is 
10371 \begin_inset Flex CharStyle:Code
10372 status collapsed
10373
10374 \begin_layout Plain Layout
10375 Enumerate
10376 \end_layout
10377
10378 \end_inset
10379
10380 , though this case is a bit complicated.
10381  Suppose you declare 
10382 \begin_inset Quotes eld
10383 \end_inset
10384
10385
10386 \begin_inset Flex CharStyle:Code
10387 status collapsed
10388
10389 \begin_layout Plain Layout
10390 LabelCounter myenum
10391 \end_layout
10392
10393 \end_inset
10394
10395
10396 \begin_inset Quotes erd
10397 \end_inset
10398
10399 .
10400  Then the actual counters used are 
10401 \begin_inset Flex CharStyle:Code
10402 status collapsed
10403
10404 \begin_layout Plain Layout
10405 myenumi
10406 \end_layout
10407
10408 \end_inset
10409
10410
10411 \begin_inset Flex CharStyle:Code
10412 status collapsed
10413
10414 \begin_layout Plain Layout
10415 myenumii
10416 \end_layout
10417
10418 \end_inset
10419
10420
10421 \begin_inset Flex CharStyle:Code
10422 status collapsed
10423
10424 \begin_layout Plain Layout
10425 myenumiii
10426 \end_layout
10427
10428 \end_inset
10429
10430 , and 
10431 \begin_inset Flex CharStyle:Code
10432 status collapsed
10433
10434 \begin_layout Plain Layout
10435 myenumiv
10436 \end_layout
10437
10438 \end_inset
10439
10440 , much as in LaTeX.
10441  These counters must all be declared separately.
10442 \begin_inset Newline newline
10443 \end_inset
10444
10445 See Section 
10446 \begin_inset CommandInset ref
10447 LatexCommand ref
10448 reference "sub:Counters"
10449
10450 \end_inset
10451
10452  for details on counters.
10453 \end_layout
10454
10455 \begin_layout Description
10456 \begin_inset Flex CharStyle:Code
10457 status collapsed
10458
10459 \begin_layout Plain Layout
10460 LabelFont
10461 \end_layout
10462
10463 \end_inset
10464
10465  The font used for the label.
10466  See section
10467 \begin_inset space ~
10468 \end_inset
10469
10470
10471 \begin_inset CommandInset ref
10472 LatexCommand ref
10473 reference "sub:Font-description"
10474
10475 \end_inset
10476
10477 .
10478 \end_layout
10479
10480 \begin_layout Description
10481 \begin_inset Flex CharStyle:Code
10482 status collapsed
10483
10484 \begin_layout Plain Layout
10485 LabelIndent
10486 \end_layout
10487
10488 \end_inset
10489
10490  Text that indicates how far a label should be indented.
10491 \end_layout
10492
10493 \begin_layout Description
10494 \begin_inset Flex CharStyle:Code
10495 status collapsed
10496
10497 \begin_layout Plain Layout
10498 Labelsep
10499 \end_layout
10500
10501 \end_inset
10502
10503  [
10504 \begin_inset Flex CharStyle:Code
10505 status collapsed
10506
10507 \begin_layout Plain Layout
10508 string=""
10509 \end_layout
10510
10511 \end_inset
10512
10513 ] The horizontal space between the label and the text body.
10514  Only used for labels that are not above the text body.
10515 \end_layout
10516
10517 \begin_layout Description
10518 \begin_inset Flex CharStyle:Code
10519 status collapsed
10520
10521 \begin_layout Plain Layout
10522 LabelString
10523 \end_layout
10524
10525 \end_inset
10526
10527  [
10528 \begin_inset Flex CharStyle:Code
10529 status collapsed
10530
10531 \begin_layout Plain Layout
10532 string=""
10533 \end_layout
10534
10535 \end_inset
10536
10537 ] The string used for a label with a 
10538 \begin_inset Flex CharStyle:Code
10539 status collapsed
10540
10541 \begin_layout Plain Layout
10542 Static
10543 \end_layout
10544
10545 \end_inset
10546
10547  labeltype.
10548  When 
10549 \begin_inset Flex CharStyle:Code
10550 status collapsed
10551
10552 \begin_layout Plain Layout
10553 LabelCounter
10554 \end_layout
10555
10556 \end_inset
10557
10558  is set, this string can be contain the special formatting commands described
10559  in Section 
10560 \begin_inset CommandInset ref
10561 LatexCommand ref
10562 reference "sub:Counters"
10563
10564 \end_inset
10565
10566 .
10567 \begin_inset Foot
10568 status collapsed
10569
10570 \begin_layout Plain Layout
10571 For the sake of backwards compatibility, the string 
10572 \begin_inset Flex CharStyle:Code
10573 status collapsed
10574
10575 \begin_layout Plain Layout
10576 @
10577 \emph on
10578 style-name
10579 \emph default
10580 @
10581 \end_layout
10582
10583 \end_inset
10584
10585  will be replaced by the expanded 
10586 \begin_inset Flex CharStyle:Code
10587 status collapsed
10588
10589 \begin_layout Plain Layout
10590 LabelString
10591 \end_layout
10592
10593 \end_inset
10594
10595  of style 
10596 \begin_inset Flex CharStyle:Code
10597 status collapsed
10598
10599 \begin_layout Plain Layout
10600
10601 \emph on
10602 style-name
10603 \end_layout
10604
10605 \end_inset
10606
10607 .
10608  This feature is now obsolete and should be replaced by the mechanisms of
10609  Section 
10610 \begin_inset CommandInset ref
10611 LatexCommand ref
10612 reference "sub:Counters"
10613
10614 \end_inset
10615
10616 .
10617 \end_layout
10618
10619 \end_inset
10620
10621
10622 \end_layout
10623
10624 \begin_layout Description
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  [
10635 \begin_inset Flex CharStyle:Code
10636 status collapsed
10637
10638 \begin_layout Plain Layout
10639 string=""
10640 \end_layout
10641
10642 \end_inset
10643
10644 ] This is used inside the appendix instead of 
10645 \begin_inset Flex CharStyle:Code
10646 status collapsed
10647
10648 \begin_layout Plain Layout
10649 LabelString
10650 \end_layout
10651
10652 \end_inset
10653
10654 .
10655  Note that every 
10656 \begin_inset Flex CharStyle:Code
10657 status collapsed
10658
10659 \begin_layout Plain Layout
10660 LabelString
10661 \end_layout
10662
10663 \end_inset
10664
10665  statement resets 
10666 \begin_inset Flex CharStyle:Code
10667 status collapsed
10668
10669 \begin_layout Plain Layout
10670 LabelStringAppendix
10671 \end_layout
10672
10673 \end_inset
10674
10675  too.
10676 \end_layout
10677
10678 \begin_layout Description
10679 \begin_inset Flex CharStyle:Code
10680 status collapsed
10681
10682 \begin_layout Plain Layout
10683 LabelTag
10684 \end_layout
10685
10686 \end_inset
10687
10688  [FIXME] (Used only with XML-type formats.)
10689 \end_layout
10690
10691 \begin_layout Description
10692 \begin_inset Flex CharStyle:Code
10693 status collapsed
10694
10695 \begin_layout Plain Layout
10696 LabelType
10697 \end_layout
10698
10699 \end_inset
10700
10701  [
10702 \begin_inset Flex CharStyle:Code
10703 status collapsed
10704
10705 \begin_layout Plain Layout
10706
10707 \emph on
10708 No_Label
10709 \emph default
10710 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10711  Enumerate, Itemize, Bibliography
10712 \end_layout
10713
10714 \end_inset
10715
10716
10717 \end_layout
10718
10719 \begin_deeper
10720 \begin_layout Itemize
10721 \begin_inset Flex CharStyle:Code
10722 status collapsed
10723
10724 \begin_layout Plain Layout
10725 Manual
10726 \end_layout
10727
10728 \end_inset
10729
10730  means the label is the very first word (up to the first real blank).
10731  Use protected spaces (like
10732 \begin_inset space ~
10733 \end_inset
10734
10735 that one) if you want more than one word as the label.
10736  
10737 \end_layout
10738
10739 \begin_layout Itemize
10740 \begin_inset Flex CharStyle:Code
10741 status collapsed
10742
10743 \begin_layout Plain Layout
10744 Static
10745 \end_layout
10746
10747 \end_inset
10748
10749  means the label is simply whatever 
10750 \begin_inset Flex CharStyle:Code
10751 status collapsed
10752
10753 \begin_layout Plain Layout
10754 LabelString
10755 \end_layout
10756
10757 \end_inset
10758
10759  declares it to be.
10760  Note that this really is `static'.
10761 \end_layout
10762
10763 \begin_layout Itemize
10764 \begin_inset Flex CharStyle:Code
10765 status collapsed
10766
10767 \begin_layout Plain Layout
10768 Top_Environment
10769 \end_layout
10770
10771 \end_inset
10772
10773  and 
10774 \begin_inset Flex CharStyle:Code
10775 status collapsed
10776
10777 \begin_layout Plain Layout
10778 Centered_Top_Environment
10779 \end_layout
10780
10781 \end_inset
10782
10783  are special cases of 
10784 \begin_inset Flex CharStyle:Code
10785 status collapsed
10786
10787 \begin_layout Plain Layout
10788 Static
10789 \end_layout
10790
10791 \end_inset
10792
10793 .
10794  The label will be printed above the paragraph, but only at the top of an
10795  environment or the top of a chain of paragraphs with this layout.
10796  This might be used with the 
10797 \begin_inset Flex CharStyle:MenuItem
10798 status collapsed
10799
10800 \begin_layout Plain Layout
10801 Abstract
10802 \end_layout
10803
10804 \end_inset
10805
10806  layout, for example.
10807 \end_layout
10808
10809 \begin_layout Itemize
10810 \begin_inset Flex CharStyle:Code
10811 status collapsed
10812
10813 \begin_layout Plain Layout
10814 Sensitive
10815 \end_layout
10816
10817 \end_inset
10818
10819  is a special case for the caption-labels 
10820 \begin_inset Quotes eld
10821 \end_inset
10822
10823 Figure
10824 \begin_inset Quotes erd
10825 \end_inset
10826
10827  and 
10828 \begin_inset Quotes eld
10829 \end_inset
10830
10831 Table
10832 \begin_inset Quotes erd
10833 \end_inset
10834
10835 .
10836  
10837 \begin_inset Flex CharStyle:Code
10838 status collapsed
10839
10840 \begin_layout Plain Layout
10841 Sensitive
10842 \end_layout
10843
10844 \end_inset
10845
10846  means the (hardcoded) label string depends on the kind of float: It is
10847  hardcoded to be `FloatType N', where N is the value of the counter associated
10848  with the float.
10849 \end_layout
10850
10851 \begin_layout Itemize
10852 The 
10853 \begin_inset Flex CharStyle:Code
10854 status collapsed
10855
10856 \begin_layout Plain Layout
10857 Counter
10858 \end_layout
10859
10860 \end_inset
10861
10862  label type defines automatically numbered labels.
10863  The 
10864 \begin_inset Flex CharStyle:Code
10865 status collapsed
10866
10867 \begin_layout Plain Layout
10868 LabelString
10869 \end_layout
10870
10871 \end_inset
10872
10873  will be expanded to resolve any counter references it contains: For example,
10874  it might be 
10875 \begin_inset Quotes eld
10876 \end_inset
10877
10878
10879 \begin_inset Flex CharStyle:Code
10880 status collapsed
10881
10882 \begin_layout Plain Layout
10883 Section 
10884 \backslash
10885 thechapter.
10886 \backslash
10887 thesection
10888 \end_layout
10889
10890 \end_inset
10891
10892
10893 \begin_inset Quotes erd
10894 \end_inset
10895
10896 .
10897  See Section 
10898 \begin_inset CommandInset ref
10899 LatexCommand ref
10900 reference "sub:Counters"
10901
10902 \end_inset
10903
10904  for more information on counters.
10905 \end_layout
10906
10907 \begin_layout Itemize
10908 \begin_inset Flex CharStyle:Code
10909 status collapsed
10910
10911 \begin_layout Plain Layout
10912 Enumerate
10913 \end_layout
10914
10915 \end_inset
10916
10917  produces the usual sort of enumeration labels.
10918  At present, it is hardcoded to use Arabic numerals, lowercase letters,
10919  small Roman numerals, and uppercase letters for the four possible depths.
10920 \end_layout
10921
10922 \begin_layout Itemize
10923 \begin_inset Flex CharStyle:Code
10924 status collapsed
10925
10926 \begin_layout Plain Layout
10927 Itemize
10928 \end_layout
10929
10930 \end_inset
10931
10932  produces various bullets at the different levels.
10933  It is also hardcoded.
10934 \end_layout
10935
10936 \begin_layout Itemize
10937 \begin_inset Flex CharStyle:Code
10938 status collapsed
10939
10940 \begin_layout Plain Layout
10941 Bibliography
10942 \end_layout
10943
10944 \end_inset
10945
10946  is used internally by LyX and should be used only with 
10947 \begin_inset Flex CharStyle:Code
10948 status collapsed
10949
10950 \begin_layout Plain Layout
10951 LatexType BibEnvironment
10952 \end_layout
10953
10954 \end_inset
10955
10956 .
10957 \end_layout
10958
10959 \end_deeper
10960 \begin_layout Description
10961 \begin_inset Flex CharStyle:Code
10962 status collapsed
10963
10964 \begin_layout Plain Layout
10965 LangPreamble
10966 \end_layout
10967
10968 \end_inset
10969
10970  Like 
10971 \begin_inset Flex CharStyle:Code
10972 status collapsed
10973
10974 \begin_layout Plain Layout
10975 BabelPreamble
10976 \end_layout
10977
10978 \end_inset
10979
10980 , but this preamble snippet occurs independently from the babel package,
10981  and only for the document language.
10982  Must end with 
10983 \begin_inset Quotes eld
10984 \end_inset
10985
10986
10987 \begin_inset Flex CharStyle:Code
10988 status collapsed
10989
10990 \begin_layout Plain Layout
10991 EndLangPreamble
10992 \end_layout
10993
10994 \end_inset
10995
10996
10997 \begin_inset Quotes erd
10998 \end_inset
10999
11000 .
11001 \end_layout
11002
11003 \begin_deeper
11004 \begin_layout Standard
11005 If the style defines text that appears in the typeset document, it may use
11006  
11007 \begin_inset Flex CharStyle:Code
11008 status collapsed
11009
11010 \begin_layout Plain Layout
11011 LangPreamble
11012 \end_layout
11013
11014 \end_inset
11015
11016  and 
11017 \begin_inset Flex CharStyle:Code
11018 status collapsed
11019
11020 \begin_layout Plain Layout
11021 BabelPreamble
11022 \end_layout
11023
11024 \end_inset
11025
11026  to support non-english and even multilanguage documents correctly.
11027  The following excerpt (from the 
11028 \begin_inset Flex CharStyle:Code
11029 status collapsed
11030
11031 \begin_layout Plain Layout
11032 theorems-ams.inc
11033 \end_layout
11034
11035 \end_inset
11036
11037  file) shows how this works:
11038 \end_layout
11039
11040 \begin_layout LyX-Code
11041 Preamble
11042 \end_layout
11043
11044 \begin_layout LyX-Code
11045   
11046 \backslash
11047 theoremstyle{remark}
11048 \end_layout
11049
11050 \begin_layout LyX-Code
11051   
11052 \backslash
11053 newtheorem{claim}[thm]{
11054 \backslash
11055 protect
11056 \backslash
11057 claimname}
11058 \end_layout
11059
11060 \begin_layout LyX-Code
11061 EndPreamble
11062 \end_layout
11063
11064 \begin_layout LyX-Code
11065 LangPreamble
11066 \end_layout
11067
11068 \begin_layout LyX-Code
11069   
11070 \backslash
11071 providecommand{
11072 \backslash
11073 claimname}{_(Claim)}
11074 \end_layout
11075
11076 \begin_layout LyX-Code
11077
11078 \end_layout
11079
11080 \begin_layout LyX-Code
11081 EndLangPreamble
11082 \end_layout
11083
11084 \begin_layout LyX-Code
11085 BabelPreamble
11086 \end_layout
11087
11088 \begin_layout LyX-Code
11089     
11090 \backslash
11091 addto
11092 \backslash
11093 captions$$lang{
11094 \backslash
11095 renewcommand{
11096 \backslash
11097 claimname}{_(Claim)}}
11098 \end_layout
11099
11100 \begin_layout LyX-Code
11101 EndBabelPreamble
11102 \end_layout
11103
11104 \begin_layout Standard
11105 The key to correct translation of the user visible text is the definition
11106  of the command 
11107 \begin_inset Flex CharStyle:Code
11108 status collapsed
11109
11110 \begin_layout Plain Layout
11111
11112 \backslash
11113 claimname
11114 \end_layout
11115
11116 \end_inset
11117
11118  in the language preamble.
11119  This command holds the name of the theorem that will appear in the output.
11120  The 
11121 \begin_inset Flex CharStyle:Code
11122 status collapsed
11123
11124 \begin_layout Plain Layout
11125 BabelPreamble
11126 \end_layout
11127
11128 \end_inset
11129
11130  then uses the commands offered by the babel package to redefine 
11131 \begin_inset Flex CharStyle:Code
11132 status collapsed
11133
11134 \begin_layout Plain Layout
11135
11136 \backslash
11137 claimname
11138 \end_layout
11139
11140 \end_inset
11141
11142  for each used language in multilanguage documents.
11143 \end_layout
11144
11145 \end_deeper
11146 \begin_layout Description
11147 \begin_inset Flex CharStyle:Code
11148 status collapsed
11149
11150 \begin_layout Plain Layout
11151 LatexName
11152 \end_layout
11153
11154 \end_inset
11155
11156  The name of the corresponding LaTeX stuff.
11157  Either the environment or command name.
11158 \end_layout
11159
11160 \begin_layout Description
11161 \begin_inset Flex CharStyle:Code
11162 status collapsed
11163
11164 \begin_layout Plain Layout
11165 LatexParam
11166 \end_layout
11167
11168 \end_inset
11169
11170  An optional parameter for the corresponding 
11171 \begin_inset Flex CharStyle:Code
11172 status collapsed
11173
11174 \begin_layout Plain Layout
11175 LatexName
11176 \end_layout
11177
11178 \end_inset
11179
11180  stuff.
11181  This parameter cannot be changed from within LyX.
11182 \end_layout
11183
11184 \begin_layout Description
11185 \begin_inset Flex CharStyle:Code
11186 status collapsed
11187
11188 \begin_layout Plain Layout
11189 LatexType
11190 \end_layout
11191
11192 \end_inset
11193
11194  
11195 \begin_inset CommandInset label
11196 LatexCommand label
11197 name "des:LatexType"
11198
11199 \end_inset
11200
11201 [
11202 \begin_inset Flex CharStyle:Code
11203 status collapsed
11204
11205 \begin_layout Plain Layout
11206
11207 \emph on
11208 Paragraph
11209 \emph default
11210 , Command, Environment, Item_Environment,
11211 \end_layout
11212
11213 \end_inset
11214
11215  
11216 \begin_inset Flex CharStyle:Code
11217 status collapsed
11218
11219 \begin_layout Plain Layout
11220 List_Environment, Bib_Environment
11221 \end_layout
11222
11223 \end_inset
11224
11225 ] How the layout should be translated into LaTeX.
11226 \begin_inset Foot
11227 status collapsed
11228
11229 \begin_layout Plain Layout
11230 \begin_inset Flex CharStyle:Code
11231 status collapsed
11232
11233 \begin_layout Plain Layout
11234 LatexType
11235 \end_layout
11236
11237 \end_inset
11238
11239  is perhaps a bit misleading, since these rules apply to SGML classes, too.
11240  Visit the SGML class files for specific examples.
11241 \end_layout
11242
11243 \end_inset
11244
11245
11246 \end_layout
11247
11248 \begin_deeper
11249 \begin_layout Itemize
11250 \begin_inset Flex CharStyle:Code
11251 status collapsed
11252
11253 \begin_layout Plain Layout
11254 Paragraph
11255 \end_layout
11256
11257 \end_inset
11258
11259  means nothing special.
11260  
11261 \end_layout
11262
11263 \begin_layout Itemize
11264 \begin_inset Flex CharStyle:Code
11265 status collapsed
11266
11267 \begin_layout Plain Layout
11268 Command
11269 \end_layout
11270
11271 \end_inset
11272
11273  means 
11274 \begin_inset Flex CharStyle:Code
11275 status collapsed
11276
11277 \begin_layout Plain Layout
11278
11279 \backslash
11280
11281 \emph on
11282 LatexName
11283 \emph default
11284 {\SpecialChar \ldots{}
11285 }
11286 \end_layout
11287
11288 \end_inset
11289
11290 .
11291 \end_layout
11292
11293 \begin_layout Itemize
11294 \begin_inset Flex CharStyle:Code
11295 status collapsed
11296
11297 \begin_layout Plain Layout
11298 Environment
11299 \end_layout
11300
11301 \end_inset
11302
11303  means 
11304 \begin_inset Flex CharStyle:Code
11305 status collapsed
11306
11307 \begin_layout Plain Layout
11308
11309 \backslash
11310 begin{
11311 \emph on
11312 LatexName
11313 \emph default
11314 }\SpecialChar \ldots{}
11315
11316 \backslash
11317 end{
11318 \emph on
11319 LatexName
11320 \emph default
11321 }
11322 \end_layout
11323
11324 \end_inset
11325
11326 .
11327  
11328 \end_layout
11329
11330 \begin_layout Itemize
11331 \begin_inset Flex CharStyle:Code
11332 status collapsed
11333
11334 \begin_layout Plain Layout
11335 Item_Environment
11336 \end_layout
11337
11338 \end_inset
11339
11340  is the same as 
11341 \begin_inset Flex CharStyle:Code
11342 status collapsed
11343
11344 \begin_layout Plain Layout
11345 Environment
11346 \end_layout
11347
11348 \end_inset
11349
11350 , except that an 
11351 \begin_inset Flex CharStyle:Code
11352 status collapsed
11353
11354 \begin_layout Plain Layout
11355
11356 \backslash
11357 item
11358 \end_layout
11359
11360 \end_inset
11361
11362  is generated for each paragraph of this environment.
11363  
11364 \end_layout
11365
11366 \begin_layout Itemize
11367 \begin_inset Flex CharStyle:Code
11368 status collapsed
11369
11370 \begin_layout Plain Layout
11371 List_Environment
11372 \end_layout
11373
11374 \end_inset
11375
11376  is the same as 
11377 \begin_inset Flex CharStyle:Code
11378 status collapsed
11379
11380 \begin_layout Plain Layout
11381 Item_Environment
11382 \end_layout
11383
11384 \end_inset
11385
11386 , except that 
11387 \begin_inset Flex CharStyle:Code
11388 status collapsed
11389
11390 \begin_layout Plain Layout
11391 LabelWidthString
11392 \end_layout
11393
11394 \end_inset
11395
11396  is passed as an argument to the environment.
11397  
11398 \begin_inset Flex CharStyle:Code
11399 status collapsed
11400
11401 \begin_layout Plain Layout
11402 LabelWidthString
11403 \end_layout
11404
11405 \end_inset
11406
11407  can be defined in the 
11408 \begin_inset Flex CharStyle:MenuItem
11409 status collapsed
11410
11411 \begin_layout Plain Layout
11412
11413 \bar under
11414 L
11415 \bar default
11416 ayout\SpecialChar \menuseparator
11417
11418 \bar under
11419 P
11420 \bar default
11421 aragraph
11422 \end_layout
11423
11424 \end_inset
11425
11426  dialog.
11427  
11428 \end_layout
11429
11430 \begin_layout Standard
11431 Putting the last few things together, the LaTeX output will be either: 
11432 \end_layout
11433
11434 \begin_layout LyX-Code
11435
11436 \backslash
11437 latexname[latexparam]{\SpecialChar \ldots{}
11438 }
11439 \end_layout
11440
11441 \begin_layout Standard
11442 or: 
11443 \end_layout
11444
11445 \begin_layout LyX-Code
11446
11447 \backslash
11448 begin{latexname}[latexparam] \SpecialChar \ldots{}
11449  
11450 \backslash
11451 end{latexname}.
11452 \end_layout
11453
11454 \begin_layout Standard
11455 depending upon the LaTeX type.
11456 \end_layout
11457
11458 \end_deeper
11459 \begin_layout Description
11460 \begin_inset Flex CharStyle:Code
11461 status collapsed
11462
11463 \begin_layout Plain Layout
11464 LeftMargin
11465 \end_layout
11466
11467 \end_inset
11468
11469  [
11470 \begin_inset Flex CharStyle:Code
11471 status collapsed
11472
11473 \begin_layout Plain Layout
11474 string=""
11475 \end_layout
11476
11477 \end_inset
11478
11479 ] If you put layouts into environments, the leftmargins are not simply added,
11480  but added with a factor 
11481 \begin_inset Formula $\frac{4}{depth+4}$
11482 \end_inset
11483
11484 .
11485  Note that this parameter is also used when the margin is defined as 
11486 \begin_inset Flex CharStyle:Code
11487 status collapsed
11488
11489 \begin_layout Plain Layout
11490 Manual
11491 \end_layout
11492
11493 \end_inset
11494
11495  or 
11496 \begin_inset Flex CharStyle:Code
11497 status collapsed
11498
11499 \begin_layout Plain Layout
11500 Dynamic
11501 \end_layout
11502
11503 \end_inset
11504
11505 .
11506  Then it is added to the manual or dynamic margin.
11507  
11508 \begin_inset Newline newline
11509 \end_inset
11510
11511 The argument is passed as a string.
11512  For example 
11513 \begin_inset Quotes eld
11514 \end_inset
11515
11516
11517 \begin_inset Flex CharStyle:Code
11518 status collapsed
11519
11520 \begin_layout Plain Layout
11521 MM
11522 \end_layout
11523
11524 \end_inset
11525
11526
11527 \begin_inset Quotes erd
11528 \end_inset
11529
11530  means that the paragraph is indented with the width of 
11531 \begin_inset Quotes eld
11532 \end_inset
11533
11534
11535 \begin_inset Flex CharStyle:Code
11536 status collapsed
11537
11538 \begin_layout Plain Layout
11539 MM
11540 \end_layout
11541
11542 \end_inset
11543
11544
11545 \begin_inset Quotes erd
11546 \end_inset
11547
11548  in the normal font.
11549  You can get a negative width by prefixing the string with 
11550 \begin_inset Quotes eld
11551 \end_inset
11552
11553
11554 \begin_inset Flex CharStyle:Code
11555 status collapsed
11556
11557 \begin_layout Plain Layout
11558 -
11559 \end_layout
11560
11561 \end_inset
11562
11563
11564 \begin_inset Quotes erd
11565 \end_inset
11566
11567 .
11568  This way was chosen so that the look is the same with each used screen
11569  font.
11570  
11571 \end_layout
11572
11573 \begin_layout Description
11574 \begin_inset Flex CharStyle:Code
11575 status collapsed
11576
11577 \begin_layout Plain Layout
11578 Margin
11579 \end_layout
11580
11581 \end_inset
11582
11583  [
11584 \begin_inset Flex CharStyle:Code
11585 status collapsed
11586
11587 \begin_layout Plain Layout
11588
11589 \emph on
11590 Static
11591 \emph default
11592 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11593 \end_layout
11594
11595 \end_inset
11596
11597
11598 \begin_inset Newline newline
11599 \end_inset
11600
11601 The kind of margin that the layout has on the left side.
11602  
11603 \begin_inset Flex CharStyle:Code
11604 status collapsed
11605
11606 \begin_layout Plain Layout
11607 Static
11608 \end_layout
11609
11610 \end_inset
11611
11612  just means a fixed margin.
11613  
11614 \begin_inset Flex CharStyle:Code
11615 status collapsed
11616
11617 \begin_layout Plain Layout
11618 Manual
11619 \end_layout
11620
11621 \end_inset
11622
11623  means that the left margin depends on the string entered in the 
11624 \begin_inset Flex CharStyle:MenuItem
11625 status collapsed
11626
11627 \begin_layout Plain Layout
11628 Edit\SpecialChar \menuseparator
11629 Paragraph
11630 \begin_inset space ~
11631 \end_inset
11632
11633 Settings
11634 \end_layout
11635
11636 \end_inset
11637
11638  dialog.
11639  This is used to typeset nice lists without tabulators.
11640  
11641 \begin_inset Flex CharStyle:Code
11642 status collapsed
11643
11644 \begin_layout Plain Layout
11645 Dynamic
11646 \end_layout
11647
11648 \end_inset
11649
11650  means that the margin depends on the size of the label.
11651  This is used for automatic enumerated headlines.
11652  It is obvious that the headline 
11653 \begin_inset Quotes eld
11654 \end_inset
11655
11656 5.4.3.2.1 Very long headline
11657 \begin_inset Quotes erd
11658 \end_inset
11659
11660  must have a wider left margin (as wide as 
11661 \begin_inset Quotes eld
11662 \end_inset
11663
11664 5.4.3.2.1
11665 \begin_inset Quotes erd
11666 \end_inset
11667
11668  plus the space) than 
11669 \begin_inset Quotes eld
11670 \end_inset
11671
11672 3.2 Very long headline
11673 \begin_inset Quotes erd
11674 \end_inset
11675
11676 , even if standard 
11677 \begin_inset Quotes eld
11678 \end_inset
11679
11680 word processors
11681 \begin_inset Quotes erd
11682 \end_inset
11683
11684  are not able to do this.
11685  
11686 \begin_inset Flex CharStyle:Code
11687 status collapsed
11688
11689 \begin_layout Plain Layout
11690 First_Dynamic
11691 \end_layout
11692
11693 \end_inset
11694
11695  is similar, but only the very first row of the paragraph is dynamic, while
11696  the others are static; this is used, for example, for descriptions.
11697  
11698 \begin_inset Flex CharStyle:Code
11699 status collapsed
11700
11701 \begin_layout Plain Layout
11702 Right_Address_Box
11703 \end_layout
11704
11705 \end_inset
11706
11707  means the margin is chosen in a way that the longest row of this paragraph
11708  fits to the right margin.
11709  This is used to typeset an address on the right edge of the page.
11710 \end_layout
11711
11712 \begin_layout Description
11713 \begin_inset Flex CharStyle:Code
11714 status collapsed
11715
11716 \begin_layout Plain Layout
11717 NeedProtect
11718 \end_layout
11719
11720 \end_inset
11721
11722  [
11723 \begin_inset Flex CharStyle:Code
11724 status collapsed
11725
11726 \begin_layout Plain Layout
11727
11728 \emph on
11729 0
11730 \end_layout
11731
11732 \end_inset
11733
11734 ,
11735 \begin_inset Flex CharStyle:Code
11736 status collapsed
11737
11738 \begin_layout Plain Layout
11739 1
11740 \end_layout
11741
11742 \end_inset
11743
11744 ] Whether fragile commands in this layout should be 
11745 \begin_inset Flex CharStyle:Code
11746 status collapsed
11747
11748 \begin_layout Plain Layout
11749
11750 \backslash
11751 protect
11752 \end_layout
11753
11754 \end_inset
11755
11756 'ed.
11757  (Note: This is 
11758 \emph on
11759 not
11760 \emph default
11761  whether this command should itself be protected.)
11762 \end_layout
11763
11764 \begin_layout Description
11765 \begin_inset Flex CharStyle:Code
11766 status collapsed
11767
11768 \begin_layout Plain Layout
11769 Newline
11770 \end_layout
11771
11772 \end_inset
11773
11774  [
11775 \begin_inset Flex CharStyle:Code
11776 status collapsed
11777
11778 \begin_layout Plain Layout
11779 0
11780 \end_layout
11781
11782 \end_inset
11783
11784
11785 \begin_inset Flex CharStyle:Code
11786 status collapsed
11787
11788 \begin_layout Plain Layout
11789
11790 \emph on
11791 1
11792 \end_layout
11793
11794 \end_inset
11795
11796 ] Whether newlines are translated into LaTeX newlines (
11797 \begin_inset Flex CharStyle:Code
11798 status collapsed
11799
11800 \begin_layout Plain Layout
11801
11802 \backslash
11803
11804 \backslash
11805
11806 \end_layout
11807
11808 \end_inset
11809
11810 ) or not.
11811  The translation can be switched off to allow more comfortable LaTeX editing
11812  inside LyX.
11813 \end_layout
11814
11815 \begin_layout Description
11816 \begin_inset Flex CharStyle:Code
11817 status collapsed
11818
11819 \begin_layout Plain Layout
11820 NextNoIndent
11821 \end_layout
11822
11823 \end_inset
11824
11825  [
11826 \begin_inset Flex CharStyle:Code
11827 status collapsed
11828
11829 \begin_layout Plain Layout
11830 1
11831 \end_layout
11832
11833 \end_inset
11834
11835
11836 \begin_inset Flex CharStyle:Code
11837 status collapsed
11838
11839 \begin_layout Plain Layout
11840
11841 \emph on
11842 0
11843 \end_layout
11844
11845 \end_inset
11846
11847 ] Whether the following Paragraph is allowed to indent its very first row.
11848  
11849 \begin_inset Flex CharStyle:Code
11850 status collapsed
11851
11852 \begin_layout Plain Layout
11853 1
11854 \end_layout
11855
11856 \end_inset
11857
11858  means that it is not allowed to do so; 
11859 \begin_inset Flex CharStyle:Code
11860 status collapsed
11861
11862 \begin_layout Plain Layout
11863 0
11864 \end_layout
11865
11866 \end_inset
11867
11868  means it could do so if it wants to.
11869 \end_layout
11870
11871 \begin_layout Description
11872 \begin_inset Flex CharStyle:Code
11873 status collapsed
11874
11875 \begin_layout Plain Layout
11876 ObsoletedBy
11877 \end_layout
11878
11879 \end_inset
11880
11881  Name of a layout that has replaced this layout.
11882  This is used to rename a layout, while keeping backward compatibility.
11883 \end_layout
11884
11885 \begin_layout Description
11886 \begin_inset Flex CharStyle:Code
11887 status collapsed
11888
11889 \begin_layout Plain Layout
11890 OptionalArgs
11891 \end_layout
11892
11893 \end_inset
11894
11895  [
11896 \begin_inset Flex CharStyle:Code
11897 status collapsed
11898
11899 \begin_layout Plain Layout
11900 int=0
11901 \end_layout
11902
11903 \end_inset
11904
11905 ] The number of optional arguments that can be used with this layout.
11906  This is useful for things like section headings, and only makes sense with
11907  LaTeX.
11908  Note that, on output, the optional arguments will all precede any required
11909  arguments (see below).
11910  So one can have constructs like:
11911 \end_layout
11912
11913 \begin_deeper
11914 \begin_layout LyX-Code
11915
11916 \backslash
11917 mycmd[opt1]{req1}{contents of paragraph}
11918 \end_layout
11919
11920 \begin_layout Standard
11921 but one cannot have things like: 
11922 \end_layout
11923
11924 \begin_layout LyX-Code
11925
11926 \backslash
11927 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11928 \end_layout
11929
11930 \begin_layout Standard
11931 at least, not without ERT (with which you can have anything).
11932  
11933 \end_layout
11934
11935 \end_deeper
11936 \begin_layout Description
11937 \begin_inset Flex CharStyle:Code
11938 status collapsed
11939
11940 \begin_layout Plain Layout
11941 ParIndent
11942 \end_layout
11943
11944 \end_inset
11945
11946  [
11947 \begin_inset Flex CharStyle:Code
11948 status collapsed
11949
11950 \begin_layout Plain Layout
11951 string=""
11952 \end_layout
11953
11954 \end_inset
11955
11956 ] The indent of the very first line of a paragraph.
11957  The 
11958 \begin_inset Flex CharStyle:Code
11959 status collapsed
11960
11961 \begin_layout Plain Layout
11962 Parindent
11963 \end_layout
11964
11965 \end_inset
11966
11967  will be fixed for a certain layout.
11968  The exception is Standard layout, since the indentation of a Standard layout
11969  paragraph can be prohibited with 
11970 \begin_inset Flex CharStyle:Code
11971 status collapsed
11972
11973 \begin_layout Plain Layout
11974 NextNoIndent
11975 \end_layout
11976
11977 \end_inset
11978
11979 .
11980  Also, Standard layout paragraphs inside environments use the 
11981 \begin_inset Flex CharStyle:Code
11982 status collapsed
11983
11984 \begin_layout Plain Layout
11985 Parindent
11986 \end_layout
11987
11988 \end_inset
11989
11990  of the environment, not their native one.
11991  For example, Standard paragraphs inside an enumeration are not indented.
11992 \end_layout
11993
11994 \begin_layout Description
11995 \begin_inset Flex CharStyle:Code
11996 status collapsed
11997
11998 \begin_layout Plain Layout
11999 Parsep
12000 \end_layout
12001
12002 \end_inset
12003
12004  [
12005 \begin_inset Flex CharStyle:Code
12006 status collapsed
12007
12008 \begin_layout Plain Layout
12009 float=0
12010 \end_layout
12011
12012 \end_inset
12013
12014 ] The vertical space between two paragraphs of this layout.
12015 \end_layout
12016
12017 \begin_layout Description
12018 \begin_inset Flex CharStyle:Code
12019 status collapsed
12020
12021 \begin_layout Plain Layout
12022 Parskip
12023 \end_layout
12024
12025 \end_inset
12026
12027  [
12028 \begin_inset Flex CharStyle:Code
12029 status collapsed
12030
12031 \begin_layout Plain Layout
12032 float=0
12033 \end_layout
12034
12035 \end_inset
12036
12037 ] LyX allows the user to choose either 
12038 \begin_inset Quotes eld
12039 \end_inset
12040
12041 indent
12042 \begin_inset Quotes erd
12043 \end_inset
12044
12045  or 
12046 \begin_inset Quotes eld
12047 \end_inset
12048
12049 skip
12050 \begin_inset Quotes erd
12051 \end_inset
12052
12053  to typeset a document.
12054  When 
12055 \begin_inset Quotes eld
12056 \end_inset
12057
12058 indent
12059 \begin_inset Quotes erd
12060 \end_inset
12061
12062  is chosen, this value is completely ignored.
12063  When 
12064 \begin_inset Quotes eld
12065 \end_inset
12066
12067 skip
12068 \begin_inset Quotes erd
12069 \end_inset
12070
12071  is chosen, the parindent of a LaTeXtype 
12072 \begin_inset Quotes eld
12073 \end_inset
12074
12075 Paragraph
12076 \begin_inset Quotes erd
12077 \end_inset
12078
12079  layout is ignored and all paragraphs are separated by this parskip argument.
12080  The vertical space is calculated with 
12081 \begin_inset Flex CharStyle:Code
12082 status collapsed
12083
12084 \begin_layout Plain Layout
12085 value
12086 \begin_inset space ~
12087 \end_inset
12088
12089 * DefaultHeight
12090 \end_layout
12091
12092 \end_inset
12093
12094  where 
12095 \begin_inset Flex CharStyle:Code
12096 status collapsed
12097
12098 \begin_layout Plain Layout
12099 DefaultHeight
12100 \end_layout
12101
12102 \end_inset
12103
12104  is the height of a row with the normal font.
12105  This way, the look stays the same with different screen fonts.
12106 \end_layout
12107
12108 \begin_layout Description
12109 \begin_inset Flex CharStyle:Code
12110 status collapsed
12111
12112 \begin_layout Plain Layout
12113 PassThru
12114 \end_layout
12115
12116 \end_inset
12117
12118  
12119 \begin_inset CommandInset label
12120 LatexCommand label
12121 name "des:PathThru"
12122
12123 \end_inset
12124
12125 [
12126 \begin_inset Flex CharStyle:Code
12127 status collapsed
12128
12129 \begin_layout Plain Layout
12130
12131 \emph on
12132 0
12133 \end_layout
12134
12135 \end_inset
12136
12137
12138 \begin_inset Flex CharStyle:Code
12139 status collapsed
12140
12141 \begin_layout Plain Layout
12142 1
12143 \end_layout
12144
12145 \end_inset
12146
12147 ] Whether the contents of this paragraph should be output in raw form, meaning
12148  without special translations that LaTeX would require.
12149 \end_layout
12150
12151 \begin_layout Description
12152 \begin_inset Flex CharStyle:Code
12153 status collapsed
12154
12155 \begin_layout Plain Layout
12156 Preamble
12157 \end_layout
12158
12159 \end_inset
12160
12161  
12162 \begin_inset CommandInset label
12163 LatexCommand label
12164 name "des:Preamble"
12165
12166 \end_inset
12167
12168 Information to be included in the LaTeX preamble when this style is used.
12169  Used to define macros, load packages, etc., required by this particular
12170  style.
12171  Must end with 
12172 \begin_inset Quotes eld
12173 \end_inset
12174
12175
12176 \begin_inset Flex CharStyle:Code
12177 status collapsed
12178
12179 \begin_layout Plain Layout
12180 EndPreamble
12181 \end_layout
12182
12183 \end_inset
12184
12185
12186 \begin_inset Quotes erd
12187 \end_inset
12188
12189 .
12190 \end_layout
12191
12192 \begin_layout Description
12193 \begin_inset Flex CharStyle:Code
12194 status collapsed
12195
12196 \begin_layout Plain Layout
12197 RefPrefix
12198 \end_layout
12199
12200 \end_inset
12201
12202  [
12203 \begin_inset Flex CharStyle:Code
12204 status collapsed
12205
12206 \begin_layout Plain Layout
12207 string
12208 \end_layout
12209
12210 \end_inset
12211
12212 ] The prefix to use when creating labels referring to paragraphs of this
12213  type.
12214  This allows the use of formatted references.
12215 \end_layout
12216
12217 \begin_layout Description
12218 \begin_inset Flex CharStyle:Code
12219 status collapsed
12220
12221 \begin_layout Plain Layout
12222 RequiredArgs
12223 \end_layout
12224
12225 \end_inset
12226
12227  [
12228 \begin_inset Flex CharStyle:Code
12229 status collapsed
12230
12231 \begin_layout Plain Layout
12232 int=0
12233 \end_layout
12234
12235 \end_inset
12236
12237 ] The number of required arguments that the LaTeX command or environment
12238  corresponding to this layout expects.
12239  In the case of a command, these are required arguments 
12240 \emph on
12241 other than
12242 \emph default
12243  that associated with the content of the paragraph itself.
12244  These do not actually have to be provided: LyX will output empty arguments
12245  if necessary.
12246  Note that optional arguments will be output before required arguments.
12247  See the discussion of the 
12248 \begin_inset Flex CharStyle:Code
12249 status collapsed
12250
12251 \begin_layout Plain Layout
12252 OptionalArgs
12253 \end_layout
12254
12255 \end_inset
12256
12257  tag above for more information.
12258 \end_layout
12259
12260 \begin_layout Description
12261 \begin_inset Flex CharStyle:Code
12262 status collapsed
12263
12264 \begin_layout Plain Layout
12265 Requires 
12266 \end_layout
12267
12268 \end_inset
12269
12270  [
12271 \begin_inset Flex CharStyle:Code
12272 status collapsed
12273
12274 \begin_layout Plain Layout
12275 string
12276 \end_layout
12277
12278 \end_inset
12279
12280
12281 \begin_inset CommandInset label
12282 LatexCommand label
12283 name "des:Requires"
12284
12285 \end_inset
12286
12287 Whether the layout requires the feature 
12288 \begin_inset Flex CharStyle:Code
12289 status collapsed
12290
12291 \begin_layout Plain Layout
12292 string
12293 \end_layout
12294
12295 \end_inset
12296
12297 .
12298  See the description of 
12299 \begin_inset Flex CharStyle:Code
12300 status collapsed
12301
12302 \begin_layout Plain Layout
12303 Provides
12304 \end_layout
12305
12306 \end_inset
12307
12308  above (page 
12309 \begin_inset CommandInset ref
12310 LatexCommand pageref
12311 reference "des:FreeSpacing"
12312
12313 \end_inset
12314
12315 ) for information on `features'.
12316  
12317 \end_layout
12318
12319 \begin_layout Description
12320 \begin_inset Flex CharStyle:Code
12321 status collapsed
12322
12323 \begin_layout Plain Layout
12324 RightMargin
12325 \end_layout
12326
12327 \end_inset
12328
12329  [
12330 \begin_inset Flex CharStyle:Code
12331 status collapsed
12332
12333 \begin_layout Plain Layout
12334 string=""
12335 \end_layout
12336
12337 \end_inset
12338
12339 ] Similar to 
12340 \begin_inset Flex CharStyle:Code
12341 status collapsed
12342
12343 \begin_layout Plain Layout
12344 LeftMargin
12345 \end_layout
12346
12347 \end_inset
12348
12349 .
12350 \end_layout
12351
12352 \begin_layout Description
12353 \begin_inset Flex CharStyle:Code
12354 status collapsed
12355
12356 \begin_layout Plain Layout
12357 Spacing
12358 \end_layout
12359
12360 \end_inset
12361
12362  [
12363 \begin_inset Flex CharStyle:Code
12364 status collapsed
12365
12366 \begin_layout Plain Layout
12367
12368 \emph on
12369 single
12370 \emph default
12371 , onehalf, double, other
12372 \end_layout
12373
12374 \end_inset
12375
12376  
12377 \emph on
12378 value
12379 \emph default
12380 ] This defines what the default spacing should be in the layout.
12381  The arguments 
12382 \begin_inset Flex CharStyle:Code
12383 status collapsed
12384
12385 \begin_layout Plain Layout
12386 single
12387 \end_layout
12388
12389 \end_inset
12390
12391
12392 \begin_inset Flex CharStyle:Code
12393 status collapsed
12394
12395 \begin_layout Plain Layout
12396 onehalf
12397 \end_layout
12398
12399 \end_inset
12400
12401  and 
12402 \begin_inset Flex CharStyle:Code
12403 status collapsed
12404
12405 \begin_layout Plain Layout
12406 double
12407 \end_layout
12408
12409 \end_inset
12410
12411  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12412  If you specify the argument 
12413 \begin_inset Flex CharStyle:Code
12414 status collapsed
12415
12416 \begin_layout Plain Layout
12417 other
12418 \end_layout
12419
12420 \end_inset
12421
12422 , then you should also provide a numerical argument which will be the actual
12423  multiplier value.
12424  Note that, contrary to other parameters, 
12425 \begin_inset Flex CharStyle:Code
12426 status collapsed
12427
12428 \begin_layout Plain Layout
12429 Spacing
12430 \end_layout
12431
12432 \end_inset
12433
12434  implies the generation of specific LaTeX code, using the package 
12435 \family roman
12436
12437 \begin_inset Flex CharStyle:Code
12438 status collapsed
12439
12440 \begin_layout Plain Layout
12441 setspace.sty
12442 \end_layout
12443
12444 \end_inset
12445
12446 .
12447 \end_layout
12448
12449 \begin_layout Description
12450 \begin_inset Flex CharStyle:Code
12451 status collapsed
12452
12453 \begin_layout Plain Layout
12454 Spellcheck
12455 \end_layout
12456
12457 \end_inset
12458
12459  [
12460 \begin_inset Flex CharStyle:Code
12461 status collapsed
12462
12463 \begin_layout Plain Layout
12464 0
12465 \end_layout
12466
12467 \end_inset
12468
12469 ,
12470 \begin_inset Flex CharStyle:Code
12471 status collapsed
12472
12473 \begin_layout Plain Layout
12474
12475 \emph on
12476 1
12477 \end_layout
12478
12479 \end_inset
12480
12481 ] Spellcheck paragraphs of this style.
12482  Default is true.
12483 \end_layout
12484
12485 \begin_layout Description
12486 \begin_inset Flex CharStyle:Code
12487 status collapsed
12488
12489 \begin_layout Plain Layout
12490 TextFont
12491 \end_layout
12492
12493 \end_inset
12494
12495  The font used for the text body .
12496  See section 
12497 \begin_inset CommandInset ref
12498 LatexCommand ref
12499 reference "sub:Font-description"
12500
12501 \end_inset
12502
12503 .
12504 \end_layout
12505
12506 \begin_layout Description
12507 \begin_inset Flex CharStyle:Code
12508 status collapsed
12509
12510 \begin_layout Plain Layout
12511 TocLevel
12512 \end_layout
12513
12514 \end_inset
12515
12516
12517 \series medium
12518  
12519 \begin_inset Flex CharStyle:Code
12520 status collapsed
12521
12522 \begin_layout Plain Layout
12523
12524 \series medium
12525 [int]
12526 \end_layout
12527
12528 \end_inset
12529
12530
12531 \series default
12532  The level of the style in the table of contents.
12533  This is used for automatic numbering of section headings.
12534 \end_layout
12535
12536 \begin_layout Description
12537 \begin_inset Flex CharStyle:Code
12538 status collapsed
12539
12540 \begin_layout Plain Layout
12541 TopSep
12542 \end_layout
12543
12544 \end_inset
12545
12546  [
12547 \begin_inset Flex CharStyle:Code
12548 status collapsed
12549
12550 \begin_layout Plain Layout
12551 float=0
12552 \end_layout
12553
12554 \end_inset
12555
12556 ] The vertical space with which the very first of a chain of paragraphs
12557  with this layout is separated from the previous paragraph.
12558  If the previous paragraph has another layout, the separations are not simply
12559  added, but the maximum is taken.
12560 \end_layout
12561
12562 \begin_layout Subsection
12563 Floats
12564 \begin_inset CommandInset label
12565 LatexCommand label
12566 name "sub:Floats"
12567
12568 \end_inset
12569
12570
12571 \end_layout
12572
12573 \begin_layout Standard
12574 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12575  define the floats (
12576 \begin_inset Flex CharStyle:MenuItem
12577 status collapsed
12578
12579 \begin_layout Plain Layout
12580 figure
12581 \end_layout
12582
12583 \end_inset
12584
12585
12586 \begin_inset Flex CharStyle:MenuItem
12587 status collapsed
12588
12589 \begin_layout Plain Layout
12590 table
12591 \end_layout
12592
12593 \end_inset
12594
12595 , \SpecialChar \ldots{}
12596 ) in the text class itself.
12597  Standard floats are included in the file 
12598 \begin_inset Flex CharStyle:Code
12599 status collapsed
12600
12601 \begin_layout Plain Layout
12602 stdfloats.inc
12603 \end_layout
12604
12605 \end_inset
12606
12607 , so you may have to do no more than add
12608 \end_layout
12609
12610 \begin_layout LyX-Code
12611 Input stdfloats.inc
12612 \end_layout
12613
12614 \begin_layout Standard
12615 to your layout file.
12616  If you want to implement a text class that proposes some other float types
12617  (like the AGU class bundled with LyX), the information below will hopefully
12618  help you:
12619 \end_layout
12620
12621 \begin_layout Description
12622 \begin_inset Flex CharStyle:Code
12623 status collapsed
12624
12625 \begin_layout Plain Layout
12626 Extension
12627 \end_layout
12628
12629 \end_inset
12630
12631  [
12632 \begin_inset Flex CharStyle:Code
12633 status collapsed
12634
12635 \begin_layout Plain Layout
12636 string
12637 \end_layout
12638
12639 \end_inset
12640
12641 =
12642 \begin_inset Quotes erd
12643 \end_inset
12644
12645
12646 \begin_inset Quotes erd
12647 \end_inset
12648
12649 ] The file name extension of an auxiliary file for the list of figures (or
12650  whatever).
12651  LaTeX writes the captions to this file.
12652 \end_layout
12653
12654 \begin_layout Description
12655 \begin_inset Flex CharStyle:Code
12656 status collapsed
12657
12658 \begin_layout Plain Layout
12659 GuiName
12660 \end_layout
12661
12662 \end_inset
12663
12664  [
12665 \begin_inset Flex CharStyle:Code
12666 status collapsed
12667
12668 \begin_layout Plain Layout
12669 string
12670 \end_layout
12671
12672 \end_inset
12673
12674 =
12675 \begin_inset Quotes erd
12676 \end_inset
12677
12678
12679 \begin_inset Quotes erd
12680 \end_inset
12681
12682 ] The string that will be used in the menus and also for the caption.
12683  This is translated to the current language if babel is used.
12684 \end_layout
12685
12686 \begin_layout Description
12687 \begin_inset Flex CharStyle:Code
12688 status collapsed
12689
12690 \begin_layout Plain Layout
12691 HTML*
12692 \end_layout
12693
12694 \end_inset
12695
12696  These are used for XHTML output.
12697  See 
12698 \begin_inset CommandInset ref
12699 LatexCommand ref
12700 reference "sec:Tags-for-XHTML"
12701
12702 \end_inset
12703
12704 .
12705 \end_layout
12706
12707 \begin_layout Description
12708 \begin_inset Flex CharStyle:Code
12709 status collapsed
12710
12711 \begin_layout Plain Layout
12712 ListCommand
12713 \end_layout
12714
12715 \end_inset
12716
12717  [
12718 \begin_inset Flex CharStyle:Code
12719 status collapsed
12720
12721 \begin_layout Plain Layout
12722 string
12723 \end_layout
12724
12725 \end_inset
12726
12727 =
12728 \begin_inset Quotes erd
12729 \end_inset
12730
12731
12732 \begin_inset Quotes erd
12733 \end_inset
12734
12735 ] The command used to generate a list of floats of this type; the leading
12736  `
12737 \backslash
12738 ' should be omitted.
12739  This 
12740 \emph on
12741 must
12742 \emph default
12743  be given if 
12744 \begin_inset Flex CharStyle:Code
12745 status collapsed
12746
12747 \begin_layout Plain Layout
12748 NeedsFloatPkg
12749 \end_layout
12750
12751 \end_inset
12752
12753  is false, since there is no standard way to generate this command.
12754  It is ignored if 
12755 \begin_inset Flex CharStyle:Code
12756 status collapsed
12757
12758 \begin_layout Plain Layout
12759 NeedsFloatPkg
12760 \end_layout
12761
12762 \end_inset
12763
12764  is true, since in that case there is a standard way.
12765 \end_layout
12766
12767 \begin_layout Description
12768 \begin_inset Flex CharStyle:Code
12769 status collapsed
12770
12771 \begin_layout Plain Layout
12772 ListName
12773 \end_layout
12774
12775 \end_inset
12776
12777  [
12778 \begin_inset Flex CharStyle:Code
12779 status collapsed
12780
12781 \begin_layout Plain Layout
12782 string
12783 \end_layout
12784
12785 \end_inset
12786
12787 =
12788 \begin_inset Quotes erd
12789 \end_inset
12790
12791
12792 \begin_inset Quotes erd
12793 \end_inset
12794
12795 ] A title for a list of floats of this kind (list of figures, tables, or
12796  whatever).
12797  It is used for the screen label within LyX; it is passed to LaTeX for use
12798  as the title there; and it is used as the title in XHTML output.
12799  It will be translated to the document language.
12800 \end_layout
12801
12802 \begin_layout Description
12803 \begin_inset Flex CharStyle:Code
12804 status collapsed
12805
12806 \begin_layout Plain Layout
12807 NeedsFloatPkg
12808 \end_layout
12809
12810 \end_inset
12811
12812  [
12813 \begin_inset Flex CharStyle:Code
12814 status open
12815
12816 \begin_layout Plain Layout
12817 0
12818 \end_layout
12819
12820 \end_inset
12821
12822
12823 \begin_inset Flex CharStyle:Code
12824 status collapsed
12825
12826 \begin_layout Plain Layout
12827
12828 \emph on
12829 1
12830 \end_layout
12831
12832 \end_inset
12833
12834 ] Indicates whether the float is already defined in the document class or
12835  if we instead need to load 
12836 \begin_inset Flex CharStyle:Code
12837 status collapsed
12838
12839 \begin_layout Plain Layout
12840 float.sty
12841 \end_layout
12842
12843 \end_inset
12844
12845  and use what it provides.
12846  The default is 
12847 \begin_inset Flex CharStyle:Code
12848 status collapsed
12849
12850 \begin_layout Plain Layout
12851 1
12852 \end_layout
12853
12854 \end_inset
12855
12856 , which means: use 
12857 \begin_inset Flex CharStyle:Code
12858 status collapsed
12859
12860 \begin_layout Plain Layout
12861 float.sty
12862 \end_layout
12863
12864 \end_inset
12865
12866 .
12867  It should be set to 
12868 \begin_inset Flex CharStyle:Code
12869 status collapsed
12870
12871 \begin_layout Plain Layout
12872 0
12873 \end_layout
12874
12875 \end_inset
12876
12877  if the float is already defined by the LaTeX document class.
12878 \end_layout
12879
12880 \begin_layout Description
12881 \begin_inset Flex CharStyle:Code
12882 status collapsed
12883
12884 \begin_layout Plain Layout
12885 NumberWithin
12886 \end_layout
12887
12888 \end_inset
12889
12890  [
12891 \begin_inset Flex CharStyle:Code
12892 status collapsed
12893
12894 \begin_layout Plain Layout
12895 string
12896 \end_layout
12897
12898 \end_inset
12899
12900 =
12901 \begin_inset Quotes erd
12902 \end_inset
12903
12904
12905 \begin_inset Quotes erd
12906 \end_inset
12907
12908 ] This (optional) argument determines whether floats of this class will
12909  be numbered within some sectional unit of the document.
12910  For example, if within is equal to 
12911 \begin_inset Flex CharStyle:Code
12912 status collapsed
12913
12914 \begin_layout Plain Layout
12915 chapter
12916 \end_layout
12917
12918 \end_inset
12919
12920 , the floats will be numbered within chapters.
12921  
12922 \end_layout
12923
12924 \begin_layout Description
12925 \begin_inset Flex CharStyle:Code
12926 status collapsed
12927
12928 \begin_layout Plain Layout
12929 Placement
12930 \end_layout
12931
12932 \end_inset
12933
12934  [
12935 \begin_inset Flex CharStyle:Code
12936 status collapsed
12937
12938 \begin_layout Plain Layout
12939 string
12940 \end_layout
12941
12942 \end_inset
12943
12944 =
12945 \begin_inset Quotes erd
12946 \end_inset
12947
12948
12949 \begin_inset Quotes erd
12950 \end_inset
12951
12952 ] The default placement for the given class of floats.
12953  The string should be as in standard LaTeX: 
12954 \begin_inset Flex CharStyle:Code
12955 status collapsed
12956
12957 \begin_layout Plain Layout
12958 t
12959 \end_layout
12960
12961 \end_inset
12962
12963
12964 \begin_inset Flex CharStyle:Code
12965 status collapsed
12966
12967 \begin_layout Plain Layout
12968 b
12969 \end_layout
12970
12971 \end_inset
12972
12973
12974 \begin_inset Flex CharStyle:Code
12975 status collapsed
12976
12977 \begin_layout Plain Layout
12978 p
12979 \end_layout
12980
12981 \end_inset
12982
12983  and 
12984 \begin_inset Flex CharStyle:Code
12985 status collapsed
12986
12987 \begin_layout Plain Layout
12988 h
12989 \end_layout
12990
12991 \end_inset
12992
12993  for top, bottom, page, and here, respectively.
12994 \begin_inset Foot
12995 status collapsed
12996
12997 \begin_layout Plain Layout
12998 Note that the order of these letters in the string is irrelevant, like in
12999  LaTeX.
13000 \end_layout
13001
13002 \end_inset
13003
13004  On top of that there is a new type, 
13005 \begin_inset Flex CharStyle:Code
13006 status collapsed
13007
13008 \begin_layout Plain Layout
13009 H
13010 \end_layout
13011
13012 \end_inset
13013
13014 , which does not really correspond to a float, since it means: put it 
13015 \begin_inset Quotes eld
13016 \end_inset
13017
13018 here
13019 \begin_inset Quotes erd
13020 \end_inset
13021
13022  and nowhere else.
13023  Note however that the 
13024 \begin_inset Flex CharStyle:Code
13025 status collapsed
13026
13027 \begin_layout Plain Layout
13028 H
13029 \end_layout
13030
13031 \end_inset
13032
13033  specifier is special and, because of implementation details, cannot be
13034  used in non-built in float types.
13035  If you do not understand what this means, just use 
13036 \begin_inset Quotes eld
13037 \end_inset
13038
13039
13040 \begin_inset Flex CharStyle:Code
13041 status collapsed
13042
13043 \begin_layout Plain Layout
13044 tbp
13045 \end_layout
13046
13047 \end_inset
13048
13049
13050 \begin_inset Quotes erd
13051 \end_inset
13052
13053 .
13054 \end_layout
13055
13056 \begin_layout Description
13057 \begin_inset Flex CharStyle:Code
13058 status collapsed
13059
13060 \begin_layout Plain Layout
13061 RefPrefix
13062 \end_layout
13063
13064 \end_inset
13065
13066  [
13067 \begin_inset Flex CharStyle:Code
13068 status collapsed
13069
13070 \begin_layout Plain Layout
13071 string
13072 \end_layout
13073
13074 \end_inset
13075
13076 ] The prefix to use when creating labels referring to floats of this type.
13077  This allows the use of formatted references.
13078  Note that you can remove any 
13079 \begin_inset Flex CharStyle:Code
13080 status collapsed
13081
13082 \begin_layout Plain Layout
13083 RefPrefix
13084 \end_layout
13085
13086 \end_inset
13087
13088  set by a copied style by using the special value 
13089 \begin_inset Quotes eld
13090 \end_inset
13091
13092 OFF
13093 \begin_inset Quotes erd
13094 \end_inset
13095
13096 , which must be all caps.
13097 \end_layout
13098
13099 \begin_layout Description
13100 \begin_inset Flex CharStyle:Code
13101 status collapsed
13102
13103 \begin_layout Plain Layout
13104 Style
13105 \end_layout
13106
13107 \end_inset
13108
13109  [
13110 \begin_inset Flex CharStyle:Code
13111 status collapsed
13112
13113 \begin_layout Plain Layout
13114 string
13115 \end_layout
13116
13117 \end_inset
13118
13119 =
13120 \begin_inset Quotes erd
13121 \end_inset
13122
13123
13124 \begin_inset Quotes erd
13125 \end_inset
13126
13127 ] The style used when defining the float using 
13128 \begin_inset Flex CharStyle:Code
13129 status collapsed
13130
13131 \begin_layout Plain Layout
13132
13133 \backslash
13134 newfloat
13135 \end_layout
13136
13137 \end_inset
13138
13139 .
13140 \end_layout
13141
13142 \begin_layout Description
13143 \begin_inset Flex CharStyle:Code
13144 status collapsed
13145
13146 \begin_layout Plain Layout
13147 Type
13148 \end_layout
13149
13150 \end_inset
13151
13152  [
13153 \begin_inset Flex CharStyle:Code
13154 status collapsed
13155
13156 \begin_layout Plain Layout
13157 string
13158 \end_layout
13159
13160 \end_inset
13161
13162 =
13163 \begin_inset Quotes erd
13164 \end_inset
13165
13166
13167 \begin_inset Quotes erd
13168 \end_inset
13169
13170 ] The 
13171 \begin_inset Quotes eld
13172 \end_inset
13173
13174 type
13175 \begin_inset Quotes erd
13176 \end_inset
13177
13178  of the new class of floats, like program or algorithm.
13179  After the appropriate 
13180 \begin_inset Flex CharStyle:Code
13181 status collapsed
13182
13183 \begin_layout Plain Layout
13184
13185 \backslash
13186 newfloat
13187 \end_layout
13188
13189 \end_inset
13190
13191 , commands such as 
13192 \begin_inset Flex CharStyle:Code
13193 status collapsed
13194
13195 \begin_layout Plain Layout
13196
13197 \backslash
13198 begin{program}
13199 \end_layout
13200
13201 \end_inset
13202
13203  or 
13204 \begin_inset Flex CharStyle:Code
13205 status collapsed
13206
13207 \begin_layout Plain Layout
13208
13209 \backslash
13210 end{algorithm*}
13211 \end_layout
13212
13213 \end_inset
13214
13215  will be available.
13216 \end_layout
13217
13218 \begin_layout Standard
13219 Note that defining a float with type 
13220 \begin_inset Flex CharStyle:Code
13221 status collapsed
13222
13223 \begin_layout Plain Layout
13224
13225 \emph on
13226 type
13227 \end_layout
13228
13229 \end_inset
13230
13231  automatically defines the corresponding counter with name 
13232 \begin_inset Flex CharStyle:Code
13233 status collapsed
13234
13235 \begin_layout Plain Layout
13236
13237 \emph on
13238 type
13239 \end_layout
13240
13241 \end_inset
13242
13243 .
13244 \end_layout
13245
13246 \begin_layout Subsection
13247 Flex insets and InsetLayout
13248 \begin_inset CommandInset label
13249 LatexCommand label
13250 name "sub:Flex-insets-and"
13251
13252 \end_inset
13253
13254
13255 \end_layout
13256
13257 \begin_layout Standard
13258 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13259  these are called Flex insets.
13260  
13261 \end_layout
13262
13263 \begin_layout Standard
13264 Flex insets come in three different kinds: 
13265 \end_layout
13266
13267 \begin_layout Itemize
13268 character style (
13269 \begin_inset Flex CharStyle:Code
13270 status collapsed
13271
13272 \begin_layout Plain Layout
13273 CharStyle
13274 \end_layout
13275
13276 \end_inset
13277
13278 ): These define semantic markup corresponding to such LaTeX commands as
13279  
13280 \begin_inset Flex CharStyle:Code
13281 status collapsed
13282
13283 \begin_layout Plain Layout
13284
13285 \backslash
13286 noun
13287 \end_layout
13288
13289 \end_inset
13290
13291  and 
13292 \begin_inset Flex CharStyle:Code
13293 status collapsed
13294
13295 \begin_layout Plain Layout
13296
13297 \backslash
13298 code
13299 \end_layout
13300
13301 \end_inset
13302
13303 .
13304 \end_layout
13305
13306 \begin_layout Itemize
13307 user custom (
13308 \begin_inset Flex CharStyle:Code
13309 status collapsed
13310
13311 \begin_layout Plain Layout
13312 Custom
13313 \end_layout
13314
13315 \end_inset
13316
13317 ): These can be used to define custom collapsible insets, similar to TeX
13318  code, footnote, and the like.
13319  An obvious example is an endnote inset, which is defined in the 
13320 \begin_inset Flex CharStyle:Code
13321 status collapsed
13322
13323 \begin_layout Plain Layout
13324 endnote
13325 \end_layout
13326
13327 \end_inset
13328
13329  module.
13330 \end_layout
13331
13332 \begin_layout Itemize
13333 XML elements (
13334 \begin_inset Flex CharStyle:Code
13335 status collapsed
13336
13337 \begin_layout Plain Layout
13338 Element
13339 \end_layout
13340
13341 \end_inset
13342
13343 ): For use with DocBook classes.
13344 \end_layout
13345
13346 \begin_layout Standard
13347 Flex insets are defined using the 
13348 \begin_inset Flex CharStyle:Code
13349 status collapsed
13350
13351 \begin_layout Plain Layout
13352 InsetLayout
13353 \end_layout
13354
13355 \end_inset
13356
13357  tag, which shall be explained in a moment.
13358 \end_layout
13359
13360 \begin_layout Standard
13361 The 
13362 \begin_inset Flex CharStyle:Code
13363 status collapsed
13364
13365 \begin_layout Plain Layout
13366 InsetLayout
13367 \end_layout
13368
13369 \end_inset
13370
13371  tag also serves another function: It can be used to customize the general
13372  layout of many different types of insets.
13373  Currently, 
13374 \begin_inset Flex CharStyle:Code
13375 status collapsed
13376
13377 \begin_layout Plain Layout
13378 InsetLayout
13379 \end_layout
13380
13381 \end_inset
13382
13383  can be used to customize the layout parameters for footnotes, marginal
13384  notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13385  boxes, tables, algorithms, URLs, and optional arguments, as well as to
13386  define Flex insets.
13387 \end_layout
13388
13389 \begin_layout Standard
13390 The 
13391 \begin_inset Flex CharStyle:Code
13392 status collapsed
13393
13394 \begin_layout Plain Layout
13395 InsetLayout
13396 \end_layout
13397
13398 \end_inset
13399
13400  definition must begin with a line of the form:
13401 \end_layout
13402
13403 \begin_layout LyX-Code
13404 InsetLayout <Type>
13405 \end_layout
13406
13407 \begin_layout Standard
13408 Here 
13409 \begin_inset Flex CharStyle:Code
13410 status collapsed
13411
13412 \begin_layout Plain Layout
13413 <Type>
13414 \end_layout
13415
13416 \end_inset
13417
13418  indicates the inset whose layout is being defined, and here there are two
13419  cases.
13420 \end_layout
13421
13422 \begin_layout Enumerate
13423 The layout for a pre-existing inset is being modified.
13424  In this case, can be 
13425 \begin_inset Flex CharStyle:Code
13426 status collapsed
13427
13428 \begin_layout Plain Layout
13429 <Type>
13430 \end_layout
13431
13432 \end_inset
13433
13434  any one of the following: 
13435 \begin_inset Flex CharStyle:Code
13436 status collapsed
13437
13438 \begin_layout Plain Layout
13439 Algorithm
13440 \end_layout
13441
13442 \end_inset
13443
13444
13445 \begin_inset Flex CharStyle:Code
13446 status collapsed
13447
13448 \begin_layout Plain Layout
13449 Branch
13450 \end_layout
13451
13452 \end_inset
13453
13454
13455 \begin_inset Flex CharStyle:Code
13456 status collapsed
13457
13458 \begin_layout Plain Layout
13459 Box
13460 \end_layout
13461
13462 \end_inset
13463
13464
13465 \begin_inset Flex CharStyle:Code
13466 status collapsed
13467
13468 \begin_layout Plain Layout
13469 Box:shaded
13470 \end_layout
13471
13472 \end_inset
13473
13474
13475 \begin_inset Flex CharStyle:Code
13476 status collapsed
13477
13478 \begin_layout Plain Layout
13479 ERT
13480 \end_layout
13481
13482 \end_inset
13483
13484
13485 \begin_inset Flex CharStyle:Code
13486 status collapsed
13487
13488 \begin_layout Plain Layout
13489 Figure
13490 \end_layout
13491
13492 \end_inset
13493
13494
13495 \begin_inset Flex CharStyle:Code
13496 status collapsed
13497
13498 \begin_layout Plain Layout
13499 Foot
13500 \end_layout
13501
13502 \end_inset
13503
13504
13505 \begin_inset Flex CharStyle:Code
13506 status collapsed
13507
13508 \begin_layout Plain Layout
13509 Index
13510 \end_layout
13511
13512 \end_inset
13513
13514
13515 \begin_inset Flex CharStyle:Code
13516 status collapsed
13517
13518 \begin_layout Plain Layout
13519 Info
13520 \end_layout
13521
13522 \end_inset
13523
13524
13525 \begin_inset Flex CharStyle:Code
13526 status collapsed
13527
13528 \begin_layout Plain Layout
13529 Info:menu
13530 \end_layout
13531
13532 \end_inset
13533
13534
13535 \begin_inset Flex CharStyle:Code
13536 status collapsed
13537
13538 \begin_layout Plain Layout
13539 Info:shortcut
13540 \end_layout
13541
13542 \end_inset
13543
13544
13545 \begin_inset Flex CharStyle:Code
13546 status collapsed
13547
13548 \begin_layout Plain Layout
13549 Info:shortcuts
13550 \end_layout
13551
13552 \end_inset
13553
13554
13555 \begin_inset Flex CharStyle:Code
13556 status collapsed
13557
13558 \begin_layout Plain Layout
13559 Listings
13560 \end_layout
13561
13562 \end_inset
13563
13564
13565 \begin_inset Flex CharStyle:Code
13566 status collapsed
13567
13568 \begin_layout Plain Layout
13569 Marginal
13570 \end_layout
13571
13572 \end_inset
13573
13574
13575 \begin_inset Flex CharStyle:Code
13576 status collapsed
13577
13578 \begin_layout Plain Layout
13579 Note:Comment
13580 \end_layout
13581
13582 \end_inset
13583
13584
13585 \begin_inset Flex CharStyle:Code
13586 status collapsed
13587
13588 \begin_layout Plain Layout
13589 Note:Note
13590 \end_layout
13591
13592 \end_inset
13593
13594
13595 \begin_inset Flex CharStyle:Code
13596 status collapsed
13597
13598 \begin_layout Plain Layout
13599 Note:GreyedOut
13600 \end_layout
13601
13602 \end_inset
13603
13604
13605 \begin_inset Flex CharStyle:Code
13606 status collapsed
13607
13608 \begin_layout Plain Layout
13609 OptArg
13610 \end_layout
13611
13612 \end_inset
13613
13614
13615 \begin_inset Flex CharStyle:Code
13616 status collapsed
13617
13618 \begin_layout Plain Layout
13619 Table
13620 \end_layout
13621
13622 \end_inset
13623
13624 , or 
13625 \begin_inset Flex CharStyle:Code
13626 status collapsed
13627
13628 \begin_layout Plain Layout
13629 URL
13630 \end_layout
13631
13632 \end_inset
13633
13634 .
13635 \end_layout
13636
13637 \begin_layout Enumerate
13638 The layout for a Flex inset is being defined.
13639  In this case, 
13640 \begin_inset Flex CharStyle:Code
13641 status collapsed
13642
13643 \begin_layout Plain Layout
13644 <Type>
13645 \end_layout
13646
13647 \end_inset
13648
13649  can be any valid identifier not used by a pre-existing inset.
13650  Note that the definition of a flex inset 
13651 \emph on
13652 must 
13653 \emph default
13654 also include a 
13655 \begin_inset Flex CharStyle:Code
13656 status collapsed
13657
13658 \begin_layout Plain Layout
13659 LyXType
13660 \end_layout
13661
13662 \end_inset
13663
13664  entry, declaring which type of inset this is.
13665 \end_layout
13666
13667 \begin_layout Standard
13668 The 
13669 \begin_inset Flex CharStyle:Code
13670 status collapsed
13671
13672 \begin_layout Plain Layout
13673 InsetLayout
13674 \end_layout
13675
13676 \end_inset
13677
13678  definition can contain the following entries:
13679 \end_layout
13680
13681 \begin_layout Description
13682 \begin_inset Flex CharStyle:Code
13683 status collapsed
13684
13685 \begin_layout Plain Layout
13686 BgColor
13687 \end_layout
13688
13689 \end_inset
13690
13691  The color for the inset's background.
13692  The valid colors are defined in 
13693 \begin_inset Flex CharStyle:Code
13694 status collapsed
13695
13696 \begin_layout Plain Layout
13697 src/ColorCode.h
13698 \end_layout
13699
13700 \end_inset
13701
13702 .
13703 \end_layout
13704
13705 \begin_layout Description
13706 \begin_inset Flex CharStyle:Code
13707 status collapsed
13708
13709 \begin_layout Plain Layout
13710 ContentAsLabel
13711 \end_layout
13712
13713 \end_inset
13714
13715  [
13716 \begin_inset Flex CharStyle:Code
13717 status collapsed
13718
13719 \begin_layout Plain Layout
13720
13721 \emph on
13722 0
13723 \end_layout
13724
13725 \end_inset
13726
13727 ,
13728 \begin_inset Flex CharStyle:Code
13729 status collapsed
13730
13731 \begin_layout Plain Layout
13732 1
13733 \end_layout
13734
13735 \end_inset
13736
13737 ] Whether to use the content of the inset as the label, when the inset is
13738  closed.
13739  Default is false.
13740 \end_layout
13741
13742 \begin_layout Description
13743 \begin_inset Flex CharStyle:Code
13744 status collapsed
13745
13746 \begin_layout Plain Layout
13747 CopyStyle
13748 \end_layout
13749
13750 \end_inset
13751
13752  As with paragraph styles (see page 
13753 \begin_inset CommandInset ref
13754 LatexCommand ref
13755 reference "des:CopyStyle"
13756
13757 \end_inset
13758
13759 ).
13760 \end_layout
13761
13762 \begin_layout Description
13763 \begin_inset Flex CharStyle:Code
13764 status collapsed
13765
13766 \begin_layout Plain Layout
13767 CustomPars
13768 \end_layout
13769
13770 \end_inset
13771
13772  [
13773 \begin_inset Flex CharStyle:Code
13774 status collapsed
13775
13776 \begin_layout Plain Layout
13777
13778 \emph on
13779 0
13780 \end_layout
13781
13782 \end_inset
13783
13784 ,
13785 \begin_inset Flex CharStyle:Code
13786 status collapsed
13787
13788 \begin_layout Plain Layout
13789 1
13790 \end_layout
13791
13792 \end_inset
13793
13794 ] Indicates whether the user may employ the Paragraph Settings dialog to
13795  customize the paragraph.
13796 \end_layout
13797
13798 \begin_layout Description
13799 \begin_inset Flex CharStyle:Code
13800 status collapsed
13801
13802 \begin_layout Plain Layout
13803 Decoration
13804 \end_layout
13805
13806 \end_inset
13807
13808  can be 
13809 \begin_inset Flex CharStyle:Code
13810 status collapsed
13811
13812 \begin_layout Plain Layout
13813 Classic
13814 \end_layout
13815
13816 \end_inset
13817
13818
13819 \begin_inset Flex CharStyle:Code
13820 status collapsed
13821
13822 \begin_layout Plain Layout
13823 Minimalistic
13824 \end_layout
13825
13826 \end_inset
13827
13828 , or 
13829 \begin_inset Flex CharStyle:Code
13830 status collapsed
13831
13832 \begin_layout Plain Layout
13833 Conglomerate
13834 \end_layout
13835
13836 \end_inset
13837
13838 , describing the rendering style used for the inset's frame and buttons.
13839  Footnotes generally use 
13840 \begin_inset Flex CharStyle:Code
13841 status collapsed
13842
13843 \begin_layout Plain Layout
13844 Classic
13845 \end_layout
13846
13847 \end_inset
13848
13849 , ERT insets generally 
13850 \begin_inset Flex CharStyle:Code
13851 status collapsed
13852
13853 \begin_layout Plain Layout
13854 Minimalistic
13855 \end_layout
13856
13857 \end_inset
13858
13859 , and character styles 
13860 \begin_inset Flex CharStyle:Code
13861 status collapsed
13862
13863 \begin_layout Plain Layout
13864 Conglomerate
13865 \end_layout
13866
13867 \end_inset
13868
13869 .
13870 \end_layout
13871
13872 \begin_layout Description
13873 \begin_inset Flex CharStyle:Code
13874 status collapsed
13875
13876 \begin_layout Plain Layout
13877 End
13878 \end_layout
13879
13880 \end_inset
13881
13882  Required at the end of the InsetLayout declarations.
13883 \end_layout
13884
13885 \begin_layout Description
13886 \begin_inset Flex CharStyle:Code
13887 status collapsed
13888
13889 \begin_layout Plain Layout
13890 Font
13891 \end_layout
13892
13893 \end_inset
13894
13895  The font used for both the text body 
13896 \emph on
13897 and
13898 \emph default
13899  the label.
13900  See section
13901 \begin_inset space ~
13902 \end_inset
13903
13904
13905 \begin_inset CommandInset ref
13906 LatexCommand ref
13907 reference "sub:Font-description"
13908
13909 \end_inset
13910
13911 .
13912  Note that defining this font automatically defines the 
13913 \begin_inset Flex CharStyle:Code
13914 status collapsed
13915
13916 \begin_layout Plain Layout
13917 LabelFont
13918 \end_layout
13919
13920 \end_inset
13921
13922  to the same value, so define this first and define 
13923 \begin_inset Flex CharStyle:Code
13924 status collapsed
13925
13926 \begin_layout Plain Layout
13927 LabelFont
13928 \end_layout
13929
13930 \end_inset
13931
13932  later if you want them to be different.
13933 \end_layout
13934
13935 \begin_layout Description
13936 \begin_inset Flex CharStyle:Code
13937 status collapsed
13938
13939 \begin_layout Plain Layout
13940 ForceLTR
13941 \end_layout
13942
13943 \end_inset
13944
13945  Force the 
13946 \begin_inset Quotes eld
13947 \end_inset
13948
13949 latex
13950 \begin_inset Quotes erd
13951 \end_inset
13952
13953  language, leading to Left-to-Right (latin) output, e.
13954 \begin_inset space \thinspace{}
13955 \end_inset
13956
13957 g.
13958 \begin_inset space \space{}
13959 \end_inset
13960
13961 in TeX code or URL.
13962  A kludge.
13963 \end_layout
13964
13965 \begin_layout Description
13966 \begin_inset Flex CharStyle:Code
13967 status collapsed
13968
13969 \begin_layout Plain Layout
13970 ForcePlain
13971 \end_layout
13972
13973 \end_inset
13974
13975  [
13976 \begin_inset Flex CharStyle:Code
13977 status collapsed
13978
13979 \begin_layout Plain Layout
13980
13981 \emph on
13982 0
13983 \end_layout
13984
13985 \end_inset
13986
13987 ,
13988 \begin_inset Flex CharStyle:Code
13989 status collapsed
13990
13991 \begin_layout Plain Layout
13992 1
13993 \end_layout
13994
13995 \end_inset
13996
13997 ] Indicates whether the PlainLayout should be used or, instead, the user
13998  can change the paragraph style used in the inset.
13999  Default is false.
14000 \end_layout
14001
14002 \begin_layout Description
14003 \begin_inset Flex CharStyle:Code
14004 status collapsed
14005
14006 \begin_layout Plain Layout
14007 FreeSpacing
14008 \end_layout
14009
14010 \end_inset
14011
14012  As with paragraph styles (see page 
14013 \begin_inset CommandInset ref
14014 LatexCommand pageref
14015 reference "des:FreeSpacing"
14016
14017 \end_inset
14018
14019 ).
14020  Default is false.
14021 \end_layout
14022
14023 \begin_layout Description
14024 \begin_inset Flex CharStyle:Code
14025 status collapsed
14026
14027 \begin_layout Plain Layout
14028 HTML*
14029 \end_layout
14030
14031 \end_inset
14032
14033  These tags control XHTML output.
14034  See 
14035 \end_layout
14036
14037 \begin_layout Description
14038 \begin_inset Flex CharStyle:Code
14039 status collapsed
14040
14041 \begin_layout Plain Layout
14042 InToc
14043 \end_layout
14044
14045 \end_inset
14046
14047  [
14048 \begin_inset Flex CharStyle:Code
14049 status collapsed
14050
14051 \begin_layout Plain Layout
14052
14053 \emph on
14054 0
14055 \end_layout
14056
14057 \end_inset
14058
14059 ,
14060 \begin_inset Flex CharStyle:Code
14061 status collapsed
14062
14063 \begin_layout Plain Layout
14064 1
14065 \end_layout
14066
14067 \end_inset
14068
14069 ] Whether to include the contents of this inset in the strings generated
14070  for the `Outline' pane.
14071  One would not, for example, want the content of a footnote in a section
14072  header to be included in the TOC displayed in the outline, but one would
14073  normally want the content of a character style displayed.
14074  Default is false: not to include.
14075 \end_layout
14076
14077 \begin_layout Description
14078 \begin_inset Flex CharStyle:Code
14079 status collapsed
14080
14081 \begin_layout Plain Layout
14082 KeepEmpty
14083 \end_layout
14084
14085 \end_inset
14086
14087  As with paragraph styles (see page 
14088 \begin_inset CommandInset ref
14089 LatexCommand pageref
14090 reference "des:KeepEmpty"
14091
14092 \end_inset
14093
14094 ).
14095  Default is false.
14096 \end_layout
14097
14098 \begin_layout Description
14099 \begin_inset Flex CharStyle:Code
14100 status collapsed
14101
14102 \begin_layout Plain Layout
14103 LabelFont
14104 \end_layout
14105
14106 \end_inset
14107
14108  The font used for the label.
14109  See section
14110 \begin_inset space ~
14111 \end_inset
14112
14113
14114 \begin_inset CommandInset ref
14115 LatexCommand ref
14116 reference "sub:Font-description"
14117
14118 \end_inset
14119
14120 .
14121  Note that this definition can never appear before 
14122 \begin_inset Flex CharStyle:Code
14123 status collapsed
14124
14125 \begin_layout Plain Layout
14126 Font
14127 \end_layout
14128
14129 \end_inset
14130
14131 , lest it be ineffective.
14132 \end_layout
14133
14134 \begin_layout Description
14135 \begin_inset Flex CharStyle:Code
14136 status collapsed
14137
14138 \begin_layout Plain Layout
14139 LabelString
14140 \end_layout
14141
14142 \end_inset
14143
14144  What will be displayed on the button or elsewhere as the inset label.
14145  Some inset types (TeX code and Branch) modify this label on the fly.
14146 \end_layout
14147
14148 \begin_layout Description
14149 \begin_inset Flex CharStyle:Code
14150 status collapsed
14151
14152 \begin_layout Plain Layout
14153 LatexName
14154 \end_layout
14155
14156 \end_inset
14157
14158  The name of the corresponding LaTeX stuff.
14159  Either the environment or command name.
14160 \end_layout
14161
14162 \begin_layout Description
14163 \begin_inset Flex CharStyle:Code
14164 status collapsed
14165
14166 \begin_layout Plain Layout
14167 LatexParam
14168 \end_layout
14169
14170 \end_inset
14171
14172  The optional parameter for the corresponding 
14173 \begin_inset Flex CharStyle:Code
14174 status collapsed
14175
14176 \begin_layout Plain Layout
14177 LatexName
14178 \end_layout
14179
14180 \end_inset
14181
14182  stuff, including possible bracket pairs like 
14183 \begin_inset Flex CharStyle:Code
14184 status collapsed
14185
14186 \begin_layout Plain Layout
14187 []
14188 \end_layout
14189
14190 \end_inset
14191
14192 .
14193  This parameter cannot be changed from within LyX.
14194 \end_layout
14195
14196 \begin_layout Description
14197 \begin_inset Flex CharStyle:Code
14198 status collapsed
14199
14200 \begin_layout Plain Layout
14201 LatexType
14202 \end_layout
14203
14204 \end_inset
14205
14206  As with paragraph styles (see page 
14207 \begin_inset CommandInset ref
14208 LatexCommand pageref
14209 reference "des:LatexType"
14210
14211 \end_inset
14212
14213 ).
14214 \end_layout
14215
14216 \begin_layout Description
14217 \begin_inset Flex CharStyle:Code
14218 status collapsed
14219
14220 \begin_layout Plain Layout
14221 LyxType
14222 \end_layout
14223
14224 \end_inset
14225
14226  Can be 
14227 \begin_inset Flex CharStyle:Code
14228 status collapsed
14229
14230 \begin_layout Plain Layout
14231 charstyle
14232 \end_layout
14233
14234 \end_inset
14235
14236
14237 \begin_inset Flex CharStyle:Code
14238 status collapsed
14239
14240 \begin_layout Plain Layout
14241 custom
14242 \end_layout
14243
14244 \end_inset
14245
14246
14247 \begin_inset Flex CharStyle:Code
14248 status collapsed
14249
14250 \begin_layout Plain Layout
14251 element
14252 \end_layout
14253
14254 \end_inset
14255
14256 , or 
14257 \begin_inset Flex CharStyle:Code
14258 status collapsed
14259
14260 \begin_layout Plain Layout
14261 end
14262 \end_layout
14263
14264 \end_inset
14265
14266  (indicating a dummy definition ending definitions of charstyles, etc).
14267  This entry is required in and is only meaningful for Flex insets.
14268  Among other things, it determines on which menu this inset will appear.
14269  Setting 
14270 \begin_inset Flex CharStyle:Code
14271 status collapsed
14272
14273 \begin_layout Plain Layout
14274 LyXType
14275 \end_layout
14276
14277 \end_inset
14278
14279  to 
14280 \begin_inset Flex CharStyle:Code
14281 status collapsed
14282
14283 \begin_layout Plain Layout
14284 charstyle
14285 \end_layout
14286
14287 \end_inset
14288
14289  will set 
14290 \begin_inset Flex CharStyle:Code
14291 status collapsed
14292
14293 \begin_layout Plain Layout
14294 MultiPar
14295 \end_layout
14296
14297 \end_inset
14298
14299  to false.
14300  
14301 \begin_inset Flex CharStyle:Code
14302 status collapsed
14303
14304 \begin_layout Plain Layout
14305 MultiPar
14306 \end_layout
14307
14308 \end_inset
14309
14310  can be set to true for charstyle insets, if you wish, by setting it 
14311 \emph on
14312 after
14313 \emph default
14314  you set the 
14315 \begin_inset Flex CharStyle:Code
14316 status collapsed
14317
14318 \begin_layout Plain Layout
14319 LyXType
14320 \end_layout
14321
14322 \end_inset
14323
14324 .
14325 \end_layout
14326
14327 \begin_layout Description
14328 \begin_inset Flex CharStyle:Code
14329 status collapsed
14330
14331 \begin_layout Plain Layout
14332 MultiPar
14333 \end_layout
14334
14335 \end_inset
14336
14337  [
14338 \begin_inset Flex CharStyle:Code
14339 status collapsed
14340
14341 \begin_layout Plain Layout
14342
14343 \emph on
14344 0
14345 \end_layout
14346
14347 \end_inset
14348
14349 ,
14350 \begin_inset Flex CharStyle:Code
14351 status collapsed
14352
14353 \begin_layout Plain Layout
14354 1
14355 \end_layout
14356
14357 \end_inset
14358
14359 ] Whether multiple paragraphs are permitted in this inset.
14360  This will also set 
14361 \begin_inset Flex CharStyle:Code
14362 status collapsed
14363
14364 \begin_layout Plain Layout
14365 CustomPars
14366 \end_layout
14367
14368 \end_inset
14369
14370  to the same value and 
14371 \begin_inset Flex CharStyle:Code
14372 status collapsed
14373
14374 \begin_layout Plain Layout
14375 ForcePlain
14376 \end_layout
14377
14378 \end_inset
14379
14380  to the opposite value.
14381  These can be reset to other values, if they are used 
14382 \emph on
14383 after
14384 \emph default
14385  
14386 \begin_inset Flex CharStyle:Code
14387 status collapsed
14388
14389 \begin_layout Plain Layout
14390 MultiPar
14391 \end_layout
14392
14393 \end_inset
14394
14395 .
14396  Default is true.
14397 \end_layout
14398
14399 \begin_layout Description
14400 \begin_inset Flex CharStyle:Code
14401 status collapsed
14402
14403 \begin_layout Plain Layout
14404 NeedProtect
14405 \end_layout
14406
14407 \end_inset
14408
14409  [
14410 \begin_inset Flex CharStyle:Code
14411 status collapsed
14412
14413 \begin_layout Plain Layout
14414
14415 \emph on
14416 0
14417 \end_layout
14418
14419 \end_inset
14420
14421 ,
14422 \begin_inset Flex CharStyle:Code
14423 status collapsed
14424
14425 \begin_layout Plain Layout
14426 1
14427 \end_layout
14428
14429 \end_inset
14430
14431 ] Whether fragile commands in this layout should be 
14432 \begin_inset Flex CharStyle:Code
14433 status collapsed
14434
14435 \begin_layout Plain Layout
14436
14437 \backslash
14438 protect
14439 \end_layout
14440
14441 \end_inset
14442
14443 'ed.
14444  (Note: This is 
14445 \emph on
14446 not
14447 \emph default
14448  whether the command should itself be protected.) Default is false.
14449 \end_layout
14450
14451 \begin_layout Description
14452 \begin_inset Flex CharStyle:Code
14453 status collapsed
14454
14455 \begin_layout Plain Layout
14456 PassThru
14457 \end_layout
14458
14459 \end_inset
14460
14461  [
14462 \begin_inset Flex CharStyle:Code
14463 status collapsed
14464
14465 \begin_layout Plain Layout
14466
14467 \emph on
14468 0
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 1
14479 \end_layout
14480
14481 \end_inset
14482
14483 ] As with paragraph styles (see page 
14484 \begin_inset CommandInset ref
14485 LatexCommand pageref
14486 reference "des:PathThru"
14487
14488 \end_inset
14489
14490 ).
14491  Default is false.
14492 \end_layout
14493
14494 \begin_layout Description
14495 \begin_inset Flex CharStyle:Code
14496 status collapsed
14497
14498 \begin_layout Plain Layout
14499 Preamble
14500 \end_layout
14501
14502 \end_inset
14503
14504  As with paragraph styles (see page 
14505 \begin_inset CommandInset ref
14506 LatexCommand pageref
14507 reference "des:Preamble"
14508
14509 \end_inset
14510
14511 ).
14512 \end_layout
14513
14514 \begin_layout Description
14515 \begin_inset Flex CharStyle:Code
14516 status collapsed
14517
14518 \begin_layout Plain Layout
14519 RefPrefix
14520 \end_layout
14521
14522 \end_inset
14523
14524  [
14525 \begin_inset Flex CharStyle:Code
14526 status collapsed
14527
14528 \begin_layout Plain Layout
14529 string
14530 \end_layout
14531
14532 \end_inset
14533
14534 ] The prefix to use when creating labels referring to insets of this type.
14535  This allows the use of formatted references.
14536 \end_layout
14537
14538 \begin_layout Description
14539 \begin_inset Flex CharStyle:Code
14540 status collapsed
14541
14542 \begin_layout Plain Layout
14543 Requires
14544 \end_layout
14545
14546 \end_inset
14547
14548  [
14549 \begin_inset Flex CharStyle:Code
14550 status collapsed
14551
14552 \begin_layout Plain Layout
14553 string
14554 \end_layout
14555
14556 \end_inset
14557
14558 ] As with paragraph styles (see page 
14559 \begin_inset CommandInset ref
14560 LatexCommand pageref
14561 reference "des:Requires"
14562
14563 \end_inset
14564
14565 ).
14566 \end_layout
14567
14568 \begin_layout Description
14569 \begin_inset Flex CharStyle:Code
14570 status collapsed
14571
14572 \begin_layout Plain Layout
14573 Spellcheck
14574 \end_layout
14575
14576 \end_inset
14577
14578  [
14579 \begin_inset Flex CharStyle:Code
14580 status collapsed
14581
14582 \begin_layout Plain Layout
14583 0
14584 \end_layout
14585
14586 \end_inset
14587
14588 ,
14589 \begin_inset Flex CharStyle:Code
14590 status collapsed
14591
14592 \begin_layout Plain Layout
14593
14594 \emph on
14595 1
14596 \end_layout
14597
14598 \end_inset
14599
14600 ] Spellcheck the contents of this inset.
14601  Default is true.
14602 \end_layout
14603
14604 \begin_layout Subsection
14605 Counters
14606 \begin_inset CommandInset label
14607 LatexCommand label
14608 name "sub:Counters"
14609
14610 \end_inset
14611
14612
14613 \end_layout
14614
14615 \begin_layout Standard
14616 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14617  counters (
14618 \begin_inset Flex CharStyle:MenuItem
14619 status collapsed
14620
14621 \begin_layout Plain Layout
14622 chapter
14623 \end_layout
14624
14625 \end_inset
14626
14627
14628 \begin_inset Flex CharStyle:MenuItem
14629 status collapsed
14630
14631 \begin_layout Plain Layout
14632 figure
14633 \end_layout
14634
14635 \end_inset
14636
14637 , \SpecialChar \ldots{}
14638 ) in the text class itself.
14639  The standard counters are defined in the file 
14640 \begin_inset Flex CharStyle:Code
14641 status collapsed
14642
14643 \begin_layout Plain Layout
14644 stdcounters.inc
14645 \end_layout
14646
14647 \end_inset
14648
14649 , so you may have to do no more than add
14650 \end_layout
14651
14652 \begin_layout LyX-Code
14653 Input stdcounters.inc
14654 \end_layout
14655
14656 \begin_layout Standard
14657 to your layout file to get them to work.
14658  But if you want to define custom counters, then you can do so.
14659  The counter declaration must begin with:
14660 \end_layout
14661
14662 \begin_layout LyX-Code
14663 Counter CounterName
14664 \end_layout
14665
14666 \begin_layout Standard
14667 where of course `
14668 \begin_inset Flex CharStyle:Code
14669 status collapsed
14670
14671 \begin_layout Plain Layout
14672 CounterName
14673 \end_layout
14674
14675 \end_inset
14676
14677 ' is replaced by the name of the counter.
14678  And it must end with 
14679 \begin_inset Quotes eld
14680 \end_inset
14681
14682
14683 \begin_inset Flex CharStyle:Code
14684 status collapsed
14685
14686 \begin_layout Plain Layout
14687 End
14688 \end_layout
14689
14690 \end_inset
14691
14692
14693 \begin_inset Quotes erd
14694 \end_inset
14695
14696 .
14697  The following parameters can also be used:
14698 \end_layout
14699
14700 \begin_layout Description
14701 \begin_inset Flex CharStyle:Code
14702 status collapsed
14703
14704 \begin_layout Plain Layout
14705 LabelString
14706 \end_layout
14707
14708 \end_inset
14709
14710  [
14711 \begin_inset Flex CharStyle:Code
14712 status collapsed
14713
14714 \begin_layout Plain Layout
14715 string
14716 \end_layout
14717
14718 \end_inset
14719
14720 =
14721 \begin_inset Quotes erd
14722 \end_inset
14723
14724
14725 \begin_inset Quotes erd
14726 \end_inset
14727
14728 ] When defined, this string defines how the counter is displayed.
14729  Setting this value sets 
14730 \begin_inset Flex CharStyle:Code
14731 status collapsed
14732
14733 \begin_layout Plain Layout
14734 LabelStringAppendix
14735 \end_layout
14736
14737 \end_inset
14738
14739  to the same value.
14740  The following special constructs can be used in the string:
14741 \end_layout
14742
14743 \begin_deeper
14744 \begin_layout Itemize
14745 \begin_inset Flex CharStyle:Code
14746 status collapsed
14747
14748 \begin_layout Plain Layout
14749
14750 \backslash
14751 thecounter
14752 \end_layout
14753
14754 \end_inset
14755
14756  will be replaced by the expansion of the 
14757 \begin_inset Flex CharStyle:Code
14758 status collapsed
14759
14760 \begin_layout Plain Layout
14761 LabelString
14762 \end_layout
14763
14764 \end_inset
14765
14766  (or 
14767 \begin_inset Flex CharStyle:Code
14768 status collapsed
14769
14770 \begin_layout Plain Layout
14771 LabelStringAppendix
14772 \end_layout
14773
14774 \end_inset
14775
14776 ) of the counter 
14777 \begin_inset Flex CharStyle:Code
14778 status collapsed
14779
14780 \begin_layout Plain Layout
14781 counter
14782 \end_layout
14783
14784 \end_inset
14785
14786 .
14787  
14788 \end_layout
14789
14790 \begin_layout Itemize
14791 counter values can be expressed using LaTeX-like macros 
14792 \begin_inset Flex CharStyle:Code
14793 status collapsed
14794
14795 \begin_layout Plain Layout
14796
14797 \backslash
14798
14799 \emph on
14800 numbertype
14801 \emph default
14802 {
14803 \emph on
14804 counter
14805 \emph default
14806 }
14807 \end_layout
14808
14809 \end_inset
14810
14811 , where 
14812 \begin_inset Flex CharStyle:Code
14813 status collapsed
14814
14815 \begin_layout Plain Layout
14816
14817 \emph on
14818 numbertype
14819 \end_layout
14820
14821 \end_inset
14822
14823  can be:
14824 \begin_inset Foot
14825 status collapsed
14826
14827 \begin_layout Plain Layout
14828
14829 \family roman
14830 \series medium
14831 \shape up
14832 \size normal
14833 \emph off
14834 \bar no
14835 \noun off
14836 \color none
14837 Actually, the situation is a bit more complicated: any
14838 \family default
14839 \series default
14840 \shape default
14841 \emph default
14842 \bar default
14843  
14844 \size default
14845 \emph on
14846 \noun default
14847 \color inherit
14848 numbertype
14849 \family roman
14850 \series medium
14851 \shape up
14852 \size normal
14853 \emph off
14854 \bar no
14855 \noun off
14856  other than those described below will produce arabic numerals.
14857  It would not be surprising to see this change in the future.
14858 \end_layout
14859
14860 \end_inset
14861
14862  
14863 \begin_inset Flex CharStyle:Code
14864 status collapsed
14865
14866 \begin_layout Plain Layout
14867 arabic
14868 \end_layout
14869
14870 \end_inset
14871
14872 : 1, 2, 3,\SpecialChar \ldots{}
14873
14874 \begin_inset Flex CharStyle:Code
14875 status collapsed
14876
14877 \begin_layout Plain Layout
14878 alph
14879 \end_layout
14880
14881 \end_inset
14882
14883  for lower-case letters: a, b, c, \SpecialChar \ldots{}
14884
14885 \begin_inset Flex CharStyle:Code
14886 status collapsed
14887
14888 \begin_layout Plain Layout
14889 Alph
14890 \end_layout
14891
14892 \end_inset
14893
14894  for upper-case letters: A, B, C, \SpecialChar \ldots{}
14895
14896 \begin_inset Flex CharStyle:Code
14897 status collapsed
14898
14899 \begin_layout Plain Layout
14900 roman
14901 \end_layout
14902
14903 \end_inset
14904
14905  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
14906
14907 \begin_inset Flex CharStyle:Code
14908 status collapsed
14909
14910 \begin_layout Plain Layout
14911 Roman
14912 \end_layout
14913
14914 \end_inset
14915
14916  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
14917
14918 \begin_inset Flex CharStyle:Code
14919 status collapsed
14920
14921 \begin_layout Plain Layout
14922 hebrew
14923 \end_layout
14924
14925 \end_inset
14926
14927  for hebrew numerals.
14928 \end_layout
14929
14930 \end_deeper
14931 \begin_layout Standard
14932 If LabelString is not defined, a default value is constructed as follows:
14933  if the counter has a master counter 
14934 \begin_inset Flex CharStyle:Code
14935 status collapsed
14936
14937 \begin_layout Plain Layout
14938 master
14939 \end_layout
14940
14941 \end_inset
14942
14943  (defined via 
14944 \begin_inset Flex CharStyle:Code
14945 status collapsed
14946
14947 \begin_layout Plain Layout
14948 Within
14949 \end_layout
14950
14951 \end_inset
14952
14953 ), the string 
14954 \begin_inset Flex CharStyle:Code
14955 status collapsed
14956
14957 \begin_layout Plain Layout
14958
14959 \backslash
14960 themaster.
14961 \backslash
14962 arabic{counter}
14963 \end_layout
14964
14965 \end_inset
14966
14967  is used; otherwise the string 
14968 \begin_inset Flex CharStyle:Code
14969 status collapsed
14970
14971 \begin_layout Plain Layout
14972
14973 \backslash
14974 arabic{counter}
14975 \end_layout
14976
14977 \end_inset
14978
14979  is used.
14980 \end_layout
14981
14982 \begin_layout Description
14983 \begin_inset Flex CharStyle:Code
14984 status collapsed
14985
14986 \begin_layout Plain Layout
14987 LabelStringAppendix
14988 \end_layout
14989
14990 \end_inset
14991
14992  [
14993 \begin_inset Flex CharStyle:Code
14994 status collapsed
14995
14996 \begin_layout Plain Layout
14997 string
14998 \end_layout
14999
15000 \end_inset
15001
15002 =
15003 \begin_inset Quotes erd
15004 \end_inset
15005
15006
15007 \begin_inset Quotes erd
15008 \end_inset
15009
15010 ] Same as 
15011 \begin_inset Flex CharStyle:Code
15012 status collapsed
15013
15014 \begin_layout Plain Layout
15015 LabelString
15016 \end_layout
15017
15018 \end_inset
15019
15020 , but for use in the Appendix.
15021 \end_layout
15022
15023 \begin_layout Description
15024 \begin_inset Flex CharStyle:Code
15025 status collapsed
15026
15027 \begin_layout Plain Layout
15028 PrettyFormat
15029 \end_layout
15030
15031 \end_inset
15032
15033  [
15034 \begin_inset Flex CharStyle:Code
15035 status collapsed
15036
15037 \begin_layout Plain Layout
15038 string
15039 \end_layout
15040
15041 \end_inset
15042
15043 =
15044 \begin_inset Quotes erd
15045 \end_inset
15046
15047
15048 \begin_inset Quotes erd
15049 \end_inset
15050
15051 ] A format for use with formatted references to this counter.
15052  For example, one might want to have references to section numbers appear
15053  as 
15054 \begin_inset Quotes eld
15055 \end_inset
15056
15057 Section 2.4
15058 \begin_inset Quotes erd
15059 \end_inset
15060
15061 .
15062  The string should contain 
15063 \begin_inset Quotes eld
15064 \end_inset
15065
15066 ##
15067 \begin_inset Quotes erd
15068 \end_inset
15069
15070 .
15071  This will be replaced by the counter number itself.
15072  So, for sections, it would be: Section ##.
15073 \end_layout
15074
15075 \begin_layout Description
15076 \begin_inset Flex CharStyle:Code
15077 status collapsed
15078
15079 \begin_layout Plain Layout
15080 Within
15081 \end_layout
15082
15083 \end_inset
15084
15085  [
15086 \begin_inset Flex CharStyle:Code
15087 status collapsed
15088
15089 \begin_layout Plain Layout
15090 string
15091 \end_layout
15092
15093 \end_inset
15094
15095 =
15096 \begin_inset Quotes erd
15097 \end_inset
15098
15099
15100 \begin_inset Quotes erd
15101 \end_inset
15102
15103 ] If this is set to the name of another counter, the present counter will
15104  be reset every time the other one is increased.
15105  For example, 
15106 \begin_inset Flex CharStyle:Code
15107 status collapsed
15108
15109 \begin_layout Plain Layout
15110 subsection
15111 \end_layout
15112
15113 \end_inset
15114
15115  is numbered inside 
15116 \begin_inset Flex CharStyle:Code
15117 status collapsed
15118
15119 \begin_layout Plain Layout
15120 section
15121 \end_layout
15122
15123 \end_inset
15124
15125 .
15126 \end_layout
15127
15128 \begin_layout Subsection
15129 Font description
15130 \begin_inset CommandInset label
15131 LatexCommand label
15132 name "sub:Font-description"
15133
15134 \end_inset
15135
15136
15137 \end_layout
15138
15139 \begin_layout Standard
15140 A font description looks like this:
15141 \end_layout
15142
15143 \begin_layout LyX-Code
15144 Font 
15145 \family roman
15146 \emph on
15147 or
15148 \family default
15149 \emph default
15150  LabelFont
15151 \end_layout
15152
15153 \begin_layout LyX-Code
15154  ...
15155 \end_layout
15156
15157 \begin_layout LyX-Code
15158 EndFont
15159 \end_layout
15160
15161 \begin_layout Standard
15162 The following commands are available:
15163 \end_layout
15164
15165 \begin_layout Description
15166 \begin_inset Flex CharStyle:Code
15167 status collapsed
15168
15169 \begin_layout Plain Layout
15170 Color
15171 \end_layout
15172
15173 \end_inset
15174
15175  [
15176 \begin_inset Flex CharStyle:Code
15177 status collapsed
15178
15179 \begin_layout Plain Layout
15180
15181 \emph on
15182 none
15183 \end_layout
15184
15185 \end_inset
15186
15187
15188 \begin_inset Flex CharStyle:Code
15189 status collapsed
15190
15191 \begin_layout Plain Layout
15192 black
15193 \end_layout
15194
15195 \end_inset
15196
15197
15198 \begin_inset Flex CharStyle:Code
15199 status collapsed
15200
15201 \begin_layout Plain Layout
15202 white
15203 \end_layout
15204
15205 \end_inset
15206
15207
15208 \begin_inset Flex CharStyle:Code
15209 status collapsed
15210
15211 \begin_layout Plain Layout
15212 red
15213 \end_layout
15214
15215 \end_inset
15216
15217
15218 \begin_inset Flex CharStyle:Code
15219 status collapsed
15220
15221 \begin_layout Plain Layout
15222 green
15223 \end_layout
15224
15225 \end_inset
15226
15227
15228 \begin_inset Flex CharStyle:Code
15229 status collapsed
15230
15231 \begin_layout Plain Layout
15232 blue
15233 \end_layout
15234
15235 \end_inset
15236
15237
15238 \begin_inset Flex CharStyle:Code
15239 status collapsed
15240
15241 \begin_layout Plain Layout
15242 cyan
15243 \end_layout
15244
15245 \end_inset
15246
15247
15248 \begin_inset Flex CharStyle:Code
15249 status collapsed
15250
15251 \begin_layout Plain Layout
15252 magenta
15253 \end_layout
15254
15255 \end_inset
15256
15257
15258 \begin_inset Flex CharStyle:Code
15259 status collapsed
15260
15261 \begin_layout Plain Layout
15262 yellow
15263 \end_layout
15264
15265 \end_inset
15266
15267 ]
15268 \end_layout
15269
15270 \begin_layout Description
15271 \begin_inset Flex CharStyle:Code
15272 status collapsed
15273
15274 \begin_layout Plain Layout
15275 Family
15276 \end_layout
15277
15278 \end_inset
15279
15280  [
15281 \begin_inset Flex CharStyle:Code
15282 status collapsed
15283
15284 \begin_layout Plain Layout
15285
15286 \emph on
15287 Roman
15288 \end_layout
15289
15290 \end_inset
15291
15292
15293 \begin_inset Flex CharStyle:Code
15294 status collapsed
15295
15296 \begin_layout Plain Layout
15297 Sans
15298 \end_layout
15299
15300 \end_inset
15301
15302
15303 \begin_inset Flex CharStyle:Code
15304 status collapsed
15305
15306 \begin_layout Plain Layout
15307 Typewriter
15308 \end_layout
15309
15310 \end_inset
15311
15312
15313 \end_layout
15314
15315 \begin_layout Description
15316 \begin_inset Flex CharStyle:Code
15317 status collapsed
15318
15319 \begin_layout Plain Layout
15320 Misc
15321 \end_layout
15322
15323 \end_inset
15324
15325  [
15326 \begin_inset Flex CharStyle:Code
15327 status collapsed
15328
15329 \begin_layout Plain Layout
15330 string
15331 \end_layout
15332
15333 \end_inset
15334
15335 ] Valid arguments are: 
15336 \begin_inset Flex CharStyle:Code
15337 status collapsed
15338
15339 \begin_layout Plain Layout
15340 emph
15341 \end_layout
15342
15343 \end_inset
15344
15345
15346 \begin_inset Flex CharStyle:Code
15347 status collapsed
15348
15349 \begin_layout Plain Layout
15350 noun
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 underbar
15361 \end_layout
15362
15363 \end_inset
15364
15365
15366 \begin_inset Flex CharStyle:Code
15367 status collapsed
15368
15369 \begin_layout Plain Layout
15370 no_emph
15371 \end_layout
15372
15373 \end_inset
15374
15375
15376 \begin_inset Flex CharStyle:Code
15377 status collapsed
15378
15379 \begin_layout Plain Layout
15380 no_noun
15381 \end_layout
15382
15383 \end_inset
15384
15385  and 
15386 \begin_inset Flex CharStyle:Code
15387 status collapsed
15388
15389 \begin_layout Plain Layout
15390 no_bar
15391 \end_layout
15392
15393 \end_inset
15394
15395 .
15396  Each of these turns on or off the corresponding attribute.
15397  For example, 
15398 \begin_inset Flex CharStyle:Code
15399 status collapsed
15400
15401 \begin_layout Plain Layout
15402 emph
15403 \end_layout
15404
15405 \end_inset
15406
15407  turns on emphasis, and 
15408 \begin_inset Flex CharStyle:Code
15409 status collapsed
15410
15411 \begin_layout Plain Layout
15412 no_emph
15413 \end_layout
15414
15415 \end_inset
15416
15417  turns it off.
15418  
15419 \begin_inset Newline newline
15420 \end_inset
15421
15422 If the latter seems puzzling, remember that the font settings for the present
15423  context are generally inherited from the surrounding context.
15424  So 
15425 \begin_inset Flex CharStyle:Code
15426 status collapsed
15427
15428 \begin_layout Plain Layout
15429 no_emph
15430 \end_layout
15431
15432 \end_inset
15433
15434  would turn off the emphasis that was anyway in effect, say, in a theorem
15435  environment.
15436 \end_layout
15437
15438 \begin_layout Description
15439 \begin_inset Flex CharStyle:Code
15440 status collapsed
15441
15442 \begin_layout Plain Layout
15443 Series
15444 \end_layout
15445
15446 \end_inset
15447
15448  [
15449 \begin_inset Flex CharStyle:Code
15450 status collapsed
15451
15452 \begin_layout Plain Layout
15453
15454 \emph on
15455 Medium
15456 \end_layout
15457
15458 \end_inset
15459
15460
15461 \begin_inset Flex CharStyle:Code
15462 status collapsed
15463
15464 \begin_layout Plain Layout
15465 Bold
15466 \end_layout
15467
15468 \end_inset
15469
15470
15471 \end_layout
15472
15473 \begin_layout Description
15474 \begin_inset Flex CharStyle:Code
15475 status collapsed
15476
15477 \begin_layout Plain Layout
15478 Shape
15479 \end_layout
15480
15481 \end_inset
15482
15483  [
15484 \begin_inset Flex CharStyle:Code
15485 status collapsed
15486
15487 \begin_layout Plain Layout
15488
15489 \emph on
15490 Up
15491 \end_layout
15492
15493 \end_inset
15494
15495
15496 \begin_inset Flex CharStyle:Code
15497 status collapsed
15498
15499 \begin_layout Plain Layout
15500 Italic
15501 \end_layout
15502
15503 \end_inset
15504
15505
15506 \begin_inset Flex CharStyle:Code
15507 status collapsed
15508
15509 \begin_layout Plain Layout
15510 SmallCaps
15511 \end_layout
15512
15513 \end_inset
15514
15515
15516 \begin_inset Flex CharStyle:Code
15517 status collapsed
15518
15519 \begin_layout Plain Layout
15520 Slanted
15521 \end_layout
15522
15523 \end_inset
15524
15525
15526 \end_layout
15527
15528 \begin_layout Description
15529 \begin_inset Flex CharStyle:Code
15530 status collapsed
15531
15532 \begin_layout Plain Layout
15533 Size
15534 \end_layout
15535
15536 \end_inset
15537
15538  [
15539 \begin_inset Flex CharStyle:Code
15540 status collapsed
15541
15542 \begin_layout Plain Layout
15543 tiny
15544 \end_layout
15545
15546 \end_inset
15547
15548
15549 \begin_inset Flex CharStyle:Code
15550 status collapsed
15551
15552 \begin_layout Plain Layout
15553 small
15554 \end_layout
15555
15556 \end_inset
15557
15558
15559 \begin_inset Flex CharStyle:Code
15560 status collapsed
15561
15562 \begin_layout Plain Layout
15563
15564 \emph on
15565 normal
15566 \end_layout
15567
15568 \end_inset
15569
15570
15571 \begin_inset Flex CharStyle:Code
15572 status collapsed
15573
15574 \begin_layout Plain Layout
15575 large
15576 \end_layout
15577
15578 \end_inset
15579
15580
15581 \begin_inset Flex CharStyle:Code
15582 status collapsed
15583
15584 \begin_layout Plain Layout
15585 larger
15586 \end_layout
15587
15588 \end_inset
15589
15590
15591 \begin_inset Flex CharStyle:Code
15592 status collapsed
15593
15594 \begin_layout Plain Layout
15595 largest
15596 \end_layout
15597
15598 \end_inset
15599
15600
15601 \begin_inset Flex CharStyle:Code
15602 status collapsed
15603
15604 \begin_layout Plain Layout
15605 huge
15606 \end_layout
15607
15608 \end_inset
15609
15610
15611 \begin_inset Flex CharStyle:Code
15612 status collapsed
15613
15614 \begin_layout Plain Layout
15615 giant
15616 \end_layout
15617
15618 \end_inset
15619
15620 ]
15621 \end_layout
15622
15623 \begin_layout Subsection
15624 \begin_inset CommandInset label
15625 LatexCommand label
15626 name "sub:Citation-format-description"
15627
15628 \end_inset
15629
15630 Citation format description
15631 \end_layout
15632
15633 \begin_layout Standard
15634 The 
15635 \begin_inset Flex CharStyle:Code
15636 status collapsed
15637
15638 \begin_layout Plain Layout
15639 CiteFormat
15640 \end_layout
15641
15642 \end_inset
15643
15644  blocks are used to describe how bibliographic information should be displayed,
15645  both within LyX itself (in the citation dialog and in tooltips, for example)
15646  and in XHTML output.
15647  Such a block might look like this:
15648 \end_layout
15649
15650 \begin_layout LyX-Code
15651 CiteFormat
15652 \end_layout
15653
15654 \begin_layout LyX-Code
15655  article ...
15656 \end_layout
15657
15658 \begin_layout LyX-Code
15659  book ...
15660 \end_layout
15661
15662 \begin_layout LyX-Code
15663 End
15664 \end_layout
15665
15666 \begin_layout Standard
15667 The individual lines define how the bibliographic information associated
15668  with an article or book, respectively, is to be displayed, and such a definitio
15669 n can be given for any `entry type' that might be present in a BibTeX file.
15670  LyX defines a default format in the source code that will be used if no
15671  specific definition has been given.
15672  LyX predefines several formats in the file 
15673 \begin_inset Flex CharStyle:Code
15674 status collapsed
15675
15676 \begin_layout Plain Layout
15677 stdciteformats.inc
15678 \end_layout
15679
15680 \end_inset
15681
15682 , which is included in most of LyX's document classes.
15683 \end_layout
15684
15685 \begin_layout Standard
15686 The definitions use a simple language that allows BibTeX keys to be replaced
15687  with their values.
15688  Keys should be enclosed in % signs, e.g.: 
15689 \begin_inset Flex CharStyle:Code
15690 status collapsed
15691
15692 \begin_layout Plain Layout
15693 %author%
15694 \end_layout
15695
15696 \end_inset
15697
15698 .
15699  So a simple definition might look like this:
15700 \end_layout
15701
15702 \begin_layout LyX-Code
15703 misc %author%, 
15704 \begin_inset Quotes eld
15705 \end_inset
15706
15707 %title
15708 \begin_inset Quotes erd
15709 \end_inset
15710
15711 .
15712 \end_layout
15713
15714 \begin_layout Standard
15715 This would print the author, followed by a comma, followed by the title,
15716  in quotes, followed by a period.
15717 \end_layout
15718
15719 \begin_layout Standard
15720 Of course, sometimes you may want to print a key only if it exists.
15721  This can be done by using a conditional construction, such as: 
15722 \begin_inset Flex CharStyle:Code
15723 status collapsed
15724
15725 \begin_layout Plain Layout
15726 {%volume%[[vol.
15727 \begin_inset space ~
15728 \end_inset
15729
15730 %volume%]]}
15731 \end_layout
15732
15733 \end_inset
15734
15735 .
15736  This says: If the 
15737 \begin_inset Flex CharStyle:Code
15738 status collapsed
15739
15740 \begin_layout Plain Layout
15741 volume
15742 \end_layout
15743
15744 \end_inset
15745
15746  key exists, then print 
15747 \begin_inset Quotes eld
15748 \end_inset
15749
15750 vol.
15751 \begin_inset space ~
15752 \end_inset
15753
15754
15755 \begin_inset Quotes erd
15756 \end_inset
15757
15758  followed by the volume key.
15759  It is also possible to have an else clause in the conditional, such as:
15760  
15761 \begin_inset Flex CharStyle:Code
15762 status collapsed
15763
15764 \begin_layout Plain Layout
15765 {%author%[[%author%]][[%editor%, ed.]]}
15766 \end_layout
15767
15768 \end_inset
15769
15770 .
15771  Here, the 
15772 \begin_inset Flex CharStyle:Code
15773 status collapsed
15774
15775 \begin_layout Plain Layout
15776 author
15777 \end_layout
15778
15779 \end_inset
15780
15781  key is printed if it exists; otherwise, the editor key is printed, followed
15782  by 
15783 \begin_inset Quotes eld
15784 \end_inset
15785
15786 ,
15787 \begin_inset space ~
15788 \end_inset
15789
15790 ed.
15791 \begin_inset Quotes erd
15792 \end_inset
15793
15794  Note that the key is again enclosed in % signs; the entire conditional
15795  is enclosed in braces; and the if and else clauses are enclosed in double
15796  brackets, 
15797 \begin_inset Quotes eld
15798 \end_inset
15799
15800 [[
15801 \begin_inset Quotes eld
15802 \end_inset
15803
15804  and 
15805 \begin_inset Quotes eld
15806 \end_inset
15807
15808 ]]
15809 \begin_inset Quotes erd
15810 \end_inset
15811
15812 .
15813  There must be no space between any of these.
15814 \end_layout
15815
15816 \begin_layout Standard
15817 There is one other piece of syntax available in definitions, which looks
15818  like this: 
15819 \begin_inset Flex CharStyle:Code
15820 status collapsed
15821
15822 \begin_layout Plain Layout
15823 {!<i>!}
15824 \end_layout
15825
15826 \end_inset
15827
15828 .
15829  This defines a piece of formatting information that is to be used when
15830  creating 
15831 \begin_inset Quotes eld
15832 \end_inset
15833
15834 rich text
15835 \begin_inset Quotes erd
15836 \end_inset
15837
15838 .
15839  Obviously, we do not want to output HTML tags when writing plain text,
15840  so they should be wrapped in 
15841 \begin_inset Quotes eld
15842 \end_inset
15843
15844 {!
15845 \begin_inset Quotes erd
15846 \end_inset
15847
15848  and 
15849 \begin_inset Quotes eld
15850 \end_inset
15851
15852 !}
15853 \begin_inset Quotes erd
15854 \end_inset
15855
15856 .
15857 \end_layout
15858
15859 \begin_layout Standard
15860 Two special sorts of definitions are also possible in a 
15861 \begin_inset Flex CharStyle:Code
15862 status collapsed
15863
15864 \begin_layout Plain Layout
15865 CiteFormat
15866 \end_layout
15867
15868 \end_inset
15869
15870  block.
15871  An example of the first would be:
15872 \end_layout
15873
15874 \begin_layout LyX-Code
15875 !quotetitle 
15876 \begin_inset Quotes eld
15877 \end_inset
15878
15879 %title%
15880 \begin_inset Quotes erd
15881 \end_inset
15882
15883
15884 \end_layout
15885
15886 \begin_layout Standard
15887 This is an abbreviation, or macro, and it can be used by treating it as
15888  if it were a key: 
15889 \begin_inset Flex CharStyle:Code
15890 status collapsed
15891
15892 \begin_layout Plain Layout
15893 %!quotetitle%
15894 \end_layout
15895
15896 \end_inset
15897
15898 .
15899  LyX will treat 
15900 \begin_inset Flex CharStyle:Code
15901 status collapsed
15902
15903 \begin_layout Plain Layout
15904 %!quotetitle%
15905 \end_layout
15906
15907 \end_inset
15908
15909  exactly as it would treat its definition.
15910  So, let us issue the obvious 
15911 \emph on
15912 warning
15913 \emph default
15914 .
15915  Do not do this:
15916 \end_layout
15917
15918 \begin_layout LyX-Code
15919 !funfun %funfun%
15920 \end_layout
15921
15922 \begin_layout Standard
15923 or anything like it.
15924  LyX shouldn't go into an infinite loop, but it may go into a long one before
15925  it gives up.
15926 \end_layout
15927
15928 \begin_layout Standard
15929 The second sort of special definition might look like this:
15930 \end_layout
15931
15932 \begin_layout LyX-Code
15933 _pptext pp.
15934 \end_layout
15935
15936 \begin_layout Standard
15937 This defines a translatable piece of text, which allows relevant parts of
15938  the bibliography to be translated.
15939  It can be included in a definition by treating it as a key: 
15940 \begin_inset Flex CharStyle:Code
15941 status collapsed
15942
15943 \begin_layout Plain Layout
15944 %_pptext%
15945 \end_layout
15946
15947 \end_inset
15948
15949 .
15950  Several of these are predefined in 
15951 \begin_inset Flex CharStyle:Code
15952 status collapsed
15953
15954 \begin_layout Plain Layout
15955 stdciteformats.inc
15956 \end_layout
15957
15958 \end_inset
15959
15960 .
15961  Note that these are not macros, in the sense just defined.
15962  They will not be expanded.
15963 \end_layout
15964
15965 \begin_layout Standard
15966 So here then is an example that use all these features:
15967 \end_layout
15968
15969 \begin_layout LyX-Code
15970 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
15971 \end_layout
15972
15973 \begin_layout Standard
15974 The defines a macro that prints the author, followed by a comma, if the
15975  
15976 \begin_inset Flex CharStyle:Code
15977 status collapsed
15978
15979 \begin_layout Plain Layout
15980 author
15981 \end_layout
15982
15983 \end_inset
15984
15985  key is defined, or else prints the name of the editor, followed by the
15986  
15987 \begin_inset Flex CharStyle:Code
15988 status collapsed
15989
15990 \begin_layout Plain Layout
15991 _edtext
15992 \end_layout
15993
15994 \end_inset
15995
15996  or its translation (it is by default 
15997 \begin_inset Quotes eld
15998 \end_inset
15999
16000 ed.
16001 \begin_inset Quotes erd
16002 \end_inset
16003
16004 ), if the 
16005 \begin_inset Flex CharStyle:Code
16006 status collapsed
16007
16008 \begin_layout Plain Layout
16009 editor
16010 \end_layout
16011
16012 \end_inset
16013
16014  key is defined.
16015  Note that this is in fact defined in 
16016 \begin_inset Flex CharStyle:Code
16017 status collapsed
16018
16019 \begin_layout Plain Layout
16020 stdciteformats.inc
16021 \end_layout
16022
16023 \end_inset
16024
16025 , so you can use it in your own definitions, or re-definitions, if you load
16026  that file first.
16027 \end_layout
16028
16029 \begin_layout Section
16030 \begin_inset CommandInset label
16031 LatexCommand label
16032 name "sec:Tags-for-XHTML"
16033
16034 \end_inset
16035
16036 Tags for XHTML output
16037 \end_layout
16038
16039 \begin_layout Standard
16040 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16041  by layout information.
16042  In general, LyX provides sensible defaults and, as mentioned earlier, it
16043  will even construct default CSS style rules from the other layout tags.
16044  For example, LyX will attempt to use the information provided in the 
16045 \begin_inset Flex CharStyle:Code
16046 status collapsed
16047
16048 \begin_layout Plain Layout
16049 Font
16050 \end_layout
16051
16052 \end_inset
16053
16054  declaration for the Chapter style to write CSS that will appropriately
16055  format chapter headings.
16056 \end_layout
16057
16058 \begin_layout Standard
16059 In many cases, then, you may not have to do anything at all to get acceptable
16060  XHTML output for your own environments, custom insets, and so forth.
16061  But in some cases you will, and so LyX provides a number of layout tags
16062  that can be used to customize the XHTML and CSS that are generated.
16063 \end_layout
16064
16065 \begin_layout Standard
16066 Note that there are two tags, 
16067 \begin_inset Flex CharStyle:Code
16068 status collapsed
16069
16070 \begin_layout Plain Layout
16071 HTMLPreamble
16072 \end_layout
16073
16074 \end_inset
16075
16076  and 
16077 \begin_inset Flex CharStyle:Code
16078 status collapsed
16079
16080 \begin_layout Plain Layout
16081 AddToHTMLPreamble
16082 \end_layout
16083
16084 \end_inset
16085
16086  that may appear outside style and inset declarations.
16087  See 
16088 \begin_inset CommandInset ref
16089 LatexCommand prettyref
16090 reference "sub:General-text-class"
16091
16092 \end_inset
16093
16094  for details on these.
16095 \end_layout
16096
16097 \begin_layout Subsection
16098 \begin_inset CommandInset label
16099 LatexCommand label
16100 name "sub:Paragraph-Style-XHTML"
16101
16102 \end_inset
16103
16104 Paragraph styles
16105 \end_layout
16106
16107 \begin_layout Standard
16108 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16109  dealing with a normal paragraph, a command, or an environment, where this
16110  is itself determined by the contents of the corresponding 
16111 \begin_inset Flex CharStyle:Code
16112 status collapsed
16113
16114 \begin_layout Plain Layout
16115 LaTeXType
16116 \end_layout
16117
16118 \end_inset
16119
16120  tag.
16121  
16122 \end_layout
16123
16124 \begin_layout Standard
16125 For a command or normal paragraph, the output XHTML has the following form:
16126 \end_layout
16127
16128 \begin_layout LyX-Code
16129 <tag attr=
16130 \begin_inset Quotes erd
16131 \end_inset
16132
16133 value
16134 \begin_inset Quotes erd
16135 \end_inset
16136
16137 >
16138 \end_layout
16139
16140 \begin_layout LyX-Code
16141 <labeltag attr=
16142 \begin_inset Quotes erd
16143 \end_inset
16144
16145 value
16146 \begin_inset Quotes erd
16147 \end_inset
16148
16149 >Label</labeltag>
16150 \end_layout
16151
16152 \begin_layout LyX-Code
16153 Contents of the paragraph.
16154 \end_layout
16155
16156 \begin_layout LyX-Code
16157 </tag>
16158 \end_layout
16159
16160 \begin_layout Standard
16161 The label tags are of course omitted if the paragraph does not have a label.
16162 \end_layout
16163
16164 \begin_layout Standard
16165 For an environment that is not some sort of list, the XHTML takes this form:
16166 \end_layout
16167
16168 \begin_layout LyX-Code
16169 <tag attr=
16170 \begin_inset Quotes erd
16171 \end_inset
16172
16173 value
16174 \begin_inset Quotes erd
16175 \end_inset
16176
16177 >
16178 \end_layout
16179
16180 \begin_layout LyX-Code
16181 <itemtag attr=
16182 \begin_inset Quotes erd
16183 \end_inset
16184
16185 value
16186 \begin_inset Quotes erd
16187 \end_inset
16188
16189 ><labeltag attr=
16190 \begin_inset Quotes erd
16191 \end_inset
16192
16193 value
16194 \begin_inset Quotes erd
16195 \end_inset
16196
16197 >Environment Label</labeltag>First paragraph.</itemtag>
16198 \end_layout
16199
16200 \begin_layout LyX-Code
16201 <itemtag>Second paragraph.</itemtag>
16202 \end_layout
16203
16204 \begin_layout LyX-Code
16205 </tag>
16206 \end_layout
16207
16208 \begin_layout Standard
16209 Note that the label is output only for the first paragraph, as it should
16210  be for a theorem, for example.
16211  
16212 \end_layout
16213
16214 \begin_layout Standard
16215 For a list, we have one of these forms:
16216 \end_layout
16217
16218 \begin_layout LyX-Code
16219 <tag attr=
16220 \begin_inset Quotes erd
16221 \end_inset
16222
16223 value
16224 \begin_inset Quotes erd
16225 \end_inset
16226
16227 >
16228 \end_layout
16229
16230 \begin_layout LyX-Code
16231 <itemtag attr=
16232 \begin_inset Quotes erd
16233 \end_inset
16234
16235 value
16236 \begin_inset Quotes erd
16237 \end_inset
16238
16239 ><labeltag attr=
16240 \begin_inset Quotes erd
16241 \end_inset
16242
16243 value
16244 \begin_inset Quotes erd
16245 \end_inset
16246
16247 >List Label</labeltag>First item.</itemtag>
16248 \end_layout
16249
16250 \begin_layout LyX-Code
16251 <itemtag attr=
16252 \begin_inset Quotes erd
16253 \end_inset
16254
16255 value
16256 \begin_inset Quotes erd
16257 \end_inset
16258
16259 ><labeltag attr=
16260 \begin_inset Quotes erd
16261 \end_inset
16262
16263 value
16264 \begin_inset Quotes erd
16265 \end_inset
16266
16267 >List Label</labeltag>Second item.</itemtag>
16268 \end_layout
16269
16270 \begin_layout LyX-Code
16271 </tag>
16272 \end_layout
16273
16274 \begin_layout LyX-Code
16275
16276 \end_layout
16277
16278 \begin_layout LyX-Code
16279 <tag attr=
16280 \begin_inset Quotes erd
16281 \end_inset
16282
16283 value
16284 \begin_inset Quotes erd
16285 \end_inset
16286
16287 >
16288 \end_layout
16289
16290 \begin_layout LyX-Code
16291 <labeltag attr=
16292 \begin_inset Quotes erd
16293 \end_inset
16294
16295 value
16296 \begin_inset Quotes erd
16297 \end_inset
16298
16299 >List Label</labeltag><itemtag attr=
16300 \begin_inset Quotes erd
16301 \end_inset
16302
16303 value
16304 \begin_inset Quotes erd
16305 \end_inset
16306
16307 >First item.</itemtag>
16308 \end_layout
16309
16310 \begin_layout LyX-Code
16311 <labeltag attr=
16312 \begin_inset Quotes erd
16313 \end_inset
16314
16315 value
16316 \begin_inset Quotes erd
16317 \end_inset
16318
16319 >List Label</labeltag><itemtag attr=
16320 \begin_inset Quotes erd
16321 \end_inset
16322
16323 value
16324 \begin_inset Quotes erd
16325 \end_inset
16326
16327 >Second item.</itemtag>
16328 \end_layout
16329
16330 \begin_layout LyX-Code
16331 </tag>
16332 \end_layout
16333
16334 \begin_layout Standard
16335 Note the different orders of 
16336 \begin_inset Flex CharStyle:Code
16337 status collapsed
16338
16339 \begin_layout Plain Layout
16340 labeltag
16341 \end_layout
16342
16343 \end_inset
16344
16345  and 
16346 \begin_inset Flex CharStyle:Code
16347 status collapsed
16348
16349 \begin_layout Plain Layout
16350 itemtag
16351 \end_layout
16352
16353 \end_inset
16354
16355 .
16356  Which order we get depends upon the setting of 
16357 \begin_inset Flex CharStyle:Code
16358 status collapsed
16359
16360 \begin_layout Plain Layout
16361 HTMLLabelFirst
16362 \end_layout
16363
16364 \end_inset
16365
16366 : If 
16367 \begin_inset Flex CharStyle:Code
16368 status collapsed
16369
16370 \begin_layout Plain Layout
16371 HTMLLabelFirst
16372 \end_layout
16373
16374 \end_inset
16375
16376  is false (the default), you get the first of these, with the label within
16377  the item; if true, you get the second, with the label outside the item.
16378 \end_layout
16379
16380 \begin_layout Standard
16381 The specific tags and attributes output for each paragraph type can be controlle
16382 d by means of the layout tags we are about to describe.
16383  As mentioned earlier, however, LyX uses sensible defaults for many of these,
16384  so you often may not need to do very much to get good XHTML output.
16385  Think of the available tags as there so you can tweak things to your liking.
16386 \end_layout
16387
16388 \begin_layout Description
16389 \begin_inset Flex CharStyle:Code
16390 status collapsed
16391
16392 \begin_layout Plain Layout
16393 HTMLAttr
16394 \end_layout
16395
16396 \end_inset
16397
16398  [
16399 \begin_inset Flex CharStyle:Code
16400 status collapsed
16401
16402 \begin_layout Plain Layout
16403 string
16404 \end_layout
16405
16406 \end_inset
16407
16408 ] Specifies attribute information to be output with the main tag.
16409  For example, 
16410 \begin_inset Quotes eld
16411 \end_inset
16412
16413
16414 \begin_inset Flex CharStyle:Code
16415 status collapsed
16416
16417 \begin_layout Plain Layout
16418 class=`mydiv'
16419 \end_layout
16420
16421 \end_inset
16422
16423
16424 \begin_inset Quotes erd
16425 \end_inset
16426
16427 .
16428  By default, LyX will output 
16429 \begin_inset Quotes eld
16430 \end_inset
16431
16432
16433 \begin_inset Flex CharStyle:Code
16434 status collapsed
16435
16436 \begin_layout Plain Layout
16437 class=`layoutname'
16438 \end_layout
16439
16440 \end_inset
16441
16442
16443 \begin_inset Quotes erd
16444 \end_inset
16445
16446 , where 
16447 \begin_inset Flex CharStyle:Code
16448 status collapsed
16449
16450 \begin_layout Plain Layout
16451 layoutname
16452 \end_layout
16453
16454 \end_inset
16455
16456  is the LyX name of the layout, made lowercase, for example: chapter.
16457 \end_layout
16458
16459 \begin_layout Description
16460 \begin_inset Flex CharStyle:Code
16461 status collapsed
16462
16463 \begin_layout Plain Layout
16464 HTMLForceCSS
16465 \end_layout
16466
16467 \end_inset
16468
16469  [
16470 \begin_inset Flex CharStyle:Code
16471 status collapsed
16472
16473 \begin_layout Plain Layout
16474
16475 \emph on
16476 0
16477 \emph default
16478 ,1
16479 \end_layout
16480
16481 \end_inset
16482
16483 ] Whether to output the default CSS information LyX generates for this layout,
16484  even if additional information is explicitly provided via 
16485 \begin_inset Flex CharStyle:Code
16486 status collapsed
16487
16488 \begin_layout Plain Layout
16489 HTMLStyle
16490 \end_layout
16491
16492 \end_inset
16493
16494 .
16495  Setting this to 
16496 \begin_inset Flex CharStyle:Code
16497 status collapsed
16498
16499 \begin_layout Plain Layout
16500 1
16501 \end_layout
16502
16503 \end_inset
16504
16505  allows you to alter or augment the generated CSS, rather than to override
16506  it completely.
16507  Default is 
16508 \begin_inset Flex CharStyle:Code
16509 status collapsed
16510
16511 \begin_layout Plain Layout
16512 0
16513 \end_layout
16514
16515 \end_inset
16516
16517 .
16518 \end_layout
16519
16520 \begin_layout Description
16521 \begin_inset Flex CharStyle:Code
16522 status collapsed
16523
16524 \begin_layout Plain Layout
16525 HTMLItem
16526 \end_layout
16527
16528 \end_inset
16529
16530  [
16531 \begin_inset Flex CharStyle:Code
16532 status collapsed
16533
16534 \begin_layout Plain Layout
16535 string
16536 \end_layout
16537
16538 \end_inset
16539
16540 ] The tag to be used for individual paragraphs of environments, replacing
16541  
16542 \begin_inset Flex CharStyle:Code
16543 status collapsed
16544
16545 \begin_layout Plain Layout
16546 itemtag
16547 \end_layout
16548
16549 \end_inset
16550
16551  in the examples above.
16552  Defaults to 
16553 \begin_inset Flex CharStyle:Code
16554 status collapsed
16555
16556 \begin_layout Plain Layout
16557 div
16558 \end_layout
16559
16560 \end_inset
16561
16562 .
16563 \end_layout
16564
16565 \begin_layout Description
16566 \begin_inset Flex CharStyle:Code
16567 status collapsed
16568
16569 \begin_layout Plain Layout
16570 HTMLItemAttr
16571 \end_layout
16572
16573 \end_inset
16574
16575  [
16576 \begin_inset Flex CharStyle:Code
16577 status collapsed
16578
16579 \begin_layout Plain Layout
16580 string
16581 \end_layout
16582
16583 \end_inset
16584
16585 ] Attributes for the item tag.
16586  Defaults to 
16587 \begin_inset Quotes eld
16588 \end_inset
16589
16590
16591 \begin_inset Flex CharStyle:Code
16592 status collapsed
16593
16594 \begin_layout Plain Layout
16595 class=`layoutname_item'
16596 \end_layout
16597
16598 \end_inset
16599
16600
16601 \begin_inset Quotes erd
16602 \end_inset
16603
16604 .
16605 \end_layout
16606
16607 \begin_layout Description
16608 \begin_inset Flex CharStyle:Code
16609 status collapsed
16610
16611 \begin_layout Plain Layout
16612 HTMLLabel
16613 \end_layout
16614
16615 \end_inset
16616
16617  [
16618 \begin_inset Flex CharStyle:Code
16619 status collapsed
16620
16621 \begin_layout Plain Layout
16622 string
16623 \end_layout
16624
16625 \end_inset
16626
16627 ] The tag to be used for paragraph and item labels, replacing 
16628 \begin_inset Flex CharStyle:Code
16629 status collapsed
16630
16631 \begin_layout Plain Layout
16632 labeltag
16633 \end_layout
16634
16635 \end_inset
16636
16637  in the examples above.
16638  Defaults to 
16639 \begin_inset Flex CharStyle:Code
16640 status collapsed
16641
16642 \begin_layout Plain Layout
16643 span
16644 \end_layout
16645
16646 \end_inset
16647
16648 .
16649 \end_layout
16650
16651 \begin_layout Description
16652 \begin_inset Flex CharStyle:Code
16653 status collapsed
16654
16655 \begin_layout Plain Layout
16656 HTMLLabelAttr
16657 \end_layout
16658
16659 \end_inset
16660
16661  [
16662 \begin_inset Flex CharStyle:Code
16663 status collapsed
16664
16665 \begin_layout Plain Layout
16666 string
16667 \end_layout
16668
16669 \end_inset
16670
16671 ] Attributes for the label tag.
16672  Defaults to 
16673 \begin_inset Quotes eld
16674 \end_inset
16675
16676
16677 \begin_inset Flex CharStyle:Code
16678 status collapsed
16679
16680 \begin_layout Plain Layout
16681 class=`layoutname_label'
16682 \end_layout
16683
16684 \end_inset
16685
16686
16687 \begin_inset Quotes erd
16688 \end_inset
16689
16690 .
16691 \end_layout
16692
16693 \begin_layout Description
16694 \begin_inset Flex CharStyle:Code
16695 status collapsed
16696
16697 \begin_layout Plain Layout
16698 HTMLLabelFirst
16699 \end_layout
16700
16701 \end_inset
16702
16703  [
16704 \begin_inset Flex CharStyle:Code
16705 status collapsed
16706
16707 \begin_layout Plain Layout
16708
16709 \emph on
16710 0
16711 \emph default
16712 ,1
16713 \end_layout
16714
16715 \end_inset
16716
16717 ] Meaningful only for list-like environments, this tag controls whether
16718  the label tag is output before or inside the item tag.
16719  This is used, for example, in the description environment, where we want
16720  `
16721 \begin_inset Flex CharStyle:Code
16722 status collapsed
16723
16724 \begin_layout Plain Layout
16725 <dt>\SpecialChar \ldots{}
16726 </dt><dd>\SpecialChar \ldots{}
16727 </dd>
16728 \end_layout
16729
16730 \end_inset
16731
16732 .
16733  Default is 
16734 \begin_inset Flex CharStyle:Code
16735 status collapsed
16736
16737 \begin_layout Plain Layout
16738 0
16739 \end_layout
16740
16741 \end_inset
16742
16743 : The label tag is output inside the item tag.
16744 \end_layout
16745
16746 \begin_layout Description
16747 \begin_inset Flex CharStyle:Code
16748 status collapsed
16749
16750 \begin_layout Plain Layout
16751 HTMLPreamble
16752 \end_layout
16753
16754 \end_inset
16755
16756  Information to be output in the 
16757 \begin_inset Flex CharStyle:Code
16758 status collapsed
16759
16760 \begin_layout Plain Layout
16761 <head>
16762 \end_layout
16763
16764 \end_inset
16765
16766  section when this style is used.
16767  This might, for example, be used to include a 
16768 \begin_inset Flex CharStyle:Code
16769 status collapsed
16770
16771 \begin_layout Plain Layout
16772 <script>
16773 \end_layout
16774
16775 \end_inset
16776
16777  block defining an 
16778 \begin_inset Flex CharStyle:Code
16779 status collapsed
16780
16781 \begin_layout Plain Layout
16782 onclick
16783 \end_layout
16784
16785 \end_inset
16786
16787  handler.
16788 \end_layout
16789
16790 \begin_layout Description
16791 \begin_inset Flex CharStyle:Code
16792 status collapsed
16793
16794 \begin_layout Plain Layout
16795 HTMLStyle
16796 \end_layout
16797
16798 \end_inset
16799
16800  CSS style information to be included when this style is used.
16801  Note that this will automatically be wrapped in a layout-generated 
16802 \begin_inset Flex CharStyle:Code
16803 status collapsed
16804
16805 \begin_layout Plain Layout
16806 <style>
16807 \end_layout
16808
16809 \end_inset
16810
16811  block, so only the CSS itself need be included.
16812 \end_layout
16813
16814 \begin_layout Description
16815 \begin_inset Flex CharStyle:Code
16816 status collapsed
16817
16818 \begin_layout Plain Layout
16819 HTMLTag
16820 \end_layout
16821
16822 \end_inset
16823
16824  [
16825 \begin_inset Flex CharStyle:Code
16826 status collapsed
16827
16828 \begin_layout Plain Layout
16829 string
16830 \end_layout
16831
16832 \end_inset
16833
16834 ] The tag to be used for the main label, replacing 
16835 \begin_inset Flex CharStyle:Code
16836 status collapsed
16837
16838 \begin_layout Plain Layout
16839 tag
16840 \end_layout
16841
16842 \end_inset
16843
16844  in the examples above.
16845  Defaults to 
16846 \begin_inset Flex CharStyle:Code
16847 status collapsed
16848
16849 \begin_layout Plain Layout
16850 div
16851 \end_layout
16852
16853 \end_inset
16854
16855 .
16856 \end_layout
16857
16858 \begin_layout Description
16859 \begin_inset Flex CharStyle:Code
16860 status collapsed
16861
16862 \begin_layout Plain Layout
16863 HTMLTitle
16864 \end_layout
16865
16866 \end_inset
16867
16868  [
16869 \begin_inset Flex CharStyle:Code
16870 status collapsed
16871
16872 \begin_layout Plain Layout
16873
16874 \emph on
16875 0
16876 \emph default
16877 ,1
16878 \end_layout
16879
16880 \end_inset
16881
16882 ] Marks this style as the one to be used to generate the 
16883 \begin_inset Flex CharStyle:Code
16884 status collapsed
16885
16886 \begin_layout Plain Layout
16887 <title>
16888 \end_layout
16889
16890 \end_inset
16891
16892  tag for the XHTML file.
16893  By default, it is false.
16894  The 
16895 \begin_inset Flex CharStyle:Code
16896 status collapsed
16897
16898 \begin_layout Plain Layout
16899 stdtitle.inc
16900 \end_layout
16901
16902 \end_inset
16903
16904  file sets it to true for the 
16905 \begin_inset Flex CharStyle:Code
16906 status collapsed
16907
16908 \begin_layout Plain Layout
16909 title
16910 \end_layout
16911
16912 \end_inset
16913
16914  environment.
16915  
16916 \end_layout
16917
16918 \begin_layout Subsection
16919 InsetLayout XHTML
16920 \end_layout
16921
16922 \begin_layout Standard
16923 The XHTML output of insets can also be controlled by information in layout
16924  files.
16925 \begin_inset Foot
16926 status collapsed
16927
16928 \begin_layout Plain Layout
16929 At present, this is true only for 
16930 \begin_inset Quotes eld
16931 \end_inset
16932
16933 text
16934 \begin_inset Quotes erd
16935 \end_inset
16936
16937  insets (insets you can type into) and is not true for 
16938 \begin_inset Quotes eld
16939 \end_inset
16940
16941 command
16942 \begin_inset Quotes erd
16943 \end_inset
16944
16945  insets (insets that are associated with dialog boxes).
16946 \end_layout
16947
16948 \end_inset
16949
16950  Here, too, LyX tries to provide sensible defaults, and it constructs default
16951  CSS style rules.
16952  But everything can be customized.
16953 \end_layout
16954
16955 \begin_layout Standard
16956 The XHTML LyX outputs for an inset has the following form:
16957 \end_layout
16958
16959 \begin_layout LyX-Code
16960 <tag attr=
16961 \begin_inset Quotes erd
16962 \end_inset
16963
16964 value
16965 \begin_inset Quotes erd
16966 \end_inset
16967
16968 >
16969 \end_layout
16970
16971 \begin_layout LyX-Code
16972 <labeltag>Label</labeltag>
16973 \end_layout
16974
16975 \begin_layout LyX-Code
16976 <innertag attr=
16977 \begin_inset Quotes erd
16978 \end_inset
16979
16980 value
16981 \begin_inset Quotes erd
16982 \end_inset
16983
16984 >Contents of the inset.</innertag>
16985 \end_layout
16986
16987 \begin_layout LyX-Code
16988 </tag>
16989 \end_layout
16990
16991 \begin_layout Standard
16992 If the inset permits multiple paragraphs---that is, if 
16993 \begin_inset Flex CharStyle:Code
16994 status collapsed
16995
16996 \begin_layout Plain Layout
16997 MultiPar
16998 \end_layout
16999
17000 \end_inset
17001
17002  is true---then the contents of the inset will itself be output as paragraphs
17003  formatted according to the styles used for those paragraphs (standard,
17004  quote, and the like).
17005  The label tag is of course omitted if the paragraph does not have a label
17006  and, at present, is always 
17007 \begin_inset Flex CharStyle:Code
17008 status collapsed
17009
17010 \begin_layout Plain Layout
17011 span
17012 \end_layout
17013
17014 \end_inset
17015
17016 .
17017  The inner tag is optional and, by default, does not appear.
17018 \end_layout
17019
17020 \begin_layout Standard
17021 The specific tags and attributes output for each inset can be controlled
17022  by means of the following layout tags.
17023 \end_layout
17024
17025 \begin_layout Description
17026 \begin_inset Flex CharStyle:Code
17027 status collapsed
17028
17029 \begin_layout Plain Layout
17030 HTMLAttr
17031 \end_layout
17032
17033 \end_inset
17034
17035  [
17036 \begin_inset Flex CharStyle:Code
17037 status collapsed
17038
17039 \begin_layout Plain Layout
17040 string
17041 \end_layout
17042
17043 \end_inset
17044
17045 ] Specifies attribute information to be output with the main tag.
17046  For example, 
17047 \begin_inset Quotes eld
17048 \end_inset
17049
17050
17051 \begin_inset Flex CharStyle:Code
17052 status collapsed
17053
17054 \begin_layout Plain Layout
17055 class=`myinset' onclick=`\SpecialChar \ldots{}
17056 '
17057 \end_layout
17058
17059 \end_inset
17060
17061
17062 \begin_inset Quotes erd
17063 \end_inset
17064
17065 .
17066  By default, LyX will output 
17067 \begin_inset Quotes eld
17068 \end_inset
17069
17070
17071 \begin_inset Flex CharStyle:Code
17072 status collapsed
17073
17074 \begin_layout Plain Layout
17075 class=`insetname'
17076 \end_layout
17077
17078 \end_inset
17079
17080
17081 \begin_inset Quotes erd
17082 \end_inset
17083
17084 , where 
17085 \begin_inset Flex CharStyle:Code
17086 status collapsed
17087
17088 \begin_layout Plain Layout
17089 insetname
17090 \end_layout
17091
17092 \end_inset
17093
17094  is the LyX name of the inset, made lowercase and with non-alphanumeric
17095  characters converted to underscores, for example: footnote.
17096 \end_layout
17097
17098 \begin_layout Description
17099 \begin_inset Flex CharStyle:Code
17100 status collapsed
17101
17102 \begin_layout Plain Layout
17103 HTMLForceCSS
17104 \end_layout
17105
17106 \end_inset
17107
17108  [
17109 \begin_inset Flex CharStyle:Code
17110 status collapsed
17111
17112 \begin_layout Plain Layout
17113
17114 \emph on
17115 0
17116 \emph default
17117 ,1
17118 \end_layout
17119
17120 \end_inset
17121
17122 ] Whether to output the default CSS information LyX generates for this layout,
17123  even if additional information is explicitly provided via 
17124 \begin_inset Flex CharStyle:Code
17125 status collapsed
17126
17127 \begin_layout Plain Layout
17128 HTMLStyle
17129 \end_layout
17130
17131 \end_inset
17132
17133 .
17134  Setting this to 
17135 \begin_inset Flex CharStyle:Code
17136 status collapsed
17137
17138 \begin_layout Plain Layout
17139 1
17140 \end_layout
17141
17142 \end_inset
17143
17144  allows you to alter or augment the generated CSS, rather than to override
17145  it completely.
17146  Default is 0.
17147 \end_layout
17148
17149 \begin_layout Description
17150 \begin_inset Flex CharStyle:Code
17151 status collapsed
17152
17153 \begin_layout Plain Layout
17154 HTMLInnerAttr
17155 \end_layout
17156
17157 \end_inset
17158
17159  [
17160 \begin_inset Flex CharStyle:Code
17161 status collapsed
17162
17163 \begin_layout Plain Layout
17164 string
17165 \end_layout
17166
17167 \end_inset
17168
17169 ] Attributes for the inner tag.
17170  Defaults to 
17171 \begin_inset Quotes eld
17172 \end_inset
17173
17174
17175 \begin_inset Flex CharStyle:Code
17176 status collapsed
17177
17178 \begin_layout Plain Layout
17179 class=`insetname_inner'
17180 \end_layout
17181
17182 \end_inset
17183
17184
17185 \begin_inset Quotes erd
17186 \end_inset
17187
17188 .
17189 \end_layout
17190
17191 \begin_layout Description
17192 \begin_inset Flex CharStyle:Code
17193 status collapsed
17194
17195 \begin_layout Plain Layout
17196 HTMLInnerTag
17197 \end_layout
17198
17199 \end_inset
17200
17201  [
17202 \begin_inset Flex CharStyle:Code
17203 status collapsed
17204
17205 \begin_layout Plain Layout
17206 string
17207 \end_layout
17208
17209 \end_inset
17210
17211 ] The inner tag, replacing 
17212 \begin_inset Flex CharStyle:Code
17213 status collapsed
17214
17215 \begin_layout Plain Layout
17216 innertag
17217 \end_layout
17218
17219 \end_inset
17220
17221  in the examples above.
17222  By default, there is none.
17223 \end_layout
17224
17225 \begin_layout Description
17226 \begin_inset Flex CharStyle:Code
17227 status collapsed
17228
17229 \begin_layout Plain Layout
17230 HTMLIsBlock
17231 \end_layout
17232
17233 \end_inset
17234
17235  [
17236 \begin_inset Flex CharStyle:Code
17237 status collapsed
17238
17239 \begin_layout Plain Layout
17240 0,
17241 \emph on
17242 1
17243 \end_layout
17244
17245 \end_inset
17246
17247 ] Whether this inset represents a standalone block of text (such as a footnote)
17248  or instead represents material that is included in the surrounding text
17249  (such as a branch).
17250  Defaults to 1.
17251 \end_layout
17252
17253 \begin_layout Description
17254 \begin_inset Flex CharStyle:Code
17255 status collapsed
17256
17257 \begin_layout Plain Layout
17258 HTMLLabel
17259 \end_layout
17260
17261 \end_inset
17262
17263  [
17264 \begin_inset Flex CharStyle:Code
17265 status collapsed
17266
17267 \begin_layout Plain Layout
17268 string
17269 \end_layout
17270
17271 \end_inset
17272
17273 ] A label for this inset, possibly including a reference to a counter.
17274  For example, for footnote, it might be: 
17275 \begin_inset Flex CharStyle:Code
17276 status collapsed
17277
17278 \begin_layout Plain Layout
17279
17280 \backslash
17281 arabic{footnote}
17282 \end_layout
17283
17284 \end_inset
17285
17286 .
17287  This is optional, and there is no default.
17288 \end_layout
17289
17290 \begin_layout Description
17291 \begin_inset Flex CharStyle:Code
17292 status collapsed
17293
17294 \begin_layout Plain Layout
17295 HTMLPreamble
17296 \end_layout
17297
17298 \end_inset
17299
17300  Information to be output in the 
17301 \begin_inset Flex CharStyle:Code
17302 status collapsed
17303
17304 \begin_layout Plain Layout
17305 <head>
17306 \end_layout
17307
17308 \end_inset
17309
17310  section when this style is used.
17311  This might, for example, be used to include a 
17312 \begin_inset Flex CharStyle:Code
17313 status collapsed
17314
17315 \begin_layout Plain Layout
17316 <script>
17317 \end_layout
17318
17319 \end_inset
17320
17321  block defining an 
17322 \begin_inset Flex CharStyle:Code
17323 status collapsed
17324
17325 \begin_layout Plain Layout
17326 onclick
17327 \end_layout
17328
17329 \end_inset
17330
17331  handler.
17332 \end_layout
17333
17334 \begin_layout Description
17335 \begin_inset Flex CharStyle:Code
17336 status collapsed
17337
17338 \begin_layout Plain Layout
17339 HTMLStyle
17340 \end_layout
17341
17342 \end_inset
17343
17344  CSS style information to be included when this style is used.
17345  Note that this will automatically be wrapped in a layout-generated 
17346 \begin_inset Flex CharStyle:Code
17347 status collapsed
17348
17349 \begin_layout Plain Layout
17350 <style>
17351 \end_layout
17352
17353 \end_inset
17354
17355  block, so only the CSS itself need be included.
17356 \end_layout
17357
17358 \begin_layout Description
17359 \begin_inset Flex CharStyle:Code
17360 status collapsed
17361
17362 \begin_layout Plain Layout
17363 HTMLTag
17364 \end_layout
17365
17366 \end_inset
17367
17368  [
17369 \begin_inset Flex CharStyle:Code
17370 status collapsed
17371
17372 \begin_layout Plain Layout
17373 string
17374 \end_layout
17375
17376 \end_inset
17377
17378 ] The tag to be used for the main label, replacing 
17379 \begin_inset Flex CharStyle:Code
17380 status collapsed
17381
17382 \begin_layout Plain Layout
17383 tag
17384 \end_layout
17385
17386 \end_inset
17387
17388  in the examples above.
17389  The default depends upon the setting of 
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 : If 
17400 \begin_inset Flex CharStyle:Code
17401 status collapsed
17402
17403 \begin_layout Plain Layout
17404 MultiPar
17405 \end_layout
17406
17407 \end_inset
17408
17409  is true, the default is 
17410 \begin_inset Flex CharStyle:Code
17411 status collapsed
17412
17413 \begin_layout Plain Layout
17414 div
17415 \end_layout
17416
17417 \end_inset
17418
17419 ; if it is false, the default is 
17420 \begin_inset Flex CharStyle:Code
17421 status collapsed
17422
17423 \begin_layout Plain Layout
17424 span
17425 \end_layout
17426
17427 \end_inset
17428
17429 .
17430 \end_layout
17431
17432 \begin_layout Subsection
17433 Float XHTML
17434 \end_layout
17435
17436 \begin_layout Standard
17437 The XHTML output for floats too can be controlled by layout information.
17438  The output has the following form:
17439 \end_layout
17440
17441 \begin_layout LyX-Code
17442 <tag attr=
17443 \begin_inset Quotes erd
17444 \end_inset
17445
17446 value
17447 \begin_inset Quotes erd
17448 \end_inset
17449
17450 >
17451 \end_layout
17452
17453 \begin_layout LyX-Code
17454 Contents of the float.
17455 \end_layout
17456
17457 \begin_layout LyX-Code
17458 </tag>
17459 \end_layout
17460
17461 \begin_layout Standard
17462 The caption, if there is one, is a separate inset and will be output as
17463  such.
17464  Its appearance can be controlled via the InsetLayout for caption insets.
17465  
17466 \end_layout
17467
17468 \begin_layout Description
17469 \begin_inset Flex CharStyle:Code
17470 status collapsed
17471
17472 \begin_layout Plain Layout
17473 HTMLAttr
17474 \end_layout
17475
17476 \end_inset
17477
17478  [
17479 \begin_inset Flex CharStyle:Code
17480 status collapsed
17481
17482 \begin_layout Plain Layout
17483 string
17484 \end_layout
17485
17486 \end_inset
17487
17488 ] Specifies attribute information to be output with the main tag.
17489  For example, 
17490 \begin_inset Quotes eld
17491 \end_inset
17492
17493
17494 \begin_inset Flex CharStyle:Code
17495 status collapsed
17496
17497 \begin_layout Plain Layout
17498 class=`myfloat' onclick=`\SpecialChar \ldots{}
17499 '
17500 \end_layout
17501
17502 \end_inset
17503
17504
17505 \begin_inset Quotes erd
17506 \end_inset
17507
17508 .
17509  By default, LyX will output 
17510 \begin_inset Quotes eld
17511 \end_inset
17512
17513
17514 \begin_inset Flex CharStyle:Code
17515 status collapsed
17516
17517 \begin_layout Plain Layout
17518 class=`float float-floattype'
17519 \end_layout
17520
17521 \end_inset
17522
17523
17524 \begin_inset Quotes erd
17525 \end_inset
17526
17527 , where 
17528 \begin_inset Flex CharStyle:Code
17529 status collapsed
17530
17531 \begin_layout Plain Layout
17532 floattype
17533 \end_layout
17534
17535 \end_inset
17536
17537  is LyX's name for this type of float, as determined by the float delcaration
17538  (see 
17539 \begin_inset CommandInset ref
17540 LatexCommand ref
17541 reference "sub:Floats"
17542
17543 \end_inset
17544
17545 ), though made lowercase and with non-alphanumeric characters converted
17546  to underscores, for example: float-table.
17547 \end_layout
17548
17549 \begin_layout Description
17550 \begin_inset Flex CharStyle:Code
17551 status collapsed
17552
17553 \begin_layout Plain Layout
17554 HTMLStyle
17555 \end_layout
17556
17557 \end_inset
17558
17559  CSS style information to be included when this float is used.
17560  Note that this will automatically be wrapped in a layout-generated 
17561 \begin_inset Flex CharStyle:Code
17562 status collapsed
17563
17564 \begin_layout Plain Layout
17565 <style>
17566 \end_layout
17567
17568 \end_inset
17569
17570  block, so only the CSS itself need be included.
17571 \end_layout
17572
17573 \begin_layout Description
17574 \begin_inset Flex CharStyle:Code
17575 status collapsed
17576
17577 \begin_layout Plain Layout
17578 HTMLTag
17579 \end_layout
17580
17581 \end_inset
17582
17583  [
17584 \begin_inset Flex CharStyle:Code
17585 status collapsed
17586
17587 \begin_layout Plain Layout
17588 string
17589 \end_layout
17590
17591 \end_inset
17592
17593 ] The tag to be used for this float, replacing 
17594 \begin_inset Quotes eld
17595 \end_inset
17596
17597
17598 \begin_inset Flex CharStyle:Code
17599 status collapsed
17600
17601 \begin_layout Plain Layout
17602 tag
17603 \end_layout
17604
17605 \end_inset
17606
17607
17608 \begin_inset Quotes erd
17609 \end_inset
17610
17611  in the example above.
17612  The default is 
17613 \begin_inset Flex CharStyle:Code
17614 status collapsed
17615
17616 \begin_layout Plain Layout
17617 div
17618 \end_layout
17619
17620 \end_inset
17621
17622  and will rarely need changing.
17623 \end_layout
17624
17625 \begin_layout Subsection
17626 Bibliography formatting
17627 \end_layout
17628
17629 \begin_layout Standard
17630 The bibliography can be formatted using 
17631 \begin_inset Flex CharStyle:Code
17632 status collapsed
17633
17634 \begin_layout Plain Layout
17635 CiteFormat
17636 \end_layout
17637
17638 \end_inset
17639
17640  blocks.
17641  See Section 
17642 \begin_inset CommandInset ref
17643 LatexCommand ref
17644 reference "sub:Citation-format-description"
17645
17646 \end_inset
17647
17648  for the details.
17649 \end_layout
17650
17651 \begin_layout Subsection
17652 LyX-generated CSS
17653 \end_layout
17654
17655 \begin_layout Standard
17656 We have several times mentioned that LyX will generate default CSS style
17657  rules for both insets and paragraph styles, based upon the other layout
17658  information that is provided.
17659  In this section, we shall say a word about which layout information LyX
17660  uses and how.
17661 \end_layout
17662
17663 \begin_layout Standard
17664 At present, LyX auto-generates CSS only for font information, making use
17665  of the 
17666 \begin_inset Flex CharStyle:Code
17667 status collapsed
17668
17669 \begin_layout Plain Layout
17670 Family
17671 \end_layout
17672
17673 \end_inset
17674
17675
17676 \begin_inset Flex CharStyle:Code
17677 status collapsed
17678
17679 \begin_layout Plain Layout
17680 Series
17681 \end_layout
17682
17683 \end_inset
17684
17685
17686 \begin_inset Flex CharStyle:Code
17687 status collapsed
17688
17689 \begin_layout Plain Layout
17690 Shape
17691 \end_layout
17692
17693 \end_inset
17694
17695 , and 
17696 \begin_inset Flex CharStyle:Code
17697 status collapsed
17698
17699 \begin_layout Plain Layout
17700 Size
17701 \end_layout
17702
17703 \end_inset
17704
17705  specified in the 
17706 \begin_inset Flex CharStyle:Code
17707 status collapsed
17708
17709 \begin_layout Plain Layout
17710 Font
17711 \end_layout
17712
17713 \end_inset
17714
17715  declaration.
17716  (See 
17717 \begin_inset CommandInset ref
17718 LatexCommand ref
17719 reference "sub:Font-description"
17720
17721 \end_inset
17722
17723 .) The translation is mostly straightforward and obvious.
17724  For example, 
17725 \begin_inset Quotes eld
17726 \end_inset
17727
17728
17729 \begin_inset Flex CharStyle:Code
17730 status collapsed
17731
17732 \begin_layout Plain Layout
17733 Family Sans
17734 \end_layout
17735
17736 \end_inset
17737
17738
17739 \begin_inset Quotes erd
17740 \end_inset
17741
17742  becomes 
17743 \begin_inset Quotes eld
17744 \end_inset
17745
17746
17747 \begin_inset Flex CharStyle:Code
17748 status collapsed
17749
17750 \begin_layout Plain Layout
17751 font-family: sans-serif;
17752 \end_layout
17753
17754 \end_inset
17755
17756
17757 \begin_inset Quotes erd
17758 \end_inset
17759
17760 .
17761  The correspondence of LyX sizes and CSS sizes is a little less obvious
17762  but nonetheless intuitive.
17763  See the 
17764 \begin_inset Flex CharStyle:Code
17765 status collapsed
17766
17767 \begin_layout Plain Layout
17768 getSizeCSS()
17769 \end_layout
17770
17771 \end_inset
17772
17773  function in 
17774 \begin_inset Flex URL
17775 status collapsed
17776
17777 \begin_layout Plain Layout
17778
17779 src/FontInfo.cpp
17780 \end_layout
17781
17782 \end_inset
17783
17784  for the details.
17785  
17786 \end_layout
17787
17788 \begin_layout Chapter
17789 Including External Material
17790 \end_layout
17791
17792 \begin_layout Standard
17793 \begin_inset Box Shadowbox
17794 position "t"
17795 hor_pos "c"
17796 has_inner_box 1
17797 inner_pos "t"
17798 use_parbox 0
17799 use_makebox 0
17800 width "100col%"
17801 special "none"
17802 height "1in"
17803 height_special "totalheight"
17804 status open
17805
17806 \begin_layout Plain Layout
17807 WARNING: This portion of the documentation has not been updated for some
17808  time.
17809  We certainly hope that it is still accurate, but there are no guarantees.
17810 \end_layout
17811
17812 \end_inset
17813
17814
17815 \end_layout
17816
17817 \begin_layout Standard
17818 The use of material from sources external to LyX is covered in detail in
17819  the 
17820 \emph on
17821 Embedded Objects
17822 \emph default
17823  manual.
17824  This part of the manual covers what needs to happen behind the scenes for
17825  new sorts of material to be included.
17826 \end_layout
17827
17828 \begin_layout Section
17829 How does it work?
17830 \end_layout
17831
17832 \begin_layout Standard
17833 The external material feature is based on the concept of a 
17834 \emph on
17835 template
17836 \emph default
17837 .
17838  A template is a specification of how LyX should interface with a certain
17839  kind of material.
17840  As bundled, LyX comes with predefined templates for Xfig figures, various
17841  raster format images, chess diagrams, and LilyPond music notation.
17842  You can check the actual list by using the menu 
17843 \begin_inset Flex CharStyle:MenuItem
17844 status collapsed
17845
17846 \begin_layout Plain Layout
17847 Insert\SpecialChar \menuseparator
17848 File\SpecialChar \menuseparator
17849 External Material
17850 \end_layout
17851
17852 \end_inset
17853
17854 .
17855  Furthermore, it is possible to roll your own template to support a specific
17856  kind of material.
17857  Later we'll describe in more detail what is involved, and hopefully you
17858  will submit all the templates you create so we can include them in a later
17859  LyX version.
17860 \end_layout
17861
17862 \begin_layout Standard
17863 Another basic idea of the external material feature is to distinguish between
17864  the original file that serves as a base for final material and the produced
17865  file that is included in your exported or printed document.
17866  For example, consider the case of a figure produced with 
17867 \begin_inset Flex CharStyle:Code
17868 status collapsed
17869
17870 \begin_layout Plain Layout
17871 Xfig
17872 \end_layout
17873
17874 \end_inset
17875
17876 .
17877  The Xfig application itself works on an original file with the 
17878 \begin_inset Flex CharStyle:Code
17879 status collapsed
17880
17881 \begin_layout Plain Layout
17882 .fig
17883 \end_layout
17884
17885 \end_inset
17886
17887  extension.
17888  Within Xfig, you create and change your figure, and when you are done,
17889  you save the 
17890 \begin_inset Flex CharStyle:Code
17891 status collapsed
17892
17893 \begin_layout Plain Layout
17894 fig
17895 \end_layout
17896
17897 \end_inset
17898
17899 -file.
17900  When you want to include the figure in your document, you invoke 
17901 \begin_inset Flex CharStyle:Code
17902 status collapsed
17903
17904 \begin_layout Plain Layout
17905 transfig
17906 \end_layout
17907
17908 \end_inset
17909
17910  in order to create a PostScript file that can readily be included in your
17911  LaTeX file.
17912  In this case, the 
17913 \begin_inset Flex CharStyle:Code
17914 status collapsed
17915
17916 \begin_layout Plain Layout
17917 .fig
17918 \end_layout
17919
17920 \end_inset
17921
17922  file is the original file, and the PostScript file is the produced file.
17923 \end_layout
17924
17925 \begin_layout Standard
17926 This distinction is important in order to allow updating of the material
17927  while you are in the process of writing the document.
17928  Furthermore, it provides us with the flexibility that is needed to support
17929  multiple export formats.
17930  For instance, in the case of a plain text file, it is not exactly an award-winn
17931 ing idea to include the figure as raw PostScript.
17932  Instead, you'd either prefer to just include a reference to the figure
17933  or try to invoke some graphics to ASCII converter to make the final result
17934  look similar to the real graphics.
17935  The external material management allows you to do this, because it is parametri
17936 zed on the different export formats that LyX supports.
17937 \end_layout
17938
17939 \begin_layout Standard
17940 Besides supporting the production of different products according to the
17941  exported format, it supports tight integration with editing and viewing
17942  applications.
17943  In the case of an Xfig figure, you are able to invoke Xfig on the original
17944  file with a single click from within the external material dialog in LyX,
17945  and also preview the produced PostScript file with Ghostview with another
17946  click.
17947  No more fiddling around with the command line and/or file browsers to locate
17948  and manipulate the original or produced files.
17949  In this way, you are finally able to take full advantage of the many different
17950  applications that are relevant to use when you write your documents, and
17951  ultimately be more productive.
17952 \end_layout
17953
17954 \begin_layout Section
17955 The external template configuration file
17956 \end_layout
17957
17958 \begin_layout Standard
17959 It is relatively easy to add custom external template definitions to LyX.
17960  However, be aware that doing this in an careless manner most probably 
17961 \emph on
17962 will
17963 \emph default
17964  introduce an easily exploitable security hole.
17965  So before you do this, please read the discussion about security in section
17966  
17967 \begin_inset CommandInset ref
17968 LatexCommand ref
17969 reference "sec:Security-discussion"
17970
17971 \end_inset
17972
17973 .
17974 \end_layout
17975
17976 \begin_layout Standard
17977 Having said that, we encourage you to submit any interesting templates that
17978  you create.
17979  
17980 \end_layout
17981
17982 \begin_layout Standard
17983 The external templates are defined in the 
17984 \begin_inset Flex CharStyle:Code
17985 status collapsed
17986
17987 \begin_layout Plain Layout
17988 LyXDir/lib/external_templates
17989 \end_layout
17990
17991 \end_inset
17992
17993  file.
17994  You can place your own version in 
17995 \begin_inset Flex CharStyle:Code
17996 status collapsed
17997
17998 \begin_layout Plain Layout
17999 UserDir/external_templates
18000 \end_layout
18001
18002 \end_inset
18003
18004 .
18005 \end_layout
18006
18007 \begin_layout Standard
18008 A typical template looks like this:
18009 \end_layout
18010
18011 \begin_layout LyX-Code
18012 Template XFig
18013 \end_layout
18014
18015 \begin_layout LyX-Code
18016 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18017 \end_layout
18018
18019 \begin_layout LyX-Code
18020 HelpText
18021 \end_layout
18022
18023 \begin_layout LyX-Code
18024 An XFig figure.
18025 \end_layout
18026
18027 \begin_layout LyX-Code
18028 HelpTextEnd
18029 \end_layout
18030
18031 \begin_layout LyX-Code
18032 InputFormat fig
18033 \end_layout
18034
18035 \begin_layout LyX-Code
18036 FileFilter "*.fig"
18037 \end_layout
18038
18039 \begin_layout LyX-Code
18040 AutomaticProduction true
18041 \end_layout
18042
18043 \begin_layout LyX-Code
18044 Transform Rotate
18045 \end_layout
18046
18047 \begin_layout LyX-Code
18048 Transform Resize
18049 \end_layout
18050
18051 \begin_layout LyX-Code
18052 Format LaTeX
18053 \end_layout
18054
18055 \begin_layout LyX-Code
18056 TransformCommand Rotate RotationLatexCommand
18057 \end_layout
18058
18059 \begin_layout LyX-Code
18060 TransformCommand Resize ResizeLatexCommand
18061 \end_layout
18062
18063 \begin_layout LyX-Code
18064 Product "$$RotateFront$$ResizeFront
18065 \end_layout
18066
18067 \begin_layout LyX-Code
18068          
18069 \backslash
18070
18071 \backslash
18072 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18073 \end_layout
18074
18075 \begin_layout LyX-Code
18076          $$ResizeBack$$RotateBack"
18077 \end_layout
18078
18079 \begin_layout LyX-Code
18080 UpdateFormat pstex
18081 \end_layout
18082
18083 \begin_layout LyX-Code
18084 UpdateResult "$$AbsPath$$Basename.pstex_t"
18085 \end_layout
18086
18087 \begin_layout LyX-Code
18088 Requirement "graphicx"
18089 \end_layout
18090
18091 \begin_layout LyX-Code
18092 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18093 \end_layout
18094
18095 \begin_layout LyX-Code
18096 ReferencedFile latex "$$AbsPath$$Basename.eps"
18097 \end_layout
18098
18099 \begin_layout LyX-Code
18100 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18101 \end_layout
18102
18103 \begin_layout LyX-Code
18104 FormatEnd
18105 \end_layout
18106
18107 \begin_layout LyX-Code
18108 Format PDFLaTeX
18109 \end_layout
18110
18111 \begin_layout LyX-Code
18112 TransformCommand Rotate RotationLatexCommand
18113 \end_layout
18114
18115 \begin_layout LyX-Code
18116 TransformCommand Resize ResizeLatexCommand
18117 \end_layout
18118
18119 \begin_layout LyX-Code
18120 Product "$$RotateFront$$ResizeFront
18121 \end_layout
18122
18123 \begin_layout LyX-Code
18124          
18125 \backslash
18126
18127 \backslash
18128 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18129 \end_layout
18130
18131 \begin_layout LyX-Code
18132          $$ResizeBack$$RotateBack"
18133 \end_layout
18134
18135 \begin_layout LyX-Code
18136 UpdateFormat pdftex
18137 \end_layout
18138
18139 \begin_layout LyX-Code
18140 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18141 \end_layout
18142
18143 \begin_layout LyX-Code
18144 Requirement "graphicx"
18145 \end_layout
18146
18147 \begin_layout LyX-Code
18148 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18149 \end_layout
18150
18151 \begin_layout LyX-Code
18152 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18153 \end_layout
18154
18155 \begin_layout LyX-Code
18156 FormatEnd
18157 \end_layout
18158
18159 \begin_layout LyX-Code
18160 Format Ascii
18161 \end_layout
18162
18163 \begin_layout LyX-Code
18164 Product "$$Contents(
18165 \backslash
18166 "$$AbsPath$$Basename.asc
18167 \backslash
18168 ")"
18169 \end_layout
18170
18171 \begin_layout LyX-Code
18172 UpdateFormat asciixfig
18173 \end_layout
18174
18175 \begin_layout LyX-Code
18176 UpdateResult "$$AbsPath$$Basename.asc"
18177 \end_layout
18178
18179 \begin_layout LyX-Code
18180 FormatEnd
18181 \end_layout
18182
18183 \begin_layout LyX-Code
18184 Format DocBook
18185 \end_layout
18186
18187 \begin_layout LyX-Code
18188 Product "<graphic fileref=
18189 \backslash
18190 "$$AbsOrRelPathMaster$$Basename.eps
18191 \backslash
18192 ">
18193 \end_layout
18194
18195 \begin_layout LyX-Code
18196          </graphic>"
18197 \end_layout
18198
18199 \begin_layout LyX-Code
18200 UpdateFormat eps
18201 \end_layout
18202
18203 \begin_layout LyX-Code
18204 UpdateResult "$$AbsPath$$Basename.eps"
18205 \end_layout
18206
18207 \begin_layout LyX-Code
18208 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18209 \end_layout
18210
18211 \begin_layout LyX-Code
18212 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18213 \end_layout
18214
18215 \begin_layout LyX-Code
18216 FormatEnd
18217 \end_layout
18218
18219 \begin_layout LyX-Code
18220 Product "[XFig: $$FName]"
18221 \end_layout
18222
18223 \begin_layout LyX-Code
18224 FormatEnd
18225 \end_layout
18226
18227 \begin_layout LyX-Code
18228 TemplateEnd
18229 \end_layout
18230
18231 \begin_layout Standard
18232 As you can see, the template is enclosed in 
18233 \begin_inset Flex CharStyle:Code
18234 status collapsed
18235
18236 \begin_layout Plain Layout
18237 Template
18238 \end_layout
18239
18240 \end_inset
18241
18242  \SpecialChar \ldots{}
18243  
18244 \begin_inset Flex CharStyle:Code
18245 status collapsed
18246
18247 \begin_layout Plain Layout
18248 TemplateEnd
18249 \end_layout
18250
18251 \end_inset
18252
18253 .
18254  It contains a header specifying some general settings and, for each supported
18255  primary document file format, a section 
18256 \begin_inset Flex CharStyle:Code
18257 status collapsed
18258
18259 \begin_layout Plain Layout
18260 Format
18261 \end_layout
18262
18263 \end_inset
18264
18265  \SpecialChar \ldots{}
18266  
18267 \begin_inset Flex CharStyle:Code
18268 status collapsed
18269
18270 \begin_layout Plain Layout
18271 FormatEnd
18272 \end_layout
18273
18274 \end_inset
18275
18276 .
18277 \end_layout
18278
18279 \begin_layout Subsection
18280 The template header
18281 \end_layout
18282
18283 \begin_layout Description
18284 \begin_inset Flex CharStyle:Code
18285 status collapsed
18286
18287 \begin_layout Plain Layout
18288 AutomaticProduction
18289 \begin_inset space ~
18290 \end_inset
18291
18292 true|false
18293 \end_layout
18294
18295 \end_inset
18296
18297  Whether the file represented by the template must be generated by LyX.
18298  This command must occur exactly once.
18299 \end_layout
18300
18301 \begin_layout Description
18302 \begin_inset Flex CharStyle:Code
18303 status collapsed
18304
18305 \begin_layout Plain Layout
18306 FileFilter
18307 \begin_inset space ~
18308 \end_inset
18309
18310 <pattern>
18311 \end_layout
18312
18313 \end_inset
18314
18315  A glob pattern that is used in the file dialog to filter out the desired
18316  files.
18317  If there is more than one possible file extension (e.
18318 \begin_inset space \thinspace{}
18319 \end_inset
18320
18321 g.
18322 \begin_inset space \space{}
18323 \end_inset
18324
18325 tgif has 
18326 \begin_inset Flex CharStyle:Code
18327 status collapsed
18328
18329 \begin_layout Plain Layout
18330 .obj
18331 \end_layout
18332
18333 \end_inset
18334
18335  and 
18336 \begin_inset Flex CharStyle:Code
18337 status collapsed
18338
18339 \begin_layout Plain Layout
18340 .tgo
18341 \end_layout
18342
18343 \end_inset
18344
18345 ), use something like 
18346 \begin_inset Flex CharStyle:Code
18347 status collapsed
18348
18349 \begin_layout Plain Layout
18350 "*.{obj,tgo}"
18351 \end_layout
18352
18353 \end_inset
18354
18355 .
18356  This command must occur exactly once.
18357 \end_layout
18358
18359 \begin_layout Description
18360 \begin_inset Flex CharStyle:Code
18361 status collapsed
18362
18363 \begin_layout Plain Layout
18364 GuiName
18365 \begin_inset space ~
18366 \end_inset
18367
18368 <guiname>
18369 \end_layout
18370
18371 \end_inset
18372
18373  The text that is displayed on the button.
18374  This command must occur exactly once.
18375 \end_layout
18376
18377 \begin_layout Description
18378 \begin_inset Flex CharStyle:Code
18379 status collapsed
18380
18381 \begin_layout Plain Layout
18382 HelpText
18383 \begin_inset space ~
18384 \end_inset
18385
18386 <text>
18387 \begin_inset space ~
18388 \end_inset
18389
18390 HelpTextEnd
18391 \end_layout
18392
18393 \end_inset
18394
18395  The help text that is used in the External dialog.
18396  Provide enough information to explain to the user just what the template
18397  can provide him with.
18398  This command must occur exactly once.
18399 \end_layout
18400
18401 \begin_layout Description
18402 \begin_inset Flex CharStyle:Code
18403 status collapsed
18404
18405 \begin_layout Plain Layout
18406 InputFormat
18407 \begin_inset space ~
18408 \end_inset
18409
18410 <format>
18411 \end_layout
18412
18413 \end_inset
18414
18415  The file format of the original file.
18416  This must be the name of a format that is known to LyX (see section 
18417 \begin_inset CommandInset ref
18418 LatexCommand ref
18419 reference "sec:Formats"
18420
18421 \end_inset
18422
18423 ).
18424  Use 
18425 \begin_inset Quotes eld
18426 \end_inset
18427
18428
18429 \begin_inset Flex CharStyle:Code
18430 status collapsed
18431
18432 \begin_layout Plain Layout
18433 *
18434 \end_layout
18435
18436 \end_inset
18437
18438
18439 \begin_inset Quotes erd
18440 \end_inset
18441
18442  if the template can handle original files of more than one format.
18443  LyX will attempt to interrogate the file itself in order to deduce its
18444  format in this case.
18445  This command must occur exactly once.
18446 \end_layout
18447
18448 \begin_layout Description
18449 \begin_inset Flex CharStyle:Code
18450 status collapsed
18451
18452 \begin_layout Plain Layout
18453 Template
18454 \begin_inset space ~
18455 \end_inset
18456
18457 <id>
18458 \end_layout
18459
18460 \end_inset
18461
18462  A unique name for the template.
18463  It must not contain substitution macros (see below).
18464 \end_layout
18465
18466 \begin_layout Description
18467 \begin_inset Flex CharStyle:Code
18468 status collapsed
18469
18470 \begin_layout Plain Layout
18471 Transform
18472 \begin_inset space ~
18473 \end_inset
18474
18475 Rotate|Resize|Clip|Extra
18476 \end_layout
18477
18478 \end_inset
18479
18480  This command specifies which transformations are supported by this template.
18481  It may occur zero or more times.
18482  This command enables the corresponding tabs in the external dialog.
18483  Each 
18484 \begin_inset Flex CharStyle:Code
18485 status collapsed
18486
18487 \begin_layout Plain Layout
18488 Transform
18489 \end_layout
18490
18491 \end_inset
18492
18493  command must have either a corresponding 
18494 \begin_inset Flex CharStyle:Code
18495 status collapsed
18496
18497 \begin_layout Plain Layout
18498 TransformCommand
18499 \end_layout
18500
18501 \end_inset
18502
18503  or a 
18504 \begin_inset Flex CharStyle:Code
18505 status collapsed
18506
18507 \begin_layout Plain Layout
18508 TransformOption
18509 \end_layout
18510
18511 \end_inset
18512
18513  command in the 
18514 \begin_inset Flex CharStyle:Code
18515 status collapsed
18516
18517 \begin_layout Plain Layout
18518 Format
18519 \end_layout
18520
18521 \end_inset
18522
18523  section.
18524  Otherwise the transformation will not be supported by that format.
18525 \end_layout
18526
18527 \begin_layout Subsection
18528 The Format section
18529 \end_layout
18530
18531 \begin_layout Description
18532 \begin_inset Flex CharStyle:Code
18533 status collapsed
18534
18535 \begin_layout Plain Layout
18536 Format
18537 \begin_inset space ~
18538 \end_inset
18539
18540 LaTeX|PDFLaTeX|PlainText|DocBook
18541 \end_layout
18542
18543 \end_inset
18544
18545  The primary document file format that this format definition is for.
18546  Not every template has a sensible representation in all document file formats.
18547  Please define nevertheless a 
18548 \begin_inset Flex CharStyle:Code
18549 status collapsed
18550
18551 \begin_layout Plain Layout
18552 Format
18553 \end_layout
18554
18555 \end_inset
18556
18557  section for all formats.
18558  Use a dummy text when no representation is available.
18559  Then you can at least see a reference to the external material in the exported
18560  document.
18561 \end_layout
18562
18563 \begin_layout Description
18564 \begin_inset Flex CharStyle:Code
18565 status collapsed
18566
18567 \begin_layout Plain Layout
18568 Option
18569 \begin_inset space ~
18570 \end_inset
18571
18572 <name>
18573 \begin_inset space ~
18574 \end_inset
18575
18576 <value>
18577 \end_layout
18578
18579 \end_inset
18580
18581  This command defines an additional macro 
18582 \begin_inset Flex CharStyle:Code
18583 status collapsed
18584
18585 \begin_layout Plain Layout
18586 $$<name>
18587 \end_layout
18588
18589 \end_inset
18590
18591  for substitution in 
18592 \begin_inset Flex CharStyle:Code
18593 status collapsed
18594
18595 \begin_layout Plain Layout
18596 Product
18597 \end_layout
18598
18599 \end_inset
18600
18601 .
18602  
18603 \begin_inset Flex CharStyle:Code
18604 status collapsed
18605
18606 \begin_layout Plain Layout
18607 <value>
18608 \end_layout
18609
18610 \end_inset
18611
18612  itself may contain substitution macros.
18613  The advantage over using 
18614 \begin_inset Flex CharStyle:Code
18615 status collapsed
18616
18617 \begin_layout Plain Layout
18618 <value>
18619 \end_layout
18620
18621 \end_inset
18622
18623  directly in 
18624 \begin_inset Flex CharStyle:Code
18625 status collapsed
18626
18627 \begin_layout Plain Layout
18628 Product
18629 \end_layout
18630
18631 \end_inset
18632
18633  is that the substituted value of 
18634 \begin_inset Flex CharStyle:Code
18635 status collapsed
18636
18637 \begin_layout Plain Layout
18638 $$<name>
18639 \end_layout
18640
18641 \end_inset
18642
18643  is sanitized so that it is a valid optional argument in the document format.
18644  This command may occur zero or more times.
18645 \end_layout
18646
18647 \begin_layout Description
18648 \begin_inset Flex CharStyle:Code
18649 status collapsed
18650
18651 \begin_layout Plain Layout
18652 Product
18653 \begin_inset space ~
18654 \end_inset
18655
18656 <text>
18657 \end_layout
18658
18659 \end_inset
18660
18661  The text that is inserted in the exported document.
18662  This is actually the most important command and can be quite complex.
18663  This command must occur exactly once.
18664 \end_layout
18665
18666 \begin_layout Description
18667 \begin_inset Flex CharStyle:Code
18668 status collapsed
18669
18670 \begin_layout Plain Layout
18671 Preamble
18672 \begin_inset space ~
18673 \end_inset
18674
18675 <name>
18676 \end_layout
18677
18678 \end_inset
18679
18680  This command specifies a preamble snippet that will be included in the
18681  LaTeX preamble.
18682  It has to be defined using 
18683 \begin_inset Flex CharStyle:Code
18684 status collapsed
18685
18686 \begin_layout Plain Layout
18687 PreambleDef
18688 \end_layout
18689
18690 \end_inset
18691
18692  \SpecialChar \ldots{}
18693  
18694 \begin_inset Flex CharStyle:Code
18695 status collapsed
18696
18697 \begin_layout Plain Layout
18698 PreambleDefEnd
18699 \end_layout
18700
18701 \end_inset
18702
18703 .
18704  This command may occur zero or more times.
18705 \end_layout
18706
18707 \begin_layout Description
18708 \begin_inset Flex CharStyle:Code
18709 status collapsed
18710
18711 \begin_layout Plain Layout
18712 ReferencedFile
18713 \begin_inset space ~
18714 \end_inset
18715
18716 <format>
18717 \begin_inset space ~
18718 \end_inset
18719
18720 <filename>
18721 \end_layout
18722
18723 \end_inset
18724
18725  This command denotes files that are created by the conversion process and
18726  are needed for a particular export format.
18727  If the filename is relative, it is interpreted relative to the master document.
18728  This command may be given zero or more times.
18729 \end_layout
18730
18731 \begin_layout Description
18732 \begin_inset Flex CharStyle:Code
18733 status collapsed
18734
18735 \begin_layout Plain Layout
18736 Requirement
18737 \begin_inset space ~
18738 \end_inset
18739
18740 <package>
18741 \end_layout
18742
18743 \end_inset
18744
18745  The name of a required LaTeX package.
18746  The package is included via 
18747 \begin_inset Flex CharStyle:Code
18748 status collapsed
18749
18750 \begin_layout Plain Layout
18751
18752 \backslash
18753 usepackage{}
18754 \end_layout
18755
18756 \end_inset
18757
18758  in the LaTeX preamble.
18759  This command may occur zero or more times.
18760 \end_layout
18761
18762 \begin_layout Description
18763 \begin_inset Flex CharStyle:Code
18764 status collapsed
18765
18766 \begin_layout Plain Layout
18767 TransformCommand
18768 \begin_inset space ~
18769 \end_inset
18770
18771 Rotate
18772 \begin_inset space ~
18773 \end_inset
18774
18775 RotationLatexCommand
18776 \end_layout
18777
18778 \end_inset
18779
18780  This command specifies that the built in LaTeX command should be used for
18781  rotation.
18782  This command may occur once or not at all.
18783 \end_layout
18784
18785 \begin_layout Description
18786 \begin_inset Flex CharStyle:Code
18787 status collapsed
18788
18789 \begin_layout Plain Layout
18790 TransformCommand
18791 \begin_inset space ~
18792 \end_inset
18793
18794 Resize
18795 \begin_inset space ~
18796 \end_inset
18797
18798 ResizeLatexCommand
18799 \end_layout
18800
18801 \end_inset
18802
18803  This command specifies that the built in LaTeX command should be used for
18804  resizing.
18805  This command may occur once or not at all.
18806 \end_layout
18807
18808 \begin_layout Description
18809 \begin_inset Flex CharStyle:Code
18810 status collapsed
18811
18812 \begin_layout Plain Layout
18813 TransformOption
18814 \begin_inset space ~
18815 \end_inset
18816
18817 Rotate
18818 \begin_inset space ~
18819 \end_inset
18820
18821 RotationLatexOption
18822 \end_layout
18823
18824 \end_inset
18825
18826  This command specifies that rotation is done via an optional argument.
18827  This command may occur once or not at all.
18828 \end_layout
18829
18830 \begin_layout Description
18831 \begin_inset Flex CharStyle:Code
18832 status collapsed
18833
18834 \begin_layout Plain Layout
18835 TransformOption
18836 \begin_inset space ~
18837 \end_inset
18838
18839 Resize
18840 \begin_inset space ~
18841 \end_inset
18842
18843 ResizeLatexOption
18844 \end_layout
18845
18846 \end_inset
18847
18848  This command specifies that resizing is done via an optional argument.
18849  This command may occur once or not at all.
18850 \end_layout
18851
18852 \begin_layout Description
18853 \begin_inset Flex CharStyle:Code
18854 status collapsed
18855
18856 \begin_layout Plain Layout
18857 TransformOption
18858 \begin_inset space ~
18859 \end_inset
18860
18861 Clip
18862 \begin_inset space ~
18863 \end_inset
18864
18865 ClipLatexOption
18866 \end_layout
18867
18868 \end_inset
18869
18870  This command specifies that clipping is done via an optional argument.
18871  This command may occur once or not at all.
18872 \end_layout
18873
18874 \begin_layout Description
18875 \begin_inset Flex CharStyle:Code
18876 status collapsed
18877
18878 \begin_layout Plain Layout
18879 TransformOption
18880 \begin_inset space ~
18881 \end_inset
18882
18883 Extra
18884 \begin_inset space ~
18885 \end_inset
18886
18887 ExtraLatexOption
18888 \end_layout
18889
18890 \end_inset
18891
18892  This command specifies that an extra optional argument is used.
18893  This command may occur once or not at all.
18894 \end_layout
18895
18896 \begin_layout Description
18897 \begin_inset Flex CharStyle:Code
18898 status collapsed
18899
18900 \begin_layout Plain Layout
18901 UpdateFormat
18902 \begin_inset space ~
18903 \end_inset
18904
18905 <format>
18906 \end_layout
18907
18908 \end_inset
18909
18910  The file format of the converted file.
18911  This must be the name of a format that is known to LyX (see the 
18912 \begin_inset Flex CharStyle:MenuItem
18913 status collapsed
18914
18915 \begin_layout Plain Layout
18916
18917 \bar under
18918 T
18919 \bar default
18920 ools\SpecialChar \menuseparator
18921
18922 \bar under
18923 P
18924 \bar default
18925 references:Conversion
18926 \end_layout
18927
18928 \end_inset
18929
18930  dialog).
18931  This command must occur exactly once.
18932 \end_layout
18933
18934 \begin_layout Description
18935 \begin_inset Flex CharStyle:Code
18936 status collapsed
18937
18938 \begin_layout Plain Layout
18939 UpdateResult
18940 \begin_inset space ~
18941 \end_inset
18942
18943 <filename>
18944 \end_layout
18945
18946 \end_inset
18947
18948  The file name of the converted file.
18949  The file name must be absolute.
18950  This command must occur exactly once.
18951 \end_layout
18952
18953 \begin_layout Subsection
18954 Preamble definitions
18955 \end_layout
18956
18957 \begin_layout Standard
18958 The external template configuration file may contain additional preamble
18959  definitions enclosed by 
18960 \begin_inset Flex CharStyle:Code
18961 status collapsed
18962
18963 \begin_layout Plain Layout
18964 PreambleDef
18965 \end_layout
18966
18967 \end_inset
18968
18969  \SpecialChar \ldots{}
18970  
18971 \begin_inset Flex CharStyle:Code
18972 status collapsed
18973
18974 \begin_layout Plain Layout
18975 PreambleDefEnd
18976 \end_layout
18977
18978 \end_inset
18979
18980 .
18981  They can be used by the templates in the 
18982 \begin_inset Flex CharStyle:Code
18983 status collapsed
18984
18985 \begin_layout Plain Layout
18986 Format
18987 \end_layout
18988
18989 \end_inset
18990
18991  section.
18992 \end_layout
18993
18994 \begin_layout Section
18995 The substitution mechanism
18996 \end_layout
18997
18998 \begin_layout Standard
18999 When the external material facility invokes an external program, it is done
19000  on the basis of a command defined in the template configuration file.
19001  These commands can contain various macros that are expanded before execution.
19002  Execution always take place in the directory of the containing document.
19003 \end_layout
19004
19005 \begin_layout Standard
19006 Also, whenever external material is to be displayed, the name will be produced
19007  by the substitution mechanism, and most other commands in the template
19008  definition support substitution as well.
19009 \end_layout
19010
19011 \begin_layout Standard
19012 The available macros are the following:
19013 \end_layout
19014
19015 \begin_layout Description
19016 \begin_inset Flex CharStyle:Code
19017 status collapsed
19018
19019 \begin_layout Plain Layout
19020 $$AbsOrRelPathMaster
19021 \end_layout
19022
19023 \end_inset
19024
19025  The file path, absolute or relative to the master LyX document.
19026 \end_layout
19027
19028 \begin_layout Description
19029 \begin_inset Flex CharStyle:Code
19030 status collapsed
19031
19032 \begin_layout Plain Layout
19033 $$AbsOrRelPathParent
19034 \end_layout
19035
19036 \end_inset
19037
19038  The file path, absolute or relative to the LyX document.
19039 \end_layout
19040
19041 \begin_layout Description
19042 \begin_inset Flex CharStyle:Code
19043 status collapsed
19044
19045 \begin_layout Plain Layout
19046 $$AbsPath
19047 \end_layout
19048
19049 \end_inset
19050
19051  The absolute file path.
19052 \end_layout
19053
19054 \begin_layout Description
19055 \begin_inset Flex CharStyle:Code
19056 status collapsed
19057
19058 \begin_layout Plain Layout
19059 $$Basename
19060 \end_layout
19061
19062 \end_inset
19063
19064  The filename without path and without the extension.
19065 \end_layout
19066
19067 \begin_layout Description
19068 \begin_inset Flex CharStyle:Code
19069 status collapsed
19070
19071 \begin_layout Plain Layout
19072 $$Contents(
19073 \begin_inset Quotes eld
19074 \end_inset
19075
19076 filename.ext
19077 \begin_inset Quotes erd
19078 \end_inset
19079
19080 )
19081 \end_layout
19082
19083 \end_inset
19084
19085  This macro will expand to the contents of the file with the name 
19086 \begin_inset Flex CharStyle:Code
19087 status collapsed
19088
19089 \begin_layout Plain Layout
19090 filename.ext
19091 \end_layout
19092
19093 \end_inset
19094
19095 .
19096 \end_layout
19097
19098 \begin_layout Description
19099 \begin_inset Flex CharStyle:Code
19100 status collapsed
19101
19102 \begin_layout Plain Layout
19103 $$Extension
19104 \end_layout
19105
19106 \end_inset
19107
19108  The file extension (including the dot).
19109 \end_layout
19110
19111 \begin_layout Description
19112 \begin_inset Flex CharStyle:Code
19113 status collapsed
19114
19115 \begin_layout Plain Layout
19116 $$FName
19117 \end_layout
19118
19119 \end_inset
19120
19121  The filename of the file specified in the external material dialog.
19122  This is either an absolute name, or it is relative to the LyX document.
19123 \end_layout
19124
19125 \begin_layout Description
19126 \begin_inset Flex CharStyle:Code
19127 status collapsed
19128
19129 \begin_layout Plain Layout
19130 $$FPath
19131 \end_layout
19132
19133 \end_inset
19134
19135  The path part of 
19136 \begin_inset Flex CharStyle:Code
19137 status collapsed
19138
19139 \begin_layout Plain Layout
19140 $$FName
19141 \end_layout
19142
19143 \end_inset
19144
19145  (absolute name or relative to the LyX document).
19146 \end_layout
19147
19148 \begin_layout Description
19149 \begin_inset Flex CharStyle:Code
19150 status collapsed
19151
19152 \begin_layout Plain Layout
19153 $$RelPathMaster
19154 \end_layout
19155
19156 \end_inset
19157
19158  The file path, relative to the master LyX document.
19159 \end_layout
19160
19161 \begin_layout Description
19162 \begin_inset Flex CharStyle:Code
19163 status collapsed
19164
19165 \begin_layout Plain Layout
19166 $$RelPathParent
19167 \end_layout
19168
19169 \end_inset
19170
19171  The file path, relative to the LyX document.
19172 \end_layout
19173
19174 \begin_layout Description
19175 \begin_inset Flex CharStyle:Code
19176 status collapsed
19177
19178 \begin_layout Plain Layout
19179 $$Sysdir
19180 \end_layout
19181
19182 \end_inset
19183
19184  This macro will expand to the absolute path of the system directory.
19185  This is typically used to point to the various helper scripts that are
19186  bundled with LyX.
19187 \end_layout
19188
19189 \begin_layout Description
19190 \begin_inset Flex CharStyle:Code
19191 status collapsed
19192
19193 \begin_layout Plain Layout
19194 $$Tempname
19195 \end_layout
19196
19197 \end_inset
19198
19199  A name and full path to a temporary file which will be automatically deleted
19200  whenever the containing document is closed, or the external material insertion
19201  deleted.
19202 \end_layout
19203
19204 \begin_layout Standard
19205 All path macros contain a trailing directory separator, so you can construct
19206  e.
19207 \begin_inset space \thinspace{}
19208 \end_inset
19209
19210 g.
19211 \begin_inset space \space{}
19212 \end_inset
19213
19214 the absolute filename with 
19215 \begin_inset Flex CharStyle:Code
19216 status collapsed
19217
19218 \begin_layout Plain Layout
19219 $$AbsPath$$Basename$$Extension
19220 \end_layout
19221
19222 \end_inset
19223
19224 .
19225 \end_layout
19226
19227 \begin_layout Standard
19228 The macros above are substituted in all commands unless otherwise noted.
19229  The command 
19230 \begin_inset Flex CharStyle:Code
19231 status collapsed
19232
19233 \begin_layout Plain Layout
19234 Product
19235 \end_layout
19236
19237 \end_inset
19238
19239  supports additionally the following substitutions if they are enabled by
19240  the 
19241 \begin_inset Flex CharStyle:Code
19242 status collapsed
19243
19244 \begin_layout Plain Layout
19245 Transform
19246 \end_layout
19247
19248 \end_inset
19249
19250  and 
19251 \begin_inset Flex CharStyle:Code
19252 status collapsed
19253
19254 \begin_layout Plain Layout
19255 TransformCommand
19256 \end_layout
19257
19258 \end_inset
19259
19260  commands:
19261 \end_layout
19262
19263 \begin_layout Description
19264 \begin_inset Flex CharStyle:Code
19265 status collapsed
19266
19267 \begin_layout Plain Layout
19268 $$ResizeFront
19269 \end_layout
19270
19271 \end_inset
19272
19273  The front part of the resize command.
19274 \end_layout
19275
19276 \begin_layout Description
19277 \begin_inset Flex CharStyle:Code
19278 status collapsed
19279
19280 \begin_layout Plain Layout
19281 $$ResizeBack
19282 \end_layout
19283
19284 \end_inset
19285
19286  The back part of the resize command.
19287 \end_layout
19288
19289 \begin_layout Description
19290 \begin_inset Flex CharStyle:Code
19291 status collapsed
19292
19293 \begin_layout Plain Layout
19294 $$RotateFront
19295 \end_layout
19296
19297 \end_inset
19298
19299  The front part of the rotation command.
19300 \end_layout
19301
19302 \begin_layout Description
19303 \begin_inset Flex CharStyle:Code
19304 status collapsed
19305
19306 \begin_layout Plain Layout
19307 $$RotateBack
19308 \end_layout
19309
19310 \end_inset
19311
19312  The back part of the rotation command.
19313 \end_layout
19314
19315 \begin_layout Standard
19316 The value string of the 
19317 \begin_inset Flex CharStyle:Code
19318 status collapsed
19319
19320 \begin_layout Plain Layout
19321 Option
19322 \end_layout
19323
19324 \end_inset
19325
19326  command supports additionally the following substitutions if they are enabled
19327  by the 
19328 \begin_inset Flex CharStyle:Code
19329 status collapsed
19330
19331 \begin_layout Plain Layout
19332 Transform
19333 \end_layout
19334
19335 \end_inset
19336
19337  and 
19338 \begin_inset Flex CharStyle:Code
19339 status collapsed
19340
19341 \begin_layout Plain Layout
19342 TransformOption
19343 \end_layout
19344
19345 \end_inset
19346
19347  commands:
19348 \end_layout
19349
19350 \begin_layout Description
19351 \begin_inset Flex CharStyle:Code
19352 status collapsed
19353
19354 \begin_layout Plain Layout
19355 $$Clip
19356 \end_layout
19357
19358 \end_inset
19359
19360  The clip option.
19361 \end_layout
19362
19363 \begin_layout Description
19364 \begin_inset Flex CharStyle:Code
19365 status collapsed
19366
19367 \begin_layout Plain Layout
19368 $$Extra
19369 \end_layout
19370
19371 \end_inset
19372
19373  The extra option.
19374 \end_layout
19375
19376 \begin_layout Description
19377 \begin_inset Flex CharStyle:Code
19378 status collapsed
19379
19380 \begin_layout Plain Layout
19381 $$Resize
19382 \end_layout
19383
19384 \end_inset
19385
19386  The resize option.
19387 \end_layout
19388
19389 \begin_layout Description
19390 \begin_inset Flex CharStyle:Code
19391 status collapsed
19392
19393 \begin_layout Plain Layout
19394 $$Rotate
19395 \end_layout
19396
19397 \end_inset
19398
19399  The rotation option.
19400 \end_layout
19401
19402 \begin_layout Standard
19403 You may ask why there are so many path macros.
19404  There are mainly two reasons:
19405 \end_layout
19406
19407 \begin_layout Enumerate
19408 Relative and absolute file names should remain relative or absolute, respectivel
19409 y.
19410  Users may have reasons to prefer either form.
19411  Relative names are useful for portable documents that should work on different
19412  machines, for example.
19413  Absolute names may be required by some programs.
19414 \end_layout
19415
19416 \begin_layout Enumerate
19417 LaTeX treats relative file names differently than LyX and other programs
19418  in nested included files.
19419  For LyX, a relative file name is always relative to the document that contains
19420  the file name.
19421  For LaTeX, it is always relative to the master document.
19422  These two definitions are identical if you have only one document, but
19423  differ if you have a master document that includes part documents.
19424  That means that relative filenames must be transformed when presented to
19425  LaTeX.
19426  Fortunately LyX does this automatically for you if you choose the right
19427  macros.
19428 \end_layout
19429
19430 \begin_layout Standard
19431 So which path macro should be used in new template definitions? The rule
19432  is not difficult:
19433 \end_layout
19434
19435 \begin_layout Itemize
19436 Use 
19437 \begin_inset Flex CharStyle:Code
19438 status collapsed
19439
19440 \begin_layout Plain Layout
19441 $$AbsPath
19442 \end_layout
19443
19444 \end_inset
19445
19446  if an absolute path is required.
19447 \end_layout
19448
19449 \begin_layout Itemize
19450 Use 
19451 \begin_inset Flex CharStyle:Code
19452 status collapsed
19453
19454 \begin_layout Plain Layout
19455 $$AbsOrRelPathMaster
19456 \end_layout
19457
19458 \end_inset
19459
19460  if the substituted string is some kind of LaTeX input.
19461 \end_layout
19462
19463 \begin_layout Itemize
19464 Else use 
19465 \begin_inset Flex CharStyle:Code
19466 status collapsed
19467
19468 \begin_layout Plain Layout
19469 $$AbsOrRelPathParent
19470 \end_layout
19471
19472 \end_inset
19473
19474  in order to preserve the user's choice.
19475 \end_layout
19476
19477 \begin_layout Standard
19478 There are special cases where this rule does not work and e.
19479 \begin_inset space \thinspace{}
19480 \end_inset
19481
19482 g.
19483 \begin_inset space \space{}
19484 \end_inset
19485
19486 relative names are needed, but normally it will work just fine.
19487  One example for such a case is the command 
19488 \begin_inset Flex CharStyle:Code
19489 status collapsed
19490
19491 \begin_layout Plain Layout
19492 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19493 \end_layout
19494
19495 \end_inset
19496
19497  in the XFig template above: We can't use the absolute name because the
19498  copier for 
19499 \begin_inset Flex CharStyle:Code
19500 status collapsed
19501
19502 \begin_layout Plain Layout
19503 .pstex_t
19504 \end_layout
19505
19506 \end_inset
19507
19508  files needs the relative name in order to rewrite the file content.
19509 \end_layout
19510
19511 \begin_layout Section
19512 Security discussion
19513 \begin_inset CommandInset label
19514 LatexCommand label
19515 name "sec:Security-discussion"
19516
19517 \end_inset
19518
19519
19520 \end_layout
19521
19522 \begin_layout Standard
19523 The external material feature interfaces with a lot of external programs
19524  and does so automatically, so we have to consider the security implications
19525  of this.
19526  In particular, since you have the option of including your own filenames
19527  and/or parameter strings and those are expanded into a command, it seems
19528  that it would be possible to create a malicious document which executes
19529  arbitrary commands when a user views or prints the document.
19530  This is something we definitely want to avoid.
19531 \end_layout
19532
19533 \begin_layout Standard
19534 However, since the external program commands are specified in the template
19535  configuration file only, there are no security issues if LyX is properly
19536  configured with safe templates only.
19537  This is so because the external programs are invoked with the 
19538 \begin_inset Flex CharStyle:Code
19539 status collapsed
19540
19541 \begin_layout Plain Layout
19542 execvp
19543 \end_layout
19544
19545 \end_inset
19546
19547 -system call rather than the 
19548 \begin_inset Flex CharStyle:Code
19549 status collapsed
19550
19551 \begin_layout Plain Layout
19552 system
19553 \end_layout
19554
19555 \end_inset
19556
19557  system-call, so it's not possible to execute arbitrary commands from the
19558  filename or parameter section via the shell.
19559 \end_layout
19560
19561 \begin_layout Standard
19562 This also implies that you are restricted in what command strings you can
19563  use in the external material templates.
19564  In particular, pipes and redirection are not readily available.
19565  This has to be so if LyX should remain safe.
19566  If you want to use some of the shell features, you should write a safe
19567  script to do this in a controlled manner, and then invoke the script from
19568  the command string.
19569  
19570 \end_layout
19571
19572 \begin_layout Standard
19573 It is possible to design a template that interacts directly with the shell,
19574  but since this would allow a malicious user to execute arbitrary commands
19575  by writing clever filenames and/or parameters, we generally recommend that
19576  you only use safe scripts that work with the 
19577 \begin_inset Flex CharStyle:Code
19578 status collapsed
19579
19580 \begin_layout Plain Layout
19581 execvp
19582 \end_layout
19583
19584 \end_inset
19585
19586  system call in a controlled manner.
19587  Of course, for use in a controlled environment, it can be tempting to just
19588  fall back to use ordinary shell scripts.
19589  If you do so, be aware that you 
19590 \emph on
19591 will
19592 \emph default
19593  provide an easily exploitable security hole in your system.
19594  Of course it stands to reason that such unsafe templates will never be
19595  included in the standard LyX distribution, although we do encourage people
19596  to submit new templates in the open source tradition.
19597  But LyX as shipped from the official distribution channels will never have
19598  unsafe templates.
19599 \end_layout
19600
19601 \begin_layout Standard
19602 Including external material provides a lot of power, and you have to be
19603  careful not to introduce security hazards with this power.
19604  A subtle error in a single line in an innocent looking script can open
19605  the door to huge security problems.
19606  So if you do not fully understand the issues, we recommend that you consult
19607  a knowledgeable security professional or the LyX development team if you
19608  have any questions about whether a given template is safe or not.
19609  And do this before you use it in an uncontrolled environment.
19610 \end_layout
19611
19612 \end_body
19613 \end_document