]> git.lyx.org Git - lyx.git/blob - lib/doc/Customization.lyx
Basque docs: major updates by Iñaki Larrañaga Murgoitio
[lyx.git] / lib / doc / Customization.lyx
1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
2 \lyxformat 390
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 OptArg
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 \end_layout
10088
10089 \begin_layout Description
10090 \begin_inset Flex CharStyle:Code
10091 status collapsed
10092
10093 \begin_layout Plain Layout
10094 InTitle
10095 \end_layout
10096
10097 \end_inset
10098
10099  
10100 \begin_inset Flex CharStyle:Code
10101 status collapsed
10102
10103 \begin_layout Plain Layout
10104 [1, 0]
10105 \end_layout
10106
10107 \end_inset
10108
10109  If 1, marks the layout as being part of a title block (see also the 
10110 \begin_inset Flex CharStyle:Code
10111 status collapsed
10112
10113 \begin_layout Plain Layout
10114 TitleLatexType
10115 \end_layout
10116
10117 \end_inset
10118
10119  and 
10120 \begin_inset Flex CharStyle:Code
10121 status collapsed
10122
10123 \begin_layout Plain Layout
10124 TitleLatexName
10125 \end_layout
10126
10127 \end_inset
10128
10129  global entries).
10130 \end_layout
10131
10132 \begin_layout Description
10133 \begin_inset Flex CharStyle:Code
10134 status collapsed
10135
10136 \begin_layout Plain Layout
10137 ItemSep
10138 \end_layout
10139
10140 \end_inset
10141
10142  [
10143 \begin_inset Flex CharStyle:Code
10144 status collapsed
10145
10146 \begin_layout Plain Layout
10147 float=0
10148 \end_layout
10149
10150 \end_inset
10151
10152 ] This provides extra space between paragraphs that have the same layout.
10153  If you put other layouts into an environment, each is separated with the
10154  environment's 
10155 \begin_inset Flex CharStyle:Code
10156 status collapsed
10157
10158 \begin_layout Plain Layout
10159 Parsep
10160 \end_layout
10161
10162 \end_inset
10163
10164 .
10165  But the whole items of the environment are additionally separated with
10166  this 
10167 \begin_inset Flex CharStyle:Code
10168 status collapsed
10169
10170 \begin_layout Plain Layout
10171 Itemsep
10172 \end_layout
10173
10174 \end_inset
10175
10176 .
10177  Note that this is a
10178 \emph on
10179  multiplier.
10180 \end_layout
10181
10182 \begin_layout Description
10183 \begin_inset Flex CharStyle:Code
10184 status collapsed
10185
10186 \begin_layout Plain Layout
10187 ItemTag
10188 \end_layout
10189
10190 \end_inset
10191
10192  [[FIXME]] (Used only with XML-type formats.)
10193 \end_layout
10194
10195 \begin_layout Description
10196 \begin_inset Flex CharStyle:Code
10197 status collapsed
10198
10199 \begin_layout Plain Layout
10200 KeepEmpty
10201 \end_layout
10202
10203 \end_inset
10204
10205  
10206 \begin_inset CommandInset label
10207 LatexCommand label
10208 name "des:KeepEmpty"
10209
10210 \end_inset
10211
10212 [
10213 \begin_inset Flex CharStyle:Code
10214 status collapsed
10215
10216 \begin_layout Plain Layout
10217
10218 \emph on
10219 0
10220 \end_layout
10221
10222 \end_inset
10223
10224
10225 \begin_inset Flex CharStyle:Code
10226 status collapsed
10227
10228 \begin_layout Plain Layout
10229 1
10230 \end_layout
10231
10232 \end_inset
10233
10234 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10235  lead to empty LaTeX output.
10236  There are some cases where this could be desirable however: in a letter
10237  template, the required fields can be provided as empty fields, so that
10238  people do not forget them; in some special classes, a layout can be used
10239  as some kind of break, which does not contain actual text.
10240 \end_layout
10241
10242 \begin_layout Description
10243 \begin_inset Flex CharStyle:Code
10244 status collapsed
10245
10246 \begin_layout Plain Layout
10247 LabelBottomsep
10248 \end_layout
10249
10250 \end_inset
10251
10252  [float=0] The vertical space between the label and the text body.
10253  Only used for labels that are above the text body (
10254 \begin_inset Flex CharStyle:Code
10255 status collapsed
10256
10257 \begin_layout Plain Layout
10258 Top_Environment
10259 \end_layout
10260
10261 \end_inset
10262
10263
10264 \begin_inset Flex CharStyle:Code
10265 status collapsed
10266
10267 \begin_layout Plain Layout
10268 Centered_Top_Environment
10269 \end_layout
10270
10271 \end_inset
10272
10273 ).
10274 \end_layout
10275
10276 \begin_layout Description
10277 \begin_inset Flex CharStyle:Code
10278 status collapsed
10279
10280 \begin_layout Plain Layout
10281 LabelCounter
10282 \end_layout
10283
10284 \end_inset
10285
10286  [
10287 \begin_inset Flex CharStyle:Code
10288 status collapsed
10289
10290 \begin_layout Plain Layout
10291 string=""
10292 \end_layout
10293
10294 \end_inset
10295
10296 ]
10297 \begin_inset Newline newline
10298 \end_inset
10299
10300 The name of the counter for automatic numbering.
10301  
10302 \begin_inset Newline newline
10303 \end_inset
10304
10305 This 
10306 \emph on
10307 must
10308 \emph default
10309  be given if 
10310 \begin_inset Flex CharStyle:Code
10311 status collapsed
10312
10313 \begin_layout Plain Layout
10314 LabelType
10315 \end_layout
10316
10317 \end_inset
10318
10319  is 
10320 \begin_inset Flex CharStyle:Code
10321 status collapsed
10322
10323 \begin_layout Plain Layout
10324 Counter
10325 \end_layout
10326
10327 \end_inset
10328
10329 .
10330  In that case, the counter will be stepped each time the layout appears.
10331  
10332 \begin_inset Newline newline
10333 \end_inset
10334
10335 This 
10336 \emph on
10337 may
10338 \emph default
10339  also be given if 
10340 \begin_inset Flex CharStyle:Code
10341 status collapsed
10342
10343 \begin_layout Plain Layout
10344 LabelType
10345 \end_layout
10346
10347 \end_inset
10348
10349  is 
10350 \begin_inset Flex CharStyle:Code
10351 status collapsed
10352
10353 \begin_layout Plain Layout
10354 Enumerate
10355 \end_layout
10356
10357 \end_inset
10358
10359 , though this case is a bit complicated.
10360  Suppose you declare 
10361 \begin_inset Quotes eld
10362 \end_inset
10363
10364
10365 \begin_inset Flex CharStyle:Code
10366 status collapsed
10367
10368 \begin_layout Plain Layout
10369 LabelCounter myenum
10370 \end_layout
10371
10372 \end_inset
10373
10374
10375 \begin_inset Quotes erd
10376 \end_inset
10377
10378 .
10379  Then the actual counters used are 
10380 \begin_inset Flex CharStyle:Code
10381 status collapsed
10382
10383 \begin_layout Plain Layout
10384 myenumi
10385 \end_layout
10386
10387 \end_inset
10388
10389
10390 \begin_inset Flex CharStyle:Code
10391 status collapsed
10392
10393 \begin_layout Plain Layout
10394 myenumii
10395 \end_layout
10396
10397 \end_inset
10398
10399
10400 \begin_inset Flex CharStyle:Code
10401 status collapsed
10402
10403 \begin_layout Plain Layout
10404 myenumiii
10405 \end_layout
10406
10407 \end_inset
10408
10409 , and 
10410 \begin_inset Flex CharStyle:Code
10411 status collapsed
10412
10413 \begin_layout Plain Layout
10414 myenumiv
10415 \end_layout
10416
10417 \end_inset
10418
10419 , much as in LaTeX.
10420  These counters must all be declared separately.
10421 \begin_inset Newline newline
10422 \end_inset
10423
10424 See Section 
10425 \begin_inset CommandInset ref
10426 LatexCommand ref
10427 reference "sub:Counters"
10428
10429 \end_inset
10430
10431  for details on counters.
10432 \end_layout
10433
10434 \begin_layout Description
10435 \begin_inset Flex CharStyle:Code
10436 status collapsed
10437
10438 \begin_layout Plain Layout
10439 LabelFont
10440 \end_layout
10441
10442 \end_inset
10443
10444  The font used for the label.
10445  See section
10446 \begin_inset space ~
10447 \end_inset
10448
10449
10450 \begin_inset CommandInset ref
10451 LatexCommand ref
10452 reference "sub:Font-description"
10453
10454 \end_inset
10455
10456 .
10457 \end_layout
10458
10459 \begin_layout Description
10460 \begin_inset Flex CharStyle:Code
10461 status collapsed
10462
10463 \begin_layout Plain Layout
10464 LabelIndent
10465 \end_layout
10466
10467 \end_inset
10468
10469  Text that indicates how far a label should be indented.
10470 \end_layout
10471
10472 \begin_layout Description
10473 \begin_inset Flex CharStyle:Code
10474 status collapsed
10475
10476 \begin_layout Plain Layout
10477 Labelsep
10478 \end_layout
10479
10480 \end_inset
10481
10482  [
10483 \begin_inset Flex CharStyle:Code
10484 status collapsed
10485
10486 \begin_layout Plain Layout
10487 string=""
10488 \end_layout
10489
10490 \end_inset
10491
10492 ] The horizontal space between the label and the text body.
10493  Only used for labels that are not above the text body.
10494 \end_layout
10495
10496 \begin_layout Description
10497 \begin_inset Flex CharStyle:Code
10498 status collapsed
10499
10500 \begin_layout Plain Layout
10501 LabelString
10502 \end_layout
10503
10504 \end_inset
10505
10506  [
10507 \begin_inset Flex CharStyle:Code
10508 status collapsed
10509
10510 \begin_layout Plain Layout
10511 string=""
10512 \end_layout
10513
10514 \end_inset
10515
10516 ] The string used for a label with a 
10517 \begin_inset Flex CharStyle:Code
10518 status collapsed
10519
10520 \begin_layout Plain Layout
10521 Static
10522 \end_layout
10523
10524 \end_inset
10525
10526  labeltype.
10527  When 
10528 \begin_inset Flex CharStyle:Code
10529 status collapsed
10530
10531 \begin_layout Plain Layout
10532 LabelCounter
10533 \end_layout
10534
10535 \end_inset
10536
10537  is set, this string can be contain the special formatting commands described
10538  in Section 
10539 \begin_inset CommandInset ref
10540 LatexCommand ref
10541 reference "sub:Counters"
10542
10543 \end_inset
10544
10545 .
10546 \begin_inset Foot
10547 status collapsed
10548
10549 \begin_layout Plain Layout
10550 For the sake of backwards compatibility, the string 
10551 \begin_inset Flex CharStyle:Code
10552 status collapsed
10553
10554 \begin_layout Plain Layout
10555 @
10556 \emph on
10557 style-name
10558 \emph default
10559 @
10560 \end_layout
10561
10562 \end_inset
10563
10564  will be replaced by the expanded 
10565 \begin_inset Flex CharStyle:Code
10566 status collapsed
10567
10568 \begin_layout Plain Layout
10569 LabelString
10570 \end_layout
10571
10572 \end_inset
10573
10574  of style 
10575 \begin_inset Flex CharStyle:Code
10576 status collapsed
10577
10578 \begin_layout Plain Layout
10579
10580 \emph on
10581 style-name
10582 \end_layout
10583
10584 \end_inset
10585
10586 .
10587  This feature is now obsolete and should be replaced by the mechanisms of
10588  Section 
10589 \begin_inset CommandInset ref
10590 LatexCommand ref
10591 reference "sub:Counters"
10592
10593 \end_inset
10594
10595 .
10596 \end_layout
10597
10598 \end_inset
10599
10600
10601 \end_layout
10602
10603 \begin_layout Description
10604 \begin_inset Flex CharStyle:Code
10605 status collapsed
10606
10607 \begin_layout Plain Layout
10608 LabelStringAppendix
10609 \end_layout
10610
10611 \end_inset
10612
10613  [
10614 \begin_inset Flex CharStyle:Code
10615 status collapsed
10616
10617 \begin_layout Plain Layout
10618 string=""
10619 \end_layout
10620
10621 \end_inset
10622
10623 ] This is used inside the appendix instead of 
10624 \begin_inset Flex CharStyle:Code
10625 status collapsed
10626
10627 \begin_layout Plain Layout
10628 LabelString
10629 \end_layout
10630
10631 \end_inset
10632
10633 .
10634  Note that every 
10635 \begin_inset Flex CharStyle:Code
10636 status collapsed
10637
10638 \begin_layout Plain Layout
10639 LabelString
10640 \end_layout
10641
10642 \end_inset
10643
10644  statement resets 
10645 \begin_inset Flex CharStyle:Code
10646 status collapsed
10647
10648 \begin_layout Plain Layout
10649 LabelStringAppendix
10650 \end_layout
10651
10652 \end_inset
10653
10654  too.
10655 \end_layout
10656
10657 \begin_layout Description
10658 \begin_inset Flex CharStyle:Code
10659 status collapsed
10660
10661 \begin_layout Plain Layout
10662 LabelTag
10663 \end_layout
10664
10665 \end_inset
10666
10667  [FIXME] (Used only with XML-type formats.)
10668 \end_layout
10669
10670 \begin_layout Description
10671 \begin_inset Flex CharStyle:Code
10672 status collapsed
10673
10674 \begin_layout Plain Layout
10675 LabelType
10676 \end_layout
10677
10678 \end_inset
10679
10680  [
10681 \begin_inset Flex CharStyle:Code
10682 status collapsed
10683
10684 \begin_layout Plain Layout
10685
10686 \emph on
10687 No_Label
10688 \emph default
10689 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10690  Enumerate, Itemize, Bibliography
10691 \end_layout
10692
10693 \end_inset
10694
10695
10696 \end_layout
10697
10698 \begin_deeper
10699 \begin_layout Itemize
10700 \begin_inset Flex CharStyle:Code
10701 status collapsed
10702
10703 \begin_layout Plain Layout
10704 Manual
10705 \end_layout
10706
10707 \end_inset
10708
10709  means the label is the very first word (up to the first real blank).
10710  Use protected spaces (like
10711 \begin_inset space ~
10712 \end_inset
10713
10714 that one) if you want more than one word as the label.
10715  
10716 \end_layout
10717
10718 \begin_layout Itemize
10719 \begin_inset Flex CharStyle:Code
10720 status collapsed
10721
10722 \begin_layout Plain Layout
10723 Static
10724 \end_layout
10725
10726 \end_inset
10727
10728  means the label is simply whatever 
10729 \begin_inset Flex CharStyle:Code
10730 status collapsed
10731
10732 \begin_layout Plain Layout
10733 LabelString
10734 \end_layout
10735
10736 \end_inset
10737
10738  declares it to be.
10739  Note that this really is `static'.
10740 \end_layout
10741
10742 \begin_layout Itemize
10743 \begin_inset Flex CharStyle:Code
10744 status collapsed
10745
10746 \begin_layout Plain Layout
10747 Top_Environment
10748 \end_layout
10749
10750 \end_inset
10751
10752  and 
10753 \begin_inset Flex CharStyle:Code
10754 status collapsed
10755
10756 \begin_layout Plain Layout
10757 Centered_Top_Environment
10758 \end_layout
10759
10760 \end_inset
10761
10762  are special cases of 
10763 \begin_inset Flex CharStyle:Code
10764 status collapsed
10765
10766 \begin_layout Plain Layout
10767 Static
10768 \end_layout
10769
10770 \end_inset
10771
10772 .
10773  The label will be printed above the paragraph, but only at the top of an
10774  environment or the top of a chain of paragraphs with this layout.
10775  This might be used with the 
10776 \begin_inset Flex CharStyle:MenuItem
10777 status collapsed
10778
10779 \begin_layout Plain Layout
10780 Abstract
10781 \end_layout
10782
10783 \end_inset
10784
10785  layout, for example.
10786 \end_layout
10787
10788 \begin_layout Itemize
10789 \begin_inset Flex CharStyle:Code
10790 status collapsed
10791
10792 \begin_layout Plain Layout
10793 Sensitive
10794 \end_layout
10795
10796 \end_inset
10797
10798  is a special case for the caption-labels 
10799 \begin_inset Quotes eld
10800 \end_inset
10801
10802 Figure
10803 \begin_inset Quotes erd
10804 \end_inset
10805
10806  and 
10807 \begin_inset Quotes eld
10808 \end_inset
10809
10810 Table
10811 \begin_inset Quotes erd
10812 \end_inset
10813
10814 .
10815  
10816 \begin_inset Flex CharStyle:Code
10817 status collapsed
10818
10819 \begin_layout Plain Layout
10820 Sensitive
10821 \end_layout
10822
10823 \end_inset
10824
10825  means the (hardcoded) label string depends on the kind of float: It is
10826  hardcoded to be `FloatType N', where N is the value of the counter associated
10827  with the float.
10828 \end_layout
10829
10830 \begin_layout Itemize
10831 The 
10832 \begin_inset Flex CharStyle:Code
10833 status collapsed
10834
10835 \begin_layout Plain Layout
10836 Counter
10837 \end_layout
10838
10839 \end_inset
10840
10841  label type defines automatically numbered labels.
10842  The 
10843 \begin_inset Flex CharStyle:Code
10844 status collapsed
10845
10846 \begin_layout Plain Layout
10847 LabelString
10848 \end_layout
10849
10850 \end_inset
10851
10852  will be expanded to resolve any counter references it contains: For example,
10853  it might be 
10854 \begin_inset Quotes eld
10855 \end_inset
10856
10857
10858 \begin_inset Flex CharStyle:Code
10859 status collapsed
10860
10861 \begin_layout Plain Layout
10862 Section 
10863 \backslash
10864 thechapter.
10865 \backslash
10866 thesection
10867 \end_layout
10868
10869 \end_inset
10870
10871
10872 \begin_inset Quotes erd
10873 \end_inset
10874
10875 .
10876  See Section 
10877 \begin_inset CommandInset ref
10878 LatexCommand ref
10879 reference "sub:Counters"
10880
10881 \end_inset
10882
10883  for more information on counters.
10884 \end_layout
10885
10886 \begin_layout Itemize
10887 \begin_inset Flex CharStyle:Code
10888 status collapsed
10889
10890 \begin_layout Plain Layout
10891 Enumerate
10892 \end_layout
10893
10894 \end_inset
10895
10896  produces the usual sort of enumeration labels.
10897  At present, it is hardcoded to use Arabic numerals, lowercase letters,
10898  small Roman numerals, and uppercase letters for the four possible depths.
10899 \end_layout
10900
10901 \begin_layout Itemize
10902 \begin_inset Flex CharStyle:Code
10903 status collapsed
10904
10905 \begin_layout Plain Layout
10906 Itemize
10907 \end_layout
10908
10909 \end_inset
10910
10911  produces various bullets at the different levels.
10912  It is also hardcoded.
10913 \end_layout
10914
10915 \begin_layout Itemize
10916 \begin_inset Flex CharStyle:Code
10917 status collapsed
10918
10919 \begin_layout Plain Layout
10920 Bibliography
10921 \end_layout
10922
10923 \end_inset
10924
10925  is used internally by LyX and should be used only with 
10926 \begin_inset Flex CharStyle:Code
10927 status collapsed
10928
10929 \begin_layout Plain Layout
10930 LatexType BibEnvironment
10931 \end_layout
10932
10933 \end_inset
10934
10935 .
10936 \end_layout
10937
10938 \end_deeper
10939 \begin_layout Description
10940 \begin_inset Flex CharStyle:Code
10941 status collapsed
10942
10943 \begin_layout Plain Layout
10944 LangPreamble
10945 \end_layout
10946
10947 \end_inset
10948
10949  Like 
10950 \begin_inset Flex CharStyle:Code
10951 status collapsed
10952
10953 \begin_layout Plain Layout
10954 BabelPreamble
10955 \end_layout
10956
10957 \end_inset
10958
10959 , but this preamble snippet occurs independently from the babel package,
10960  and only for the document language.
10961  Must end with 
10962 \begin_inset Quotes eld
10963 \end_inset
10964
10965
10966 \begin_inset Flex CharStyle:Code
10967 status collapsed
10968
10969 \begin_layout Plain Layout
10970 EndLangPreamble
10971 \end_layout
10972
10973 \end_inset
10974
10975
10976 \begin_inset Quotes erd
10977 \end_inset
10978
10979 .
10980 \end_layout
10981
10982 \begin_deeper
10983 \begin_layout Standard
10984 If the style defines text that appears in the typeset document, it may use
10985  
10986 \begin_inset Flex CharStyle:Code
10987 status collapsed
10988
10989 \begin_layout Plain Layout
10990 LangPreamble
10991 \end_layout
10992
10993 \end_inset
10994
10995  and 
10996 \begin_inset Flex CharStyle:Code
10997 status collapsed
10998
10999 \begin_layout Plain Layout
11000 BabelPreamble
11001 \end_layout
11002
11003 \end_inset
11004
11005  to support non-english and even multilanguage documents correctly.
11006  The following excerpt (from the 
11007 \begin_inset Flex CharStyle:Code
11008 status collapsed
11009
11010 \begin_layout Plain Layout
11011 theorems-ams.inc
11012 \end_layout
11013
11014 \end_inset
11015
11016  file) shows how this works:
11017 \end_layout
11018
11019 \begin_layout LyX-Code
11020 Preamble
11021 \end_layout
11022
11023 \begin_layout LyX-Code
11024   
11025 \backslash
11026 theoremstyle{remark}
11027 \end_layout
11028
11029 \begin_layout LyX-Code
11030   
11031 \backslash
11032 newtheorem{claim}[thm]{
11033 \backslash
11034 protect
11035 \backslash
11036 claimname}
11037 \end_layout
11038
11039 \begin_layout LyX-Code
11040 EndPreamble
11041 \end_layout
11042
11043 \begin_layout LyX-Code
11044 LangPreamble
11045 \end_layout
11046
11047 \begin_layout LyX-Code
11048   
11049 \backslash
11050 providecommand{
11051 \backslash
11052 claimname}{_(Claim)}
11053 \end_layout
11054
11055 \begin_layout LyX-Code
11056
11057 \end_layout
11058
11059 \begin_layout LyX-Code
11060 EndLangPreamble
11061 \end_layout
11062
11063 \begin_layout LyX-Code
11064 BabelPreamble
11065 \end_layout
11066
11067 \begin_layout LyX-Code
11068     
11069 \backslash
11070 addto
11071 \backslash
11072 captions$$lang{
11073 \backslash
11074 renewcommand{
11075 \backslash
11076 claimname}{_(Claim)}}
11077 \end_layout
11078
11079 \begin_layout LyX-Code
11080 EndBabelPreamble
11081 \end_layout
11082
11083 \begin_layout Standard
11084 The key to correct translation of the user visible text is the definition
11085  of the command 
11086 \begin_inset Flex CharStyle:Code
11087 status collapsed
11088
11089 \begin_layout Plain Layout
11090
11091 \backslash
11092 claimname
11093 \end_layout
11094
11095 \end_inset
11096
11097  in the language preamble.
11098  This command holds the name of the theorem that will appear in the output.
11099  The 
11100 \begin_inset Flex CharStyle:Code
11101 status collapsed
11102
11103 \begin_layout Plain Layout
11104 BabelPreamble
11105 \end_layout
11106
11107 \end_inset
11108
11109  then uses the commands offered by the babel package to redefine 
11110 \begin_inset Flex CharStyle:Code
11111 status collapsed
11112
11113 \begin_layout Plain Layout
11114
11115 \backslash
11116 claimname
11117 \end_layout
11118
11119 \end_inset
11120
11121  for each used language in multilanguage documents.
11122 \end_layout
11123
11124 \end_deeper
11125 \begin_layout Description
11126 \begin_inset Flex CharStyle:Code
11127 status collapsed
11128
11129 \begin_layout Plain Layout
11130 LatexName
11131 \end_layout
11132
11133 \end_inset
11134
11135  The name of the corresponding LaTeX stuff.
11136  Either the environment or command name.
11137 \end_layout
11138
11139 \begin_layout Description
11140 \begin_inset Flex CharStyle:Code
11141 status collapsed
11142
11143 \begin_layout Plain Layout
11144 LatexParam
11145 \end_layout
11146
11147 \end_inset
11148
11149  An optional parameter for the corresponding 
11150 \begin_inset Flex CharStyle:Code
11151 status collapsed
11152
11153 \begin_layout Plain Layout
11154 LatexName
11155 \end_layout
11156
11157 \end_inset
11158
11159  stuff.
11160  This parameter cannot be changed from within LyX.
11161 \end_layout
11162
11163 \begin_layout Description
11164 \begin_inset Flex CharStyle:Code
11165 status collapsed
11166
11167 \begin_layout Plain Layout
11168 LatexType
11169 \end_layout
11170
11171 \end_inset
11172
11173  
11174 \begin_inset CommandInset label
11175 LatexCommand label
11176 name "des:LatexType"
11177
11178 \end_inset
11179
11180 [
11181 \begin_inset Flex CharStyle:Code
11182 status collapsed
11183
11184 \begin_layout Plain Layout
11185
11186 \emph on
11187 Paragraph
11188 \emph default
11189 , Command, Environment, Item_Environment,
11190 \end_layout
11191
11192 \end_inset
11193
11194  
11195 \begin_inset Flex CharStyle:Code
11196 status collapsed
11197
11198 \begin_layout Plain Layout
11199 List_Environment, Bib_Environment
11200 \end_layout
11201
11202 \end_inset
11203
11204 ] How the layout should be translated into LaTeX.
11205 \begin_inset Foot
11206 status collapsed
11207
11208 \begin_layout Plain Layout
11209 \begin_inset Flex CharStyle:Code
11210 status collapsed
11211
11212 \begin_layout Plain Layout
11213 LatexType
11214 \end_layout
11215
11216 \end_inset
11217
11218  is perhaps a bit misleading, since these rules apply to SGML classes, too.
11219  Visit the SGML class files for specific examples.
11220 \end_layout
11221
11222 \end_inset
11223
11224
11225 \end_layout
11226
11227 \begin_deeper
11228 \begin_layout Itemize
11229 \begin_inset Flex CharStyle:Code
11230 status collapsed
11231
11232 \begin_layout Plain Layout
11233 Paragraph
11234 \end_layout
11235
11236 \end_inset
11237
11238  means nothing special.
11239  
11240 \end_layout
11241
11242 \begin_layout Itemize
11243 \begin_inset Flex CharStyle:Code
11244 status collapsed
11245
11246 \begin_layout Plain Layout
11247 Command
11248 \end_layout
11249
11250 \end_inset
11251
11252  means 
11253 \begin_inset Flex CharStyle:Code
11254 status collapsed
11255
11256 \begin_layout Plain Layout
11257
11258 \backslash
11259
11260 \emph on
11261 LatexName
11262 \emph default
11263 {\SpecialChar \ldots{}
11264 }
11265 \end_layout
11266
11267 \end_inset
11268
11269 .
11270 \end_layout
11271
11272 \begin_layout Itemize
11273 \begin_inset Flex CharStyle:Code
11274 status collapsed
11275
11276 \begin_layout Plain Layout
11277 Environment
11278 \end_layout
11279
11280 \end_inset
11281
11282  means 
11283 \begin_inset Flex CharStyle:Code
11284 status collapsed
11285
11286 \begin_layout Plain Layout
11287
11288 \backslash
11289 begin{
11290 \emph on
11291 LatexName
11292 \emph default
11293 }\SpecialChar \ldots{}
11294
11295 \backslash
11296 end{
11297 \emph on
11298 LatexName
11299 \emph default
11300 }
11301 \end_layout
11302
11303 \end_inset
11304
11305 .
11306  
11307 \end_layout
11308
11309 \begin_layout Itemize
11310 \begin_inset Flex CharStyle:Code
11311 status collapsed
11312
11313 \begin_layout Plain Layout
11314 Item_Environment
11315 \end_layout
11316
11317 \end_inset
11318
11319  is the same as 
11320 \begin_inset Flex CharStyle:Code
11321 status collapsed
11322
11323 \begin_layout Plain Layout
11324 Environment
11325 \end_layout
11326
11327 \end_inset
11328
11329 , except that an 
11330 \begin_inset Flex CharStyle:Code
11331 status collapsed
11332
11333 \begin_layout Plain Layout
11334
11335 \backslash
11336 item
11337 \end_layout
11338
11339 \end_inset
11340
11341  is generated for each paragraph of this environment.
11342  
11343 \end_layout
11344
11345 \begin_layout Itemize
11346 \begin_inset Flex CharStyle:Code
11347 status collapsed
11348
11349 \begin_layout Plain Layout
11350 List_Environment
11351 \end_layout
11352
11353 \end_inset
11354
11355  is the same as 
11356 \begin_inset Flex CharStyle:Code
11357 status collapsed
11358
11359 \begin_layout Plain Layout
11360 Item_Environment
11361 \end_layout
11362
11363 \end_inset
11364
11365 , except that 
11366 \begin_inset Flex CharStyle:Code
11367 status collapsed
11368
11369 \begin_layout Plain Layout
11370 LabelWidthString
11371 \end_layout
11372
11373 \end_inset
11374
11375  is passed as an argument to the environment.
11376  
11377 \begin_inset Flex CharStyle:Code
11378 status collapsed
11379
11380 \begin_layout Plain Layout
11381 LabelWidthString
11382 \end_layout
11383
11384 \end_inset
11385
11386  can be defined in the 
11387 \begin_inset Flex CharStyle:MenuItem
11388 status collapsed
11389
11390 \begin_layout Plain Layout
11391
11392 \bar under
11393 L
11394 \bar default
11395 ayout\SpecialChar \menuseparator
11396
11397 \bar under
11398 P
11399 \bar default
11400 aragraph
11401 \end_layout
11402
11403 \end_inset
11404
11405  dialog.
11406  
11407 \end_layout
11408
11409 \begin_layout Standard
11410 Putting the last few things together, the LaTeX output will be either: 
11411 \end_layout
11412
11413 \begin_layout LyX-Code
11414
11415 \backslash
11416 latexname[latexparam]{\SpecialChar \ldots{}
11417 }
11418 \end_layout
11419
11420 \begin_layout Standard
11421 or: 
11422 \end_layout
11423
11424 \begin_layout LyX-Code
11425
11426 \backslash
11427 begin{latexname}[latexparam] \SpecialChar \ldots{}
11428  
11429 \backslash
11430 end{latexname}.
11431 \end_layout
11432
11433 \begin_layout Standard
11434 depending upon the LaTeX type.
11435 \end_layout
11436
11437 \end_deeper
11438 \begin_layout Description
11439 \begin_inset Flex CharStyle:Code
11440 status collapsed
11441
11442 \begin_layout Plain Layout
11443 LeftMargin
11444 \end_layout
11445
11446 \end_inset
11447
11448  [
11449 \begin_inset Flex CharStyle:Code
11450 status collapsed
11451
11452 \begin_layout Plain Layout
11453 string=""
11454 \end_layout
11455
11456 \end_inset
11457
11458 ] If you put layouts into environments, the leftmargins are not simply added,
11459  but added with a factor 
11460 \begin_inset Formula $\frac{4}{depth+4}$
11461 \end_inset
11462
11463 .
11464  Note that this parameter is also used when the margin is defined as 
11465 \begin_inset Flex CharStyle:Code
11466 status collapsed
11467
11468 \begin_layout Plain Layout
11469 Manual
11470 \end_layout
11471
11472 \end_inset
11473
11474  or 
11475 \begin_inset Flex CharStyle:Code
11476 status collapsed
11477
11478 \begin_layout Plain Layout
11479 Dynamic
11480 \end_layout
11481
11482 \end_inset
11483
11484 .
11485  Then it is added to the manual or dynamic margin.
11486  
11487 \begin_inset Newline newline
11488 \end_inset
11489
11490 The argument is passed as a string.
11491  For example 
11492 \begin_inset Quotes eld
11493 \end_inset
11494
11495
11496 \begin_inset Flex CharStyle:Code
11497 status collapsed
11498
11499 \begin_layout Plain Layout
11500 MM
11501 \end_layout
11502
11503 \end_inset
11504
11505
11506 \begin_inset Quotes erd
11507 \end_inset
11508
11509  means that the paragraph is indented with the width of 
11510 \begin_inset Quotes eld
11511 \end_inset
11512
11513
11514 \begin_inset Flex CharStyle:Code
11515 status collapsed
11516
11517 \begin_layout Plain Layout
11518 MM
11519 \end_layout
11520
11521 \end_inset
11522
11523
11524 \begin_inset Quotes erd
11525 \end_inset
11526
11527  in the normal font.
11528  You can get a negative width by prefixing the string with 
11529 \begin_inset Quotes eld
11530 \end_inset
11531
11532
11533 \begin_inset Flex CharStyle:Code
11534 status collapsed
11535
11536 \begin_layout Plain Layout
11537 -
11538 \end_layout
11539
11540 \end_inset
11541
11542
11543 \begin_inset Quotes erd
11544 \end_inset
11545
11546 .
11547  This way was chosen so that the look is the same with each used screen
11548  font.
11549  
11550 \end_layout
11551
11552 \begin_layout Description
11553 \begin_inset Flex CharStyle:Code
11554 status collapsed
11555
11556 \begin_layout Plain Layout
11557 Margin
11558 \end_layout
11559
11560 \end_inset
11561
11562  [
11563 \begin_inset Flex CharStyle:Code
11564 status collapsed
11565
11566 \begin_layout Plain Layout
11567
11568 \emph on
11569 Static
11570 \emph default
11571 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11572 \end_layout
11573
11574 \end_inset
11575
11576
11577 \begin_inset Newline newline
11578 \end_inset
11579
11580 The kind of margin that the layout has on the left side.
11581  
11582 \begin_inset Flex CharStyle:Code
11583 status collapsed
11584
11585 \begin_layout Plain Layout
11586 Static
11587 \end_layout
11588
11589 \end_inset
11590
11591  just means a fixed margin.
11592  
11593 \begin_inset Flex CharStyle:Code
11594 status collapsed
11595
11596 \begin_layout Plain Layout
11597 Manual
11598 \end_layout
11599
11600 \end_inset
11601
11602  means that the left margin depends on the string entered in the 
11603 \begin_inset Flex CharStyle:MenuItem
11604 status collapsed
11605
11606 \begin_layout Plain Layout
11607 Edit\SpecialChar \menuseparator
11608 Paragraph
11609 \begin_inset space ~
11610 \end_inset
11611
11612 Settings
11613 \end_layout
11614
11615 \end_inset
11616
11617  dialog.
11618  This is used to typeset nice lists without tabulators.
11619  
11620 \begin_inset Flex CharStyle:Code
11621 status collapsed
11622
11623 \begin_layout Plain Layout
11624 Dynamic
11625 \end_layout
11626
11627 \end_inset
11628
11629  means that the margin depends on the size of the label.
11630  This is used for automatic enumerated headlines.
11631  It is obvious that the headline 
11632 \begin_inset Quotes eld
11633 \end_inset
11634
11635 5.4.3.2.1 Very long headline
11636 \begin_inset Quotes erd
11637 \end_inset
11638
11639  must have a wider left margin (as wide as 
11640 \begin_inset Quotes eld
11641 \end_inset
11642
11643 5.4.3.2.1
11644 \begin_inset Quotes erd
11645 \end_inset
11646
11647  plus the space) than 
11648 \begin_inset Quotes eld
11649 \end_inset
11650
11651 3.2 Very long headline
11652 \begin_inset Quotes erd
11653 \end_inset
11654
11655 , even if standard 
11656 \begin_inset Quotes eld
11657 \end_inset
11658
11659 word processors
11660 \begin_inset Quotes erd
11661 \end_inset
11662
11663  are not able to do this.
11664  
11665 \begin_inset Flex CharStyle:Code
11666 status collapsed
11667
11668 \begin_layout Plain Layout
11669 First_Dynamic
11670 \end_layout
11671
11672 \end_inset
11673
11674  is similar, but only the very first row of the paragraph is dynamic, while
11675  the others are static; this is used, for example, for descriptions.
11676  
11677 \begin_inset Flex CharStyle:Code
11678 status collapsed
11679
11680 \begin_layout Plain Layout
11681 Right_Address_Box
11682 \end_layout
11683
11684 \end_inset
11685
11686  means the margin is chosen in a way that the longest row of this paragraph
11687  fits to the right margin.
11688  This is used to typeset an address on the right edge of the page.
11689 \end_layout
11690
11691 \begin_layout Description
11692 \begin_inset Flex CharStyle:Code
11693 status collapsed
11694
11695 \begin_layout Plain Layout
11696 NeedProtect
11697 \end_layout
11698
11699 \end_inset
11700
11701  [
11702 \begin_inset Flex CharStyle:Code
11703 status collapsed
11704
11705 \begin_layout Plain Layout
11706
11707 \emph on
11708 0
11709 \end_layout
11710
11711 \end_inset
11712
11713 ,
11714 \begin_inset Flex CharStyle:Code
11715 status collapsed
11716
11717 \begin_layout Plain Layout
11718 1
11719 \end_layout
11720
11721 \end_inset
11722
11723 ] Whether fragile commands in this layout should be 
11724 \begin_inset Flex CharStyle:Code
11725 status collapsed
11726
11727 \begin_layout Plain Layout
11728
11729 \backslash
11730 protect
11731 \end_layout
11732
11733 \end_inset
11734
11735 'ed.
11736  (Note: This is 
11737 \emph on
11738 not
11739 \emph default
11740  whether this command should itself be protected.)
11741 \end_layout
11742
11743 \begin_layout Description
11744 \begin_inset Flex CharStyle:Code
11745 status collapsed
11746
11747 \begin_layout Plain Layout
11748 Newline
11749 \end_layout
11750
11751 \end_inset
11752
11753  [
11754 \begin_inset Flex CharStyle:Code
11755 status collapsed
11756
11757 \begin_layout Plain Layout
11758 0
11759 \end_layout
11760
11761 \end_inset
11762
11763
11764 \begin_inset Flex CharStyle:Code
11765 status collapsed
11766
11767 \begin_layout Plain Layout
11768
11769 \emph on
11770 1
11771 \end_layout
11772
11773 \end_inset
11774
11775 ] Whether newlines are translated into LaTeX newlines (
11776 \begin_inset Flex CharStyle:Code
11777 status collapsed
11778
11779 \begin_layout Plain Layout
11780
11781 \backslash
11782
11783 \backslash
11784
11785 \end_layout
11786
11787 \end_inset
11788
11789 ) or not.
11790  The translation can be switched off to allow more comfortable LaTeX editing
11791  inside LyX.
11792 \end_layout
11793
11794 \begin_layout Description
11795 \begin_inset Flex CharStyle:Code
11796 status collapsed
11797
11798 \begin_layout Plain Layout
11799 NextNoIndent
11800 \end_layout
11801
11802 \end_inset
11803
11804  [
11805 \begin_inset Flex CharStyle:Code
11806 status collapsed
11807
11808 \begin_layout Plain Layout
11809 1
11810 \end_layout
11811
11812 \end_inset
11813
11814
11815 \begin_inset Flex CharStyle:Code
11816 status collapsed
11817
11818 \begin_layout Plain Layout
11819
11820 \emph on
11821 0
11822 \end_layout
11823
11824 \end_inset
11825
11826 ] Whether the following Paragraph is allowed to indent its very first row.
11827  
11828 \begin_inset Flex CharStyle:Code
11829 status collapsed
11830
11831 \begin_layout Plain Layout
11832 1
11833 \end_layout
11834
11835 \end_inset
11836
11837  means that it is not allowed to do so; 
11838 \begin_inset Flex CharStyle:Code
11839 status collapsed
11840
11841 \begin_layout Plain Layout
11842 0
11843 \end_layout
11844
11845 \end_inset
11846
11847  means it could do so if it wants to.
11848 \end_layout
11849
11850 \begin_layout Description
11851 \begin_inset Flex CharStyle:Code
11852 status collapsed
11853
11854 \begin_layout Plain Layout
11855 ObsoletedBy
11856 \end_layout
11857
11858 \end_inset
11859
11860  Name of a layout that has replaced this layout.
11861  This is used to rename a layout, while keeping backward compatibility.
11862 \end_layout
11863
11864 \begin_layout Description
11865 \begin_inset Flex CharStyle:Code
11866 status collapsed
11867
11868 \begin_layout Plain Layout
11869 OptionalArgs
11870 \end_layout
11871
11872 \end_inset
11873
11874  [
11875 \begin_inset Flex CharStyle:Code
11876 status collapsed
11877
11878 \begin_layout Plain Layout
11879 int=0
11880 \end_layout
11881
11882 \end_inset
11883
11884 ] The number of optional arguments that can be used with this layout.
11885  This is useful for things like section headings, and only makes sense with
11886  LaTeX.
11887  Note that, on output, the optional arguments will all precede any required
11888  arguments (see below).
11889  So one can have constructs like:
11890 \end_layout
11891
11892 \begin_deeper
11893 \begin_layout LyX-Code
11894
11895 \backslash
11896 mycmd[opt1]{req1}{contents of paragraph}
11897 \end_layout
11898
11899 \begin_layout Standard
11900 but one cannot have things like: 
11901 \end_layout
11902
11903 \begin_layout LyX-Code
11904
11905 \backslash
11906 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11907 \end_layout
11908
11909 \begin_layout Standard
11910 at least, not without ERT (with which you can have anything).
11911  
11912 \end_layout
11913
11914 \end_deeper
11915 \begin_layout Description
11916 \begin_inset Flex CharStyle:Code
11917 status collapsed
11918
11919 \begin_layout Plain Layout
11920 ParIndent
11921 \end_layout
11922
11923 \end_inset
11924
11925  [
11926 \begin_inset Flex CharStyle:Code
11927 status collapsed
11928
11929 \begin_layout Plain Layout
11930 string=""
11931 \end_layout
11932
11933 \end_inset
11934
11935 ] The indent of the very first line of a paragraph.
11936  The 
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  will be fixed for a certain layout.
11947  The exception is Standard layout, since the indentation of a Standard layout
11948  paragraph can be prohibited with 
11949 \begin_inset Flex CharStyle:Code
11950 status collapsed
11951
11952 \begin_layout Plain Layout
11953 NextNoIndent
11954 \end_layout
11955
11956 \end_inset
11957
11958 .
11959  Also, Standard layout paragraphs inside environments use the 
11960 \begin_inset Flex CharStyle:Code
11961 status collapsed
11962
11963 \begin_layout Plain Layout
11964 Parindent
11965 \end_layout
11966
11967 \end_inset
11968
11969  of the environment, not their native one.
11970  For example, Standard paragraphs inside an enumeration are not indented.
11971 \end_layout
11972
11973 \begin_layout Description
11974 \begin_inset Flex CharStyle:Code
11975 status collapsed
11976
11977 \begin_layout Plain Layout
11978 Parsep
11979 \end_layout
11980
11981 \end_inset
11982
11983  [
11984 \begin_inset Flex CharStyle:Code
11985 status collapsed
11986
11987 \begin_layout Plain Layout
11988 float=0
11989 \end_layout
11990
11991 \end_inset
11992
11993 ] The vertical space between two paragraphs of this layout.
11994 \end_layout
11995
11996 \begin_layout Description
11997 \begin_inset Flex CharStyle:Code
11998 status collapsed
11999
12000 \begin_layout Plain Layout
12001 Parskip
12002 \end_layout
12003
12004 \end_inset
12005
12006  [
12007 \begin_inset Flex CharStyle:Code
12008 status collapsed
12009
12010 \begin_layout Plain Layout
12011 float=0
12012 \end_layout
12013
12014 \end_inset
12015
12016 ] LyX allows the user to choose either 
12017 \begin_inset Quotes eld
12018 \end_inset
12019
12020 indent
12021 \begin_inset Quotes erd
12022 \end_inset
12023
12024  or 
12025 \begin_inset Quotes eld
12026 \end_inset
12027
12028 skip
12029 \begin_inset Quotes erd
12030 \end_inset
12031
12032  to typeset a document.
12033  When 
12034 \begin_inset Quotes eld
12035 \end_inset
12036
12037 indent
12038 \begin_inset Quotes erd
12039 \end_inset
12040
12041  is chosen, this value is completely ignored.
12042  When 
12043 \begin_inset Quotes eld
12044 \end_inset
12045
12046 skip
12047 \begin_inset Quotes erd
12048 \end_inset
12049
12050  is chosen, the parindent of a LaTeXtype 
12051 \begin_inset Quotes eld
12052 \end_inset
12053
12054 Paragraph
12055 \begin_inset Quotes erd
12056 \end_inset
12057
12058  layout is ignored and all paragraphs are separated by this parskip argument.
12059  The vertical space is calculated with 
12060 \begin_inset Flex CharStyle:Code
12061 status collapsed
12062
12063 \begin_layout Plain Layout
12064 value
12065 \begin_inset space ~
12066 \end_inset
12067
12068 * DefaultHeight
12069 \end_layout
12070
12071 \end_inset
12072
12073  where 
12074 \begin_inset Flex CharStyle:Code
12075 status collapsed
12076
12077 \begin_layout Plain Layout
12078 DefaultHeight
12079 \end_layout
12080
12081 \end_inset
12082
12083  is the height of a row with the normal font.
12084  This way, the look stays the same with different screen fonts.
12085 \end_layout
12086
12087 \begin_layout Description
12088 \begin_inset Flex CharStyle:Code
12089 status collapsed
12090
12091 \begin_layout Plain Layout
12092 PassThru
12093 \end_layout
12094
12095 \end_inset
12096
12097  
12098 \begin_inset CommandInset label
12099 LatexCommand label
12100 name "des:PathThru"
12101
12102 \end_inset
12103
12104 [
12105 \begin_inset Flex CharStyle:Code
12106 status collapsed
12107
12108 \begin_layout Plain Layout
12109
12110 \emph on
12111 0
12112 \end_layout
12113
12114 \end_inset
12115
12116
12117 \begin_inset Flex CharStyle:Code
12118 status collapsed
12119
12120 \begin_layout Plain Layout
12121 1
12122 \end_layout
12123
12124 \end_inset
12125
12126 ] Whether the contents of this paragraph should be output in raw form, meaning
12127  without special translations that LaTeX would require.
12128 \end_layout
12129
12130 \begin_layout Description
12131 \begin_inset Flex CharStyle:Code
12132 status collapsed
12133
12134 \begin_layout Plain Layout
12135 Preamble
12136 \end_layout
12137
12138 \end_inset
12139
12140  
12141 \begin_inset CommandInset label
12142 LatexCommand label
12143 name "des:Preamble"
12144
12145 \end_inset
12146
12147 Information to be included in the LaTeX preamble when this style is used.
12148  Used to define macros, load packages, etc., required by this particular
12149  style.
12150  Must end with 
12151 \begin_inset Quotes eld
12152 \end_inset
12153
12154
12155 \begin_inset Flex CharStyle:Code
12156 status collapsed
12157
12158 \begin_layout Plain Layout
12159 EndPreamble
12160 \end_layout
12161
12162 \end_inset
12163
12164
12165 \begin_inset Quotes erd
12166 \end_inset
12167
12168 .
12169 \end_layout
12170
12171 \begin_layout Description
12172 \begin_inset Flex CharStyle:Code
12173 status collapsed
12174
12175 \begin_layout Plain Layout
12176 RefPrefix
12177 \end_layout
12178
12179 \end_inset
12180
12181  [
12182 \begin_inset Flex CharStyle:Code
12183 status collapsed
12184
12185 \begin_layout Plain Layout
12186 string
12187 \end_layout
12188
12189 \end_inset
12190
12191 ] The prefix to use when creating labels referring to paragraphs of this
12192  type.
12193  This allows the use of formatted references.
12194 \end_layout
12195
12196 \begin_layout Description
12197 \begin_inset Flex CharStyle:Code
12198 status collapsed
12199
12200 \begin_layout Plain Layout
12201 RequiredArgs
12202 \end_layout
12203
12204 \end_inset
12205
12206  [
12207 \begin_inset Flex CharStyle:Code
12208 status collapsed
12209
12210 \begin_layout Plain Layout
12211 int=0
12212 \end_layout
12213
12214 \end_inset
12215
12216 ] The number of required arguments that the LaTeX command or environment
12217  corresponding to this layout expects.
12218  In the case of a command, these are required arguments 
12219 \emph on
12220 other than
12221 \emph default
12222  that associated with the content of the paragraph itself.
12223  These do not actually have to be provided: LyX will output empty arguments
12224  if necessary.
12225  Note that optional arguments will be output before required arguments.
12226  See the discussion of the 
12227 \begin_inset Flex CharStyle:Code
12228 status collapsed
12229
12230 \begin_layout Plain Layout
12231 OptionalArgs
12232 \end_layout
12233
12234 \end_inset
12235
12236  tag above for more information.
12237 \end_layout
12238
12239 \begin_layout Description
12240 \begin_inset Flex CharStyle:Code
12241 status collapsed
12242
12243 \begin_layout Plain Layout
12244 Requires 
12245 \end_layout
12246
12247 \end_inset
12248
12249  [
12250 \begin_inset Flex CharStyle:Code
12251 status collapsed
12252
12253 \begin_layout Plain Layout
12254 string
12255 \end_layout
12256
12257 \end_inset
12258
12259
12260 \begin_inset CommandInset label
12261 LatexCommand label
12262 name "des:Requires"
12263
12264 \end_inset
12265
12266 Whether the layout requires the feature 
12267 \begin_inset Flex CharStyle:Code
12268 status collapsed
12269
12270 \begin_layout Plain Layout
12271 string
12272 \end_layout
12273
12274 \end_inset
12275
12276 .
12277  See the description of 
12278 \begin_inset Flex CharStyle:Code
12279 status collapsed
12280
12281 \begin_layout Plain Layout
12282 Provides
12283 \end_layout
12284
12285 \end_inset
12286
12287  above (page 
12288 \begin_inset CommandInset ref
12289 LatexCommand pageref
12290 reference "des:FreeSpacing"
12291
12292 \end_inset
12293
12294 ) for information on `features'.
12295  
12296 \end_layout
12297
12298 \begin_layout Description
12299 \begin_inset Flex CharStyle:Code
12300 status collapsed
12301
12302 \begin_layout Plain Layout
12303 RightMargin
12304 \end_layout
12305
12306 \end_inset
12307
12308  [
12309 \begin_inset Flex CharStyle:Code
12310 status collapsed
12311
12312 \begin_layout Plain Layout
12313 string=""
12314 \end_layout
12315
12316 \end_inset
12317
12318 ] Similar to 
12319 \begin_inset Flex CharStyle:Code
12320 status collapsed
12321
12322 \begin_layout Plain Layout
12323 LeftMargin
12324 \end_layout
12325
12326 \end_inset
12327
12328 .
12329 \end_layout
12330
12331 \begin_layout Description
12332 \begin_inset Flex CharStyle:Code
12333 status collapsed
12334
12335 \begin_layout Plain Layout
12336 Spacing
12337 \end_layout
12338
12339 \end_inset
12340
12341  [
12342 \begin_inset Flex CharStyle:Code
12343 status collapsed
12344
12345 \begin_layout Plain Layout
12346
12347 \emph on
12348 single
12349 \emph default
12350 , onehalf, double, other
12351 \end_layout
12352
12353 \end_inset
12354
12355  
12356 \emph on
12357 value
12358 \emph default
12359 ] This defines what the default spacing should be in the layout.
12360  The arguments 
12361 \begin_inset Flex CharStyle:Code
12362 status collapsed
12363
12364 \begin_layout Plain Layout
12365 single
12366 \end_layout
12367
12368 \end_inset
12369
12370
12371 \begin_inset Flex CharStyle:Code
12372 status collapsed
12373
12374 \begin_layout Plain Layout
12375 onehalf
12376 \end_layout
12377
12378 \end_inset
12379
12380  and 
12381 \begin_inset Flex CharStyle:Code
12382 status collapsed
12383
12384 \begin_layout Plain Layout
12385 double
12386 \end_layout
12387
12388 \end_inset
12389
12390  correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12391  If you specify the argument 
12392 \begin_inset Flex CharStyle:Code
12393 status collapsed
12394
12395 \begin_layout Plain Layout
12396 other
12397 \end_layout
12398
12399 \end_inset
12400
12401 , then you should also provide a numerical argument which will be the actual
12402  multiplier value.
12403  Note that, contrary to other parameters, 
12404 \begin_inset Flex CharStyle:Code
12405 status collapsed
12406
12407 \begin_layout Plain Layout
12408 Spacing
12409 \end_layout
12410
12411 \end_inset
12412
12413  implies the generation of specific LaTeX code, using the package 
12414 \family roman
12415
12416 \begin_inset Flex CharStyle:Code
12417 status collapsed
12418
12419 \begin_layout Plain Layout
12420 setspace.sty
12421 \end_layout
12422
12423 \end_inset
12424
12425 .
12426 \end_layout
12427
12428 \begin_layout Description
12429 \begin_inset Flex CharStyle:Code
12430 status collapsed
12431
12432 \begin_layout Plain Layout
12433 Spellcheck
12434 \end_layout
12435
12436 \end_inset
12437
12438  [
12439 \begin_inset Flex CharStyle:Code
12440 status collapsed
12441
12442 \begin_layout Plain Layout
12443 0
12444 \end_layout
12445
12446 \end_inset
12447
12448 ,
12449 \begin_inset Flex CharStyle:Code
12450 status collapsed
12451
12452 \begin_layout Plain Layout
12453
12454 \emph on
12455 1
12456 \end_layout
12457
12458 \end_inset
12459
12460 ] Spellcheck paragraphs of this style.
12461  Default is true.
12462 \end_layout
12463
12464 \begin_layout Description
12465 \begin_inset Flex CharStyle:Code
12466 status collapsed
12467
12468 \begin_layout Plain Layout
12469 TextFont
12470 \end_layout
12471
12472 \end_inset
12473
12474  The font used for the text body .
12475  See section 
12476 \begin_inset CommandInset ref
12477 LatexCommand ref
12478 reference "sub:Font-description"
12479
12480 \end_inset
12481
12482 .
12483 \end_layout
12484
12485 \begin_layout Description
12486 \begin_inset Flex CharStyle:Code
12487 status collapsed
12488
12489 \begin_layout Plain Layout
12490 TocLevel
12491 \end_layout
12492
12493 \end_inset
12494
12495
12496 \series medium
12497  
12498 \begin_inset Flex CharStyle:Code
12499 status collapsed
12500
12501 \begin_layout Plain Layout
12502
12503 \series medium
12504 [int]
12505 \end_layout
12506
12507 \end_inset
12508
12509
12510 \series default
12511  The level of the style in the table of contents.
12512  This is used for automatic numbering of section headings.
12513 \end_layout
12514
12515 \begin_layout Description
12516 \begin_inset Flex CharStyle:Code
12517 status collapsed
12518
12519 \begin_layout Plain Layout
12520 TopSep
12521 \end_layout
12522
12523 \end_inset
12524
12525  [
12526 \begin_inset Flex CharStyle:Code
12527 status collapsed
12528
12529 \begin_layout Plain Layout
12530 float=0
12531 \end_layout
12532
12533 \end_inset
12534
12535 ] The vertical space with which the very first of a chain of paragraphs
12536  with this layout is separated from the previous paragraph.
12537  If the previous paragraph has another layout, the separations are not simply
12538  added, but the maximum is taken.
12539 \end_layout
12540
12541 \begin_layout Subsection
12542 Floats
12543 \begin_inset CommandInset label
12544 LatexCommand label
12545 name "sub:Floats"
12546
12547 \end_inset
12548
12549
12550 \end_layout
12551
12552 \begin_layout Standard
12553 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12554  define the floats (
12555 \begin_inset Flex CharStyle:MenuItem
12556 status collapsed
12557
12558 \begin_layout Plain Layout
12559 figure
12560 \end_layout
12561
12562 \end_inset
12563
12564
12565 \begin_inset Flex CharStyle:MenuItem
12566 status collapsed
12567
12568 \begin_layout Plain Layout
12569 table
12570 \end_layout
12571
12572 \end_inset
12573
12574 , \SpecialChar \ldots{}
12575 ) in the text class itself.
12576  Standard floats are included in the file 
12577 \begin_inset Flex CharStyle:Code
12578 status collapsed
12579
12580 \begin_layout Plain Layout
12581 stdfloats.inc
12582 \end_layout
12583
12584 \end_inset
12585
12586 , so you may have to do no more than add
12587 \end_layout
12588
12589 \begin_layout LyX-Code
12590 Input stdfloats.inc
12591 \end_layout
12592
12593 \begin_layout Standard
12594 to your layout file.
12595  If you want to implement a text class that proposes some other float types
12596  (like the AGU class bundled with LyX), the information below will hopefully
12597  help you:
12598 \end_layout
12599
12600 \begin_layout Description
12601 \begin_inset Flex CharStyle:Code
12602 status collapsed
12603
12604 \begin_layout Plain Layout
12605 Extension
12606 \end_layout
12607
12608 \end_inset
12609
12610  [
12611 \begin_inset Flex CharStyle:Code
12612 status collapsed
12613
12614 \begin_layout Plain Layout
12615 string
12616 \end_layout
12617
12618 \end_inset
12619
12620 =
12621 \begin_inset Quotes erd
12622 \end_inset
12623
12624
12625 \begin_inset Quotes erd
12626 \end_inset
12627
12628 ] The file name extension of an auxiliary file for the list of figures (or
12629  whatever).
12630  LaTeX writes the captions to this file.
12631 \end_layout
12632
12633 \begin_layout Description
12634 \begin_inset Flex CharStyle:Code
12635 status collapsed
12636
12637 \begin_layout Plain Layout
12638 GuiName
12639 \end_layout
12640
12641 \end_inset
12642
12643  [
12644 \begin_inset Flex CharStyle:Code
12645 status collapsed
12646
12647 \begin_layout Plain Layout
12648 string
12649 \end_layout
12650
12651 \end_inset
12652
12653 =
12654 \begin_inset Quotes erd
12655 \end_inset
12656
12657
12658 \begin_inset Quotes erd
12659 \end_inset
12660
12661 ] The string that will be used in the menus and also for the caption.
12662  This is translated to the current language if babel is used.
12663 \end_layout
12664
12665 \begin_layout Description
12666 \begin_inset Flex CharStyle:Code
12667 status collapsed
12668
12669 \begin_layout Plain Layout
12670 HTML*
12671 \end_layout
12672
12673 \end_inset
12674
12675  These are used for XHTML output.
12676  See 
12677 \begin_inset CommandInset ref
12678 LatexCommand ref
12679 reference "sec:Tags-for-XHTML"
12680
12681 \end_inset
12682
12683 .
12684 \end_layout
12685
12686 \begin_layout Description
12687 \begin_inset Flex CharStyle:Code
12688 status collapsed
12689
12690 \begin_layout Plain Layout
12691 ListCommand
12692 \end_layout
12693
12694 \end_inset
12695
12696  [
12697 \begin_inset Flex CharStyle:Code
12698 status collapsed
12699
12700 \begin_layout Plain Layout
12701 string
12702 \end_layout
12703
12704 \end_inset
12705
12706 =
12707 \begin_inset Quotes erd
12708 \end_inset
12709
12710
12711 \begin_inset Quotes erd
12712 \end_inset
12713
12714 ] The command used to generate a list of floats of this type; the leading
12715  `
12716 \backslash
12717 ' should be omitted.
12718  This 
12719 \emph on
12720 must
12721 \emph default
12722  be given if 
12723 \begin_inset Flex CharStyle:Code
12724 status collapsed
12725
12726 \begin_layout Plain Layout
12727 NeedsFloatPkg
12728 \end_layout
12729
12730 \end_inset
12731
12732  is false, since there is no standard way to generate this command.
12733  It is ignored if 
12734 \begin_inset Flex CharStyle:Code
12735 status collapsed
12736
12737 \begin_layout Plain Layout
12738 NeedsFloatPkg
12739 \end_layout
12740
12741 \end_inset
12742
12743  is true, since in that case there is a standard way.
12744 \end_layout
12745
12746 \begin_layout Description
12747 \begin_inset Flex CharStyle:Code
12748 status collapsed
12749
12750 \begin_layout Plain Layout
12751 ListName
12752 \end_layout
12753
12754 \end_inset
12755
12756  [
12757 \begin_inset Flex CharStyle:Code
12758 status collapsed
12759
12760 \begin_layout Plain Layout
12761 string
12762 \end_layout
12763
12764 \end_inset
12765
12766 =
12767 \begin_inset Quotes erd
12768 \end_inset
12769
12770
12771 \begin_inset Quotes erd
12772 \end_inset
12773
12774 ] A title for a list of floats of this kind (list of figures, tables, or
12775  whatever).
12776  It is used for the screen label within LyX; it is passed to LaTeX for use
12777  as the title there; and it is used as the title in XHTML output.
12778  It will be translated to the document language.
12779 \end_layout
12780
12781 \begin_layout Description
12782 \begin_inset Flex CharStyle:Code
12783 status collapsed
12784
12785 \begin_layout Plain Layout
12786 NeedsFloatPkg
12787 \end_layout
12788
12789 \end_inset
12790
12791  [
12792 \begin_inset Flex CharStyle:Code
12793 status open
12794
12795 \begin_layout Plain Layout
12796 0
12797 \end_layout
12798
12799 \end_inset
12800
12801
12802 \begin_inset Flex CharStyle:Code
12803 status collapsed
12804
12805 \begin_layout Plain Layout
12806
12807 \emph on
12808 1
12809 \end_layout
12810
12811 \end_inset
12812
12813 ] Indicates whether the float is already defined in the document class or
12814  if we instead need to load 
12815 \begin_inset Flex CharStyle:Code
12816 status collapsed
12817
12818 \begin_layout Plain Layout
12819 float.sty
12820 \end_layout
12821
12822 \end_inset
12823
12824  and use what it provides.
12825  The default is 
12826 \begin_inset Flex CharStyle:Code
12827 status collapsed
12828
12829 \begin_layout Plain Layout
12830 1
12831 \end_layout
12832
12833 \end_inset
12834
12835 , which means: use 
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 .
12846  It should be set to 
12847 \begin_inset Flex CharStyle:Code
12848 status collapsed
12849
12850 \begin_layout Plain Layout
12851 0
12852 \end_layout
12853
12854 \end_inset
12855
12856  if the float is already defined by the LaTeX document class.
12857 \end_layout
12858
12859 \begin_layout Description
12860 \begin_inset Flex CharStyle:Code
12861 status collapsed
12862
12863 \begin_layout Plain Layout
12864 NumberWithin
12865 \end_layout
12866
12867 \end_inset
12868
12869  [
12870 \begin_inset Flex CharStyle:Code
12871 status collapsed
12872
12873 \begin_layout Plain Layout
12874 string
12875 \end_layout
12876
12877 \end_inset
12878
12879 =
12880 \begin_inset Quotes erd
12881 \end_inset
12882
12883
12884 \begin_inset Quotes erd
12885 \end_inset
12886
12887 ] This (optional) argument determines whether floats of this class will
12888  be numbered within some sectional unit of the document.
12889  For example, if within is equal to 
12890 \begin_inset Flex CharStyle:Code
12891 status collapsed
12892
12893 \begin_layout Plain Layout
12894 chapter
12895 \end_layout
12896
12897 \end_inset
12898
12899 , the floats will be numbered within chapters.
12900  
12901 \end_layout
12902
12903 \begin_layout Description
12904 \begin_inset Flex CharStyle:Code
12905 status collapsed
12906
12907 \begin_layout Plain Layout
12908 Placement
12909 \end_layout
12910
12911 \end_inset
12912
12913  [
12914 \begin_inset Flex CharStyle:Code
12915 status collapsed
12916
12917 \begin_layout Plain Layout
12918 string
12919 \end_layout
12920
12921 \end_inset
12922
12923 =
12924 \begin_inset Quotes erd
12925 \end_inset
12926
12927
12928 \begin_inset Quotes erd
12929 \end_inset
12930
12931 ] The default placement for the given class of floats.
12932  The string should be as in standard LaTeX: 
12933 \begin_inset Flex CharStyle:Code
12934 status collapsed
12935
12936 \begin_layout Plain Layout
12937 t
12938 \end_layout
12939
12940 \end_inset
12941
12942
12943 \begin_inset Flex CharStyle:Code
12944 status collapsed
12945
12946 \begin_layout Plain Layout
12947 b
12948 \end_layout
12949
12950 \end_inset
12951
12952
12953 \begin_inset Flex CharStyle:Code
12954 status collapsed
12955
12956 \begin_layout Plain Layout
12957 p
12958 \end_layout
12959
12960 \end_inset
12961
12962  and 
12963 \begin_inset Flex CharStyle:Code
12964 status collapsed
12965
12966 \begin_layout Plain Layout
12967 h
12968 \end_layout
12969
12970 \end_inset
12971
12972  for top, bottom, page, and here, respectively.
12973 \begin_inset Foot
12974 status collapsed
12975
12976 \begin_layout Plain Layout
12977 Note that the order of these letters in the string is irrelevant, like in
12978  LaTeX.
12979 \end_layout
12980
12981 \end_inset
12982
12983  On top of that there is a new type, 
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 , which does not really correspond to a float, since it means: put it 
12994 \begin_inset Quotes eld
12995 \end_inset
12996
12997 here
12998 \begin_inset Quotes erd
12999 \end_inset
13000
13001  and nowhere else.
13002  Note however that the 
13003 \begin_inset Flex CharStyle:Code
13004 status collapsed
13005
13006 \begin_layout Plain Layout
13007 H
13008 \end_layout
13009
13010 \end_inset
13011
13012  specifier is special and, because of implementation details, cannot be
13013  used in non-built in float types.
13014  If you do not understand what this means, just use 
13015 \begin_inset Quotes eld
13016 \end_inset
13017
13018
13019 \begin_inset Flex CharStyle:Code
13020 status collapsed
13021
13022 \begin_layout Plain Layout
13023 tbp
13024 \end_layout
13025
13026 \end_inset
13027
13028
13029 \begin_inset Quotes erd
13030 \end_inset
13031
13032 .
13033 \end_layout
13034
13035 \begin_layout Description
13036 \begin_inset Flex CharStyle:Code
13037 status collapsed
13038
13039 \begin_layout Plain Layout
13040 RefPrefix
13041 \end_layout
13042
13043 \end_inset
13044
13045  [
13046 \begin_inset Flex CharStyle:Code
13047 status collapsed
13048
13049 \begin_layout Plain Layout
13050 string
13051 \end_layout
13052
13053 \end_inset
13054
13055 ] The prefix to use when creating labels referring to floats of this type.
13056  This allows the use of formatted references.
13057 \end_layout
13058
13059 \begin_layout Description
13060 \begin_inset Flex CharStyle:Code
13061 status collapsed
13062
13063 \begin_layout Plain Layout
13064 Style
13065 \end_layout
13066
13067 \end_inset
13068
13069  [
13070 \begin_inset Flex CharStyle:Code
13071 status collapsed
13072
13073 \begin_layout Plain Layout
13074 string
13075 \end_layout
13076
13077 \end_inset
13078
13079 =
13080 \begin_inset Quotes erd
13081 \end_inset
13082
13083
13084 \begin_inset Quotes erd
13085 \end_inset
13086
13087 ] The style used when defining the float using 
13088 \begin_inset Flex CharStyle:Code
13089 status collapsed
13090
13091 \begin_layout Plain Layout
13092
13093 \backslash
13094 newfloat
13095 \end_layout
13096
13097 \end_inset
13098
13099 .
13100 \end_layout
13101
13102 \begin_layout Description
13103 \begin_inset Flex CharStyle:Code
13104 status collapsed
13105
13106 \begin_layout Plain Layout
13107 Type
13108 \end_layout
13109
13110 \end_inset
13111
13112  [
13113 \begin_inset Flex CharStyle:Code
13114 status collapsed
13115
13116 \begin_layout Plain Layout
13117 string
13118 \end_layout
13119
13120 \end_inset
13121
13122 =
13123 \begin_inset Quotes erd
13124 \end_inset
13125
13126
13127 \begin_inset Quotes erd
13128 \end_inset
13129
13130 ] The 
13131 \begin_inset Quotes eld
13132 \end_inset
13133
13134 type
13135 \begin_inset Quotes erd
13136 \end_inset
13137
13138  of the new class of floats, like program or algorithm.
13139  After the appropriate 
13140 \begin_inset Flex CharStyle:Code
13141 status collapsed
13142
13143 \begin_layout Plain Layout
13144
13145 \backslash
13146 newfloat
13147 \end_layout
13148
13149 \end_inset
13150
13151 , commands such as 
13152 \begin_inset Flex CharStyle:Code
13153 status collapsed
13154
13155 \begin_layout Plain Layout
13156
13157 \backslash
13158 begin{program}
13159 \end_layout
13160
13161 \end_inset
13162
13163  or 
13164 \begin_inset Flex CharStyle:Code
13165 status collapsed
13166
13167 \begin_layout Plain Layout
13168
13169 \backslash
13170 end{algorithm*}
13171 \end_layout
13172
13173 \end_inset
13174
13175  will be available.
13176 \end_layout
13177
13178 \begin_layout Standard
13179 Note that defining a float with type 
13180 \begin_inset Flex CharStyle:Code
13181 status collapsed
13182
13183 \begin_layout Plain Layout
13184
13185 \emph on
13186 type
13187 \end_layout
13188
13189 \end_inset
13190
13191  automatically defines the corresponding counter with name 
13192 \begin_inset Flex CharStyle:Code
13193 status collapsed
13194
13195 \begin_layout Plain Layout
13196
13197 \emph on
13198 type
13199 \end_layout
13200
13201 \end_inset
13202
13203 .
13204 \end_layout
13205
13206 \begin_layout Subsection
13207 Flex insets and InsetLayout
13208 \begin_inset CommandInset label
13209 LatexCommand label
13210 name "sub:Flex-insets-and"
13211
13212 \end_inset
13213
13214
13215 \end_layout
13216
13217 \begin_layout Standard
13218 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13219  these are called Flex insets.
13220  
13221 \end_layout
13222
13223 \begin_layout Standard
13224 Flex insets come in three different kinds: 
13225 \end_layout
13226
13227 \begin_layout Itemize
13228 character style (
13229 \begin_inset Flex CharStyle:Code
13230 status collapsed
13231
13232 \begin_layout Plain Layout
13233 CharStyle
13234 \end_layout
13235
13236 \end_inset
13237
13238 ): These define semantic markup corresponding to such LaTeX commands as
13239  
13240 \begin_inset Flex CharStyle:Code
13241 status collapsed
13242
13243 \begin_layout Plain Layout
13244
13245 \backslash
13246 noun
13247 \end_layout
13248
13249 \end_inset
13250
13251  and 
13252 \begin_inset Flex CharStyle:Code
13253 status collapsed
13254
13255 \begin_layout Plain Layout
13256
13257 \backslash
13258 code
13259 \end_layout
13260
13261 \end_inset
13262
13263 .
13264 \end_layout
13265
13266 \begin_layout Itemize
13267 user custom (
13268 \begin_inset Flex CharStyle:Code
13269 status collapsed
13270
13271 \begin_layout Plain Layout
13272 Custom
13273 \end_layout
13274
13275 \end_inset
13276
13277 ): These can be used to define custom collapsible insets, similar to TeX
13278  code, footnote, and the like.
13279  An obvious example is an endnote inset, which is defined in the 
13280 \begin_inset Flex CharStyle:Code
13281 status collapsed
13282
13283 \begin_layout Plain Layout
13284 endnote
13285 \end_layout
13286
13287 \end_inset
13288
13289  module.
13290 \end_layout
13291
13292 \begin_layout Itemize
13293 XML elements (
13294 \begin_inset Flex CharStyle:Code
13295 status collapsed
13296
13297 \begin_layout Plain Layout
13298 Element
13299 \end_layout
13300
13301 \end_inset
13302
13303 ): For use with DocBook classes.
13304 \end_layout
13305
13306 \begin_layout Standard
13307 Flex insets are defined using the 
13308 \begin_inset Flex CharStyle:Code
13309 status collapsed
13310
13311 \begin_layout Plain Layout
13312 InsetLayout
13313 \end_layout
13314
13315 \end_inset
13316
13317  tag, which shall be explained in a moment.
13318 \end_layout
13319
13320 \begin_layout Standard
13321 The 
13322 \begin_inset Flex CharStyle:Code
13323 status collapsed
13324
13325 \begin_layout Plain Layout
13326 InsetLayout
13327 \end_layout
13328
13329 \end_inset
13330
13331  tag also serves another function: It can be used to customize the general
13332  layout of many different types of insets.
13333  Currently, 
13334 \begin_inset Flex CharStyle:Code
13335 status collapsed
13336
13337 \begin_layout Plain Layout
13338 InsetLayout
13339 \end_layout
13340
13341 \end_inset
13342
13343  can be used to customize the layout parameters for footnotes, marginal
13344  notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13345  boxes, tables, algorithms, URLs, and optional arguments, as well as to
13346  define Flex insets.
13347 \end_layout
13348
13349 \begin_layout Standard
13350 The 
13351 \begin_inset Flex CharStyle:Code
13352 status collapsed
13353
13354 \begin_layout Plain Layout
13355 InsetLayout
13356 \end_layout
13357
13358 \end_inset
13359
13360  definition must begin with a line of the form:
13361 \end_layout
13362
13363 \begin_layout LyX-Code
13364 InsetLayout <Type>
13365 \end_layout
13366
13367 \begin_layout Standard
13368 Here 
13369 \begin_inset Flex CharStyle:Code
13370 status collapsed
13371
13372 \begin_layout Plain Layout
13373 <Type>
13374 \end_layout
13375
13376 \end_inset
13377
13378  indicates the inset whose layout is being defined, and here there are two
13379  cases.
13380 \end_layout
13381
13382 \begin_layout Enumerate
13383 The layout for a pre-existing inset is being modified.
13384  In this case, can be 
13385 \begin_inset Flex CharStyle:Code
13386 status collapsed
13387
13388 \begin_layout Plain Layout
13389 <Type>
13390 \end_layout
13391
13392 \end_inset
13393
13394  any one of the following: 
13395 \begin_inset Flex CharStyle:Code
13396 status collapsed
13397
13398 \begin_layout Plain Layout
13399 Algorithm
13400 \end_layout
13401
13402 \end_inset
13403
13404
13405 \begin_inset Flex CharStyle:Code
13406 status collapsed
13407
13408 \begin_layout Plain Layout
13409 Branch
13410 \end_layout
13411
13412 \end_inset
13413
13414
13415 \begin_inset Flex CharStyle:Code
13416 status collapsed
13417
13418 \begin_layout Plain Layout
13419 Box
13420 \end_layout
13421
13422 \end_inset
13423
13424
13425 \begin_inset Flex CharStyle:Code
13426 status collapsed
13427
13428 \begin_layout Plain Layout
13429 Box:shaded
13430 \end_layout
13431
13432 \end_inset
13433
13434
13435 \begin_inset Flex CharStyle:Code
13436 status collapsed
13437
13438 \begin_layout Plain Layout
13439 ERT
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 Figure
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 Foot
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 Index
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 Info
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 Info:menu
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 Info:shortcut
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 Info:shortcuts
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 Listings
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 Marginal
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 Note:Comment
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 Note:Note
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 Note:GreyedOut
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 OptArg
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 Table
13580 \end_layout
13581
13582 \end_inset
13583
13584 , or 
13585 \begin_inset Flex CharStyle:Code
13586 status collapsed
13587
13588 \begin_layout Plain Layout
13589 URL
13590 \end_layout
13591
13592 \end_inset
13593
13594 .
13595 \end_layout
13596
13597 \begin_layout Enumerate
13598 The layout for a Flex inset is being defined.
13599  In this case, 
13600 \begin_inset Flex CharStyle:Code
13601 status collapsed
13602
13603 \begin_layout Plain Layout
13604 <Type>
13605 \end_layout
13606
13607 \end_inset
13608
13609  can be any valid identifier not used by a pre-existing inset.
13610  Note that the definition of a flex inset 
13611 \emph on
13612 must 
13613 \emph default
13614 also include a 
13615 \begin_inset Flex CharStyle:Code
13616 status collapsed
13617
13618 \begin_layout Plain Layout
13619 LyXType
13620 \end_layout
13621
13622 \end_inset
13623
13624  entry, declaring which type of inset this is.
13625 \end_layout
13626
13627 \begin_layout Standard
13628 The 
13629 \begin_inset Flex CharStyle:Code
13630 status collapsed
13631
13632 \begin_layout Plain Layout
13633 InsetLayout
13634 \end_layout
13635
13636 \end_inset
13637
13638  definition can contain the following entries:
13639 \end_layout
13640
13641 \begin_layout Description
13642 \begin_inset Flex CharStyle:Code
13643 status collapsed
13644
13645 \begin_layout Plain Layout
13646 BgColor
13647 \end_layout
13648
13649 \end_inset
13650
13651  The color for the inset's background.
13652  The valid colors are defined in 
13653 \begin_inset Flex CharStyle:Code
13654 status collapsed
13655
13656 \begin_layout Plain Layout
13657 src/ColorCode.h
13658 \end_layout
13659
13660 \end_inset
13661
13662 .
13663 \end_layout
13664
13665 \begin_layout Description
13666 \begin_inset Flex CharStyle:Code
13667 status collapsed
13668
13669 \begin_layout Plain Layout
13670 ContentAsLabel
13671 \end_layout
13672
13673 \end_inset
13674
13675  [
13676 \begin_inset Flex CharStyle:Code
13677 status collapsed
13678
13679 \begin_layout Plain Layout
13680
13681 \emph on
13682 0
13683 \end_layout
13684
13685 \end_inset
13686
13687 ,
13688 \begin_inset Flex CharStyle:Code
13689 status collapsed
13690
13691 \begin_layout Plain Layout
13692 1
13693 \end_layout
13694
13695 \end_inset
13696
13697 ] Whether to use the content of the inset as the label, when the inset is
13698  closed.
13699  Default is false.
13700 \end_layout
13701
13702 \begin_layout Description
13703 \begin_inset Flex CharStyle:Code
13704 status collapsed
13705
13706 \begin_layout Plain Layout
13707 CopyStyle
13708 \end_layout
13709
13710 \end_inset
13711
13712  As with paragraph styles (see page 
13713 \begin_inset CommandInset ref
13714 LatexCommand ref
13715 reference "des:CopyStyle"
13716
13717 \end_inset
13718
13719 ).
13720 \end_layout
13721
13722 \begin_layout Description
13723 \begin_inset Flex CharStyle:Code
13724 status collapsed
13725
13726 \begin_layout Plain Layout
13727 CustomPars
13728 \end_layout
13729
13730 \end_inset
13731
13732  [
13733 \begin_inset Flex CharStyle:Code
13734 status collapsed
13735
13736 \begin_layout Plain Layout
13737
13738 \emph on
13739 0
13740 \end_layout
13741
13742 \end_inset
13743
13744 ,
13745 \begin_inset Flex CharStyle:Code
13746 status collapsed
13747
13748 \begin_layout Plain Layout
13749 1
13750 \end_layout
13751
13752 \end_inset
13753
13754 ] Indicates whether the user may employ the Paragraph Settings dialog to
13755  customize the paragraph.
13756 \end_layout
13757
13758 \begin_layout Description
13759 \begin_inset Flex CharStyle:Code
13760 status collapsed
13761
13762 \begin_layout Plain Layout
13763 Decoration
13764 \end_layout
13765
13766 \end_inset
13767
13768  can be 
13769 \begin_inset Flex CharStyle:Code
13770 status collapsed
13771
13772 \begin_layout Plain Layout
13773 Classic
13774 \end_layout
13775
13776 \end_inset
13777
13778
13779 \begin_inset Flex CharStyle:Code
13780 status collapsed
13781
13782 \begin_layout Plain Layout
13783 Minimalistic
13784 \end_layout
13785
13786 \end_inset
13787
13788 , or 
13789 \begin_inset Flex CharStyle:Code
13790 status collapsed
13791
13792 \begin_layout Plain Layout
13793 Conglomerate
13794 \end_layout
13795
13796 \end_inset
13797
13798 , describing the rendering style used for the inset's frame and buttons.
13799  Footnotes generally use 
13800 \begin_inset Flex CharStyle:Code
13801 status collapsed
13802
13803 \begin_layout Plain Layout
13804 Classic
13805 \end_layout
13806
13807 \end_inset
13808
13809 , ERT insets generally 
13810 \begin_inset Flex CharStyle:Code
13811 status collapsed
13812
13813 \begin_layout Plain Layout
13814 Minimalistic
13815 \end_layout
13816
13817 \end_inset
13818
13819 , and character styles 
13820 \begin_inset Flex CharStyle:Code
13821 status collapsed
13822
13823 \begin_layout Plain Layout
13824 Conglomerate
13825 \end_layout
13826
13827 \end_inset
13828
13829 .
13830 \end_layout
13831
13832 \begin_layout Description
13833 \begin_inset Flex CharStyle:Code
13834 status collapsed
13835
13836 \begin_layout Plain Layout
13837 End
13838 \end_layout
13839
13840 \end_inset
13841
13842  Required at the end of the InsetLayout declarations.
13843 \end_layout
13844
13845 \begin_layout Description
13846 \begin_inset Flex CharStyle:Code
13847 status collapsed
13848
13849 \begin_layout Plain Layout
13850 Font
13851 \end_layout
13852
13853 \end_inset
13854
13855  The font used for both the text body 
13856 \emph on
13857 and
13858 \emph default
13859  the label.
13860  See section
13861 \begin_inset space ~
13862 \end_inset
13863
13864
13865 \begin_inset CommandInset ref
13866 LatexCommand ref
13867 reference "sub:Font-description"
13868
13869 \end_inset
13870
13871 .
13872  Note that defining this font automatically defines the 
13873 \begin_inset Flex CharStyle:Code
13874 status collapsed
13875
13876 \begin_layout Plain Layout
13877 LabelFont
13878 \end_layout
13879
13880 \end_inset
13881
13882  to the same value, so define this first and define 
13883 \begin_inset Flex CharStyle:Code
13884 status collapsed
13885
13886 \begin_layout Plain Layout
13887 LabelFont
13888 \end_layout
13889
13890 \end_inset
13891
13892  later if you want them to be different.
13893 \end_layout
13894
13895 \begin_layout Description
13896 \begin_inset Flex CharStyle:Code
13897 status collapsed
13898
13899 \begin_layout Plain Layout
13900 ForceLTR
13901 \end_layout
13902
13903 \end_inset
13904
13905  Force the 
13906 \begin_inset Quotes eld
13907 \end_inset
13908
13909 latex
13910 \begin_inset Quotes erd
13911 \end_inset
13912
13913  language, leading to Left-to-Right (latin) output, e.
13914 \begin_inset space \thinspace{}
13915 \end_inset
13916
13917 g.
13918 \begin_inset space \space{}
13919 \end_inset
13920
13921 in TeX code or URL.
13922  A kludge.
13923 \end_layout
13924
13925 \begin_layout Description
13926 \begin_inset Flex CharStyle:Code
13927 status collapsed
13928
13929 \begin_layout Plain Layout
13930 ForcePlain
13931 \end_layout
13932
13933 \end_inset
13934
13935  [
13936 \begin_inset Flex CharStyle:Code
13937 status collapsed
13938
13939 \begin_layout Plain Layout
13940
13941 \emph on
13942 0
13943 \end_layout
13944
13945 \end_inset
13946
13947 ,
13948 \begin_inset Flex CharStyle:Code
13949 status collapsed
13950
13951 \begin_layout Plain Layout
13952 1
13953 \end_layout
13954
13955 \end_inset
13956
13957 ] Indicates whether the PlainLayout should be used or, instead, the user
13958  can change the paragraph style used in the inset.
13959  Default is false.
13960 \end_layout
13961
13962 \begin_layout Description
13963 \begin_inset Flex CharStyle:Code
13964 status collapsed
13965
13966 \begin_layout Plain Layout
13967 FreeSpacing
13968 \end_layout
13969
13970 \end_inset
13971
13972  As with paragraph styles (see page 
13973 \begin_inset CommandInset ref
13974 LatexCommand pageref
13975 reference "des:FreeSpacing"
13976
13977 \end_inset
13978
13979 ).
13980  Default is false.
13981 \end_layout
13982
13983 \begin_layout Description
13984 \begin_inset Flex CharStyle:Code
13985 status collapsed
13986
13987 \begin_layout Plain Layout
13988 HTML*
13989 \end_layout
13990
13991 \end_inset
13992
13993  These tags control XHTML output.
13994  See 
13995 \end_layout
13996
13997 \begin_layout Description
13998 \begin_inset Flex CharStyle:Code
13999 status collapsed
14000
14001 \begin_layout Plain Layout
14002 InToc
14003 \end_layout
14004
14005 \end_inset
14006
14007  [
14008 \begin_inset Flex CharStyle:Code
14009 status collapsed
14010
14011 \begin_layout Plain Layout
14012
14013 \emph on
14014 0
14015 \end_layout
14016
14017 \end_inset
14018
14019 ,
14020 \begin_inset Flex CharStyle:Code
14021 status collapsed
14022
14023 \begin_layout Plain Layout
14024 1
14025 \end_layout
14026
14027 \end_inset
14028
14029 ] Whether to include the contents of this inset in the strings generated
14030  for the `Outline' pane.
14031  One would not, for example, want the content of a footnote in a section
14032  header to be included in the TOC displayed in the outline, but one would
14033  normally want the content of a character style displayed.
14034  Default is false: not to include.
14035 \end_layout
14036
14037 \begin_layout Description
14038 \begin_inset Flex CharStyle:Code
14039 status collapsed
14040
14041 \begin_layout Plain Layout
14042 KeepEmpty
14043 \end_layout
14044
14045 \end_inset
14046
14047  As with paragraph styles (see page 
14048 \begin_inset CommandInset ref
14049 LatexCommand pageref
14050 reference "des:KeepEmpty"
14051
14052 \end_inset
14053
14054 ).
14055  Default is false.
14056 \end_layout
14057
14058 \begin_layout Description
14059 \begin_inset Flex CharStyle:Code
14060 status collapsed
14061
14062 \begin_layout Plain Layout
14063 LabelFont
14064 \end_layout
14065
14066 \end_inset
14067
14068  The font used for the label.
14069  See section
14070 \begin_inset space ~
14071 \end_inset
14072
14073
14074 \begin_inset CommandInset ref
14075 LatexCommand ref
14076 reference "sub:Font-description"
14077
14078 \end_inset
14079
14080 .
14081  Note that this definition can never appear before 
14082 \begin_inset Flex CharStyle:Code
14083 status collapsed
14084
14085 \begin_layout Plain Layout
14086 Font
14087 \end_layout
14088
14089 \end_inset
14090
14091 , lest it be ineffective.
14092 \end_layout
14093
14094 \begin_layout Description
14095 \begin_inset Flex CharStyle:Code
14096 status collapsed
14097
14098 \begin_layout Plain Layout
14099 LabelString
14100 \end_layout
14101
14102 \end_inset
14103
14104  What will be displayed on the button or elsewhere as the inset label.
14105  Some inset types (TeX code and Branch) modify this label on the fly.
14106 \end_layout
14107
14108 \begin_layout Description
14109 \begin_inset Flex CharStyle:Code
14110 status collapsed
14111
14112 \begin_layout Plain Layout
14113 LatexName
14114 \end_layout
14115
14116 \end_inset
14117
14118  The name of the corresponding LaTeX stuff.
14119  Either the environment or command name.
14120 \end_layout
14121
14122 \begin_layout Description
14123 \begin_inset Flex CharStyle:Code
14124 status collapsed
14125
14126 \begin_layout Plain Layout
14127 LatexParam
14128 \end_layout
14129
14130 \end_inset
14131
14132  The optional parameter for the corresponding 
14133 \begin_inset Flex CharStyle:Code
14134 status collapsed
14135
14136 \begin_layout Plain Layout
14137 LatexName
14138 \end_layout
14139
14140 \end_inset
14141
14142  stuff, including possible bracket pairs like 
14143 \begin_inset Flex CharStyle:Code
14144 status collapsed
14145
14146 \begin_layout Plain Layout
14147 []
14148 \end_layout
14149
14150 \end_inset
14151
14152 .
14153  This parameter cannot be changed from within LyX.
14154 \end_layout
14155
14156 \begin_layout Description
14157 \begin_inset Flex CharStyle:Code
14158 status collapsed
14159
14160 \begin_layout Plain Layout
14161 LatexType
14162 \end_layout
14163
14164 \end_inset
14165
14166  As with paragraph styles (see page 
14167 \begin_inset CommandInset ref
14168 LatexCommand pageref
14169 reference "des:LatexType"
14170
14171 \end_inset
14172
14173 ).
14174 \end_layout
14175
14176 \begin_layout Description
14177 \begin_inset Flex CharStyle:Code
14178 status collapsed
14179
14180 \begin_layout Plain Layout
14181 LyxType
14182 \end_layout
14183
14184 \end_inset
14185
14186  Can be 
14187 \begin_inset Flex CharStyle:Code
14188 status collapsed
14189
14190 \begin_layout Plain Layout
14191 charstyle
14192 \end_layout
14193
14194 \end_inset
14195
14196
14197 \begin_inset Flex CharStyle:Code
14198 status collapsed
14199
14200 \begin_layout Plain Layout
14201 custom
14202 \end_layout
14203
14204 \end_inset
14205
14206
14207 \begin_inset Flex CharStyle:Code
14208 status collapsed
14209
14210 \begin_layout Plain Layout
14211 element
14212 \end_layout
14213
14214 \end_inset
14215
14216 , or 
14217 \begin_inset Flex CharStyle:Code
14218 status collapsed
14219
14220 \begin_layout Plain Layout
14221 end
14222 \end_layout
14223
14224 \end_inset
14225
14226  (indicating a dummy definition ending definitions of charstyles, etc).
14227  This entry is required in and is only meaningful for Flex insets.
14228  Among other things, it determines on which menu this inset will appear.
14229  Setting 
14230 \begin_inset Flex CharStyle:Code
14231 status collapsed
14232
14233 \begin_layout Plain Layout
14234 LyXType
14235 \end_layout
14236
14237 \end_inset
14238
14239  to 
14240 \begin_inset Flex CharStyle:Code
14241 status collapsed
14242
14243 \begin_layout Plain Layout
14244 charstyle
14245 \end_layout
14246
14247 \end_inset
14248
14249  will set 
14250 \begin_inset Flex CharStyle:Code
14251 status collapsed
14252
14253 \begin_layout Plain Layout
14254 MultiPar
14255 \end_layout
14256
14257 \end_inset
14258
14259  to false.
14260  
14261 \begin_inset Flex CharStyle:Code
14262 status collapsed
14263
14264 \begin_layout Plain Layout
14265 MultiPar
14266 \end_layout
14267
14268 \end_inset
14269
14270  can be set to true for charstyle insets, if you wish, by setting it 
14271 \emph on
14272 after
14273 \emph default
14274  you set the 
14275 \begin_inset Flex CharStyle:Code
14276 status collapsed
14277
14278 \begin_layout Plain Layout
14279 LyXType
14280 \end_layout
14281
14282 \end_inset
14283
14284 .
14285 \end_layout
14286
14287 \begin_layout Description
14288 \begin_inset Flex CharStyle:Code
14289 status collapsed
14290
14291 \begin_layout Plain Layout
14292 MultiPar
14293 \end_layout
14294
14295 \end_inset
14296
14297  [
14298 \begin_inset Flex CharStyle:Code
14299 status collapsed
14300
14301 \begin_layout Plain Layout
14302
14303 \emph on
14304 0
14305 \end_layout
14306
14307 \end_inset
14308
14309 ,
14310 \begin_inset Flex CharStyle:Code
14311 status collapsed
14312
14313 \begin_layout Plain Layout
14314 1
14315 \end_layout
14316
14317 \end_inset
14318
14319 ] Whether multiple paragraphs are permitted in this inset.
14320  This will also set 
14321 \begin_inset Flex CharStyle:Code
14322 status collapsed
14323
14324 \begin_layout Plain Layout
14325 CustomPars
14326 \end_layout
14327
14328 \end_inset
14329
14330  to the same value and 
14331 \begin_inset Flex CharStyle:Code
14332 status collapsed
14333
14334 \begin_layout Plain Layout
14335 ForcePlain
14336 \end_layout
14337
14338 \end_inset
14339
14340  to the opposite value.
14341  These can be reset to other values, if they are used 
14342 \emph on
14343 after
14344 \emph default
14345  
14346 \begin_inset Flex CharStyle:Code
14347 status collapsed
14348
14349 \begin_layout Plain Layout
14350 MultiPar
14351 \end_layout
14352
14353 \end_inset
14354
14355 .
14356  Default is true.
14357 \end_layout
14358
14359 \begin_layout Description
14360 \begin_inset Flex CharStyle:Code
14361 status collapsed
14362
14363 \begin_layout Plain Layout
14364 NeedProtect
14365 \end_layout
14366
14367 \end_inset
14368
14369  [
14370 \begin_inset Flex CharStyle:Code
14371 status collapsed
14372
14373 \begin_layout Plain Layout
14374
14375 \emph on
14376 0
14377 \end_layout
14378
14379 \end_inset
14380
14381 ,
14382 \begin_inset Flex CharStyle:Code
14383 status collapsed
14384
14385 \begin_layout Plain Layout
14386 1
14387 \end_layout
14388
14389 \end_inset
14390
14391 ] Whether fragile commands in this layout should be 
14392 \begin_inset Flex CharStyle:Code
14393 status collapsed
14394
14395 \begin_layout Plain Layout
14396
14397 \backslash
14398 protect
14399 \end_layout
14400
14401 \end_inset
14402
14403 'ed.
14404  (Note: This is 
14405 \emph on
14406 not
14407 \emph default
14408  whether the command should itself be protected.) Default is false.
14409 \end_layout
14410
14411 \begin_layout Description
14412 \begin_inset Flex CharStyle:Code
14413 status collapsed
14414
14415 \begin_layout Plain Layout
14416 PassThru
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
14427 \emph on
14428 0
14429 \end_layout
14430
14431 \end_inset
14432
14433 ,
14434 \begin_inset Flex CharStyle:Code
14435 status collapsed
14436
14437 \begin_layout Plain Layout
14438 1
14439 \end_layout
14440
14441 \end_inset
14442
14443 ] As with paragraph styles (see page 
14444 \begin_inset CommandInset ref
14445 LatexCommand pageref
14446 reference "des:PathThru"
14447
14448 \end_inset
14449
14450 ).
14451  Default is false.
14452 \end_layout
14453
14454 \begin_layout Description
14455 \begin_inset Flex CharStyle:Code
14456 status collapsed
14457
14458 \begin_layout Plain Layout
14459 Preamble
14460 \end_layout
14461
14462 \end_inset
14463
14464  As with paragraph styles (see page 
14465 \begin_inset CommandInset ref
14466 LatexCommand pageref
14467 reference "des:Preamble"
14468
14469 \end_inset
14470
14471 ).
14472 \end_layout
14473
14474 \begin_layout Description
14475 \begin_inset Flex CharStyle:Code
14476 status collapsed
14477
14478 \begin_layout Plain Layout
14479 RefPrefix
14480 \end_layout
14481
14482 \end_inset
14483
14484  [
14485 \begin_inset Flex CharStyle:Code
14486 status collapsed
14487
14488 \begin_layout Plain Layout
14489 string
14490 \end_layout
14491
14492 \end_inset
14493
14494 ] The prefix to use when creating labels referring to insets of this type.
14495  This allows the use of formatted references.
14496 \end_layout
14497
14498 \begin_layout Description
14499 \begin_inset Flex CharStyle:Code
14500 status collapsed
14501
14502 \begin_layout Plain Layout
14503 Requires
14504 \end_layout
14505
14506 \end_inset
14507
14508  [
14509 \begin_inset Flex CharStyle:Code
14510 status collapsed
14511
14512 \begin_layout Plain Layout
14513 string
14514 \end_layout
14515
14516 \end_inset
14517
14518 ] As with paragraph styles (see page 
14519 \begin_inset CommandInset ref
14520 LatexCommand pageref
14521 reference "des:Requires"
14522
14523 \end_inset
14524
14525 ).
14526 \end_layout
14527
14528 \begin_layout Description
14529 \begin_inset Flex CharStyle:Code
14530 status collapsed
14531
14532 \begin_layout Plain Layout
14533 Spellcheck
14534 \end_layout
14535
14536 \end_inset
14537
14538  [
14539 \begin_inset Flex CharStyle:Code
14540 status collapsed
14541
14542 \begin_layout Plain Layout
14543 0
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
14554 \emph on
14555 1
14556 \end_layout
14557
14558 \end_inset
14559
14560 ] Spellcheck the contents of this inset.
14561  Default is true.
14562 \end_layout
14563
14564 \begin_layout Subsection
14565 Counters
14566 \begin_inset CommandInset label
14567 LatexCommand label
14568 name "sub:Counters"
14569
14570 \end_inset
14571
14572
14573 \end_layout
14574
14575 \begin_layout Standard
14576 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14577  counters (
14578 \begin_inset Flex CharStyle:MenuItem
14579 status collapsed
14580
14581 \begin_layout Plain Layout
14582 chapter
14583 \end_layout
14584
14585 \end_inset
14586
14587
14588 \begin_inset Flex CharStyle:MenuItem
14589 status collapsed
14590
14591 \begin_layout Plain Layout
14592 figure
14593 \end_layout
14594
14595 \end_inset
14596
14597 , \SpecialChar \ldots{}
14598 ) in the text class itself.
14599  The standard counters are defined in the file 
14600 \begin_inset Flex CharStyle:Code
14601 status collapsed
14602
14603 \begin_layout Plain Layout
14604 stdcounters.inc
14605 \end_layout
14606
14607 \end_inset
14608
14609 , so you may have to do no more than add
14610 \end_layout
14611
14612 \begin_layout LyX-Code
14613 Input stdcounters.inc
14614 \end_layout
14615
14616 \begin_layout Standard
14617 to your layout file to get them to work.
14618  But if you want to define custom counters, then you can do so.
14619  The counter declaration must begin with:
14620 \end_layout
14621
14622 \begin_layout LyX-Code
14623 Counter CounterName
14624 \end_layout
14625
14626 \begin_layout Standard
14627 where of course `
14628 \begin_inset Flex CharStyle:Code
14629 status collapsed
14630
14631 \begin_layout Plain Layout
14632 CounterName
14633 \end_layout
14634
14635 \end_inset
14636
14637 ' is replaced by the name of the counter.
14638  And it must end with 
14639 \begin_inset Quotes eld
14640 \end_inset
14641
14642
14643 \begin_inset Flex CharStyle:Code
14644 status collapsed
14645
14646 \begin_layout Plain Layout
14647 End
14648 \end_layout
14649
14650 \end_inset
14651
14652
14653 \begin_inset Quotes erd
14654 \end_inset
14655
14656 .
14657  The following parameters can also be used:
14658 \end_layout
14659
14660 \begin_layout Description
14661 \begin_inset Flex CharStyle:Code
14662 status collapsed
14663
14664 \begin_layout Plain Layout
14665 LabelString
14666 \end_layout
14667
14668 \end_inset
14669
14670  [
14671 \begin_inset Flex CharStyle:Code
14672 status collapsed
14673
14674 \begin_layout Plain Layout
14675 string
14676 \end_layout
14677
14678 \end_inset
14679
14680 =
14681 \begin_inset Quotes erd
14682 \end_inset
14683
14684
14685 \begin_inset Quotes erd
14686 \end_inset
14687
14688 ] When defined, this string defines how the counter is displayed.
14689  Setting this value sets 
14690 \begin_inset Flex CharStyle:Code
14691 status collapsed
14692
14693 \begin_layout Plain Layout
14694 LabelStringAppendix
14695 \end_layout
14696
14697 \end_inset
14698
14699  to the same value.
14700  The following special constructs can be used in the string:
14701 \end_layout
14702
14703 \begin_deeper
14704 \begin_layout Itemize
14705 \begin_inset Flex CharStyle:Code
14706 status collapsed
14707
14708 \begin_layout Plain Layout
14709
14710 \backslash
14711 thecounter
14712 \end_layout
14713
14714 \end_inset
14715
14716  will be replaced by the expansion of the 
14717 \begin_inset Flex CharStyle:Code
14718 status collapsed
14719
14720 \begin_layout Plain Layout
14721 LabelString
14722 \end_layout
14723
14724 \end_inset
14725
14726  (or 
14727 \begin_inset Flex CharStyle:Code
14728 status collapsed
14729
14730 \begin_layout Plain Layout
14731 LabelStringAppendix
14732 \end_layout
14733
14734 \end_inset
14735
14736 ) of the counter 
14737 \begin_inset Flex CharStyle:Code
14738 status collapsed
14739
14740 \begin_layout Plain Layout
14741 counter
14742 \end_layout
14743
14744 \end_inset
14745
14746 .
14747  
14748 \end_layout
14749
14750 \begin_layout Itemize
14751 counter values can be expressed using LaTeX-like macros 
14752 \begin_inset Flex CharStyle:Code
14753 status collapsed
14754
14755 \begin_layout Plain Layout
14756
14757 \backslash
14758
14759 \emph on
14760 numbertype
14761 \emph default
14762 {
14763 \emph on
14764 counter
14765 \emph default
14766 }
14767 \end_layout
14768
14769 \end_inset
14770
14771 , where 
14772 \begin_inset Flex CharStyle:Code
14773 status collapsed
14774
14775 \begin_layout Plain Layout
14776
14777 \emph on
14778 numbertype
14779 \end_layout
14780
14781 \end_inset
14782
14783  can be:
14784 \begin_inset Foot
14785 status collapsed
14786
14787 \begin_layout Plain Layout
14788
14789 \family roman
14790 \series medium
14791 \shape up
14792 \size normal
14793 \emph off
14794 \bar no
14795 \noun off
14796 \color none
14797 Actually, the situation is a bit more complicated: any
14798 \family default
14799 \series default
14800 \shape default
14801 \emph default
14802 \bar default
14803  
14804 \size default
14805 \emph on
14806 \noun default
14807 \color inherit
14808 numbertype
14809 \family roman
14810 \series medium
14811 \shape up
14812 \size normal
14813 \emph off
14814 \bar no
14815 \noun off
14816  other than those described below will produce arabic numerals.
14817  It would not be surprising to see this change in the future.
14818 \end_layout
14819
14820 \end_inset
14821
14822  
14823 \begin_inset Flex CharStyle:Code
14824 status collapsed
14825
14826 \begin_layout Plain Layout
14827 arabic
14828 \end_layout
14829
14830 \end_inset
14831
14832 : 1, 2, 3,\SpecialChar \ldots{}
14833
14834 \begin_inset Flex CharStyle:Code
14835 status collapsed
14836
14837 \begin_layout Plain Layout
14838 alph
14839 \end_layout
14840
14841 \end_inset
14842
14843  for lower-case letters: a, b, c, \SpecialChar \ldots{}
14844
14845 \begin_inset Flex CharStyle:Code
14846 status collapsed
14847
14848 \begin_layout Plain Layout
14849 Alph
14850 \end_layout
14851
14852 \end_inset
14853
14854  for upper-case letters: A, B, C, \SpecialChar \ldots{}
14855
14856 \begin_inset Flex CharStyle:Code
14857 status collapsed
14858
14859 \begin_layout Plain Layout
14860 roman
14861 \end_layout
14862
14863 \end_inset
14864
14865  for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
14866
14867 \begin_inset Flex CharStyle:Code
14868 status collapsed
14869
14870 \begin_layout Plain Layout
14871 Roman
14872 \end_layout
14873
14874 \end_inset
14875
14876  for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
14877
14878 \begin_inset Flex CharStyle:Code
14879 status collapsed
14880
14881 \begin_layout Plain Layout
14882 hebrew
14883 \end_layout
14884
14885 \end_inset
14886
14887  for hebrew numerals.
14888 \end_layout
14889
14890 \end_deeper
14891 \begin_layout Standard
14892 If LabelString is not defined, a default value is constructed as follows:
14893  if the counter has a master counter 
14894 \begin_inset Flex CharStyle:Code
14895 status collapsed
14896
14897 \begin_layout Plain Layout
14898 master
14899 \end_layout
14900
14901 \end_inset
14902
14903  (defined via 
14904 \begin_inset Flex CharStyle:Code
14905 status collapsed
14906
14907 \begin_layout Plain Layout
14908 Within
14909 \end_layout
14910
14911 \end_inset
14912
14913 ), the string 
14914 \begin_inset Flex CharStyle:Code
14915 status collapsed
14916
14917 \begin_layout Plain Layout
14918
14919 \backslash
14920 themaster.
14921 \backslash
14922 arabic{counter}
14923 \end_layout
14924
14925 \end_inset
14926
14927  is used; otherwise the string 
14928 \begin_inset Flex CharStyle:Code
14929 status collapsed
14930
14931 \begin_layout Plain Layout
14932
14933 \backslash
14934 arabic{counter}
14935 \end_layout
14936
14937 \end_inset
14938
14939  is used.
14940 \end_layout
14941
14942 \begin_layout Description
14943 \begin_inset Flex CharStyle:Code
14944 status collapsed
14945
14946 \begin_layout Plain Layout
14947 LabelStringAppendix
14948 \end_layout
14949
14950 \end_inset
14951
14952  [
14953 \begin_inset Flex CharStyle:Code
14954 status collapsed
14955
14956 \begin_layout Plain Layout
14957 string
14958 \end_layout
14959
14960 \end_inset
14961
14962 =
14963 \begin_inset Quotes erd
14964 \end_inset
14965
14966
14967 \begin_inset Quotes erd
14968 \end_inset
14969
14970 ] Same as 
14971 \begin_inset Flex CharStyle:Code
14972 status collapsed
14973
14974 \begin_layout Plain Layout
14975 LabelString
14976 \end_layout
14977
14978 \end_inset
14979
14980 , but for use in the Appendix.
14981 \end_layout
14982
14983 \begin_layout Description
14984 \begin_inset Flex CharStyle:Code
14985 status collapsed
14986
14987 \begin_layout Plain Layout
14988 PrettyFormat
14989 \end_layout
14990
14991 \end_inset
14992
14993  [
14994 \begin_inset Flex CharStyle:Code
14995 status collapsed
14996
14997 \begin_layout Plain Layout
14998 string
14999 \end_layout
15000
15001 \end_inset
15002
15003 =
15004 \begin_inset Quotes erd
15005 \end_inset
15006
15007
15008 \begin_inset Quotes erd
15009 \end_inset
15010
15011 ] A format for use with formatted references to this counter.
15012  For example, one might want to have references to section numbers appear
15013  as 
15014 \begin_inset Quotes eld
15015 \end_inset
15016
15017 Section 2.4
15018 \begin_inset Quotes erd
15019 \end_inset
15020
15021 .
15022  The string should contain 
15023 \begin_inset Quotes eld
15024 \end_inset
15025
15026 ##
15027 \begin_inset Quotes erd
15028 \end_inset
15029
15030 .
15031  This will be replaced by the counter number itself.
15032  So, for sections, it would be: Section ##.
15033 \end_layout
15034
15035 \begin_layout Description
15036 \begin_inset Flex CharStyle:Code
15037 status collapsed
15038
15039 \begin_layout Plain Layout
15040 Within
15041 \end_layout
15042
15043 \end_inset
15044
15045  [
15046 \begin_inset Flex CharStyle:Code
15047 status collapsed
15048
15049 \begin_layout Plain Layout
15050 string
15051 \end_layout
15052
15053 \end_inset
15054
15055 =
15056 \begin_inset Quotes erd
15057 \end_inset
15058
15059
15060 \begin_inset Quotes erd
15061 \end_inset
15062
15063 ] If this is set to the name of another counter, the present counter will
15064  be reset every time the other one is increased.
15065  For example, 
15066 \begin_inset Flex CharStyle:Code
15067 status collapsed
15068
15069 \begin_layout Plain Layout
15070 subsection
15071 \end_layout
15072
15073 \end_inset
15074
15075  is numbered inside 
15076 \begin_inset Flex CharStyle:Code
15077 status collapsed
15078
15079 \begin_layout Plain Layout
15080 section
15081 \end_layout
15082
15083 \end_inset
15084
15085 .
15086 \end_layout
15087
15088 \begin_layout Subsection
15089 Font description
15090 \begin_inset CommandInset label
15091 LatexCommand label
15092 name "sub:Font-description"
15093
15094 \end_inset
15095
15096
15097 \end_layout
15098
15099 \begin_layout Standard
15100 A font description looks like this:
15101 \end_layout
15102
15103 \begin_layout LyX-Code
15104 Font 
15105 \family roman
15106 \emph on
15107 or
15108 \family default
15109 \emph default
15110  LabelFont
15111 \end_layout
15112
15113 \begin_layout LyX-Code
15114  ...
15115 \end_layout
15116
15117 \begin_layout LyX-Code
15118 EndFont
15119 \end_layout
15120
15121 \begin_layout Standard
15122 The following commands are available:
15123 \end_layout
15124
15125 \begin_layout Description
15126 \begin_inset Flex CharStyle:Code
15127 status collapsed
15128
15129 \begin_layout Plain Layout
15130 Color
15131 \end_layout
15132
15133 \end_inset
15134
15135  [
15136 \begin_inset Flex CharStyle:Code
15137 status collapsed
15138
15139 \begin_layout Plain Layout
15140
15141 \emph on
15142 none
15143 \end_layout
15144
15145 \end_inset
15146
15147
15148 \begin_inset Flex CharStyle:Code
15149 status collapsed
15150
15151 \begin_layout Plain Layout
15152 black
15153 \end_layout
15154
15155 \end_inset
15156
15157
15158 \begin_inset Flex CharStyle:Code
15159 status collapsed
15160
15161 \begin_layout Plain Layout
15162 white
15163 \end_layout
15164
15165 \end_inset
15166
15167
15168 \begin_inset Flex CharStyle:Code
15169 status collapsed
15170
15171 \begin_layout Plain Layout
15172 red
15173 \end_layout
15174
15175 \end_inset
15176
15177
15178 \begin_inset Flex CharStyle:Code
15179 status collapsed
15180
15181 \begin_layout Plain Layout
15182 green
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 blue
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 cyan
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 magenta
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 yellow
15223 \end_layout
15224
15225 \end_inset
15226
15227 ]
15228 \end_layout
15229
15230 \begin_layout Description
15231 \begin_inset Flex CharStyle:Code
15232 status collapsed
15233
15234 \begin_layout Plain Layout
15235 Family
15236 \end_layout
15237
15238 \end_inset
15239
15240  [
15241 \begin_inset Flex CharStyle:Code
15242 status collapsed
15243
15244 \begin_layout Plain Layout
15245
15246 \emph on
15247 Roman
15248 \end_layout
15249
15250 \end_inset
15251
15252
15253 \begin_inset Flex CharStyle:Code
15254 status collapsed
15255
15256 \begin_layout Plain Layout
15257 Sans
15258 \end_layout
15259
15260 \end_inset
15261
15262
15263 \begin_inset Flex CharStyle:Code
15264 status collapsed
15265
15266 \begin_layout Plain Layout
15267 Typewriter
15268 \end_layout
15269
15270 \end_inset
15271
15272
15273 \end_layout
15274
15275 \begin_layout Description
15276 \begin_inset Flex CharStyle:Code
15277 status collapsed
15278
15279 \begin_layout Plain Layout
15280 Misc
15281 \end_layout
15282
15283 \end_inset
15284
15285  [
15286 \begin_inset Flex CharStyle:Code
15287 status collapsed
15288
15289 \begin_layout Plain Layout
15290 string
15291 \end_layout
15292
15293 \end_inset
15294
15295 ] Valid arguments are: 
15296 \begin_inset Flex CharStyle:Code
15297 status collapsed
15298
15299 \begin_layout Plain Layout
15300 emph
15301 \end_layout
15302
15303 \end_inset
15304
15305
15306 \begin_inset Flex CharStyle:Code
15307 status collapsed
15308
15309 \begin_layout Plain Layout
15310 noun
15311 \end_layout
15312
15313 \end_inset
15314
15315
15316 \begin_inset Flex CharStyle:Code
15317 status collapsed
15318
15319 \begin_layout Plain Layout
15320 underbar
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 no_emph
15331 \end_layout
15332
15333 \end_inset
15334
15335
15336 \begin_inset Flex CharStyle:Code
15337 status collapsed
15338
15339 \begin_layout Plain Layout
15340 no_noun
15341 \end_layout
15342
15343 \end_inset
15344
15345  and 
15346 \begin_inset Flex CharStyle:Code
15347 status collapsed
15348
15349 \begin_layout Plain Layout
15350 no_bar
15351 \end_layout
15352
15353 \end_inset
15354
15355 .
15356  Each of these turns on or off the corresponding attribute.
15357  For example, 
15358 \begin_inset Flex CharStyle:Code
15359 status collapsed
15360
15361 \begin_layout Plain Layout
15362 emph
15363 \end_layout
15364
15365 \end_inset
15366
15367  turns on emphasis, and 
15368 \begin_inset Flex CharStyle:Code
15369 status collapsed
15370
15371 \begin_layout Plain Layout
15372 no_emph
15373 \end_layout
15374
15375 \end_inset
15376
15377  turns it off.
15378  
15379 \begin_inset Newline newline
15380 \end_inset
15381
15382 If the latter seems puzzling, remember that the font settings for the present
15383  context are generally inherited from the surrounding context.
15384  So 
15385 \begin_inset Flex CharStyle:Code
15386 status collapsed
15387
15388 \begin_layout Plain Layout
15389 no_emph
15390 \end_layout
15391
15392 \end_inset
15393
15394  would turn off the emphasis that was anyway in effect, say, in a theorem
15395  environment.
15396 \end_layout
15397
15398 \begin_layout Description
15399 \begin_inset Flex CharStyle:Code
15400 status collapsed
15401
15402 \begin_layout Plain Layout
15403 Series
15404 \end_layout
15405
15406 \end_inset
15407
15408  [
15409 \begin_inset Flex CharStyle:Code
15410 status collapsed
15411
15412 \begin_layout Plain Layout
15413
15414 \emph on
15415 Medium
15416 \end_layout
15417
15418 \end_inset
15419
15420
15421 \begin_inset Flex CharStyle:Code
15422 status collapsed
15423
15424 \begin_layout Plain Layout
15425 Bold
15426 \end_layout
15427
15428 \end_inset
15429
15430
15431 \end_layout
15432
15433 \begin_layout Description
15434 \begin_inset Flex CharStyle:Code
15435 status collapsed
15436
15437 \begin_layout Plain Layout
15438 Shape
15439 \end_layout
15440
15441 \end_inset
15442
15443  [
15444 \begin_inset Flex CharStyle:Code
15445 status collapsed
15446
15447 \begin_layout Plain Layout
15448
15449 \emph on
15450 Up
15451 \end_layout
15452
15453 \end_inset
15454
15455
15456 \begin_inset Flex CharStyle:Code
15457 status collapsed
15458
15459 \begin_layout Plain Layout
15460 Italic
15461 \end_layout
15462
15463 \end_inset
15464
15465
15466 \begin_inset Flex CharStyle:Code
15467 status collapsed
15468
15469 \begin_layout Plain Layout
15470 SmallCaps
15471 \end_layout
15472
15473 \end_inset
15474
15475
15476 \begin_inset Flex CharStyle:Code
15477 status collapsed
15478
15479 \begin_layout Plain Layout
15480 Slanted
15481 \end_layout
15482
15483 \end_inset
15484
15485
15486 \end_layout
15487
15488 \begin_layout Description
15489 \begin_inset Flex CharStyle:Code
15490 status collapsed
15491
15492 \begin_layout Plain Layout
15493 Size
15494 \end_layout
15495
15496 \end_inset
15497
15498  [
15499 \begin_inset Flex CharStyle:Code
15500 status collapsed
15501
15502 \begin_layout Plain Layout
15503 tiny
15504 \end_layout
15505
15506 \end_inset
15507
15508
15509 \begin_inset Flex CharStyle:Code
15510 status collapsed
15511
15512 \begin_layout Plain Layout
15513 small
15514 \end_layout
15515
15516 \end_inset
15517
15518
15519 \begin_inset Flex CharStyle:Code
15520 status collapsed
15521
15522 \begin_layout Plain Layout
15523
15524 \emph on
15525 normal
15526 \end_layout
15527
15528 \end_inset
15529
15530
15531 \begin_inset Flex CharStyle:Code
15532 status collapsed
15533
15534 \begin_layout Plain Layout
15535 large
15536 \end_layout
15537
15538 \end_inset
15539
15540
15541 \begin_inset Flex CharStyle:Code
15542 status collapsed
15543
15544 \begin_layout Plain Layout
15545 larger
15546 \end_layout
15547
15548 \end_inset
15549
15550
15551 \begin_inset Flex CharStyle:Code
15552 status collapsed
15553
15554 \begin_layout Plain Layout
15555 largest
15556 \end_layout
15557
15558 \end_inset
15559
15560
15561 \begin_inset Flex CharStyle:Code
15562 status collapsed
15563
15564 \begin_layout Plain Layout
15565 huge
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 giant
15576 \end_layout
15577
15578 \end_inset
15579
15580 ]
15581 \end_layout
15582
15583 \begin_layout Subsection
15584 \begin_inset CommandInset label
15585 LatexCommand label
15586 name "sub:Citation-format-description"
15587
15588 \end_inset
15589
15590 Citation format description
15591 \end_layout
15592
15593 \begin_layout Standard
15594 The 
15595 \begin_inset Flex CharStyle:Code
15596 status collapsed
15597
15598 \begin_layout Plain Layout
15599 CiteFormat
15600 \end_layout
15601
15602 \end_inset
15603
15604  blocks are used to describe how bibliographic information should be displayed,
15605  both within LyX itself (in the citation dialog and in tooltips, for example)
15606  and in XHTML output.
15607  Such a block might look like this:
15608 \end_layout
15609
15610 \begin_layout LyX-Code
15611 CiteFormat
15612 \end_layout
15613
15614 \begin_layout LyX-Code
15615  article ...
15616 \end_layout
15617
15618 \begin_layout LyX-Code
15619  book ...
15620 \end_layout
15621
15622 \begin_layout LyX-Code
15623 End
15624 \end_layout
15625
15626 \begin_layout Standard
15627 The individual lines define how the bibliographic information associated
15628  with an article or book, respectively, is to be displayed, and such a definitio
15629 n can be given for any `entry type' that might be present in a BibTeX file.
15630  LyX defines a default format in the source code that will be used if no
15631  specific definition has been given.
15632  LyX predefines several formats in the file 
15633 \begin_inset Flex CharStyle:Code
15634 status collapsed
15635
15636 \begin_layout Plain Layout
15637 stdciteformats.inc
15638 \end_layout
15639
15640 \end_inset
15641
15642 , which is included in most of LyX's document classes.
15643 \end_layout
15644
15645 \begin_layout Standard
15646 The definitions use a simple language that allows BibTeX keys to be replaced
15647  with their values.
15648  Keys should be enclosed in % signs, e.g.: 
15649 \begin_inset Flex CharStyle:Code
15650 status collapsed
15651
15652 \begin_layout Plain Layout
15653 %author%
15654 \end_layout
15655
15656 \end_inset
15657
15658 .
15659  So a simple definition might look like this:
15660 \end_layout
15661
15662 \begin_layout LyX-Code
15663 misc %author%, 
15664 \begin_inset Quotes eld
15665 \end_inset
15666
15667 %title
15668 \begin_inset Quotes erd
15669 \end_inset
15670
15671 .
15672 \end_layout
15673
15674 \begin_layout Standard
15675 This would print the author, followed by a comma, followed by the title,
15676  in quotes, followed by a period.
15677 \end_layout
15678
15679 \begin_layout Standard
15680 Of course, sometimes you may want to print a key only if it exists.
15681  This can be done by using a conditional construction, such as: 
15682 \begin_inset Flex CharStyle:Code
15683 status collapsed
15684
15685 \begin_layout Plain Layout
15686 {%volume%[[vol.
15687 \begin_inset space ~
15688 \end_inset
15689
15690 %volume%]]}
15691 \end_layout
15692
15693 \end_inset
15694
15695 .
15696  This says: If the 
15697 \begin_inset Flex CharStyle:Code
15698 status collapsed
15699
15700 \begin_layout Plain Layout
15701 volume
15702 \end_layout
15703
15704 \end_inset
15705
15706  key exists, then print 
15707 \begin_inset Quotes eld
15708 \end_inset
15709
15710 vol.
15711 \begin_inset space ~
15712 \end_inset
15713
15714
15715 \begin_inset Quotes erd
15716 \end_inset
15717
15718  followed by the volume key.
15719  It is also possible to have an else clause in the conditional, such as:
15720  
15721 \begin_inset Flex CharStyle:Code
15722 status collapsed
15723
15724 \begin_layout Plain Layout
15725 {%author%[[%author%]][[%editor%, ed.]]}
15726 \end_layout
15727
15728 \end_inset
15729
15730 .
15731  Here, the 
15732 \begin_inset Flex CharStyle:Code
15733 status collapsed
15734
15735 \begin_layout Plain Layout
15736 author
15737 \end_layout
15738
15739 \end_inset
15740
15741  key is printed if it exists; otherwise, the editor key is printed, followed
15742  by 
15743 \begin_inset Quotes eld
15744 \end_inset
15745
15746 ,
15747 \begin_inset space ~
15748 \end_inset
15749
15750 ed.
15751 \begin_inset Quotes erd
15752 \end_inset
15753
15754  Note that the key is again enclosed in % signs; the entire conditional
15755  is enclosed in braces; and the if and else clauses are enclosed in double
15756  brackets, 
15757 \begin_inset Quotes eld
15758 \end_inset
15759
15760 [[
15761 \begin_inset Quotes eld
15762 \end_inset
15763
15764  and 
15765 \begin_inset Quotes eld
15766 \end_inset
15767
15768 ]]
15769 \begin_inset Quotes erd
15770 \end_inset
15771
15772 .
15773  There must be no space between any of these.
15774 \end_layout
15775
15776 \begin_layout Standard
15777 There is one other piece of syntax available in definitions, which looks
15778  like this: 
15779 \begin_inset Flex CharStyle:Code
15780 status collapsed
15781
15782 \begin_layout Plain Layout
15783 {!<i>!}
15784 \end_layout
15785
15786 \end_inset
15787
15788 .
15789  This defines a piece of formatting information that is to be used when
15790  creating 
15791 \begin_inset Quotes eld
15792 \end_inset
15793
15794 rich text
15795 \begin_inset Quotes erd
15796 \end_inset
15797
15798 .
15799  Obviously, we do not want to output HTML tags when writing plain text,
15800  so they should be wrapped in 
15801 \begin_inset Quotes eld
15802 \end_inset
15803
15804 {!
15805 \begin_inset Quotes erd
15806 \end_inset
15807
15808  and 
15809 \begin_inset Quotes eld
15810 \end_inset
15811
15812 !}
15813 \begin_inset Quotes erd
15814 \end_inset
15815
15816 .
15817 \end_layout
15818
15819 \begin_layout Standard
15820 Two special sorts of definitions are also possible in a 
15821 \begin_inset Flex CharStyle:Code
15822 status collapsed
15823
15824 \begin_layout Plain Layout
15825 CiteFormat
15826 \end_layout
15827
15828 \end_inset
15829
15830  block.
15831  An example of the first would be:
15832 \end_layout
15833
15834 \begin_layout LyX-Code
15835 !quotetitle 
15836 \begin_inset Quotes eld
15837 \end_inset
15838
15839 %title%
15840 \begin_inset Quotes erd
15841 \end_inset
15842
15843
15844 \end_layout
15845
15846 \begin_layout Standard
15847 This is an abbreviation, or macro, and it can be used by treating it as
15848  if it were a key: 
15849 \begin_inset Flex CharStyle:Code
15850 status collapsed
15851
15852 \begin_layout Plain Layout
15853 %!quotetitle%
15854 \end_layout
15855
15856 \end_inset
15857
15858 .
15859  LyX will treat 
15860 \begin_inset Flex CharStyle:Code
15861 status collapsed
15862
15863 \begin_layout Plain Layout
15864 %!quotetitle%
15865 \end_layout
15866
15867 \end_inset
15868
15869  exactly as it would treat its definition.
15870  So, let us issue the obvious 
15871 \emph on
15872 warning
15873 \emph default
15874 .
15875  Do not do this:
15876 \end_layout
15877
15878 \begin_layout LyX-Code
15879 !funfun %funfun%
15880 \end_layout
15881
15882 \begin_layout Standard
15883 or anything like it.
15884  LyX shouldn't go into an infinite loop, but it may go into a long one before
15885  it gives up.
15886 \end_layout
15887
15888 \begin_layout Standard
15889 The second sort of special definition might look like this:
15890 \end_layout
15891
15892 \begin_layout LyX-Code
15893 _pptext pp.
15894 \end_layout
15895
15896 \begin_layout Standard
15897 This defines a translatable piece of text, which allows relevant parts of
15898  the bibliography to be translated.
15899  It can be included in a definition by treating it as a key: 
15900 \begin_inset Flex CharStyle:Code
15901 status collapsed
15902
15903 \begin_layout Plain Layout
15904 %_pptext%
15905 \end_layout
15906
15907 \end_inset
15908
15909 .
15910  Several of these are predefined in 
15911 \begin_inset Flex CharStyle:Code
15912 status collapsed
15913
15914 \begin_layout Plain Layout
15915 stdciteformats.inc
15916 \end_layout
15917
15918 \end_inset
15919
15920 .
15921  Note that these are not macros, in the sense just defined.
15922  They will not be expanded.
15923 \end_layout
15924
15925 \begin_layout Standard
15926 So here then is an example that use all these features:
15927 \end_layout
15928
15929 \begin_layout LyX-Code
15930 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
15931 \end_layout
15932
15933 \begin_layout Standard
15934 The defines a macro that prints the author, followed by a comma, if the
15935  
15936 \begin_inset Flex CharStyle:Code
15937 status collapsed
15938
15939 \begin_layout Plain Layout
15940 author
15941 \end_layout
15942
15943 \end_inset
15944
15945  key is defined, or else prints the name of the editor, followed by the
15946  
15947 \begin_inset Flex CharStyle:Code
15948 status collapsed
15949
15950 \begin_layout Plain Layout
15951 _edtext
15952 \end_layout
15953
15954 \end_inset
15955
15956  or its translation (it is by default 
15957 \begin_inset Quotes eld
15958 \end_inset
15959
15960 ed.
15961 \begin_inset Quotes erd
15962 \end_inset
15963
15964 ), if the 
15965 \begin_inset Flex CharStyle:Code
15966 status collapsed
15967
15968 \begin_layout Plain Layout
15969 editor
15970 \end_layout
15971
15972 \end_inset
15973
15974  key is defined.
15975  Note that this is in fact defined in 
15976 \begin_inset Flex CharStyle:Code
15977 status collapsed
15978
15979 \begin_layout Plain Layout
15980 stdciteformats.inc
15981 \end_layout
15982
15983 \end_inset
15984
15985 , so you can use it in your own definitions, or re-definitions, if you load
15986  that file first.
15987 \end_layout
15988
15989 \begin_layout Section
15990 \begin_inset CommandInset label
15991 LatexCommand label
15992 name "sec:Tags-for-XHTML"
15993
15994 \end_inset
15995
15996 Tags for XHTML output
15997 \end_layout
15998
15999 \begin_layout Standard
16000 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16001  by layout information.
16002  In general, LyX provides sensible defaults and, as mentioned earlier, it
16003  will even construct default CSS style rules from the other layout tags.
16004  For example, LyX will attempt to use the information provided in the 
16005 \begin_inset Flex CharStyle:Code
16006 status collapsed
16007
16008 \begin_layout Plain Layout
16009 Font
16010 \end_layout
16011
16012 \end_inset
16013
16014  declaration for the Chapter style to write CSS that will appropriately
16015  format chapter headings.
16016 \end_layout
16017
16018 \begin_layout Standard
16019 In many cases, then, you may not have to do anything at all to get acceptable
16020  XHTML output for your own environments, custom insets, and so forth.
16021  But in some cases you will, and so LyX provides a number of layout tags
16022  that can be used to customize the XHTML and CSS that are generated.
16023 \end_layout
16024
16025 \begin_layout Standard
16026 Note that there are two tags, 
16027 \begin_inset Flex CharStyle:Code
16028 status collapsed
16029
16030 \begin_layout Plain Layout
16031 HTMLPreamble
16032 \end_layout
16033
16034 \end_inset
16035
16036  and 
16037 \begin_inset Flex CharStyle:Code
16038 status collapsed
16039
16040 \begin_layout Plain Layout
16041 AddToHTMLPreamble
16042 \end_layout
16043
16044 \end_inset
16045
16046  that may appear outside style and inset declarations.
16047  See 
16048 \begin_inset CommandInset ref
16049 LatexCommand prettyref
16050 reference "sub:General-text-class"
16051
16052 \end_inset
16053
16054  for details on these.
16055 \end_layout
16056
16057 \begin_layout Subsection
16058 \begin_inset CommandInset label
16059 LatexCommand label
16060 name "sub:Paragraph-Style-XHTML"
16061
16062 \end_inset
16063
16064 Paragraph styles
16065 \end_layout
16066
16067 \begin_layout Standard
16068 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16069  dealing with a normal paragraph, a command, or an environment, where this
16070  is itself determined by the contents of the corresponding 
16071 \begin_inset Flex CharStyle:Code
16072 status collapsed
16073
16074 \begin_layout Plain Layout
16075 LaTeXType
16076 \end_layout
16077
16078 \end_inset
16079
16080  tag.
16081  
16082 \end_layout
16083
16084 \begin_layout Standard
16085 For a command or normal paragraph, the output XHTML has the following form:
16086 \end_layout
16087
16088 \begin_layout LyX-Code
16089 <tag attr=
16090 \begin_inset Quotes erd
16091 \end_inset
16092
16093 value
16094 \begin_inset Quotes erd
16095 \end_inset
16096
16097 >
16098 \end_layout
16099
16100 \begin_layout LyX-Code
16101 <labeltag attr=
16102 \begin_inset Quotes erd
16103 \end_inset
16104
16105 value
16106 \begin_inset Quotes erd
16107 \end_inset
16108
16109 >Label</labeltag>
16110 \end_layout
16111
16112 \begin_layout LyX-Code
16113 Contents of the paragraph.
16114 \end_layout
16115
16116 \begin_layout LyX-Code
16117 </tag>
16118 \end_layout
16119
16120 \begin_layout Standard
16121 The label tags are of course omitted if the paragraph does not have a label.
16122 \end_layout
16123
16124 \begin_layout Standard
16125 For an environment that is not some sort of list, the XHTML takes this 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 <itemtag attr=
16142 \begin_inset Quotes erd
16143 \end_inset
16144
16145 value
16146 \begin_inset Quotes erd
16147 \end_inset
16148
16149 ><labeltag attr=
16150 \begin_inset Quotes erd
16151 \end_inset
16152
16153 value
16154 \begin_inset Quotes erd
16155 \end_inset
16156
16157 >Environment Label</labeltag>First paragraph.</itemtag>
16158 \end_layout
16159
16160 \begin_layout LyX-Code
16161 <itemtag>Second paragraph.</itemtag>
16162 \end_layout
16163
16164 \begin_layout LyX-Code
16165 </tag>
16166 \end_layout
16167
16168 \begin_layout Standard
16169 Note that the label is output only for the first paragraph, as it should
16170  be for a theorem, for example.
16171  
16172 \end_layout
16173
16174 \begin_layout Standard
16175 For a list, we have one of these forms:
16176 \end_layout
16177
16178 \begin_layout LyX-Code
16179 <tag attr=
16180 \begin_inset Quotes erd
16181 \end_inset
16182
16183 value
16184 \begin_inset Quotes erd
16185 \end_inset
16186
16187 >
16188 \end_layout
16189
16190 \begin_layout LyX-Code
16191 <itemtag attr=
16192 \begin_inset Quotes erd
16193 \end_inset
16194
16195 value
16196 \begin_inset Quotes erd
16197 \end_inset
16198
16199 ><labeltag attr=
16200 \begin_inset Quotes erd
16201 \end_inset
16202
16203 value
16204 \begin_inset Quotes erd
16205 \end_inset
16206
16207 >List Label</labeltag>First item.</itemtag>
16208 \end_layout
16209
16210 \begin_layout LyX-Code
16211 <itemtag attr=
16212 \begin_inset Quotes erd
16213 \end_inset
16214
16215 value
16216 \begin_inset Quotes erd
16217 \end_inset
16218
16219 ><labeltag attr=
16220 \begin_inset Quotes erd
16221 \end_inset
16222
16223 value
16224 \begin_inset Quotes erd
16225 \end_inset
16226
16227 >List Label</labeltag>Second item.</itemtag>
16228 \end_layout
16229
16230 \begin_layout LyX-Code
16231 </tag>
16232 \end_layout
16233
16234 \begin_layout LyX-Code
16235
16236 \end_layout
16237
16238 \begin_layout LyX-Code
16239 <tag attr=
16240 \begin_inset Quotes erd
16241 \end_inset
16242
16243 value
16244 \begin_inset Quotes erd
16245 \end_inset
16246
16247 >
16248 \end_layout
16249
16250 \begin_layout LyX-Code
16251 <labeltag attr=
16252 \begin_inset Quotes erd
16253 \end_inset
16254
16255 value
16256 \begin_inset Quotes erd
16257 \end_inset
16258
16259 >List Label</labeltag><itemtag attr=
16260 \begin_inset Quotes erd
16261 \end_inset
16262
16263 value
16264 \begin_inset Quotes erd
16265 \end_inset
16266
16267 >First item.</itemtag>
16268 \end_layout
16269
16270 \begin_layout LyX-Code
16271 <labeltag attr=
16272 \begin_inset Quotes erd
16273 \end_inset
16274
16275 value
16276 \begin_inset Quotes erd
16277 \end_inset
16278
16279 >List Label</labeltag><itemtag attr=
16280 \begin_inset Quotes erd
16281 \end_inset
16282
16283 value
16284 \begin_inset Quotes erd
16285 \end_inset
16286
16287 >Second item.</itemtag>
16288 \end_layout
16289
16290 \begin_layout LyX-Code
16291 </tag>
16292 \end_layout
16293
16294 \begin_layout Standard
16295 Note the different orders of 
16296 \begin_inset Flex CharStyle:Code
16297 status collapsed
16298
16299 \begin_layout Plain Layout
16300 labeltag
16301 \end_layout
16302
16303 \end_inset
16304
16305  and 
16306 \begin_inset Flex CharStyle:Code
16307 status collapsed
16308
16309 \begin_layout Plain Layout
16310 itemtag
16311 \end_layout
16312
16313 \end_inset
16314
16315 .
16316  Which order we get depends upon the setting of 
16317 \begin_inset Flex CharStyle:Code
16318 status collapsed
16319
16320 \begin_layout Plain Layout
16321 HTMLLabelFirst
16322 \end_layout
16323
16324 \end_inset
16325
16326 : If 
16327 \begin_inset Flex CharStyle:Code
16328 status collapsed
16329
16330 \begin_layout Plain Layout
16331 HTMLLabelFirst
16332 \end_layout
16333
16334 \end_inset
16335
16336  is false (the default), you get the first of these, with the label within
16337  the item; if true, you get the second, with the label outside the item.
16338 \end_layout
16339
16340 \begin_layout Standard
16341 The specific tags and attributes output for each paragraph type can be controlle
16342 d by means of the layout tags we are about to describe.
16343  As mentioned earlier, however, LyX uses sensible defaults for many of these,
16344  so you often may not need to do very much to get good XHTML output.
16345  Think of the available tags as there so you can tweak things to your liking.
16346 \end_layout
16347
16348 \begin_layout Description
16349 \begin_inset Flex CharStyle:Code
16350 status collapsed
16351
16352 \begin_layout Plain Layout
16353 HTMLAttr
16354 \end_layout
16355
16356 \end_inset
16357
16358  [
16359 \begin_inset Flex CharStyle:Code
16360 status collapsed
16361
16362 \begin_layout Plain Layout
16363 string
16364 \end_layout
16365
16366 \end_inset
16367
16368 ] Specifies attribute information to be output with the main tag.
16369  For example, 
16370 \begin_inset Quotes eld
16371 \end_inset
16372
16373
16374 \begin_inset Flex CharStyle:Code
16375 status collapsed
16376
16377 \begin_layout Plain Layout
16378 class=`mydiv'
16379 \end_layout
16380
16381 \end_inset
16382
16383
16384 \begin_inset Quotes erd
16385 \end_inset
16386
16387 .
16388  By default, LyX will output 
16389 \begin_inset Quotes eld
16390 \end_inset
16391
16392
16393 \begin_inset Flex CharStyle:Code
16394 status collapsed
16395
16396 \begin_layout Plain Layout
16397 class=`layoutname'
16398 \end_layout
16399
16400 \end_inset
16401
16402
16403 \begin_inset Quotes erd
16404 \end_inset
16405
16406 , where 
16407 \begin_inset Flex CharStyle:Code
16408 status collapsed
16409
16410 \begin_layout Plain Layout
16411 layoutname
16412 \end_layout
16413
16414 \end_inset
16415
16416  is the LyX name of the layout, made lowercase, for example: chapter.
16417 \end_layout
16418
16419 \begin_layout Description
16420 \begin_inset Flex CharStyle:Code
16421 status collapsed
16422
16423 \begin_layout Plain Layout
16424 HTMLForceCSS
16425 \end_layout
16426
16427 \end_inset
16428
16429  [
16430 \begin_inset Flex CharStyle:Code
16431 status collapsed
16432
16433 \begin_layout Plain Layout
16434
16435 \emph on
16436 0
16437 \emph default
16438 ,1
16439 \end_layout
16440
16441 \end_inset
16442
16443 ] Whether to output the default CSS information LyX generates for this layout,
16444  even if additional information is explicitly provided via 
16445 \begin_inset Flex CharStyle:Code
16446 status collapsed
16447
16448 \begin_layout Plain Layout
16449 HTMLStyle
16450 \end_layout
16451
16452 \end_inset
16453
16454 .
16455  Setting this to 
16456 \begin_inset Flex CharStyle:Code
16457 status collapsed
16458
16459 \begin_layout Plain Layout
16460 1
16461 \end_layout
16462
16463 \end_inset
16464
16465  allows you to alter or augment the generated CSS, rather than to override
16466  it completely.
16467  Default is 
16468 \begin_inset Flex CharStyle:Code
16469 status collapsed
16470
16471 \begin_layout Plain Layout
16472 0
16473 \end_layout
16474
16475 \end_inset
16476
16477 .
16478 \end_layout
16479
16480 \begin_layout Description
16481 \begin_inset Flex CharStyle:Code
16482 status collapsed
16483
16484 \begin_layout Plain Layout
16485 HTMLItem
16486 \end_layout
16487
16488 \end_inset
16489
16490  [
16491 \begin_inset Flex CharStyle:Code
16492 status collapsed
16493
16494 \begin_layout Plain Layout
16495 string
16496 \end_layout
16497
16498 \end_inset
16499
16500 ] The tag to be used for individual paragraphs of environments, replacing
16501  
16502 \begin_inset Flex CharStyle:Code
16503 status collapsed
16504
16505 \begin_layout Plain Layout
16506 itemtag
16507 \end_layout
16508
16509 \end_inset
16510
16511  in the examples above.
16512  Defaults to 
16513 \begin_inset Flex CharStyle:Code
16514 status collapsed
16515
16516 \begin_layout Plain Layout
16517 div
16518 \end_layout
16519
16520 \end_inset
16521
16522 .
16523 \end_layout
16524
16525 \begin_layout Description
16526 \begin_inset Flex CharStyle:Code
16527 status collapsed
16528
16529 \begin_layout Plain Layout
16530 HTMLItemAttr
16531 \end_layout
16532
16533 \end_inset
16534
16535  [
16536 \begin_inset Flex CharStyle:Code
16537 status collapsed
16538
16539 \begin_layout Plain Layout
16540 string
16541 \end_layout
16542
16543 \end_inset
16544
16545 ] Attributes for the item tag.
16546  Defaults to 
16547 \begin_inset Quotes eld
16548 \end_inset
16549
16550
16551 \begin_inset Flex CharStyle:Code
16552 status collapsed
16553
16554 \begin_layout Plain Layout
16555 class=`layoutname_item'
16556 \end_layout
16557
16558 \end_inset
16559
16560
16561 \begin_inset Quotes erd
16562 \end_inset
16563
16564 .
16565 \end_layout
16566
16567 \begin_layout Description
16568 \begin_inset Flex CharStyle:Code
16569 status collapsed
16570
16571 \begin_layout Plain Layout
16572 HTMLLabel
16573 \end_layout
16574
16575 \end_inset
16576
16577  [
16578 \begin_inset Flex CharStyle:Code
16579 status collapsed
16580
16581 \begin_layout Plain Layout
16582 string
16583 \end_layout
16584
16585 \end_inset
16586
16587 ] The tag to be used for paragraph and item labels, replacing 
16588 \begin_inset Flex CharStyle:Code
16589 status collapsed
16590
16591 \begin_layout Plain Layout
16592 labeltag
16593 \end_layout
16594
16595 \end_inset
16596
16597  in the examples above.
16598  Defaults to 
16599 \begin_inset Flex CharStyle:Code
16600 status collapsed
16601
16602 \begin_layout Plain Layout
16603 span
16604 \end_layout
16605
16606 \end_inset
16607
16608 .
16609 \end_layout
16610
16611 \begin_layout Description
16612 \begin_inset Flex CharStyle:Code
16613 status collapsed
16614
16615 \begin_layout Plain Layout
16616 HTMLLabelAttr
16617 \end_layout
16618
16619 \end_inset
16620
16621  [
16622 \begin_inset Flex CharStyle:Code
16623 status collapsed
16624
16625 \begin_layout Plain Layout
16626 string
16627 \end_layout
16628
16629 \end_inset
16630
16631 ] Attributes for the label tag.
16632  Defaults to 
16633 \begin_inset Quotes eld
16634 \end_inset
16635
16636
16637 \begin_inset Flex CharStyle:Code
16638 status collapsed
16639
16640 \begin_layout Plain Layout
16641 class=`layoutname_label'
16642 \end_layout
16643
16644 \end_inset
16645
16646
16647 \begin_inset Quotes erd
16648 \end_inset
16649
16650 .
16651 \end_layout
16652
16653 \begin_layout Description
16654 \begin_inset Flex CharStyle:Code
16655 status collapsed
16656
16657 \begin_layout Plain Layout
16658 HTMLLabelFirst
16659 \end_layout
16660
16661 \end_inset
16662
16663  [
16664 \begin_inset Flex CharStyle:Code
16665 status collapsed
16666
16667 \begin_layout Plain Layout
16668
16669 \emph on
16670 0
16671 \emph default
16672 ,1
16673 \end_layout
16674
16675 \end_inset
16676
16677 ] Meaningful only for list-like environments, this tag controls whether
16678  the label tag is output before or inside the item tag.
16679  This is used, for example, in the description environment, where we want
16680  `
16681 \begin_inset Flex CharStyle:Code
16682 status collapsed
16683
16684 \begin_layout Plain Layout
16685 <dt>\SpecialChar \ldots{}
16686 </dt><dd>\SpecialChar \ldots{}
16687 </dd>
16688 \end_layout
16689
16690 \end_inset
16691
16692 .
16693  Default is 
16694 \begin_inset Flex CharStyle:Code
16695 status collapsed
16696
16697 \begin_layout Plain Layout
16698 0
16699 \end_layout
16700
16701 \end_inset
16702
16703 : The label tag is output inside the item tag.
16704 \end_layout
16705
16706 \begin_layout Description
16707 \begin_inset Flex CharStyle:Code
16708 status collapsed
16709
16710 \begin_layout Plain Layout
16711 HTMLPreamble
16712 \end_layout
16713
16714 \end_inset
16715
16716  Information to be output in the 
16717 \begin_inset Flex CharStyle:Code
16718 status collapsed
16719
16720 \begin_layout Plain Layout
16721 <head>
16722 \end_layout
16723
16724 \end_inset
16725
16726  section when this style is used.
16727  This might, for example, be used to include a 
16728 \begin_inset Flex CharStyle:Code
16729 status collapsed
16730
16731 \begin_layout Plain Layout
16732 <script>
16733 \end_layout
16734
16735 \end_inset
16736
16737  block defining an 
16738 \begin_inset Flex CharStyle:Code
16739 status collapsed
16740
16741 \begin_layout Plain Layout
16742 onclick
16743 \end_layout
16744
16745 \end_inset
16746
16747  handler.
16748 \end_layout
16749
16750 \begin_layout Description
16751 \begin_inset Flex CharStyle:Code
16752 status collapsed
16753
16754 \begin_layout Plain Layout
16755 HTMLStyle
16756 \end_layout
16757
16758 \end_inset
16759
16760  CSS style information to be included when this style is used.
16761  Note that this will automatically be wrapped in a layout-generated 
16762 \begin_inset Flex CharStyle:Code
16763 status collapsed
16764
16765 \begin_layout Plain Layout
16766 <style>
16767 \end_layout
16768
16769 \end_inset
16770
16771  block, so only the CSS itself need be included.
16772 \end_layout
16773
16774 \begin_layout Description
16775 \begin_inset Flex CharStyle:Code
16776 status collapsed
16777
16778 \begin_layout Plain Layout
16779 HTMLTag
16780 \end_layout
16781
16782 \end_inset
16783
16784  [
16785 \begin_inset Flex CharStyle:Code
16786 status collapsed
16787
16788 \begin_layout Plain Layout
16789 string
16790 \end_layout
16791
16792 \end_inset
16793
16794 ] The tag to be used for the main label, replacing 
16795 \begin_inset Flex CharStyle:Code
16796 status collapsed
16797
16798 \begin_layout Plain Layout
16799 tag
16800 \end_layout
16801
16802 \end_inset
16803
16804  in the examples above.
16805  Defaults to 
16806 \begin_inset Flex CharStyle:Code
16807 status collapsed
16808
16809 \begin_layout Plain Layout
16810 div
16811 \end_layout
16812
16813 \end_inset
16814
16815 .
16816 \end_layout
16817
16818 \begin_layout Description
16819 \begin_inset Flex CharStyle:Code
16820 status collapsed
16821
16822 \begin_layout Plain Layout
16823 HTMLTitle
16824 \end_layout
16825
16826 \end_inset
16827
16828  [
16829 \begin_inset Flex CharStyle:Code
16830 status collapsed
16831
16832 \begin_layout Plain Layout
16833
16834 \emph on
16835 0
16836 \emph default
16837 ,1
16838 \end_layout
16839
16840 \end_inset
16841
16842 ] Marks this style as the one to be used to generate the 
16843 \begin_inset Flex CharStyle:Code
16844 status collapsed
16845
16846 \begin_layout Plain Layout
16847 <title>
16848 \end_layout
16849
16850 \end_inset
16851
16852  tag for the XHTML file.
16853  By default, it is false.
16854  The 
16855 \begin_inset Flex CharStyle:Code
16856 status collapsed
16857
16858 \begin_layout Plain Layout
16859 stdtitle.inc
16860 \end_layout
16861
16862 \end_inset
16863
16864  file sets it to true for the 
16865 \begin_inset Flex CharStyle:Code
16866 status collapsed
16867
16868 \begin_layout Plain Layout
16869 title
16870 \end_layout
16871
16872 \end_inset
16873
16874  environment.
16875  
16876 \end_layout
16877
16878 \begin_layout Subsection
16879 InsetLayout XHTML
16880 \end_layout
16881
16882 \begin_layout Standard
16883 The XHTML output of insets can also be controlled by information in layout
16884  files.
16885 \begin_inset Foot
16886 status collapsed
16887
16888 \begin_layout Plain Layout
16889 At present, this is true only for 
16890 \begin_inset Quotes eld
16891 \end_inset
16892
16893 text
16894 \begin_inset Quotes erd
16895 \end_inset
16896
16897  insets (insets you can type into) and is not true for 
16898 \begin_inset Quotes eld
16899 \end_inset
16900
16901 command
16902 \begin_inset Quotes erd
16903 \end_inset
16904
16905  insets (insets that are associated with dialog boxes).
16906 \end_layout
16907
16908 \end_inset
16909
16910  Here, too, LyX tries to provide sensible defaults, and it constructs default
16911  CSS style rules.
16912  But everything can be customized.
16913 \end_layout
16914
16915 \begin_layout Standard
16916 The XHTML LyX outputs for an inset has the following form:
16917 \end_layout
16918
16919 \begin_layout LyX-Code
16920 <tag attr=
16921 \begin_inset Quotes erd
16922 \end_inset
16923
16924 value
16925 \begin_inset Quotes erd
16926 \end_inset
16927
16928 >
16929 \end_layout
16930
16931 \begin_layout LyX-Code
16932 <labeltag>Label</labeltag>
16933 \end_layout
16934
16935 \begin_layout LyX-Code
16936 <innertag attr=
16937 \begin_inset Quotes erd
16938 \end_inset
16939
16940 value
16941 \begin_inset Quotes erd
16942 \end_inset
16943
16944 >Contents of the inset.</innertag>
16945 \end_layout
16946
16947 \begin_layout LyX-Code
16948 </tag>
16949 \end_layout
16950
16951 \begin_layout Standard
16952 If the inset permits multiple paragraphs---that is, if 
16953 \begin_inset Flex CharStyle:Code
16954 status collapsed
16955
16956 \begin_layout Plain Layout
16957 MultiPar
16958 \end_layout
16959
16960 \end_inset
16961
16962  is true---then the contents of the inset will itself be output as paragraphs
16963  formatted according to the styles used for those paragraphs (standard,
16964  quote, and the like).
16965  The label tag is of course omitted if the paragraph does not have a label
16966  and, at present, is always 
16967 \begin_inset Flex CharStyle:Code
16968 status collapsed
16969
16970 \begin_layout Plain Layout
16971 span
16972 \end_layout
16973
16974 \end_inset
16975
16976 .
16977  The inner tag is optional and, by default, does not appear.
16978 \end_layout
16979
16980 \begin_layout Standard
16981 The specific tags and attributes output for each inset can be controlled
16982  by means of the following layout tags.
16983 \end_layout
16984
16985 \begin_layout Description
16986 \begin_inset Flex CharStyle:Code
16987 status collapsed
16988
16989 \begin_layout Plain Layout
16990 HTMLAttr
16991 \end_layout
16992
16993 \end_inset
16994
16995  [
16996 \begin_inset Flex CharStyle:Code
16997 status collapsed
16998
16999 \begin_layout Plain Layout
17000 string
17001 \end_layout
17002
17003 \end_inset
17004
17005 ] Specifies attribute information to be output with the main tag.
17006  For example, 
17007 \begin_inset Quotes eld
17008 \end_inset
17009
17010
17011 \begin_inset Flex CharStyle:Code
17012 status collapsed
17013
17014 \begin_layout Plain Layout
17015 class=`myinset' onclick=`\SpecialChar \ldots{}
17016 '
17017 \end_layout
17018
17019 \end_inset
17020
17021
17022 \begin_inset Quotes erd
17023 \end_inset
17024
17025 .
17026  By default, LyX will output 
17027 \begin_inset Quotes eld
17028 \end_inset
17029
17030
17031 \begin_inset Flex CharStyle:Code
17032 status collapsed
17033
17034 \begin_layout Plain Layout
17035 class=`insetname'
17036 \end_layout
17037
17038 \end_inset
17039
17040
17041 \begin_inset Quotes erd
17042 \end_inset
17043
17044 , where 
17045 \begin_inset Flex CharStyle:Code
17046 status collapsed
17047
17048 \begin_layout Plain Layout
17049 insetname
17050 \end_layout
17051
17052 \end_inset
17053
17054  is the LyX name of the inset, made lowercase and with non-alphanumeric
17055  characters converted to underscores, for example: footnote.
17056 \end_layout
17057
17058 \begin_layout Description
17059 \begin_inset Flex CharStyle:Code
17060 status collapsed
17061
17062 \begin_layout Plain Layout
17063 HTMLForceCSS
17064 \end_layout
17065
17066 \end_inset
17067
17068  [
17069 \begin_inset Flex CharStyle:Code
17070 status collapsed
17071
17072 \begin_layout Plain Layout
17073
17074 \emph on
17075 0
17076 \emph default
17077 ,1
17078 \end_layout
17079
17080 \end_inset
17081
17082 ] Whether to output the default CSS information LyX generates for this layout,
17083  even if additional information is explicitly provided via 
17084 \begin_inset Flex CharStyle:Code
17085 status collapsed
17086
17087 \begin_layout Plain Layout
17088 HTMLStyle
17089 \end_layout
17090
17091 \end_inset
17092
17093 .
17094  Setting this to 
17095 \begin_inset Flex CharStyle:Code
17096 status collapsed
17097
17098 \begin_layout Plain Layout
17099 1
17100 \end_layout
17101
17102 \end_inset
17103
17104  allows you to alter or augment the generated CSS, rather than to override
17105  it completely.
17106  Default is 0.
17107 \end_layout
17108
17109 \begin_layout Description
17110 \begin_inset Flex CharStyle:Code
17111 status collapsed
17112
17113 \begin_layout Plain Layout
17114 HTMLInnerAttr
17115 \end_layout
17116
17117 \end_inset
17118
17119  [
17120 \begin_inset Flex CharStyle:Code
17121 status collapsed
17122
17123 \begin_layout Plain Layout
17124 string
17125 \end_layout
17126
17127 \end_inset
17128
17129 ] Attributes for the inner tag.
17130  Defaults to 
17131 \begin_inset Quotes eld
17132 \end_inset
17133
17134
17135 \begin_inset Flex CharStyle:Code
17136 status collapsed
17137
17138 \begin_layout Plain Layout
17139 class=`insetname_inner'
17140 \end_layout
17141
17142 \end_inset
17143
17144
17145 \begin_inset Quotes erd
17146 \end_inset
17147
17148 .
17149 \end_layout
17150
17151 \begin_layout Description
17152 \begin_inset Flex CharStyle:Code
17153 status collapsed
17154
17155 \begin_layout Plain Layout
17156 HTMLInnerTag
17157 \end_layout
17158
17159 \end_inset
17160
17161  [
17162 \begin_inset Flex CharStyle:Code
17163 status collapsed
17164
17165 \begin_layout Plain Layout
17166 string
17167 \end_layout
17168
17169 \end_inset
17170
17171 ] The inner tag, replacing 
17172 \begin_inset Flex CharStyle:Code
17173 status collapsed
17174
17175 \begin_layout Plain Layout
17176 innertag
17177 \end_layout
17178
17179 \end_inset
17180
17181  in the examples above.
17182  By default, there is none.
17183 \end_layout
17184
17185 \begin_layout Description
17186 \begin_inset Flex CharStyle:Code
17187 status collapsed
17188
17189 \begin_layout Plain Layout
17190 HTMLIsBlock
17191 \end_layout
17192
17193 \end_inset
17194
17195  [
17196 \begin_inset Flex CharStyle:Code
17197 status collapsed
17198
17199 \begin_layout Plain Layout
17200 0,
17201 \emph on
17202 1
17203 \end_layout
17204
17205 \end_inset
17206
17207 ] Whether this inset represents a standalone block of text (such as a footnote)
17208  or instead represents material that is included in the surrounding text
17209  (such as a branch).
17210  Defaults to 1.
17211 \end_layout
17212
17213 \begin_layout Description
17214 \begin_inset Flex CharStyle:Code
17215 status collapsed
17216
17217 \begin_layout Plain Layout
17218 HTMLLabel
17219 \end_layout
17220
17221 \end_inset
17222
17223  [
17224 \begin_inset Flex CharStyle:Code
17225 status collapsed
17226
17227 \begin_layout Plain Layout
17228 string
17229 \end_layout
17230
17231 \end_inset
17232
17233 ] A label for this inset, possibly including a reference to a counter.
17234  For example, for footnote, it might be: 
17235 \begin_inset Flex CharStyle:Code
17236 status collapsed
17237
17238 \begin_layout Plain Layout
17239
17240 \backslash
17241 arabic{footnote}
17242 \end_layout
17243
17244 \end_inset
17245
17246 .
17247  This is optional, and there is no default.
17248 \end_layout
17249
17250 \begin_layout Description
17251 \begin_inset Flex CharStyle:Code
17252 status collapsed
17253
17254 \begin_layout Plain Layout
17255 HTMLPreamble
17256 \end_layout
17257
17258 \end_inset
17259
17260  Information to be output in the 
17261 \begin_inset Flex CharStyle:Code
17262 status collapsed
17263
17264 \begin_layout Plain Layout
17265 <head>
17266 \end_layout
17267
17268 \end_inset
17269
17270  section when this style is used.
17271  This might, for example, be used to include a 
17272 \begin_inset Flex CharStyle:Code
17273 status collapsed
17274
17275 \begin_layout Plain Layout
17276 <script>
17277 \end_layout
17278
17279 \end_inset
17280
17281  block defining an 
17282 \begin_inset Flex CharStyle:Code
17283 status collapsed
17284
17285 \begin_layout Plain Layout
17286 onclick
17287 \end_layout
17288
17289 \end_inset
17290
17291  handler.
17292 \end_layout
17293
17294 \begin_layout Description
17295 \begin_inset Flex CharStyle:Code
17296 status collapsed
17297
17298 \begin_layout Plain Layout
17299 HTMLStyle
17300 \end_layout
17301
17302 \end_inset
17303
17304  CSS style information to be included when this style is used.
17305  Note that this will automatically be wrapped in a layout-generated 
17306 \begin_inset Flex CharStyle:Code
17307 status collapsed
17308
17309 \begin_layout Plain Layout
17310 <style>
17311 \end_layout
17312
17313 \end_inset
17314
17315  block, so only the CSS itself need be included.
17316 \end_layout
17317
17318 \begin_layout Description
17319 \begin_inset Flex CharStyle:Code
17320 status collapsed
17321
17322 \begin_layout Plain Layout
17323 HTMLTag
17324 \end_layout
17325
17326 \end_inset
17327
17328  [
17329 \begin_inset Flex CharStyle:Code
17330 status collapsed
17331
17332 \begin_layout Plain Layout
17333 string
17334 \end_layout
17335
17336 \end_inset
17337
17338 ] The tag to be used for the main label, replacing 
17339 \begin_inset Flex CharStyle:Code
17340 status collapsed
17341
17342 \begin_layout Plain Layout
17343 tag
17344 \end_layout
17345
17346 \end_inset
17347
17348  in the examples above.
17349  The default depends upon the setting of 
17350 \begin_inset Flex CharStyle:Code
17351 status collapsed
17352
17353 \begin_layout Plain Layout
17354 MultiPar
17355 \end_layout
17356
17357 \end_inset
17358
17359 : If 
17360 \begin_inset Flex CharStyle:Code
17361 status collapsed
17362
17363 \begin_layout Plain Layout
17364 MultiPar
17365 \end_layout
17366
17367 \end_inset
17368
17369  is true, the default is 
17370 \begin_inset Flex CharStyle:Code
17371 status collapsed
17372
17373 \begin_layout Plain Layout
17374 div
17375 \end_layout
17376
17377 \end_inset
17378
17379 ; if it is false, the default is 
17380 \begin_inset Flex CharStyle:Code
17381 status collapsed
17382
17383 \begin_layout Plain Layout
17384 span
17385 \end_layout
17386
17387 \end_inset
17388
17389 .
17390 \end_layout
17391
17392 \begin_layout Subsection
17393 Float XHTML
17394 \end_layout
17395
17396 \begin_layout Standard
17397 The XHTML output for floats too can be controlled by layout information.
17398  The output has the following form:
17399 \end_layout
17400
17401 \begin_layout LyX-Code
17402 <tag attr=
17403 \begin_inset Quotes erd
17404 \end_inset
17405
17406 value
17407 \begin_inset Quotes erd
17408 \end_inset
17409
17410 >
17411 \end_layout
17412
17413 \begin_layout LyX-Code
17414 Contents of the float.
17415 \end_layout
17416
17417 \begin_layout LyX-Code
17418 </tag>
17419 \end_layout
17420
17421 \begin_layout Standard
17422 The caption, if there is one, is a separate inset and will be output as
17423  such.
17424  Its appearance can be controlled via the InsetLayout for caption insets.
17425  
17426 \end_layout
17427
17428 \begin_layout Description
17429 \begin_inset Flex CharStyle:Code
17430 status collapsed
17431
17432 \begin_layout Plain Layout
17433 HTMLAttr
17434 \end_layout
17435
17436 \end_inset
17437
17438  [
17439 \begin_inset Flex CharStyle:Code
17440 status collapsed
17441
17442 \begin_layout Plain Layout
17443 string
17444 \end_layout
17445
17446 \end_inset
17447
17448 ] Specifies attribute information to be output with the main tag.
17449  For example, 
17450 \begin_inset Quotes eld
17451 \end_inset
17452
17453
17454 \begin_inset Flex CharStyle:Code
17455 status collapsed
17456
17457 \begin_layout Plain Layout
17458 class=`myfloat' onclick=`\SpecialChar \ldots{}
17459 '
17460 \end_layout
17461
17462 \end_inset
17463
17464
17465 \begin_inset Quotes erd
17466 \end_inset
17467
17468 .
17469  By default, LyX will output 
17470 \begin_inset Quotes eld
17471 \end_inset
17472
17473
17474 \begin_inset Flex CharStyle:Code
17475 status collapsed
17476
17477 \begin_layout Plain Layout
17478 class=`float float-floattype'
17479 \end_layout
17480
17481 \end_inset
17482
17483
17484 \begin_inset Quotes erd
17485 \end_inset
17486
17487 , where 
17488 \begin_inset Flex CharStyle:Code
17489 status collapsed
17490
17491 \begin_layout Plain Layout
17492 floattype
17493 \end_layout
17494
17495 \end_inset
17496
17497  is LyX's name for this type of float, as determined by the float delcaration
17498  (see 
17499 \begin_inset CommandInset ref
17500 LatexCommand ref
17501 reference "sub:Floats"
17502
17503 \end_inset
17504
17505 ), though made lowercase and with non-alphanumeric characters converted
17506  to underscores, for example: float-table.
17507 \end_layout
17508
17509 \begin_layout Description
17510 \begin_inset Flex CharStyle:Code
17511 status collapsed
17512
17513 \begin_layout Plain Layout
17514 HTMLStyle
17515 \end_layout
17516
17517 \end_inset
17518
17519  CSS style information to be included when this float is used.
17520  Note that this will automatically be wrapped in a layout-generated 
17521 \begin_inset Flex CharStyle:Code
17522 status collapsed
17523
17524 \begin_layout Plain Layout
17525 <style>
17526 \end_layout
17527
17528 \end_inset
17529
17530  block, so only the CSS itself need be included.
17531 \end_layout
17532
17533 \begin_layout Description
17534 \begin_inset Flex CharStyle:Code
17535 status collapsed
17536
17537 \begin_layout Plain Layout
17538 HTMLTag
17539 \end_layout
17540
17541 \end_inset
17542
17543  [
17544 \begin_inset Flex CharStyle:Code
17545 status collapsed
17546
17547 \begin_layout Plain Layout
17548 string
17549 \end_layout
17550
17551 \end_inset
17552
17553 ] The tag to be used for this float, replacing 
17554 \begin_inset Quotes eld
17555 \end_inset
17556
17557
17558 \begin_inset Flex CharStyle:Code
17559 status collapsed
17560
17561 \begin_layout Plain Layout
17562 tag
17563 \end_layout
17564
17565 \end_inset
17566
17567
17568 \begin_inset Quotes erd
17569 \end_inset
17570
17571  in the example above.
17572  The default is 
17573 \begin_inset Flex CharStyle:Code
17574 status collapsed
17575
17576 \begin_layout Plain Layout
17577 div
17578 \end_layout
17579
17580 \end_inset
17581
17582  and will rarely need changing.
17583 \end_layout
17584
17585 \begin_layout Subsection
17586 Bibliography formatting
17587 \end_layout
17588
17589 \begin_layout Standard
17590 The bibliography can be formatted using 
17591 \begin_inset Flex CharStyle:Code
17592 status collapsed
17593
17594 \begin_layout Plain Layout
17595 CiteFormat
17596 \end_layout
17597
17598 \end_inset
17599
17600  blocks.
17601  See Section 
17602 \begin_inset CommandInset ref
17603 LatexCommand ref
17604 reference "sub:Citation-format-description"
17605
17606 \end_inset
17607
17608  for the details.
17609 \end_layout
17610
17611 \begin_layout Subsection
17612 LyX-generated CSS
17613 \end_layout
17614
17615 \begin_layout Standard
17616 We have several times mentioned that LyX will generate default CSS style
17617  rules for both insets and paragraph styles, based upon the other layout
17618  information that is provided.
17619  In this section, we shall say a word about which layout information LyX
17620  uses and how.
17621 \end_layout
17622
17623 \begin_layout Standard
17624 At present, LyX auto-generates CSS only for font information, making use
17625  of the 
17626 \begin_inset Flex CharStyle:Code
17627 status collapsed
17628
17629 \begin_layout Plain Layout
17630 Family
17631 \end_layout
17632
17633 \end_inset
17634
17635
17636 \begin_inset Flex CharStyle:Code
17637 status collapsed
17638
17639 \begin_layout Plain Layout
17640 Series
17641 \end_layout
17642
17643 \end_inset
17644
17645
17646 \begin_inset Flex CharStyle:Code
17647 status collapsed
17648
17649 \begin_layout Plain Layout
17650 Shape
17651 \end_layout
17652
17653 \end_inset
17654
17655 , and 
17656 \begin_inset Flex CharStyle:Code
17657 status collapsed
17658
17659 \begin_layout Plain Layout
17660 Size
17661 \end_layout
17662
17663 \end_inset
17664
17665  specified in the 
17666 \begin_inset Flex CharStyle:Code
17667 status collapsed
17668
17669 \begin_layout Plain Layout
17670 Font
17671 \end_layout
17672
17673 \end_inset
17674
17675  declaration.
17676  (See 
17677 \begin_inset CommandInset ref
17678 LatexCommand ref
17679 reference "sub:Font-description"
17680
17681 \end_inset
17682
17683 .) The translation is mostly straightforward and obvious.
17684  For example, 
17685 \begin_inset Quotes eld
17686 \end_inset
17687
17688
17689 \begin_inset Flex CharStyle:Code
17690 status collapsed
17691
17692 \begin_layout Plain Layout
17693 Family Sans
17694 \end_layout
17695
17696 \end_inset
17697
17698
17699 \begin_inset Quotes erd
17700 \end_inset
17701
17702  becomes 
17703 \begin_inset Quotes eld
17704 \end_inset
17705
17706
17707 \begin_inset Flex CharStyle:Code
17708 status collapsed
17709
17710 \begin_layout Plain Layout
17711 font-family: sans-serif;
17712 \end_layout
17713
17714 \end_inset
17715
17716
17717 \begin_inset Quotes erd
17718 \end_inset
17719
17720 .
17721  The correspondence of LyX sizes and CSS sizes is a little less obvious
17722  but nonetheless intuitive.
17723  See the 
17724 \begin_inset Flex CharStyle:Code
17725 status collapsed
17726
17727 \begin_layout Plain Layout
17728 getSizeCSS()
17729 \end_layout
17730
17731 \end_inset
17732
17733  function in 
17734 \begin_inset Flex URL
17735 status collapsed
17736
17737 \begin_layout Plain Layout
17738
17739 src/FontInfo.cpp
17740 \end_layout
17741
17742 \end_inset
17743
17744  for the details.
17745  
17746 \end_layout
17747
17748 \begin_layout Chapter
17749 Including External Material
17750 \end_layout
17751
17752 \begin_layout Standard
17753 \begin_inset Box Shadowbox
17754 position "t"
17755 hor_pos "c"
17756 has_inner_box 1
17757 inner_pos "t"
17758 use_parbox 0
17759 width "100col%"
17760 special "none"
17761 height "1in"
17762 height_special "totalheight"
17763 status open
17764
17765 \begin_layout Plain Layout
17766 WARNING: This portion of the documentation has not been updated for some
17767  time.
17768  We certainly hope that it is still accurate, but there are no guarantees.
17769 \end_layout
17770
17771 \end_inset
17772
17773
17774 \end_layout
17775
17776 \begin_layout Standard
17777 The use of material from sources external to LyX is covered in detail in
17778  the 
17779 \emph on
17780 Embedded Objects
17781 \emph default
17782  manual.
17783  This part of the manual covers what needs to happen behind the scenes for
17784  new sorts of material to be included.
17785 \end_layout
17786
17787 \begin_layout Section
17788 How does it work?
17789 \end_layout
17790
17791 \begin_layout Standard
17792 The external material feature is based on the concept of a 
17793 \emph on
17794 template
17795 \emph default
17796 .
17797  A template is a specification of how LyX should interface with a certain
17798  kind of material.
17799  As bundled, LyX comes with predefined templates for Xfig figures, various
17800  raster format images, chess diagrams, and LilyPond music notation.
17801  You can check the actual list by using the menu 
17802 \begin_inset Flex CharStyle:MenuItem
17803 status collapsed
17804
17805 \begin_layout Plain Layout
17806 Insert\SpecialChar \menuseparator
17807 File\SpecialChar \menuseparator
17808 External Material
17809 \end_layout
17810
17811 \end_inset
17812
17813 .
17814  Furthermore, it is possible to roll your own template to support a specific
17815  kind of material.
17816  Later we'll describe in more detail what is involved, and hopefully you
17817  will submit all the templates you create so we can include them in a later
17818  LyX version.
17819 \end_layout
17820
17821 \begin_layout Standard
17822 Another basic idea of the external material feature is to distinguish between
17823  the original file that serves as a base for final material and the produced
17824  file that is included in your exported or printed document.
17825  For example, consider the case of a figure produced with 
17826 \begin_inset Flex CharStyle:Code
17827 status collapsed
17828
17829 \begin_layout Plain Layout
17830 Xfig
17831 \end_layout
17832
17833 \end_inset
17834
17835 .
17836  The Xfig application itself works on an original file with the 
17837 \begin_inset Flex CharStyle:Code
17838 status collapsed
17839
17840 \begin_layout Plain Layout
17841 .fig
17842 \end_layout
17843
17844 \end_inset
17845
17846  extension.
17847  Within Xfig, you create and change your figure, and when you are done,
17848  you save the 
17849 \begin_inset Flex CharStyle:Code
17850 status collapsed
17851
17852 \begin_layout Plain Layout
17853 fig
17854 \end_layout
17855
17856 \end_inset
17857
17858 -file.
17859  When you want to include the figure in your document, you invoke 
17860 \begin_inset Flex CharStyle:Code
17861 status collapsed
17862
17863 \begin_layout Plain Layout
17864 transfig
17865 \end_layout
17866
17867 \end_inset
17868
17869  in order to create a PostScript file that can readily be included in your
17870  LaTeX file.
17871  In this case, the 
17872 \begin_inset Flex CharStyle:Code
17873 status collapsed
17874
17875 \begin_layout Plain Layout
17876 .fig
17877 \end_layout
17878
17879 \end_inset
17880
17881  file is the original file, and the PostScript file is the produced file.
17882 \end_layout
17883
17884 \begin_layout Standard
17885 This distinction is important in order to allow updating of the material
17886  while you are in the process of writing the document.
17887  Furthermore, it provides us with the flexibility that is needed to support
17888  multiple export formats.
17889  For instance, in the case of a plain text file, it is not exactly an award-winn
17890 ing idea to include the figure as raw PostScript.
17891  Instead, you'd either prefer to just include a reference to the figure
17892  or try to invoke some graphics to ASCII converter to make the final result
17893  look similar to the real graphics.
17894  The external material management allows you to do this, because it is parametri
17895 zed on the different export formats that LyX supports.
17896 \end_layout
17897
17898 \begin_layout Standard
17899 Besides supporting the production of different products according to the
17900  exported format, it supports tight integration with editing and viewing
17901  applications.
17902  In the case of an Xfig figure, you are able to invoke Xfig on the original
17903  file with a single click from within the external material dialog in LyX,
17904  and also preview the produced PostScript file with Ghostview with another
17905  click.
17906  No more fiddling around with the command line and/or file browsers to locate
17907  and manipulate the original or produced files.
17908  In this way, you are finally able to take full advantage of the many different
17909  applications that are relevant to use when you write your documents, and
17910  ultimately be more productive.
17911 \end_layout
17912
17913 \begin_layout Section
17914 The external template configuration file
17915 \end_layout
17916
17917 \begin_layout Standard
17918 It is relatively easy to add custom external template definitions to LyX.
17919  However, be aware that doing this in an careless manner most probably 
17920 \emph on
17921 will
17922 \emph default
17923  introduce an easily exploitable security hole.
17924  So before you do this, please read the discussion about security in section
17925  
17926 \begin_inset CommandInset ref
17927 LatexCommand ref
17928 reference "sec:Security-discussion"
17929
17930 \end_inset
17931
17932 .
17933 \end_layout
17934
17935 \begin_layout Standard
17936 Having said that, we encourage you to submit any interesting templates that
17937  you create.
17938  
17939 \end_layout
17940
17941 \begin_layout Standard
17942 The external templates are defined in the 
17943 \begin_inset Flex CharStyle:Code
17944 status collapsed
17945
17946 \begin_layout Plain Layout
17947 LyXDir/lib/external_templates
17948 \end_layout
17949
17950 \end_inset
17951
17952  file.
17953  You can place your own version in 
17954 \begin_inset Flex CharStyle:Code
17955 status collapsed
17956
17957 \begin_layout Plain Layout
17958 UserDir/external_templates
17959 \end_layout
17960
17961 \end_inset
17962
17963 .
17964 \end_layout
17965
17966 \begin_layout Standard
17967 A typical template looks like this:
17968 \end_layout
17969
17970 \begin_layout LyX-Code
17971 Template XFig
17972 \end_layout
17973
17974 \begin_layout LyX-Code
17975 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
17976 \end_layout
17977
17978 \begin_layout LyX-Code
17979 HelpText
17980 \end_layout
17981
17982 \begin_layout LyX-Code
17983 An XFig figure.
17984 \end_layout
17985
17986 \begin_layout LyX-Code
17987 HelpTextEnd
17988 \end_layout
17989
17990 \begin_layout LyX-Code
17991 InputFormat fig
17992 \end_layout
17993
17994 \begin_layout LyX-Code
17995 FileFilter "*.fig"
17996 \end_layout
17997
17998 \begin_layout LyX-Code
17999 AutomaticProduction true
18000 \end_layout
18001
18002 \begin_layout LyX-Code
18003 Transform Rotate
18004 \end_layout
18005
18006 \begin_layout LyX-Code
18007 Transform Resize
18008 \end_layout
18009
18010 \begin_layout LyX-Code
18011 Format LaTeX
18012 \end_layout
18013
18014 \begin_layout LyX-Code
18015 TransformCommand Rotate RotationLatexCommand
18016 \end_layout
18017
18018 \begin_layout LyX-Code
18019 TransformCommand Resize ResizeLatexCommand
18020 \end_layout
18021
18022 \begin_layout LyX-Code
18023 Product "$$RotateFront$$ResizeFront
18024 \end_layout
18025
18026 \begin_layout LyX-Code
18027          
18028 \backslash
18029
18030 \backslash
18031 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18032 \end_layout
18033
18034 \begin_layout LyX-Code
18035          $$ResizeBack$$RotateBack"
18036 \end_layout
18037
18038 \begin_layout LyX-Code
18039 UpdateFormat pstex
18040 \end_layout
18041
18042 \begin_layout LyX-Code
18043 UpdateResult "$$AbsPath$$Basename.pstex_t"
18044 \end_layout
18045
18046 \begin_layout LyX-Code
18047 Requirement "graphicx"
18048 \end_layout
18049
18050 \begin_layout LyX-Code
18051 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18052 \end_layout
18053
18054 \begin_layout LyX-Code
18055 ReferencedFile latex "$$AbsPath$$Basename.eps"
18056 \end_layout
18057
18058 \begin_layout LyX-Code
18059 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18060 \end_layout
18061
18062 \begin_layout LyX-Code
18063 FormatEnd
18064 \end_layout
18065
18066 \begin_layout LyX-Code
18067 Format PDFLaTeX
18068 \end_layout
18069
18070 \begin_layout LyX-Code
18071 TransformCommand Rotate RotationLatexCommand
18072 \end_layout
18073
18074 \begin_layout LyX-Code
18075 TransformCommand Resize ResizeLatexCommand
18076 \end_layout
18077
18078 \begin_layout LyX-Code
18079 Product "$$RotateFront$$ResizeFront
18080 \end_layout
18081
18082 \begin_layout LyX-Code
18083          
18084 \backslash
18085
18086 \backslash
18087 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18088 \end_layout
18089
18090 \begin_layout LyX-Code
18091          $$ResizeBack$$RotateBack"
18092 \end_layout
18093
18094 \begin_layout LyX-Code
18095 UpdateFormat pdftex
18096 \end_layout
18097
18098 \begin_layout LyX-Code
18099 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18100 \end_layout
18101
18102 \begin_layout LyX-Code
18103 Requirement "graphicx"
18104 \end_layout
18105
18106 \begin_layout LyX-Code
18107 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18108 \end_layout
18109
18110 \begin_layout LyX-Code
18111 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18112 \end_layout
18113
18114 \begin_layout LyX-Code
18115 FormatEnd
18116 \end_layout
18117
18118 \begin_layout LyX-Code
18119 Format Ascii
18120 \end_layout
18121
18122 \begin_layout LyX-Code
18123 Product "$$Contents(
18124 \backslash
18125 "$$AbsPath$$Basename.asc
18126 \backslash
18127 ")"
18128 \end_layout
18129
18130 \begin_layout LyX-Code
18131 UpdateFormat asciixfig
18132 \end_layout
18133
18134 \begin_layout LyX-Code
18135 UpdateResult "$$AbsPath$$Basename.asc"
18136 \end_layout
18137
18138 \begin_layout LyX-Code
18139 FormatEnd
18140 \end_layout
18141
18142 \begin_layout LyX-Code
18143 Format DocBook
18144 \end_layout
18145
18146 \begin_layout LyX-Code
18147 Product "<graphic fileref=
18148 \backslash
18149 "$$AbsOrRelPathMaster$$Basename.eps
18150 \backslash
18151 ">
18152 \end_layout
18153
18154 \begin_layout LyX-Code
18155          </graphic>"
18156 \end_layout
18157
18158 \begin_layout LyX-Code
18159 UpdateFormat eps
18160 \end_layout
18161
18162 \begin_layout LyX-Code
18163 UpdateResult "$$AbsPath$$Basename.eps"
18164 \end_layout
18165
18166 \begin_layout LyX-Code
18167 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18168 \end_layout
18169
18170 \begin_layout LyX-Code
18171 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18172 \end_layout
18173
18174 \begin_layout LyX-Code
18175 FormatEnd
18176 \end_layout
18177
18178 \begin_layout LyX-Code
18179 Product "[XFig: $$FName]"
18180 \end_layout
18181
18182 \begin_layout LyX-Code
18183 FormatEnd
18184 \end_layout
18185
18186 \begin_layout LyX-Code
18187 TemplateEnd
18188 \end_layout
18189
18190 \begin_layout Standard
18191 As you can see, the template is enclosed in 
18192 \begin_inset Flex CharStyle:Code
18193 status collapsed
18194
18195 \begin_layout Plain Layout
18196 Template
18197 \end_layout
18198
18199 \end_inset
18200
18201  \SpecialChar \ldots{}
18202  
18203 \begin_inset Flex CharStyle:Code
18204 status collapsed
18205
18206 \begin_layout Plain Layout
18207 TemplateEnd
18208 \end_layout
18209
18210 \end_inset
18211
18212 .
18213  It contains a header specifying some general settings and, for each supported
18214  primary document file format, a section 
18215 \begin_inset Flex CharStyle:Code
18216 status collapsed
18217
18218 \begin_layout Plain Layout
18219 Format
18220 \end_layout
18221
18222 \end_inset
18223
18224  \SpecialChar \ldots{}
18225  
18226 \begin_inset Flex CharStyle:Code
18227 status collapsed
18228
18229 \begin_layout Plain Layout
18230 FormatEnd
18231 \end_layout
18232
18233 \end_inset
18234
18235 .
18236 \end_layout
18237
18238 \begin_layout Subsection
18239 The template header
18240 \end_layout
18241
18242 \begin_layout Description
18243 \begin_inset Flex CharStyle:Code
18244 status collapsed
18245
18246 \begin_layout Plain Layout
18247 AutomaticProduction
18248 \begin_inset space ~
18249 \end_inset
18250
18251 true|false
18252 \end_layout
18253
18254 \end_inset
18255
18256  Whether the file represented by the template must be generated by LyX.
18257  This command must occur exactly once.
18258 \end_layout
18259
18260 \begin_layout Description
18261 \begin_inset Flex CharStyle:Code
18262 status collapsed
18263
18264 \begin_layout Plain Layout
18265 FileFilter
18266 \begin_inset space ~
18267 \end_inset
18268
18269 <pattern>
18270 \end_layout
18271
18272 \end_inset
18273
18274  A glob pattern that is used in the file dialog to filter out the desired
18275  files.
18276  If there is more than one possible file extension (e.
18277 \begin_inset space \thinspace{}
18278 \end_inset
18279
18280 g.
18281 \begin_inset space \space{}
18282 \end_inset
18283
18284 tgif has 
18285 \begin_inset Flex CharStyle:Code
18286 status collapsed
18287
18288 \begin_layout Plain Layout
18289 .obj
18290 \end_layout
18291
18292 \end_inset
18293
18294  and 
18295 \begin_inset Flex CharStyle:Code
18296 status collapsed
18297
18298 \begin_layout Plain Layout
18299 .tgo
18300 \end_layout
18301
18302 \end_inset
18303
18304 ), use something like 
18305 \begin_inset Flex CharStyle:Code
18306 status collapsed
18307
18308 \begin_layout Plain Layout
18309 "*.{obj,tgo}"
18310 \end_layout
18311
18312 \end_inset
18313
18314 .
18315  This command must occur exactly once.
18316 \end_layout
18317
18318 \begin_layout Description
18319 \begin_inset Flex CharStyle:Code
18320 status collapsed
18321
18322 \begin_layout Plain Layout
18323 GuiName
18324 \begin_inset space ~
18325 \end_inset
18326
18327 <guiname>
18328 \end_layout
18329
18330 \end_inset
18331
18332  The text that is displayed on the button.
18333  This command must occur exactly once.
18334 \end_layout
18335
18336 \begin_layout Description
18337 \begin_inset Flex CharStyle:Code
18338 status collapsed
18339
18340 \begin_layout Plain Layout
18341 HelpText
18342 \begin_inset space ~
18343 \end_inset
18344
18345 <text>
18346 \begin_inset space ~
18347 \end_inset
18348
18349 HelpTextEnd
18350 \end_layout
18351
18352 \end_inset
18353
18354  The help text that is used in the External dialog.
18355  Provide enough information to explain to the user just what the template
18356  can provide him with.
18357  This command must occur exactly once.
18358 \end_layout
18359
18360 \begin_layout Description
18361 \begin_inset Flex CharStyle:Code
18362 status collapsed
18363
18364 \begin_layout Plain Layout
18365 InputFormat
18366 \begin_inset space ~
18367 \end_inset
18368
18369 <format>
18370 \end_layout
18371
18372 \end_inset
18373
18374  The file format of the original file.
18375  This must be the name of a format that is known to LyX (see section 
18376 \begin_inset CommandInset ref
18377 LatexCommand ref
18378 reference "sec:Formats"
18379
18380 \end_inset
18381
18382 ).
18383  Use 
18384 \begin_inset Quotes eld
18385 \end_inset
18386
18387
18388 \begin_inset Flex CharStyle:Code
18389 status collapsed
18390
18391 \begin_layout Plain Layout
18392 *
18393 \end_layout
18394
18395 \end_inset
18396
18397
18398 \begin_inset Quotes erd
18399 \end_inset
18400
18401  if the template can handle original files of more than one format.
18402  LyX will attempt to interrogate the file itself in order to deduce its
18403  format in this case.
18404  This command must occur exactly once.
18405 \end_layout
18406
18407 \begin_layout Description
18408 \begin_inset Flex CharStyle:Code
18409 status collapsed
18410
18411 \begin_layout Plain Layout
18412 Template
18413 \begin_inset space ~
18414 \end_inset
18415
18416 <id>
18417 \end_layout
18418
18419 \end_inset
18420
18421  A unique name for the template.
18422  It must not contain substitution macros (see below).
18423 \end_layout
18424
18425 \begin_layout Description
18426 \begin_inset Flex CharStyle:Code
18427 status collapsed
18428
18429 \begin_layout Plain Layout
18430 Transform
18431 \begin_inset space ~
18432 \end_inset
18433
18434 Rotate|Resize|Clip|Extra
18435 \end_layout
18436
18437 \end_inset
18438
18439  This command specifies which transformations are supported by this template.
18440  It may occur zero or more times.
18441  This command enables the corresponding tabs in the external dialog.
18442  Each 
18443 \begin_inset Flex CharStyle:Code
18444 status collapsed
18445
18446 \begin_layout Plain Layout
18447 Transform
18448 \end_layout
18449
18450 \end_inset
18451
18452  command must have either a corresponding 
18453 \begin_inset Flex CharStyle:Code
18454 status collapsed
18455
18456 \begin_layout Plain Layout
18457 TransformCommand
18458 \end_layout
18459
18460 \end_inset
18461
18462  or a 
18463 \begin_inset Flex CharStyle:Code
18464 status collapsed
18465
18466 \begin_layout Plain Layout
18467 TransformOption
18468 \end_layout
18469
18470 \end_inset
18471
18472  command in the 
18473 \begin_inset Flex CharStyle:Code
18474 status collapsed
18475
18476 \begin_layout Plain Layout
18477 Format
18478 \end_layout
18479
18480 \end_inset
18481
18482  section.
18483  Otherwise the transformation will not be supported by that format.
18484 \end_layout
18485
18486 \begin_layout Subsection
18487 The Format section
18488 \end_layout
18489
18490 \begin_layout Description
18491 \begin_inset Flex CharStyle:Code
18492 status collapsed
18493
18494 \begin_layout Plain Layout
18495 Format
18496 \begin_inset space ~
18497 \end_inset
18498
18499 LaTeX|PDFLaTeX|PlainText|DocBook
18500 \end_layout
18501
18502 \end_inset
18503
18504  The primary document file format that this format definition is for.
18505  Not every template has a sensible representation in all document file formats.
18506  Please define nevertheless a 
18507 \begin_inset Flex CharStyle:Code
18508 status collapsed
18509
18510 \begin_layout Plain Layout
18511 Format
18512 \end_layout
18513
18514 \end_inset
18515
18516  section for all formats.
18517  Use a dummy text when no representation is available.
18518  Then you can at least see a reference to the external material in the exported
18519  document.
18520 \end_layout
18521
18522 \begin_layout Description
18523 \begin_inset Flex CharStyle:Code
18524 status collapsed
18525
18526 \begin_layout Plain Layout
18527 Option
18528 \begin_inset space ~
18529 \end_inset
18530
18531 <name>
18532 \begin_inset space ~
18533 \end_inset
18534
18535 <value>
18536 \end_layout
18537
18538 \end_inset
18539
18540  This command defines an additional macro 
18541 \begin_inset Flex CharStyle:Code
18542 status collapsed
18543
18544 \begin_layout Plain Layout
18545 $$<name>
18546 \end_layout
18547
18548 \end_inset
18549
18550  for substitution in 
18551 \begin_inset Flex CharStyle:Code
18552 status collapsed
18553
18554 \begin_layout Plain Layout
18555 Product
18556 \end_layout
18557
18558 \end_inset
18559
18560 .
18561  
18562 \begin_inset Flex CharStyle:Code
18563 status collapsed
18564
18565 \begin_layout Plain Layout
18566 <value>
18567 \end_layout
18568
18569 \end_inset
18570
18571  itself may contain substitution macros.
18572  The advantage over using 
18573 \begin_inset Flex CharStyle:Code
18574 status collapsed
18575
18576 \begin_layout Plain Layout
18577 <value>
18578 \end_layout
18579
18580 \end_inset
18581
18582  directly in 
18583 \begin_inset Flex CharStyle:Code
18584 status collapsed
18585
18586 \begin_layout Plain Layout
18587 Product
18588 \end_layout
18589
18590 \end_inset
18591
18592  is that the substituted value of 
18593 \begin_inset Flex CharStyle:Code
18594 status collapsed
18595
18596 \begin_layout Plain Layout
18597 $$<name>
18598 \end_layout
18599
18600 \end_inset
18601
18602  is sanitized so that it is a valid optional argument in the document format.
18603  This command may occur zero or more times.
18604 \end_layout
18605
18606 \begin_layout Description
18607 \begin_inset Flex CharStyle:Code
18608 status collapsed
18609
18610 \begin_layout Plain Layout
18611 Product
18612 \begin_inset space ~
18613 \end_inset
18614
18615 <text>
18616 \end_layout
18617
18618 \end_inset
18619
18620  The text that is inserted in the exported document.
18621  This is actually the most important command and can be quite complex.
18622  This command must occur exactly once.
18623 \end_layout
18624
18625 \begin_layout Description
18626 \begin_inset Flex CharStyle:Code
18627 status collapsed
18628
18629 \begin_layout Plain Layout
18630 Preamble
18631 \begin_inset space ~
18632 \end_inset
18633
18634 <name>
18635 \end_layout
18636
18637 \end_inset
18638
18639  This command specifies a preamble snippet that will be included in the
18640  LaTeX preamble.
18641  It has to be defined using 
18642 \begin_inset Flex CharStyle:Code
18643 status collapsed
18644
18645 \begin_layout Plain Layout
18646 PreambleDef
18647 \end_layout
18648
18649 \end_inset
18650
18651  \SpecialChar \ldots{}
18652  
18653 \begin_inset Flex CharStyle:Code
18654 status collapsed
18655
18656 \begin_layout Plain Layout
18657 PreambleDefEnd
18658 \end_layout
18659
18660 \end_inset
18661
18662 .
18663  This command may occur zero or more times.
18664 \end_layout
18665
18666 \begin_layout Description
18667 \begin_inset Flex CharStyle:Code
18668 status collapsed
18669
18670 \begin_layout Plain Layout
18671 ReferencedFile
18672 \begin_inset space ~
18673 \end_inset
18674
18675 <format>
18676 \begin_inset space ~
18677 \end_inset
18678
18679 <filename>
18680 \end_layout
18681
18682 \end_inset
18683
18684  This command denotes files that are created by the conversion process and
18685  are needed for a particular export format.
18686  If the filename is relative, it is interpreted relative to the master document.
18687  This command may be given zero or more times.
18688 \end_layout
18689
18690 \begin_layout Description
18691 \begin_inset Flex CharStyle:Code
18692 status collapsed
18693
18694 \begin_layout Plain Layout
18695 Requirement
18696 \begin_inset space ~
18697 \end_inset
18698
18699 <package>
18700 \end_layout
18701
18702 \end_inset
18703
18704  The name of a required LaTeX package.
18705  The package is included via 
18706 \begin_inset Flex CharStyle:Code
18707 status collapsed
18708
18709 \begin_layout Plain Layout
18710
18711 \backslash
18712 usepackage{}
18713 \end_layout
18714
18715 \end_inset
18716
18717  in the LaTeX preamble.
18718  This command may occur zero or more times.
18719 \end_layout
18720
18721 \begin_layout Description
18722 \begin_inset Flex CharStyle:Code
18723 status collapsed
18724
18725 \begin_layout Plain Layout
18726 TransformCommand
18727 \begin_inset space ~
18728 \end_inset
18729
18730 Rotate
18731 \begin_inset space ~
18732 \end_inset
18733
18734 RotationLatexCommand
18735 \end_layout
18736
18737 \end_inset
18738
18739  This command specifies that the built in LaTeX command should be used for
18740  rotation.
18741  This command may occur once or not at all.
18742 \end_layout
18743
18744 \begin_layout Description
18745 \begin_inset Flex CharStyle:Code
18746 status collapsed
18747
18748 \begin_layout Plain Layout
18749 TransformCommand
18750 \begin_inset space ~
18751 \end_inset
18752
18753 Resize
18754 \begin_inset space ~
18755 \end_inset
18756
18757 ResizeLatexCommand
18758 \end_layout
18759
18760 \end_inset
18761
18762  This command specifies that the built in LaTeX command should be used for
18763  resizing.
18764  This command may occur once or not at all.
18765 \end_layout
18766
18767 \begin_layout Description
18768 \begin_inset Flex CharStyle:Code
18769 status collapsed
18770
18771 \begin_layout Plain Layout
18772 TransformOption
18773 \begin_inset space ~
18774 \end_inset
18775
18776 Rotate
18777 \begin_inset space ~
18778 \end_inset
18779
18780 RotationLatexOption
18781 \end_layout
18782
18783 \end_inset
18784
18785  This command specifies that rotation is done via an optional argument.
18786  This command may occur once or not at all.
18787 \end_layout
18788
18789 \begin_layout Description
18790 \begin_inset Flex CharStyle:Code
18791 status collapsed
18792
18793 \begin_layout Plain Layout
18794 TransformOption
18795 \begin_inset space ~
18796 \end_inset
18797
18798 Resize
18799 \begin_inset space ~
18800 \end_inset
18801
18802 ResizeLatexOption
18803 \end_layout
18804
18805 \end_inset
18806
18807  This command specifies that resizing is done via an optional argument.
18808  This command may occur once or not at all.
18809 \end_layout
18810
18811 \begin_layout Description
18812 \begin_inset Flex CharStyle:Code
18813 status collapsed
18814
18815 \begin_layout Plain Layout
18816 TransformOption
18817 \begin_inset space ~
18818 \end_inset
18819
18820 Clip
18821 \begin_inset space ~
18822 \end_inset
18823
18824 ClipLatexOption
18825 \end_layout
18826
18827 \end_inset
18828
18829  This command specifies that clipping is done via an optional argument.
18830  This command may occur once or not at all.
18831 \end_layout
18832
18833 \begin_layout Description
18834 \begin_inset Flex CharStyle:Code
18835 status collapsed
18836
18837 \begin_layout Plain Layout
18838 TransformOption
18839 \begin_inset space ~
18840 \end_inset
18841
18842 Extra
18843 \begin_inset space ~
18844 \end_inset
18845
18846 ExtraLatexOption
18847 \end_layout
18848
18849 \end_inset
18850
18851  This command specifies that an extra optional argument is used.
18852  This command may occur once or not at all.
18853 \end_layout
18854
18855 \begin_layout Description
18856 \begin_inset Flex CharStyle:Code
18857 status collapsed
18858
18859 \begin_layout Plain Layout
18860 UpdateFormat
18861 \begin_inset space ~
18862 \end_inset
18863
18864 <format>
18865 \end_layout
18866
18867 \end_inset
18868
18869  The file format of the converted file.
18870  This must be the name of a format that is known to LyX (see the 
18871 \begin_inset Flex CharStyle:MenuItem
18872 status collapsed
18873
18874 \begin_layout Plain Layout
18875
18876 \bar under
18877 T
18878 \bar default
18879 ools\SpecialChar \menuseparator
18880
18881 \bar under
18882 P
18883 \bar default
18884 references:Conversion
18885 \end_layout
18886
18887 \end_inset
18888
18889  dialog).
18890  This command must occur exactly once.
18891 \end_layout
18892
18893 \begin_layout Description
18894 \begin_inset Flex CharStyle:Code
18895 status collapsed
18896
18897 \begin_layout Plain Layout
18898 UpdateResult
18899 \begin_inset space ~
18900 \end_inset
18901
18902 <filename>
18903 \end_layout
18904
18905 \end_inset
18906
18907  The file name of the converted file.
18908  The file name must be absolute.
18909  This command must occur exactly once.
18910 \end_layout
18911
18912 \begin_layout Subsection
18913 Preamble definitions
18914 \end_layout
18915
18916 \begin_layout Standard
18917 The external template configuration file may contain additional preamble
18918  definitions enclosed by 
18919 \begin_inset Flex CharStyle:Code
18920 status collapsed
18921
18922 \begin_layout Plain Layout
18923 PreambleDef
18924 \end_layout
18925
18926 \end_inset
18927
18928  \SpecialChar \ldots{}
18929  
18930 \begin_inset Flex CharStyle:Code
18931 status collapsed
18932
18933 \begin_layout Plain Layout
18934 PreambleDefEnd
18935 \end_layout
18936
18937 \end_inset
18938
18939 .
18940  They can be used by the templates in the 
18941 \begin_inset Flex CharStyle:Code
18942 status collapsed
18943
18944 \begin_layout Plain Layout
18945 Format
18946 \end_layout
18947
18948 \end_inset
18949
18950  section.
18951 \end_layout
18952
18953 \begin_layout Section
18954 The substitution mechanism
18955 \end_layout
18956
18957 \begin_layout Standard
18958 When the external material facility invokes an external program, it is done
18959  on the basis of a command defined in the template configuration file.
18960  These commands can contain various macros that are expanded before execution.
18961  Execution always take place in the directory of the containing document.
18962 \end_layout
18963
18964 \begin_layout Standard
18965 Also, whenever external material is to be displayed, the name will be produced
18966  by the substitution mechanism, and most other commands in the template
18967  definition support substitution as well.
18968 \end_layout
18969
18970 \begin_layout Standard
18971 The available macros are the following:
18972 \end_layout
18973
18974 \begin_layout Description
18975 \begin_inset Flex CharStyle:Code
18976 status collapsed
18977
18978 \begin_layout Plain Layout
18979 $$AbsOrRelPathMaster
18980 \end_layout
18981
18982 \end_inset
18983
18984  The file path, absolute or relative to the master LyX document.
18985 \end_layout
18986
18987 \begin_layout Description
18988 \begin_inset Flex CharStyle:Code
18989 status collapsed
18990
18991 \begin_layout Plain Layout
18992 $$AbsOrRelPathParent
18993 \end_layout
18994
18995 \end_inset
18996
18997  The file path, absolute or relative to the LyX document.
18998 \end_layout
18999
19000 \begin_layout Description
19001 \begin_inset Flex CharStyle:Code
19002 status collapsed
19003
19004 \begin_layout Plain Layout
19005 $$AbsPath
19006 \end_layout
19007
19008 \end_inset
19009
19010  The absolute file path.
19011 \end_layout
19012
19013 \begin_layout Description
19014 \begin_inset Flex CharStyle:Code
19015 status collapsed
19016
19017 \begin_layout Plain Layout
19018 $$Basename
19019 \end_layout
19020
19021 \end_inset
19022
19023  The filename without path and without the extension.
19024 \end_layout
19025
19026 \begin_layout Description
19027 \begin_inset Flex CharStyle:Code
19028 status collapsed
19029
19030 \begin_layout Plain Layout
19031 $$Contents(
19032 \begin_inset Quotes eld
19033 \end_inset
19034
19035 filename.ext
19036 \begin_inset Quotes erd
19037 \end_inset
19038
19039 )
19040 \end_layout
19041
19042 \end_inset
19043
19044  This macro will expand to the contents of the file with the name 
19045 \begin_inset Flex CharStyle:Code
19046 status collapsed
19047
19048 \begin_layout Plain Layout
19049 filename.ext
19050 \end_layout
19051
19052 \end_inset
19053
19054 .
19055 \end_layout
19056
19057 \begin_layout Description
19058 \begin_inset Flex CharStyle:Code
19059 status collapsed
19060
19061 \begin_layout Plain Layout
19062 $$Extension
19063 \end_layout
19064
19065 \end_inset
19066
19067  The file extension (including the dot).
19068 \end_layout
19069
19070 \begin_layout Description
19071 \begin_inset Flex CharStyle:Code
19072 status collapsed
19073
19074 \begin_layout Plain Layout
19075 $$FName
19076 \end_layout
19077
19078 \end_inset
19079
19080  The filename of the file specified in the external material dialog.
19081  This is either an absolute name, or it is relative to the LyX document.
19082 \end_layout
19083
19084 \begin_layout Description
19085 \begin_inset Flex CharStyle:Code
19086 status collapsed
19087
19088 \begin_layout Plain Layout
19089 $$FPath
19090 \end_layout
19091
19092 \end_inset
19093
19094  The path part of 
19095 \begin_inset Flex CharStyle:Code
19096 status collapsed
19097
19098 \begin_layout Plain Layout
19099 $$FName
19100 \end_layout
19101
19102 \end_inset
19103
19104  (absolute name or relative to the LyX document).
19105 \end_layout
19106
19107 \begin_layout Description
19108 \begin_inset Flex CharStyle:Code
19109 status collapsed
19110
19111 \begin_layout Plain Layout
19112 $$RelPathMaster
19113 \end_layout
19114
19115 \end_inset
19116
19117  The file path, relative to the master LyX document.
19118 \end_layout
19119
19120 \begin_layout Description
19121 \begin_inset Flex CharStyle:Code
19122 status collapsed
19123
19124 \begin_layout Plain Layout
19125 $$RelPathParent
19126 \end_layout
19127
19128 \end_inset
19129
19130  The file path, relative to the LyX document.
19131 \end_layout
19132
19133 \begin_layout Description
19134 \begin_inset Flex CharStyle:Code
19135 status collapsed
19136
19137 \begin_layout Plain Layout
19138 $$Sysdir
19139 \end_layout
19140
19141 \end_inset
19142
19143  This macro will expand to the absolute path of the system directory.
19144  This is typically used to point to the various helper scripts that are
19145  bundled with LyX.
19146 \end_layout
19147
19148 \begin_layout Description
19149 \begin_inset Flex CharStyle:Code
19150 status collapsed
19151
19152 \begin_layout Plain Layout
19153 $$Tempname
19154 \end_layout
19155
19156 \end_inset
19157
19158  A name and full path to a temporary file which will be automatically deleted
19159  whenever the containing document is closed, or the external material insertion
19160  deleted.
19161 \end_layout
19162
19163 \begin_layout Standard
19164 All path macros contain a trailing directory separator, so you can construct
19165  e.
19166 \begin_inset space \thinspace{}
19167 \end_inset
19168
19169 g.
19170 \begin_inset space \space{}
19171 \end_inset
19172
19173 the absolute filename with 
19174 \begin_inset Flex CharStyle:Code
19175 status collapsed
19176
19177 \begin_layout Plain Layout
19178 $$AbsPath$$Basename$$Extension
19179 \end_layout
19180
19181 \end_inset
19182
19183 .
19184 \end_layout
19185
19186 \begin_layout Standard
19187 The macros above are substituted in all commands unless otherwise noted.
19188  The command 
19189 \begin_inset Flex CharStyle:Code
19190 status collapsed
19191
19192 \begin_layout Plain Layout
19193 Product
19194 \end_layout
19195
19196 \end_inset
19197
19198  supports additionally the following substitutions if they are enabled by
19199  the 
19200 \begin_inset Flex CharStyle:Code
19201 status collapsed
19202
19203 \begin_layout Plain Layout
19204 Transform
19205 \end_layout
19206
19207 \end_inset
19208
19209  and 
19210 \begin_inset Flex CharStyle:Code
19211 status collapsed
19212
19213 \begin_layout Plain Layout
19214 TransformCommand
19215 \end_layout
19216
19217 \end_inset
19218
19219  commands:
19220 \end_layout
19221
19222 \begin_layout Description
19223 \begin_inset Flex CharStyle:Code
19224 status collapsed
19225
19226 \begin_layout Plain Layout
19227 $$ResizeFront
19228 \end_layout
19229
19230 \end_inset
19231
19232  The front part of the resize command.
19233 \end_layout
19234
19235 \begin_layout Description
19236 \begin_inset Flex CharStyle:Code
19237 status collapsed
19238
19239 \begin_layout Plain Layout
19240 $$ResizeBack
19241 \end_layout
19242
19243 \end_inset
19244
19245  The back part of the resize command.
19246 \end_layout
19247
19248 \begin_layout Description
19249 \begin_inset Flex CharStyle:Code
19250 status collapsed
19251
19252 \begin_layout Plain Layout
19253 $$RotateFront
19254 \end_layout
19255
19256 \end_inset
19257
19258  The front part of the rotation command.
19259 \end_layout
19260
19261 \begin_layout Description
19262 \begin_inset Flex CharStyle:Code
19263 status collapsed
19264
19265 \begin_layout Plain Layout
19266 $$RotateBack
19267 \end_layout
19268
19269 \end_inset
19270
19271  The back part of the rotation command.
19272 \end_layout
19273
19274 \begin_layout Standard
19275 The value string of the 
19276 \begin_inset Flex CharStyle:Code
19277 status collapsed
19278
19279 \begin_layout Plain Layout
19280 Option
19281 \end_layout
19282
19283 \end_inset
19284
19285  command supports additionally the following substitutions if they are enabled
19286  by the 
19287 \begin_inset Flex CharStyle:Code
19288 status collapsed
19289
19290 \begin_layout Plain Layout
19291 Transform
19292 \end_layout
19293
19294 \end_inset
19295
19296  and 
19297 \begin_inset Flex CharStyle:Code
19298 status collapsed
19299
19300 \begin_layout Plain Layout
19301 TransformOption
19302 \end_layout
19303
19304 \end_inset
19305
19306  commands:
19307 \end_layout
19308
19309 \begin_layout Description
19310 \begin_inset Flex CharStyle:Code
19311 status collapsed
19312
19313 \begin_layout Plain Layout
19314 $$Clip
19315 \end_layout
19316
19317 \end_inset
19318
19319  The clip option.
19320 \end_layout
19321
19322 \begin_layout Description
19323 \begin_inset Flex CharStyle:Code
19324 status collapsed
19325
19326 \begin_layout Plain Layout
19327 $$Extra
19328 \end_layout
19329
19330 \end_inset
19331
19332  The extra option.
19333 \end_layout
19334
19335 \begin_layout Description
19336 \begin_inset Flex CharStyle:Code
19337 status collapsed
19338
19339 \begin_layout Plain Layout
19340 $$Resize
19341 \end_layout
19342
19343 \end_inset
19344
19345  The resize option.
19346 \end_layout
19347
19348 \begin_layout Description
19349 \begin_inset Flex CharStyle:Code
19350 status collapsed
19351
19352 \begin_layout Plain Layout
19353 $$Rotate
19354 \end_layout
19355
19356 \end_inset
19357
19358  The rotation option.
19359 \end_layout
19360
19361 \begin_layout Standard
19362 You may ask why there are so many path macros.
19363  There are mainly two reasons:
19364 \end_layout
19365
19366 \begin_layout Enumerate
19367 Relative and absolute file names should remain relative or absolute, respectivel
19368 y.
19369  Users may have reasons to prefer either form.
19370  Relative names are useful for portable documents that should work on different
19371  machines, for example.
19372  Absolute names may be required by some programs.
19373 \end_layout
19374
19375 \begin_layout Enumerate
19376 LaTeX treats relative file names differently than LyX and other programs
19377  in nested included files.
19378  For LyX, a relative file name is always relative to the document that contains
19379  the file name.
19380  For LaTeX, it is always relative to the master document.
19381  These two definitions are identical if you have only one document, but
19382  differ if you have a master document that includes part documents.
19383  That means that relative filenames must be transformed when presented to
19384  LaTeX.
19385  Fortunately LyX does this automatically for you if you choose the right
19386  macros.
19387 \end_layout
19388
19389 \begin_layout Standard
19390 So which path macro should be used in new template definitions? The rule
19391  is not difficult:
19392 \end_layout
19393
19394 \begin_layout Itemize
19395 Use 
19396 \begin_inset Flex CharStyle:Code
19397 status collapsed
19398
19399 \begin_layout Plain Layout
19400 $$AbsPath
19401 \end_layout
19402
19403 \end_inset
19404
19405  if an absolute path is required.
19406 \end_layout
19407
19408 \begin_layout Itemize
19409 Use 
19410 \begin_inset Flex CharStyle:Code
19411 status collapsed
19412
19413 \begin_layout Plain Layout
19414 $$AbsOrRelPathMaster
19415 \end_layout
19416
19417 \end_inset
19418
19419  if the substituted string is some kind of LaTeX input.
19420 \end_layout
19421
19422 \begin_layout Itemize
19423 Else use 
19424 \begin_inset Flex CharStyle:Code
19425 status collapsed
19426
19427 \begin_layout Plain Layout
19428 $$AbsOrRelPathParent
19429 \end_layout
19430
19431 \end_inset
19432
19433  in order to preserve the user's choice.
19434 \end_layout
19435
19436 \begin_layout Standard
19437 There are special cases where this rule does not work and e.
19438 \begin_inset space \thinspace{}
19439 \end_inset
19440
19441 g.
19442 \begin_inset space \space{}
19443 \end_inset
19444
19445 relative names are needed, but normally it will work just fine.
19446  One example for such a case is the command 
19447 \begin_inset Flex CharStyle:Code
19448 status collapsed
19449
19450 \begin_layout Plain Layout
19451 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19452 \end_layout
19453
19454 \end_inset
19455
19456  in the XFig template above: We can't use the absolute name because the
19457  copier for 
19458 \begin_inset Flex CharStyle:Code
19459 status collapsed
19460
19461 \begin_layout Plain Layout
19462 .pstex_t
19463 \end_layout
19464
19465 \end_inset
19466
19467  files needs the relative name in order to rewrite the file content.
19468 \end_layout
19469
19470 \begin_layout Section
19471 Security discussion
19472 \begin_inset CommandInset label
19473 LatexCommand label
19474 name "sec:Security-discussion"
19475
19476 \end_inset
19477
19478
19479 \end_layout
19480
19481 \begin_layout Standard
19482 The external material feature interfaces with a lot of external programs
19483  and does so automatically, so we have to consider the security implications
19484  of this.
19485  In particular, since you have the option of including your own filenames
19486  and/or parameter strings and those are expanded into a command, it seems
19487  that it would be possible to create a malicious document which executes
19488  arbitrary commands when a user views or prints the document.
19489  This is something we definitely want to avoid.
19490 \end_layout
19491
19492 \begin_layout Standard
19493 However, since the external program commands are specified in the template
19494  configuration file only, there are no security issues if LyX is properly
19495  configured with safe templates only.
19496  This is so because the external programs are invoked with the 
19497 \begin_inset Flex CharStyle:Code
19498 status collapsed
19499
19500 \begin_layout Plain Layout
19501 execvp
19502 \end_layout
19503
19504 \end_inset
19505
19506 -system call rather than the 
19507 \begin_inset Flex CharStyle:Code
19508 status collapsed
19509
19510 \begin_layout Plain Layout
19511 system
19512 \end_layout
19513
19514 \end_inset
19515
19516  system-call, so it's not possible to execute arbitrary commands from the
19517  filename or parameter section via the shell.
19518 \end_layout
19519
19520 \begin_layout Standard
19521 This also implies that you are restricted in what command strings you can
19522  use in the external material templates.
19523  In particular, pipes and redirection are not readily available.
19524  This has to be so if LyX should remain safe.
19525  If you want to use some of the shell features, you should write a safe
19526  script to do this in a controlled manner, and then invoke the script from
19527  the command string.
19528  
19529 \end_layout
19530
19531 \begin_layout Standard
19532 It is possible to design a template that interacts directly with the shell,
19533  but since this would allow a malicious user to execute arbitrary commands
19534  by writing clever filenames and/or parameters, we generally recommend that
19535  you only use safe scripts that work with the 
19536 \begin_inset Flex CharStyle:Code
19537 status collapsed
19538
19539 \begin_layout Plain Layout
19540 execvp
19541 \end_layout
19542
19543 \end_inset
19544
19545  system call in a controlled manner.
19546  Of course, for use in a controlled environment, it can be tempting to just
19547  fall back to use ordinary shell scripts.
19548  If you do so, be aware that you 
19549 \emph on
19550 will
19551 \emph default
19552  provide an easily exploitable security hole in your system.
19553  Of course it stands to reason that such unsafe templates will never be
19554  included in the standard LyX distribution, although we do encourage people
19555  to submit new templates in the open source tradition.
19556  But LyX as shipped from the official distribution channels will never have
19557  unsafe templates.
19558 \end_layout
19559
19560 \begin_layout Standard
19561 Including external material provides a lot of power, and you have to be
19562  careful not to introduce security hazards with this power.
19563  A subtle error in a single line in an innocent looking script can open
19564  the door to huge security problems.
19565  So if you do not fully understand the issues, we recommend that you consult
19566  a knowledgeable security professional or the LyX development team if you
19567  have any questions about whether a given template is safe or not.
19568  And do this before you use it in an uncontrolled environment.
19569 \end_layout
19570
19571 \end_body
19572 \end_document