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