1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
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
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
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{%
30 \pdfbookmark[1]{\contentsname}{}
34 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
35 \use_default_options false
39 \maintain_unincluded_children false
42 InsetLayout Flex:MenuItem
51 \newcommand*{\menuitem}[1]{{\sffamily #1}}
54 # In case we need to do with sans...
55 #InsetLayout CharStyle:Code
60 #\renewcommand{\code}[1]{{\sffamily #1}}
65 \language_package default
70 \font_typewriter default
71 \font_default_family default
72 \use_non_tex_fonts false
79 \default_output_format default
81 \bibtex_command default
82 \index_command default
86 \pdf_title "LyX Configuration Manual"
87 \pdf_author "LyX Team"
88 \pdf_subject "LyX-documentation Customization"
89 \pdf_keywords "LyX, documentation, customization"
91 \pdf_bookmarksnumbered true
92 \pdf_bookmarksopen true
93 \pdf_bookmarksopenlevel 1
98 \pdf_pdfusetitle false
99 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
109 \paperorientation portrait
123 \paragraph_separation indent
124 \paragraph_indentation default
125 \quotes_language english
128 \paperpagestyle headings
129 \tracking_changes true
130 \output_changes false
134 \author -195340706 "Georg Baum"
140 Customizing LyX: Features for the Advanced User
148 \begin_layout Plain Layout
150 If you have comments or error corrections, please send them to the LyX Documenta
152 \begin_inset CommandInset href
154 target "lyx-docs@lists.lyx.org"
161 \begin_inset Quotes eld
165 \begin_inset Quotes erd
168 in the subject header, and please cc the current maintainer of this file,
169 Richard Heck <rgheck@comcast.net>.
175 \begin_inset Newline newline
179 \begin_inset Newline newline
185 \begin_layout Standard
186 \begin_inset CommandInset toc
187 LatexCommand tableofcontents
194 \begin_layout Standard
195 \begin_inset Note Note
198 \begin_layout Plain Layout
199 Please use change tracking when modifying this document.
200 This makes it easier for our translators to recognize things that have
201 been changed, and it helps the maintainer keep up-to-date with what's been
210 \begin_layout Chapter
214 \begin_layout Standard
215 This manual covers the customization features present in LyX.
216 In it, we discuss issues like keyboard shortcuts, screen previewing options,
217 printer options, sending commands to LyX via the LyX Server, internationalizati
218 on, installing new LaTeX classes and LyX layouts, etc.
219 We can't possibly hope to touch on everything you can change—our developers
220 add new features faster than we can document them—but we will explain the
221 most common customizations and hopefully point you in the right direction
222 for some of the more obscure ones.
225 \begin_layout Standard
226 \begin_inset Branch OutDated
229 \begin_layout Standard
230 Information from previous versions of this document that now seems to be
231 outdated is contained in the OutDated branch of this document.
232 By default, this information will not appear in the LaTeX output.
240 \begin_layout Chapter
241 LyX configuration files
244 \begin_layout Standard
245 This chapter aims to help you to find your way through the LyX configuration
247 Before continuing to read this chapter, you should find out where your
248 LyX library and user directories are by using
249 \begin_inset Flex MenuItem
252 \begin_layout Plain Layout
253 Help\SpecialChar \menuseparator
264 The library directory is the place where LyX places its system-wide configurati
265 on files; the user directory is where you can place your modified versions.
266 We will call the former
267 \begin_inset Flex Code
270 \begin_layout Plain Layout
277 \begin_inset Flex MenuItem
280 \begin_layout Plain Layout
286 in the remainder of this document.
290 \begin_layout Section
292 \begin_inset Flex Code
295 \begin_layout Plain Layout
304 \begin_layout Standard
305 \begin_inset Flex Code
308 \begin_layout Plain Layout
314 and its sub-directories contain a number of files and that can be used
315 to customize LyX's behavior.
316 You can change many of these files from within LyX itself through the
317 \begin_inset Flex MenuItem
320 \begin_layout Plain Layout
321 Tools\SpecialChar \menuseparator
328 Most customization that you will want to do in LyX is possible through
330 However, many other inner aspects of LyX can be customized by modifying
332 \begin_inset Flex Code
335 \begin_layout Plain Layout
342 These files fall in different categories, described in the following subsection
346 \begin_layout Subsection
347 Automatically generated files
350 \begin_layout Standard
351 The files, which are to be found in
352 \begin_inset Flex MenuItem
355 \begin_layout Plain Layout
361 , are generated when you configure LyX.
362 They contain various default values that are guessed by inspection.
363 In general, it is not a good idea to modify them, since they might be overwritt
367 \begin_layout Labeling
368 \labelwidthstring 00.00.0000
369 \begin_inset Flex Code
372 \begin_layout Plain Layout
378 contains defaults for various commands.
381 \begin_layout Labeling
382 \labelwidthstring 00.00.0000
383 \begin_inset Flex Code
386 \begin_layout Plain Layout
392 contains the list of packages that have been recognized by LyX.
393 It is currently unused by the LyX program itself, but the information extracted
394 , and more, is made available with
395 \begin_inset Flex MenuItem
398 \begin_layout Plain Layout
399 Help\SpecialChar \menuseparator
412 \begin_layout Labeling
413 \labelwidthstring 00.00.0000
414 \begin_inset Flex Code
417 \begin_layout Plain Layout
423 the list of text classes that have been found in your
424 \begin_inset Flex Code
427 \begin_layout Plain Layout
433 directories, along with the associated LaTeX document class and their descripti
437 \begin_layout Labeling
438 \labelwidthstring 00.00.0000
439 \begin_inset Flex Code
442 \begin_layout Plain Layout
448 the list of layout modules found in your
449 \begin_inset Flex Code
452 \begin_layout Plain Layout
461 \begin_layout Labeling
462 \labelwidthstring 00.00.0000
463 \begin_inset Flex Code
466 \begin_layout Plain Layout
472 lists of various sorts of LaTeX-related files found on your system
475 \begin_layout Labeling
476 \labelwidthstring 00.00.0000
477 \begin_inset Flex Code
480 \begin_layout Plain Layout
486 is automatically generated during configuration from the file
487 \begin_inset Flex Code
490 \begin_layout Plain Layout
497 It contains information on your LaTeX configuration.
500 \begin_layout Subsection
504 \begin_layout Standard
505 These directories are duplicated between
506 \begin_inset Flex Code
509 \begin_layout Plain Layout
516 \begin_inset Flex Code
519 \begin_layout Plain Layout
526 If a particular files exists in both places, the one in
527 \begin_inset Flex Code
530 \begin_layout Plain Layout
539 \begin_layout Labeling
540 \labelwidthstring 00.00.0000
541 \begin_inset Flex Code
544 \begin_layout Plain Layout
550 this directory contains files with the extension
551 \begin_inset Flex Code
554 \begin_layout Plain Layout
560 that define the keybindings used in LyX.
561 If there exists an internationalized version of the bind file named
562 \begin_inset Flex Code
565 \begin_layout Plain Layout
571 , that will be used first.
574 \begin_layout Labeling
575 \labelwidthstring 00.00.0000
576 \begin_inset Flex Code
579 \begin_layout Plain Layout
585 contains graphics files that can be included in documents.
589 \begin_layout Labeling
590 \labelwidthstring 00.00.0000
591 \begin_inset Flex Code
594 \begin_layout Plain Layout
600 contains LyX documentation files (including the one you are currently reading).
602 \begin_inset Flex Code
605 \begin_layout Plain Layout
611 deserves special attention, as noted above.
612 The internationalized help docs are in subdirectories
613 \begin_inset Flex Code
616 \begin_layout Plain Layout
623 \begin_inset Quotes eld
627 \begin_inset Quotes erd
630 is the ISO language code.
636 \begin_inset CommandInset ref
638 reference "cha:Internationalizing-LyX"
645 \begin_layout Labeling
646 \labelwidthstring 00.00.0000
647 \begin_inset Flex Code
650 \begin_layout Plain Layout
656 contains example files that explain how to use some features.
657 In the file browser, press the
658 \begin_inset Flex MenuItem
661 \begin_layout Plain Layout
670 \begin_layout Labeling
671 \labelwidthstring 00.00.0000
672 \begin_inset Flex Code
675 \begin_layout Plain Layout
681 contains image files that are used by the
682 \begin_inset Flex MenuItem
685 \begin_layout Plain Layout
692 In addition, it also contains the individual icons used in the toolbar
693 and the banners that can be shown when LyX is launched.
696 \begin_layout Labeling
697 \labelwidthstring 00.00.0000
698 \begin_inset Flex Code
701 \begin_layout Plain Layout
707 contains keyboard keymapping files.
713 \begin_inset CommandInset ref
715 reference "sec:International-Keymap-Stuff"
722 \begin_layout Labeling
723 \labelwidthstring 00.00.0000
724 \begin_inset Flex Code
727 \begin_layout Plain Layout
733 contains the text class and module files described in Chapter
738 \begin_inset CommandInset ref
740 reference "cha:Installing-New-Document"
747 \begin_layout Labeling
748 \labelwidthstring 00.00.0000
749 \begin_inset Flex Code
752 \begin_layout Plain Layout
759 \begin_inset Flex Code
762 \begin_layout Plain Layout
768 Python scripts used to convert between LyX versions.
769 These can be run from the command line if, say, you want to batch-convert
773 \begin_layout Labeling
774 \labelwidthstring 00.00.0000
775 \begin_inset Flex Code
778 \begin_layout Plain Layout
784 contains some files that demonstrate the capabilities of the
785 \begin_inset Flex MenuItem
788 \begin_layout Plain Layout
799 Also contains some scripts used by LyX itself.
802 \begin_layout Labeling
803 \labelwidthstring 00.00.0000
804 \begin_inset Flex Code
807 \begin_layout Plain Layout
813 contains the standard LyX template files described in Chapter
818 \begin_inset CommandInset ref
820 reference "sub:Creating-Templates"
827 \begin_layout Labeling
828 \labelwidthstring 00.00.0000
829 \begin_inset Flex Code
832 \begin_layout Plain Layout
838 contains files with the extension
839 \begin_inset Flex Code
842 \begin_layout Plain Layout
848 that define the user interface to LyX.
849 That is, the files define which items appear in which menus and the items
850 appearing on the toolbar.
853 \begin_layout Subsection
854 Files you don't want to modify
857 \begin_layout Standard
858 These files are used internally by LyX and you generally do not need to
859 modify them unless you are a developer.
862 \begin_layout Labeling
863 \labelwidthstring 00.00.0000
864 \begin_inset Flex Code
867 \begin_layout Plain Layout
873 this file contains the list of LyX developers.
874 The contents are displayed with the menu entry
875 \begin_inset Flex MenuItem
878 \begin_layout Plain Layout
879 Help\SpecialChar \menuseparator
892 \begin_layout Labeling
893 \labelwidthstring 00.00.0000
894 \begin_inset Flex Code
897 \begin_layout Plain Layout
903 this is a LaTeX script used during the configuration process.
907 \begin_layout Labeling
908 \labelwidthstring 00.00.0000
909 \begin_inset Flex Code
912 \begin_layout Plain Layout
918 this is the script that is used to re-configure LyX.
919 It creates configuration files in the directory it was run from.
922 \begin_layout Subsection
923 Other files needing a line or two...
926 \begin_layout Labeling
927 \labelwidthstring 00.00.0000
928 \begin_inset Flex Code
931 \begin_layout Plain Layout
937 this contains tables describing how different character encodings can be
941 \begin_layout Labeling
942 \labelwidthstring 00.00.0000
943 \begin_inset Flex Code
946 \begin_layout Plain Layout
952 this file contains the templates available to the new
953 \begin_inset Flex MenuItem
956 \begin_layout Plain Layout
969 \begin_layout Labeling
970 \labelwidthstring 00.00.0000
971 \begin_inset Flex Code
974 \begin_layout Plain Layout
980 this file contains a list of all the languages currently supported by LyX.
983 \begin_layout Section
984 Your local configuration directory
987 \begin_layout Standard
988 Even if you are using LyX as an unprivileged user, you might want to change
989 LyX configuration for your own use.
991 \begin_inset Flex Code
994 \begin_layout Plain Layout
1000 directory contains all your personal configuration files.
1001 This is the directory described as
1002 \begin_inset Quotes eld
1006 \begin_inset Quotes erd
1010 \begin_inset Flex MenuItem
1013 \begin_layout Plain Layout
1014 Help\SpecialChar \menuseparator
1016 \begin_inset space ~
1025 This directory is used as a mirror of
1026 \begin_inset Flex Code
1029 \begin_layout Plain Layout
1035 , which means that every file in
1036 \begin_inset Flex Code
1039 \begin_layout Plain Layout
1045 is a replacement for the corresponding file in
1046 \begin_inset Flex Code
1049 \begin_layout Plain Layout
1056 Any configuration file described in the above sections can be placed either
1057 in the system-wide directory, in which case it will affect all users, or
1058 in your local directory for your own use.
1061 \begin_layout Standard
1062 To make things clearer, let's provide a few examples:
1065 \begin_layout Itemize
1066 The preferences set in the
1067 \begin_inset Flex MenuItem
1070 \begin_layout Plain Layout
1071 Tools\SpecialChar \menuseparator
1077 dialog are saved to a file
1078 \begin_inset Flex Code
1081 \begin_layout Plain Layout
1088 \begin_inset Flex Code
1091 \begin_layout Plain Layout
1100 \begin_layout Itemize
1101 When you reconfigure using
1102 \begin_inset Flex MenuItem
1105 \begin_layout Plain Layout
1106 Tools\SpecialChar \menuseparator
1113 \begin_inset Flex Code
1116 \begin_layout Plain Layout
1122 script, and the resulting files are written in your local configuration
1124 This means that any additional text class file that you might have added
1126 \begin_inset Flex Code
1129 \begin_layout Plain Layout
1135 will be added to the list of classes in the
1136 \begin_inset Flex MenuItem
1139 \begin_layout Plain Layout
1140 Document\SpecialChar \menuseparator
1149 \begin_layout Itemize
1150 If you get some updated documentation from LyX ftp site and cannot install
1151 it because you do not have sysadmin rights on your system, you can just
1153 \begin_inset Flex Code
1156 \begin_layout Plain Layout
1162 and the items in the
1163 \begin_inset Flex MenuItem
1166 \begin_layout Plain Layout
1172 menu will open them!
1175 \begin_layout Section
1176 Running LyX with multiple configurations
1179 \begin_layout Standard
1180 The configuration freedom of the local configuration directory may not suffice
1181 if you want to have more than one configuration at your disposal.
1182 For example, you may want to be use different key bindings or printer settings
1184 You can achieve this by having several such directories.
1185 You then specify which directory to use at run-time.
1188 \begin_layout Standard
1189 Invoking LyX with the command line switch
1190 \begin_inset Flex Code
1193 \begin_layout Plain Layout
1203 instructs the program to read the configuration from that directory, and
1204 not from the default directory.
1205 (You can determine the default directory by running LyX without the
1206 \begin_inset Flex Code
1209 \begin_layout Plain Layout
1215 switch.) If the specified directory does not exist, LyX offers to create
1216 it for you, just like it does for the default directory on the first time
1217 you run the program.
1218 You can modify the configuration options in this additional user directory
1219 exactly as you would for the default directory.
1220 These directories are completely independent (but read on).
1221 Note that setting the environment variable
1222 \begin_inset Flex Code
1225 \begin_layout Plain Layout
1231 to some value has exactly the same effect.
1234 \begin_layout Standard
1235 Having several configurations also requires more maintenance: if you want
1236 to add a new layout to
1237 \begin_inset Flex Code
1240 \begin_layout Plain Layout
1246 which you want available from all your configurations, you must add it
1247 to each directory separately.
1248 You can avoid this with the following trick: after LyX creates the additional
1249 directory, most of the subdirectories (see above) are empty.
1250 If you want the new configuration to mirror an existing one, replace the
1251 empty subdirectory with a symbolic link to the matching subdirectory in
1252 the existing configuration.
1254 \begin_inset Flex Code
1257 \begin_layout Plain Layout
1263 subdirectory, however, since it contains a file written by the configuration
1264 script (also accessible through
1265 \begin_inset Flex MenuItem
1268 \begin_layout Plain Layout
1269 Tools\SpecialChar \menuseparator
1275 ) which is configuration-specific.
1278 \begin_layout Chapter
1279 The Preferences dialog
1282 \begin_layout Standard
1283 All options of the preferences dialog are described in the Appendix
1285 The Preferences Dialog
1292 For some options you might find here more details.
1295 \begin_layout Section
1297 \begin_inset CommandInset label
1306 \begin_layout Standard
1307 The first step is to define your file formats if they are not already defined.
1309 \begin_inset Flex MenuItem
1312 \begin_layout Plain Layout
1313 Tools\SpecialChar \menuseparator
1321 \begin_inset Flex MenuItem
1324 \begin_layout Plain Layout
1325 File Handling\SpecialChar \menuseparator
1332 \begin_inset Flex MenuItem
1335 \begin_layout Plain Layout
1336 New\SpecialChar \ldots{}
1342 button to define your new format.
1344 \begin_inset Flex MenuItem
1347 \begin_layout Plain Layout
1353 field contains the name used to identify the format in the GUI.
1355 \begin_inset Flex MenuItem
1358 \begin_layout Plain Layout
1364 is used to identify the format internally.
1365 You will also need to enter a file extension.
1366 These are all required.
1368 \begin_inset Flex MenuItem
1371 \begin_layout Plain Layout
1377 field is used to provide a keyboard shortcut on the menus.
1378 (For example, pressing
1379 \begin_inset Flex MenuItem
1382 \begin_layout Plain Layout
1389 \begin_inset Flex MenuItem
1392 \begin_layout Plain Layout
1393 View\SpecialChar \menuseparator
1394 View (Other Formats)\SpecialChar \menuseparator
1403 \begin_layout Standard
1405 \begin_inset Flex MenuItem
1408 \begin_layout Plain Layout
1415 \begin_inset Flex MenuItem
1418 \begin_layout Plain Layout
1425 For example, you might want to use
1426 \begin_inset Flex MenuItem
1429 \begin_layout Plain Layout
1435 to view PostScript files.
1436 You can enter the command needed to start the program in the corresponding
1438 In defining this command, you can use the four variables listed in the
1440 The viewer is launched when you view an image in LyX or use the
1441 \begin_inset Flex MenuItem
1444 \begin_layout Plain Layout
1451 The editor is for example launched when you right-click on an image and
1453 \begin_inset Flex MenuItem
1456 \begin_layout Plain Layout
1462 in the appearing context menu.
1465 \begin_layout Standard
1467 \change_inserted -195340706 1329851811
1469 \begin_inset Flex MenuItem
1472 \begin_layout Plain Layout
1478 type of a format is optional, but if it is specified, it must be unique
1480 It is used to detect files of this format from the file contents.
1481 For some important file formats there is no MIME type officially registered
1483 \begin_inset CommandInset href
1486 target "http://www.iana.org/assignments/media-types/"
1491 Therefore LyX uses the extended list of MIME types as specified by
1492 \begin_inset CommandInset href
1494 name "freedesktop.org"
1495 target "http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec"
1502 \begin_layout Standard
1504 \begin_inset Flex MenuItem
1507 \begin_layout Plain Layout
1513 option tells LyX that a format is suitable for document export.
1514 If this is set and if a suitable conversion route exists (see sec.
1515 \begin_inset space \thinspace{}
1519 \begin_inset CommandInset ref
1521 reference "sec:Converters"
1525 ), the format will appear in the
1526 \begin_inset Flex MenuItem
1529 \begin_layout Plain Layout
1530 File\SpecialChar \menuseparator
1537 The format will also appear in the
1538 \begin_inset Flex MenuItem
1541 \begin_layout Plain Layout
1547 menu if a viewer is specified for the format.
1548 Pure image formats, such as
1549 \begin_inset Flex Code
1552 \begin_layout Plain Layout
1558 , should not use this option.
1559 Formats that can both represent vector graphics and documents like
1560 \begin_inset Flex Code
1563 \begin_layout Plain Layout
1572 \begin_layout Standard
1574 \begin_inset Flex MenuItem
1577 \begin_layout Plain Layout
1578 Vector graphics format
1583 tells LyX that a format can contain vector graphics.
1584 This information is used to determine the target format of included graphics
1586 \begin_inset Flex MenuItem
1589 \begin_layout Plain Layout
1596 Included graphics may need to be converted to either
1597 \begin_inset Flex MenuItem
1600 \begin_layout Plain Layout
1607 \begin_inset Flex MenuItem
1610 \begin_layout Plain Layout
1617 \begin_inset Flex MenuItem
1620 \begin_layout Plain Layout
1627 \begin_inset Flex MenuItem
1630 \begin_layout Plain Layout
1636 cannot handle other image formats.
1637 If an included graphic is not already in
1638 \begin_inset Flex MenuItem
1641 \begin_layout Plain Layout
1648 \begin_inset Flex MenuItem
1651 \begin_layout Plain Layout
1658 \begin_inset Flex MenuItem
1661 \begin_layout Plain Layout
1667 format, it is converted to
1668 \begin_inset Flex MenuItem
1671 \begin_layout Plain Layout
1677 if the vector format option is set, and otherwise to
1678 \begin_inset Flex MenuItem
1681 \begin_layout Plain Layout
1690 \begin_layout Section
1694 \begin_layout Standard
1695 Since all conversions from one format to another take place in LyX's temporary
1696 directory, it is sometimes necessary to modify a file before copying it
1697 to the temporary directory in order that the conversion may be performed.
1701 \begin_layout Plain Layout
1702 For example, the file may refer to other files—images, for example—using
1703 relative file names, and these may become invalid when the file is copied
1704 to the temporary directory.
1709 This is done by a Copier: It copies a file to (or from) the temporary directory
1710 and may modify it in the process.
1713 \begin_layout Standard
1714 The definitions of the copiers may use four variables:
1717 \begin_layout Labeling
1718 \labelwidthstring 00.00.0000
1719 \begin_inset Flex Code
1722 \begin_layout Plain Layout
1728 The LyX system directory (e.
1729 \begin_inset space \thinspace{}
1733 \begin_inset space \space{}
1737 \begin_inset Flex MenuItem
1740 \begin_layout Plain Layout
1749 \begin_layout Labeling
1750 \labelwidthstring 00.00.0000
1751 \begin_inset Flex Code
1754 \begin_layout Plain Layout
1763 \begin_layout Labeling
1764 \labelwidthstring 00.00.0000
1765 \begin_inset Flex Code
1768 \begin_layout Plain Layout
1777 \begin_layout Labeling
1778 \labelwidthstring 00.00.0000
1779 \begin_inset Flex Code
1782 \begin_layout Plain Layout
1791 \begin_layout Standard
1792 The latter should be the filename as it would be used in a LaTeX's
1799 It is relevant only when exporting files suitable for such inclusion.
1802 \begin_layout Standard
1803 Copiers can be used to do almost anything with output files.
1804 For example, suppose you want generated pdf files to be copied to a special
1806 \begin_inset Flex Code
1809 \begin_layout Plain Layout
1816 Then you could write a shell script such as this one:
1819 \begin_layout Standard
1820 \begin_inset listings
1824 \begin_layout Plain Layout
1829 \begin_layout Plain Layout
1834 \begin_layout Plain Layout
1836 TOFILE=`basename $2`
1839 \begin_layout Plain Layout
1841 cp $FROMFILE /home/you/pdf/$TOFILE
1846 Save it in your local LyX directory—say,
1847 \begin_inset Flex Code
1850 \begin_layout Plain Layout
1851 /home/you/.lyx/scripts/pdfcopier.sh
1856 —and make it executable, if you need to do so on your platform.
1858 \begin_inset Flex MenuItem
1861 \begin_layout Plain Layout
1862 Tools\SpecialChar \menuseparator
1868 dialog, select under
1869 \begin_inset Flex MenuItem
1872 \begin_layout Plain Layout
1873 File Handling\SpecialChar \menuseparator
1880 \begin_inset Flex MenuItem
1883 \begin_layout Plain Layout
1889 format—or one of the other pdf formats—and enter
1890 \begin_inset Flex Code
1893 \begin_layout Plain Layout
1894 pdfcopier.sh $$i $$o
1900 \begin_inset Flex MenuItem
1903 \begin_layout Plain Layout
1913 \begin_layout Standard
1914 Copiers are used by LyX in various of its own conversions.
1915 For example, if appropriate programs are found, LyX will automatically
1916 install copiers for the
1917 \begin_inset Flex MenuItem
1920 \begin_layout Plain Layout
1927 \begin_inset Flex MenuItem
1930 \begin_layout Plain Layout
1932 \begin_inset space ~
1941 When these formats are exported, the copier sees that not just the main
1942 HTML file but various associated files (style files, images, etc.) are also
1944 All these files are written to a subdirectory of the directory in which
1945 the original LyX file was found.
1949 \begin_layout Plain Layout
1950 This copier can be customized.
1952 \begin_inset Quotes eld
1956 \begin_inset Quotes erd
1959 argument takes a comma-separated list of extensions to be copied; if it
1960 is omitted, all files will be copied.
1962 \begin_inset Quotes eld
1966 \begin_inset Quotes erd
1969 argument determines the extension added to the generated directory.
1971 \begin_inset Quotes eld
1975 \begin_inset Flex MenuItem
1978 \begin_layout Plain Layout
1985 \begin_inset Quotes erd
1988 , so HTML generated from
1989 \begin_inset Flex MenuItem
1992 \begin_layout Plain Layout
1993 /path/to/filename.lyx
1999 \begin_inset Flex MenuItem
2002 \begin_layout Plain Layout
2003 /path/to/filename.html.LyXconv
2017 \begin_layout Section
2019 \begin_inset CommandInset label
2021 name "sec:Converters"
2028 \begin_layout Standard
2029 You can define your own Converters to convert files between different formats.
2031 \begin_inset Flex MenuItem
2034 \begin_layout Plain Layout
2035 Tools\SpecialChar \menuseparator
2036 Preferences\SpecialChar \menuseparator
2037 File Handling\SpecialChar \menuseparator
2046 \begin_layout Standard
2047 To define a new converter, select the
2048 \begin_inset Flex MenuItem
2051 \begin_layout Plain Layout
2053 \begin_inset space ~
2062 \begin_inset Flex MenuItem
2065 \begin_layout Plain Layout
2067 \begin_inset space ~
2075 from the drop-down lists, enter the command needed for the conversion,
2077 \begin_inset Flex MenuItem
2080 \begin_layout Plain Layout
2087 Several variables can be used in the definition of converters:
2090 \begin_layout Labeling
2091 \labelwidthstring 00.00.0000
2092 \begin_inset Flex Code
2095 \begin_layout Plain Layout
2101 The LyX system directory
2104 \begin_layout Labeling
2105 \labelwidthstring 00.00.0000
2106 \begin_inset Flex Code
2109 \begin_layout Plain Layout
2118 \begin_layout Labeling
2119 \labelwidthstring 00.00.0000
2120 \begin_inset Flex Code
2123 \begin_layout Plain Layout
2132 \begin_layout Labeling
2133 \labelwidthstring 00.00.0000
2134 \begin_inset Flex Code
2137 \begin_layout Plain Layout
2143 The base filename of the input file (i.
2144 \begin_inset space \thinspace{}
2147 g., without the extension)
2150 \begin_layout Labeling
2151 \labelwidthstring 00.00.0000
2152 \begin_inset Flex Code
2155 \begin_layout Plain Layout
2161 The path to the input file
2164 \begin_layout Labeling
2165 \labelwidthstring 00.00.0000
2166 \begin_inset Flex Code
2169 \begin_layout Plain Layout
2175 The path to the original input file (this is different from $$p when a
2176 chain of converters is called)
2179 \begin_layout Labeling
2180 \labelwidthstring 00.00.0000
2181 \begin_inset Flex Code
2184 \begin_layout Plain Layout
2190 The iconv name for the encoding of the document.
2193 \begin_layout Standard
2195 \begin_inset Flex MenuItem
2198 \begin_layout Plain Layout
2200 \begin_inset space ~
2208 field you can enter the following flags, separated by commas:
2211 \begin_layout Labeling
2212 \labelwidthstring 00.00.0000
2213 \begin_inset Flex Code
2216 \begin_layout Plain Layout
2222 This converter runs some form of LaTeX.
2223 This will make LyX's LaTeX error logs available.
2226 \begin_layout Labeling
2227 \labelwidthstring 00.00.0000
2228 \begin_inset Flex Code
2231 \begin_layout Plain Layout
2238 \begin_inset Flex MenuItem
2241 \begin_layout Plain Layout
2247 file for the conversion.
2250 \begin_layout Labeling
2251 \labelwidthstring 00.00.0000
2252 \begin_inset Flex Code
2255 \begin_layout Plain Layout
2264 \begin_layout Standard
2265 The following three flags are not really flags at all because they take
2267 \begin_inset Flex MenuItem
2270 \begin_layout Plain Layout
2272 \begin_inset space ~
2276 \begin_inset space ~
2287 \begin_layout Labeling
2288 \labelwidthstring 00.00.0000
2289 \begin_inset Flex Code
2292 \begin_layout Plain Layout
2298 If set, the converter's standard error will be redirected to a file
2299 \begin_inset Flex Code
2302 \begin_layout Plain Layout
2308 , and the script given as argument will be run as:
2309 \begin_inset Flex Code
2312 \begin_layout Plain Layout
2313 script < infile.out > infile.log
2319 The argument may contain
2320 \begin_inset Flex Code
2323 \begin_layout Plain Layout
2332 \begin_layout Labeling
2333 \labelwidthstring 00.00.0000
2334 \begin_inset Flex Code
2337 \begin_layout Plain Layout
2343 The name of the directory in which the converter will dump the generated
2345 LyX will not create this directory, and it does not copy anything into
2346 it, though it will copy this directory to the destination.
2347 The argument may contain
2348 \begin_inset Flex Code
2351 \begin_layout Plain Layout
2357 , which will be replaced by the base name of the input and output files,
2358 respectively, when the directory is copied.
2359 \begin_inset Newline newline
2362 Note that resultdir and usetempdir make no sense together.
2363 The latter will be ignored if the former is given.
2366 \begin_layout Labeling
2367 \labelwidthstring 00.00.0000
2368 \begin_inset Flex Code
2371 \begin_layout Plain Layout
2377 Determines the output file name and may, contain
2378 \begin_inset Flex Code
2381 \begin_layout Plain Layout
2388 Sensible only with resultdir and optional even then; if not given, it defaults
2392 \begin_layout Standard
2393 None of these last three are presently used in any of the converters that
2394 are installed with LyX.
2398 \begin_layout Standard
2399 You do not have to define converters for all formats between which you want
2401 For example, you will note that there is no `LyX to PostScript' converter,
2402 but LyX will export PostScript.
2403 It does so by first creating a LaTeX file (no converter needs to be defined
2404 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2405 and finally converting the resulting DVI file to PostScript.
2406 LyX finds such `chains' of converters automatically, and it will always
2407 choose the shortest possible chain.
2408 You can, though, still define multiple conversion methods between file
2410 For example, the standard LyX configuration provides three ways to convert
2411 LaTeX to PDF: Directly, using
2412 \begin_inset Flex MenuItem
2415 \begin_layout Plain Layout
2421 ; via (DVI and) PostScript, using
2422 \begin_inset Flex MenuItem
2425 \begin_layout Plain Layout
2432 \begin_inset Flex MenuItem
2435 \begin_layout Plain Layout
2442 To define such alternate chains, you must define multiple target `file
2443 formats', as described in section
2444 \begin_inset CommandInset ref
2446 reference "sec:Formats"
2451 For example, in the standard configuration, the formats named
2452 \begin_inset Flex MenuItem
2455 \begin_layout Plain Layout
2462 \begin_inset Flex MenuItem
2465 \begin_layout Plain Layout
2472 \begin_inset Flex MenuItem
2475 \begin_layout Plain Layout
2481 are defined, all of which share the extension
2482 \begin_inset Flex MenuItem
2485 \begin_layout Plain Layout
2491 , and which correspond to the conversion methods just mentioned.
2494 \begin_layout Chapter
2495 Internationalizing LyX
2496 \begin_inset CommandInset label
2498 name "cha:Internationalizing-LyX"
2505 \begin_layout Standard
2506 LyX supports using a translated interface.
2507 Last time we checked, LyX provided text in thirty languages.
2508 The language of choice is called your
2513 (For further reading on locale settings, see also the documentation for
2514 locale that comes with your operating system.
2515 For Linux, the manual page for
2516 \begin_inset Flex Code
2519 \begin_layout Plain Layout
2525 could be a good place to start).
2528 \begin_layout Standard
2529 Notice that these translations will work, but do contain a few flaws.
2530 In particular, all dialogs have been designed with the English text in
2531 mind, which means that some of the translated text will be too large to
2532 fit within the space allocated.
2533 This is only a display problem and will not cause any harm.
2534 Also, you will find that some of the translations do not define shortcut
2535 keys for everything.
2536 Sometimes, there are simply not enough free letters to do it.
2537 Other times, the translator just hasn't got around to doing it yet.
2538 Our localization team, which you may wish to join,
2542 \begin_layout Plain Layout
2543 If you are a fluent speaker of a language other than English, joining these
2544 teams is a great way to give back to the LyX community!
2549 will of course try to fix these shortcomings in future versions of LyX.
2552 \begin_layout Section
2556 \begin_layout Subsection
2557 Translating the graphical user interface (text messages).
2560 \begin_layout Standard
2562 \begin_inset Flex Code
2565 \begin_layout Plain Layout
2571 library to handle the internationalization of the interface.
2572 To have LyX speak your favorite language in all menus and dialogs, you
2574 \begin_inset Flex Code
2577 \begin_layout Plain Layout
2583 -file for that language.
2584 When this is available, you'll have to generate a
2585 \begin_inset Flex Code
2588 \begin_layout Plain Layout
2594 -file from it and install the
2595 \begin_inset Flex Code
2598 \begin_layout Plain Layout
2605 The process of doing all of this is explained in the documentation for
2607 \begin_inset Flex Code
2610 \begin_layout Plain Layout
2617 It is possible to do this just for yourself, but if you're going to do
2618 it, you might as well share the results of your labors with the rest of
2620 Send a message to the LyX developers' list for more information about how
2624 \begin_layout Standard
2625 In short, this is what you should do (xx denotes the language code):
2628 \begin_layout Itemize
2629 Check out the LyX source code.
2631 \begin_inset CommandInset href
2633 name "information on the web"
2634 target "http://www.lyx.org/HowToUseSVN"
2641 \begin_layout Itemize
2643 \begin_inset Flex Code
2646 \begin_layout Plain Layout
2652 to the folder of the
2653 \begin_inset Flex Code
2656 \begin_layout Plain Layout
2664 \begin_inset Flex Code
2667 \begin_layout Plain Layout
2675 \begin_inset Flex Code
2678 \begin_layout Plain Layout
2684 doesn't exist anywhere, it can be remade with the console command
2685 \begin_inset Flex Code
2688 \begin_layout Plain Layout
2694 in that directory, or you can use an existing po-file for some other language
2698 \begin_layout Itemize
2700 \begin_inset Flex Code
2703 \begin_layout Plain Layout
2713 \begin_layout Plain Layout
2714 This is just a text file, so it can be edited in any text editor.
2715 But there are also specialized programs that support such editing, such
2720 (for all platforms) or
2729 contains a `mode' for editing
2730 \begin_inset Flex Code
2733 \begin_layout Plain Layout
2744 For some menu- and widget-labels, there are also shortcut keys that should
2746 Those keys are marked after a `|', and should be translated according to
2747 the words and phrases of the language.
2748 You should also fill also out the information at the beginning of the new
2750 \begin_inset Flex Code
2753 \begin_layout Plain Layout
2759 -file with your email-address, etc., so people know where to reach you with
2760 suggestions and entertaining flames.
2763 \begin_layout Standard
2764 If you are just doing this on your own, then:
2767 \begin_layout Itemize
2769 \begin_inset Flex Code
2772 \begin_layout Plain Layout
2779 This can be done with
2780 \begin_inset Flex Code
2783 \begin_layout Plain Layout
2784 msgfmt -o xx.mo < xx.po
2792 \begin_layout Itemize
2794 \begin_inset Flex Code
2797 \begin_layout Plain Layout
2803 -file to your locale-tree, at the correct directory for application messages
2808 xx, and under the name
2809 \begin_inset Flex Code
2812 \begin_layout Plain Layout
2819 \begin_inset space \thinspace{}
2823 \begin_inset space \space{}
2827 \begin_inset Flex Code
2830 \begin_layout Plain Layout
2831 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2841 \begin_layout Standard
2842 As said, however, it would be best if the new
2843 \begin_inset Flex Code
2846 \begin_layout Plain Layout
2852 -file could be added to the LyX distribution, so others can use it.
2853 Adding it involves making additional changes to LyX.
2854 So send an email to the developers' mailing list if you're interested in
2858 \begin_layout Subsubsection
2862 \begin_layout Standard
2863 Sometimes it turns out that one English message needs to be translated into
2864 different messages in the target language.
2865 One example is the message
2866 \begin_inset Flex Code
2869 \begin_layout Plain Layout
2875 which has the German translation
2883 , depending upon exactly what the English
2884 \begin_inset Quotes eld
2888 \begin_inset Quotes erd
2893 \begin_inset Flex Code
2896 \begin_layout Plain Layout
2902 does not handle such ambiguous translations.
2903 Therefore you have to add some context information to the message: Instead
2905 \begin_inset Flex Code
2908 \begin_layout Plain Layout
2915 \begin_inset Flex Code
2918 \begin_layout Plain Layout
2919 To[[as in 'From format x to format y']]
2925 \begin_inset Flex Code
2928 \begin_layout Plain Layout
2929 To[[as in 'From page x to page y']].
2934 Now the two occurrences of
2935 \begin_inset Flex Code
2938 \begin_layout Plain Layout
2945 \begin_inset Flex Code
2948 \begin_layout Plain Layout
2954 and can be translated correctly to
2965 \begin_layout Standard
2966 Of course the context information needs to be stripped off the original
2967 message when no translation is used.
2968 Therefore you have to put it in double square brackets at the end of the
2969 message (see the example above).
2970 The translation mechanism of LyX ensures that everything in double square
2971 brackets at the end of messages is removed before displaying the message.
2974 \begin_layout Subsection
2975 Translating the documentation.
2978 \begin_layout Standard
2979 The online documentation (in the
2980 \begin_inset Flex MenuItem
2983 \begin_layout Plain Layout
2989 -menu) can (and should!) be translated.
2990 If there are translated versions of the documentation available
2994 \begin_layout Plain Layout
2995 As of March 2008, at least some of the documents have been translated into
2996 fourteen languages, with the Tutorial available in a few more.
3001 and the locale is set accordingly, these will be used automagically by
3003 LyX looks for translated versions as
3004 \begin_inset Flex Code
3007 \begin_layout Plain Layout
3008 LyXDir/doc/xx/DocName.lyx
3014 \begin_inset Flex Code
3017 \begin_layout Plain Layout
3023 is the code for the language currently in use.
3024 If there are no translated documents, the default English versions will
3026 Note that the translated versions must have the same filenames (
3027 \begin_inset Flex Code
3030 \begin_layout Plain Layout
3036 above) as the original.
3037 If you feel up to translating the documentation (an excellent way to proof-read
3038 the original documentation by the way!), there are a few things you should
3042 \begin_layout Itemize
3043 Check out the documentation translation web page at
3044 \begin_inset CommandInset href
3046 name "http://www.lyx.org/Translation"
3047 target "http://www.lyx.org/Translation"
3052 That way, you can find out which (if any) documents have already been translate
3053 d into your language.
3054 You can also find out who (if anyone) is organizing the effort to translate
3055 the documentation into your language.
3056 If no one is organizing the effort, please let us know that you're interested.
3059 \begin_layout Standard
3060 Once you get to actually translating, here's a few hints for you that may
3064 \begin_layout Itemize
3065 Join the documentation team! There is information on how to do that in
3066 \begin_inset Flex Code
3069 \begin_layout Plain Layout
3076 \begin_inset Flex MenuItem
3079 \begin_layout Plain Layout
3080 Help\SpecialChar \menuseparator
3086 ), which by the way is the first document you should translate.
3089 \begin_layout Itemize
3090 Learn the typographic conventions for the language you are translating to.
3091 Typography is an ancient art and over the centuries, a great variety of
3092 conventions have developed throughout different parts of the world.
3093 Also study the professional terminology amongst typographers in your country.
3094 Inventing your own terminology will only confuse the users.
3097 (Warning! Typography is addictive!)
3100 \begin_layout Itemize
3101 Make a copy of the document.
3102 This will be your working copy.
3103 You can use this as your personal translated help-file by placing it in
3105 \begin_inset Flex Code
3108 \begin_layout Plain Layout
3117 \begin_layout Itemize
3118 Sometimes the original document (from the LyX-team) will be updated.
3119 Use the source viewer at
3120 \begin_inset CommandInset href
3122 name "http://www.lyx.org/trac/timeline"
3123 target "http://www.lyx.org/trac/timeline"
3127 to see what has been changed.
3128 That way you can easily see which parts of the translated document need
3132 \begin_layout Standard
3133 If you ever find an error in the original document, fix it and notify the
3134 rest of the documentation team of the changes! (You didn't forget to join
3135 the documentation team, did you?)
3138 \begin_layout Standard
3139 \begin_inset Branch OutDated
3142 \begin_layout Section
3143 International Keyboard Support
3146 \begin_layout Standard
3149 [Editor's Note: The following section is by
3157 It needs to be fixed to conform to the new Documentation Style sheet and
3158 to make use of the new v1.0 features.
3159 The whole thing also needs to be merged with the section following it.-jw
3160 It may also be badly out of date.-rh (2008)]
3163 \begin_layout Subsection
3164 Defining Own Keymaps: Keymap File Format
3167 \begin_layout Standard
3168 Let's look at a keyboard definition file a little closer.
3169 It is a plain text file defining
3172 \begin_layout Itemize
3173 key-to-key or key-to-string translations
3176 \begin_layout Itemize
3180 \begin_layout Itemize
3181 dead keys exceptions
3184 \begin_layout Standard
3185 To define key-to-key or key-to-string translation, use this command:
3188 \begin_layout Quotation
3189 \begin_inset Flex Code
3192 \begin_layout Plain Layout
3201 \begin_inset Flex Code
3204 \begin_layout Plain Layout
3213 \begin_layout Standard
3215 \begin_inset Flex Code
3218 \begin_layout Plain Layout
3224 is the key to be translated and
3225 \begin_inset Flex Code
3228 \begin_layout Plain Layout
3234 is the string to be inserted into the document.
3235 To define dead keys, use:
3238 \begin_layout Quotation
3239 \begin_inset Flex Code
3242 \begin_layout Plain Layout
3251 \begin_inset Flex Code
3254 \begin_layout Plain Layout
3263 \begin_layout Standard
3265 \begin_inset Flex Code
3268 \begin_layout Plain Layout
3274 is a keyboard key and
3275 \begin_inset Flex Code
3278 \begin_layout Plain Layout
3285 The following dead keys are supported (shortcut name is in parentheses):
3288 \begin_layout Quotation
3292 \begin_inset space \hfill{}
3298 \begin_layout Quotation
3300 \begin_inset space \hfill{}
3306 \begin_layout Quotation
3308 \begin_inset space \hfill{}
3314 \begin_layout Quotation
3316 \begin_inset space \hfill{}
3322 \begin_layout Quotation
3324 \begin_inset space \hfill{}
3330 \begin_layout Quotation
3332 \begin_inset space \hfill{}
3339 \begin_layout Plain Layout
3351 \begin_layout Quotation
3353 \begin_inset space \hfill{}
3359 \begin_layout Quotation
3361 \begin_inset space \hfill{}
3368 \begin_layout Plain Layout
3380 \begin_layout Quotation
3382 \begin_inset space \hfill{}
3388 \begin_layout Quotation
3390 \begin_inset space \hfill{}
3396 \begin_layout Quotation
3398 \begin_inset space \hfill{}
3405 \begin_layout Plain Layout
3417 \begin_layout Quotation
3419 \begin_inset space \hfill{}
3426 \begin_layout Plain Layout
3438 \begin_layout Quotation
3440 \begin_inset space \hfill{}
3446 \begin_layout Quotation
3447 hungarian umlaut (hug)
3448 \begin_inset space \hfill{}
3454 \begin_layout Quotation
3456 \begin_inset space \hfill{}
3462 \begin_layout Quotation
3464 \begin_inset space \hfill{}
3471 \begin_layout Plain Layout
3483 \begin_layout Standard
3484 Since in many international keyboards there are exceptions to what some
3485 dead keys should do, you can define them using
3488 \begin_layout Quotation
3489 \begin_inset Flex Code
3492 \begin_layout Plain Layout
3500 deadkey key outstring
3503 \begin_layout Standard
3504 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3508 \begin_layout Quotation
3509 \begin_inset Flex Code
3512 \begin_layout Plain Layout
3525 \begin_layout Standard
3526 to make it work correctly.
3527 Also, you have to define as exceptions dead keys over i and j, to remove
3528 the dot from them before inserting an accent mark.
3529 I will change this when the time comes, but so far I haven't had time.
3532 \begin_layout Standard
3533 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3536 \begin_inset Flex Code
3539 \begin_layout Plain Layout
3545 have different meaning.
3547 \begin_inset Flex Code
3550 \begin_layout Plain Layout
3556 marks comments, quotes start and end LaTeX-style commands.
3557 To enter quote, you'll need to use
3558 \begin_inset Flex Code
3561 \begin_layout Plain Layout
3570 \begin_inset Flex Code
3573 \begin_layout Plain Layout
3580 \begin_inset Flex Code
3583 \begin_layout Plain Layout
3594 \begin_layout Standard
3595 If you make a keyboard description file that works for your language, please
3596 mail it to me, so I can include it in the next keymap distribution.
3599 \begin_layout Standard
3600 More keywords will be supported in keymap configuration file in future,
3604 \begin_layout Itemize
3605 \begin_inset Flex Code
3608 \begin_layout Plain Layout
3619 \begin_inset space \hfill{}
3623 \begin_inset Flex Code
3626 \begin_layout Plain Layout
3635 \begin_layout Itemize
3636 \begin_inset Flex Code
3639 \begin_layout Plain Layout
3650 \begin_inset space \hfill{}
3654 \begin_inset Flex Code
3657 \begin_layout Plain Layout
3663 an external keymap translation program
3666 \begin_layout Standard
3667 Also, it should look into
3668 \begin_inset Flex Code
3671 \begin_layout Plain Layout
3677 file for defaults, too (for example, a
3678 \begin_inset Flex Code
3681 \begin_layout Plain Layout
3689 option to include default keyboard).
3697 \begin_layout Section
3698 International Keymap Stuff
3699 \begin_inset CommandInset label
3701 name "sec:International-Keymap-Stuff"
3708 \begin_layout Standard
3709 \begin_inset Note Note
3712 \begin_layout Plain Layout
3713 In doing the revisions on this document in March 2008, I did not look over
3714 this stuff, as I do not understand it.
3715 It would be good if someone else could do so.
3724 \begin_layout Standard
3725 The next two sections describe the
3726 \begin_inset Flex Code
3729 \begin_layout Plain Layout
3738 \begin_inset Flex Code
3741 \begin_layout Plain Layout
3749 file syntax in detail.
3750 These sections should help you design your own key map if the ones provided
3751 do not meet your needs.
3754 \begin_layout Subsection
3758 \begin_layout Standard
3762 \begin_inset Flex Code
3765 \begin_layout Plain Layout
3771 file maps keystrokes to characters or strings.
3772 As the name suggests, it sets a keyboard mapping.
3774 \begin_inset Flex Code
3777 \begin_layout Plain Layout
3788 \begin_inset Flex Code
3791 \begin_layout Plain Layout
3806 \begin_inset Flex Code
3809 \begin_layout Plain Layout
3822 \begin_inset Flex Code
3825 \begin_layout Plain Layout
3834 \begin_inset Flex Code
3837 \begin_layout Plain Layout
3845 are described in this section.
3848 \begin_layout Labeling
3849 \labelwidthstring 00.00.0000
3850 \begin_inset Flex Code
3853 \begin_layout Plain Layout
3861 Map a character to a string
3864 \begin_layout LyX-Code
3879 \begin_layout Standard
3912 the double-quote (")
3929 must be escaped with a preceding backslash (
3940 \begin_layout Standard
3942 \begin_inset Flex MenuItem
3945 \begin_layout Plain Layout
3953 statement to cause the symbol
3954 \begin_inset Flex MenuItem
3957 \begin_layout Plain Layout
3965 to be output for the keystroke
3966 \begin_inset Flex MenuItem
3969 \begin_layout Plain Layout
3980 \begin_layout LyX-Code
3986 \begin_layout Labeling
3987 \labelwidthstring 00.00.0000
3988 \begin_inset Flex Code
3991 \begin_layout Plain Layout
3999 Specify an accent character
4002 \begin_layout LyX-Code
4011 \begin_layout Standard
4012 This will make the cha
4050 This is the dead key
4054 \begin_layout Plain Layout
4061 refers to a key that does not produce a character by itself, but when followed
4062 with another key, produces the desired accent character.
4063 For example, a German characte
4065 r with an umlaut like
4075 can be produced in this manner.
4084 \begin_layout Standard
4097 and then another key not in
4114 followed by the other, not allowed key, as output.
4118 \begin_inset Flex MenuItem
4121 \begin_layout Plain Layout
4129 cancels a dead key, so if
4140 \begin_inset Flex MenuItem
4143 \begin_layout Plain Layout
4152 , the cursor will not go one position backwards but will instead cancel
4168 might have had on the next keystroke.
4172 \begin_layout Standard
4173 The following example specifies that the character ' is to be an acute accent,
4174 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4177 \begin_layout LyX-Code
4180 kmod ' acute aeiouAEIOU
4183 \begin_layout Labeling
4184 \labelwidthstring 00.00.0000
4185 \begin_inset Flex Code
4188 \begin_layout Plain Layout
4194 Specify an exception to the accent character
4197 \begin_layout LyX-Code
4206 \begin_layout Standard
4207 This defines an exce
4248 have been assigned a keystroke with a previous
4251 \begin_inset Flex Code
4254 \begin_layout Plain Layout
4278 must not belong in the
4325 If such a declaration does not exist in
4333 \begin_inset Flex Code
4336 \begin_layout Plain Layout
4370 \begin_inset Flex Code
4373 \begin_layout Plain Layout
4387 \begin_layout Standard
4388 The following command produces causes äi to be produced when you enter acute-i
4392 \begin_layout LyX-Code
4406 \begin_layout Labeling
4407 \labelwidthstring 00.00.0000
4408 \begin_inset Flex Code
4411 \begin_layout Plain Layout
4417 Combine two accent characters
4420 \begin_layout LyX-Code
4426 accent1 accent2 allowed
4429 \begin_layout Standard
4430 This one is getting pretty esoteric.
4431 It allows you to combine the effect
4487 \begin_inset Flex Code
4490 \begin_layout Plain Layout
4518 \begin_layout Standard
4519 Consider this example from the
4520 \begin_inset Flex Code
4523 \begin_layout Plain Layout
4534 \begin_layout LyX-Code
4537 kmod ; acute aeioyvhAEIOYVH
4541 kcomb acute umlaut iyIY
4544 \begin_layout Standard
4545 This allows you to press
4546 \begin_inset Flex MenuItem
4549 \begin_layout Plain Layout
4557 and get the effect of
4558 \begin_inset Flex Code
4561 \begin_layout Plain Layout
4580 in this case cancels the last dead key, so if you press
4581 \begin_inset Flex MenuItem
4584 \begin_layout Plain Layout
4593 \begin_inset Flex Code
4596 \begin_layout Plain Layout
4609 \begin_layout Subsection
4613 \begin_layout Standard
4615 \begin_inset Flex Code
4618 \begin_layout Plain Layout
4626 mapping is performed, a
4627 \begin_inset Flex Code
4630 \begin_layout Plain Layout
4640 file maps the strings that the symbols generate to characters in the current
4642 The LyX distribution currently includes at least the
4643 \begin_inset Flex Code
4646 \begin_layout Plain Layout
4655 \begin_inset Flex Code
4658 \begin_layout Plain Layout
4669 \begin_layout Standard
4671 \begin_inset Flex Code
4674 \begin_layout Plain Layout
4682 file is a sequence of declarations of the form
4685 \begin_layout LyX-Code
4698 \begin_layout Standard
4699 For example, in order to map
4700 \begin_inset Flex MenuItem
4703 \begin_layout Plain Layout
4713 to the corresponding character in the iso-8859-1 set (233), the following
4717 \begin_layout LyX-Code
4725 \begin_layout Standard
4727 \begin_inset Flex Code
4730 \begin_layout Plain Layout
4739 \begin_inset Flex Code
4742 \begin_layout Plain Layout
4760 the same character can apply to more than one string.
4762 \begin_inset Flex Code
4765 \begin_layout Plain Layout
4776 \begin_layout LyX-Code
4788 \begin_inset Newline newline
4804 \begin_layout Standard
4805 If LyX cannot find a mapping for the string produced by the keystroke or
4806 a deadkey sequence, it will check if it looks like an accented char and
4807 try to draw an accent over the character on screen.
4810 \begin_layout Subsection
4814 \begin_layout Standard
4815 There is a second way to add support for international characters through
4816 so-called dead-keys.
4817 A dead-key works in combination with a letter to produce an accented character.
4818 Here, we'll explain how to create a really simple dead-key to illustrate
4822 \begin_layout Standard
4823 Suppose you happen to need the circumflex character,
4824 \begin_inset Quotes eld
4828 \begin_inset Quotes erd
4833 \begin_inset Flex MenuItem
4836 \begin_layout Plain Layout
4843 \begin_inset space ~
4847 \begin_inset Flex MenuItem
4850 \begin_layout Plain Layout
4856 ] to the LyX command
4857 \begin_inset Flex Code
4860 \begin_layout Plain Layout
4867 \begin_inset Flex Code
4870 \begin_layout Plain Layout
4877 Now, whenever you type the
4878 \begin_inset Flex MenuItem
4881 \begin_layout Plain Layout
4887 -key followed by a letter, that letter will have a circumflex accent on
4889 For example, the sequence
4890 \begin_inset Quotes eld
4894 \begin_inset Flex MenuItem
4897 \begin_layout Plain Layout
4904 \begin_inset Quotes erd
4907 produces the letter:
4908 \begin_inset Quotes eld
4912 \begin_inset Quotes erd
4916 If you tried to type
4917 \begin_inset Quotes eld
4921 \begin_inset Flex MenuItem
4924 \begin_layout Plain Layout
4931 \begin_inset Quotes erd
4934 , however, LyX will complain with a beep, since a
4935 \begin_inset Quotes eld
4939 \begin_inset Flex MenuItem
4942 \begin_layout Plain Layout
4949 \begin_inset Quotes erd
4952 never takes a circumflex accent.
4954 \begin_inset Flex MenuItem
4957 \begin_layout Plain Layout
4963 after a dead-key produces the bare-accent.
4964 Please note this last point! If you bind a key to a dead-key, you'll need
4965 to rebind the character on that key to yet another key.
4967 \begin_inset Flex MenuItem
4970 \begin_layout Plain Layout
4976 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4979 \begin_layout Standard
4980 One common way to bind dead-keys is to use
4981 \begin_inset Flex MenuItem
4984 \begin_layout Plain Layout
4991 \begin_inset Flex MenuItem
4994 \begin_layout Plain Layout
5001 \begin_inset Flex MenuItem
5004 \begin_layout Plain Layout
5010 in combination with an accent, like
5011 \begin_inset Quotes eld
5015 \begin_inset Flex MenuItem
5018 \begin_layout Plain Layout
5025 \begin_inset Quotes erd
5029 \begin_inset Quotes eld
5033 \begin_inset Flex MenuItem
5036 \begin_layout Plain Layout
5043 \begin_inset Quotes erd
5047 \begin_inset Quotes eld
5051 \begin_inset Flex MenuItem
5054 \begin_layout Plain Layout
5061 \begin_inset Quotes erd
5065 Another way involves using
5066 \begin_inset Flex Code
5069 \begin_layout Plain Layout
5076 \begin_inset Flex Code
5079 \begin_layout Plain Layout
5085 to set up the special
5086 \begin_inset Flex Code
5089 \begin_layout Plain Layout
5097 \begin_inset Flex Code
5100 \begin_layout Plain Layout
5106 acts in some ways just like
5107 \begin_inset Flex MenuItem
5110 \begin_layout Plain Layout
5116 and permits you to bind keys to accented characters.
5117 You can also turn keys into dead-keys by binding them to something like
5119 \begin_inset Flex Code
5122 \begin_layout Plain Layout
5128 and then binding this symbolic key to the corresponding LyX command.
5132 \begin_layout Plain Layout
5137 : This is exactly what I do in my
5138 \begin_inset Flex Code
5141 \begin_layout Plain Layout
5148 \begin_inset Flex Code
5151 \begin_layout Plain Layout
5159 \begin_inset Flex MenuItem
5162 \begin_layout Plain Layout
5164 \begin_inset space ~
5173 \begin_inset Flex Code
5176 \begin_layout Plain Layout
5182 and a bunch of these
5183 \begin_inset Quotes eld
5187 \begin_inset Flex Code
5190 \begin_layout Plain Layout
5197 \begin_inset Quotes erd
5200 symbolic keys bound such things as
5201 \begin_inset Flex MenuItem
5204 \begin_layout Plain Layout
5206 \begin_inset space ~
5215 \begin_inset Flex MenuItem
5218 \begin_layout Plain Layout
5220 \begin_inset space ~
5229 This is how I produce my accented characters.
5234 You can make just about anything into the
5235 \begin_inset Flex Code
5238 \begin_layout Plain Layout
5245 \begin_inset Flex MenuItem
5248 \begin_layout Plain Layout
5254 keys, a spare function key, etc.
5255 As for the LyX commands that produce accents, check the entry for
5256 \begin_inset Flex Code
5259 \begin_layout Plain Layout
5270 You'll find the complete list there.
5273 \begin_layout Subsection
5274 Saving your Language Configuration
5277 \begin_layout Standard
5278 You can edit your preferences so that your desired language environment
5279 is automatically configured when LyX starts up, via the
5280 \begin_inset Flex MenuItem
5283 \begin_layout Plain Layout
5284 Edit\SpecialChar \menuseparator
5293 \begin_layout Chapter
5294 Installing New Document Classes, Layouts, and Templates
5295 \begin_inset CommandInset label
5297 name "cha:Installing-New-Document"
5302 \begin_inset Argument
5305 \begin_layout Plain Layout
5306 Installing New Document Classes
5314 \begin_layout Standard
5315 In this chapter, we describe the procedures for creating and installing
5316 new LyX layout and template files, as well as offer a refresher on correctly
5317 installing new LaTeX document classes.
5321 \begin_layout Standard
5322 First, let us a say a few words about how one ought to think about the relation
5323 between LyX and LaTeX.
5324 The thing to understand is that, in a certain sense, LyX doesn't know anything
5326 Indeed, from LyX's point of view, LaTeX is just one of several
5327 \begin_inset Quotes eld
5331 \begin_inset Quotes erd
5334 in which it is capable of producing output.
5335 Other such formats are DocBook, plaintext, and XHTML.
5336 LaTeX is, of course, a particularly important format, but very little of
5337 the information LyX has about LaTeX is actually contained in the program
5342 \begin_layout Plain Layout
5343 Some commands are sufficiently complex that they are
5344 \begin_inset Quotes eld
5348 \begin_inset Quotes erd
5352 But the developers generally regard this as a Bad Thing.
5357 Rather, that information, even for the standard classes like
5358 \begin_inset Flex Code
5361 \begin_layout Plain Layout
5367 , is contained in `layout files'.
5368 Similarly, LyX itself does not know much about DocBook or XHTML.
5369 What it knows is contained in layout files.
5372 \begin_layout Standard
5373 You can think of the layout file for a given document class as a translation
5374 manual between LyX constructs---paragraphs with their corresponding styles,
5375 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5377 Almost everything LyX knows about
5378 \begin_inset Flex Code
5381 \begin_layout Plain Layout
5387 , for example, is contained in the file
5388 \begin_inset Flex Code
5391 \begin_layout Plain Layout
5397 and in various other files it includes.
5398 For this reason, anyone intending to write layout files should plan to
5399 study the existing files.
5400 A good place to start is with
5401 \begin_inset Flex Code
5404 \begin_layout Plain Layout
5410 , which is included in
5411 \begin_inset Flex Code
5414 \begin_layout Plain Layout
5421 \begin_inset Flex Code
5424 \begin_layout Plain Layout
5430 , and many of the other layout files for document classes.
5431 This file is where sections and the like are defined:
5432 \begin_inset Flex Code
5435 \begin_layout Plain Layout
5441 tells LyX how paragraphs that are marked with the Section, Subsection,
5442 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5445 \begin_inset Flex Code
5448 \begin_layout Plain Layout
5454 file basically just includes several of these
5455 \begin_inset Flex Code
5458 \begin_layout Plain Layout
5467 \begin_layout Standard
5468 Defining the LyX--LaTeX correspondence is not the only thing layout files
5470 Their other job is to define how the LyX constructs themselves will appear
5472 The fact that layout files have these two jobs is often a source of confusion,
5473 because they are completely separate.
5474 Telling LyX how to translate a certain paragraph style into LaTeX does
5475 not tell LyX how to display it; conversely, telling LyX how to display
5476 a certain paragraph style does not tell LyX how to translate it into LaTeX
5477 (let alone tell LaTeX how to display it).
5478 So, in general, when you define a new LyX construct, you must always do
5479 two quite separate things: (i)
5480 \begin_inset space ~
5483 tell LyX how to translate it into LaTeX and (ii)
5484 \begin_inset space ~
5487 tell LyX how to display it.
5490 \begin_layout Standard
5491 Much the same is true, of course, as regards LyX's other backend formats,
5492 though XHTML is in some ways different, because in that case LyX
5496 able, to some extent, to use information about how it should display a
5497 paragraph on the screen to output information (in the form of CSS) about
5498 how the paragraph should be displayed in a browser.
5499 Even in this case, however, the distinction between what LyX does internally
5500 and how things are rendered externally remains in force, and the two can
5501 be controlled separately.
5503 \begin_inset CommandInset ref
5505 reference "sec:Tags-for-XHTML"
5512 \begin_layout Section
5513 Installing new LaTeX files
5516 \begin_layout Standard
5517 Some installations may not include a LaTeX package or class file that you
5518 would like to use within LyX.
5519 For example, you might need FoilTeX, a package for preparing slides for
5520 overhead projectors.
5521 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5522 a user interface for installing such packages.
5523 For example, with MiKTeX, you start the program
5524 \begin_inset Quotes eld
5528 \begin_inset space ~
5532 \begin_inset Quotes erd
5535 to get a list of available packages.
5536 To install one of them, right click on it or use the corresponding toolbar
5540 \begin_layout Standard
5541 If your LaTeX distribution does not provide such a `package manager', or
5542 if the package is not available from your distribution, then follow these
5543 steps to install it manually:
5546 \begin_layout Enumerate
5547 Get the package from
5548 \begin_inset CommandInset href
5551 target "http://www.ctan.org/"
5558 \begin_layout Enumerate
5559 If the package contains a file with the ending
5560 \begin_inset Quotes eld
5564 \begin_inset Flex Code
5567 \begin_layout Plain Layout
5574 \begin_inset Quotes erd
5577 (is the case for FoilTeX) then open a console, change to the folder of
5578 this file and execute the command
5579 \begin_inset Flex Code
5582 \begin_layout Plain Layout
5589 You have now unpacked the package and have all files to install it.
5590 Most LaTeX-packages are not packed and you can skip this step.
5593 \begin_layout Enumerate
5594 Now you need to decide if the package should be available for all users
5599 \begin_layout Enumerate
5600 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5601 for all users on your system, then install it in your `local' TeX tree,
5602 otherwise install it in your own `user' TeX tree.
5603 Where these trees should be created, if they do not already exist, depends
5605 To find this out, look in the file
5606 \begin_inset Flex Code
5609 \begin_layout Plain Layout
5619 \begin_layout Plain Layout
5620 This is usually in the directory
5621 \begin_inset Flex Code
5624 \begin_layout Plain Layout
5630 , though you can execute the command
5631 \begin_inset Flex Code
5634 \begin_layout Plain Layout
5645 The location of the `local' TeX tree is defined by the
5646 \begin_inset Flex Code
5649 \begin_layout Plain Layout
5655 variable; this is usually somewhere like
5656 \begin_inset Flex Code
5659 \begin_layout Plain Layout
5660 /usr/local/share/texmf
5666 The location of the `user' TeX tree is defined by
5667 \begin_inset Flex Code
5670 \begin_layout Plain Layout
5677 \begin_inset Flex Code
5680 \begin_layout Plain Layout
5687 (If these variables are not predefined, you have to define them.) You'll
5688 probably need root permissions to create or modify the `local' tree, but
5689 not for your `user' tree.
5690 \begin_inset Newline newline
5693 In general, it is recommended to install in the user tree because your user
5694 will not be modified or even overwritten when you upgrade your system.
5695 It will typically also be backed up together with everything else when
5696 you backup your home directory (which, of course, you do on a regular basis).
5699 \begin_layout Enumerate
5700 On Windows, if you want the new package to be available for all users on
5701 your system, change to the folder where LaTeX is installed and then change
5703 \begin_inset Flex Code
5706 \begin_layout Plain Layout
5717 (For MiKTeX, this would be by default the folder
5718 \begin_inset Flex Code
5721 \begin_layout Plain Layout
5739 \begin_layout Plain Layout
5740 Note that this will be the correct path only on English installations.
5741 On a German one, it would be
5742 \begin_inset Flex Code
5745 \begin_layout Plain Layout
5759 , and similarly for other languages.
5764 Create there a new folder
5765 \begin_inset Flex Code
5768 \begin_layout Plain Layout
5774 and copy all files of the package into it.
5776 \begin_inset Newline newline
5779 If the package should only available for you or you don't have admin permissions
5780 , do the same, but in the local LaTeX folder.
5782 \begin_inset space \thinspace{}
5786 \begin_inset space ~
5789 2.8 under Windows XP, this would be the folder:
5790 \begin_inset Newline newline
5796 \begin_inset Flex Code
5799 \begin_layout Plain Layout
5802 Documents and Settings
5814 \begin_inset Newline newline
5820 \begin_inset Phantom HPhantom
5823 \begin_layout Plain Layout
5834 \begin_inset Flex Code
5837 \begin_layout Plain Layout
5850 \begin_inset Newline newline
5853 On Vista, it would be:
5854 \begin_inset Newline newline
5858 \begin_inset Flex Code
5861 \begin_layout Plain Layout
5887 \begin_layout Enumerate
5888 Now one only need to tell LaTeX that there are new files.
5889 This depends on the used LaTeX-Distribution:
5893 \begin_layout Enumerate
5894 For TeXLive execute the command
5895 \begin_inset Flex Code
5898 \begin_layout Plain Layout
5905 If you installed the package for all users, then you will probably need
5906 to have root permissions for that.
5909 \begin_layout Enumerate
5910 For MiKTeX, if you have installed the package for all users, start the program
5912 \begin_inset Quotes eld
5916 \begin_inset space ~
5920 \begin_inset Quotes erd
5923 and press the button marked
5924 \begin_inset Quotes eld
5928 \begin_inset Quotes erd
5932 Otherwise start the program
5933 \begin_inset Quotes eld
5937 \begin_inset Quotes erd
5944 \begin_layout Enumerate
5945 Finally, you need to tell LyX that there are new packages available.
5946 So, in LyX, use the menu
5947 \begin_inset Flex MenuItem
5950 \begin_layout Plain Layout
5953 \SpecialChar \menuseparator
5959 and then restart LyX.
5962 \begin_layout Standard
5963 Now the package is installed.
5964 In our example, the document class
5965 \begin_inset Flex Code
5968 \begin_layout Plain Layout
5970 \begin_inset space ~
5977 \begin_layout Plain Layout
5989 will now be available under
5990 \begin_inset Flex MenuItem
5993 \begin_layout Plain Layout
5994 Document\SpecialChar \menuseparator
5995 Settings\SpecialChar \menuseparator
6005 \begin_layout Standard
6006 If you would like to use a LaTeX document class that is not even listed
6008 \begin_inset Flex MenuItem
6011 \begin_layout Plain Layout
6012 Document\SpecialChar \menuseparator
6013 Settings\SpecialChar \menuseparator
6019 , then you need to create a `layout' file for it.
6020 That is the topic of the next section.
6023 \begin_layout Section
6024 Types of layout files
6027 \begin_layout Standard
6028 This section describes the various sorts of LyX files that contain layout
6030 These files describe various paragraph and character styles, determining
6031 how LyX should display them and how they should be translated into LaTeX,
6032 DocBook, XHTML, or whatever output format is being used.
6036 \begin_layout Standard
6037 We shall try to provide a thorough description of the process of writing
6039 However, there are so many different types of documents supported even
6040 by just LaTeX that we can't hope to cover every different possibility or
6041 problem you might encounter.
6042 The LyX users' list is frequented by people with lots of experience with
6043 layout design who are willing to share what they've learned, so please
6044 feel free to ask questions there.
6047 \begin_layout Standard
6048 As you prepare to write a new layout, it is extremely helpful to look at
6049 the layouts distributed with LyX.
6050 If you write a LyX layout for a LaTeX document class that might also be
6051 used by others, or write a module that might be useful to others, then
6052 you should consider posting your layout to the
6053 \begin_inset CommandInset href
6055 name "layout section on the LyX wiki"
6056 target "http://wiki.lyx.org/Layouts/Layouts"
6060 or even to the LyX developers' list, so that it might be included in LyX
6065 \begin_layout Plain Layout
6066 Note that LyX is licensed under the General Public License, so any material
6067 that is contributed to LyX must be similarly licensed.
6075 \begin_layout Subsection
6077 \begin_inset CommandInset label
6079 name "sub:Layout-modules"
6086 \begin_layout Standard
6087 We have spoken to this point about `layout files'.
6088 But there are different sorts of files that contain layout information.
6089 Layout files, strictly so called, have the
6090 \begin_inset Flex Code
6093 \begin_layout Plain Layout
6099 extension and provide LyX with information about document classes.
6100 As of LyX 1.6, however, layout information can also be contained in layout
6106 \begin_inset Flex Code
6109 \begin_layout Plain Layout
6116 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6117 some modules—such as the
6118 \begin_inset Flex Code
6121 \begin_layout Plain Layout
6127 module—specifically provide support for one package.
6128 In a sense, layout modules are similar to included
6132 \begin_layout Plain Layout
6133 These can have any extension, but by convention have the
6134 \begin_inset Flex Code
6137 \begin_layout Plain Layout
6149 \begin_inset Flex Code
6152 \begin_layout Plain Layout
6158 —in that modules are not specific to a given document class but may be used
6159 with many different classes.
6160 The difference is that using an included file with
6161 \begin_inset Flex Code
6164 \begin_layout Plain Layout
6170 requires editing that file.
6171 Modules, by contrast, are selected in the
6172 \begin_inset Flex MenuItem
6175 \begin_layout Plain Layout
6176 Document\SpecialChar \menuseparator
6185 \begin_layout Standard
6186 Building modules is the easiest way to get started with layout editing,
6187 since it can be as simple as adding a single new paragraph style or flex
6189 But modules may, in principle, contain anything a layout file can contain.
6192 \begin_layout Standard
6193 After creating a new module and copying it to the
6194 \begin_inset Flex Code
6197 \begin_layout Plain Layout
6203 folder, you will need to reconfigure and then restart LyX for the module
6204 to appear in the menu.
6205 However, changes you make to the module will be seen immediately, if you
6207 \begin_inset Flex MenuItem
6210 \begin_layout Plain Layout
6211 Document\SpecialChar \menuseparator
6217 , highlight something, and then hit
6218 \begin_inset Quotes eld
6222 \begin_inset Quotes erd
6228 It is strongly recommended that you save your work before doing this
6233 it is strongly recommended that you not attempt to edit modules while simultaneo
6234 usly working on actual documents
6237 Though of course the developers strive to keep LyX stable in such situations,
6238 syntax errors and the like in your module file could cause strange behavior.
6241 \begin_layout Subsubsection
6245 \begin_layout Standard
6246 Modules are to LyX as packages are to LaTeX.
6247 Sometimes, however, you find yourself wanting a specific inset or character
6248 style just for one document and writing a module that will also be available
6249 to other documents makes little sense.
6250 What you need is LyX's
6251 \begin_inset Quotes eld
6255 \begin_inset Quotes erd
6261 \begin_layout Standard
6262 You will find it under
6264 Document\SpecialChar \menuseparator
6265 Settings\SpecialChar \menuseparator
6269 The large text box allows you to enter anything that you might enter in
6270 a layout file or module.
6271 You can think of a document's local layout, in fact, as a module that belongs
6273 So, in particular, you must enter a
6274 \begin_inset Flex Code
6277 \begin_layout Plain Layout
6284 Any format is acceptable, but one would normally use the format current
6286 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6287 layout is not supported by versions of LyX prior to 1.6, so you should not
6288 use it if you want to be able to export your document to LyX 1.5 or earlier
6289 (without, that is, losing the local layout information).
6290 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6291 though there is no UI for it---then you should use format 11 and, of course,
6292 use only layout constructs that were available in LyX 1.6.
6295 \begin_layout Standard
6296 When you have entered something in the
6297 \begin_inset Flex Code
6300 \begin_layout Plain Layout
6306 pane, LyX will enable the
6307 \begin_inset Quotes eld
6311 \begin_inset Quotes erd
6314 button at the bottom.
6315 Clicking this button will cause LyX to determine whether what you have
6316 entered is valid layout information for the chosen format.
6317 LyX will report the result but, unfortunately, will not tell you what errors
6318 there might have been.
6319 These will be written to the terminal, however, if LyX is started from
6321 You will not be permitted to save your local layout until you have entered
6325 \begin_layout Standard
6326 The warnings at the end of the previous section apply here, too.
6327 Do not play with local layout while you are actually working, especially
6328 if you have not saved your document.
6329 That said, using local layout with a test document can be a very convenient
6330 way to try out layout ideas, or even to start developing a module.
6333 \begin_layout Subsection
6335 \begin_inset Flex MenuItem
6338 \begin_layout Plain Layout
6347 \begin_layout Standard
6348 There are two situations you are likely to encounter when wanting to support
6349 a new LaTeX document class, involving style (
6350 \begin_inset Flex Code
6353 \begin_layout Plain Layout
6359 ) files and LaTeX2e class (
6360 \begin_inset Flex Code
6363 \begin_layout Plain Layout
6370 Supporting a style file is usually fairly easy.
6371 Supporting a new class file is a bit harder.
6372 We'll discuss the former in this section and the latter in the next.
6373 Similar remarks apply, of course, if you want to support a new DocBook
6377 \begin_layout Standard
6378 The easier case is the one in which your new document class is provided
6379 as a style file that is to be used in conjunction with an already supported
6381 For the sake of the example, we'll assume that the style file is called
6383 \begin_inset Flex MenuItem
6386 \begin_layout Plain Layout
6392 and that it is meant to be used with
6393 \begin_inset Flex MenuItem
6396 \begin_layout Plain Layout
6402 , which is a standard class.
6406 \begin_layout Standard
6407 Start by copying the existing class's layout file into your local directory:
6411 \begin_layout Plain Layout
6412 Of course, which directory is your local directory will vary by platform,
6413 and LyX allows you to specify your local directory on startup, too, using
6415 \begin_inset Flex Code
6418 \begin_layout Plain Layout
6432 \begin_layout LyX-Code
6433 cp report.layout ~/.lyx/layouts/myclass.layout
6436 \begin_layout Standard
6438 \begin_inset Flex Code
6441 \begin_layout Plain Layout
6447 and change the line:
6450 \begin_layout LyX-Code
6453 DeclareLaTeXClass{report}
6456 \begin_layout Standard
6460 \begin_layout LyX-Code
6463 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6466 \begin_layout Standard
6470 \begin_layout LyX-Code
6472 \begin_inset Newline newline
6478 \begin_inset Newline newline
6484 \begin_layout Standard
6485 near the top of the file.
6488 \begin_layout Standard
6489 Start LyX and select
6490 \begin_inset Flex MenuItem
6493 \begin_layout Plain Layout
6494 Tools\SpecialChar \menuseparator
6501 Then restart LyX and try creating a new document.
6503 \begin_inset Flex MenuItem
6506 \begin_layout Plain Layout
6512 " as a document class option in the
6513 \begin_inset Flex MenuItem
6516 \begin_layout Plain Layout
6517 Document\SpecialChar \menuseparator
6524 It is likely that some of the sectioning commands and such in your new
6525 class will work differently from how they worked in the base class—
6526 \begin_inset Flex Code
6529 \begin_layout Plain Layout
6535 in this example—so you can fiddle around with the settings for the different
6536 sections if you wish.
6537 The layout information for sections is contained in
6538 \begin_inset Flex Code
6541 \begin_layout Plain Layout
6547 , but you do not need to copy and change this file.
6548 Instead, you can simply add your changes to your layout file, after the
6550 \begin_inset Flex Code
6553 \begin_layout Plain Layout
6559 , which itself includes
6560 \begin_inset Flex Code
6563 \begin_layout Plain Layout
6570 For example, you might add these lines:
6573 \begin_layout LyX-Code
6577 \begin_layout LyX-Code
6581 \begin_layout LyX-Code
6585 \begin_layout LyX-Code
6589 \begin_layout LyX-Code
6593 \begin_layout Standard
6594 to change the font for chapter headings to sans-serif.
6595 This will override (or, in this case, add to) the existing declaration
6596 for the Chapter style.
6600 \begin_layout Standard
6601 Your new package may also provide commands or environments not present in
6603 In this case, you will want to add these to the layout file.
6605 \begin_inset CommandInset ref
6607 reference "sec:TextClass"
6611 for information on how to do so.
6614 \begin_layout Standard
6616 \begin_inset Flex MenuItem
6619 \begin_layout Plain Layout
6625 can be used with several different document classes, and even if it cannot,
6626 you might find it easiest just to write a module that you can load with
6628 The simplest possible such module would be:
6631 \begin_layout LyX-Code
6634 DeclareLyXModule{My Package}
6637 \begin_layout LyX-Code
6641 \begin_layout LyX-Code
6642 #Support for mypkg.sty.
6645 \begin_layout LyX-Code
6647 \begin_inset Newline newline
6653 \begin_layout LyX-Code
6655 \begin_inset Newline newline
6661 \begin_layout LyX-Code
6663 \begin_inset Newline newline
6669 \begin_inset Newline newline
6675 \begin_layout Standard
6676 A more complex module might modify the behavior of some existing constructs
6677 or define some new ones.
6679 \begin_inset CommandInset ref
6681 reference "sec:TextClass"
6688 \begin_layout Subsection
6690 \begin_inset Flex MenuItem
6693 \begin_layout Plain Layout
6702 \begin_layout Standard
6703 There are two possibilities here.
6704 One is that the class file is itself based upon an existing document class.
6705 For example, many thesis classes are based upon
6706 \begin_inset Flex MenuItem
6709 \begin_layout Plain Layout
6716 To see whether yours is, look for a line like
6719 \begin_layout LyX-Code
6725 \begin_layout Standard
6727 If so, then you may proceed largely as in the previous section, though
6729 \begin_inset Flex Code
6732 \begin_layout Plain Layout
6738 line will be different.
6739 If your new class is
6740 \begin_inset Flex Code
6743 \begin_layout Plain Layout
6749 and it is based upon
6750 \begin_inset Flex Code
6753 \begin_layout Plain Layout
6759 , then the line should read:
6763 \begin_layout Plain Layout
6764 And it will be easiest if you save the file to
6765 \begin_inset Flex Code
6768 \begin_layout Plain Layout
6774 : LyX assumes that the document class has the same name as the layout file.
6783 \begin_layout LyX-Code
6786 DeclareLaTeXClass[thesis,book]{thesis}
6789 \begin_layout Standard
6790 If, on the other hand, the new class is not based upon an existing class,
6791 you will probably have to
6792 \begin_inset Quotes eld
6796 \begin_inset Quotes erd
6800 We strongly suggest copying an existing layout file which uses a similar
6801 LaTeX class and then modifying it, if you can do so.
6802 At least use an existing file as a starting point so you can find out what
6803 items you need to worry about.
6804 Again, the specifics are covered below.
6807 \begin_layout Subsection
6809 \begin_inset CommandInset label
6811 name "sub:Creating-Templates"
6818 \begin_layout Standard
6819 Once you have written a layout file for a new document class, you might
6820 want to consider writing a
6825 A template acts as a kind of tutorial for your layout, showing how it might
6826 be used, though containing dummy content.
6827 You can of course look at the various templates included with LyX for ideas.
6830 \begin_layout Standard
6831 Templates are created just like usual documents: using LyX.
6832 The only difference is that usual documents contain all possible settings,
6833 including the font scheme and the paper size.
6834 Usually a user doesn't want a template to overwrite his preferred settings
6835 for such parameters.
6836 For that reason, the designer of a template should remove the corresponding
6838 \begin_inset Flex Code
6841 \begin_layout Plain Layout
6850 \begin_inset Flex Code
6853 \begin_layout Plain Layout
6861 from the template LyX file.
6862 This can be done with any simple text-editor, for example
6863 \begin_inset Flex Code
6866 \begin_layout Plain Layout
6873 \begin_inset Flex Code
6876 \begin_layout Plain Layout
6886 \begin_layout Standard
6887 Put the edited template files you create in
6888 \begin_inset Flex Code
6891 \begin_layout Plain Layout
6897 , copy the ones you use from the global template directory in
6898 \begin_inset Flex Code
6901 \begin_layout Plain Layout
6907 to the same place, and redefine the template path in the
6908 \begin_inset Flex MenuItem
6911 \begin_layout Plain Layout
6912 Tools\SpecialChar \menuseparator
6913 Preferences\SpecialChar \menuseparator
6922 \begin_layout Standard
6923 Note, by the way, that there is a template which has a particular meaning:
6925 \begin_inset Flex Code
6928 \begin_layout Plain Layout
6935 This template is loaded every time you create a new document with
6936 \begin_inset Flex MenuItem
6939 \begin_layout Plain Layout
6940 File\SpecialChar \menuseparator
6946 in order to provide useful defaults.
6947 To create this template from inside LyX, all you have to do is to open
6948 a document with the correct settings, and use the
6949 \begin_inset Flex MenuItem
6952 \begin_layout Plain Layout
6953 Save as Document Defaults
6961 \begin_layout Subsection
6962 Upgrading old layout files
6965 \begin_layout Standard
6966 The format of layout files changes with each LyX release, so old layout
6967 files need to be converted to the new format.
6968 This process has been automated since LyX 1.4: If LyX reads a layout file
6969 in an older format, it automatically calls the script
6970 \begin_inset Flex Code
6973 \begin_layout Plain Layout
6979 to convert it to a temporary file in current format.
6980 The original file is left untouched.
6981 If you use the layout file often, then, you may want to convert it permanently,
6982 so that LyX does not have to do so itself every time.
6983 To do this, you can call the converter manually:
6986 \begin_layout LyX-Code
6987 mv myclass.layout myclass.old
6990 \begin_layout LyX-Code
6991 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6994 \begin_layout Standard
6996 \begin_inset Flex Code
6999 \begin_layout Plain Layout
7005 with the name of your LyX system directory, of course.
7008 \begin_layout Standard
7009 Note that manual conversion does not affect included files, so these will
7010 have to be converted separately.
7013 \begin_layout Section
7014 \begin_inset CommandInset label
7016 name "sec:TextClass"
7020 The layout file format
7023 \begin_layout Standard
7024 When it's finally time to get your hands dirty and create or edit your own
7025 layout file, the following sections describe what you're up against.
7026 Our advice is to go slowly, save and test often, listen to soothing music,
7027 and enjoy one or two of your favorite adult beverages; more if you are
7028 getting particularly stuck.
7029 It's really not that hard, except that the multitude of options can become
7030 overwhelming if you try to do too much in one sitting.
7031 Go have another adult beverage, just for good measure.
7034 \begin_layout Standard
7035 Note that all the tags used in layout files are case-insensitive.
7037 \begin_inset Flex Code
7040 \begin_layout Plain Layout
7047 \begin_inset Flex Code
7050 \begin_layout Plain Layout
7057 \begin_inset Flex Code
7060 \begin_layout Plain Layout
7066 are really the same tag.
7067 The possible values are printed in brackets after the feature's name.
7068 The default value if a feature isn't specified inside a text class-description
7070 \begin_inset Flex Code
7073 \begin_layout Plain Layout
7082 If the argument has a data type like
7083 \begin_inset Quotes eld
7087 \begin_inset Quotes erd
7091 \begin_inset Quotes eld
7095 \begin_inset Quotes erd
7098 , the default is shown like this:
7099 \begin_inset Flex Code
7102 \begin_layout Plain Layout
7113 \begin_layout Subsection
7114 The document class declaration
7117 \begin_layout Standard
7118 Lines in a layout file which begin with
7119 \begin_inset Flex Code
7122 \begin_layout Plain Layout
7129 There is one exception to this rule.
7131 \begin_inset Flex Code
7134 \begin_layout Plain Layout
7140 files should begin with a line like:
7143 \begin_layout LyX-Code
7146 #% Do not delete the line below; configure depends on this
7149 \begin_layout LyX-Code
7154 DeclareLaTeXClass{article}
7157 \begin_layout Standard
7158 The second line is used when you (re)configure LyX.
7159 The layout file is read by the LaTeX script
7160 \begin_inset Flex Code
7163 \begin_layout Plain Layout
7169 , in a special mode where
7170 \begin_inset Flex Code
7173 \begin_layout Plain Layout
7180 The first line is just a LaTeX comment, and the second one contains the
7181 declaration of the text class.
7182 If these lines appear in a file named
7183 \begin_inset Flex Code
7186 \begin_layout Plain Layout
7192 , then they define a text class of name
7193 \begin_inset Flex Code
7196 \begin_layout Plain Layout
7202 (the name of the layout file) which uses the LaTeX document class
7203 \begin_inset Flex Code
7206 \begin_layout Plain Layout
7212 (the default is to use the same name as the layout).
7214 \begin_inset Quotes eld
7218 \begin_inset Quotes erd
7221 that appears above is used as a description of the text class in the
7222 \begin_inset Flex MenuItem
7225 \begin_layout Plain Layout
7226 Document\SpecialChar \menuseparator
7235 \begin_layout Standard
7236 Let's assume that you wrote your own text class that uses the
7237 \begin_inset Flex Code
7240 \begin_layout Plain Layout
7246 document class, but where you changed the appearance of the section headings.
7247 If you put it in a file
7248 \begin_inset Flex Code
7251 \begin_layout Plain Layout
7257 , the header of this file should be:
7260 \begin_layout LyX-Code
7263 #% Do not delete the line below; configure depends on this
7266 \begin_layout LyX-Code
7271 DeclareLaTeXClass[article]{article (with my own headings)}
7274 \begin_layout Standard
7275 This declares a text class
7276 \begin_inset Flex Code
7279 \begin_layout Plain Layout
7285 , associated with the LaTeX document class
7286 \begin_inset Flex Code
7289 \begin_layout Plain Layout
7296 \begin_inset Quotes eld
7299 article (with my own headings)
7300 \begin_inset Quotes erd
7304 If your text class depends on several packages, you can declare it as:
7307 \begin_layout LyX-Code
7310 #% Do not delete the line below; configure depends on this
7313 \begin_layout LyX-Code
7318 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7321 \begin_layout Standard
7322 This indicates that your text class uses the
7323 \begin_inset Flex Code
7326 \begin_layout Plain Layout
7333 Finally, it is also possible to declare classes for DocBook code.
7334 Typical declarations will look like:
7337 \begin_layout LyX-Code
7340 #% Do not delete the line below; configure depends on this
7343 \begin_layout LyX-Code
7348 DeclareDocBookClass[article]{SGML (DocBook article)}
7351 \begin_layout Standard
7352 Note that these declarations can also be given an optional parameter declaring
7353 the name of the document class (but not a list).
7356 \begin_layout Standard
7357 So, to be as explicit as possible, the form of the layout declaration is:
7360 \begin_layout LyX-Code
7365 DeclareLaTeXClass[class,package.sty]{layout description}
7368 \begin_layout Standard
7369 The class need only be specified if the name of the LaTeX class file and
7370 the name of the layout file are different or if there are packages to load.
7371 If the name of the class file is not specified, then LyX will simply assume
7372 that it is the same as the name of the layout file.
7375 \begin_layout Standard
7376 When the text class has been modified to your taste, all you have to do
7377 is to copy it either to
7378 \begin_inset Flex Code
7381 \begin_layout Plain Layout
7388 \begin_inset Flex Code
7391 \begin_layout Plain Layout
7398 \begin_inset Flex MenuItem
7401 \begin_layout Plain Layout
7402 Tools\SpecialChar \menuseparator
7408 , exit LyX and restart.
7409 Then your new text class should be available along with the others.
7412 \begin_layout Standard
7413 Once the layout file is installed, you can edit it and see your changes
7414 without having to reconfigure or to restart LyX.
7419 \begin_layout Plain Layout
7420 In versions of LyX prior to 1.6, this was not true.
7421 As a result, editing layout files was very time consuming, since you had
7422 constantly to restart LyX to see changes.
7427 You can force a reload of the current layout by using the LyX function
7429 \begin_inset Flex MenuItem
7432 \begin_layout Plain Layout
7439 There is no default binding for this function—though, of course, you can
7440 bind it to a key yourself.
7441 But you will normally use this function simply by entering it in the mini-buffe
7446 \begin_layout Standard
7452 \begin_inset Flex MenuItem
7455 \begin_layout Plain Layout
7461 is very much an `advanced feature'.
7466 recommended that you save your work before using this function.
7471 recommended that you not attempt to edit layout information while simultaneousl
7472 y working on a document that you care about.
7473 Use a test document.
7474 Syntax errors and the like in your layout file could cause peculiar behavior.
7475 In particular, such errors could cause LyX to regard the current layout
7476 as invalid and to attempt to switch to some other layout.
7480 \begin_layout Plain Layout
7481 Really bad syntax errors may even caused LyX to exit.
7482 This is because certain sorts of errors may make LyX unable to read
7492 The LyX team strives to keep LyX stable in such situations, but safe is
7497 \begin_layout Plain Layout
7498 While we're giving advice: make regular backups.
7499 And be nice to your mother.
7507 \begin_layout Subsection
7508 The Module declaration
7511 \begin_layout Standard
7512 A module must begin with a line like the following:
7515 \begin_layout LyX-Code
7518 DeclareLyXModule[endnotes.sty]{Endnotes}
7521 \begin_layout Standard
7522 The mandatory argument, in curly brackets, is the name of the module, as
7524 \begin_inset Flex MenuItem
7527 \begin_layout Plain Layout
7528 Document\SpecialChar \menuseparator
7529 Settings\SpecialChar \menuseparator
7536 The argument in square brackets is optional: It declares any LaTeX packages
7537 on which the module depends.
7538 Please note that only packages about which LyX knows should be listed in
7539 the square brackets.
7543 \begin_layout Plain Layout
7544 The list of such packages is documented only in the source code.
7549 LyX will not check for arbitrary packages.
7550 It is also possible to use the form
7551 \begin_inset Flex MenuItem
7554 \begin_layout Plain Layout
7560 as an optional argument, which declares that the module can only be used
7561 when there exists a conversion chain between the formats `
7562 \begin_inset Flex Code
7565 \begin_layout Plain Layout
7572 \begin_inset Flex Code
7575 \begin_layout Plain Layout
7584 \begin_layout Standard
7585 The module declaration should then be followed by lines like the following
7589 \begin_layout Plain Layout
7590 Preferably in English if the module should be published with LyX.
7591 This description will appear in the list of messages to be translated and
7592 will be thus translated with the next interface update.
7600 \begin_layout LyX-Code
7604 \begin_layout LyX-Code
7605 #Adds an endnote command, in addition to footnotes.
7609 \begin_layout LyX-Code
7610 #You will need to add
7612 theendnotes in TeX code where you
7615 \begin_layout LyX-Code
7616 #want the endnotes to appear.
7620 \begin_layout LyX-Code
7624 \begin_layout LyX-Code
7625 #Requires: somemodule | othermodule
7628 \begin_layout LyX-Code
7629 #Excludes: badmodule
7632 \begin_layout Standard
7633 The description is used in
7634 \begin_inset Flex MenuItem
7637 \begin_layout Plain Layout
7638 Document\SpecialChar \menuseparator
7639 Settings\SpecialChar \menuseparator
7645 to provide the user with information about what the module does.
7647 \begin_inset Flex Code
7650 \begin_layout Plain Layout
7656 line is used to identify other modules with which this one must be used;
7658 \begin_inset Flex Code
7661 \begin_layout Plain Layout
7667 line is used to identify modules with which this one may not be used.
7668 Both are optional, and, as shown, multiple modules should be separated
7669 with the pipe symbol: |.
7670 Note that the required modules are treated disjunctively:
7674 of the required modules must be used.
7679 excluded module may be used.
7680 Note that modules are identified here by their
7685 \begin_inset Flex Code
7688 \begin_layout Plain Layout
7696 \begin_inset Flex Code
7699 \begin_layout Plain Layout
7706 \begin_inset Flex Code
7709 \begin_layout Plain Layout
7718 \begin_layout Subsection
7722 \begin_layout Standard
7723 The first non-comment line of any layout file, included file, or module
7728 contain the file format number:
7731 \begin_layout Description
7732 \begin_inset Flex Code
7735 \begin_layout Plain Layout
7742 \begin_inset Flex Code
7745 \begin_layout Plain Layout
7751 ] The format of the layout file.
7754 \begin_layout Standard
7755 This tag was introduced with LyX 1.4.0.
7756 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7757 and are considered to be of format 1.
7758 The format for the present version of LyX is format 21.
7759 But each version of LyX is capable of reading earlier versions' layout
7760 files, just as they are capable of reading files produced by earlier versions
7762 There is, however, no provision for converting to earlier formats.
7763 So LyX 1.6.x will not read layout files in format 21 but only files in format
7767 \begin_layout Subsection
7768 \begin_inset CommandInset label
7770 name "sub:General-text-class"
7774 General text class parameters
7777 \begin_layout Standard
7778 These are general parameters that govern the behavior of an entire document
7784 mean that they must appear in
7785 \begin_inset Flex Code
7788 \begin_layout Plain Layout
7794 files rather than in modules.
7795 A module can contain any layout tag.)
7798 \begin_layout Description
7799 \begin_inset Flex Code
7802 \begin_layout Plain Layout
7808 Adds information that will be output in the
7809 \begin_inset Flex Code
7812 \begin_layout Plain Layout
7818 block when this document class is output to XHTML.
7819 Typically, this would be used to output CSS style information, but it can
7820 be used for anything that can appear in
7821 \begin_inset Flex Code
7824 \begin_layout Plain Layout
7832 \begin_inset Quotes eld
7836 \begin_inset Flex Code
7839 \begin_layout Plain Layout
7846 \begin_inset Quotes erd
7852 \begin_layout Description
7853 \begin_inset Flex Code
7856 \begin_layout Plain Layout
7862 Adds CSS styling information.
7863 This will either be output in a
7864 \begin_inset Quotes eld
7868 \begin_inset Flex Code
7871 \begin_layout Plain Layout
7878 \begin_inset Quotes erd
7881 block or, if the user has so chosen, to a separate CSS file.Must end with
7883 \begin_inset Quotes eld
7887 \begin_inset Flex Code
7890 \begin_layout Plain Layout
7897 \begin_inset Quotes erd
7903 \begin_layout Description
7904 \begin_inset Flex Code
7907 \begin_layout Plain Layout
7913 Adds information to the document preamble.
7915 \begin_inset Quotes eld
7919 \begin_inset Flex Code
7922 \begin_layout Plain Layout
7929 \begin_inset Quotes erd
7935 \begin_layout Description
7936 \begin_inset Flex Code
7939 \begin_layout Plain Layout
7945 Defines formats for use in the display of bibliographic information.
7947 \begin_inset CommandInset ref
7949 reference "sub:Citation-format-description"
7955 \begin_inset Quotes eld
7959 \begin_inset Flex Code
7962 \begin_layout Plain Layout
7969 \begin_inset Quotes erd
7975 \begin_layout Description
7976 \begin_inset Flex Code
7979 \begin_layout Plain Layout
7985 Describes various global options supported by the document class.
7987 \begin_inset space ~
7991 \begin_inset CommandInset ref
7993 reference "sub:ClassOptions"
7999 \begin_inset Quotes eld
8003 \begin_inset Flex Code
8006 \begin_layout Plain Layout
8013 \begin_inset Quotes erd
8019 \begin_layout Description
8020 \begin_inset Flex Code
8023 \begin_layout Plain Layout
8030 \begin_inset Flex Code
8033 \begin_layout Plain Layout
8042 \begin_inset Flex Code
8045 \begin_layout Plain Layout
8051 ] Whether the class should
8055 to having one or two columns.
8056 Can be changed in the
8057 \begin_inset Flex MenuItem
8060 \begin_layout Plain Layout
8061 Document\SpecialChar \menuseparator
8070 \begin_layout Description
8071 \begin_inset Flex Code
8074 \begin_layout Plain Layout
8081 \begin_inset Flex Code
8084 \begin_layout Plain Layout
8090 ] This sequence defines the properties for a counter.
8091 If the counter does not yet exist, it is created; if it does exist, it
8094 \begin_inset Quotes eld
8098 \begin_inset Flex Code
8101 \begin_layout Plain Layout
8108 \begin_inset Quotes erd
8112 \begin_inset Newline newline
8116 \begin_inset space ~
8120 \begin_inset CommandInset ref
8122 reference "sub:Counters"
8126 for details on counters.
8129 \begin_layout Description
8130 \begin_inset Flex Code
8133 \begin_layout Plain Layout
8139 Sets the default font used to display the document.
8141 \begin_inset space ~
8145 \begin_inset CommandInset ref
8147 reference "sub:Font-description"
8151 for how to declare fonts.
8153 \begin_inset Quotes eld
8157 \begin_inset Flex Code
8160 \begin_layout Plain Layout
8167 \begin_inset Quotes erd
8173 \begin_layout Description
8174 \begin_inset Flex Code
8177 \begin_layout Plain Layout
8184 \begin_inset Flex Code
8187 \begin_layout Plain Layout
8193 Specifies a module to be included by default with this document class.
8194 The module should be specified by filename without the
8195 \begin_inset Flex Code
8198 \begin_layout Plain Layout
8205 The user can still remove the module, but it will be active at the outset.
8206 (This applies only when new files are created, or when this class is chosen
8207 for an existing document.)
8210 \begin_layout Description
8211 \begin_inset Flex Code
8214 \begin_layout Plain Layout
8221 \begin_inset Flex Code
8224 \begin_layout Plain Layout
8230 ] This is the style that will be assigned to new paragraphs, usually
8231 \begin_inset Flex MenuItem
8234 \begin_layout Plain Layout
8241 This will default to the first defined style if not given, but you are
8242 encouraged to use this directive.
8245 \begin_layout Description
8246 \begin_inset Flex Code
8249 \begin_layout Plain Layout
8256 \begin_inset Flex Code
8259 \begin_layout Plain Layout
8265 ] This tag indicates that the module in question—which should be specified
8266 by filename without the
8267 \begin_inset Flex Code
8270 \begin_layout Plain Layout
8276 extension—cannot be used with this document class.
8277 This might be used in a journal-specific layout file to prevent, say, the
8279 \begin_inset Flex Code
8282 \begin_layout Plain Layout
8288 module that numbers theorems by section.
8293 be used in a module.
8294 Modules have their own way of excluding other modules (see
8295 \begin_inset CommandInset ref
8297 reference "sub:Layout-modules"
8304 \begin_layout Description
8305 \begin_inset Flex Code
8308 \begin_layout Plain Layout
8314 Defines a new float.
8316 \begin_inset space ~
8320 \begin_inset CommandInset ref
8322 reference "sub:Floats"
8328 \begin_inset Quotes eld
8332 \begin_inset Flex Code
8335 \begin_layout Plain Layout
8342 \begin_inset Quotes erd
8348 \begin_layout Description
8349 \begin_inset Flex Code
8352 \begin_layout Plain Layout
8358 Sets the information that will be output in the
8359 \begin_inset Flex Code
8362 \begin_layout Plain Layout
8368 block when this document class is output to XHTML.
8369 Note that this will completely override any prior
8370 \begin_inset Flex Code
8373 \begin_layout Plain Layout
8380 \begin_inset Flex Code
8383 \begin_layout Plain Layout
8391 \begin_inset Flex Code
8394 \begin_layout Plain Layout
8400 if you just want to add material to the preamble.) Must end with
8401 \begin_inset Quotes eld
8405 \begin_inset Flex Code
8408 \begin_layout Plain Layout
8415 \begin_inset Quotes erd
8421 \begin_layout Description
8422 \begin_inset Flex Code
8425 \begin_layout Plain Layout
8431 Sets CSS styling information.
8432 This will either be output in a
8433 \begin_inset Quotes eld
8437 \begin_inset Flex Code
8440 \begin_layout Plain Layout
8447 \begin_inset Quotes erd
8450 block or, if the user has so chosen, to a separate CSS file.
8451 Note that this will completely override any prior
8452 \begin_inset Flex Code
8455 \begin_layout Plain Layout
8462 \begin_inset Flex Code
8465 \begin_layout Plain Layout
8473 \begin_inset Flex Code
8476 \begin_layout Plain Layout
8482 if you just want to add material.) Must end with
8483 \begin_inset Quotes eld
8487 \begin_inset Flex Code
8490 \begin_layout Plain Layout
8497 \begin_inset Quotes erd
8503 \begin_layout Description
8504 \begin_inset Flex Code
8507 \begin_layout Plain Layout
8514 \begin_inset Flex Code
8517 \begin_layout Plain Layout
8523 ] The layout to use for the table of contents, bibliography, and so forth,
8524 when the document is output to HTML.
8525 For articles, this should normally be Section; for books, Chapter.
8526 If it is not given, then LyX will attempt to figure out which layout to
8530 \begin_layout Description
8531 \begin_inset Flex Code
8534 \begin_layout Plain Layout
8541 \begin_inset Flex Code
8544 \begin_layout Plain Layout
8550 ] Modifies the properties of the given counter.
8551 If the counter does not exist, the section is ignored.
8553 \begin_inset Quotes eld
8557 \begin_inset Flex Code
8560 \begin_layout Plain Layout
8567 \begin_inset Quotes erd
8571 \begin_inset Newline newline
8575 \begin_inset space ~
8579 \begin_inset CommandInset ref
8581 reference "sub:Counters"
8585 for details on counters.
8588 \begin_layout Description
8589 \begin_inset Flex Code
8592 \begin_layout Plain Layout
8599 \begin_inset Flex Code
8602 \begin_layout Plain Layout
8608 ] Modifies the properties of the given paragraph style.
8609 If the style does not exist, the section is ignored.
8611 \begin_inset Quotes eld
8615 \begin_inset Flex Code
8618 \begin_layout Plain Layout
8625 \begin_inset Quotes erd
8631 \begin_layout Description
8632 \begin_inset Flex Code
8635 \begin_layout Plain Layout
8641 As its name implies, this command allows you to include another layout
8642 definition file within yours to avoid duplicating commands.
8643 Common examples are the standard layout files, for example,
8644 \begin_inset Flex Code
8647 \begin_layout Plain Layout
8653 , which contains most of the basic layouts.
8656 \begin_layout Description
8657 \begin_inset Flex Code
8660 \begin_layout Plain Layout
8666 This section (re-)defines the layout of an inset.
8667 It can be applied to an existing inset or to a new, user-defined inset,
8668 e.g., a new character style.
8670 \begin_inset Quotes eld
8674 \begin_inset Flex Code
8677 \begin_layout Plain Layout
8684 \begin_inset Quotes erd
8688 \begin_inset Newline newline
8692 \begin_inset space ~
8696 \begin_inset CommandInset ref
8698 reference "sub:Flex-insets-and"
8702 for more information.
8706 \begin_layout Description
8707 \begin_inset Flex Code
8710 \begin_layout Plain Layout
8717 \begin_inset Flex Code
8720 \begin_layout Plain Layout
8726 ] A string that indicates the width of the left margin on the screen, for
8728 \begin_inset Quotes eld
8732 \begin_inset Quotes erd
8736 (Note that this is not a `length', like
8737 \begin_inset Quotes eld
8741 \begin_inset Quotes erd
8747 \begin_layout Description
8748 \begin_inset Flex Code
8751 \begin_layout Plain Layout
8758 \begin_inset Flex Code
8761 \begin_layout Plain Layout
8767 ] This command deletes an existing counter, usually one defined in an included
8771 \begin_layout Description
8772 \begin_inset Flex Code
8775 \begin_layout Plain Layout
8781 This command deletes an existing float.
8782 This is particularly useful when you want to suppress a float that has
8783 been defined in an input file.
8786 \begin_layout Description
8787 \begin_inset Flex Code
8790 \begin_layout Plain Layout
8796 This command deletes an existing style.
8797 This is particularly useful when you want to suppress a style that has
8798 be defined in an input file.
8801 \begin_layout Description
8802 \begin_inset Flex Code
8805 \begin_layout Plain Layout
8811 A string indicating the file format (as defined in the Preferences dialog)
8812 produced by this class.
8813 It is mainly useful when
8814 \begin_inset Flex Code
8817 \begin_layout Plain Layout
8823 is `literate' and one wants to define a new type of literate document.
8824 This string is reset to `docbook', `latex', or `literate' when the correspondin
8826 \begin_inset Flex Code
8829 \begin_layout Plain Layout
8835 parameter is encountered.
8838 \begin_layout Description
8839 \begin_inset Flex Code
8842 \begin_layout Plain Layout
8848 A string indicating what sort of output documents using this class will
8850 At present, the options are: `docbook', `latex', and `literate'.
8853 \begin_layout Description
8854 \begin_inset Flex Code
8857 \begin_layout Plain Layout
8864 \begin_inset Flex Code
8867 \begin_layout Plain Layout
8876 \begin_inset Flex Code
8879 \begin_layout Plain Layout
8886 \begin_inset Flex Code
8889 \begin_layout Plain Layout
8895 ] The default pagestyle.
8896 Can be changed in the
8897 \begin_inset Flex MenuItem
8900 \begin_layout Plain Layout
8901 Document\SpecialChar \menuseparator
8910 \begin_layout Description
8911 \begin_inset Flex Code
8914 \begin_layout Plain Layout
8920 Sets the preamble for the LaTeX document.
8921 Note that this will completely override any prior
8922 \begin_inset Flex Code
8925 \begin_layout Plain Layout
8932 \begin_inset Flex Code
8935 \begin_layout Plain Layout
8943 \begin_inset Flex Code
8946 \begin_layout Plain Layout
8952 if you just want to add material to the preamble.) Must end with
8953 \begin_inset Quotes eld
8957 \begin_inset Flex Code
8960 \begin_layout Plain Layout
8967 \begin_inset Quotes erd
8973 \begin_layout Description
8974 \begin_inset Flex Code
8977 \begin_layout Plain Layout
8984 \begin_inset Flex Code
8987 \begin_layout Plain Layout
8994 \begin_inset Flex Code
8997 \begin_layout Plain Layout
9006 \begin_inset Flex Code
9009 \begin_layout Plain Layout
9015 ] Whether the class already provides the feature
9016 \begin_inset Flex Code
9019 \begin_layout Plain Layout
9026 A feature is in general the name of a package (
9027 \begin_inset Flex Code
9030 \begin_layout Plain Layout
9037 \begin_inset Flex Code
9040 \begin_layout Plain Layout
9046 , \SpecialChar \ldots{}
9048 \begin_inset Flex Code
9051 \begin_layout Plain Layout
9058 \begin_inset Flex Code
9061 \begin_layout Plain Layout
9067 ,\SpecialChar \ldots{}
9068 ); the complete list of supported features is unfortunately not documented
9069 outside the LyX source code—but see
9070 \begin_inset Flex Code
9073 \begin_layout Plain Layout
9079 if you're interested.
9081 \begin_inset Flex MenuItem
9084 \begin_layout Plain Layout
9085 Help\SpecialChar \menuseparator
9091 also gives an overview of the supported packages.
9094 \begin_layout Description
9095 \begin_inset Flex Code
9098 \begin_layout Plain Layout
9105 \begin_inset Flex Code
9108 \begin_layout Plain Layout
9114 ] Indicates that this layout provides the functionality of the module mentioned,
9115 which should be specified by the filename without the
9116 \begin_inset Flex Code
9119 \begin_layout Plain Layout
9126 This will typically be used if the layout includes the module directly,
9127 rather than using the
9128 \begin_inset Flex Code
9131 \begin_layout Plain Layout
9137 tag to indicate that it ought to be used.
9138 It could also be used in a module that provided an alternate implementation
9139 of the same functionality.
9142 \begin_layout Description
9143 \begin_inset Flex Code
9146 \begin_layout Plain Layout
9153 \begin_inset Flex Code
9156 \begin_layout Plain Layout
9162 ] Whether the class requires the feature
9163 \begin_inset Flex Code
9166 \begin_layout Plain Layout
9173 Multiple features must be separated by commas.
9174 Note that you can only request supported features.
9176 \begin_inset Flex Code
9179 \begin_layout Plain Layout
9185 for a list of these.)
9188 \begin_layout Description
9189 \begin_inset Flex Code
9192 \begin_layout Plain Layout
9198 A string that indicates the width of the right margin on the screen, for
9200 \begin_inset Quotes eld
9204 \begin_inset Quotes erd
9210 \begin_layout Description
9211 \begin_inset Flex Code
9214 \begin_layout Plain Layout
9220 Sets which divisions get numbered.
9222 \begin_inset Flex Code
9225 \begin_layout Plain Layout
9234 \begin_layout Description
9235 \begin_inset Flex Code
9238 \begin_layout Plain Layout
9245 \begin_inset Flex Code
9248 \begin_layout Plain Layout
9257 \begin_inset Flex Code
9260 \begin_layout Plain Layout
9266 ] Whether the class-default should be printing on one or both sides of the
9268 Can be changed in the
9269 \begin_inset Flex MenuItem
9272 \begin_layout Plain Layout
9273 Document\SpecialChar \menuseparator
9282 \begin_layout Description
9283 \begin_inset Flex Code
9286 \begin_layout Plain Layout
9292 This sequence defines a paragraph style.
9293 If the style does not yet exist, it is created; if it does exist, its parameter
9296 \begin_inset Quotes eld
9300 \begin_inset Flex Code
9303 \begin_layout Plain Layout
9310 \begin_inset Quotes erd
9314 \begin_inset Newline newline
9318 \begin_inset space ~
9322 \begin_inset CommandInset ref
9324 reference "sub:Paragraph-Styles"
9328 for details on paragraph styles.
9331 \begin_layout Description
9332 \begin_inset Flex Code
9335 \begin_layout Plain Layout
9342 \begin_inset Flex Code
9345 \begin_layout Plain Layout
9351 ] The name of the command or environment to be used with
9352 \begin_inset Flex Code
9355 \begin_layout Plain Layout
9364 \begin_layout Description
9365 \begin_inset Flex Code
9368 \begin_layout Plain Layout
9375 \begin_inset Flex Code
9378 \begin_layout Plain Layout
9387 \begin_inset Flex Code
9390 \begin_layout Plain Layout
9396 ] Indicates what kind of markup is used to define the title of a document.
9398 \begin_inset Flex Code
9401 \begin_layout Plain Layout
9407 means that the macro with name
9408 \begin_inset Flex Code
9411 \begin_layout Plain Layout
9417 will be inserted after the last layout which has
9418 \begin_inset Quotes eld
9422 \begin_inset Flex Code
9425 \begin_layout Plain Layout
9432 \begin_inset Quotes erd
9437 \begin_inset Flex Code
9440 \begin_layout Plain Layout
9446 corresponds to the case where the block of paragraphs which have
9447 \begin_inset Quotes eld
9451 \begin_inset Flex Code
9454 \begin_layout Plain Layout
9461 \begin_inset Quotes erd
9464 should be enclosed into the
9465 \begin_inset Flex Code
9468 \begin_layout Plain Layout
9477 \begin_layout Description
9478 \begin_inset Flex Code
9481 \begin_layout Plain Layout
9487 Sets which divisions are included in the table of contents.
9489 \begin_inset Flex Code
9492 \begin_layout Plain Layout
9501 \begin_layout Subsection
9502 \begin_inset Flex Code
9505 \begin_layout Plain Layout
9512 \begin_inset CommandInset label
9514 name "sub:ClassOptions"
9521 \begin_layout Standard
9523 \begin_inset Flex Code
9526 \begin_layout Plain Layout
9532 section can contain the following entries:
9535 \begin_layout Description
9536 \begin_inset Flex Code
9539 \begin_layout Plain Layout
9546 \begin_inset Flex Code
9549 \begin_layout Plain Layout
9555 ] The list of available font sizes for the document's main font, separated
9557 \begin_inset Quotes eld
9561 \begin_inset Flex Code
9564 \begin_layout Plain Layout
9571 \begin_inset Quotes erd
9577 \begin_layout Description
9578 \begin_inset Flex Code
9581 \begin_layout Plain Layout
9587 Used to set the DTD line with XML-based output classes.
9589 \begin_inset space \thinspace{}
9593 \begin_inset Quotes eld
9596 -//OASIS//DTD DocBook V4.2//EN
9597 \begin_inset Quotes erd
9603 \begin_layout Description
9604 \begin_inset Flex Code
9607 \begin_layout Plain Layout
9614 \begin_inset Flex Code
9617 \begin_layout Plain Layout
9618 string="empty|plain|headings|fancy"
9623 ] The list of available page styles, separated by
9624 \begin_inset Quotes eld
9628 \begin_inset Flex Code
9631 \begin_layout Plain Layout
9638 \begin_inset Quotes erd
9644 \begin_layout Description
9645 \begin_inset Flex Code
9648 \begin_layout Plain Layout
9655 \begin_inset Flex Code
9658 \begin_layout Plain Layout
9664 ] Some document class options, separated by a comma, that will be added
9665 to the optional part of the
9666 \begin_inset Flex Code
9669 \begin_layout Plain Layout
9680 \begin_layout Standard
9682 \begin_inset Flex Code
9685 \begin_layout Plain Layout
9691 section must end with
9692 \begin_inset Quotes eld
9696 \begin_inset Flex Code
9699 \begin_layout Plain Layout
9706 \begin_inset Quotes erd
9712 \begin_layout Subsection
9714 \begin_inset CommandInset label
9716 name "sub:Paragraph-Styles"
9723 \begin_layout Standard
9724 A paragraph style description looks like this:
9728 \begin_layout Plain Layout
9729 Note that this will either define a new style or modify an existing one.
9737 \begin_layout LyX-Code
9744 \begin_layout LyX-Code
9748 \begin_layout LyX-Code
9752 \begin_layout Standard
9753 where the following commands are allowed:
9756 \begin_layout Description
9757 \begin_inset Flex Code
9760 \begin_layout Plain Layout
9767 \begin_inset Flex Code
9770 \begin_layout Plain Layout
9775 , left, right, center
9780 ] Paragraph alignment.
9783 \begin_layout Description
9784 \begin_inset Flex Code
9787 \begin_layout Plain Layout
9794 \begin_inset Flex Code
9797 \begin_layout Plain Layout
9802 , left, right, center
9807 ] A comma separated list of permitted alignments.
9808 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9810 For example a right-aligned or centered enumeration isn't possible.)
9813 \begin_layout Description
9814 \begin_inset Flex Code
9817 \begin_layout Plain Layout
9823 Note that this will completely override any prior
9824 \begin_inset Flex Code
9827 \begin_layout Plain Layout
9833 declaration for this style.
9835 \begin_inset Quotes eld
9839 \begin_inset Flex Code
9842 \begin_layout Plain Layout
9849 \begin_inset Quotes erd
9854 \begin_inset CommandInset ref
9856 reference "sub:I18n"
9860 for details on its use.
9863 \begin_layout Description
9864 \begin_inset Flex Code
9867 \begin_layout Plain Layout
9874 \begin_inset Flex Code
9877 \begin_layout Plain Layout
9887 \begin_layout Plain Layout
9888 Note that a `float' here is a real number, such as: 1.5.
9893 The vertical space with which the last of a chain of paragraphs with this
9894 style is separated from the following paragraph.
9895 If the next paragraph has another style, the separations are not simply
9896 added, but the maximum is taken.
9899 \begin_layout Description
9900 \begin_inset Flex Code
9903 \begin_layout Plain Layout
9910 \begin_inset Flex Code
9913 \begin_layout Plain Layout
9919 The category for this style.
9920 This is used to group related styles in the style combobox on the toolbar.
9921 Any string can be used, but you may want to use existing categories with
9926 \begin_layout Description
9927 \begin_inset Flex Code
9930 \begin_layout Plain Layout
9936 Depth of XML command.
9937 Used only with XML-type formats.
9940 \begin_layout Description
9941 \begin_inset Flex Code
9944 \begin_layout Plain Layout
9951 \begin_inset Flex Code
9954 \begin_layout Plain Layout
9960 Copies all the features of an existing style into the current one.
9964 \begin_layout Description
9965 \begin_inset Flex Code
9968 \begin_layout Plain Layout
9974 The name of a style whose preamble should be output
9979 This allows to ensure some ordering of the preamble snippets when macros
9980 definitions depend on one another.
9984 \begin_layout Plain Layout
9985 Note that, besides that functionality, there is no way to ensure any ordering
9987 The ordering that you see in a given version of LyX may change without
9988 warning in later versions.
9996 \begin_layout Description
9997 \begin_inset Flex Code
10000 \begin_layout Plain Layout
10007 \begin_inset Flex Code
10010 \begin_layout Plain Layout
10015 , Box, Filled_Box, Static
10020 ] The type of label that stands at the end of the paragraph (or sequence
10022 \begin_inset Flex Code
10025 \begin_layout Plain Layout
10032 \begin_inset Flex Code
10035 \begin_layout Plain Layout
10042 \begin_inset Flex Code
10045 \begin_layout Plain Layout
10052 \begin_inset Flex Code
10055 \begin_layout Plain Layout
10063 \begin_inset Flex Code
10066 \begin_layout Plain Layout
10073 \begin_inset Quotes eld
10077 \begin_inset Quotes erd
10081 \begin_inset Flex Code
10084 \begin_layout Plain Layout
10091 \begin_inset Flex Code
10094 \begin_layout Plain Layout
10095 \begin_inset space ~
10103 ) is a white (resp.
10104 \begin_inset space ~
10107 black) square suitable for end of proof markers,
10108 \begin_inset Flex Code
10111 \begin_layout Plain Layout
10117 is an explicit text string.
10120 \begin_layout Description
10121 \begin_inset Flex Code
10124 \begin_layout Plain Layout
10131 \begin_inset Flex Code
10134 \begin_layout Plain Layout
10140 ] The string used for a label with a
10141 \begin_inset Flex Code
10144 \begin_layout Plain Layout
10151 \begin_inset Flex Code
10154 \begin_layout Plain Layout
10164 \begin_layout Description
10165 \begin_inset Flex Code
10168 \begin_layout Plain Layout
10174 The font used for both the text body
10180 \begin_inset space ~
10184 \begin_inset CommandInset ref
10186 reference "sub:Font-description"
10191 Note that defining this font automatically defines the
10192 \begin_inset Flex Code
10195 \begin_layout Plain Layout
10202 So you should define this one first if you also want to define
10203 \begin_inset Flex Code
10206 \begin_layout Plain Layout
10215 \begin_layout Description
10216 \begin_inset Flex Code
10219 \begin_layout Plain Layout
10226 \begin_inset CommandInset label
10228 name "des:FreeSpacing"
10233 \begin_inset Flex Code
10236 \begin_layout Plain Layout
10245 \begin_inset Flex Code
10248 \begin_layout Plain Layout
10254 ] Usually LyX doesn't allow you to insert more than one space between words,
10255 since a space is considered as the separation between two words, not a
10256 character or symbol of its own.
10257 This is a very fine thing but sometimes annoying, for example, when typing
10258 program code or plain LaTeX code.
10260 \begin_inset Flex Code
10263 \begin_layout Plain Layout
10270 Note that LyX will create protected blanks for the additional blanks when
10271 in another mode than LaTeX-mode.
10274 \begin_layout Description
10275 \begin_inset Flex Code
10278 \begin_layout Plain Layout
10284 These tags are used with XHTML output.
10286 \begin_inset CommandInset ref
10288 reference "sub:Paragraph-Style-XHTML"
10295 \begin_layout Description
10296 \begin_inset Flex Code
10299 \begin_layout Plain Layout
10305 [[FIXME]] (Used only with XML-type formats.)
10308 \begin_layout Description
10309 \begin_inset Flex Code
10312 \begin_layout Plain Layout
10319 \begin_inset Flex Code
10322 \begin_layout Plain Layout
10328 If 1, marks the style as to be included in the document preamble rather
10329 than in the document body.
10330 This is useful for document classes that want such information as the title
10331 and author to appear in the preamble.
10332 Note that this works only for styles for which the
10333 \begin_inset Flex Code
10336 \begin_layout Plain Layout
10343 \begin_inset Flex Code
10346 \begin_layout Plain Layout
10353 \begin_inset Flex Code
10356 \begin_layout Plain Layout
10365 \begin_layout Description
10366 \begin_inset Flex Code
10369 \begin_layout Plain Layout
10376 \begin_inset Flex Code
10379 \begin_layout Plain Layout
10385 If 1, marks the style as being part of a title block (see also the
10386 \begin_inset Flex Code
10389 \begin_layout Plain Layout
10396 \begin_inset Flex Code
10399 \begin_layout Plain Layout
10408 \begin_layout Description
10409 \begin_inset Flex Code
10412 \begin_layout Plain Layout
10419 \begin_inset Flex Code
10422 \begin_layout Plain Layout
10428 ] This provides extra space between paragraphs that have the same style.
10429 If you put other styles into an environment, each is separated with the
10431 \begin_inset Flex Code
10434 \begin_layout Plain Layout
10441 But the whole items of the environment are additionally separated with
10443 \begin_inset Flex Code
10446 \begin_layout Plain Layout
10453 Note that this is a
10458 \begin_layout Description
10459 \begin_inset Flex Code
10462 \begin_layout Plain Layout
10468 [[FIXME]] (Used only with XML-type formats.)
10471 \begin_layout Description
10472 \begin_inset Flex Code
10475 \begin_layout Plain Layout
10482 \begin_inset Flex Code
10485 \begin_layout Plain Layout
10494 \begin_inset Flex Code
10497 \begin_layout Plain Layout
10503 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10504 lead to empty LaTeX output.
10505 There are some cases where this could be desirable however: in a letter
10506 template, the required fields can be provided as empty fields, so that
10507 people do not forget them; in some special classes, a style can be used
10508 as some kind of break, which does not contain actual text.
10511 \begin_layout Description
10512 \begin_inset Flex Code
10515 \begin_layout Plain Layout
10521 [float=0] The vertical space between the label and the text body.
10522 Only used for labels that are above the text body (
10523 \begin_inset Flex Code
10526 \begin_layout Plain Layout
10533 \begin_inset Flex Code
10536 \begin_layout Plain Layout
10537 Centered_Top_Environment
10545 \begin_layout Description
10546 \begin_inset Flex Code
10549 \begin_layout Plain Layout
10556 \begin_inset Flex Code
10559 \begin_layout Plain Layout
10566 \begin_inset Newline newline
10569 The name of the counter for automatic numbering.
10571 \begin_inset Newline newline
10579 \begin_inset Flex Code
10582 \begin_layout Plain Layout
10589 \begin_inset Flex Code
10592 \begin_layout Plain Layout
10599 In that case, the counter will be stepped each time the style appears.
10601 \begin_inset Newline newline
10609 \begin_inset Flex Code
10612 \begin_layout Plain Layout
10619 \begin_inset Flex Code
10622 \begin_layout Plain Layout
10628 , though this case is a bit complicated.
10629 Suppose you declare
10630 \begin_inset Quotes eld
10634 \begin_inset Flex Code
10637 \begin_layout Plain Layout
10638 LabelCounter myenum
10644 \begin_inset Quotes erd
10648 Then the actual counters used are
10649 \begin_inset Flex Code
10652 \begin_layout Plain Layout
10659 \begin_inset Flex Code
10662 \begin_layout Plain Layout
10669 \begin_inset Flex Code
10672 \begin_layout Plain Layout
10679 \begin_inset Flex Code
10682 \begin_layout Plain Layout
10688 , much as in LaTeX.
10689 These counters must all be declared separately.
10690 \begin_inset Newline newline
10694 \begin_inset CommandInset ref
10696 reference "sub:Counters"
10700 for details on counters.
10703 \begin_layout Description
10704 \begin_inset Flex Code
10707 \begin_layout Plain Layout
10713 The font used for the label.
10715 \begin_inset space ~
10719 \begin_inset CommandInset ref
10721 reference "sub:Font-description"
10728 \begin_layout Description
10729 \begin_inset Flex Code
10732 \begin_layout Plain Layout
10738 Text that indicates how far a label should be indented.
10741 \begin_layout Description
10742 \begin_inset Flex Code
10745 \begin_layout Plain Layout
10752 \begin_inset Flex Code
10755 \begin_layout Plain Layout
10761 ] The horizontal space between the label and the text body.
10762 Only used for labels that are not above the text body.
10765 \begin_layout Description
10766 \begin_inset Flex Code
10769 \begin_layout Plain Layout
10776 \begin_inset Flex Code
10779 \begin_layout Plain Layout
10785 ] The string used for a label with a
10786 \begin_inset Flex Code
10789 \begin_layout Plain Layout
10797 \begin_inset Flex Code
10800 \begin_layout Plain Layout
10806 is set, this string can be contain the special formatting commands described
10808 \begin_inset CommandInset ref
10810 reference "sub:Counters"
10818 \begin_layout Plain Layout
10819 For the sake of backwards compatibility, the string
10820 \begin_inset Flex Code
10823 \begin_layout Plain Layout
10833 will be replaced by the expanded
10834 \begin_inset Flex Code
10837 \begin_layout Plain Layout
10844 \begin_inset Flex Code
10847 \begin_layout Plain Layout
10856 This feature is now obsolete and should be replaced by the mechanisms of
10858 \begin_inset CommandInset ref
10860 reference "sub:Counters"
10872 \begin_layout Description
10873 \begin_inset Flex Code
10876 \begin_layout Plain Layout
10877 LabelStringAppendix
10883 \begin_inset Flex Code
10886 \begin_layout Plain Layout
10892 ] This is used inside the appendix instead of
10893 \begin_inset Flex Code
10896 \begin_layout Plain Layout
10904 \begin_inset Flex Code
10907 \begin_layout Plain Layout
10914 \begin_inset Flex Code
10917 \begin_layout Plain Layout
10918 LabelStringAppendix
10926 \begin_layout Description
10927 \begin_inset Flex Code
10930 \begin_layout Plain Layout
10936 [FIXME] (Used only with XML-type formats.)
10939 \begin_layout Description
10940 \begin_inset Flex Code
10943 \begin_layout Plain Layout
10950 \begin_inset Flex Code
10953 \begin_layout Plain Layout
10958 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10959 Enumerate, Itemize, Bibliography
10968 \begin_layout Itemize
10969 \begin_inset Flex Code
10972 \begin_layout Plain Layout
10978 means the label is the very first word (up to the first real blank).
10979 Use protected spaces (like
10980 \begin_inset space ~
10983 that one) if you want more than one word as the label.
10987 \begin_layout Itemize
10988 \begin_inset Flex Code
10991 \begin_layout Plain Layout
10997 means the label is simply whatever
10998 \begin_inset Flex Code
11001 \begin_layout Plain Layout
11008 Note that this really is `static'.
11011 \begin_layout Itemize
11012 \begin_inset Flex Code
11015 \begin_layout Plain Layout
11022 \begin_inset Flex Code
11025 \begin_layout Plain Layout
11026 Centered_Top_Environment
11031 are special cases of
11032 \begin_inset Flex Code
11035 \begin_layout Plain Layout
11042 The label will be printed above the paragraph, but only at the top of an
11043 environment or the top of a chain of paragraphs with this style.
11044 This might be used with the
11045 \begin_inset Flex MenuItem
11048 \begin_layout Plain Layout
11054 style, for example.
11057 \begin_layout Itemize
11058 \begin_inset Flex Code
11061 \begin_layout Plain Layout
11067 is a special case for the caption-labels
11068 \begin_inset Quotes eld
11072 \begin_inset Quotes erd
11076 \begin_inset Quotes eld
11080 \begin_inset Quotes erd
11085 \begin_inset Flex Code
11088 \begin_layout Plain Layout
11094 means the (hardcoded) label string depends on the kind of float: It is
11095 hardcoded to be `FloatType N', where N is the value of the counter associated
11099 \begin_layout Itemize
11101 \begin_inset Flex Code
11104 \begin_layout Plain Layout
11110 label type defines automatically numbered labels.
11112 \begin_inset Flex Code
11115 \begin_layout Plain Layout
11121 will be expanded to resolve any counter references it contains: For example,
11123 \begin_inset Quotes eld
11127 \begin_inset Flex Code
11130 \begin_layout Plain Layout
11141 \begin_inset Quotes erd
11146 \begin_inset CommandInset ref
11148 reference "sub:Counters"
11152 for more information on counters.
11155 \begin_layout Itemize
11156 \begin_inset Flex Code
11159 \begin_layout Plain Layout
11165 produces the usual sort of enumeration labels.
11166 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11167 small Roman numerals, and uppercase letters for the four possible depths.
11170 \begin_layout Itemize
11171 \begin_inset Flex Code
11174 \begin_layout Plain Layout
11180 produces various bullets at the different levels.
11181 It is also hardcoded.
11184 \begin_layout Itemize
11185 \begin_inset Flex Code
11188 \begin_layout Plain Layout
11194 is used internally by LyX and should be used only with
11195 \begin_inset Flex Code
11198 \begin_layout Plain Layout
11199 LatexType BibEnvironment
11208 \begin_layout Description
11209 \begin_inset Flex Code
11212 \begin_layout Plain Layout
11218 Note that this will completely override any prior
11219 \begin_inset Flex Code
11222 \begin_layout Plain Layout
11228 declaration for this style.
11230 \begin_inset Quotes eld
11234 \begin_inset Flex Code
11237 \begin_layout Plain Layout
11244 \begin_inset Quotes erd
11249 \begin_inset CommandInset ref
11251 reference "sub:I18n"
11255 for details on its use.
11258 \begin_layout Description
11259 \begin_inset Flex Code
11262 \begin_layout Plain Layout
11268 The name of the corresponding LaTeX stuff.
11269 Either the environment or command name.
11272 \begin_layout Description
11273 \begin_inset Flex Code
11276 \begin_layout Plain Layout
11282 An optional parameter for the corresponding
11283 \begin_inset Flex Code
11286 \begin_layout Plain Layout
11293 This parameter cannot be changed from within LyX.
11296 \begin_layout Description
11297 \begin_inset Flex Code
11300 \begin_layout Plain Layout
11307 \begin_inset Flex Code
11310 \begin_layout Plain Layout
11315 , Command, Environment, Item_Environment,
11321 \begin_inset Flex Code
11324 \begin_layout Plain Layout
11325 List_Environment, Bib_Environment
11330 ] How the style should be translated into LaTeX.
11334 \begin_layout Plain Layout
11335 \begin_inset Flex Code
11338 \begin_layout Plain Layout
11344 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11345 Visit the SGML class files for specific examples.
11354 \begin_layout Itemize
11355 \begin_inset Flex Code
11358 \begin_layout Plain Layout
11364 means nothing special.
11368 \begin_layout Itemize
11369 \begin_inset Flex Code
11372 \begin_layout Plain Layout
11379 \begin_inset Flex Code
11382 \begin_layout Plain Layout
11389 {\SpecialChar \ldots{}
11398 \begin_layout Itemize
11399 \begin_inset Flex Code
11402 \begin_layout Plain Layout
11409 \begin_inset Flex Code
11412 \begin_layout Plain Layout
11419 }\SpecialChar \ldots{}
11435 \begin_layout Itemize
11436 \begin_inset Flex Code
11439 \begin_layout Plain Layout
11446 \begin_inset Flex Code
11449 \begin_layout Plain Layout
11456 \begin_inset Flex Code
11459 \begin_layout Plain Layout
11467 is generated for each paragraph of this environment.
11471 \begin_layout Itemize
11472 \begin_inset Flex Code
11475 \begin_layout Plain Layout
11482 \begin_inset Flex Code
11485 \begin_layout Plain Layout
11492 \begin_inset Flex Code
11495 \begin_layout Plain Layout
11501 is passed as an argument to the environment.
11503 \begin_inset Flex Code
11506 \begin_layout Plain Layout
11512 can be defined in the
11513 \begin_inset Flex MenuItem
11516 \begin_layout Plain Layout
11517 Edit\SpecialChar \menuseparator
11519 \begin_inset space ~
11531 \begin_layout Standard
11532 Putting the last few things together, the LaTeX output will be either:
11535 \begin_layout LyX-Code
11538 latexname[latexparam]{\SpecialChar \ldots{}
11542 \begin_layout Standard
11546 \begin_layout LyX-Code
11549 begin{latexname}[latexparam] \SpecialChar \ldots{}
11555 \begin_layout Standard
11556 depending upon the LaTeX type.
11560 \begin_layout Description
11561 \begin_inset Flex Code
11564 \begin_layout Plain Layout
11571 \begin_inset Flex Code
11574 \begin_layout Plain Layout
11580 ] If you put styles into environments, the leftmargins are not simply added,
11581 but added with a factor
11582 \begin_inset Formula $\frac{4}{depth+4}$
11586 Note that this parameter is also used when the margin is defined as
11587 \begin_inset Flex Code
11590 \begin_layout Plain Layout
11597 \begin_inset Flex Code
11600 \begin_layout Plain Layout
11607 Then it is added to the manual or dynamic margin.
11609 \begin_inset Newline newline
11612 The argument is passed as a string.
11614 \begin_inset Quotes eld
11618 \begin_inset Flex Code
11621 \begin_layout Plain Layout
11628 \begin_inset Quotes erd
11631 means that the paragraph is indented with the width of
11632 \begin_inset Quotes eld
11636 \begin_inset Flex Code
11639 \begin_layout Plain Layout
11646 \begin_inset Quotes erd
11649 in the normal font.
11650 You can get a negative width by prefixing the string with
11651 \begin_inset Quotes eld
11655 \begin_inset Flex Code
11658 \begin_layout Plain Layout
11665 \begin_inset Quotes erd
11669 This way was chosen so that the look is the same with each used screen
11674 \begin_layout Description
11675 \begin_inset Flex Code
11678 \begin_layout Plain Layout
11685 \begin_inset Flex Code
11688 \begin_layout Plain Layout
11693 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11699 \begin_inset Newline newline
11702 The kind of margin that the style has on the left side.
11704 \begin_inset Flex Code
11707 \begin_layout Plain Layout
11713 just means a fixed margin.
11715 \begin_inset Flex Code
11718 \begin_layout Plain Layout
11724 means that the left margin depends on the string entered in the
11725 \begin_inset Flex MenuItem
11728 \begin_layout Plain Layout
11729 Edit\SpecialChar \menuseparator
11731 \begin_inset space ~
11740 This is used to typeset nice lists without tabulators.
11742 \begin_inset Flex Code
11745 \begin_layout Plain Layout
11751 means that the margin depends on the size of the label.
11752 This is used for automatic enumerated headlines.
11753 It is obvious that the headline
11754 \begin_inset Quotes eld
11757 5.4.3.2.1 Very long headline
11758 \begin_inset Quotes erd
11761 must have a wider left margin (as wide as
11762 \begin_inset Quotes eld
11766 \begin_inset Quotes erd
11769 plus the space) than
11770 \begin_inset Quotes eld
11773 3.2 Very long headline
11774 \begin_inset Quotes erd
11778 \begin_inset Quotes eld
11782 \begin_inset Quotes erd
11785 are not able to do this.
11787 \begin_inset Flex Code
11790 \begin_layout Plain Layout
11796 is similar, but only the very first row of the paragraph is dynamic, while
11797 the others are static; this is used, for example, for descriptions.
11799 \begin_inset Flex Code
11802 \begin_layout Plain Layout
11808 means the margin is chosen in a way that the longest row of this paragraph
11809 fits to the right margin.
11810 This is used to typeset an address on the right edge of the page.
11813 \begin_layout Description
11814 \begin_inset Flex Code
11817 \begin_layout Plain Layout
11824 \begin_inset Flex Code
11827 \begin_layout Plain Layout
11836 \begin_inset Flex Code
11839 \begin_layout Plain Layout
11845 ] Whether fragile commands in this style should be
11846 \begin_inset Flex Code
11849 \begin_layout Plain Layout
11862 whether this command should itself be protected.)
11865 \begin_layout Description
11866 \begin_inset Flex Code
11869 \begin_layout Plain Layout
11876 \begin_inset Flex Code
11879 \begin_layout Plain Layout
11886 \begin_inset Flex Code
11889 \begin_layout Plain Layout
11897 ] Whether newlines are translated into LaTeX newlines (
11898 \begin_inset Flex Code
11901 \begin_layout Plain Layout
11912 The translation can be switched off to allow more comfortable LaTeX editing
11916 \begin_layout Description
11917 \begin_inset Flex Code
11920 \begin_layout Plain Layout
11927 \begin_inset Flex Code
11930 \begin_layout Plain Layout
11937 \begin_inset Flex Code
11940 \begin_layout Plain Layout
11948 ] If set to true, and if
11949 \begin_inset Flex Code
11952 \begin_layout Plain Layout
11959 \begin_inset Flex Code
11962 \begin_layout Plain Layout
11968 ) paragraphs are being indented, then the indentation of such a paragraph
11969 following one of this type will be suppressed.
11970 (So this will not affect the display of non-default paragraphs.)
11973 \begin_layout Description
11974 \begin_inset Flex Code
11977 \begin_layout Plain Layout
11983 Name of a style that has replaced this style.
11984 This is used to rename a style, while keeping backward compatibility.
11987 \begin_layout Description
11988 \begin_inset Flex Code
11991 \begin_layout Plain Layout
11998 \begin_inset Flex Code
12001 \begin_layout Plain Layout
12007 ] The number of optional arguments that can be used with this style.
12008 This is useful for things like section headings, and only makes sense with
12010 Note that, on output, the optional arguments will all precede any required
12011 arguments (see below).
12012 So one can have constructs like:
12016 \begin_layout LyX-Code
12019 mycmd[opt1]{req1}{contents of paragraph}
12022 \begin_layout Standard
12023 but one cannot have things like:
12026 \begin_layout LyX-Code
12029 mycmd[opt1]{req1}[opt2]{contents of paragraph}
12032 \begin_layout Standard
12033 at least, not without ERT (with which you can have anything).
12038 \begin_layout Description
12039 \begin_inset Flex Code
12042 \begin_layout Plain Layout
12049 \begin_inset Flex Code
12052 \begin_layout Plain Layout
12061 \begin_inset Flex Code
12064 \begin_layout Plain Layout
12070 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12071 output, but only by a line break; together with
12072 \begin_inset Flex Code
12075 \begin_layout Plain Layout
12081 , this allows to emulate a plain text editor (like the ERT inset).
12084 \begin_layout Description
12085 \begin_inset Flex Code
12088 \begin_layout Plain Layout
12095 \begin_inset Flex Code
12098 \begin_layout Plain Layout
12104 ] The indent of the very first line of a paragraph.
12106 \begin_inset Flex Code
12109 \begin_layout Plain Layout
12115 will be fixed for a certain style.
12116 The exception is the default style, since the indentation for these paragraphs
12117 can be prohibited with
12118 \begin_inset Flex Code
12121 \begin_layout Plain Layout
12129 \begin_inset Flex Code
12132 \begin_layout Plain Layout
12138 style paragraphs inside environments use the
12139 \begin_inset Flex Code
12142 \begin_layout Plain Layout
12148 of the environment, not their native one.
12150 \begin_inset Flex Code
12153 \begin_layout Plain Layout
12159 paragraphs inside an enumeration are not indented.
12162 \begin_layout Description
12163 \begin_inset Flex Code
12166 \begin_layout Plain Layout
12173 \begin_inset Flex Code
12176 \begin_layout Plain Layout
12182 ] The vertical space between two paragraphs of this style.
12185 \begin_layout Description
12186 \begin_inset Flex Code
12189 \begin_layout Plain Layout
12196 \begin_inset Flex Code
12199 \begin_layout Plain Layout
12205 ] LyX allows the user to choose either
12206 \begin_inset Quotes eld
12210 \begin_inset Quotes erd
12214 \begin_inset Quotes eld
12218 \begin_inset Quotes erd
12221 to typeset a document.
12223 \begin_inset Quotes eld
12227 \begin_inset Quotes erd
12230 is chosen, this value is completely ignored.
12232 \begin_inset Quotes eld
12236 \begin_inset Quotes erd
12239 is chosen, the parindent of a LaTeXtype
12240 \begin_inset Quotes eld
12244 \begin_inset Quotes erd
12247 style is ignored and all paragraphs are separated by this parskip argument.
12248 The vertical space is calculated with
12249 \begin_inset Flex Code
12252 \begin_layout Plain Layout
12254 \begin_inset space ~
12263 \begin_inset Flex Code
12266 \begin_layout Plain Layout
12272 is the height of a row with the normal font.
12273 This way, the look stays the same with different screen fonts.
12276 \begin_layout Description
12277 \begin_inset Flex Code
12280 \begin_layout Plain Layout
12287 \begin_inset Flex Code
12290 \begin_layout Plain Layout
12299 \begin_inset Flex Code
12302 \begin_layout Plain Layout
12308 ] Whether the contents of this paragraph should be output in raw form, meaning
12309 without special translations that LaTeX would require.
12312 \begin_layout Description
12313 \begin_inset Flex Code
12316 \begin_layout Plain Layout
12322 Information to be included in the LaTeX preamble when this style is used.
12323 Used to define macros, load packages, etc., required by this particular
12326 \begin_inset Quotes eld
12330 \begin_inset Flex Code
12333 \begin_layout Plain Layout
12340 \begin_inset Quotes erd
12346 \begin_layout Description
12347 \begin_inset Flex Code
12350 \begin_layout Plain Layout
12357 \begin_inset Flex Code
12360 \begin_layout Plain Layout
12366 ] The prefix to use when creating labels referring to paragraphs of this
12368 This allows the use of formatted references.
12371 \begin_layout Description
12372 \begin_inset Flex Code
12375 \begin_layout Plain Layout
12382 \begin_inset Flex Code
12385 \begin_layout Plain Layout
12391 ] The number of required arguments that the LaTeX command or environment
12392 corresponding to this style expects.
12393 In the case of a command, these are required arguments
12397 that associated with the content of the paragraph itself.
12398 These do not actually have to be provided: LyX will output empty arguments
12400 Note that optional arguments will be output before required arguments.
12401 See the discussion of the
12402 \begin_inset Flex Code
12405 \begin_layout Plain Layout
12411 tag above for more information.
12414 \begin_layout Description
12415 \begin_inset Flex Code
12418 \begin_layout Plain Layout
12425 \begin_inset Flex Code
12428 \begin_layout Plain Layout
12434 ] Whether the style requires the feature
12435 \begin_inset Flex Code
12438 \begin_layout Plain Layout
12445 See the description of
12446 \begin_inset Flex Code
12449 \begin_layout Plain Layout
12456 \begin_inset CommandInset ref
12457 LatexCommand pageref
12458 reference "des:FreeSpacing"
12462 ) for information on `features'.
12466 \begin_layout Description
12467 \begin_inset Flex Code
12470 \begin_layout Plain Layout
12477 \begin_inset Flex Code
12480 \begin_layout Plain Layout
12487 \begin_inset Flex Code
12490 \begin_layout Plain Layout
12499 \begin_layout Description
12500 \begin_inset Flex Code
12503 \begin_layout Plain Layout
12510 \begin_inset Flex Code
12513 \begin_layout Plain Layout
12518 , onehalf, double, other
12527 ] This defines what the default spacing should be in the style.
12529 \begin_inset Flex Code
12532 \begin_layout Plain Layout
12539 \begin_inset Flex Code
12542 \begin_layout Plain Layout
12549 \begin_inset Flex Code
12552 \begin_layout Plain Layout
12558 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12559 If you specify the argument
12560 \begin_inset Flex Code
12563 \begin_layout Plain Layout
12569 , then you should also provide a numerical argument which will be the actual
12571 Note that, contrary to other parameters,
12572 \begin_inset Flex Code
12575 \begin_layout Plain Layout
12581 implies the generation of specific LaTeX code, using the package
12584 \begin_inset Flex Code
12587 \begin_layout Plain Layout
12596 \begin_layout Description
12597 \begin_inset Flex Code
12600 \begin_layout Plain Layout
12607 \begin_inset Flex Code
12610 \begin_layout Plain Layout
12617 \begin_inset Flex Code
12620 \begin_layout Plain Layout
12628 ] Spellcheck paragraphs of this style.
12632 \begin_layout Description
12633 \begin_inset Flex Code
12636 \begin_layout Plain Layout
12642 The font used for the text body .
12644 \begin_inset CommandInset ref
12646 reference "sub:Font-description"
12653 \begin_layout Description
12654 \begin_inset Flex Code
12657 \begin_layout Plain Layout
12666 \begin_inset Flex Code
12669 \begin_layout Plain Layout
12679 The level of the style in the table of contents.
12680 This is used for automatic numbering of section headings.
12683 \begin_layout Description
12684 \begin_inset Flex Code
12687 \begin_layout Plain Layout
12694 \begin_inset Flex Code
12697 \begin_layout Plain Layout
12703 ] The vertical space with which the very first of a chain of paragraphs
12704 with this style is separated from the previous paragraph.
12705 If the previous paragraph has another style, the separations are not simply
12706 added, but the maximum is taken.
12709 \begin_layout Subsection
12710 \begin_inset CommandInset label
12716 Internationalization of Paragraph Styles
12719 \begin_layout Standard
12720 LyX has long supported internationalization of layout information, but,
12721 until version 2.0, this applied only to the user interface and not to, say,
12723 Thus, French authors were forced to resort to ugly hacks if they wanted
12728 1' instead of `Theorem 1'.
12729 Thanks to Georg Baum, that is no longer the case.
12732 \begin_layout Standard
12734 \begin_inset Flex Code
12737 \begin_layout Plain Layout
12743 defines text that is to appear in the typeset document, it may use
12744 \begin_inset Flex Code
12747 \begin_layout Plain Layout
12754 \begin_inset Flex Code
12757 \begin_layout Plain Layout
12763 to support non-English and even multi-language documents correctly.
12764 The following excerpt (from the
12765 \begin_inset Flex Code
12768 \begin_layout Plain Layout
12774 file) shows how this works:
12777 \begin_layout LyX-Code
12782 \begin_layout LyX-Code
12785 theoremstyle{remark}
12788 \begin_layout LyX-Code
12791 newtheorem{claim}[thm]{
12798 \begin_layout LyX-Code
12802 \begin_layout LyX-Code
12806 \begin_layout LyX-Code
12811 claimname}{_(Claim)}
12814 \begin_layout LyX-Code
12818 \begin_layout LyX-Code
12822 \begin_layout LyX-Code
12831 claimname}{_(Claim)}}
12834 \begin_layout LyX-Code
12839 \begin_layout Standard
12840 In principle, any legal LaTeX may appear in the
12841 \begin_inset Flex Code
12844 \begin_layout Plain Layout
12851 \begin_inset Flex Code
12854 \begin_layout Plain Layout
12860 tags, but in practice they will typically look as they do here.
12861 The key to correct translation of the typeset text is the definition of
12863 \begin_inset Flex Code
12866 \begin_layout Plain Layout
12875 \begin_inset Flex Code
12878 \begin_layout Plain Layout
12890 \begin_layout Standard
12892 \begin_inset Flex Code
12895 \begin_layout Plain Layout
12901 tag provides for internationalization based upon the overall language of
12903 The contents of the tag will be included in the preamble, just as with
12905 \begin_inset Flex Code
12908 \begin_layout Plain Layout
12915 What makes it special is the use of the
12916 \begin_inset Quotes eld
12920 \begin_inset Quotes erd
12924 \begin_inset Flex Code
12927 \begin_layout Plain Layout
12933 , which will be replaced, when LyX produces LaTeX output, with the translation
12934 of its argument into the document language.
12937 \begin_layout Standard
12939 \begin_inset Flex Code
12942 \begin_layout Plain Layout
12948 tag is more complex, since it is meant to provide support for multi-language
12949 documents and so offers an interface to the
12950 \begin_inset Flex Code
12953 \begin_layout Plain Layout
12960 Its contents will be added to the preamble once for each language that
12961 appears in the document.
12962 In this case, the argument to
12963 \begin_inset Flex Code
12966 \begin_layout Plain Layout
12972 will be replaced with its translation into the language in question; the
12974 \begin_inset Flex Code
12977 \begin_layout Plain Layout
12983 is replaced by the language name (as used by the babel package).
12986 \begin_layout Standard
12987 A German document that also included a French section would thus have the
12988 following in the preamble:
12991 \begin_layout LyX-Code
13000 claimname}{Affirmation}}
13008 claimname}{Behauptung}}
13012 claimname}{Behauptung}
13015 \begin_layout Standard
13017 \begin_inset Flex Code
13020 \begin_layout Plain Layout
13026 will then conspire to produce the correct text in the output.
13029 \begin_layout Standard
13030 One important point to note here is that the translations are provided by
13031 LyX itself, through the same mechanism it uses for internationalization
13032 of the user interface.
13033 This means, in effect, that
13034 \begin_inset Flex Code
13037 \begin_layout Plain Layout
13044 \begin_inset Flex Code
13047 \begin_layout Plain Layout
13053 are really only of use in layout files that are provided with LyX, since
13054 text entered in user-created layout files will not be seen by LyX's internation
13055 alization routines.
13056 That said, however, any layout created with the intention that it will
13057 be included with LyX should use these tags where appropriate.
13060 \begin_layout Subsection
13062 \begin_inset CommandInset label
13071 \begin_layout Standard
13072 Since version 1.3.0 of LyX, it is has been both possible and necessary to
13073 define the floats (
13074 \begin_inset Flex MenuItem
13077 \begin_layout Plain Layout
13084 \begin_inset Flex MenuItem
13087 \begin_layout Plain Layout
13093 , \SpecialChar \ldots{}
13094 ) in the text class itself.
13095 Standard floats are included in the file
13096 \begin_inset Flex Code
13099 \begin_layout Plain Layout
13105 , so you may have to do no more than add
13108 \begin_layout LyX-Code
13109 Input stdfloats.inc
13112 \begin_layout Standard
13113 to your layout file.
13114 If you want to implement a text class that proposes some other float types
13115 (like the AGU class bundled with LyX), the information below will hopefully
13119 \begin_layout Description
13120 \begin_inset Flex Code
13123 \begin_layout Plain Layout
13130 \begin_inset Flex Code
13133 \begin_layout Plain Layout
13140 \begin_inset Quotes erd
13144 \begin_inset Quotes erd
13147 ] The file name extension of an auxiliary file for the list of figures (or
13149 LaTeX writes the captions to this file.
13152 \begin_layout Description
13153 \begin_inset Flex Code
13156 \begin_layout Plain Layout
13163 \begin_inset Flex Code
13166 \begin_layout Plain Layout
13173 \begin_inset Quotes erd
13177 \begin_inset Quotes erd
13180 ] The string that will be used in the menus and also for the caption.
13181 This is translated to the current language if babel is used.
13184 \begin_layout Description
13185 \begin_inset Flex Code
13188 \begin_layout Plain Layout
13194 These are used for XHTML output.
13196 \begin_inset CommandInset ref
13198 reference "sec:Tags-for-XHTML"
13205 \begin_layout Description
13206 \begin_inset Flex Code
13209 \begin_layout Plain Layout
13218 \begin_inset Flex Code
13221 \begin_layout Plain Layout
13230 \begin_inset Flex Code
13233 \begin_layout Plain Layout
13239 ] Indicates whether the float is already defined in the document class or
13240 if we instead need to load
13241 \begin_inset Flex Code
13244 \begin_layout Plain Layout
13250 and use what it provides to define it on-the-fly.
13252 \begin_inset Flex Code
13255 \begin_layout Plain Layout
13262 \begin_inset Flex Code
13265 \begin_layout Plain Layout
13272 It should be set to
13273 \begin_inset Flex Code
13276 \begin_layout Plain Layout
13282 if the float is already defined by the LaTeX document class.
13285 \begin_layout Description
13286 \begin_inset Flex Code
13289 \begin_layout Plain Layout
13296 \begin_inset Flex Code
13299 \begin_layout Plain Layout
13306 \begin_inset Quotes erd
13310 \begin_inset Quotes erd
13313 ] The command used to generate a list of floats of this type; the leading
13316 ' should be omitted.
13322 \begin_inset Flex Code
13325 \begin_layout Plain Layout
13331 is false, since there is no standard way to generate this command.
13333 \begin_inset Flex Code
13336 \begin_layout Plain Layout
13342 is true, since in that case there is a standard way to define the command.
13345 \begin_layout Description
13346 \begin_inset Flex Code
13349 \begin_layout Plain Layout
13356 \begin_inset Flex Code
13359 \begin_layout Plain Layout
13366 \begin_inset Quotes erd
13370 \begin_inset Quotes erd
13373 ] A title for a list of floats of this kind (list of figures, tables, or
13375 It is used for the screen label within LyX; it is passed to LaTeX for use
13376 as the title there; and it is used as the title in XHTML output.
13377 It will be translated to the document language.
13380 \begin_layout Description
13381 \begin_inset Flex Code
13384 \begin_layout Plain Layout
13391 \begin_inset Flex Code
13394 \begin_layout Plain Layout
13401 \begin_inset Quotes erd
13405 \begin_inset Quotes erd
13408 ] This (optional) argument determines whether floats of this class will
13409 be numbered within some sectional unit of the document.
13410 For example, if within is equal to
13411 \begin_inset Flex Code
13414 \begin_layout Plain Layout
13420 , the floats will be numbered within chapters.
13424 \begin_layout Description
13425 \begin_inset Flex Code
13428 \begin_layout Plain Layout
13435 \begin_inset Flex Code
13438 \begin_layout Plain Layout
13445 \begin_inset Quotes erd
13449 \begin_inset Quotes erd
13452 ] The default placement for the given class of floats.
13453 The string should be as in standard LaTeX:
13454 \begin_inset Flex Code
13457 \begin_layout Plain Layout
13464 \begin_inset Flex Code
13467 \begin_layout Plain Layout
13474 \begin_inset Flex Code
13477 \begin_layout Plain Layout
13484 \begin_inset Flex Code
13487 \begin_layout Plain Layout
13493 for top, bottom, page, and here, respectively.
13497 \begin_layout Plain Layout
13498 Note that the order of these letters in the string is irrelevant, like in
13504 On top of that there is a new type,
13505 \begin_inset Flex Code
13508 \begin_layout Plain Layout
13514 , which does not really correspond to a float, since it means: put it
13515 \begin_inset Quotes eld
13519 \begin_inset Quotes erd
13523 Note however that the
13524 \begin_inset Flex Code
13527 \begin_layout Plain Layout
13533 specifier is special and, because of implementation details, cannot be
13534 used in non-built in float types.
13535 If you do not understand what this means, just use
13536 \begin_inset Quotes eld
13540 \begin_inset Flex Code
13543 \begin_layout Plain Layout
13550 \begin_inset Quotes erd
13556 \begin_layout Description
13557 \begin_inset Flex Code
13560 \begin_layout Plain Layout
13567 \begin_inset Flex Code
13570 \begin_layout Plain Layout
13576 ] The prefix to use when creating labels referring to floats of this type.
13577 This allows the use of formatted references.
13578 Note that you can remove any
13579 \begin_inset Flex Code
13582 \begin_layout Plain Layout
13588 set by a copied style by using the special value
13589 \begin_inset Quotes eld
13593 \begin_inset Quotes erd
13596 , which must be all caps.
13599 \begin_layout Description
13600 \begin_inset Flex Code
13603 \begin_layout Plain Layout
13610 \begin_inset Flex Code
13613 \begin_layout Plain Layout
13620 \begin_inset Quotes erd
13624 \begin_inset Quotes erd
13627 ] The style used when defining the float using
13628 \begin_inset Flex Code
13631 \begin_layout Plain Layout
13642 \begin_layout Description
13643 \begin_inset Flex Code
13646 \begin_layout Plain Layout
13653 \begin_inset Flex Code
13656 \begin_layout Plain Layout
13663 \begin_inset Quotes erd
13667 \begin_inset Quotes erd
13671 \begin_inset Quotes eld
13675 \begin_inset Quotes erd
13678 of the new class of floats, like program or algorithm.
13679 After the appropriate
13680 \begin_inset Flex Code
13683 \begin_layout Plain Layout
13692 \begin_inset Flex Code
13695 \begin_layout Plain Layout
13704 \begin_inset Flex Code
13707 \begin_layout Plain Layout
13718 \begin_layout Description
13719 \begin_inset Flex Code
13722 \begin_layout Plain Layout
13729 \begin_inset Flex Code
13732 \begin_layout Plain Layout
13739 \begin_inset Flex Code
13742 \begin_layout Plain Layout
13750 ] Tells us whether this float is defined using the facilities provided by
13752 \begin_inset Flex Code
13755 \begin_layout Plain Layout
13761 , either by the class file or a package, or on-the-fly by LyX itself.
13764 \begin_layout Standard
13765 Note that defining a float with type
13766 \begin_inset Flex Code
13769 \begin_layout Plain Layout
13777 automatically defines the corresponding counter with name
13778 \begin_inset Flex Code
13781 \begin_layout Plain Layout
13792 \begin_layout Subsection
13793 Flex insets and InsetLayout
13794 \begin_inset CommandInset label
13796 name "sub:Flex-insets-and"
13803 \begin_layout Standard
13804 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13805 these are called Flex insets.
13809 \begin_layout Standard
13810 Flex insets come in three different kinds:
13813 \begin_layout Itemize
13815 \begin_inset Flex Code
13818 \begin_layout Plain Layout
13824 ): These define semantic markup corresponding to such LaTeX commands as
13826 \begin_inset Flex Code
13829 \begin_layout Plain Layout
13838 \begin_inset Flex Code
13841 \begin_layout Plain Layout
13852 \begin_layout Itemize
13854 \begin_inset Flex Code
13857 \begin_layout Plain Layout
13863 ): These can be used to define custom collapsible insets, similar to TeX
13864 code, footnote, and the like.
13865 An obvious example is an endnote inset, which is defined in the
13866 \begin_inset Flex Code
13869 \begin_layout Plain Layout
13878 \begin_layout Itemize
13880 \begin_inset Flex Code
13883 \begin_layout Plain Layout
13889 ): For use with DocBook classes.
13892 \begin_layout Standard
13893 Flex insets are defined using the
13894 \begin_inset Flex Code
13897 \begin_layout Plain Layout
13903 tag, which shall be explained in a moment.
13906 \begin_layout Standard
13908 \begin_inset Flex Code
13911 \begin_layout Plain Layout
13917 tag also serves another function: It can be used to customize the general
13918 layout of many different types of insets.
13920 \begin_inset Flex Code
13923 \begin_layout Plain Layout
13929 can be used to customize the layout parameters for footnotes, marginal
13930 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13931 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13932 define Flex insets.
13935 \begin_layout Standard
13937 \begin_inset Flex Code
13940 \begin_layout Plain Layout
13946 definition must begin with a line of the form:
13949 \begin_layout LyX-Code
13953 \begin_layout Standard
13955 \begin_inset Flex Code
13958 \begin_layout Plain Layout
13964 indicates the inset whose layout is being defined, and here there are two
13968 \begin_layout Enumerate
13969 The layout for a pre-existing inset is being modified.
13970 In this case, can be
13971 \begin_inset Flex Code
13974 \begin_layout Plain Layout
13980 any one of the following:
13981 \begin_inset Flex Code
13984 \begin_layout Plain Layout
13991 \begin_inset Flex Code
13994 \begin_layout Plain Layout
14001 \begin_inset Flex Code
14004 \begin_layout Plain Layout
14011 \begin_inset Flex Code
14014 \begin_layout Plain Layout
14021 \begin_inset Flex Code
14024 \begin_layout Plain Layout
14031 \begin_inset Flex Code
14034 \begin_layout Plain Layout
14041 \begin_inset Flex Code
14044 \begin_layout Plain Layout
14051 \begin_inset Flex Code
14054 \begin_layout Plain Layout
14061 \begin_inset Flex Code
14064 \begin_layout Plain Layout
14071 \begin_inset Flex Code
14074 \begin_layout Plain Layout
14081 \begin_inset Flex Code
14084 \begin_layout Plain Layout
14091 \begin_inset Flex Code
14094 \begin_layout Plain Layout
14101 \begin_inset Flex Code
14104 \begin_layout Plain Layout
14111 \begin_inset Flex Code
14114 \begin_layout Plain Layout
14121 \begin_inset Flex Code
14124 \begin_layout Plain Layout
14131 \begin_inset Flex Code
14134 \begin_layout Plain Layout
14141 \begin_inset Flex Code
14144 \begin_layout Plain Layout
14151 \begin_inset Flex Code
14154 \begin_layout Plain Layout
14161 \begin_inset Flex Code
14164 \begin_layout Plain Layout
14171 \begin_inset Flex Code
14174 \begin_layout Plain Layout
14183 \begin_layout Enumerate
14184 The layout for a Flex inset is being defined.
14186 \begin_inset Flex Code
14189 \begin_layout Plain Layout
14195 must be of the form
14196 \begin_inset Quotes eld
14200 \begin_inset Flex Code
14203 \begin_layout Plain Layout
14210 \begin_inset Quotes erd
14214 \begin_inset Flex Code
14217 \begin_layout Plain Layout
14223 may be be any valid identifier not used by a pre-existing Flex inset.
14224 The identifier may include spaces, but in that case the whole thing must
14225 be wrapped in quotes.
14226 Note that the definition of a flex inset
14231 \begin_inset Flex Code
14234 \begin_layout Plain Layout
14240 entry, declaring which type of inset it defines.
14243 \begin_layout Standard
14245 \begin_inset Flex Code
14248 \begin_layout Plain Layout
14254 definition can contain the following entries:
14257 \begin_layout Description
14258 \begin_inset Flex Code
14261 \begin_layout Plain Layout
14267 The color for the inset's background.
14268 The valid colors are defined in
14269 \begin_inset Flex Code
14272 \begin_layout Plain Layout
14281 \begin_layout Description
14282 \begin_inset Flex Code
14285 \begin_layout Plain Layout
14292 \begin_inset Flex Code
14295 \begin_layout Plain Layout
14304 \begin_inset Flex Code
14307 \begin_layout Plain Layout
14313 ] Whether to use the content of the inset as the label, when the inset is
14318 \begin_layout Description
14319 \begin_inset Flex Code
14322 \begin_layout Plain Layout
14329 \begin_inset Flex Code
14332 \begin_layout Plain Layout
14338 Copies all the features of an existing style into the current one.
14342 \begin_layout Description
14343 \begin_inset Flex Code
14346 \begin_layout Plain Layout
14353 \begin_inset Flex Code
14356 \begin_layout Plain Layout
14365 \begin_inset Flex Code
14368 \begin_layout Plain Layout
14374 ] Indicates whether the user may employ the Paragraph Settings dialog to
14375 customize the paragraph.
14378 \begin_layout Description
14379 \begin_inset Flex Code
14382 \begin_layout Plain Layout
14389 \begin_inset Flex Code
14392 \begin_layout Plain Layout
14399 \begin_inset Flex Code
14402 \begin_layout Plain Layout
14409 \begin_inset Flex Code
14412 \begin_layout Plain Layout
14418 , describing the rendering style used for the inset's frame and buttons.
14419 Footnotes generally use
14420 \begin_inset Flex Code
14423 \begin_layout Plain Layout
14429 , ERT insets generally
14430 \begin_inset Flex Code
14433 \begin_layout Plain Layout
14439 , and character styles
14440 \begin_inset Flex Code
14443 \begin_layout Plain Layout
14452 \begin_layout Description
14453 \begin_inset Flex Code
14456 \begin_layout Plain Layout
14463 \begin_inset Flex Code
14466 \begin_layout Plain Layout
14473 \begin_inset Flex Code
14476 \begin_layout Plain Layout
14485 \begin_inset Flex Code
14488 \begin_layout Plain Layout
14495 \begin_inset Flex Code
14498 \begin_layout Plain Layout
14505 Indicates whether the environment will stand on its own in LaTeX output
14506 or will appear inline with the surrounding text.
14507 If set to false, it is supposed that the LaTeX environment ignores white
14508 space (including one newline character) after the
14509 \begin_inset Flex Code
14512 \begin_layout Plain Layout
14525 \begin_inset Flex Code
14528 \begin_layout Plain Layout
14544 \begin_layout Description
14545 \begin_inset Flex Code
14548 \begin_layout Plain Layout
14554 Required at the end of the InsetLayout declarations.
14557 \begin_layout Description
14558 \begin_inset Flex Code
14561 \begin_layout Plain Layout
14567 The font used for both the text body
14573 \begin_inset space ~
14577 \begin_inset CommandInset ref
14579 reference "sub:Font-description"
14584 Note that defining this font automatically defines the
14585 \begin_inset Flex Code
14588 \begin_layout Plain Layout
14594 to the same value, so define this first and define
14595 \begin_inset Flex Code
14598 \begin_layout Plain Layout
14604 later if you want them to be different.
14607 \begin_layout Description
14608 \begin_inset Flex Code
14611 \begin_layout Plain Layout
14618 \begin_inset Quotes eld
14622 \begin_inset Quotes erd
14625 language, leading to Left-to-Right (latin) output, e.
14626 \begin_inset space \thinspace{}
14630 \begin_inset space \space{}
14633 in TeX code or URL.
14637 \begin_layout Description
14638 \begin_inset Flex Code
14641 \begin_layout Plain Layout
14648 \begin_inset Flex Code
14651 \begin_layout Plain Layout
14660 \begin_inset Flex Code
14663 \begin_layout Plain Layout
14669 ] Indicates whether the
14670 \begin_inset Flex Code
14673 \begin_layout Plain Layout
14679 should be used or, instead, the user can change the paragraph style used
14684 \begin_layout Description
14685 \begin_inset Flex Code
14688 \begin_layout Plain Layout
14695 \begin_inset Flex Code
14698 \begin_layout Plain Layout
14707 \begin_inset Flex Code
14710 \begin_layout Plain Layout
14716 ] Usually LyX doesn't allow you to insert more than one space between words,
14717 since a space is considered as the separation between two words, not a
14718 character or symbol of its own.
14719 This is a very fine thing but sometimes annoying, for example, when typing
14720 program code or plain LaTeX code.
14722 \begin_inset Flex Code
14725 \begin_layout Plain Layout
14732 Note that LyX will create protected blanks for the additional blanks when
14733 in another mode than LaTeX-mode.
14737 \begin_layout Description
14738 \begin_inset Flex Code
14741 \begin_layout Plain Layout
14747 These tags control XHTML output.
14749 \begin_inset CommandInset ref
14751 reference "sec:Tags-for-XHTML"
14758 \begin_layout Description
14759 \begin_inset Flex Code
14762 \begin_layout Plain Layout
14769 \begin_inset Flex Code
14772 \begin_layout Plain Layout
14781 \begin_inset Flex Code
14784 \begin_layout Plain Layout
14790 ] Whether to include the contents of this inset in the strings generated
14791 for the `Outline' pane.
14792 One would not, for example, want the content of a footnote in a section
14793 header to be included in the TOC displayed in the outline, but one would
14794 normally want the content of a character style displayed.
14795 Default is false: not to include.
14798 \begin_layout Description
14799 \begin_inset Flex Code
14802 \begin_layout Plain Layout
14809 \begin_inset Flex Code
14812 \begin_layout Plain Layout
14821 \begin_inset Flex Code
14824 \begin_layout Plain Layout
14830 ] Usually LyX does not allow you to leave a paragraph empty, since it would
14831 lead to empty LaTeX output.
14832 There are some cases where this could be desirable however: in a letter
14833 template, the required fields can be provided as empty fields, so that
14834 people do not forget them; in some special classes, a style can be used
14835 as some kind of break, which does not contain actual text.
14839 \begin_layout Description
14840 \begin_inset Flex Code
14843 \begin_layout Plain Layout
14849 The font used for the label.
14851 \begin_inset space ~
14855 \begin_inset CommandInset ref
14857 reference "sub:Font-description"
14862 Note that this definition can never appear before
14863 \begin_inset Flex Code
14866 \begin_layout Plain Layout
14872 , lest it be ineffective.
14875 \begin_layout Description
14876 \begin_inset Flex Code
14879 \begin_layout Plain Layout
14885 What will be displayed on the button or elsewhere as the inset label.
14887 \begin_inset Flex Code
14890 \begin_layout Plain Layout
14897 \begin_inset Flex Code
14900 \begin_layout Plain Layout
14906 ) modify this label on the fly.
14909 \begin_layout Description
14910 \begin_inset Flex Code
14913 \begin_layout Plain Layout
14919 The name of the corresponding LaTeX stuff.
14920 Either the environment or command name.
14923 \begin_layout Description
14924 \begin_inset Flex Code
14927 \begin_layout Plain Layout
14933 The optional parameter for the corresponding
14934 \begin_inset Flex Code
14937 \begin_layout Plain Layout
14943 stuff, including possible bracket pairs like
14944 \begin_inset Flex Code
14947 \begin_layout Plain Layout
14954 This parameter cannot be changed from within LyX.
14957 \begin_layout Description
14958 \begin_inset Flex Code
14961 \begin_layout Plain Layout
14968 \begin_inset Flex Code
14971 \begin_layout Plain Layout
14976 , Command, Environment, Item_Environment,
14982 \begin_inset Flex Code
14985 \begin_layout Plain Layout
14986 List_Environment, Bib_Environment
14991 ] How the style should be translated into LaTeX.
14995 \begin_layout Plain Layout
14996 \begin_inset Flex Code
14999 \begin_layout Plain Layout
15005 is perhaps a bit misleading, since these rules apply to SGML classes, too.
15006 Visit the SGML class files for specific examples.
15015 \begin_layout Itemize
15016 \begin_inset Flex Code
15019 \begin_layout Plain Layout
15025 means nothing special.
15029 \begin_layout Itemize
15030 \begin_inset Flex Code
15033 \begin_layout Plain Layout
15040 \begin_inset Flex Code
15043 \begin_layout Plain Layout
15050 {\SpecialChar \ldots{}
15059 \begin_layout Itemize
15060 \begin_inset Flex Code
15063 \begin_layout Plain Layout
15070 \begin_inset Flex Code
15073 \begin_layout Plain Layout
15080 }\SpecialChar \ldots{}
15096 \begin_layout Itemize
15097 \begin_inset Flex Code
15100 \begin_layout Plain Layout
15107 \begin_inset Flex Code
15110 \begin_layout Plain Layout
15117 \begin_inset Flex Code
15120 \begin_layout Plain Layout
15128 is generated for each paragraph of this environment.
15132 \begin_layout Itemize
15133 \begin_inset Flex Code
15136 \begin_layout Plain Layout
15143 \begin_inset Flex Code
15146 \begin_layout Plain Layout
15153 \begin_inset Flex Code
15156 \begin_layout Plain Layout
15162 is passed as an argument to the environment.
15164 \begin_inset Flex Code
15167 \begin_layout Plain Layout
15173 can be defined in the
15174 \begin_inset Flex MenuItem
15177 \begin_layout Plain Layout
15182 \SpecialChar \menuseparator
15188 \begin_inset space ~
15200 \begin_layout Standard
15201 Putting the last few things together, the LaTeX output will be either:
15204 \begin_layout LyX-Code
15207 latexname[latexparam]{\SpecialChar \ldots{}
15211 \begin_layout Standard
15215 \begin_layout LyX-Code
15218 begin{latexname}[latexparam] \SpecialChar \ldots{}
15224 \begin_layout Standard
15225 depending upon the LaTeX type.
15229 \begin_layout Description
15230 \begin_inset Flex Code
15233 \begin_layout Plain Layout
15240 \begin_inset Flex Code
15243 \begin_layout Plain Layout
15250 \begin_inset Flex Code
15253 \begin_layout Plain Layout
15260 \begin_inset Flex Code
15263 \begin_layout Plain Layout
15270 \begin_inset Flex Code
15273 \begin_layout Plain Layout
15279 (indicating a dummy definition ending definitions of charstyles, etc).
15280 This entry is required in and is only meaningful for Flex insets.
15281 Among other things, it determines on which menu this inset will appear.
15283 \begin_inset Flex Code
15286 \begin_layout Plain Layout
15293 \begin_inset Flex Code
15296 \begin_layout Plain Layout
15303 \begin_inset Flex Code
15306 \begin_layout Plain Layout
15314 \begin_inset Flex Code
15317 \begin_layout Plain Layout
15323 can be set to true for charstyle insets, if you wish, by setting it
15328 \begin_inset Flex Code
15331 \begin_layout Plain Layout
15340 \begin_layout Description
15341 \begin_inset Flex Code
15344 \begin_layout Plain Layout
15351 \begin_inset Flex Code
15354 \begin_layout Plain Layout
15363 \begin_inset Flex Code
15366 \begin_layout Plain Layout
15372 ] Whether multiple paragraphs are permitted in this inset.
15374 \begin_inset Flex Code
15377 \begin_layout Plain Layout
15383 to the same value and
15384 \begin_inset Flex Code
15387 \begin_layout Plain Layout
15393 to the opposite value.
15394 These can be reset to other values, if they are used
15399 \begin_inset Flex Code
15402 \begin_layout Plain Layout
15412 \begin_layout Description
15413 \begin_inset Flex Code
15416 \begin_layout Plain Layout
15423 \begin_inset Flex Code
15426 \begin_layout Plain Layout
15435 \begin_inset Flex Code
15438 \begin_layout Plain Layout
15444 ] Whether fragile commands in this inset should be
15445 \begin_inset Flex Code
15448 \begin_layout Plain Layout
15461 whether the command should itself be protected.) Default is false.
15464 \begin_layout Description
15465 \begin_inset Flex Code
15468 \begin_layout Plain Layout
15475 \begin_inset Flex Code
15478 \begin_layout Plain Layout
15487 \begin_inset Flex Code
15490 \begin_layout Plain Layout
15496 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
15497 output, but only by a line break; together with
15498 \begin_inset Flex Code
15501 \begin_layout Plain Layout
15507 , this allows to emulate a plain text editor (like the ERT inset).
15511 \begin_layout Description
15512 \begin_inset Flex Code
15515 \begin_layout Plain Layout
15522 \begin_inset Flex Code
15525 \begin_layout Plain Layout
15534 \begin_inset Flex Code
15537 \begin_layout Plain Layout
15543 ] Whether the contents of this paragraph should be output in raw form, meaning
15544 without special translations that LaTeX would require.
15547 \begin_layout Description
15548 \begin_inset Flex Code
15551 \begin_layout Plain Layout
15557 Information to be included in the LaTeX preamble when this style is used.
15558 Used to define macros, load packages, etc., required by this particular
15561 \begin_inset Quotes eld
15565 \begin_inset Flex Code
15568 \begin_layout Plain Layout
15575 \begin_inset Quotes erd
15581 \begin_layout Description
15582 \begin_inset Flex Code
15585 \begin_layout Plain Layout
15592 \begin_inset Flex Code
15595 \begin_layout Plain Layout
15601 ] The prefix to use when creating labels referring to insets of this type.
15602 This allows the use of formatted references.
15605 \begin_layout Description
15606 \begin_inset Flex Code
15609 \begin_layout Plain Layout
15616 \begin_inset Flex Code
15619 \begin_layout Plain Layout
15625 ] Whether the style requires the feature
15626 \begin_inset Flex Code
15629 \begin_layout Plain Layout
15636 See the description of
15637 \begin_inset Flex Code
15640 \begin_layout Plain Layout
15647 \begin_inset CommandInset ref
15648 LatexCommand pageref
15649 reference "des:FreeSpacing"
15653 ) for information on `features'.
15657 \begin_layout Description
15658 \begin_inset Flex Code
15661 \begin_layout Plain Layout
15668 \begin_inset Flex Code
15671 \begin_layout Plain Layout
15678 \begin_inset Flex Code
15681 \begin_layout Plain Layout
15689 ] Whether this inset should use the font of its surrounding environment
15691 Default is true: uses its own.
15694 \begin_layout Description
15695 \begin_inset Flex Code
15698 \begin_layout Plain Layout
15705 \begin_inset Flex Code
15708 \begin_layout Plain Layout
15715 \begin_inset Flex Code
15718 \begin_layout Plain Layout
15726 ] Spellcheck the contents of this inset.
15730 \begin_layout Subsection
15732 \begin_inset CommandInset label
15734 name "sub:Counters"
15741 \begin_layout Standard
15742 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15744 \begin_inset Flex MenuItem
15747 \begin_layout Plain Layout
15754 \begin_inset Flex MenuItem
15757 \begin_layout Plain Layout
15763 , \SpecialChar \ldots{}
15764 ) in the text class itself.
15765 The standard counters are defined in the file
15766 \begin_inset Flex Code
15769 \begin_layout Plain Layout
15775 , so you may have to do no more than add
15778 \begin_layout LyX-Code
15779 Input stdcounters.inc
15782 \begin_layout Standard
15783 to your layout file to get them to work.
15784 But if you want to define custom counters, then you can do so.
15785 The counter declaration must begin with:
15788 \begin_layout LyX-Code
15789 Counter CounterName
15792 \begin_layout Standard
15794 \begin_inset Flex Code
15797 \begin_layout Plain Layout
15803 ' is replaced by the name of the counter.
15804 And it must end with
15805 \begin_inset Quotes eld
15809 \begin_inset Flex Code
15812 \begin_layout Plain Layout
15819 \begin_inset Quotes erd
15823 The following parameters can also be used:
15826 \begin_layout Description
15827 \begin_inset Flex Code
15830 \begin_layout Plain Layout
15837 \begin_inset Flex Code
15840 \begin_layout Plain Layout
15847 \begin_inset Quotes erd
15851 \begin_inset Quotes erd
15854 ] When defined, this string defines how the counter is displayed.
15855 Setting this value sets
15856 \begin_inset Flex Code
15859 \begin_layout Plain Layout
15860 LabelStringAppendix
15866 The following special constructs can be used in the string:
15870 \begin_layout Itemize
15871 \begin_inset Flex Code
15874 \begin_layout Plain Layout
15882 will be replaced by the expansion of the
15883 \begin_inset Flex Code
15886 \begin_layout Plain Layout
15893 \begin_inset Flex Code
15896 \begin_layout Plain Layout
15897 LabelStringAppendix
15903 \begin_inset Flex Code
15906 \begin_layout Plain Layout
15916 \begin_layout Itemize
15917 counter values can be expressed using LaTeX-like macros
15918 \begin_inset Flex Code
15921 \begin_layout Plain Layout
15938 \begin_inset Flex Code
15941 \begin_layout Plain Layout
15953 \begin_layout Plain Layout
15963 Actually, the situation is a bit more complicated: any
15982 other than those described below will produce arabic numerals.
15983 It would not be surprising to see this change in the future.
15989 \begin_inset Flex Code
15992 \begin_layout Plain Layout
15998 : 1, 2, 3,\SpecialChar \ldots{}
16000 \begin_inset Flex Code
16003 \begin_layout Plain Layout
16009 for lower-case letters: a, b, c, \SpecialChar \ldots{}
16011 \begin_inset Flex Code
16014 \begin_layout Plain Layout
16020 for upper-case letters: A, B, C, \SpecialChar \ldots{}
16022 \begin_inset Flex Code
16025 \begin_layout Plain Layout
16031 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
16033 \begin_inset Flex Code
16036 \begin_layout Plain Layout
16042 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
16044 \begin_inset Flex Code
16047 \begin_layout Plain Layout
16053 for hebrew numerals.
16057 \begin_layout Standard
16058 If LabelString is not defined, a default value is constructed as follows:
16059 if the counter has a master counter
16060 \begin_inset Flex Code
16063 \begin_layout Plain Layout
16070 \begin_inset Flex Code
16073 \begin_layout Plain Layout
16080 \begin_inset Flex Code
16083 \begin_layout Plain Layout
16093 is used; otherwise the string
16094 \begin_inset Flex Code
16097 \begin_layout Plain Layout
16108 \begin_layout Description
16109 \begin_inset Flex Code
16112 \begin_layout Plain Layout
16113 LabelStringAppendix
16119 \begin_inset Flex Code
16122 \begin_layout Plain Layout
16129 \begin_inset Quotes erd
16133 \begin_inset Quotes erd
16137 \begin_inset Flex Code
16140 \begin_layout Plain Layout
16146 , but for use in the Appendix.
16149 \begin_layout Description
16150 \begin_inset Flex Code
16153 \begin_layout Plain Layout
16160 \begin_inset Flex Code
16163 \begin_layout Plain Layout
16170 \begin_inset Quotes erd
16174 \begin_inset Quotes erd
16177 ] A format for use with formatted references to this counter.
16178 For example, one might want to have references to section numbers appear
16180 \begin_inset Quotes eld
16184 \begin_inset Quotes erd
16188 The string should contain
16189 \begin_inset Quotes eld
16193 \begin_inset Quotes erd
16197 This will be replaced by the counter number itself.
16198 So, for sections, it would be: Section ##.
16201 \begin_layout Description
16202 \begin_inset Flex Code
16205 \begin_layout Plain Layout
16212 \begin_inset Flex Code
16215 \begin_layout Plain Layout
16222 \begin_inset Quotes erd
16226 \begin_inset Quotes erd
16229 ] If this is set to the name of another counter, the present counter will
16230 be reset every time the other one is increased.
16232 \begin_inset Flex Code
16235 \begin_layout Plain Layout
16242 \begin_inset Flex Code
16245 \begin_layout Plain Layout
16254 \begin_layout Subsection
16256 \begin_inset CommandInset label
16258 name "sub:Font-description"
16265 \begin_layout Standard
16266 A font description looks like this:
16269 \begin_layout LyX-Code
16279 \begin_layout LyX-Code
16283 \begin_layout LyX-Code
16287 \begin_layout Standard
16288 The following commands are available:
16291 \begin_layout Description
16292 \begin_inset Flex Code
16295 \begin_layout Plain Layout
16302 \begin_inset Flex Code
16305 \begin_layout Plain Layout
16314 \begin_inset Flex Code
16317 \begin_layout Plain Layout
16324 \begin_inset Flex Code
16327 \begin_layout Plain Layout
16334 \begin_inset Flex Code
16337 \begin_layout Plain Layout
16344 \begin_inset Flex Code
16347 \begin_layout Plain Layout
16354 \begin_inset Flex Code
16357 \begin_layout Plain Layout
16364 \begin_inset Flex Code
16367 \begin_layout Plain Layout
16374 \begin_inset Flex Code
16377 \begin_layout Plain Layout
16384 \begin_inset Flex Code
16387 \begin_layout Plain Layout
16396 \begin_layout Description
16397 \begin_inset Flex Code
16400 \begin_layout Plain Layout
16407 \begin_inset Flex Code
16410 \begin_layout Plain Layout
16419 \begin_inset Flex Code
16422 \begin_layout Plain Layout
16429 \begin_inset Flex Code
16432 \begin_layout Plain Layout
16441 \begin_layout Description
16442 \begin_inset Flex Code
16445 \begin_layout Plain Layout
16452 \begin_inset Flex Code
16455 \begin_layout Plain Layout
16461 ] Valid arguments are:
16462 \begin_inset Flex Code
16465 \begin_layout Plain Layout
16472 \begin_inset Flex Code
16475 \begin_layout Plain Layout
16482 \begin_inset Flex Code
16485 \begin_layout Plain Layout
16492 \begin_inset Flex Code
16495 \begin_layout Plain Layout
16502 \begin_inset Flex Code
16505 \begin_layout Plain Layout
16512 \begin_inset Flex Code
16515 \begin_layout Plain Layout
16522 \begin_inset Flex Code
16525 \begin_layout Plain Layout
16532 \begin_inset Flex Code
16535 \begin_layout Plain Layout
16542 \begin_inset Flex Code
16545 \begin_layout Plain Layout
16552 \begin_inset Flex Code
16555 \begin_layout Plain Layout
16562 \begin_inset Flex Code
16565 \begin_layout Plain Layout
16572 \begin_inset Flex Code
16575 \begin_layout Plain Layout
16582 Each of these turns on or off the corresponding attribute.
16584 \begin_inset Flex Code
16587 \begin_layout Plain Layout
16593 turns on emphasis, and
16594 \begin_inset Flex Code
16597 \begin_layout Plain Layout
16605 \begin_inset Newline newline
16608 If the latter seems puzzling, remember that the font settings for the present
16609 context are generally inherited from the surrounding context.
16611 \begin_inset Flex Code
16614 \begin_layout Plain Layout
16620 would turn off the emphasis that was anyway in effect, say, in a theorem
16624 \begin_layout Description
16625 \begin_inset Flex Code
16628 \begin_layout Plain Layout
16635 \begin_inset Flex Code
16638 \begin_layout Plain Layout
16647 \begin_inset Flex Code
16650 \begin_layout Plain Layout
16659 \begin_layout Description
16660 \begin_inset Flex Code
16663 \begin_layout Plain Layout
16670 \begin_inset Flex Code
16673 \begin_layout Plain Layout
16682 \begin_inset Flex Code
16685 \begin_layout Plain Layout
16692 \begin_inset Flex Code
16695 \begin_layout Plain Layout
16702 \begin_inset Flex Code
16705 \begin_layout Plain Layout
16714 \begin_layout Description
16715 \begin_inset Flex Code
16718 \begin_layout Plain Layout
16725 \begin_inset Flex Code
16728 \begin_layout Plain Layout
16735 \begin_inset Flex Code
16738 \begin_layout Plain Layout
16745 \begin_inset Flex Code
16748 \begin_layout Plain Layout
16757 \begin_inset Flex Code
16760 \begin_layout Plain Layout
16767 \begin_inset Flex Code
16770 \begin_layout Plain Layout
16777 \begin_inset Flex Code
16780 \begin_layout Plain Layout
16787 \begin_inset Flex Code
16790 \begin_layout Plain Layout
16797 \begin_inset Flex Code
16800 \begin_layout Plain Layout
16809 \begin_layout Subsection
16810 \begin_inset CommandInset label
16812 name "sub:Citation-format-description"
16816 Citation format description
16819 \begin_layout Standard
16821 \begin_inset Flex Code
16824 \begin_layout Plain Layout
16830 blocks are used to describe how bibliographic information should be displayed,
16831 both within LyX itself (in the citation dialog and in tooltips, for example)
16832 and in XHTML output.
16833 Such a block might look like this:
16836 \begin_layout LyX-Code
16840 \begin_layout LyX-Code
16844 \begin_layout LyX-Code
16848 \begin_layout LyX-Code
16852 \begin_layout Standard
16853 The individual lines define how the bibliographic information associated
16854 with an article or book, respectively, is to be displayed, and such a definitio
16855 n can be given for any `entry type' that might be present in a BibTeX file.
16856 LyX defines a default format in the source code that will be used if no
16857 specific definition has been given.
16858 LyX predefines several formats in the file
16859 \begin_inset Flex Code
16862 \begin_layout Plain Layout
16868 , which is included in most of LyX's document classes.
16871 \begin_layout Standard
16872 The definitions use a simple language that allows BibTeX keys to be replaced
16874 Keys should be enclosed in
16875 \begin_inset Flex Code
16878 \begin_layout Plain Layout
16885 \begin_inset Flex Code
16888 \begin_layout Plain Layout
16895 So a simple definition might look like this:
16898 \begin_layout LyX-Code
16900 \begin_inset Quotes eld
16904 \begin_inset Quotes erd
16910 \begin_layout Standard
16911 This would print the author, followed by a comma, followed by the title,
16912 in quotes, followed by a period.
16915 \begin_layout Standard
16916 Of course, sometimes you may want to print a key only if it exists.
16917 This can be done by using a conditional construction, such as:
16918 \begin_inset Flex Code
16921 \begin_layout Plain Layout
16923 \begin_inset space ~
16933 \begin_inset Flex Code
16936 \begin_layout Plain Layout
16942 key exists, then print
16943 \begin_inset Quotes eld
16947 \begin_inset space ~
16951 \begin_inset Quotes erd
16954 followed by the volume key.
16955 It is also possible to have an else clause in the conditional, such as:
16957 \begin_inset Flex Code
16960 \begin_layout Plain Layout
16961 {%author%[[%author%]][[%editor%, ed.]]}
16968 \begin_inset Flex Code
16971 \begin_layout Plain Layout
16977 key is printed if it exists; otherwise, the editor key is printed, followed
16979 \begin_inset Quotes eld
16983 \begin_inset space ~
16987 \begin_inset Quotes erd
16990 Note that the key is again enclosed in
16991 \begin_inset Flex Code
16994 \begin_layout Plain Layout
17000 signs; the entire conditional is enclosed in braces; and the if and else
17001 clauses are enclosed in double brackets,
17002 \begin_inset Quotes eld
17006 \begin_inset Flex Code
17009 \begin_layout Plain Layout
17016 \begin_inset Quotes eld
17020 \begin_inset Quotes eld
17024 \begin_inset Flex Code
17027 \begin_layout Plain Layout
17034 \begin_inset Quotes erd
17038 There must be no space between any of these.
17041 \begin_layout Standard
17042 There is one other piece of syntax available in definitions, which looks
17044 \begin_inset Flex Code
17047 \begin_layout Plain Layout
17054 This defines a piece of formatting information that is to be used when
17056 \begin_inset Quotes eld
17060 \begin_inset Quotes erd
17064 Obviously, we do not want to output HTML tags when writing plain text,
17065 so they should be wrapped in
17066 \begin_inset Quotes eld
17070 \begin_inset Quotes erd
17074 \begin_inset Quotes eld
17078 \begin_inset Quotes erd
17084 \begin_layout Standard
17085 Two special sorts of definitions are also possible in a
17086 \begin_inset Flex Code
17089 \begin_layout Plain Layout
17096 An example of the first would be:
17099 \begin_layout LyX-Code
17101 \begin_inset Quotes eld
17105 \begin_inset Quotes erd
17111 \begin_layout Standard
17112 This is an abbreviation, or macro, and it can be used by treating it as
17114 \begin_inset Flex Code
17117 \begin_layout Plain Layout
17125 \begin_inset Flex Code
17128 \begin_layout Plain Layout
17134 exactly as it would treat its definition.
17135 So, let us issue the obvious
17143 \begin_layout LyX-Code
17147 \begin_layout Standard
17148 or anything like it.
17149 LyX shouldn't go into an infinite loop, but it may go into a long one before
17153 \begin_layout Standard
17154 The second sort of special definition might look like this:
17157 \begin_layout LyX-Code
17161 \begin_layout Standard
17162 This defines a translatable piece of text, which allows relevant parts of
17163 the bibliography to be translated.
17164 It can be included in a definition by treating it as a key:
17165 \begin_inset Flex Code
17168 \begin_layout Plain Layout
17175 Several of these are predefined in
17176 \begin_inset Flex Code
17179 \begin_layout Plain Layout
17186 Note that these are not macros, in the sense just defined.
17187 They will not be expanded.
17190 \begin_layout Standard
17191 So here then is an example that use all these features:
17194 \begin_layout LyX-Code
17195 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
17198 \begin_layout Standard
17199 This defines a macro that prints the author, followed by a comma, if the
17201 \begin_inset Flex Code
17204 \begin_layout Plain Layout
17210 key is defined, or else prints the name of the editor, followed by the
17212 \begin_inset Flex Code
17215 \begin_layout Plain Layout
17221 or its translation (it is by default
17222 \begin_inset Quotes eld
17226 \begin_inset Quotes erd
17230 \begin_inset Flex Code
17233 \begin_layout Plain Layout
17240 Note that this is in fact defined in
17241 \begin_inset Flex Code
17244 \begin_layout Plain Layout
17250 , so you can use it in your own definitions, or re-definitions, if you load
17254 \begin_layout Section
17255 \begin_inset CommandInset label
17257 name "sec:Tags-for-XHTML"
17261 Tags for XHTML output
17264 \begin_layout Standard
17265 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
17266 by layout information.
17267 In general, LyX provides sensible defaults and, as mentioned earlier, it
17268 will even construct default CSS style rules from the other layout tags.
17269 For example, LyX will attempt to use the information provided in the
17270 \begin_inset Flex Code
17273 \begin_layout Plain Layout
17279 declaration for the Chapter style to write CSS that will appropriately
17280 format chapter headings.
17283 \begin_layout Standard
17284 In many cases, then, you may not have to do anything at all to get acceptable
17285 XHTML output for your own environments, custom insets, and so forth.
17286 But in some cases you will, and so LyX provides a number of layout tags
17287 that can be used to customize the XHTML and CSS that are generated.
17290 \begin_layout Standard
17291 Note that there are two tags,
17292 \begin_inset Flex Code
17295 \begin_layout Plain Layout
17302 \begin_inset Flex Code
17305 \begin_layout Plain Layout
17311 that may appear outside style and inset declarations.
17313 \begin_inset CommandInset ref
17315 reference "sub:General-text-class"
17319 for details on these.
17322 \begin_layout Subsection
17323 \begin_inset CommandInset label
17325 name "sub:Paragraph-Style-XHTML"
17332 \begin_layout Standard
17333 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
17334 dealing with a normal paragraph, a command, or an environment, where this
17335 is itself determined by the contents of the corresponding
17336 \begin_inset Flex Code
17339 \begin_layout Plain Layout
17349 \begin_layout Standard
17350 For a command or normal paragraph, the output XHTML has the following form:
17353 \begin_layout LyX-Code
17355 \begin_inset Quotes erd
17359 \begin_inset Quotes erd
17365 \begin_layout LyX-Code
17367 \begin_inset Quotes erd
17371 \begin_inset Quotes erd
17377 \begin_layout LyX-Code
17378 Contents of the paragraph.
17381 \begin_layout LyX-Code
17385 \begin_layout Standard
17386 The label tags are of course omitted if the paragraph does not have a label.
17389 \begin_layout Standard
17390 For an environment that is not some sort of list, the XHTML takes this form:
17393 \begin_layout LyX-Code
17395 \begin_inset Quotes erd
17399 \begin_inset Quotes erd
17405 \begin_layout LyX-Code
17407 \begin_inset Quotes erd
17411 \begin_inset Quotes erd
17415 \begin_inset Quotes erd
17419 \begin_inset Quotes erd
17422 >Environment Label</labeltag>First paragraph.</itemtag>
17425 \begin_layout LyX-Code
17426 <itemtag>Second paragraph.</itemtag>
17429 \begin_layout LyX-Code
17433 \begin_layout Standard
17434 Note that the label is output only for the first paragraph, as it should
17435 be for a theorem, for example.
17439 \begin_layout Standard
17440 For a list, we have one of these forms:
17443 \begin_layout LyX-Code
17445 \begin_inset Quotes erd
17449 \begin_inset Quotes erd
17455 \begin_layout LyX-Code
17457 \begin_inset Quotes erd
17461 \begin_inset Quotes erd
17465 \begin_inset Quotes erd
17469 \begin_inset Quotes erd
17472 >List Label</labeltag>First item.</itemtag>
17475 \begin_layout LyX-Code
17477 \begin_inset Quotes erd
17481 \begin_inset Quotes erd
17485 \begin_inset Quotes erd
17489 \begin_inset Quotes erd
17492 >List Label</labeltag>Second item.</itemtag>
17495 \begin_layout LyX-Code
17499 \begin_layout LyX-Code
17503 \begin_layout LyX-Code
17505 \begin_inset Quotes erd
17509 \begin_inset Quotes erd
17515 \begin_layout LyX-Code
17517 \begin_inset Quotes erd
17521 \begin_inset Quotes erd
17524 >List Label</labeltag><itemtag attr=
17525 \begin_inset Quotes erd
17529 \begin_inset Quotes erd
17532 >First item.</itemtag>
17535 \begin_layout LyX-Code
17537 \begin_inset Quotes erd
17541 \begin_inset Quotes erd
17544 >List Label</labeltag><itemtag attr=
17545 \begin_inset Quotes erd
17549 \begin_inset Quotes erd
17552 >Second item.</itemtag>
17555 \begin_layout LyX-Code
17559 \begin_layout Standard
17560 Note the different orders of
17561 \begin_inset Flex Code
17564 \begin_layout Plain Layout
17571 \begin_inset Flex Code
17574 \begin_layout Plain Layout
17581 Which order we get depends upon the setting of
17582 \begin_inset Flex Code
17585 \begin_layout Plain Layout
17592 \begin_inset Flex Code
17595 \begin_layout Plain Layout
17601 is false (the default), you get the first of these, with the label within
17602 the item; if true, you get the second, with the label outside the item.
17605 \begin_layout Standard
17606 The specific tags and attributes output for each paragraph type can be controlle
17607 d by means of the layout tags we are about to describe.
17608 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17609 so you often may not need to do very much to get good XHTML output.
17610 Think of the available tags as there so you can tweak things to your liking.
17613 \begin_layout Description
17614 \begin_inset Flex Code
17617 \begin_layout Plain Layout
17624 \begin_inset Flex Code
17627 \begin_layout Plain Layout
17633 ] Specifies attribute information to be output with the main tag.
17635 \begin_inset Quotes eld
17639 \begin_inset Flex Code
17642 \begin_layout Plain Layout
17649 \begin_inset Quotes erd
17653 By default, LyX will output
17654 \begin_inset Quotes eld
17658 \begin_inset Flex Code
17661 \begin_layout Plain Layout
17668 \begin_inset Quotes erd
17672 \begin_inset Flex Code
17675 \begin_layout Plain Layout
17681 is the LyX name of the layout, made lowercase, for example: chapter.
17686 contain any style information.
17688 \begin_inset Flex Code
17691 \begin_layout Plain Layout
17700 \begin_layout Description
17701 \begin_inset Flex Code
17704 \begin_layout Plain Layout
17711 \begin_inset Flex Code
17714 \begin_layout Plain Layout
17724 ] Whether to output the default CSS information LyX generates for this layout,
17725 even if additional information is explicitly provided via
17726 \begin_inset Flex Code
17729 \begin_layout Plain Layout
17737 \begin_inset Flex Code
17740 \begin_layout Plain Layout
17746 allows you to alter or augment the generated CSS, rather than to override
17749 \begin_inset Flex Code
17752 \begin_layout Plain Layout
17761 \begin_layout Description
17762 \begin_inset Flex Code
17765 \begin_layout Plain Layout
17772 \begin_inset Flex Code
17775 \begin_layout Plain Layout
17781 ] The tag to be used for individual paragraphs of environments, replacing
17783 \begin_inset Flex Code
17786 \begin_layout Plain Layout
17792 in the examples above.
17794 \begin_inset Flex Code
17797 \begin_layout Plain Layout
17806 \begin_layout Description
17807 \begin_inset Flex Code
17810 \begin_layout Plain Layout
17817 \begin_inset Flex Code
17820 \begin_layout Plain Layout
17826 ] Attributes for the item tag.
17828 \begin_inset Quotes eld
17832 \begin_inset Flex Code
17835 \begin_layout Plain Layout
17836 class=`layoutname_item'
17842 \begin_inset Quotes erd
17850 contain any style information.
17852 \begin_inset Flex Code
17855 \begin_layout Plain Layout
17864 \begin_layout Description
17865 \begin_inset Flex Code
17868 \begin_layout Plain Layout
17875 \begin_inset Flex Code
17878 \begin_layout Plain Layout
17884 ] The tag to be used for paragraph and item labels, replacing
17885 \begin_inset Flex Code
17888 \begin_layout Plain Layout
17894 in the examples above.
17896 \begin_inset Flex Code
17899 \begin_layout Plain Layout
17906 \begin_inset Flex Code
17909 \begin_layout Plain Layout
17916 \begin_inset Flex Code
17919 \begin_layout Plain Layout
17926 \begin_inset Flex Code
17929 \begin_layout Plain Layout
17930 Centered_Top_Environment
17935 , in which case it defaults to
17936 \begin_inset Flex Code
17939 \begin_layout Plain Layout
17948 \begin_layout Description
17949 \begin_inset Flex Code
17952 \begin_layout Plain Layout
17959 \begin_inset Flex Code
17962 \begin_layout Plain Layout
17968 ] Attributes for the label tag.
17970 \begin_inset Quotes eld
17974 \begin_inset Flex Code
17977 \begin_layout Plain Layout
17978 class=`layoutname_label'
17984 \begin_inset Quotes erd
17992 contain any style information.
17994 \begin_inset Flex Code
17997 \begin_layout Plain Layout
18006 \begin_layout Description
18007 \begin_inset Flex Code
18010 \begin_layout Plain Layout
18017 \begin_inset Flex Code
18020 \begin_layout Plain Layout
18030 ] Meaningful only for list-like environments, this tag controls whether
18031 the label tag is output before or inside the item tag.
18032 This is used, for example, in the description environment, where we want
18034 \begin_inset Flex Code
18037 \begin_layout Plain Layout
18038 <dt>\SpecialChar \ldots{}
18039 </dt><dd>\SpecialChar \ldots{}
18047 \begin_inset Flex Code
18050 \begin_layout Plain Layout
18056 : The label tag is output inside the item tag.
18059 \begin_layout Description
18060 \begin_inset Flex Code
18063 \begin_layout Plain Layout
18069 Information to be output in the
18070 \begin_inset Flex Code
18073 \begin_layout Plain Layout
18079 section when this style is used.
18080 This might, for example, be used to include a
18081 \begin_inset Flex Code
18084 \begin_layout Plain Layout
18091 \begin_inset Flex Code
18094 \begin_layout Plain Layout
18103 \begin_layout Description
18104 \begin_inset Flex Code
18107 \begin_layout Plain Layout
18113 CSS style information to be included when this style is used.
18114 Note that this will automatically be wrapped in a layout-generated
18115 \begin_inset Flex Code
18118 \begin_layout Plain Layout
18124 block, so only the CSS itself need be included.
18127 \begin_layout Description
18128 \begin_inset Flex Code
18131 \begin_layout Plain Layout
18138 \begin_inset Flex Code
18141 \begin_layout Plain Layout
18147 ] The tag to be used for the main label, replacing
18148 \begin_inset Flex Code
18151 \begin_layout Plain Layout
18157 in the examples above.
18159 \begin_inset Flex Code
18162 \begin_layout Plain Layout
18171 \begin_layout Description
18172 \begin_inset Flex Code
18175 \begin_layout Plain Layout
18182 \begin_inset Flex Code
18185 \begin_layout Plain Layout
18195 ] Marks this style as the one to be used to generate the
18196 \begin_inset Flex Code
18199 \begin_layout Plain Layout
18205 tag for the XHTML file.
18206 By default, it is false.
18208 \begin_inset Flex Code
18211 \begin_layout Plain Layout
18217 file sets it to true for the
18218 \begin_inset Flex Code
18221 \begin_layout Plain Layout
18231 \begin_layout Subsection
18235 \begin_layout Standard
18236 The XHTML output of insets can also be controlled by information in layout
18241 \begin_layout Plain Layout
18242 At present, this is true only for
18243 \begin_inset Quotes eld
18247 \begin_inset Quotes erd
18250 insets (insets you can type into) and is not true for
18251 \begin_inset Quotes eld
18255 \begin_inset Quotes erd
18258 insets (insets that are associated with dialog boxes).
18263 Here, too, LyX tries to provide sensible defaults, and it constructs default
18265 But everything can be customized.
18268 \begin_layout Standard
18269 The XHTML LyX outputs for an inset has the following form:
18272 \begin_layout LyX-Code
18274 \begin_inset Quotes erd
18278 \begin_inset Quotes erd
18284 \begin_layout LyX-Code
18285 <labeltag>Label</labeltag>
18288 \begin_layout LyX-Code
18290 \begin_inset Quotes erd
18294 \begin_inset Quotes erd
18297 >Contents of the inset.</innertag>
18300 \begin_layout LyX-Code
18304 \begin_layout Standard
18305 If the inset permits multiple paragraphs---that is, if
18306 \begin_inset Flex Code
18309 \begin_layout Plain Layout
18315 is true---then the contents of the inset will itself be output as paragraphs
18316 formatted according to the styles used for those paragraphs (standard,
18317 quote, and the like).
18318 The label tag is of course omitted if the paragraph does not have a label
18319 and, at present, is always
18320 \begin_inset Flex Code
18323 \begin_layout Plain Layout
18330 The inner tag is optional and, by default, does not appear.
18333 \begin_layout Standard
18334 The specific tags and attributes output for each inset can be controlled
18335 by means of the following layout tags.
18338 \begin_layout Description
18339 \begin_inset Flex Code
18342 \begin_layout Plain Layout
18349 \begin_inset Flex Code
18352 \begin_layout Plain Layout
18358 ] Specifies attribute information to be output with the main tag.
18360 \begin_inset Quotes eld
18364 \begin_inset Flex Code
18367 \begin_layout Plain Layout
18368 class=`myinset' onclick=`\SpecialChar \ldots{}
18375 \begin_inset Quotes erd
18379 By default, LyX will output
18380 \begin_inset Quotes eld
18384 \begin_inset Flex Code
18387 \begin_layout Plain Layout
18394 \begin_inset Quotes erd
18398 \begin_inset Flex Code
18401 \begin_layout Plain Layout
18407 is the LyX name of the inset, made lowercase and with non-alphanumeric
18408 characters converted to underscores, for example: footnote.
18411 \begin_layout Description
18412 \begin_inset Flex Code
18415 \begin_layout Plain Layout
18422 \begin_inset Flex Code
18425 \begin_layout Plain Layout
18435 ] Whether to output the default CSS information LyX generates for this layout,
18436 even if additional information is explicitly provided via
18437 \begin_inset Flex Code
18440 \begin_layout Plain Layout
18448 \begin_inset Flex Code
18451 \begin_layout Plain Layout
18457 allows you to alter or augment the generated CSS, rather than to override
18462 \begin_layout Description
18463 \begin_inset Flex Code
18466 \begin_layout Plain Layout
18473 \begin_inset Flex Code
18476 \begin_layout Plain Layout
18482 ] Attributes for the inner tag.
18484 \begin_inset Quotes eld
18488 \begin_inset Flex Code
18491 \begin_layout Plain Layout
18492 class=`insetname_inner'
18498 \begin_inset Quotes erd
18504 \begin_layout Description
18505 \begin_inset Flex Code
18508 \begin_layout Plain Layout
18515 \begin_inset Flex Code
18518 \begin_layout Plain Layout
18524 ] The inner tag, replacing
18525 \begin_inset Flex Code
18528 \begin_layout Plain Layout
18534 in the examples above.
18535 By default, there is none.
18538 \begin_layout Description
18539 \begin_inset Flex Code
18542 \begin_layout Plain Layout
18549 \begin_inset Flex Code
18552 \begin_layout Plain Layout
18560 ] Whether this inset represents a standalone block of text (such as a footnote)
18561 or instead represents material that is included in the surrounding text
18562 (such as a branch).
18566 \begin_layout Description
18567 \begin_inset Flex Code
18570 \begin_layout Plain Layout
18577 \begin_inset Flex Code
18580 \begin_layout Plain Layout
18586 ] A label for this inset, possibly including a reference to a counter.
18587 For example, for footnote, it might be:
18588 \begin_inset Flex Code
18591 \begin_layout Plain Layout
18600 This is optional, and there is no default.
18603 \begin_layout Description
18604 \begin_inset Flex Code
18607 \begin_layout Plain Layout
18613 Information to be output in the
18614 \begin_inset Flex Code
18617 \begin_layout Plain Layout
18623 section when this style is used.
18624 This might, for example, be used to include a
18625 \begin_inset Flex Code
18628 \begin_layout Plain Layout
18635 \begin_inset Flex Code
18638 \begin_layout Plain Layout
18647 \begin_layout Description
18648 \begin_inset Flex Code
18651 \begin_layout Plain Layout
18657 CSS style information to be included when this style is used.
18658 Note that this will automatically be wrapped in a layout-generated
18659 \begin_inset Flex Code
18662 \begin_layout Plain Layout
18668 block, so only the CSS itself need be included.
18671 \begin_layout Description
18672 \begin_inset Flex Code
18675 \begin_layout Plain Layout
18682 \begin_inset Flex Code
18685 \begin_layout Plain Layout
18691 ] The tag to be used for the main label, replacing
18692 \begin_inset Flex Code
18695 \begin_layout Plain Layout
18701 in the examples above.
18702 The default depends upon the setting of
18703 \begin_inset Flex Code
18706 \begin_layout Plain Layout
18713 \begin_inset Flex Code
18716 \begin_layout Plain Layout
18722 is true, the default is
18723 \begin_inset Flex Code
18726 \begin_layout Plain Layout
18732 ; if it is false, the default is
18733 \begin_inset Flex Code
18736 \begin_layout Plain Layout
18745 \begin_layout Subsection
18749 \begin_layout Standard
18750 The XHTML output for floats too can be controlled by layout information.
18751 The output has the following form:
18754 \begin_layout LyX-Code
18756 \begin_inset Quotes erd
18760 \begin_inset Quotes erd
18766 \begin_layout LyX-Code
18767 Contents of the float.
18770 \begin_layout LyX-Code
18774 \begin_layout Standard
18775 The caption, if there is one, is a separate inset and will be output as
18777 Its appearance can be controlled via the InsetLayout for caption insets.
18781 \begin_layout Description
18782 \begin_inset Flex Code
18785 \begin_layout Plain Layout
18792 \begin_inset Flex Code
18795 \begin_layout Plain Layout
18801 ] Specifies attribute information to be output with the main tag.
18803 \begin_inset Quotes eld
18807 \begin_inset Flex Code
18810 \begin_layout Plain Layout
18811 class=`myfloat' onclick=`\SpecialChar \ldots{}
18818 \begin_inset Quotes erd
18822 By default, LyX will output
18823 \begin_inset Quotes eld
18827 \begin_inset Flex Code
18830 \begin_layout Plain Layout
18831 class=`float float-floattype'
18837 \begin_inset Quotes erd
18841 \begin_inset Flex Code
18844 \begin_layout Plain Layout
18850 is LyX's name for this type of float, as determined by the float declaration
18852 \begin_inset CommandInset ref
18854 reference "sub:Floats"
18858 ), though made lowercase and with non-alphanumeric characters converted
18859 to underscores, for example: float-table.
18862 \begin_layout Description
18863 \begin_inset Flex Code
18866 \begin_layout Plain Layout
18872 CSS style information to be included when this float is used.
18873 Note that this will automatically be wrapped in a layout-generated
18874 \begin_inset Flex Code
18877 \begin_layout Plain Layout
18883 block, so only the CSS itself need be included.
18886 \begin_layout Description
18887 \begin_inset Flex Code
18890 \begin_layout Plain Layout
18897 \begin_inset Flex Code
18900 \begin_layout Plain Layout
18906 ] The tag to be used for this float, replacing
18907 \begin_inset Quotes eld
18911 \begin_inset Flex Code
18914 \begin_layout Plain Layout
18921 \begin_inset Quotes erd
18924 in the example above.
18926 \begin_inset Flex Code
18929 \begin_layout Plain Layout
18935 and will rarely need changing.
18938 \begin_layout Subsection
18939 Bibliography formatting
18942 \begin_layout Standard
18943 The bibliography can be formatted using
18944 \begin_inset Flex Code
18947 \begin_layout Plain Layout
18955 \begin_inset CommandInset ref
18957 reference "sub:Citation-format-description"
18964 \begin_layout Subsection
18968 \begin_layout Standard
18969 We have several times mentioned that LyX will generate default CSS style
18970 rules for both insets and paragraph styles, based upon the other layout
18971 information that is provided.
18972 In this section, we shall say a word about which layout information LyX
18976 \begin_layout Standard
18977 At present, LyX auto-generates CSS only for font information, making use
18979 \begin_inset Flex Code
18982 \begin_layout Plain Layout
18989 \begin_inset Flex Code
18992 \begin_layout Plain Layout
18999 \begin_inset Flex Code
19002 \begin_layout Plain Layout
19009 \begin_inset Flex Code
19012 \begin_layout Plain Layout
19019 \begin_inset Flex Code
19022 \begin_layout Plain Layout
19030 \begin_inset CommandInset ref
19032 reference "sub:Font-description"
19036 .) The translation is mostly straightforward and obvious.
19038 \begin_inset Quotes eld
19042 \begin_inset Flex Code
19045 \begin_layout Plain Layout
19052 \begin_inset Quotes erd
19056 \begin_inset Quotes eld
19060 \begin_inset Flex Code
19063 \begin_layout Plain Layout
19064 font-family: sans-serif;
19070 \begin_inset Quotes erd
19074 The correspondence of LyX sizes and CSS sizes is a little less obvious
19075 but nonetheless intuitive.
19077 \begin_inset Flex Code
19080 \begin_layout Plain Layout
19087 \begin_inset Flex URL
19090 \begin_layout Plain Layout
19100 \begin_layout Chapter
19101 Including External Material
19104 \begin_layout Standard
19105 \begin_inset Box Shadowbox
19115 height_special "totalheight"
19118 \begin_layout Plain Layout
19119 WARNING: This portion of the documentation has not been updated for some
19121 We certainly hope that it is still accurate, but there are no guarantees.
19129 \begin_layout Standard
19130 The use of material from sources external to LyX is covered in detail in
19136 This part of the manual covers what needs to happen behind the scenes for
19137 new sorts of material to be included.
19140 \begin_layout Section
19144 \begin_layout Standard
19145 The external material feature is based on the concept of a
19150 A template is a specification of how LyX should interface with a certain
19152 As bundled, LyX comes with predefined templates for Xfig figures, various
19153 raster format images, chess diagrams, and LilyPond music notation.
19154 You can check the actual list by using the menu
19155 \begin_inset Flex MenuItem
19158 \begin_layout Plain Layout
19159 Insert\SpecialChar \menuseparator
19160 File\SpecialChar \menuseparator
19167 Furthermore, it is possible to roll your own template to support a specific
19169 Later we'll describe in more detail what is involved, and hopefully you
19170 will submit all the templates you create so we can include them in a later
19174 \begin_layout Standard
19175 Another basic idea of the external material feature is to distinguish between
19176 the original file that serves as a base for final material and the produced
19177 file that is included in your exported or printed document.
19178 For example, consider the case of a figure produced with
19179 \begin_inset Flex Code
19182 \begin_layout Plain Layout
19189 The Xfig application itself works on an original file with the
19190 \begin_inset Flex Code
19193 \begin_layout Plain Layout
19200 Within Xfig, you create and change your figure, and when you are done,
19202 \begin_inset Flex Code
19205 \begin_layout Plain Layout
19212 When you want to include the figure in your document, you invoke
19213 \begin_inset Flex Code
19216 \begin_layout Plain Layout
19222 in order to create a PostScript file that can readily be included in your
19225 \begin_inset Flex Code
19228 \begin_layout Plain Layout
19234 file is the original file, and the PostScript file is the produced file.
19237 \begin_layout Standard
19238 This distinction is important in order to allow updating of the material
19239 while you are in the process of writing the document.
19240 Furthermore, it provides us with the flexibility that is needed to support
19241 multiple export formats.
19242 For instance, in the case of a plain text file, it is not exactly an award-winn
19243 ing idea to include the figure as raw PostScript.
19244 Instead, you would either prefer to just include a reference to the figure
19245 or try to invoke some graphics to ASCII converter to make the final result
19246 look similar to the real graphics.
19247 The external material management allows you to do this, because it is parametri
19248 zed on the different export formats that LyX supports.
19251 \begin_layout Standard
19252 Besides supporting the production of different products according to the
19253 exported format, it supports tight integration with editing and viewing
19255 In the case of an Xfig figure, you are able to invoke Xfig on the original
19256 file with a single click from within the external material dialog in LyX,
19257 and also preview the produced PostScript file with Ghostview with another
19259 No more fiddling around with the command line and/or file browsers to locate
19260 and manipulate the original or produced files.
19261 In this way, you are finally able to take full advantage of the many different
19262 applications that are relevant to use when you write your documents, and
19263 ultimately be more productive.
19266 \begin_layout Section
19267 The external template configuration file
19270 \begin_layout Standard
19271 It is relatively easy to add custom external template definitions to LyX.
19272 However, be aware that doing this in an careless manner most probably
19276 introduce an easily exploitable security hole.
19277 So before you do this, please read the discussion about security in section
19279 \begin_inset CommandInset ref
19281 reference "sec:Security-discussion"
19288 \begin_layout Standard
19289 Having said that, we encourage you to submit any interesting templates that
19294 \begin_layout Standard
19295 The external templates are defined in the
19296 \begin_inset Flex Code
19299 \begin_layout Plain Layout
19300 LyXDir/lib/external_templates
19306 You can place your own version in
19307 \begin_inset Flex Code
19310 \begin_layout Plain Layout
19311 UserDir/external_templates
19319 \begin_layout Standard
19320 A typical template looks like this:
19323 \begin_layout LyX-Code
19327 \begin_layout LyX-Code
19328 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
19331 \begin_layout LyX-Code
19335 \begin_layout LyX-Code
19339 \begin_layout LyX-Code
19343 \begin_layout LyX-Code
19347 \begin_layout LyX-Code
19351 \begin_layout LyX-Code
19352 AutomaticProduction true
19355 \begin_layout LyX-Code
19359 \begin_layout LyX-Code
19363 \begin_layout LyX-Code
19367 \begin_layout LyX-Code
19368 TransformCommand Rotate RotationLatexCommand
19371 \begin_layout LyX-Code
19372 TransformCommand Resize ResizeLatexCommand
19375 \begin_layout LyX-Code
19376 Product "$$RotateFront$$ResizeFront
19379 \begin_layout LyX-Code
19384 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
19387 \begin_layout LyX-Code
19388 $$ResizeBack$$RotateBack"
19391 \begin_layout LyX-Code
19395 \begin_layout LyX-Code
19396 UpdateResult "$$AbsPath$$Basename.pstex_t"
19399 \begin_layout LyX-Code
19400 Requirement "graphicx"
19403 \begin_layout LyX-Code
19404 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19407 \begin_layout LyX-Code
19408 ReferencedFile latex "$$AbsPath$$Basename.eps"
19411 \begin_layout LyX-Code
19412 ReferencedFile dvi "$$AbsPath$$Basename.eps"
19415 \begin_layout LyX-Code
19419 \begin_layout LyX-Code
19423 \begin_layout LyX-Code
19424 TransformCommand Rotate RotationLatexCommand
19427 \begin_layout LyX-Code
19428 TransformCommand Resize ResizeLatexCommand
19431 \begin_layout LyX-Code
19432 Product "$$RotateFront$$ResizeFront
19435 \begin_layout LyX-Code
19440 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
19443 \begin_layout LyX-Code
19444 $$ResizeBack$$RotateBack"
19447 \begin_layout LyX-Code
19448 UpdateFormat pdftex
19451 \begin_layout LyX-Code
19452 UpdateResult "$$AbsPath$$Basename.pdftex_t"
19455 \begin_layout LyX-Code
19456 Requirement "graphicx"
19459 \begin_layout LyX-Code
19460 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
19463 \begin_layout LyX-Code
19464 ReferencedFile latex "$$AbsPath$$Basename.pdf"
19467 \begin_layout LyX-Code
19471 \begin_layout LyX-Code
19475 \begin_layout LyX-Code
19476 Product "$$Contents(
19478 "$$AbsPath$$Basename.asc
19483 \begin_layout LyX-Code
19484 UpdateFormat asciixfig
19487 \begin_layout LyX-Code
19488 UpdateResult "$$AbsPath$$Basename.asc"
19491 \begin_layout LyX-Code
19495 \begin_layout LyX-Code
19499 \begin_layout LyX-Code
19500 Product "<graphic fileref=
19502 "$$AbsOrRelPathMaster$$Basename.eps
19507 \begin_layout LyX-Code
19511 \begin_layout LyX-Code
19515 \begin_layout LyX-Code
19516 UpdateResult "$$AbsPath$$Basename.eps"
19519 \begin_layout LyX-Code
19520 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19523 \begin_layout LyX-Code
19524 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19527 \begin_layout LyX-Code
19531 \begin_layout LyX-Code
19532 Product "[XFig: $$FName]"
19535 \begin_layout LyX-Code
19539 \begin_layout LyX-Code
19543 \begin_layout Standard
19544 As you can see, the template is enclosed in
19545 \begin_inset Flex Code
19548 \begin_layout Plain Layout
19554 \SpecialChar \ldots{}
19556 \begin_inset Flex Code
19559 \begin_layout Plain Layout
19566 It contains a header specifying some general settings and, for each supported
19567 primary document file format, a section
19568 \begin_inset Flex Code
19571 \begin_layout Plain Layout
19577 \SpecialChar \ldots{}
19579 \begin_inset Flex Code
19582 \begin_layout Plain Layout
19591 \begin_layout Subsection
19592 The template header
19595 \begin_layout Description
19596 \begin_inset Flex Code
19599 \begin_layout Plain Layout
19600 AutomaticProduction
19601 \begin_inset space ~
19609 Whether the file represented by the template must be generated by LyX.
19610 This command must occur exactly once.
19613 \begin_layout Description
19614 \begin_inset Flex Code
19617 \begin_layout Plain Layout
19619 \begin_inset space ~
19627 A glob pattern that is used in the file dialog to filter out the desired
19629 If there is more than one possible file extension (e.
19630 \begin_inset space \thinspace{}
19634 \begin_inset space \space{}
19638 \begin_inset Flex Code
19641 \begin_layout Plain Layout
19648 \begin_inset Flex Code
19651 \begin_layout Plain Layout
19657 ), use something like
19658 \begin_inset Flex Code
19661 \begin_layout Plain Layout
19668 This command must occur exactly once.
19671 \begin_layout Description
19672 \begin_inset Flex Code
19675 \begin_layout Plain Layout
19677 \begin_inset space ~
19685 The text that is displayed on the button.
19686 This command must occur exactly once.
19689 \begin_layout Description
19690 \begin_inset Flex Code
19693 \begin_layout Plain Layout
19695 \begin_inset space ~
19699 \begin_inset space ~
19707 The help text that is used in the External dialog.
19708 Provide enough information to explain to the user just what the template
19709 can provide him with.
19710 This command must occur exactly once.
19713 \begin_layout Description
19714 \begin_inset Flex Code
19717 \begin_layout Plain Layout
19719 \begin_inset space ~
19727 The file format of the original file.
19728 This must be the name of a format that is known to LyX (see section
19729 \begin_inset space ~
19733 \begin_inset CommandInset ref
19735 reference "sec:Formats"
19741 \begin_inset Quotes eld
19745 \begin_inset Flex Code
19748 \begin_layout Plain Layout
19755 \begin_inset Quotes erd
19758 if the template can handle original files of more than one format.
19759 LyX will attempt to interrogate the file itself in order to deduce its
19760 format in this case.
19761 This command must occur exactly once.
19764 \begin_layout Description
19765 \begin_inset Flex Code
19768 \begin_layout Plain Layout
19770 \begin_inset space ~
19778 A unique name for the template.
19779 It must not contain substitution macros (see below).
19782 \begin_layout Description
19783 \begin_inset Flex Code
19786 \begin_layout Plain Layout
19788 \begin_inset space ~
19791 Rotate|Resize|Clip|Extra
19796 This command specifies which transformations are supported by this template.
19797 It may occur zero or more times.
19798 This command enables the corresponding tabs in the external dialog.
19800 \begin_inset Flex Code
19803 \begin_layout Plain Layout
19809 command must have either a corresponding
19810 \begin_inset Flex Code
19813 \begin_layout Plain Layout
19820 \begin_inset Flex Code
19823 \begin_layout Plain Layout
19830 \begin_inset Flex Code
19833 \begin_layout Plain Layout
19840 Otherwise the transformation will not be supported by that format.
19843 \begin_layout Subsection
19847 \begin_layout Description
19848 \begin_inset Flex Code
19851 \begin_layout Plain Layout
19853 \begin_inset space ~
19856 LaTeX|PDFLaTeX|PlainText|DocBook
19861 The primary document file format that this format definition is for.
19862 Not every template has a sensible representation in all document file formats.
19863 Please define nevertheless a
19864 \begin_inset Flex Code
19867 \begin_layout Plain Layout
19873 section for all templates.
19874 Use a dummy text when no representation is available.
19875 Then you can at least see a reference to the external material in the exported
19879 \begin_layout Description
19880 \begin_inset Flex Code
19883 \begin_layout Plain Layout
19885 \begin_inset space ~
19889 \begin_inset space ~
19897 This command defines an additional macro
19898 \begin_inset Flex Code
19901 \begin_layout Plain Layout
19907 for substitution in
19908 \begin_inset Flex Code
19911 \begin_layout Plain Layout
19919 \begin_inset Flex Code
19922 \begin_layout Plain Layout
19928 itself may contain substitution macros.
19929 The advantage over using
19930 \begin_inset Flex Code
19933 \begin_layout Plain Layout
19940 \begin_inset Flex Code
19943 \begin_layout Plain Layout
19949 is that the substituted value of
19950 \begin_inset Flex Code
19953 \begin_layout Plain Layout
19959 is sanitized so that it is a valid optional argument in the document format.
19960 This command may occur zero or more times.
19963 \begin_layout Description
19964 \begin_inset Flex Code
19967 \begin_layout Plain Layout
19969 \begin_inset space ~
19977 The text that is inserted in the exported document.
19978 This is actually the most important command and can be quite complex.
19979 This command must occur exactly once.
19982 \begin_layout Description
19983 \begin_inset Flex Code
19986 \begin_layout Plain Layout
19988 \begin_inset space ~
19996 This command specifies a preamble snippet that will be included in the
19998 It has to be defined using
19999 \begin_inset Flex Code
20002 \begin_layout Plain Layout
20008 \SpecialChar \ldots{}
20010 \begin_inset Flex Code
20013 \begin_layout Plain Layout
20020 This command may occur zero or more times.
20023 \begin_layout Description
20024 \begin_inset Flex Code
20027 \begin_layout Plain Layout
20029 \begin_inset space ~
20033 \begin_inset space ~
20041 This command denotes files that are created by the conversion process and
20042 are needed for a particular export format.
20043 If the filename is relative, it is interpreted relative to the master document.
20044 This command may be given zero or more times.
20047 \begin_layout Description
20048 \begin_inset Flex Code
20051 \begin_layout Plain Layout
20053 \begin_inset space ~
20061 The name of a required LaTeX package.
20062 The package is included via
20063 \begin_inset Flex Code
20066 \begin_layout Plain Layout
20074 in the LaTeX preamble.
20075 This command may occur zero or more times.
20078 \begin_layout Description
20079 \begin_inset Flex Code
20082 \begin_layout Plain Layout
20084 \begin_inset space ~
20088 \begin_inset space ~
20091 RotationLatexCommand
20096 This command specifies that the built in LaTeX command should be used for
20098 This command may occur once or not at all.
20101 \begin_layout Description
20102 \begin_inset Flex Code
20105 \begin_layout Plain Layout
20107 \begin_inset space ~
20111 \begin_inset space ~
20119 This command specifies that the built in LaTeX command should be used for
20121 This command may occur once or not at all.
20124 \begin_layout Description
20125 \begin_inset Flex Code
20128 \begin_layout Plain Layout
20130 \begin_inset space ~
20134 \begin_inset space ~
20137 RotationLatexOption
20142 This command specifies that rotation is done via an optional argument.
20143 This command may occur once or not at all.
20146 \begin_layout Description
20147 \begin_inset Flex Code
20150 \begin_layout Plain Layout
20152 \begin_inset space ~
20156 \begin_inset space ~
20164 This command specifies that resizing is done via an optional argument.
20165 This command may occur once or not at all.
20168 \begin_layout Description
20169 \begin_inset Flex Code
20172 \begin_layout Plain Layout
20174 \begin_inset space ~
20178 \begin_inset space ~
20186 This command specifies that clipping is done via an optional argument.
20187 This command may occur once or not at all.
20190 \begin_layout Description
20191 \begin_inset Flex Code
20194 \begin_layout Plain Layout
20196 \begin_inset space ~
20200 \begin_inset space ~
20208 This command specifies that an extra optional argument is used.
20209 This command may occur once or not at all.
20212 \begin_layout Description
20213 \begin_inset Flex Code
20216 \begin_layout Plain Layout
20218 \begin_inset space ~
20226 The file format of the converted file.
20227 This must be the name of a format that is known to LyX (see the
20228 \begin_inset Flex MenuItem
20231 \begin_layout Plain Layout
20236 ools\SpecialChar \menuseparator
20241 references\SpecialChar \menuseparator
20242 File Handling\SpecialChar \menuseparator
20249 This command must occur exactly once.
20252 \begin_layout Description
20253 \begin_inset Flex Code
20256 \begin_layout Plain Layout
20258 \begin_inset space ~
20266 The file name of the converted file.
20267 The file name must be absolute.
20268 This command must occur exactly once.
20271 \begin_layout Subsection
20272 Preamble definitions
20275 \begin_layout Standard
20276 The external template configuration file may contain additional preamble
20277 definitions enclosed by
20278 \begin_inset Flex Code
20281 \begin_layout Plain Layout
20287 \SpecialChar \ldots{}
20289 \begin_inset Flex Code
20292 \begin_layout Plain Layout
20299 They can be used by the templates in the
20300 \begin_inset Flex Code
20303 \begin_layout Plain Layout
20312 \begin_layout Section
20313 The substitution mechanism
20316 \begin_layout Standard
20317 When the external material facility invokes an external program, it is done
20318 on the basis of a command defined in the template configuration file.
20319 These commands can contain various macros that are expanded before execution.
20320 Execution always take place in the directory of the containing document.
20323 \begin_layout Standard
20324 Also, whenever external material is to be displayed, the name will be produced
20325 by the substitution mechanism, and most other commands in the template
20326 definition support substitution as well.
20329 \begin_layout Standard
20330 The available macros are the following:
20333 \begin_layout Description
20334 \begin_inset Flex Code
20337 \begin_layout Plain Layout
20338 $$AbsOrRelPathMaster
20343 The file path, absolute or relative to the master LyX document.
20346 \begin_layout Description
20347 \begin_inset Flex Code
20350 \begin_layout Plain Layout
20351 $$AbsOrRelPathParent
20356 The file path, absolute or relative to the LyX document.
20359 \begin_layout Description
20360 \begin_inset Flex Code
20363 \begin_layout Plain Layout
20369 The absolute file path.
20372 \begin_layout Description
20373 \begin_inset Flex Code
20376 \begin_layout Plain Layout
20382 The filename without path and without the extension.
20385 \begin_layout Description
20386 \begin_inset Flex Code
20389 \begin_layout Plain Layout
20391 \begin_inset Quotes eld
20395 \begin_inset Quotes erd
20403 This macro will expand to the contents of the file with the name
20404 \begin_inset Flex Code
20407 \begin_layout Plain Layout
20416 \begin_layout Description
20417 \begin_inset Flex Code
20420 \begin_layout Plain Layout
20426 The file extension (including the dot).
20429 \begin_layout Description
20430 \begin_inset Flex Code
20433 \begin_layout Plain Layout
20439 The filename of the file specified in the external material dialog.
20440 This is either an absolute name, or it is relative to the LyX document.
20443 \begin_layout Description
20444 \begin_inset Flex Code
20447 \begin_layout Plain Layout
20454 \begin_inset Flex Code
20457 \begin_layout Plain Layout
20463 (absolute name or relative to the LyX document).
20466 \begin_layout Description
20467 \begin_inset Flex Code
20470 \begin_layout Plain Layout
20476 The file path, relative to the master LyX document.
20479 \begin_layout Description
20480 \begin_inset Flex Code
20483 \begin_layout Plain Layout
20489 The file path, relative to the LyX document.
20492 \begin_layout Description
20493 \begin_inset Flex Code
20496 \begin_layout Plain Layout
20502 This macro will expand to the absolute path of the system directory.
20503 This is typically used to point to the various helper scripts that are
20507 \begin_layout Description
20508 \begin_inset Flex Code
20511 \begin_layout Plain Layout
20517 A name and full path to a temporary file which will be automatically deleted
20518 whenever the containing document is closed, or the external material insertion
20522 \begin_layout Standard
20523 All path macros contain a trailing directory separator, so you can construct
20525 \begin_inset space \thinspace{}
20529 \begin_inset space \space{}
20532 the absolute filename with
20533 \begin_inset Flex Code
20536 \begin_layout Plain Layout
20537 $$AbsPath$$Basename$$Extension
20545 \begin_layout Standard
20546 The macros above are substituted in all commands unless otherwise noted.
20548 \begin_inset Flex Code
20551 \begin_layout Plain Layout
20557 supports additionally the following substitutions if they are enabled by
20559 \begin_inset Flex Code
20562 \begin_layout Plain Layout
20569 \begin_inset Flex Code
20572 \begin_layout Plain Layout
20581 \begin_layout Description
20582 \begin_inset Flex Code
20585 \begin_layout Plain Layout
20591 The front part of the resize command.
20594 \begin_layout Description
20595 \begin_inset Flex Code
20598 \begin_layout Plain Layout
20604 The back part of the resize command.
20607 \begin_layout Description
20608 \begin_inset Flex Code
20611 \begin_layout Plain Layout
20617 The front part of the rotation command.
20620 \begin_layout Description
20621 \begin_inset Flex Code
20624 \begin_layout Plain Layout
20630 The back part of the rotation command.
20633 \begin_layout Standard
20634 The value string of the
20635 \begin_inset Flex Code
20638 \begin_layout Plain Layout
20644 command supports additionally the following substitutions if they are enabled
20646 \begin_inset Flex Code
20649 \begin_layout Plain Layout
20656 \begin_inset Flex Code
20659 \begin_layout Plain Layout
20668 \begin_layout Description
20669 \begin_inset Flex Code
20672 \begin_layout Plain Layout
20681 \begin_layout Description
20682 \begin_inset Flex Code
20685 \begin_layout Plain Layout
20694 \begin_layout Description
20695 \begin_inset Flex Code
20698 \begin_layout Plain Layout
20707 \begin_layout Description
20708 \begin_inset Flex Code
20711 \begin_layout Plain Layout
20717 The rotation option.
20720 \begin_layout Standard
20721 You may ask why there are so many path macros.
20722 There are mainly two reasons:
20725 \begin_layout Enumerate
20726 Relative and absolute file names should remain relative or absolute, respectivel
20728 Users may have reasons to prefer either form.
20729 Relative names are useful for portable documents that should work on different
20730 machines, for example.
20731 Absolute names may be required by some programs.
20734 \begin_layout Enumerate
20735 LaTeX treats relative file names differently than LyX and other programs
20736 in nested included files.
20737 For LyX, a relative file name is always relative to the document that contains
20739 For LaTeX, it is always relative to the master document.
20740 These two definitions are identical if you have only one document, but
20741 differ if you have a master document that includes part documents.
20742 That means that relative filenames must be transformed when presented to
20744 Fortunately LyX does this automatically for you if you choose the right
20748 \begin_layout Standard
20749 So which path macro should be used in new template definitions? The rule
20753 \begin_layout Itemize
20755 \begin_inset Flex Code
20758 \begin_layout Plain Layout
20764 if an absolute path is required.
20767 \begin_layout Itemize
20769 \begin_inset Flex Code
20772 \begin_layout Plain Layout
20773 $$AbsOrRelPathMaster
20778 if the substituted string is some kind of LaTeX input.
20781 \begin_layout Itemize
20783 \begin_inset Flex Code
20786 \begin_layout Plain Layout
20787 $$AbsOrRelPathParent
20792 in order to preserve the user's choice.
20795 \begin_layout Standard
20796 There are special cases where this rule does not work and e.
20797 \begin_inset space \thinspace{}
20801 \begin_inset space \space{}
20804 relative names are needed, but normally it will work just fine.
20805 One example for such a case is the command
20806 \begin_inset Flex Code
20809 \begin_layout Plain Layout
20810 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20815 in the XFig template above: We can't use the absolute name because the
20817 \begin_inset Flex Code
20820 \begin_layout Plain Layout
20826 files needs the relative name in order to rewrite the file content.
20829 \begin_layout Section
20830 Security discussion
20831 \begin_inset CommandInset label
20833 name "sec:Security-discussion"
20840 \begin_layout Standard
20841 The external material feature interfaces with a lot of external programs
20842 and does so automatically, so we have to consider the security implications
20844 In particular, since you have the option of including your own filenames
20845 and/or parameter strings and those are expanded into a command, it seems
20846 that it would be possible to create a malicious document which executes
20847 arbitrary commands when a user views or prints the document.
20848 This is something we definitely want to avoid.
20851 \begin_layout Standard
20852 However, since the external program commands are specified in the template
20853 configuration file only, there are no security issues if LyX is properly
20854 configured with safe templates only.
20855 This is so because the external programs are invoked with the
20856 \begin_inset Flex Code
20859 \begin_layout Plain Layout
20865 -system call rather than the
20866 \begin_inset Flex Code
20869 \begin_layout Plain Layout
20875 system-call, so it's not possible to execute arbitrary commands from the
20876 filename or parameter section via the shell.
20879 \begin_layout Standard
20880 This also implies that you are restricted in what command strings you can
20881 use in the external material templates.
20882 In particular, pipes and redirection are not readily available.
20883 This has to be so if LyX should remain safe.
20884 If you want to use some of the shell features, you should write a safe
20885 script to do this in a controlled manner, and then invoke the script from
20886 the command string.
20890 \begin_layout Standard
20891 It is possible to design a template that interacts directly with the shell,
20892 but since this would allow a malicious user to execute arbitrary commands
20893 by writing clever filenames and/or parameters, we generally recommend that
20894 you only use safe scripts that work with the
20895 \begin_inset Flex Code
20898 \begin_layout Plain Layout
20904 system call in a controlled manner.
20905 Of course, for use in a controlled environment, it can be tempting to just
20906 fall back to use ordinary shell scripts.
20907 If you do so, be aware that you
20911 provide an easily exploitable security hole in your system.
20912 Of course it stands to reason that such unsafe templates will never be
20913 included in the standard LyX distribution, although we do encourage people
20914 to submit new templates in the open source tradition.
20915 But LyX as shipped from the official distribution channels will never have
20919 \begin_layout Standard
20920 Including external material provides a lot of power, and you have to be
20921 careful not to introduce security hazards with this power.
20922 A subtle error in a single line in an innocent looking script can open
20923 the door to huge security problems.
20924 So if you do not fully understand the issues, we recommend that you consult
20925 a knowledgeable security professional or the LyX development team if you
20926 have any questions about whether a given template is safe or not.
20927 And do this before you use it in an uncontrolled environment.