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