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