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