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