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 false
130 \output_changes false
139 Customizing LyX: Features for the Advanced User
147 \begin_layout Plain Layout
149 If you have comments or error corrections, please send them to the LyX Documenta
151 \begin_inset CommandInset href
153 target "lyx-docs@lists.lyx.org"
160 \begin_inset Quotes eld
164 \begin_inset Quotes erd
167 in the subject header, and please cc the current maintainer of this file,
168 Richard Heck <rgheck@comcast.net>.
174 \begin_inset Newline newline
178 \begin_inset Newline newline
184 \begin_layout Standard
185 \begin_inset CommandInset toc
186 LatexCommand tableofcontents
193 \begin_layout Standard
194 \begin_inset Note Note
197 \begin_layout Plain Layout
198 Please use change tracking when modifying this document.
199 This makes it easier for our translators to recognize things that have
200 been changed, and it helps the maintainer keep up-to-date with what's been
209 \begin_layout Chapter
213 \begin_layout Standard
214 This manual covers the customization features present in LyX.
215 In it, we discuss issues like keyboard shortcuts, screen previewing options,
216 printer options, sending commands to LyX via the LyX Server, internationalizati
217 on, installing new LaTeX classes and LyX layouts, etc.
218 We can't possibly hope to touch on everything you can change—our developers
219 add new features faster than we can document them—but we will explain the
220 most common customizations and hopefully point you in the right direction
221 for some of the more obscure ones.
224 \begin_layout Standard
225 \begin_inset Branch OutDated
228 \begin_layout Standard
229 Information from previous versions of this document that now seems to be
230 outdated is contained in the OutDated branch of this document.
231 By default, this information will not appear in the LaTeX output.
239 \begin_layout Chapter
240 LyX configuration files
243 \begin_layout Standard
244 This chapter aims to help you to find your way through the LyX configuration
246 Before continuing to read this chapter, you should find out where your
247 LyX library and user directories are by using
248 \begin_inset Flex MenuItem
251 \begin_layout Plain Layout
252 Help\SpecialChar \menuseparator
263 The library directory is the place where LyX places its system-wide configurati
264 on files; the user directory is where you can place your modified versions.
265 We will call the former
266 \begin_inset Flex Code
269 \begin_layout Plain Layout
276 \begin_inset Flex MenuItem
279 \begin_layout Plain Layout
285 in the remainder of this document.
289 \begin_layout Section
291 \begin_inset Flex Code
294 \begin_layout Plain Layout
303 \begin_layout Standard
304 \begin_inset Flex Code
307 \begin_layout Plain Layout
313 and its sub-directories contain a number of files and that can be used
314 to customize LyX's behavior.
315 You can change many of these files from within LyX itself through the
316 \begin_inset Flex MenuItem
319 \begin_layout Plain Layout
320 Tools\SpecialChar \menuseparator
327 Most customization that you will want to do in LyX is possible through
329 However, many other inner aspects of LyX can be customized by modifying
331 \begin_inset Flex Code
334 \begin_layout Plain Layout
341 These files fall in different categories, described in the following subsection
345 \begin_layout Subsection
346 Automatically generated files
349 \begin_layout Standard
350 The files, which are to be found in
351 \begin_inset Flex MenuItem
354 \begin_layout Plain Layout
360 , are generated when you configure LyX.
361 They contain various default values that are guessed by inspection.
362 In general, it is not a good idea to modify them, since they might be overwritt
366 \begin_layout Labeling
367 \labelwidthstring 00.00.0000
368 \begin_inset Flex Code
371 \begin_layout Plain Layout
377 contains defaults for various commands.
380 \begin_layout Labeling
381 \labelwidthstring 00.00.0000
382 \begin_inset Flex Code
385 \begin_layout Plain Layout
391 contains the list of packages that have been recognized by LyX.
392 It is currently unused by the LyX program itself, but the information extracted
393 , and more, is made available with
394 \begin_inset Flex MenuItem
397 \begin_layout Plain Layout
398 Help\SpecialChar \menuseparator
411 \begin_layout Labeling
412 \labelwidthstring 00.00.0000
413 \begin_inset Flex Code
416 \begin_layout Plain Layout
422 the list of text classes that have been found in your
423 \begin_inset Flex Code
426 \begin_layout Plain Layout
432 directories, along with the associated LaTeX document class and their descripti
436 \begin_layout Labeling
437 \labelwidthstring 00.00.0000
438 \begin_inset Flex Code
441 \begin_layout Plain Layout
447 the list of layout modules found in your
448 \begin_inset Flex Code
451 \begin_layout Plain Layout
460 \begin_layout Labeling
461 \labelwidthstring 00.00.0000
462 \begin_inset Flex Code
465 \begin_layout Plain Layout
471 lists of various sorts of LaTeX-related files found on your system
474 \begin_layout Labeling
475 \labelwidthstring 00.00.0000
476 \begin_inset Flex Code
479 \begin_layout Plain Layout
485 is automatically generated during configuration from the file
486 \begin_inset Flex Code
489 \begin_layout Plain Layout
496 It contains information on your LaTeX configuration.
499 \begin_layout Subsection
503 \begin_layout Standard
504 These directories are duplicated between
505 \begin_inset Flex Code
508 \begin_layout Plain Layout
515 \begin_inset Flex Code
518 \begin_layout Plain Layout
525 If a particular files exists in both places, the one in
526 \begin_inset Flex Code
529 \begin_layout Plain Layout
538 \begin_layout Labeling
539 \labelwidthstring 00.00.0000
540 \begin_inset Flex Code
543 \begin_layout Plain Layout
549 this directory contains files with the extension
550 \begin_inset Flex Code
553 \begin_layout Plain Layout
559 that define the keybindings used in LyX.
560 If there exists an internationalized version of the bind file named
561 \begin_inset Flex Code
564 \begin_layout Plain Layout
570 , that will be used first.
573 \begin_layout Labeling
574 \labelwidthstring 00.00.0000
575 \begin_inset Flex Code
578 \begin_layout Plain Layout
584 contains graphics files that can be included in documents.
588 \begin_layout Labeling
589 \labelwidthstring 00.00.0000
590 \begin_inset Flex Code
593 \begin_layout Plain Layout
599 contains LyX documentation files (including the one you are currently reading).
601 \begin_inset Flex Code
604 \begin_layout Plain Layout
610 deserves special attention, as noted above.
611 The internationalized help docs are in subdirectories
612 \begin_inset Flex Code
615 \begin_layout Plain Layout
622 \begin_inset Quotes eld
626 \begin_inset Quotes erd
629 is the ISO language code.
635 \begin_inset CommandInset ref
637 reference "cha:Internationalizing-LyX"
644 \begin_layout Labeling
645 \labelwidthstring 00.00.0000
646 \begin_inset Flex Code
649 \begin_layout Plain Layout
655 contains example files that explain how to use some features.
656 In the file browser, press the
657 \begin_inset Flex MenuItem
660 \begin_layout Plain Layout
669 \begin_layout Labeling
670 \labelwidthstring 00.00.0000
671 \begin_inset Flex Code
674 \begin_layout Plain Layout
680 contains image files that are used by the
681 \begin_inset Flex MenuItem
684 \begin_layout Plain Layout
691 In addition, it also contains the individual icons used in the toolbar
692 and the banners that can be shown when LyX is launched.
695 \begin_layout Labeling
696 \labelwidthstring 00.00.0000
697 \begin_inset Flex Code
700 \begin_layout Plain Layout
706 contains keyboard keymapping files.
712 \begin_inset CommandInset ref
714 reference "sec:International-Keymap-Stuff"
721 \begin_layout Labeling
722 \labelwidthstring 00.00.0000
723 \begin_inset Flex Code
726 \begin_layout Plain Layout
732 contains the text class and module files described in Chapter
737 \begin_inset CommandInset ref
739 reference "cha:Installing-New-Document"
746 \begin_layout Labeling
747 \labelwidthstring 00.00.0000
748 \begin_inset Flex Code
751 \begin_layout Plain Layout
758 \begin_inset Flex Code
761 \begin_layout Plain Layout
767 Python scripts used to convert between LyX versions.
768 These can be run from the command line if, say, you want to batch-convert
772 \begin_layout Labeling
773 \labelwidthstring 00.00.0000
774 \begin_inset Flex Code
777 \begin_layout Plain Layout
783 contains some files that demonstrate the capabilities of the
784 \begin_inset Flex MenuItem
787 \begin_layout Plain Layout
798 Also contains some scripts used by LyX itself.
801 \begin_layout Labeling
802 \labelwidthstring 00.00.0000
803 \begin_inset Flex Code
806 \begin_layout Plain Layout
812 contains the standard LyX template files described in Chapter
817 \begin_inset CommandInset ref
819 reference "sub:Creating-Templates"
826 \begin_layout Labeling
827 \labelwidthstring 00.00.0000
828 \begin_inset Flex Code
831 \begin_layout Plain Layout
837 contains files with the extension
838 \begin_inset Flex Code
841 \begin_layout Plain Layout
847 that define the user interface to LyX.
848 That is, the files define which items appear in which menus and the items
849 appearing on the toolbar.
852 \begin_layout Subsection
853 Files you don't want to modify
856 \begin_layout Standard
857 These files are used internally by LyX and you generally do not need to
858 modify them unless you are a developer.
861 \begin_layout Labeling
862 \labelwidthstring 00.00.0000
863 \begin_inset Flex Code
866 \begin_layout Plain Layout
872 this file contains the list of LyX developers.
873 The contents are displayed with the menu entry
874 \begin_inset Flex MenuItem
877 \begin_layout Plain Layout
878 Help\SpecialChar \menuseparator
891 \begin_layout Labeling
892 \labelwidthstring 00.00.0000
893 \begin_inset Flex Code
896 \begin_layout Plain Layout
902 this is a LaTeX script used during the configuration process.
906 \begin_layout Labeling
907 \labelwidthstring 00.00.0000
908 \begin_inset Flex Code
911 \begin_layout Plain Layout
917 this is the script that is used to re-configure LyX.
918 It creates configuration files in the directory it was run from.
921 \begin_layout Subsection
922 Other files needing a line or two...
925 \begin_layout Labeling
926 \labelwidthstring 00.00.0000
927 \begin_inset Flex Code
930 \begin_layout Plain Layout
936 this contains tables describing how different character encodings can be
940 \begin_layout Labeling
941 \labelwidthstring 00.00.0000
942 \begin_inset Flex Code
945 \begin_layout Plain Layout
951 this file contains the templates available to the new
952 \begin_inset Flex MenuItem
955 \begin_layout Plain Layout
968 \begin_layout Labeling
969 \labelwidthstring 00.00.0000
970 \begin_inset Flex Code
973 \begin_layout Plain Layout
979 this file contains a list of all the languages currently supported by LyX.
982 \begin_layout Section
983 Your local configuration directory
986 \begin_layout Standard
987 Even if you are using LyX as an unprivileged user, you might want to change
988 LyX configuration for your own use.
990 \begin_inset Flex Code
993 \begin_layout Plain Layout
999 directory contains all your personal configuration files.
1000 This is the directory described as
1001 \begin_inset Quotes eld
1005 \begin_inset Quotes erd
1009 \begin_inset Flex MenuItem
1012 \begin_layout Plain Layout
1013 Help\SpecialChar \menuseparator
1015 \begin_inset space ~
1024 This directory is used as a mirror of
1025 \begin_inset Flex Code
1028 \begin_layout Plain Layout
1034 , which means that every file in
1035 \begin_inset Flex Code
1038 \begin_layout Plain Layout
1044 is a replacement for the corresponding file in
1045 \begin_inset Flex Code
1048 \begin_layout Plain Layout
1055 Any configuration file described in the above sections can be placed either
1056 in the system-wide directory, in which case it will affect all users, or
1057 in your local directory for your own use.
1060 \begin_layout Standard
1061 To make things clearer, let's provide a few examples:
1064 \begin_layout Itemize
1065 The preferences set in the
1066 \begin_inset Flex MenuItem
1069 \begin_layout Plain Layout
1070 Tools\SpecialChar \menuseparator
1076 dialog are saved to a file
1077 \begin_inset Flex Code
1080 \begin_layout Plain Layout
1087 \begin_inset Flex Code
1090 \begin_layout Plain Layout
1099 \begin_layout Itemize
1100 When you reconfigure using
1101 \begin_inset Flex MenuItem
1104 \begin_layout Plain Layout
1105 Tools\SpecialChar \menuseparator
1112 \begin_inset Flex Code
1115 \begin_layout Plain Layout
1121 script, and the resulting files are written in your local configuration
1123 This means that any additional text class file that you might have added
1125 \begin_inset Flex Code
1128 \begin_layout Plain Layout
1134 will be added to the list of classes in the
1135 \begin_inset Flex MenuItem
1138 \begin_layout Plain Layout
1139 Document\SpecialChar \menuseparator
1148 \begin_layout Itemize
1149 If you get some updated documentation from LyX ftp site and cannot install
1150 it because you do not have sysadmin rights on your system, you can just
1152 \begin_inset Flex Code
1155 \begin_layout Plain Layout
1161 and the items in the
1162 \begin_inset Flex MenuItem
1165 \begin_layout Plain Layout
1171 menu will open them!
1174 \begin_layout Section
1175 Running LyX with multiple configurations
1178 \begin_layout Standard
1179 The configuration freedom of the local configuration directory may not suffice
1180 if you want to have more than one configuration at your disposal.
1181 For example, you may want to be use different key bindings or printer settings
1183 You can achieve this by having several such directories.
1184 You then specify which directory to use at run-time.
1187 \begin_layout Standard
1188 Invoking LyX with the command line switch
1189 \begin_inset Flex Code
1192 \begin_layout Plain Layout
1202 instructs the program to read the configuration from that directory, and
1203 not from the default directory.
1204 (You can determine the default directory by running LyX without the
1205 \begin_inset Flex Code
1208 \begin_layout Plain Layout
1214 switch.) If the specified directory does not exist, LyX offers to create
1215 it for you, just like it does for the default directory on the first time
1216 you run the program.
1217 You can modify the configuration options in this additional user directory
1218 exactly as you would for the default directory.
1219 These directories are completely independent (but read on).
1220 Note that setting the environment variable
1221 \begin_inset Flex Code
1224 \begin_layout Plain Layout
1230 to some value has exactly the same effect.
1233 \begin_layout Standard
1234 Having several configurations also requires more maintenance: if you want
1235 to add a new layout to
1236 \begin_inset Flex Code
1239 \begin_layout Plain Layout
1245 which you want available from all your configurations, you must add it
1246 to each directory separately.
1247 You can avoid this with the following trick: after LyX creates the additional
1248 directory, most of the subdirectories (see above) are empty.
1249 If you want the new configuration to mirror an existing one, replace the
1250 empty subdirectory with a symbolic link to the matching subdirectory in
1251 the existing configuration.
1253 \begin_inset Flex Code
1256 \begin_layout Plain Layout
1262 subdirectory, however, since it contains a file written by the configuration
1263 script (also accessible through
1264 \begin_inset Flex MenuItem
1267 \begin_layout Plain Layout
1268 Tools\SpecialChar \menuseparator
1274 ) which is configuration-specific.
1277 \begin_layout Chapter
1278 The Preferences dialog
1281 \begin_layout Standard
1282 All options of the preferences dialog are described in the Appendix
1284 The Preferences Dialog
1291 For some options you might find here more details.
1294 \begin_layout Section
1296 \begin_inset CommandInset label
1305 \begin_layout Standard
1306 The first step is to define your file formats if they are not already defined.
1308 \begin_inset Flex MenuItem
1311 \begin_layout Plain Layout
1312 Tools\SpecialChar \menuseparator
1320 \begin_inset Flex MenuItem
1323 \begin_layout Plain Layout
1324 File Handling\SpecialChar \menuseparator
1331 \begin_inset Flex MenuItem
1334 \begin_layout Plain Layout
1335 New\SpecialChar \ldots{}
1341 button to define your new format.
1343 \begin_inset Flex MenuItem
1346 \begin_layout Plain Layout
1352 field contains the name used to identify the format in the GUI.
1354 \begin_inset Flex MenuItem
1357 \begin_layout Plain Layout
1363 is used to identify the format internally.
1364 You will also need to enter a file extension.
1365 These are all required.
1367 \begin_inset Flex MenuItem
1370 \begin_layout Plain Layout
1376 field is used to provide a keyboard shortcut on the menus.
1377 (For example, pressing
1378 \begin_inset Flex MenuItem
1381 \begin_layout Plain Layout
1388 \begin_inset Flex MenuItem
1391 \begin_layout Plain Layout
1392 View\SpecialChar \menuseparator
1393 View (Other Formats)\SpecialChar \menuseparator
1402 \begin_layout Standard
1404 \begin_inset Flex MenuItem
1407 \begin_layout Plain Layout
1414 \begin_inset Flex MenuItem
1417 \begin_layout Plain Layout
1424 For example, you might want to use
1425 \begin_inset Flex MenuItem
1428 \begin_layout Plain Layout
1434 to view PostScript files.
1435 You can enter the command needed to start the program in the corresponding
1437 In defining this command, you can use the four variables listed in the
1439 The viewer is launched when you view an image in LyX or use the
1440 \begin_inset Flex MenuItem
1443 \begin_layout Plain Layout
1450 The editor is for example launched when you right-click on an image and
1452 \begin_inset Flex MenuItem
1455 \begin_layout Plain Layout
1461 in the appearing context menu.
1464 \begin_layout Standard
1466 \begin_inset Flex MenuItem
1469 \begin_layout Plain Layout
1475 option tells LyX that a format is suitable for document export.
1476 If this is set and if a suitable conversion route exists (see sec.
1477 \begin_inset space \thinspace{}
1481 \begin_inset CommandInset ref
1483 reference "sec:Converters"
1487 ), the format will appear in the
1488 \begin_inset Flex MenuItem
1491 \begin_layout Plain Layout
1492 File\SpecialChar \menuseparator
1499 The format will also appear in the
1500 \begin_inset Flex MenuItem
1503 \begin_layout Plain Layout
1509 menu if a viewer is specified for the format.
1510 Pure image formats, such as
1511 \begin_inset Flex Code
1514 \begin_layout Plain Layout
1520 , should not use this option.
1521 Formats that can both represent vector graphics and documents like
1522 \begin_inset Flex Code
1525 \begin_layout Plain Layout
1534 \begin_layout Standard
1536 \begin_inset Flex MenuItem
1539 \begin_layout Plain Layout
1540 Vector graphics format
1545 tells LyX that a format can contain vector graphics.
1546 This information is used to determine the target format of included graphics
1548 \begin_inset Flex MenuItem
1551 \begin_layout Plain Layout
1558 Included graphics may need to be converted to either
1559 \begin_inset Flex MenuItem
1562 \begin_layout Plain Layout
1569 \begin_inset Flex MenuItem
1572 \begin_layout Plain Layout
1579 \begin_inset Flex MenuItem
1582 \begin_layout Plain Layout
1589 \begin_inset Flex MenuItem
1592 \begin_layout Plain Layout
1598 cannot handle other image formats.
1599 If an included graphic is not already in
1600 \begin_inset Flex MenuItem
1603 \begin_layout Plain Layout
1610 \begin_inset Flex MenuItem
1613 \begin_layout Plain Layout
1620 \begin_inset Flex MenuItem
1623 \begin_layout Plain Layout
1629 format, it is converted to
1630 \begin_inset Flex MenuItem
1633 \begin_layout Plain Layout
1639 if the vector format option is set, and otherwise to
1640 \begin_inset Flex MenuItem
1643 \begin_layout Plain Layout
1652 \begin_layout Section
1656 \begin_layout Standard
1657 Since all conversions from one format to another take place in LyX's temporary
1658 directory, it is sometimes necessary to modify a file before copying it
1659 to the temporary directory in order that the conversion may be performed.
1663 \begin_layout Plain Layout
1664 For example, the file may refer to other files—images, for example—using
1665 relative file names, and these may become invalid when the file is copied
1666 to the temporary directory.
1671 This is done by a Copier: It copies a file to (or from) the temporary directory
1672 and may modify it in the process.
1675 \begin_layout Standard
1676 The definitions of the copiers may use four variables:
1679 \begin_layout Labeling
1680 \labelwidthstring 00.00.0000
1681 \begin_inset Flex Code
1684 \begin_layout Plain Layout
1690 The LyX system directory (e.
1691 \begin_inset space \thinspace{}
1695 \begin_inset space \space{}
1699 \begin_inset Flex MenuItem
1702 \begin_layout Plain Layout
1711 \begin_layout Labeling
1712 \labelwidthstring 00.00.0000
1713 \begin_inset Flex Code
1716 \begin_layout Plain Layout
1725 \begin_layout Labeling
1726 \labelwidthstring 00.00.0000
1727 \begin_inset Flex Code
1730 \begin_layout Plain Layout
1739 \begin_layout Labeling
1740 \labelwidthstring 00.00.0000
1741 \begin_inset Flex Code
1744 \begin_layout Plain Layout
1753 \begin_layout Standard
1754 The latter should be the filename as it would be used in a LaTeX's
1761 It is relevant only when exporting files suitable for such inclusion.
1764 \begin_layout Standard
1765 Copiers can be used to do almost anything with output files.
1766 For example, suppose you want generated pdf files to be copied to a special
1768 \begin_inset Flex Code
1771 \begin_layout Plain Layout
1778 Then you could write a shell script such as this one:
1781 \begin_layout Standard
1782 \begin_inset listings
1786 \begin_layout Plain Layout
1791 \begin_layout Plain Layout
1796 \begin_layout Plain Layout
1798 TOFILE=`basename $2`
1801 \begin_layout Plain Layout
1803 cp $FROMFILE /home/you/pdf/$TOFILE
1808 Save it in your local LyX directory—say,
1809 \begin_inset Flex Code
1812 \begin_layout Plain Layout
1813 /home/you/.lyx/scripts/pdfcopier.sh
1818 —and make it executable, if you need to do so on your platform.
1820 \begin_inset Flex MenuItem
1823 \begin_layout Plain Layout
1824 Tools\SpecialChar \menuseparator
1830 dialog, select under
1831 \begin_inset Flex MenuItem
1834 \begin_layout Plain Layout
1835 File Handling\SpecialChar \menuseparator
1842 \begin_inset Flex MenuItem
1845 \begin_layout Plain Layout
1851 format—or one of the other pdf formats—and enter
1852 \begin_inset Flex Code
1855 \begin_layout Plain Layout
1856 pdfcopier.sh $$i $$o
1862 \begin_inset Flex MenuItem
1865 \begin_layout Plain Layout
1875 \begin_layout Standard
1876 Copiers are used by LyX in various of its own conversions.
1877 For example, if appropriate programs are found, LyX will automatically
1878 install copiers for the
1879 \begin_inset Flex MenuItem
1882 \begin_layout Plain Layout
1889 \begin_inset Flex MenuItem
1892 \begin_layout Plain Layout
1894 \begin_inset space ~
1903 When these formats are exported, the copier sees that not just the main
1904 HTML file but various associated files (style files, images, etc.) are also
1906 All these files are written to a subdirectory of the directory in which
1907 the original LyX file was found.
1911 \begin_layout Plain Layout
1912 This copier can be customized.
1914 \begin_inset Quotes eld
1918 \begin_inset Quotes erd
1921 argument takes a comma-separated list of extensions to be copied; if it
1922 is omitted, all files will be copied.
1924 \begin_inset Quotes eld
1928 \begin_inset Quotes erd
1931 argument determines the extension added to the generated directory.
1933 \begin_inset Quotes eld
1937 \begin_inset Flex MenuItem
1940 \begin_layout Plain Layout
1947 \begin_inset Quotes erd
1950 , so HTML generated from
1951 \begin_inset Flex MenuItem
1954 \begin_layout Plain Layout
1955 /path/to/filename.lyx
1961 \begin_inset Flex MenuItem
1964 \begin_layout Plain Layout
1965 /path/to/filename.html.LyXconv
1979 \begin_layout Section
1981 \begin_inset CommandInset label
1983 name "sec:Converters"
1990 \begin_layout Standard
1991 You can define your own Converters to convert files between different formats.
1993 \begin_inset Flex MenuItem
1996 \begin_layout Plain Layout
1997 Tools\SpecialChar \menuseparator
1998 Preferences\SpecialChar \menuseparator
1999 File Handling\SpecialChar \menuseparator
2008 \begin_layout Standard
2009 To define a new converter, select the
2010 \begin_inset Flex MenuItem
2013 \begin_layout Plain Layout
2015 \begin_inset space ~
2024 \begin_inset Flex MenuItem
2027 \begin_layout Plain Layout
2029 \begin_inset space ~
2037 from the drop-down lists, enter the command needed for the conversion,
2039 \begin_inset Flex MenuItem
2042 \begin_layout Plain Layout
2049 Several variables can be used in the definition of converters:
2052 \begin_layout Labeling
2053 \labelwidthstring 00.00.0000
2054 \begin_inset Flex Code
2057 \begin_layout Plain Layout
2063 The LyX system directory
2066 \begin_layout Labeling
2067 \labelwidthstring 00.00.0000
2068 \begin_inset Flex Code
2071 \begin_layout Plain Layout
2080 \begin_layout Labeling
2081 \labelwidthstring 00.00.0000
2082 \begin_inset Flex Code
2085 \begin_layout Plain Layout
2094 \begin_layout Labeling
2095 \labelwidthstring 00.00.0000
2096 \begin_inset Flex Code
2099 \begin_layout Plain Layout
2105 The base filename of the input file (i.
2106 \begin_inset space \thinspace{}
2109 g., without the extension)
2112 \begin_layout Labeling
2113 \labelwidthstring 00.00.0000
2114 \begin_inset Flex Code
2117 \begin_layout Plain Layout
2123 The path to the input file
2126 \begin_layout Labeling
2127 \labelwidthstring 00.00.0000
2128 \begin_inset Flex Code
2131 \begin_layout Plain Layout
2137 The path to the original input file (this is different from $$p when a
2138 chain of converters is called)
2141 \begin_layout Labeling
2142 \labelwidthstring 00.00.0000
2143 \begin_inset Flex Code
2146 \begin_layout Plain Layout
2152 The iconv name for the encoding of the document.
2155 \begin_layout Standard
2157 \begin_inset Flex MenuItem
2160 \begin_layout Plain Layout
2162 \begin_inset space ~
2170 field you can enter the following flags, separated by commas:
2173 \begin_layout Labeling
2174 \labelwidthstring 00.00.0000
2175 \begin_inset Flex Code
2178 \begin_layout Plain Layout
2184 This converter runs some form of LaTeX.
2185 This will make LyX's LaTeX error logs available.
2188 \begin_layout Labeling
2189 \labelwidthstring 00.00.0000
2190 \begin_inset Flex Code
2193 \begin_layout Plain Layout
2200 \begin_inset Flex MenuItem
2203 \begin_layout Plain Layout
2209 file for the conversion.
2212 \begin_layout Labeling
2213 \labelwidthstring 00.00.0000
2214 \begin_inset Flex Code
2217 \begin_layout Plain Layout
2226 \begin_layout Standard
2227 The following three flags are not really flags at all because they take
2229 \begin_inset Flex MenuItem
2232 \begin_layout Plain Layout
2234 \begin_inset space ~
2238 \begin_inset space ~
2249 \begin_layout Labeling
2250 \labelwidthstring 00.00.0000
2251 \begin_inset Flex Code
2254 \begin_layout Plain Layout
2260 If set, the converter's standard error will be redirected to a file
2261 \begin_inset Flex Code
2264 \begin_layout Plain Layout
2270 , and the script given as argument will be run as:
2271 \begin_inset Flex Code
2274 \begin_layout Plain Layout
2275 script < infile.out > infile.log
2281 The argument may contain
2282 \begin_inset Flex Code
2285 \begin_layout Plain Layout
2294 \begin_layout Labeling
2295 \labelwidthstring 00.00.0000
2296 \begin_inset Flex Code
2299 \begin_layout Plain Layout
2305 The name of the directory in which the converter will dump the generated
2307 LyX will not create this directory, and it does not copy anything into
2308 it, though it will copy this directory to the destination.
2309 The argument may contain
2310 \begin_inset Flex Code
2313 \begin_layout Plain Layout
2319 , which will be replaced by the base name of the input and output files,
2320 respectively, when the directory is copied.
2321 \begin_inset Newline newline
2324 Note that resultdir and usetempdir make no sense together.
2325 The latter will be ignored if the former is given.
2328 \begin_layout Labeling
2329 \labelwidthstring 00.00.0000
2330 \begin_inset Flex Code
2333 \begin_layout Plain Layout
2339 Determines the output file name and may, contain
2340 \begin_inset Flex Code
2343 \begin_layout Plain Layout
2350 Sensible only with resultdir and optional even then; if not given, it defaults
2354 \begin_layout Standard
2355 None of these last three are presently used in any of the converters that
2356 are installed with LyX.
2360 \begin_layout Standard
2361 You do not have to define converters for all formats between which you want
2363 For example, you will note that there is no `LyX to PostScript' converter,
2364 but LyX will export PostScript.
2365 It does so by first creating a LaTeX file (no converter needs to be defined
2366 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2367 and finally converting the resulting DVI file to PostScript.
2368 LyX finds such `chains' of converters automatically, and it will always
2369 choose the shortest possible chain.
2370 You can, though, still define multiple conversion methods between file
2372 For example, the standard LyX configuration provides three ways to convert
2373 LaTeX to PDF: Directly, using
2374 \begin_inset Flex MenuItem
2377 \begin_layout Plain Layout
2383 ; via (DVI and) PostScript, using
2384 \begin_inset Flex MenuItem
2387 \begin_layout Plain Layout
2394 \begin_inset Flex MenuItem
2397 \begin_layout Plain Layout
2404 To define such alternate chains, you must define multiple target `file
2405 formats', as described in section
2406 \begin_inset CommandInset ref
2408 reference "sec:Formats"
2413 For example, in the standard configuration, the formats named
2414 \begin_inset Flex MenuItem
2417 \begin_layout Plain Layout
2424 \begin_inset Flex MenuItem
2427 \begin_layout Plain Layout
2434 \begin_inset Flex MenuItem
2437 \begin_layout Plain Layout
2443 are defined, all of which share the extension
2444 \begin_inset Flex MenuItem
2447 \begin_layout Plain Layout
2453 , and which correspond to the conversion methods just mentioned.
2456 \begin_layout Chapter
2457 Internationalizing LyX
2458 \begin_inset CommandInset label
2460 name "cha:Internationalizing-LyX"
2467 \begin_layout Standard
2468 LyX supports using a translated interface.
2469 Last time we checked, LyX provided text in thirty languages.
2470 The language of choice is called your
2475 (For further reading on locale settings, see also the documentation for
2476 locale that comes with your operating system.
2477 For Linux, the manual page for
2478 \begin_inset Flex Code
2481 \begin_layout Plain Layout
2487 could be a good place to start).
2490 \begin_layout Standard
2491 Notice that these translations will work, but do contain a few flaws.
2492 In particular, all dialogs have been designed with the English text in
2493 mind, which means that some of the translated text will be too large to
2494 fit within the space allocated.
2495 This is only a display problem and will not cause any harm.
2496 Also, you will find that some of the translations do not define shortcut
2497 keys for everything.
2498 Sometimes, there are simply not enough free letters to do it.
2499 Other times, the translator just hasn't got around to doing it yet.
2500 Our localization team, which you may wish to join,
2504 \begin_layout Plain Layout
2505 If you are a fluent speaker of a language other than English, joining these
2506 teams is a great way to give back to the LyX community!
2511 will of course try to fix these shortcomings in future versions of LyX.
2514 \begin_layout Section
2518 \begin_layout Subsection
2519 Translating the graphical user interface (text messages).
2522 \begin_layout Standard
2524 \begin_inset Flex Code
2527 \begin_layout Plain Layout
2533 library to handle the internationalization of the interface.
2534 To have LyX speak your favorite language in all menus and dialogs, you
2536 \begin_inset Flex Code
2539 \begin_layout Plain Layout
2545 -file for that language.
2546 When this is available, you'll have to generate a
2547 \begin_inset Flex Code
2550 \begin_layout Plain Layout
2556 -file from it and install the
2557 \begin_inset Flex Code
2560 \begin_layout Plain Layout
2567 The process of doing all of this is explained in the documentation for
2569 \begin_inset Flex Code
2572 \begin_layout Plain Layout
2579 It is possible to do this just for yourself, but if you're going to do
2580 it, you might as well share the results of your labors with the rest of
2582 Send a message to the LyX developers' list for more information about how
2586 \begin_layout Standard
2587 In short, this is what you should do (xx denotes the language code):
2590 \begin_layout Itemize
2591 Check out the LyX source code.
2593 \begin_inset CommandInset href
2595 name "information on the web"
2596 target "http://www.lyx.org/HowToUseSVN"
2603 \begin_layout Itemize
2605 \begin_inset Flex Code
2608 \begin_layout Plain Layout
2614 to the folder of the
2615 \begin_inset Flex Code
2618 \begin_layout Plain Layout
2626 \begin_inset Flex Code
2629 \begin_layout Plain Layout
2637 \begin_inset Flex Code
2640 \begin_layout Plain Layout
2646 doesn't exist anywhere, it can be remade with the console command
2647 \begin_inset Flex Code
2650 \begin_layout Plain Layout
2656 in that directory, or you can use an existing po-file for some other language
2660 \begin_layout Itemize
2662 \begin_inset Flex Code
2665 \begin_layout Plain Layout
2675 \begin_layout Plain Layout
2676 This is just a text file, so it can be edited in any text editor.
2677 But there are also specialized programs that support such editing, such
2682 (for all platforms) or
2691 contains a `mode' for editing
2692 \begin_inset Flex Code
2695 \begin_layout Plain Layout
2706 For some menu- and widget-labels, there are also shortcut keys that should
2708 Those keys are marked after a `|', and should be translated according to
2709 the words and phrases of the language.
2710 You should also fill also out the information at the beginning of the new
2712 \begin_inset Flex Code
2715 \begin_layout Plain Layout
2721 -file with your email-address, etc., so people know where to reach you with
2722 suggestions and entertaining flames.
2725 \begin_layout Standard
2726 If you are just doing this on your own, then:
2729 \begin_layout Itemize
2731 \begin_inset Flex Code
2734 \begin_layout Plain Layout
2741 This can be done with
2742 \begin_inset Flex Code
2745 \begin_layout Plain Layout
2746 msgfmt -o xx.mo < xx.po
2754 \begin_layout Itemize
2756 \begin_inset Flex Code
2759 \begin_layout Plain Layout
2765 -file to your locale-tree, at the correct directory for application messages
2770 xx, and under the name
2771 \begin_inset Flex Code
2774 \begin_layout Plain Layout
2781 \begin_inset space \thinspace{}
2785 \begin_inset space \space{}
2789 \begin_inset Flex Code
2792 \begin_layout Plain Layout
2793 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2803 \begin_layout Standard
2804 As said, however, it would be best if the new
2805 \begin_inset Flex Code
2808 \begin_layout Plain Layout
2814 -file could be added to the LyX distribution, so others can use it.
2815 Adding it involves making additional changes to LyX.
2816 So send an email to the developers' mailing list if you're interested in
2820 \begin_layout Subsubsection
2824 \begin_layout Standard
2825 Sometimes it turns out that one English message needs to be translated into
2826 different messages in the target language.
2827 One example is the message
2828 \begin_inset Flex Code
2831 \begin_layout Plain Layout
2837 which has the German translation
2845 , depending upon exactly what the English
2846 \begin_inset Quotes eld
2850 \begin_inset Quotes erd
2855 \begin_inset Flex Code
2858 \begin_layout Plain Layout
2864 does not handle such ambiguous translations.
2865 Therefore you have to add some context information to the message: Instead
2867 \begin_inset Flex Code
2870 \begin_layout Plain Layout
2877 \begin_inset Flex Code
2880 \begin_layout Plain Layout
2881 To[[as in 'From format x to format y']]
2887 \begin_inset Flex Code
2890 \begin_layout Plain Layout
2891 To[[as in 'From page x to page y']].
2896 Now the two occurrences of
2897 \begin_inset Flex Code
2900 \begin_layout Plain Layout
2907 \begin_inset Flex Code
2910 \begin_layout Plain Layout
2916 and can be translated correctly to
2927 \begin_layout Standard
2928 Of course the context information needs to be stripped off the original
2929 message when no translation is used.
2930 Therefore you have to put it in double square brackets at the end of the
2931 message (see the example above).
2932 The translation mechanism of LyX ensures that everything in double square
2933 brackets at the end of messages is removed before displaying the message.
2936 \begin_layout Subsection
2937 Translating the documentation.
2940 \begin_layout Standard
2941 The online documentation (in the
2942 \begin_inset Flex MenuItem
2945 \begin_layout Plain Layout
2951 -menu) can (and should!) be translated.
2952 If there are translated versions of the documentation available
2956 \begin_layout Plain Layout
2957 As of March 2008, at least some of the documents have been translated into
2958 fourteen languages, with the Tutorial available in a few more.
2963 and the locale is set accordingly, these will be used automagically by
2965 LyX looks for translated versions as
2966 \begin_inset Flex Code
2969 \begin_layout Plain Layout
2970 LyXDir/doc/xx/DocName.lyx
2976 \begin_inset Flex Code
2979 \begin_layout Plain Layout
2985 is the code for the language currently in use.
2986 If there are no translated documents, the default English versions will
2988 Note that the translated versions must have the same filenames (
2989 \begin_inset Flex Code
2992 \begin_layout Plain Layout
2998 above) as the original.
2999 If you feel up to translating the documentation (an excellent way to proof-read
3000 the original documentation by the way!), there are a few things you should
3004 \begin_layout Itemize
3005 Check out the documentation translation web page at
3006 \begin_inset CommandInset href
3008 name "http://www.lyx.org/Translation"
3009 target "http://www.lyx.org/Translation"
3014 That way, you can find out which (if any) documents have already been translate
3015 d into your language.
3016 You can also find out who (if anyone) is organizing the effort to translate
3017 the documentation into your language.
3018 If no one is organizing the effort, please let us know that you're interested.
3021 \begin_layout Standard
3022 Once you get to actually translating, here's a few hints for you that may
3026 \begin_layout Itemize
3027 Join the documentation team! There is information on how to do that in
3028 \begin_inset Flex Code
3031 \begin_layout Plain Layout
3038 \begin_inset Flex MenuItem
3041 \begin_layout Plain Layout
3042 Help\SpecialChar \menuseparator
3048 ), which by the way is the first document you should translate.
3051 \begin_layout Itemize
3052 Learn the typographic conventions for the language you are translating to.
3053 Typography is an ancient art and over the centuries, a great variety of
3054 conventions have developed throughout different parts of the world.
3055 Also study the professional terminology amongst typographers in your country.
3056 Inventing your own terminology will only confuse the users.
3059 (Warning! Typography is addictive!)
3062 \begin_layout Itemize
3063 Make a copy of the document.
3064 This will be your working copy.
3065 You can use this as your personal translated help-file by placing it in
3067 \begin_inset Flex Code
3070 \begin_layout Plain Layout
3079 \begin_layout Itemize
3080 Sometimes the original document (from the LyX-team) will be updated.
3081 Use the source viewer at
3082 \begin_inset CommandInset href
3084 name "http://www.lyx.org/trac/timeline"
3085 target "http://www.lyx.org/trac/timeline"
3089 to see what has been changed.
3090 That way you can easily see which parts of the translated document need
3094 \begin_layout Standard
3095 If you ever find an error in the original document, fix it and notify the
3096 rest of the documentation team of the changes! (You didn't forget to join
3097 the documentation team, did you?)
3100 \begin_layout Standard
3101 \begin_inset Branch OutDated
3104 \begin_layout Section
3105 International Keyboard Support
3108 \begin_layout Standard
3111 [Editor's Note: The following section is by
3119 It needs to be fixed to conform to the new Documentation Style sheet and
3120 to make use of the new v1.0 features.
3121 The whole thing also needs to be merged with the section following it.-jw
3122 It may also be badly out of date.-rh (2008)]
3125 \begin_layout Subsection
3126 Defining Own Keymaps: Keymap File Format
3129 \begin_layout Standard
3130 Let's look at a keyboard definition file a little closer.
3131 It is a plain text file defining
3134 \begin_layout Itemize
3135 key-to-key or key-to-string translations
3138 \begin_layout Itemize
3142 \begin_layout Itemize
3143 dead keys exceptions
3146 \begin_layout Standard
3147 To define key-to-key or key-to-string translation, use this command:
3150 \begin_layout Quotation
3151 \begin_inset Flex Code
3154 \begin_layout Plain Layout
3163 \begin_inset Flex Code
3166 \begin_layout Plain Layout
3175 \begin_layout Standard
3177 \begin_inset Flex Code
3180 \begin_layout Plain Layout
3186 is the key to be translated and
3187 \begin_inset Flex Code
3190 \begin_layout Plain Layout
3196 is the string to be inserted into the document.
3197 To define dead keys, use:
3200 \begin_layout Quotation
3201 \begin_inset Flex Code
3204 \begin_layout Plain Layout
3213 \begin_inset Flex Code
3216 \begin_layout Plain Layout
3225 \begin_layout Standard
3227 \begin_inset Flex Code
3230 \begin_layout Plain Layout
3236 is a keyboard key and
3237 \begin_inset Flex Code
3240 \begin_layout Plain Layout
3247 The following dead keys are supported (shortcut name is in parentheses):
3250 \begin_layout Quotation
3254 \begin_inset space \hfill{}
3260 \begin_layout Quotation
3262 \begin_inset space \hfill{}
3268 \begin_layout Quotation
3270 \begin_inset space \hfill{}
3276 \begin_layout Quotation
3278 \begin_inset space \hfill{}
3284 \begin_layout Quotation
3286 \begin_inset space \hfill{}
3292 \begin_layout Quotation
3294 \begin_inset space \hfill{}
3301 \begin_layout Plain Layout
3313 \begin_layout Quotation
3315 \begin_inset space \hfill{}
3321 \begin_layout Quotation
3323 \begin_inset space \hfill{}
3330 \begin_layout Plain Layout
3342 \begin_layout Quotation
3344 \begin_inset space \hfill{}
3350 \begin_layout Quotation
3352 \begin_inset space \hfill{}
3358 \begin_layout Quotation
3360 \begin_inset space \hfill{}
3367 \begin_layout Plain Layout
3379 \begin_layout Quotation
3381 \begin_inset space \hfill{}
3388 \begin_layout Plain Layout
3400 \begin_layout Quotation
3402 \begin_inset space \hfill{}
3408 \begin_layout Quotation
3409 hungarian umlaut (hug)
3410 \begin_inset space \hfill{}
3416 \begin_layout Quotation
3418 \begin_inset space \hfill{}
3424 \begin_layout Quotation
3426 \begin_inset space \hfill{}
3433 \begin_layout Plain Layout
3445 \begin_layout Standard
3446 Since in many international keyboards there are exceptions to what some
3447 dead keys should do, you can define them using
3450 \begin_layout Quotation
3451 \begin_inset Flex Code
3454 \begin_layout Plain Layout
3462 deadkey key outstring
3465 \begin_layout Standard
3466 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3470 \begin_layout Quotation
3471 \begin_inset Flex Code
3474 \begin_layout Plain Layout
3487 \begin_layout Standard
3488 to make it work correctly.
3489 Also, you have to define as exceptions dead keys over i and j, to remove
3490 the dot from them before inserting an accent mark.
3491 I will change this when the time comes, but so far I haven't had time.
3494 \begin_layout Standard
3495 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3498 \begin_inset Flex Code
3501 \begin_layout Plain Layout
3507 have different meaning.
3509 \begin_inset Flex Code
3512 \begin_layout Plain Layout
3518 marks comments, quotes start and end LaTeX-style commands.
3519 To enter quote, you'll need to use
3520 \begin_inset Flex Code
3523 \begin_layout Plain Layout
3532 \begin_inset Flex Code
3535 \begin_layout Plain Layout
3542 \begin_inset Flex Code
3545 \begin_layout Plain Layout
3556 \begin_layout Standard
3557 If you make a keyboard description file that works for your language, please
3558 mail it to me, so I can include it in the next keymap distribution.
3561 \begin_layout Standard
3562 More keywords will be supported in keymap configuration file in future,
3566 \begin_layout Itemize
3567 \begin_inset Flex Code
3570 \begin_layout Plain Layout
3581 \begin_inset space \hfill{}
3585 \begin_inset Flex Code
3588 \begin_layout Plain Layout
3597 \begin_layout Itemize
3598 \begin_inset Flex Code
3601 \begin_layout Plain Layout
3612 \begin_inset space \hfill{}
3616 \begin_inset Flex Code
3619 \begin_layout Plain Layout
3625 an external keymap translation program
3628 \begin_layout Standard
3629 Also, it should look into
3630 \begin_inset Flex Code
3633 \begin_layout Plain Layout
3639 file for defaults, too (for example, a
3640 \begin_inset Flex Code
3643 \begin_layout Plain Layout
3651 option to include default keyboard).
3659 \begin_layout Section
3660 International Keymap Stuff
3661 \begin_inset CommandInset label
3663 name "sec:International-Keymap-Stuff"
3670 \begin_layout Standard
3671 \begin_inset Note Note
3674 \begin_layout Plain Layout
3675 In doing the revisions on this document in March 2008, I did not look over
3676 this stuff, as I do not understand it.
3677 It would be good if someone else could do so.
3686 \begin_layout Standard
3687 The next two sections describe the
3688 \begin_inset Flex Code
3691 \begin_layout Plain Layout
3700 \begin_inset Flex Code
3703 \begin_layout Plain Layout
3711 file syntax in detail.
3712 These sections should help you design your own key map if the ones provided
3713 do not meet your needs.
3716 \begin_layout Subsection
3720 \begin_layout Standard
3724 \begin_inset Flex Code
3727 \begin_layout Plain Layout
3733 file maps keystrokes to characters or strings.
3734 As the name suggests, it sets a keyboard mapping.
3736 \begin_inset Flex Code
3739 \begin_layout Plain Layout
3750 \begin_inset Flex Code
3753 \begin_layout Plain Layout
3768 \begin_inset Flex Code
3771 \begin_layout Plain Layout
3784 \begin_inset Flex Code
3787 \begin_layout Plain Layout
3796 \begin_inset Flex Code
3799 \begin_layout Plain Layout
3807 are described in this section.
3810 \begin_layout Labeling
3811 \labelwidthstring 00.00.0000
3812 \begin_inset Flex Code
3815 \begin_layout Plain Layout
3823 Map a character to a string
3826 \begin_layout LyX-Code
3841 \begin_layout Standard
3874 the double-quote (")
3891 must be escaped with a preceding backslash (
3902 \begin_layout Standard
3904 \begin_inset Flex MenuItem
3907 \begin_layout Plain Layout
3915 statement to cause the symbol
3916 \begin_inset Flex MenuItem
3919 \begin_layout Plain Layout
3927 to be output for the keystroke
3928 \begin_inset Flex MenuItem
3931 \begin_layout Plain Layout
3942 \begin_layout LyX-Code
3948 \begin_layout Labeling
3949 \labelwidthstring 00.00.0000
3950 \begin_inset Flex Code
3953 \begin_layout Plain Layout
3961 Specify an accent character
3964 \begin_layout LyX-Code
3973 \begin_layout Standard
3974 This will make the cha
4012 This is the dead key
4016 \begin_layout Plain Layout
4023 refers to a key that does not produce a character by itself, but when followed
4024 with another key, produces the desired accent character.
4025 For example, a German characte
4027 r with an umlaut like
4037 can be produced in this manner.
4046 \begin_layout Standard
4059 and then another key not in
4076 followed by the other, not allowed key, as output.
4080 \begin_inset Flex MenuItem
4083 \begin_layout Plain Layout
4091 cancels a dead key, so if
4102 \begin_inset Flex MenuItem
4105 \begin_layout Plain Layout
4114 , the cursor will not go one position backwards but will instead cancel
4130 might have had on the next keystroke.
4134 \begin_layout Standard
4135 The following example specifies that the character ' is to be an acute accent,
4136 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4139 \begin_layout LyX-Code
4142 kmod ' acute aeiouAEIOU
4145 \begin_layout Labeling
4146 \labelwidthstring 00.00.0000
4147 \begin_inset Flex Code
4150 \begin_layout Plain Layout
4156 Specify an exception to the accent character
4159 \begin_layout LyX-Code
4168 \begin_layout Standard
4169 This defines an exce
4210 have been assigned a keystroke with a previous
4213 \begin_inset Flex Code
4216 \begin_layout Plain Layout
4240 must not belong in the
4287 If such a declaration does not exist in
4295 \begin_inset Flex Code
4298 \begin_layout Plain Layout
4332 \begin_inset Flex Code
4335 \begin_layout Plain Layout
4349 \begin_layout Standard
4350 The following command produces causes äi to be produced when you enter acute-i
4354 \begin_layout LyX-Code
4368 \begin_layout Labeling
4369 \labelwidthstring 00.00.0000
4370 \begin_inset Flex Code
4373 \begin_layout Plain Layout
4379 Combine two accent characters
4382 \begin_layout LyX-Code
4388 accent1 accent2 allowed
4391 \begin_layout Standard
4392 This one is getting pretty esoteric.
4393 It allows you to combine the effect
4449 \begin_inset Flex Code
4452 \begin_layout Plain Layout
4480 \begin_layout Standard
4481 Consider this example from the
4482 \begin_inset Flex Code
4485 \begin_layout Plain Layout
4496 \begin_layout LyX-Code
4499 kmod ; acute aeioyvhAEIOYVH
4503 kcomb acute umlaut iyIY
4506 \begin_layout Standard
4507 This allows you to press
4508 \begin_inset Flex MenuItem
4511 \begin_layout Plain Layout
4519 and get the effect of
4520 \begin_inset Flex Code
4523 \begin_layout Plain Layout
4542 in this case cancels the last dead key, so if you press
4543 \begin_inset Flex MenuItem
4546 \begin_layout Plain Layout
4555 \begin_inset Flex Code
4558 \begin_layout Plain Layout
4571 \begin_layout Subsection
4575 \begin_layout Standard
4577 \begin_inset Flex Code
4580 \begin_layout Plain Layout
4588 mapping is performed, a
4589 \begin_inset Flex Code
4592 \begin_layout Plain Layout
4602 file maps the strings that the symbols generate to characters in the current
4604 The LyX distribution currently includes at least the
4605 \begin_inset Flex Code
4608 \begin_layout Plain Layout
4617 \begin_inset Flex Code
4620 \begin_layout Plain Layout
4631 \begin_layout Standard
4633 \begin_inset Flex Code
4636 \begin_layout Plain Layout
4644 file is a sequence of declarations of the form
4647 \begin_layout LyX-Code
4660 \begin_layout Standard
4661 For example, in order to map
4662 \begin_inset Flex MenuItem
4665 \begin_layout Plain Layout
4675 to the corresponding character in the iso-8859-1 set (233), the following
4679 \begin_layout LyX-Code
4687 \begin_layout Standard
4689 \begin_inset Flex Code
4692 \begin_layout Plain Layout
4701 \begin_inset Flex Code
4704 \begin_layout Plain Layout
4722 the same character can apply to more than one string.
4724 \begin_inset Flex Code
4727 \begin_layout Plain Layout
4738 \begin_layout LyX-Code
4750 \begin_inset Newline newline
4766 \begin_layout Standard
4767 If LyX cannot find a mapping for the string produced by the keystroke or
4768 a deadkey sequence, it will check if it looks like an accented char and
4769 try to draw an accent over the character on screen.
4772 \begin_layout Subsection
4776 \begin_layout Standard
4777 There is a second way to add support for international characters through
4778 so-called dead-keys.
4779 A dead-key works in combination with a letter to produce an accented character.
4780 Here, we'll explain how to create a really simple dead-key to illustrate
4784 \begin_layout Standard
4785 Suppose you happen to need the circumflex character,
4786 \begin_inset Quotes eld
4790 \begin_inset Quotes erd
4795 \begin_inset Flex MenuItem
4798 \begin_layout Plain Layout
4805 \begin_inset space ~
4809 \begin_inset Flex MenuItem
4812 \begin_layout Plain Layout
4818 ] to the LyX command
4819 \begin_inset Flex Code
4822 \begin_layout Plain Layout
4829 \begin_inset Flex Code
4832 \begin_layout Plain Layout
4839 Now, whenever you type the
4840 \begin_inset Flex MenuItem
4843 \begin_layout Plain Layout
4849 -key followed by a letter, that letter will have a circumflex accent on
4851 For example, the sequence
4852 \begin_inset Quotes eld
4856 \begin_inset Flex MenuItem
4859 \begin_layout Plain Layout
4866 \begin_inset Quotes erd
4869 produces the letter:
4870 \begin_inset Quotes eld
4874 \begin_inset Quotes erd
4878 If you tried to type
4879 \begin_inset Quotes eld
4883 \begin_inset Flex MenuItem
4886 \begin_layout Plain Layout
4893 \begin_inset Quotes erd
4896 , however, LyX will complain with a beep, since a
4897 \begin_inset Quotes eld
4901 \begin_inset Flex MenuItem
4904 \begin_layout Plain Layout
4911 \begin_inset Quotes erd
4914 never takes a circumflex accent.
4916 \begin_inset Flex MenuItem
4919 \begin_layout Plain Layout
4925 after a dead-key produces the bare-accent.
4926 Please note this last point! If you bind a key to a dead-key, you'll need
4927 to rebind the character on that key to yet another key.
4929 \begin_inset Flex MenuItem
4932 \begin_layout Plain Layout
4938 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4941 \begin_layout Standard
4942 One common way to bind dead-keys is to use
4943 \begin_inset Flex MenuItem
4946 \begin_layout Plain Layout
4953 \begin_inset Flex MenuItem
4956 \begin_layout Plain Layout
4963 \begin_inset Flex MenuItem
4966 \begin_layout Plain Layout
4972 in combination with an accent, like
4973 \begin_inset Quotes eld
4977 \begin_inset Flex MenuItem
4980 \begin_layout Plain Layout
4987 \begin_inset Quotes erd
4991 \begin_inset Quotes eld
4995 \begin_inset Flex MenuItem
4998 \begin_layout Plain Layout
5005 \begin_inset Quotes erd
5009 \begin_inset Quotes eld
5013 \begin_inset Flex MenuItem
5016 \begin_layout Plain Layout
5023 \begin_inset Quotes erd
5027 Another way involves using
5028 \begin_inset Flex Code
5031 \begin_layout Plain Layout
5038 \begin_inset Flex Code
5041 \begin_layout Plain Layout
5047 to set up the special
5048 \begin_inset Flex Code
5051 \begin_layout Plain Layout
5059 \begin_inset Flex Code
5062 \begin_layout Plain Layout
5068 acts in some ways just like
5069 \begin_inset Flex MenuItem
5072 \begin_layout Plain Layout
5078 and permits you to bind keys to accented characters.
5079 You can also turn keys into dead-keys by binding them to something like
5081 \begin_inset Flex Code
5084 \begin_layout Plain Layout
5090 and then binding this symbolic key to the corresponding LyX command.
5094 \begin_layout Plain Layout
5099 : This is exactly what I do in my
5100 \begin_inset Flex Code
5103 \begin_layout Plain Layout
5110 \begin_inset Flex Code
5113 \begin_layout Plain Layout
5121 \begin_inset Flex MenuItem
5124 \begin_layout Plain Layout
5126 \begin_inset space ~
5135 \begin_inset Flex Code
5138 \begin_layout Plain Layout
5144 and a bunch of these
5145 \begin_inset Quotes eld
5149 \begin_inset Flex Code
5152 \begin_layout Plain Layout
5159 \begin_inset Quotes erd
5162 symbolic keys bound such things as
5163 \begin_inset Flex MenuItem
5166 \begin_layout Plain Layout
5168 \begin_inset space ~
5177 \begin_inset Flex MenuItem
5180 \begin_layout Plain Layout
5182 \begin_inset space ~
5191 This is how I produce my accented characters.
5196 You can make just about anything into the
5197 \begin_inset Flex Code
5200 \begin_layout Plain Layout
5207 \begin_inset Flex MenuItem
5210 \begin_layout Plain Layout
5216 keys, a spare function key, etc.
5217 As for the LyX commands that produce accents, check the entry for
5218 \begin_inset Flex Code
5221 \begin_layout Plain Layout
5232 You'll find the complete list there.
5235 \begin_layout Subsection
5236 Saving your Language Configuration
5239 \begin_layout Standard
5240 You can edit your preferences so that your desired language environment
5241 is automatically configured when LyX starts up, via the
5242 \begin_inset Flex MenuItem
5245 \begin_layout Plain Layout
5246 Edit\SpecialChar \menuseparator
5255 \begin_layout Chapter
5256 Installing New Document Classes, Layouts, and Templates
5257 \begin_inset CommandInset label
5259 name "cha:Installing-New-Document"
5264 \begin_inset Argument
5267 \begin_layout Plain Layout
5268 Installing New Document Classes
5276 \begin_layout Standard
5277 In this chapter, we describe the procedures for creating and installing
5278 new LyX layout and template files, as well as offer a refresher on correctly
5279 installing new LaTeX document classes.
5283 \begin_layout Standard
5284 First, let us a say a few words about how one ought to think about the relation
5285 between LyX and LaTeX.
5286 The thing to understand is that, in a certain sense, LyX doesn't know anything
5288 Indeed, from LyX's point of view, LaTeX is just one of several
5289 \begin_inset Quotes eld
5293 \begin_inset Quotes erd
5296 in which it is capable of producing output.
5297 Other such formats are DocBook, plaintext, and XHTML.
5298 LaTeX is, of course, a particularly important format, but very little of
5299 the information LyX has about LaTeX is actually contained in the program
5304 \begin_layout Plain Layout
5305 Some commands are sufficiently complex that they are
5306 \begin_inset Quotes eld
5310 \begin_inset Quotes erd
5314 But the developers generally regard this as a Bad Thing.
5319 Rather, that information, even for the standard classes like
5320 \begin_inset Flex Code
5323 \begin_layout Plain Layout
5329 , is contained in `layout files'.
5330 Similarly, LyX itself does not know much about DocBook or XHTML.
5331 What it knows is contained in layout files.
5334 \begin_layout Standard
5335 You can think of the layout file for a given document class as a translation
5336 manual between LyX constructs---paragraphs with their corresponding styles,
5337 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5339 Almost everything LyX knows about
5340 \begin_inset Flex Code
5343 \begin_layout Plain Layout
5349 , for example, is contained in the file
5350 \begin_inset Flex Code
5353 \begin_layout Plain Layout
5359 and in various other files it includes.
5360 For this reason, anyone intending to write layout files should plan to
5361 study the existing files.
5362 A good place to start is with
5363 \begin_inset Flex Code
5366 \begin_layout Plain Layout
5372 , which is included in
5373 \begin_inset Flex Code
5376 \begin_layout Plain Layout
5383 \begin_inset Flex Code
5386 \begin_layout Plain Layout
5392 , and many of the other layout files for document classes.
5393 This file is where sections and the like are defined:
5394 \begin_inset Flex Code
5397 \begin_layout Plain Layout
5403 tells LyX how paragraphs that are marked with the Section, Subsection,
5404 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5407 \begin_inset Flex Code
5410 \begin_layout Plain Layout
5416 file basically just includes several of these
5417 \begin_inset Flex Code
5420 \begin_layout Plain Layout
5429 \begin_layout Standard
5430 Defining the LyX--LaTeX correspondence is not the only thing layout files
5432 Their other job is to define how the LyX constructs themselves will appear
5434 The fact that layout files have these two jobs is often a source of confusion,
5435 because they are completely separate.
5436 Telling LyX how to translate a certain paragraph style into LaTeX does
5437 not tell LyX how to display it; conversely, telling LyX how to display
5438 a certain paragraph style does not tell LyX how to translate it into LaTeX
5439 (let alone tell LaTeX how to display it).
5440 So, in general, when you define a new LyX construct, you must always do
5441 two quite separate things: (i)
5442 \begin_inset space ~
5445 tell LyX how to translate it into LaTeX and (ii)
5446 \begin_inset space ~
5449 tell LyX how to display it.
5452 \begin_layout Standard
5453 Much the same is true, of course, as regards LyX's other backend formats,
5454 though XHTML is in some ways different, because in that case LyX
5458 able, to some extent, to use information about how it should display a
5459 paragraph on the screen to output information (in the form of CSS) about
5460 how the paragraph should be displayed in a browser.
5461 Even in this case, however, the distinction between what LyX does internally
5462 and how things are rendered externally remains in force, and the two can
5463 be controlled separately.
5465 \begin_inset CommandInset ref
5467 reference "sec:Tags-for-XHTML"
5474 \begin_layout Section
5475 Installing new LaTeX files
5478 \begin_layout Standard
5479 Some installations may not include a LaTeX package or class file that you
5480 would like to use within LyX.
5481 For example, you might need FoilTeX, a package for preparing slides for
5482 overhead projectors.
5483 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5484 a user interface for installing such packages.
5485 For example, with MiKTeX, you start the program
5486 \begin_inset Quotes eld
5490 \begin_inset space ~
5494 \begin_inset Quotes erd
5497 to get a list of available packages.
5498 To install one of them, right click on it or use the corresponding toolbar
5502 \begin_layout Standard
5503 If your LaTeX distribution does not provide such a `package manager', or
5504 if the package is not available from your distribution, then follow these
5505 steps to install it manually:
5508 \begin_layout Enumerate
5509 Get the package from
5510 \begin_inset CommandInset href
5513 target "http://www.ctan.org/"
5520 \begin_layout Enumerate
5521 If the package contains a file with the ending
5522 \begin_inset Quotes eld
5526 \begin_inset Flex Code
5529 \begin_layout Plain Layout
5536 \begin_inset Quotes erd
5539 (is the case for FoilTeX) then open a console, change to the folder of
5540 this file and execute the command
5541 \begin_inset Flex Code
5544 \begin_layout Plain Layout
5551 You have now unpacked the package and have all files to install it.
5552 Most LaTeX-packages are not packed and you can skip this step.
5555 \begin_layout Enumerate
5556 Now you need to decide if the package should be available for all users
5561 \begin_layout Enumerate
5562 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5563 for all users on your system, then install it in your `local' TeX tree,
5564 otherwise install it in your own `user' TeX tree.
5565 Where these trees should be created, if they do not already exist, depends
5567 To find this out, look in the file
5568 \begin_inset Flex Code
5571 \begin_layout Plain Layout
5581 \begin_layout Plain Layout
5582 This is usually in the directory
5583 \begin_inset Flex Code
5586 \begin_layout Plain Layout
5592 , though you can execute the command
5593 \begin_inset Flex Code
5596 \begin_layout Plain Layout
5607 The location of the `local' TeX tree is defined by the
5608 \begin_inset Flex Code
5611 \begin_layout Plain Layout
5617 variable; this is usually somewhere like
5618 \begin_inset Flex Code
5621 \begin_layout Plain Layout
5622 /usr/local/share/texmf
5628 The location of the `user' TeX tree is defined by
5629 \begin_inset Flex Code
5632 \begin_layout Plain Layout
5639 \begin_inset Flex Code
5642 \begin_layout Plain Layout
5649 (If these variables are not predefined, you have to define them.) You'll
5650 probably need root permissions to create or modify the `local' tree, but
5651 not for your `user' tree.
5652 \begin_inset Newline newline
5655 In general, it is recommended to install in the user tree because your user
5656 will not be modified or even overwritten when you upgrade your system.
5657 It will typically also be backed up together with everything else when
5658 you backup your home directory (which, of course, you do on a regular basis).
5661 \begin_layout Enumerate
5662 On Windows, if you want the new package to be available for all users on
5663 your system, change to the folder where LaTeX is installed and then change
5665 \begin_inset Flex Code
5668 \begin_layout Plain Layout
5679 (For MiKTeX, this would be by default the folder
5680 \begin_inset Flex Code
5683 \begin_layout Plain Layout
5701 \begin_layout Plain Layout
5702 Note that this will be the correct path only on English installations.
5703 On a German one, it would be
5704 \begin_inset Flex Code
5707 \begin_layout Plain Layout
5721 , and similarly for other languages.
5726 Create there a new folder
5727 \begin_inset Flex Code
5730 \begin_layout Plain Layout
5736 and copy all files of the package into it.
5738 \begin_inset Newline newline
5741 If the package should only available for you or you don't have admin permissions
5742 , do the same, but in the local LaTeX folder.
5744 \begin_inset space \thinspace{}
5748 \begin_inset space ~
5751 2.8 under Windows XP, this would be the folder:
5752 \begin_inset Newline newline
5758 \begin_inset Flex Code
5761 \begin_layout Plain Layout
5764 Documents and Settings
5776 \begin_inset Newline newline
5782 \begin_inset Phantom HPhantom
5785 \begin_layout Plain Layout
5796 \begin_inset Flex Code
5799 \begin_layout Plain Layout
5812 \begin_inset Newline newline
5815 On Vista, it would be:
5816 \begin_inset Newline newline
5820 \begin_inset Flex Code
5823 \begin_layout Plain Layout
5849 \begin_layout Enumerate
5850 Now one only need to tell LaTeX that there are new files.
5851 This depends on the used LaTeX-Distribution:
5855 \begin_layout Enumerate
5856 For TeXLive execute the command
5857 \begin_inset Flex Code
5860 \begin_layout Plain Layout
5867 If you installed the package for all users, then you will probably need
5868 to have root permissions for that.
5871 \begin_layout Enumerate
5872 For MiKTeX, if you have installed the package for all users, start the program
5874 \begin_inset Quotes eld
5878 \begin_inset space ~
5882 \begin_inset Quotes erd
5885 and press the button marked
5886 \begin_inset Quotes eld
5890 \begin_inset Quotes erd
5894 Otherwise start the program
5895 \begin_inset Quotes eld
5899 \begin_inset Quotes erd
5906 \begin_layout Enumerate
5907 Finally, you need to tell LyX that there are new packages available.
5908 So, in LyX, use the menu
5909 \begin_inset Flex MenuItem
5912 \begin_layout Plain Layout
5915 \SpecialChar \menuseparator
5921 and then restart LyX.
5924 \begin_layout Standard
5925 Now the package is installed.
5926 In our example, the document class
5927 \begin_inset Flex Code
5930 \begin_layout Plain Layout
5932 \begin_inset space ~
5939 \begin_layout Plain Layout
5951 will now be available under
5952 \begin_inset Flex MenuItem
5955 \begin_layout Plain Layout
5956 Document\SpecialChar \menuseparator
5957 Settings\SpecialChar \menuseparator
5967 \begin_layout Standard
5968 If you would like to use a LaTeX document class that is not even listed
5970 \begin_inset Flex MenuItem
5973 \begin_layout Plain Layout
5974 Document\SpecialChar \menuseparator
5975 Settings\SpecialChar \menuseparator
5981 , then you need to create a `layout' file for it.
5982 That is the topic of the next section.
5985 \begin_layout Section
5986 Types of layout files
5989 \begin_layout Standard
5990 This section describes the various sorts of LyX files that contain layout
5992 These files describe various paragraph and character styles, determining
5993 how LyX should display them and how they should be translated into LaTeX,
5994 DocBook, XHTML, or whatever output format is being used.
5998 \begin_layout Standard
5999 We shall try to provide a thorough description of the process of writing
6001 However, there are so many different types of documents supported even
6002 by just LaTeX that we can't hope to cover every different possibility or
6003 problem you might encounter.
6004 The LyX users' list is frequented by people with lots of experience with
6005 layout design who are willing to share what they've learned, so please
6006 feel free to ask questions there.
6009 \begin_layout Standard
6010 As you prepare to write a new layout, it is extremely helpful to look at
6011 the layouts distributed with LyX.
6012 If you write a LyX layout for a LaTeX document class that might also be
6013 used by others, or write a module that might be useful to others, then
6014 you should consider posting your layout to the
6015 \begin_inset CommandInset href
6017 name "layout section on the LyX wiki"
6018 target "http://wiki.lyx.org/Layouts/Layouts"
6022 or even to the LyX developers' list, so that it might be included in LyX
6027 \begin_layout Plain Layout
6028 Note that LyX is licensed under the General Public License, so any material
6029 that is contributed to LyX must be similarly licensed.
6037 \begin_layout Subsection
6039 \begin_inset CommandInset label
6041 name "sub:Layout-modules"
6048 \begin_layout Standard
6049 We have spoken to this point about `layout files'.
6050 But there are different sorts of files that contain layout information.
6051 Layout files, strictly so called, have the
6052 \begin_inset Flex Code
6055 \begin_layout Plain Layout
6061 extension and provide LyX with information about document classes.
6062 As of LyX 1.6, however, layout information can also be contained in layout
6068 \begin_inset Flex Code
6071 \begin_layout Plain Layout
6078 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6079 some modules—such as the
6080 \begin_inset Flex Code
6083 \begin_layout Plain Layout
6089 module—specifically provide support for one package.
6090 In a sense, layout modules are similar to included
6094 \begin_layout Plain Layout
6095 These can have any extension, but by convention have the
6096 \begin_inset Flex Code
6099 \begin_layout Plain Layout
6111 \begin_inset Flex Code
6114 \begin_layout Plain Layout
6120 —in that modules are not specific to a given document class but may be used
6121 with many different classes.
6122 The difference is that using an included file with
6123 \begin_inset Flex Code
6126 \begin_layout Plain Layout
6132 requires editing that file.
6133 Modules, by contrast, are selected in the
6134 \begin_inset Flex MenuItem
6137 \begin_layout Plain Layout
6138 Document\SpecialChar \menuseparator
6147 \begin_layout Standard
6148 Building modules is the easiest way to get started with layout editing,
6149 since it can be as simple as adding a single new paragraph style or flex
6151 But modules may, in principle, contain anything a layout file can contain.
6154 \begin_layout Standard
6155 After creating a new module and copying it to the
6156 \begin_inset Flex Code
6159 \begin_layout Plain Layout
6165 folder, you will need to reconfigure and then restart LyX for the module
6166 to appear in the menu.
6167 However, changes you make to the module will be seen immediately, if you
6169 \begin_inset Flex MenuItem
6172 \begin_layout Plain Layout
6173 Document\SpecialChar \menuseparator
6179 , highlight something, and then hit
6180 \begin_inset Quotes eld
6184 \begin_inset Quotes erd
6190 It is strongly recommended that you save your work before doing this
6195 it is strongly recommended that you not attempt to edit modules while simultaneo
6196 usly working on actual documents
6199 Though of course the developers strive to keep LyX stable in such situations,
6200 syntax errors and the like in your module file could cause strange behavior.
6203 \begin_layout Subsubsection
6207 \begin_layout Standard
6208 Modules are to LyX as packages are to LaTeX.
6209 Sometimes, however, you find yourself wanting a specific inset or character
6210 style just for one document and writing a module that will also be available
6211 to other documents makes little sense.
6212 What you need is LyX's
6213 \begin_inset Quotes eld
6217 \begin_inset Quotes erd
6223 \begin_layout Standard
6224 You will find it under
6226 Document\SpecialChar \menuseparator
6227 Settings\SpecialChar \menuseparator
6231 The large text box allows you to enter anything that you might enter in
6232 a layout file or module.
6233 You can think of a document's local layout, in fact, as a module that belongs
6235 So, in particular, you must enter a
6236 \begin_inset Flex Code
6239 \begin_layout Plain Layout
6246 Any format is acceptable, but one would normally use the format current
6248 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6249 layout is not supported by versions of LyX prior to 1.6, so you should not
6250 use it if you want to be able to export your document to LyX 1.5 or earlier
6251 (without, that is, losing the local layout information).
6252 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6253 though there is no UI for it---then you should use format 11 and, of course,
6254 use only layout constructs that were available in LyX 1.6.
6257 \begin_layout Standard
6258 When you have entered something in the
6259 \begin_inset Flex Code
6262 \begin_layout Plain Layout
6268 pane, LyX will enable the
6269 \begin_inset Quotes eld
6273 \begin_inset Quotes erd
6276 button at the bottom.
6277 Clicking this button will cause LyX to determine whether what you have
6278 entered is valid layout information for the chosen format.
6279 LyX will report the result but, unfortunately, will not tell you what errors
6280 there might have been.
6281 These will be written to the terminal, however, if LyX is started from
6283 You will not be permitted to save your local layout until you have entered
6287 \begin_layout Standard
6288 The warnings at the end of the previous section apply here, too.
6289 Do not play with local layout while you are actually working, especially
6290 if you have not saved your document.
6291 That said, using local layout with a test document can be a very convenient
6292 way to try out layout ideas, or even to start developing a module.
6295 \begin_layout Subsection
6297 \begin_inset Flex MenuItem
6300 \begin_layout Plain Layout
6309 \begin_layout Standard
6310 There are two situations you are likely to encounter when wanting to support
6311 a new LaTeX document class, involving style (
6312 \begin_inset Flex Code
6315 \begin_layout Plain Layout
6321 ) files and LaTeX2e class (
6322 \begin_inset Flex Code
6325 \begin_layout Plain Layout
6332 Supporting a style file is usually fairly easy.
6333 Supporting a new class file is a bit harder.
6334 We'll discuss the former in this section and the latter in the next.
6335 Similar remarks apply, of course, if you want to support a new DocBook
6339 \begin_layout Standard
6340 The easier case is the one in which your new document class is provided
6341 as a style file that is to be used in conjunction with an already supported
6343 For the sake of the example, we'll assume that the style file is called
6345 \begin_inset Flex MenuItem
6348 \begin_layout Plain Layout
6354 and that it is meant to be used with
6355 \begin_inset Flex MenuItem
6358 \begin_layout Plain Layout
6364 , which is a standard class.
6368 \begin_layout Standard
6369 Start by copying the existing class's layout file into your local directory:
6373 \begin_layout Plain Layout
6374 Of course, which directory is your local directory will vary by platform,
6375 and LyX allows you to specify your local directory on startup, too, using
6377 \begin_inset Flex Code
6380 \begin_layout Plain Layout
6394 \begin_layout LyX-Code
6395 cp report.layout ~/.lyx/layouts/myclass.layout
6398 \begin_layout Standard
6400 \begin_inset Flex Code
6403 \begin_layout Plain Layout
6409 and change the line:
6412 \begin_layout LyX-Code
6415 DeclareLaTeXClass{report}
6418 \begin_layout Standard
6422 \begin_layout LyX-Code
6425 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6428 \begin_layout Standard
6432 \begin_layout LyX-Code
6434 \begin_inset Newline newline
6440 \begin_inset Newline newline
6446 \begin_layout Standard
6447 near the top of the file.
6450 \begin_layout Standard
6451 Start LyX and select
6452 \begin_inset Flex MenuItem
6455 \begin_layout Plain Layout
6456 Tools\SpecialChar \menuseparator
6463 Then restart LyX and try creating a new document.
6465 \begin_inset Flex MenuItem
6468 \begin_layout Plain Layout
6474 " as a document class option in the
6475 \begin_inset Flex MenuItem
6478 \begin_layout Plain Layout
6479 Document\SpecialChar \menuseparator
6486 It is likely that some of the sectioning commands and such in your new
6487 class will work differently from how they worked in the base class—
6488 \begin_inset Flex Code
6491 \begin_layout Plain Layout
6497 in this example—so you can fiddle around with the settings for the different
6498 sections if you wish.
6499 The layout information for sections is contained in
6500 \begin_inset Flex Code
6503 \begin_layout Plain Layout
6509 , but you do not need to copy and change this file.
6510 Instead, you can simply add your changes to your layout file, after the
6512 \begin_inset Flex Code
6515 \begin_layout Plain Layout
6521 , which itself includes
6522 \begin_inset Flex Code
6525 \begin_layout Plain Layout
6532 For example, you might add these lines:
6535 \begin_layout LyX-Code
6539 \begin_layout LyX-Code
6543 \begin_layout LyX-Code
6547 \begin_layout LyX-Code
6551 \begin_layout LyX-Code
6555 \begin_layout Standard
6556 to change the font for chapter headings to sans-serif.
6557 This will override (or, in this case, add to) the existing declaration
6558 for the Chapter style.
6562 \begin_layout Standard
6563 Your new package may also provide commands or environments not present in
6565 In this case, you will want to add these to the layout file.
6567 \begin_inset CommandInset ref
6569 reference "sec:TextClass"
6573 for information on how to do so.
6576 \begin_layout Standard
6578 \begin_inset Flex MenuItem
6581 \begin_layout Plain Layout
6587 can be used with several different document classes, and even if it cannot,
6588 you might find it easiest just to write a module that you can load with
6590 The simplest possible such module would be:
6593 \begin_layout LyX-Code
6596 DeclareLyXModule{My Package}
6599 \begin_layout LyX-Code
6603 \begin_layout LyX-Code
6604 #Support for mypkg.sty.
6607 \begin_layout LyX-Code
6609 \begin_inset Newline newline
6615 \begin_layout LyX-Code
6617 \begin_inset Newline newline
6623 \begin_layout LyX-Code
6625 \begin_inset Newline newline
6631 \begin_inset Newline newline
6637 \begin_layout Standard
6638 A more complex module might modify the behavior of some existing constructs
6639 or define some new ones.
6641 \begin_inset CommandInset ref
6643 reference "sec:TextClass"
6650 \begin_layout Subsection
6652 \begin_inset Flex MenuItem
6655 \begin_layout Plain Layout
6664 \begin_layout Standard
6665 There are two possibilities here.
6666 One is that the class file is itself based upon an existing document class.
6667 For example, many thesis classes are based upon
6668 \begin_inset Flex MenuItem
6671 \begin_layout Plain Layout
6678 To see whether yours is, look for a line like
6681 \begin_layout LyX-Code
6687 \begin_layout Standard
6689 If so, then you may proceed largely as in the previous section, though
6691 \begin_inset Flex Code
6694 \begin_layout Plain Layout
6700 line will be different.
6701 If your new class is
6702 \begin_inset Flex Code
6705 \begin_layout Plain Layout
6711 and it is based upon
6712 \begin_inset Flex Code
6715 \begin_layout Plain Layout
6721 , then the line should read:
6725 \begin_layout Plain Layout
6726 And it will be easiest if you save the file to
6727 \begin_inset Flex Code
6730 \begin_layout Plain Layout
6736 : LyX assumes that the document class has the same name as the layout file.
6745 \begin_layout LyX-Code
6748 DeclareLaTeXClass[thesis,book]{thesis}
6751 \begin_layout Standard
6752 If, on the other hand, the new class is not based upon an existing class,
6753 you will probably have to
6754 \begin_inset Quotes eld
6758 \begin_inset Quotes erd
6762 We strongly suggest copying an existing layout file which uses a similar
6763 LaTeX class and then modifying it, if you can do so.
6764 At least use an existing file as a starting point so you can find out what
6765 items you need to worry about.
6766 Again, the specifics are covered below.
6769 \begin_layout Subsection
6771 \begin_inset CommandInset label
6773 name "sub:Creating-Templates"
6780 \begin_layout Standard
6781 Once you have written a layout file for a new document class, you might
6782 want to consider writing a
6787 A template acts as a kind of tutorial for your layout, showing how it might
6788 be used, though containing dummy content.
6789 You can of course look at the various templates included with LyX for ideas.
6792 \begin_layout Standard
6793 Templates are created just like usual documents: using LyX.
6794 The only difference is that usual documents contain all possible settings,
6795 including the font scheme and the paper size.
6796 Usually a user doesn't want a template to overwrite his preferred settings
6797 for such parameters.
6798 For that reason, the designer of a template should remove the corresponding
6800 \begin_inset Flex Code
6803 \begin_layout Plain Layout
6812 \begin_inset Flex Code
6815 \begin_layout Plain Layout
6823 from the template LyX file.
6824 This can be done with any simple text-editor, for example
6825 \begin_inset Flex Code
6828 \begin_layout Plain Layout
6835 \begin_inset Flex Code
6838 \begin_layout Plain Layout
6848 \begin_layout Standard
6849 Put the edited template files you create in
6850 \begin_inset Flex Code
6853 \begin_layout Plain Layout
6859 , copy the ones you use from the global template directory in
6860 \begin_inset Flex Code
6863 \begin_layout Plain Layout
6869 to the same place, and redefine the template path in the
6870 \begin_inset Flex MenuItem
6873 \begin_layout Plain Layout
6874 Tools\SpecialChar \menuseparator
6875 Preferences\SpecialChar \menuseparator
6884 \begin_layout Standard
6885 Note, by the way, that there is a template which has a particular meaning:
6887 \begin_inset Flex Code
6890 \begin_layout Plain Layout
6897 This template is loaded every time you create a new document with
6898 \begin_inset Flex MenuItem
6901 \begin_layout Plain Layout
6902 File\SpecialChar \menuseparator
6908 in order to provide useful defaults.
6909 To create this template from inside LyX, all you have to do is to open
6910 a document with the correct settings, and use the
6911 \begin_inset Flex MenuItem
6914 \begin_layout Plain Layout
6915 Save as Document Defaults
6923 \begin_layout Subsection
6924 Upgrading old layout files
6927 \begin_layout Standard
6928 The format of layout files changes with each LyX release, so old layout
6929 files need to be converted to the new format.
6930 This process has been automated since LyX 1.4: If LyX reads a layout file
6931 in an older format, it automatically calls the script
6932 \begin_inset Flex Code
6935 \begin_layout Plain Layout
6941 to convert it to a temporary file in current format.
6942 The original file is left untouched.
6943 If you use the layout file often, then, you may want to convert it permanently,
6944 so that LyX does not have to do so itself every time.
6945 To do this, you can call the converter manually:
6948 \begin_layout LyX-Code
6949 mv myclass.layout myclass.old
6952 \begin_layout LyX-Code
6953 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6956 \begin_layout Standard
6958 \begin_inset Flex Code
6961 \begin_layout Plain Layout
6967 with the name of your LyX system directory, of course.
6970 \begin_layout Standard
6971 Note that manual conversion does not affect included files, so these will
6972 have to be converted separately.
6975 \begin_layout Section
6976 \begin_inset CommandInset label
6978 name "sec:TextClass"
6982 The layout file format
6985 \begin_layout Standard
6986 When it's finally time to get your hands dirty and create or edit your own
6987 layout file, the following sections describe what you're up against.
6988 Our advice is to go slowly, save and test often, listen to soothing music,
6989 and enjoy one or two of your favorite adult beverages; more if you are
6990 getting particularly stuck.
6991 It's really not that hard, except that the multitude of options can become
6992 overwhelming if you try to do too much in one sitting.
6993 Go have another adult beverage, just for good measure.
6996 \begin_layout Standard
6997 Note that all the tags used in layout files are case-insensitive.
6999 \begin_inset Flex Code
7002 \begin_layout Plain Layout
7009 \begin_inset Flex Code
7012 \begin_layout Plain Layout
7019 \begin_inset Flex Code
7022 \begin_layout Plain Layout
7028 are really the same tag.
7029 The possible values are printed in brackets after the feature's name.
7030 The default value if a feature isn't specified inside a text class-description
7032 \begin_inset Flex Code
7035 \begin_layout Plain Layout
7044 If the argument has a data type like
7045 \begin_inset Quotes eld
7049 \begin_inset Quotes erd
7053 \begin_inset Quotes eld
7057 \begin_inset Quotes erd
7060 , the default is shown like this:
7061 \begin_inset Flex Code
7064 \begin_layout Plain Layout
7075 \begin_layout Subsection
7076 The document class declaration
7079 \begin_layout Standard
7080 Lines in a layout file which begin with
7081 \begin_inset Flex Code
7084 \begin_layout Plain Layout
7091 There is one exception to this rule.
7093 \begin_inset Flex Code
7096 \begin_layout Plain Layout
7102 files should begin with a line like:
7105 \begin_layout LyX-Code
7108 #% Do not delete the line below; configure depends on this
7111 \begin_layout LyX-Code
7116 DeclareLaTeXClass{article}
7119 \begin_layout Standard
7120 The second line is used when you (re)configure LyX.
7121 The layout file is read by the LaTeX script
7122 \begin_inset Flex Code
7125 \begin_layout Plain Layout
7131 , in a special mode where
7132 \begin_inset Flex Code
7135 \begin_layout Plain Layout
7142 The first line is just a LaTeX comment, and the second one contains the
7143 declaration of the text class.
7144 If these lines appear in a file named
7145 \begin_inset Flex Code
7148 \begin_layout Plain Layout
7154 , then they define a text class of name
7155 \begin_inset Flex Code
7158 \begin_layout Plain Layout
7164 (the name of the layout file) which uses the LaTeX document class
7165 \begin_inset Flex Code
7168 \begin_layout Plain Layout
7174 (the default is to use the same name as the layout).
7176 \begin_inset Quotes eld
7180 \begin_inset Quotes erd
7183 that appears above is used as a description of the text class in the
7184 \begin_inset Flex MenuItem
7187 \begin_layout Plain Layout
7188 Document\SpecialChar \menuseparator
7197 \begin_layout Standard
7198 Let's assume that you wrote your own text class that uses the
7199 \begin_inset Flex Code
7202 \begin_layout Plain Layout
7208 document class, but where you changed the appearance of the section headings.
7209 If you put it in a file
7210 \begin_inset Flex Code
7213 \begin_layout Plain Layout
7219 , the header of this file should be:
7222 \begin_layout LyX-Code
7225 #% Do not delete the line below; configure depends on this
7228 \begin_layout LyX-Code
7233 DeclareLaTeXClass[article]{article (with my own headings)}
7236 \begin_layout Standard
7237 This declares a text class
7238 \begin_inset Flex Code
7241 \begin_layout Plain Layout
7247 , associated with the LaTeX document class
7248 \begin_inset Flex Code
7251 \begin_layout Plain Layout
7258 \begin_inset Quotes eld
7261 article (with my own headings)
7262 \begin_inset Quotes erd
7266 If your text class depends on several packages, you can declare it as:
7269 \begin_layout LyX-Code
7272 #% Do not delete the line below; configure depends on this
7275 \begin_layout LyX-Code
7280 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7283 \begin_layout Standard
7284 This indicates that your text class uses the
7285 \begin_inset Flex Code
7288 \begin_layout Plain Layout
7295 Finally, it is also possible to declare classes for DocBook code.
7296 Typical declarations will look like:
7299 \begin_layout LyX-Code
7302 #% Do not delete the line below; configure depends on this
7305 \begin_layout LyX-Code
7310 DeclareDocBookClass[article]{SGML (DocBook article)}
7313 \begin_layout Standard
7314 Note that these declarations can also be given an optional parameter declaring
7315 the name of the document class (but not a list).
7318 \begin_layout Standard
7319 So, to be as explicit as possible, the form of the layout declaration is:
7322 \begin_layout LyX-Code
7327 DeclareLaTeXClass[class,package.sty]{layout description}
7330 \begin_layout Standard
7331 The class need only be specified if the name of the LaTeX class file and
7332 the name of the layout file are different or if there are packages to load.
7333 If the name of the class file is not specified, then LyX will simply assume
7334 that it is the same as the name of the layout file.
7337 \begin_layout Standard
7338 When the text class has been modified to your taste, all you have to do
7339 is to copy it either to
7340 \begin_inset Flex Code
7343 \begin_layout Plain Layout
7350 \begin_inset Flex Code
7353 \begin_layout Plain Layout
7360 \begin_inset Flex MenuItem
7363 \begin_layout Plain Layout
7364 Tools\SpecialChar \menuseparator
7370 , exit LyX and restart.
7371 Then your new text class should be available along with the others.
7374 \begin_layout Standard
7375 Once the layout file is installed, you can edit it and see your changes
7376 without having to reconfigure or to restart LyX.
7381 \begin_layout Plain Layout
7382 In versions of LyX prior to 1.6, this was not true.
7383 As a result, editing layout files was very time consuming, since you had
7384 constantly to restart LyX to see changes.
7389 You can force a reload of the current layout by using the LyX function
7391 \begin_inset Flex MenuItem
7394 \begin_layout Plain Layout
7401 There is no default binding for this function—though, of course, you can
7402 bind it to a key yourself.
7403 But you will normally use this function simply by entering it in the mini-buffe
7408 \begin_layout Standard
7414 \begin_inset Flex MenuItem
7417 \begin_layout Plain Layout
7423 is very much an `advanced feature'.
7428 recommended that you save your work before using this function.
7433 recommended that you not attempt to edit layout information while simultaneousl
7434 y working on a document that you care about.
7435 Use a test document.
7436 Syntax errors and the like in your layout file could cause peculiar behavior.
7437 In particular, such errors could cause LyX to regard the current layout
7438 as invalid and to attempt to switch to some other layout.
7442 \begin_layout Plain Layout
7443 Really bad syntax errors may even caused LyX to exit.
7444 This is because certain sorts of errors may make LyX unable to read
7454 The LyX team strives to keep LyX stable in such situations, but safe is
7459 \begin_layout Plain Layout
7460 While we're giving advice: make regular backups.
7461 And be nice to your mother.
7469 \begin_layout Subsection
7470 The Module declaration
7473 \begin_layout Standard
7474 A module must begin with a line like the following:
7477 \begin_layout LyX-Code
7480 DeclareLyXModule[endnotes.sty]{Endnotes}
7483 \begin_layout Standard
7484 The mandatory argument, in curly brackets, is the name of the module, as
7486 \begin_inset Flex MenuItem
7489 \begin_layout Plain Layout
7490 Document\SpecialChar \menuseparator
7491 Settings\SpecialChar \menuseparator
7498 The argument in square brackets is optional: It declares any LaTeX packages
7499 on which the module depends.
7500 Please note that only packages about which LyX knows should be listed in
7501 the square brackets.
7505 \begin_layout Plain Layout
7506 The list of such packages is documented only in the source code.
7511 LyX will not check for arbitrary packages.
7512 It is also possible to use the form
7513 \begin_inset Flex MenuItem
7516 \begin_layout Plain Layout
7522 as an optional argument, which declares that the module can only be used
7523 when there exists a conversion chain between the formats `
7524 \begin_inset Flex Code
7527 \begin_layout Plain Layout
7534 \begin_inset Flex Code
7537 \begin_layout Plain Layout
7546 \begin_layout Standard
7547 The module declaration should then be followed by lines like the following
7551 \begin_layout Plain Layout
7552 Preferably in English if the module should be published with LyX.
7553 This description will appear in the list of messages to be translated and
7554 will be thus translated with the next interface update.
7562 \begin_layout LyX-Code
7566 \begin_layout LyX-Code
7567 #Adds an endnote command, in addition to footnotes.
7571 \begin_layout LyX-Code
7572 #You will need to add
7574 theendnotes in TeX code where you
7577 \begin_layout LyX-Code
7578 #want the endnotes to appear.
7582 \begin_layout LyX-Code
7586 \begin_layout LyX-Code
7587 #Requires: somemodule | othermodule
7590 \begin_layout LyX-Code
7591 #Excludes: badmodule
7594 \begin_layout Standard
7595 The description is used in
7596 \begin_inset Flex MenuItem
7599 \begin_layout Plain Layout
7600 Document\SpecialChar \menuseparator
7601 Settings\SpecialChar \menuseparator
7607 to provide the user with information about what the module does.
7609 \begin_inset Flex Code
7612 \begin_layout Plain Layout
7618 line is used to identify other modules with which this one must be used;
7620 \begin_inset Flex Code
7623 \begin_layout Plain Layout
7629 line is used to identify modules with which this one may not be used.
7630 Both are optional, and, as shown, multiple modules should be separated
7631 with the pipe symbol: |.
7632 Note that the required modules are treated disjunctively:
7636 of the required modules must be used.
7641 excluded module may be used.
7642 Note that modules are identified here by their
7647 \begin_inset Flex Code
7650 \begin_layout Plain Layout
7658 \begin_inset Flex Code
7661 \begin_layout Plain Layout
7668 \begin_inset Flex Code
7671 \begin_layout Plain Layout
7680 \begin_layout Subsection
7684 \begin_layout Standard
7685 The first non-comment line of any layout file, included file, or module
7690 contain the file format number:
7693 \begin_layout Description
7694 \begin_inset Flex Code
7697 \begin_layout Plain Layout
7704 \begin_inset Flex Code
7707 \begin_layout Plain Layout
7713 ] The format of the layout file.
7716 \begin_layout Standard
7717 This tag was introduced with LyX 1.4.0.
7718 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7719 and are considered to be of format 1.
7720 The format for the present version of LyX is format 21.
7721 But each version of LyX is capable of reading earlier versions' layout
7722 files, just as they are capable of reading files produced by earlier versions
7724 There is, however, no provision for converting to earlier formats.
7725 So LyX 1.6.x will not read layout files in format 21 but only files in format
7729 \begin_layout Subsection
7730 \begin_inset CommandInset label
7732 name "sub:General-text-class"
7736 General text class parameters
7739 \begin_layout Standard
7740 These are general parameters that govern the behavior of an entire document
7746 mean that they must appear in
7747 \begin_inset Flex Code
7750 \begin_layout Plain Layout
7756 files rather than in modules.
7757 A module can contain any layout tag.)
7760 \begin_layout Description
7761 \begin_inset Flex Code
7764 \begin_layout Plain Layout
7770 Adds information that will be output in the
7771 \begin_inset Flex Code
7774 \begin_layout Plain Layout
7780 block when this document class is output to XHTML.
7781 Typically, this would be used to output CSS style information, but it can
7782 be used for anything that can appear in
7783 \begin_inset Flex Code
7786 \begin_layout Plain Layout
7794 \begin_inset Quotes eld
7798 \begin_inset Flex Code
7801 \begin_layout Plain Layout
7808 \begin_inset Quotes erd
7814 \begin_layout Description
7815 \begin_inset Flex Code
7818 \begin_layout Plain Layout
7824 Adds information to the document preamble.
7826 \begin_inset Quotes eld
7830 \begin_inset Flex Code
7833 \begin_layout Plain Layout
7840 \begin_inset Quotes erd
7846 \begin_layout Description
7847 \begin_inset Flex Code
7850 \begin_layout Plain Layout
7856 Defines formats for use in the display of bibliographic information.
7858 \begin_inset CommandInset ref
7860 reference "sub:Citation-format-description"
7866 \begin_inset Quotes eld
7870 \begin_inset Flex Code
7873 \begin_layout Plain Layout
7880 \begin_inset Quotes erd
7886 \begin_layout Description
7887 \begin_inset Flex Code
7890 \begin_layout Plain Layout
7896 Describes various global options supported by the document class.
7898 \begin_inset space ~
7902 \begin_inset CommandInset ref
7904 reference "sub:ClassOptions"
7910 \begin_inset Quotes eld
7914 \begin_inset Flex Code
7917 \begin_layout Plain Layout
7924 \begin_inset Quotes erd
7930 \begin_layout Description
7931 \begin_inset Flex Code
7934 \begin_layout Plain Layout
7941 \begin_inset Flex Code
7944 \begin_layout Plain Layout
7953 \begin_inset Flex Code
7956 \begin_layout Plain Layout
7962 ] Whether the class should
7966 to having one or two columns.
7967 Can be changed in the
7968 \begin_inset Flex MenuItem
7971 \begin_layout Plain Layout
7972 Document\SpecialChar \menuseparator
7981 \begin_layout Description
7982 \begin_inset Flex Code
7985 \begin_layout Plain Layout
7992 \begin_inset Flex Code
7995 \begin_layout Plain Layout
8001 ] This sequence defines the properties for a counter.
8002 If the counter does not yet exist, it is created; if it does exist, it
8005 \begin_inset Quotes eld
8009 \begin_inset Flex Code
8012 \begin_layout Plain Layout
8019 \begin_inset Quotes erd
8023 \begin_inset Newline newline
8027 \begin_inset space ~
8031 \begin_inset CommandInset ref
8033 reference "sub:Counters"
8037 for details on counters.
8040 \begin_layout Description
8041 \begin_inset Flex Code
8044 \begin_layout Plain Layout
8050 Sets the default font used to display the document.
8052 \begin_inset space ~
8056 \begin_inset CommandInset ref
8058 reference "sub:Font-description"
8062 for how to declare fonts.
8064 \begin_inset Quotes eld
8068 \begin_inset Flex Code
8071 \begin_layout Plain Layout
8078 \begin_inset Quotes erd
8084 \begin_layout Description
8085 \begin_inset Flex Code
8088 \begin_layout Plain Layout
8095 \begin_inset Flex Code
8098 \begin_layout Plain Layout
8104 Specifies a module to be included by default with this document class.
8105 The module should be specified by filename without the
8106 \begin_inset Flex Code
8109 \begin_layout Plain Layout
8116 The user can still remove the module, but it will be active at the outset.
8117 (This applies only when new files are created, or when this class is chosen
8118 for an existing document.)
8121 \begin_layout Description
8122 \begin_inset Flex Code
8125 \begin_layout Plain Layout
8132 \begin_inset Flex Code
8135 \begin_layout Plain Layout
8141 ] This is the style that will be assigned to new paragraphs, usually
8142 \begin_inset Flex MenuItem
8145 \begin_layout Plain Layout
8152 This will default to the first defined style if not given, but you are
8153 encouraged to use this directive.
8156 \begin_layout Description
8157 \begin_inset Flex Code
8160 \begin_layout Plain Layout
8167 \begin_inset Flex Code
8170 \begin_layout Plain Layout
8176 ] This tag indicates that the module in question—which should be specified
8177 by filename without the
8178 \begin_inset Flex Code
8181 \begin_layout Plain Layout
8187 extension—cannot be used with this document class.
8188 This might be used in a journal-specific layout file to prevent, say, the
8190 \begin_inset Flex Code
8193 \begin_layout Plain Layout
8199 module that numbers theorems by section.
8204 be used in a module.
8205 Modules have their own way of excluding other modules (see
8206 \begin_inset CommandInset ref
8208 reference "sub:Layout-modules"
8215 \begin_layout Description
8216 \begin_inset Flex Code
8219 \begin_layout Plain Layout
8225 Defines a new float.
8227 \begin_inset space ~
8231 \begin_inset CommandInset ref
8233 reference "sub:Floats"
8239 \begin_inset Quotes eld
8243 \begin_inset Flex Code
8246 \begin_layout Plain Layout
8253 \begin_inset Quotes erd
8259 \begin_layout Description
8260 \begin_inset Flex Code
8263 \begin_layout Plain Layout
8269 Sets the information that will be output in the
8270 \begin_inset Flex Code
8273 \begin_layout Plain Layout
8279 block when this document class is output to XHTML.
8280 Note that this will completely override any prior
8281 \begin_inset Flex Code
8284 \begin_layout Plain Layout
8291 \begin_inset Flex Code
8294 \begin_layout Plain Layout
8302 \begin_inset Flex Code
8305 \begin_layout Plain Layout
8311 if you just want to add material to the preamble.) Must end with
8312 \begin_inset Quotes eld
8316 \begin_inset Flex Code
8319 \begin_layout Plain Layout
8326 \begin_inset Quotes erd
8332 \begin_layout Description
8333 \begin_inset Flex Code
8336 \begin_layout Plain Layout
8343 \begin_inset Flex Code
8346 \begin_layout Plain Layout
8352 ] The layout to use for the table of contents, bibliography, and so forth,
8353 when the document is output to HTML.
8354 For articles, this should normally be Section; for books, Chapter.
8355 If it is not given, then LyX will attempt to figure out which layout to
8359 \begin_layout Description
8360 \begin_inset Flex Code
8363 \begin_layout Plain Layout
8370 \begin_inset Flex Code
8373 \begin_layout Plain Layout
8379 ] Modifies the properties of the given counter.
8380 If the counter does not exist, the section is ignored.
8382 \begin_inset Quotes eld
8386 \begin_inset Flex Code
8389 \begin_layout Plain Layout
8396 \begin_inset Quotes erd
8400 \begin_inset Newline newline
8404 \begin_inset space ~
8408 \begin_inset CommandInset ref
8410 reference "sub:Counters"
8414 for details on counters.
8417 \begin_layout Description
8418 \begin_inset Flex Code
8421 \begin_layout Plain Layout
8428 \begin_inset Flex Code
8431 \begin_layout Plain Layout
8437 ] Modifies the properties of the given paragraph style.
8438 If the style does not exist, the section is ignored.
8440 \begin_inset Quotes eld
8444 \begin_inset Flex Code
8447 \begin_layout Plain Layout
8454 \begin_inset Quotes erd
8460 \begin_layout Description
8461 \begin_inset Flex Code
8464 \begin_layout Plain Layout
8470 As its name implies, this command allows you to include another layout
8471 definition file within yours to avoid duplicating commands.
8472 Common examples are the standard layout files, for example,
8473 \begin_inset Flex Code
8476 \begin_layout Plain Layout
8482 , which contains most of the basic layouts.
8485 \begin_layout Description
8486 \begin_inset Flex Code
8489 \begin_layout Plain Layout
8495 This section (re-)defines the layout of an inset.
8496 It can be applied to an existing inset or to a new, user-defined inset,
8497 e.g., a new character style.
8499 \begin_inset Quotes eld
8503 \begin_inset Flex Code
8506 \begin_layout Plain Layout
8513 \begin_inset Quotes erd
8517 \begin_inset Newline newline
8521 \begin_inset space ~
8525 \begin_inset CommandInset ref
8527 reference "sub:Flex-insets-and"
8531 for more information.
8535 \begin_layout Description
8536 \begin_inset Flex Code
8539 \begin_layout Plain Layout
8546 \begin_inset Flex Code
8549 \begin_layout Plain Layout
8555 ] A string that indicates the width of the left margin on the screen, for
8557 \begin_inset Quotes eld
8561 \begin_inset Quotes erd
8565 (Note that this is not a `length', like
8566 \begin_inset Quotes eld
8570 \begin_inset Quotes erd
8576 \begin_layout Description
8577 \begin_inset Flex Code
8580 \begin_layout Plain Layout
8587 \begin_inset Flex Code
8590 \begin_layout Plain Layout
8596 ] This command deletes an existing counter, usually one defined in an included
8600 \begin_layout Description
8601 \begin_inset Flex Code
8604 \begin_layout Plain Layout
8610 This command deletes an existing float.
8611 This is particularly useful when you want to suppress a float that has
8612 been defined in an input file.
8615 \begin_layout Description
8616 \begin_inset Flex Code
8619 \begin_layout Plain Layout
8625 This command deletes an existing style.
8626 This is particularly useful when you want to suppress a style that has
8627 be defined in an input file.
8630 \begin_layout Description
8631 \begin_inset Flex Code
8634 \begin_layout Plain Layout
8640 A string indicating the file format (as defined in the Preferences dialog)
8641 produced by this class.
8642 It is mainly useful when
8643 \begin_inset Flex Code
8646 \begin_layout Plain Layout
8652 is `literate' and one wants to define a new type of literate document.
8653 This string is reset to `docbook', `latex', or `literate' when the correspondin
8655 \begin_inset Flex Code
8658 \begin_layout Plain Layout
8664 parameter is encountered.
8667 \begin_layout Description
8668 \begin_inset Flex Code
8671 \begin_layout Plain Layout
8677 A string indicating what sort of output documents using this class will
8679 At present, the options are: `docbook', `latex', and `literate'.
8682 \begin_layout Description
8683 \begin_inset Flex Code
8686 \begin_layout Plain Layout
8693 \begin_inset Flex Code
8696 \begin_layout Plain Layout
8705 \begin_inset Flex Code
8708 \begin_layout Plain Layout
8715 \begin_inset Flex Code
8718 \begin_layout Plain Layout
8724 ] The default pagestyle.
8725 Can be changed in the
8726 \begin_inset Flex MenuItem
8729 \begin_layout Plain Layout
8730 Document\SpecialChar \menuseparator
8739 \begin_layout Description
8740 \begin_inset Flex Code
8743 \begin_layout Plain Layout
8749 Sets the preamble for the LaTeX document.
8750 Note that this will completely override any prior
8751 \begin_inset Flex Code
8754 \begin_layout Plain Layout
8761 \begin_inset Flex Code
8764 \begin_layout Plain Layout
8772 \begin_inset Flex Code
8775 \begin_layout Plain Layout
8781 if you just want to add material to the preamble.) Must end with
8782 \begin_inset Quotes eld
8786 \begin_inset Flex Code
8789 \begin_layout Plain Layout
8796 \begin_inset Quotes erd
8802 \begin_layout Description
8803 \begin_inset Flex Code
8806 \begin_layout Plain Layout
8813 \begin_inset Flex Code
8816 \begin_layout Plain Layout
8823 \begin_inset Flex Code
8826 \begin_layout Plain Layout
8835 \begin_inset Flex Code
8838 \begin_layout Plain Layout
8844 ] Whether the class already provides the feature
8845 \begin_inset Flex Code
8848 \begin_layout Plain Layout
8855 A feature is in general the name of a package (
8856 \begin_inset Flex Code
8859 \begin_layout Plain Layout
8866 \begin_inset Flex Code
8869 \begin_layout Plain Layout
8875 , \SpecialChar \ldots{}
8877 \begin_inset Flex Code
8880 \begin_layout Plain Layout
8887 \begin_inset Flex Code
8890 \begin_layout Plain Layout
8896 ,\SpecialChar \ldots{}
8897 ); the complete list of supported features is unfortunately not documented
8898 outside the LyX source code—but see
8899 \begin_inset Flex Code
8902 \begin_layout Plain Layout
8908 if you're interested.
8910 \begin_inset Flex MenuItem
8913 \begin_layout Plain Layout
8914 Help\SpecialChar \menuseparator
8920 also gives an overview of the supported packages.
8923 \begin_layout Description
8924 \begin_inset Flex Code
8927 \begin_layout Plain Layout
8934 \begin_inset Flex Code
8937 \begin_layout Plain Layout
8943 ] Indicates that this layout provides the functionality of the module mentioned,
8944 which should be specified by the filename without the
8945 \begin_inset Flex Code
8948 \begin_layout Plain Layout
8955 This will typically be used if the layout includes the module directly,
8956 rather than using the
8957 \begin_inset Flex Code
8960 \begin_layout Plain Layout
8966 tag to indicate that it ought to be used.
8967 It could also be used in a module that provided an alternate implementation
8968 of the same functionality.
8971 \begin_layout Description
8972 \begin_inset Flex Code
8975 \begin_layout Plain Layout
8982 \begin_inset Flex Code
8985 \begin_layout Plain Layout
8991 ] Whether the class requires the feature
8992 \begin_inset Flex Code
8995 \begin_layout Plain Layout
9002 Multiple features must be separated by commas.
9003 Note that you can only request supported features.
9005 \begin_inset Flex Code
9008 \begin_layout Plain Layout
9014 for a list of these.)
9017 \begin_layout Description
9018 \begin_inset Flex Code
9021 \begin_layout Plain Layout
9027 A string that indicates the width of the right margin on the screen, for
9029 \begin_inset Quotes eld
9033 \begin_inset Quotes erd
9039 \begin_layout Description
9040 \begin_inset Flex Code
9043 \begin_layout Plain Layout
9049 Sets which divisions get numbered.
9051 \begin_inset Flex Code
9054 \begin_layout Plain Layout
9063 \begin_layout Description
9064 \begin_inset Flex Code
9067 \begin_layout Plain Layout
9074 \begin_inset Flex Code
9077 \begin_layout Plain Layout
9086 \begin_inset Flex Code
9089 \begin_layout Plain Layout
9095 ] Whether the class-default should be printing on one or both sides of the
9097 Can be changed in the
9098 \begin_inset Flex MenuItem
9101 \begin_layout Plain Layout
9102 Document\SpecialChar \menuseparator
9111 \begin_layout Description
9112 \begin_inset Flex Code
9115 \begin_layout Plain Layout
9121 This sequence defines a paragraph style.
9122 If the style does not yet exist, it is created; if it does exist, its parameter
9125 \begin_inset Quotes eld
9129 \begin_inset Flex Code
9132 \begin_layout Plain Layout
9139 \begin_inset Quotes erd
9143 \begin_inset Newline newline
9147 \begin_inset space ~
9151 \begin_inset CommandInset ref
9153 reference "sub:Paragraph-Styles"
9157 for details on paragraph styles.
9160 \begin_layout Description
9161 \begin_inset Flex Code
9164 \begin_layout Plain Layout
9171 \begin_inset Flex Code
9174 \begin_layout Plain Layout
9180 ] The name of the command or environment to be used with
9181 \begin_inset Flex Code
9184 \begin_layout Plain Layout
9193 \begin_layout Description
9194 \begin_inset Flex Code
9197 \begin_layout Plain Layout
9204 \begin_inset Flex Code
9207 \begin_layout Plain Layout
9216 \begin_inset Flex Code
9219 \begin_layout Plain Layout
9225 ] Indicates what kind of markup is used to define the title of a document.
9227 \begin_inset Flex Code
9230 \begin_layout Plain Layout
9236 means that the macro with name
9237 \begin_inset Flex Code
9240 \begin_layout Plain Layout
9246 will be inserted after the last layout which has
9247 \begin_inset Quotes eld
9251 \begin_inset Flex Code
9254 \begin_layout Plain Layout
9261 \begin_inset Quotes erd
9266 \begin_inset Flex Code
9269 \begin_layout Plain Layout
9275 corresponds to the case where the block of paragraphs which have
9276 \begin_inset Quotes eld
9280 \begin_inset Flex Code
9283 \begin_layout Plain Layout
9290 \begin_inset Quotes erd
9293 should be enclosed into the
9294 \begin_inset Flex Code
9297 \begin_layout Plain Layout
9306 \begin_layout Description
9307 \begin_inset Flex Code
9310 \begin_layout Plain Layout
9316 Sets which divisions are included in the table of contents.
9318 \begin_inset Flex Code
9321 \begin_layout Plain Layout
9330 \begin_layout Subsection
9331 \begin_inset Flex Code
9334 \begin_layout Plain Layout
9341 \begin_inset CommandInset label
9343 name "sub:ClassOptions"
9350 \begin_layout Standard
9352 \begin_inset Flex Code
9355 \begin_layout Plain Layout
9361 section can contain the following entries:
9364 \begin_layout Description
9365 \begin_inset Flex Code
9368 \begin_layout Plain Layout
9375 \begin_inset Flex Code
9378 \begin_layout Plain Layout
9384 ] The list of available font sizes for the document's main font, separated
9386 \begin_inset Quotes eld
9390 \begin_inset Flex Code
9393 \begin_layout Plain Layout
9400 \begin_inset Quotes erd
9406 \begin_layout Description
9407 \begin_inset Flex Code
9410 \begin_layout Plain Layout
9416 Used to set the DTD line with XML-based output classes.
9418 \begin_inset space \thinspace{}
9422 \begin_inset Quotes eld
9425 -//OASIS//DTD DocBook V4.2//EN
9426 \begin_inset Quotes erd
9432 \begin_layout Description
9433 \begin_inset Flex Code
9436 \begin_layout Plain Layout
9443 \begin_inset Flex Code
9446 \begin_layout Plain Layout
9447 string="empty|plain|headings|fancy"
9452 ] The list of available page styles, separated by
9453 \begin_inset Quotes eld
9457 \begin_inset Flex Code
9460 \begin_layout Plain Layout
9467 \begin_inset Quotes erd
9473 \begin_layout Description
9474 \begin_inset Flex Code
9477 \begin_layout Plain Layout
9484 \begin_inset Flex Code
9487 \begin_layout Plain Layout
9493 ] Some document class options, separated by a comma, that will be added
9494 to the optional part of the
9495 \begin_inset Flex Code
9498 \begin_layout Plain Layout
9509 \begin_layout Standard
9511 \begin_inset Flex Code
9514 \begin_layout Plain Layout
9520 section must end with
9521 \begin_inset Quotes eld
9525 \begin_inset Flex Code
9528 \begin_layout Plain Layout
9535 \begin_inset Quotes erd
9541 \begin_layout Subsection
9543 \begin_inset CommandInset label
9545 name "sub:Paragraph-Styles"
9552 \begin_layout Standard
9553 A paragraph style description looks like this:
9557 \begin_layout Plain Layout
9558 Note that this will either define a new style or modify an existing one.
9566 \begin_layout LyX-Code
9573 \begin_layout LyX-Code
9577 \begin_layout LyX-Code
9581 \begin_layout Standard
9582 where the following commands are allowed:
9585 \begin_layout Description
9586 \begin_inset Flex Code
9589 \begin_layout Plain Layout
9596 \begin_inset Flex Code
9599 \begin_layout Plain Layout
9604 , left, right, center
9609 ] Paragraph alignment.
9612 \begin_layout Description
9613 \begin_inset Flex Code
9616 \begin_layout Plain Layout
9623 \begin_inset Flex Code
9626 \begin_layout Plain Layout
9631 , left, right, center
9636 ] A comma separated list of permitted alignments.
9637 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9639 For example a right-aligned or centered enumeration isn't possible.)
9642 \begin_layout Description
9643 \begin_inset Flex Code
9646 \begin_layout Plain Layout
9652 Note that this will completely override any prior
9653 \begin_inset Flex Code
9656 \begin_layout Plain Layout
9662 declaration for this style.
9664 \begin_inset Quotes eld
9668 \begin_inset Flex Code
9671 \begin_layout Plain Layout
9678 \begin_inset Quotes erd
9683 \begin_inset CommandInset ref
9685 reference "sub:I18n"
9689 for details on its use.
9692 \begin_layout Description
9693 \begin_inset Flex Code
9696 \begin_layout Plain Layout
9703 \begin_inset Flex Code
9706 \begin_layout Plain Layout
9716 \begin_layout Plain Layout
9717 Note that a `float' here is a real number, such as: 1.5.
9722 The vertical space with which the last of a chain of paragraphs with this
9723 style is separated from the following paragraph.
9724 If the next paragraph has another style, the separations are not simply
9725 added, but the maximum is taken.
9728 \begin_layout Description
9729 \begin_inset Flex Code
9732 \begin_layout Plain Layout
9739 \begin_inset Flex Code
9742 \begin_layout Plain Layout
9748 The category for this style.
9749 This is used to group related styles in the style combobox on the toolbar.
9750 Any string can be used, but you may want to use existing categories with
9755 \begin_layout Description
9756 \begin_inset Flex Code
9759 \begin_layout Plain Layout
9765 Depth of XML command.
9766 Used only with XML-type formats.
9769 \begin_layout Description
9770 \begin_inset Flex Code
9773 \begin_layout Plain Layout
9780 \begin_inset Flex Code
9783 \begin_layout Plain Layout
9789 Copies all the features of an existing style into the current one.
9793 \begin_layout Description
9794 \begin_inset Flex Code
9797 \begin_layout Plain Layout
9803 The name of a style whose preamble should be output
9808 This allows to ensure some ordering of the preamble snippets when macros
9809 definitions depend on one another.
9813 \begin_layout Plain Layout
9814 Note that, besides that functionality, there is no way to ensure any ordering
9816 The ordering that you see in a given version of LyX may change without
9817 warning in later versions.
9825 \begin_layout Description
9826 \begin_inset Flex Code
9829 \begin_layout Plain Layout
9836 \begin_inset Flex Code
9839 \begin_layout Plain Layout
9844 , Box, Filled_Box, Static
9849 ] The type of label that stands at the end of the paragraph (or sequence
9851 \begin_inset Flex Code
9854 \begin_layout Plain Layout
9861 \begin_inset Flex Code
9864 \begin_layout Plain Layout
9871 \begin_inset Flex Code
9874 \begin_layout Plain Layout
9881 \begin_inset Flex Code
9884 \begin_layout Plain Layout
9892 \begin_inset Flex Code
9895 \begin_layout Plain Layout
9902 \begin_inset Quotes eld
9906 \begin_inset Quotes erd
9910 \begin_inset Flex Code
9913 \begin_layout Plain Layout
9920 \begin_inset Flex Code
9923 \begin_layout Plain Layout
9924 \begin_inset space ~
9933 \begin_inset space ~
9936 black) square suitable for end of proof markers,
9937 \begin_inset Flex Code
9940 \begin_layout Plain Layout
9946 is an explicit text string.
9949 \begin_layout Description
9950 \begin_inset Flex Code
9953 \begin_layout Plain Layout
9960 \begin_inset Flex Code
9963 \begin_layout Plain Layout
9969 ] The string used for a label with a
9970 \begin_inset Flex Code
9973 \begin_layout Plain Layout
9980 \begin_inset Flex Code
9983 \begin_layout Plain Layout
9993 \begin_layout Description
9994 \begin_inset Flex Code
9997 \begin_layout Plain Layout
10003 The font used for both the text body
10009 \begin_inset space ~
10013 \begin_inset CommandInset ref
10015 reference "sub:Font-description"
10020 Note that defining this font automatically defines the
10021 \begin_inset Flex Code
10024 \begin_layout Plain Layout
10031 So you should define this one first if you also want to define
10032 \begin_inset Flex Code
10035 \begin_layout Plain Layout
10044 \begin_layout Description
10045 \begin_inset Flex Code
10048 \begin_layout Plain Layout
10055 \begin_inset CommandInset label
10057 name "des:FreeSpacing"
10062 \begin_inset Flex Code
10065 \begin_layout Plain Layout
10074 \begin_inset Flex Code
10077 \begin_layout Plain Layout
10083 ] Usually LyX doesn't allow you to insert more than one space between words,
10084 since a space is considered as the separation between two words, not a
10085 character or symbol of its own.
10086 This is a very fine thing but sometimes annoying, for example, when typing
10087 program code or plain LaTeX code.
10089 \begin_inset Flex Code
10092 \begin_layout Plain Layout
10099 Note that LyX will create protected blanks for the additional blanks when
10100 in another mode than LaTeX-mode.
10103 \begin_layout Description
10104 \begin_inset Flex Code
10107 \begin_layout Plain Layout
10113 These tags are used with XHTML output.
10115 \begin_inset CommandInset ref
10117 reference "sub:Paragraph-Style-XHTML"
10124 \begin_layout Description
10125 \begin_inset Flex Code
10128 \begin_layout Plain Layout
10134 [[FIXME]] (Used only with XML-type formats.)
10137 \begin_layout Description
10138 \begin_inset Flex Code
10141 \begin_layout Plain Layout
10148 \begin_inset Flex Code
10151 \begin_layout Plain Layout
10157 If 1, marks the style as to be included in the document preamble rather
10158 than in the document body.
10159 This is useful for document classes that want such information as the title
10160 and author to appear in the preamble.
10161 Note that this works only for styles for which the
10162 \begin_inset Flex Code
10165 \begin_layout Plain Layout
10172 \begin_inset Flex Code
10175 \begin_layout Plain Layout
10182 \begin_inset Flex Code
10185 \begin_layout Plain Layout
10194 \begin_layout Description
10195 \begin_inset Flex Code
10198 \begin_layout Plain Layout
10205 \begin_inset Flex Code
10208 \begin_layout Plain Layout
10214 If 1, marks the style as being part of a title block (see also the
10215 \begin_inset Flex Code
10218 \begin_layout Plain Layout
10225 \begin_inset Flex Code
10228 \begin_layout Plain Layout
10237 \begin_layout Description
10238 \begin_inset Flex Code
10241 \begin_layout Plain Layout
10248 \begin_inset Flex Code
10251 \begin_layout Plain Layout
10257 ] This provides extra space between paragraphs that have the same style.
10258 If you put other styles into an environment, each is separated with the
10260 \begin_inset Flex Code
10263 \begin_layout Plain Layout
10270 But the whole items of the environment are additionally separated with
10272 \begin_inset Flex Code
10275 \begin_layout Plain Layout
10282 Note that this is a
10287 \begin_layout Description
10288 \begin_inset Flex Code
10291 \begin_layout Plain Layout
10297 [[FIXME]] (Used only with XML-type formats.)
10300 \begin_layout Description
10301 \begin_inset Flex Code
10304 \begin_layout Plain Layout
10311 \begin_inset Flex Code
10314 \begin_layout Plain Layout
10323 \begin_inset Flex Code
10326 \begin_layout Plain Layout
10332 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10333 lead to empty LaTeX output.
10334 There are some cases where this could be desirable however: in a letter
10335 template, the required fields can be provided as empty fields, so that
10336 people do not forget them; in some special classes, a style can be used
10337 as some kind of break, which does not contain actual text.
10340 \begin_layout Description
10341 \begin_inset Flex Code
10344 \begin_layout Plain Layout
10350 [float=0] The vertical space between the label and the text body.
10351 Only used for labels that are above the text body (
10352 \begin_inset Flex Code
10355 \begin_layout Plain Layout
10362 \begin_inset Flex Code
10365 \begin_layout Plain Layout
10366 Centered_Top_Environment
10374 \begin_layout Description
10375 \begin_inset Flex Code
10378 \begin_layout Plain Layout
10385 \begin_inset Flex Code
10388 \begin_layout Plain Layout
10395 \begin_inset Newline newline
10398 The name of the counter for automatic numbering.
10400 \begin_inset Newline newline
10408 \begin_inset Flex Code
10411 \begin_layout Plain Layout
10418 \begin_inset Flex Code
10421 \begin_layout Plain Layout
10428 In that case, the counter will be stepped each time the style appears.
10430 \begin_inset Newline newline
10438 \begin_inset Flex Code
10441 \begin_layout Plain Layout
10448 \begin_inset Flex Code
10451 \begin_layout Plain Layout
10457 , though this case is a bit complicated.
10458 Suppose you declare
10459 \begin_inset Quotes eld
10463 \begin_inset Flex Code
10466 \begin_layout Plain Layout
10467 LabelCounter myenum
10473 \begin_inset Quotes erd
10477 Then the actual counters used are
10478 \begin_inset Flex Code
10481 \begin_layout Plain Layout
10488 \begin_inset Flex Code
10491 \begin_layout Plain Layout
10498 \begin_inset Flex Code
10501 \begin_layout Plain Layout
10508 \begin_inset Flex Code
10511 \begin_layout Plain Layout
10517 , much as in LaTeX.
10518 These counters must all be declared separately.
10519 \begin_inset Newline newline
10523 \begin_inset CommandInset ref
10525 reference "sub:Counters"
10529 for details on counters.
10532 \begin_layout Description
10533 \begin_inset Flex Code
10536 \begin_layout Plain Layout
10542 The font used for the label.
10544 \begin_inset space ~
10548 \begin_inset CommandInset ref
10550 reference "sub:Font-description"
10557 \begin_layout Description
10558 \begin_inset Flex Code
10561 \begin_layout Plain Layout
10567 Text that indicates how far a label should be indented.
10570 \begin_layout Description
10571 \begin_inset Flex Code
10574 \begin_layout Plain Layout
10581 \begin_inset Flex Code
10584 \begin_layout Plain Layout
10590 ] The horizontal space between the label and the text body.
10591 Only used for labels that are not above the text body.
10594 \begin_layout Description
10595 \begin_inset Flex Code
10598 \begin_layout Plain Layout
10605 \begin_inset Flex Code
10608 \begin_layout Plain Layout
10614 ] The string used for a label with a
10615 \begin_inset Flex Code
10618 \begin_layout Plain Layout
10626 \begin_inset Flex Code
10629 \begin_layout Plain Layout
10635 is set, this string can be contain the special formatting commands described
10637 \begin_inset CommandInset ref
10639 reference "sub:Counters"
10647 \begin_layout Plain Layout
10648 For the sake of backwards compatibility, the string
10649 \begin_inset Flex Code
10652 \begin_layout Plain Layout
10662 will be replaced by the expanded
10663 \begin_inset Flex Code
10666 \begin_layout Plain Layout
10673 \begin_inset Flex Code
10676 \begin_layout Plain Layout
10685 This feature is now obsolete and should be replaced by the mechanisms of
10687 \begin_inset CommandInset ref
10689 reference "sub:Counters"
10701 \begin_layout Description
10702 \begin_inset Flex Code
10705 \begin_layout Plain Layout
10706 LabelStringAppendix
10712 \begin_inset Flex Code
10715 \begin_layout Plain Layout
10721 ] This is used inside the appendix instead of
10722 \begin_inset Flex Code
10725 \begin_layout Plain Layout
10733 \begin_inset Flex Code
10736 \begin_layout Plain Layout
10743 \begin_inset Flex Code
10746 \begin_layout Plain Layout
10747 LabelStringAppendix
10755 \begin_layout Description
10756 \begin_inset Flex Code
10759 \begin_layout Plain Layout
10765 [FIXME] (Used only with XML-type formats.)
10768 \begin_layout Description
10769 \begin_inset Flex Code
10772 \begin_layout Plain Layout
10779 \begin_inset Flex Code
10782 \begin_layout Plain Layout
10787 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10788 Enumerate, Itemize, Bibliography
10797 \begin_layout Itemize
10798 \begin_inset Flex Code
10801 \begin_layout Plain Layout
10807 means the label is the very first word (up to the first real blank).
10808 Use protected spaces (like
10809 \begin_inset space ~
10812 that one) if you want more than one word as the label.
10816 \begin_layout Itemize
10817 \begin_inset Flex Code
10820 \begin_layout Plain Layout
10826 means the label is simply whatever
10827 \begin_inset Flex Code
10830 \begin_layout Plain Layout
10837 Note that this really is `static'.
10840 \begin_layout Itemize
10841 \begin_inset Flex Code
10844 \begin_layout Plain Layout
10851 \begin_inset Flex Code
10854 \begin_layout Plain Layout
10855 Centered_Top_Environment
10860 are special cases of
10861 \begin_inset Flex Code
10864 \begin_layout Plain Layout
10871 The label will be printed above the paragraph, but only at the top of an
10872 environment or the top of a chain of paragraphs with this style.
10873 This might be used with the
10874 \begin_inset Flex MenuItem
10877 \begin_layout Plain Layout
10883 style, for example.
10886 \begin_layout Itemize
10887 \begin_inset Flex Code
10890 \begin_layout Plain Layout
10896 is a special case for the caption-labels
10897 \begin_inset Quotes eld
10901 \begin_inset Quotes erd
10905 \begin_inset Quotes eld
10909 \begin_inset Quotes erd
10914 \begin_inset Flex Code
10917 \begin_layout Plain Layout
10923 means the (hardcoded) label string depends on the kind of float: It is
10924 hardcoded to be `FloatType N', where N is the value of the counter associated
10928 \begin_layout Itemize
10930 \begin_inset Flex Code
10933 \begin_layout Plain Layout
10939 label type defines automatically numbered labels.
10941 \begin_inset Flex Code
10944 \begin_layout Plain Layout
10950 will be expanded to resolve any counter references it contains: For example,
10952 \begin_inset Quotes eld
10956 \begin_inset Flex Code
10959 \begin_layout Plain Layout
10970 \begin_inset Quotes erd
10975 \begin_inset CommandInset ref
10977 reference "sub:Counters"
10981 for more information on counters.
10984 \begin_layout Itemize
10985 \begin_inset Flex Code
10988 \begin_layout Plain Layout
10994 produces the usual sort of enumeration labels.
10995 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10996 small Roman numerals, and uppercase letters for the four possible depths.
10999 \begin_layout Itemize
11000 \begin_inset Flex Code
11003 \begin_layout Plain Layout
11009 produces various bullets at the different levels.
11010 It is also hardcoded.
11013 \begin_layout Itemize
11014 \begin_inset Flex Code
11017 \begin_layout Plain Layout
11023 is used internally by LyX and should be used only with
11024 \begin_inset Flex Code
11027 \begin_layout Plain Layout
11028 LatexType BibEnvironment
11037 \begin_layout Description
11038 \begin_inset Flex Code
11041 \begin_layout Plain Layout
11047 Note that this will completely override any prior
11048 \begin_inset Flex Code
11051 \begin_layout Plain Layout
11057 declaration for this style.
11059 \begin_inset Quotes eld
11063 \begin_inset Flex Code
11066 \begin_layout Plain Layout
11073 \begin_inset Quotes erd
11078 \begin_inset CommandInset ref
11080 reference "sub:I18n"
11084 for details on its use.
11087 \begin_layout Description
11088 \begin_inset Flex Code
11091 \begin_layout Plain Layout
11097 The name of the corresponding LaTeX stuff.
11098 Either the environment or command name.
11101 \begin_layout Description
11102 \begin_inset Flex Code
11105 \begin_layout Plain Layout
11111 An optional parameter for the corresponding
11112 \begin_inset Flex Code
11115 \begin_layout Plain Layout
11122 This parameter cannot be changed from within LyX.
11125 \begin_layout Description
11126 \begin_inset Flex Code
11129 \begin_layout Plain Layout
11136 \begin_inset Flex Code
11139 \begin_layout Plain Layout
11144 , Command, Environment, Item_Environment,
11150 \begin_inset Flex Code
11153 \begin_layout Plain Layout
11154 List_Environment, Bib_Environment
11159 ] How the style should be translated into LaTeX.
11163 \begin_layout Plain Layout
11164 \begin_inset Flex Code
11167 \begin_layout Plain Layout
11173 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11174 Visit the SGML class files for specific examples.
11183 \begin_layout Itemize
11184 \begin_inset Flex Code
11187 \begin_layout Plain Layout
11193 means nothing special.
11197 \begin_layout Itemize
11198 \begin_inset Flex Code
11201 \begin_layout Plain Layout
11208 \begin_inset Flex Code
11211 \begin_layout Plain Layout
11218 {\SpecialChar \ldots{}
11227 \begin_layout Itemize
11228 \begin_inset Flex Code
11231 \begin_layout Plain Layout
11238 \begin_inset Flex Code
11241 \begin_layout Plain Layout
11248 }\SpecialChar \ldots{}
11264 \begin_layout Itemize
11265 \begin_inset Flex Code
11268 \begin_layout Plain Layout
11275 \begin_inset Flex Code
11278 \begin_layout Plain Layout
11285 \begin_inset Flex Code
11288 \begin_layout Plain Layout
11296 is generated for each paragraph of this environment.
11300 \begin_layout Itemize
11301 \begin_inset Flex Code
11304 \begin_layout Plain Layout
11311 \begin_inset Flex Code
11314 \begin_layout Plain Layout
11321 \begin_inset Flex Code
11324 \begin_layout Plain Layout
11330 is passed as an argument to the environment.
11332 \begin_inset Flex Code
11335 \begin_layout Plain Layout
11341 can be defined in the
11342 \begin_inset Flex MenuItem
11345 \begin_layout Plain Layout
11350 \SpecialChar \menuseparator
11356 \begin_inset space ~
11368 \begin_layout Standard
11369 Putting the last few things together, the LaTeX output will be either:
11372 \begin_layout LyX-Code
11375 latexname[latexparam]{\SpecialChar \ldots{}
11379 \begin_layout Standard
11383 \begin_layout LyX-Code
11386 begin{latexname}[latexparam] \SpecialChar \ldots{}
11392 \begin_layout Standard
11393 depending upon the LaTeX type.
11397 \begin_layout Description
11398 \begin_inset Flex Code
11401 \begin_layout Plain Layout
11408 \begin_inset Flex Code
11411 \begin_layout Plain Layout
11417 ] If you put styles into environments, the leftmargins are not simply added,
11418 but added with a factor
11419 \begin_inset Formula $\frac{4}{depth+4}$
11423 Note that this parameter is also used when the margin is defined as
11424 \begin_inset Flex Code
11427 \begin_layout Plain Layout
11434 \begin_inset Flex Code
11437 \begin_layout Plain Layout
11444 Then it is added to the manual or dynamic margin.
11446 \begin_inset Newline newline
11449 The argument is passed as a string.
11451 \begin_inset Quotes eld
11455 \begin_inset Flex Code
11458 \begin_layout Plain Layout
11465 \begin_inset Quotes erd
11468 means that the paragraph is indented with the width of
11469 \begin_inset Quotes eld
11473 \begin_inset Flex Code
11476 \begin_layout Plain Layout
11483 \begin_inset Quotes erd
11486 in the normal font.
11487 You can get a negative width by prefixing the string with
11488 \begin_inset Quotes eld
11492 \begin_inset Flex Code
11495 \begin_layout Plain Layout
11502 \begin_inset Quotes erd
11506 This way was chosen so that the look is the same with each used screen
11511 \begin_layout Description
11512 \begin_inset Flex Code
11515 \begin_layout Plain Layout
11522 \begin_inset Flex Code
11525 \begin_layout Plain Layout
11530 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11536 \begin_inset Newline newline
11539 The kind of margin that the style has on the left side.
11541 \begin_inset Flex Code
11544 \begin_layout Plain Layout
11550 just means a fixed margin.
11552 \begin_inset Flex Code
11555 \begin_layout Plain Layout
11561 means that the left margin depends on the string entered in the
11562 \begin_inset Flex MenuItem
11565 \begin_layout Plain Layout
11566 Edit\SpecialChar \menuseparator
11568 \begin_inset space ~
11577 This is used to typeset nice lists without tabulators.
11579 \begin_inset Flex Code
11582 \begin_layout Plain Layout
11588 means that the margin depends on the size of the label.
11589 This is used for automatic enumerated headlines.
11590 It is obvious that the headline
11591 \begin_inset Quotes eld
11594 5.4.3.2.1 Very long headline
11595 \begin_inset Quotes erd
11598 must have a wider left margin (as wide as
11599 \begin_inset Quotes eld
11603 \begin_inset Quotes erd
11606 plus the space) than
11607 \begin_inset Quotes eld
11610 3.2 Very long headline
11611 \begin_inset Quotes erd
11615 \begin_inset Quotes eld
11619 \begin_inset Quotes erd
11622 are not able to do this.
11624 \begin_inset Flex Code
11627 \begin_layout Plain Layout
11633 is similar, but only the very first row of the paragraph is dynamic, while
11634 the others are static; this is used, for example, for descriptions.
11636 \begin_inset Flex Code
11639 \begin_layout Plain Layout
11645 means the margin is chosen in a way that the longest row of this paragraph
11646 fits to the right margin.
11647 This is used to typeset an address on the right edge of the page.
11650 \begin_layout Description
11651 \begin_inset Flex Code
11654 \begin_layout Plain Layout
11661 \begin_inset Flex Code
11664 \begin_layout Plain Layout
11673 \begin_inset Flex Code
11676 \begin_layout Plain Layout
11682 ] Whether fragile commands in this style should be
11683 \begin_inset Flex Code
11686 \begin_layout Plain Layout
11699 whether this command should itself be protected.)
11702 \begin_layout Description
11703 \begin_inset Flex Code
11706 \begin_layout Plain Layout
11713 \begin_inset Flex Code
11716 \begin_layout Plain Layout
11723 \begin_inset Flex Code
11726 \begin_layout Plain Layout
11734 ] Whether newlines are translated into LaTeX newlines (
11735 \begin_inset Flex Code
11738 \begin_layout Plain Layout
11749 The translation can be switched off to allow more comfortable LaTeX editing
11753 \begin_layout Description
11754 \begin_inset Flex Code
11757 \begin_layout Plain Layout
11764 \begin_inset Flex Code
11767 \begin_layout Plain Layout
11774 \begin_inset Flex Code
11777 \begin_layout Plain Layout
11785 ] If set to true, and if
11786 \begin_inset Flex Code
11789 \begin_layout Plain Layout
11796 \begin_inset Flex Code
11799 \begin_layout Plain Layout
11805 ) paragraphs are being indented, then the indentation of such a paragraph
11806 following one of this type will be suppressed.
11807 (So this will not affect the display of non-default paragraphs.)
11810 \begin_layout Description
11811 \begin_inset Flex Code
11814 \begin_layout Plain Layout
11820 Name of a style that has replaced this style.
11821 This is used to rename a style, while keeping backward compatibility.
11824 \begin_layout Description
11825 \begin_inset Flex Code
11828 \begin_layout Plain Layout
11835 \begin_inset Flex Code
11838 \begin_layout Plain Layout
11844 ] The number of optional arguments that can be used with this style.
11845 This is useful for things like section headings, and only makes sense with
11847 Note that, on output, the optional arguments will all precede any required
11848 arguments (see below).
11849 So one can have constructs like:
11853 \begin_layout LyX-Code
11856 mycmd[opt1]{req1}{contents of paragraph}
11859 \begin_layout Standard
11860 but one cannot have things like:
11863 \begin_layout LyX-Code
11866 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11869 \begin_layout Standard
11870 at least, not without ERT (with which you can have anything).
11875 \begin_layout Description
11876 \begin_inset Flex Code
11879 \begin_layout Plain Layout
11886 \begin_inset Flex Code
11889 \begin_layout Plain Layout
11898 \begin_inset Flex Code
11901 \begin_layout Plain Layout
11907 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11908 output, but only by a line break; together with
11909 \begin_inset Flex Code
11912 \begin_layout Plain Layout
11918 , this allows to emulate a plain text editor (like the ERT inset).
11921 \begin_layout Description
11922 \begin_inset Flex Code
11925 \begin_layout Plain Layout
11932 \begin_inset Flex Code
11935 \begin_layout Plain Layout
11941 ] The indent of the very first line of a paragraph.
11943 \begin_inset Flex Code
11946 \begin_layout Plain Layout
11952 will be fixed for a certain style.
11953 The exception is the default style, since the indentation for these paragraphs
11954 can be prohibited with
11955 \begin_inset Flex Code
11958 \begin_layout Plain Layout
11966 \begin_inset Flex Code
11969 \begin_layout Plain Layout
11975 style paragraphs inside environments use the
11976 \begin_inset Flex Code
11979 \begin_layout Plain Layout
11985 of the environment, not their native one.
11987 \begin_inset Flex Code
11990 \begin_layout Plain Layout
11996 paragraphs inside an enumeration are not indented.
11999 \begin_layout Description
12000 \begin_inset Flex Code
12003 \begin_layout Plain Layout
12010 \begin_inset Flex Code
12013 \begin_layout Plain Layout
12019 ] The vertical space between two paragraphs of this style.
12022 \begin_layout Description
12023 \begin_inset Flex Code
12026 \begin_layout Plain Layout
12033 \begin_inset Flex Code
12036 \begin_layout Plain Layout
12042 ] LyX allows the user to choose either
12043 \begin_inset Quotes eld
12047 \begin_inset Quotes erd
12051 \begin_inset Quotes eld
12055 \begin_inset Quotes erd
12058 to typeset a document.
12060 \begin_inset Quotes eld
12064 \begin_inset Quotes erd
12067 is chosen, this value is completely ignored.
12069 \begin_inset Quotes eld
12073 \begin_inset Quotes erd
12076 is chosen, the parindent of a LaTeXtype
12077 \begin_inset Quotes eld
12081 \begin_inset Quotes erd
12084 style is ignored and all paragraphs are separated by this parskip argument.
12085 The vertical space is calculated with
12086 \begin_inset Flex Code
12089 \begin_layout Plain Layout
12091 \begin_inset space ~
12100 \begin_inset Flex Code
12103 \begin_layout Plain Layout
12109 is the height of a row with the normal font.
12110 This way, the look stays the same with different screen fonts.
12113 \begin_layout Description
12114 \begin_inset Flex Code
12117 \begin_layout Plain Layout
12124 \begin_inset Flex Code
12127 \begin_layout Plain Layout
12136 \begin_inset Flex Code
12139 \begin_layout Plain Layout
12145 ] Whether the contents of this paragraph should be output in raw form, meaning
12146 without special translations that LaTeX would require.
12149 \begin_layout Description
12150 \begin_inset Flex Code
12153 \begin_layout Plain Layout
12159 Information to be included in the LaTeX preamble when this style is used.
12160 Used to define macros, load packages, etc., required by this particular
12163 \begin_inset Quotes eld
12167 \begin_inset Flex Code
12170 \begin_layout Plain Layout
12177 \begin_inset Quotes erd
12183 \begin_layout Description
12184 \begin_inset Flex Code
12187 \begin_layout Plain Layout
12194 \begin_inset Flex Code
12197 \begin_layout Plain Layout
12203 ] The prefix to use when creating labels referring to paragraphs of this
12205 This allows the use of formatted references.
12208 \begin_layout Description
12209 \begin_inset Flex Code
12212 \begin_layout Plain Layout
12219 \begin_inset Flex Code
12222 \begin_layout Plain Layout
12228 ] The number of required arguments that the LaTeX command or environment
12229 corresponding to this style expects.
12230 In the case of a command, these are required arguments
12234 that associated with the content of the paragraph itself.
12235 These do not actually have to be provided: LyX will output empty arguments
12237 Note that optional arguments will be output before required arguments.
12238 See the discussion of the
12239 \begin_inset Flex Code
12242 \begin_layout Plain Layout
12248 tag above for more information.
12251 \begin_layout Description
12252 \begin_inset Flex Code
12255 \begin_layout Plain Layout
12262 \begin_inset Flex Code
12265 \begin_layout Plain Layout
12271 ] Whether the style requires the feature
12272 \begin_inset Flex Code
12275 \begin_layout Plain Layout
12282 See the description of
12283 \begin_inset Flex Code
12286 \begin_layout Plain Layout
12293 \begin_inset CommandInset ref
12294 LatexCommand pageref
12295 reference "des:FreeSpacing"
12299 ) for information on `features'.
12303 \begin_layout Description
12304 \begin_inset Flex Code
12307 \begin_layout Plain Layout
12314 \begin_inset Flex Code
12317 \begin_layout Plain Layout
12324 \begin_inset Flex Code
12327 \begin_layout Plain Layout
12336 \begin_layout Description
12337 \begin_inset Flex Code
12340 \begin_layout Plain Layout
12347 \begin_inset Flex Code
12350 \begin_layout Plain Layout
12355 , onehalf, double, other
12364 ] This defines what the default spacing should be in the style.
12366 \begin_inset Flex Code
12369 \begin_layout Plain Layout
12376 \begin_inset Flex Code
12379 \begin_layout Plain Layout
12386 \begin_inset Flex Code
12389 \begin_layout Plain Layout
12395 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12396 If you specify the argument
12397 \begin_inset Flex Code
12400 \begin_layout Plain Layout
12406 , then you should also provide a numerical argument which will be the actual
12408 Note that, contrary to other parameters,
12409 \begin_inset Flex Code
12412 \begin_layout Plain Layout
12418 implies the generation of specific LaTeX code, using the package
12421 \begin_inset Flex Code
12424 \begin_layout Plain Layout
12433 \begin_layout Description
12434 \begin_inset Flex Code
12437 \begin_layout Plain Layout
12444 \begin_inset Flex Code
12447 \begin_layout Plain Layout
12454 \begin_inset Flex Code
12457 \begin_layout Plain Layout
12465 ] Spellcheck paragraphs of this style.
12469 \begin_layout Description
12470 \begin_inset Flex Code
12473 \begin_layout Plain Layout
12479 The font used for the text body .
12481 \begin_inset CommandInset ref
12483 reference "sub:Font-description"
12490 \begin_layout Description
12491 \begin_inset Flex Code
12494 \begin_layout Plain Layout
12503 \begin_inset Flex Code
12506 \begin_layout Plain Layout
12516 The level of the style in the table of contents.
12517 This is used for automatic numbering of section headings.
12520 \begin_layout Description
12521 \begin_inset Flex Code
12524 \begin_layout Plain Layout
12531 \begin_inset Flex Code
12534 \begin_layout Plain Layout
12540 ] The vertical space with which the very first of a chain of paragraphs
12541 with this style is separated from the previous paragraph.
12542 If the previous paragraph has another style, the separations are not simply
12543 added, but the maximum is taken.
12546 \begin_layout Subsection
12547 \begin_inset CommandInset label
12553 Internationalization of Paragraph Styles
12556 \begin_layout Standard
12557 LyX has long supported internationalization of layout information, but,
12558 until version 2.0, this applied only to the user interface and not to, say,
12560 Thus, French authors were forced to resort to ugly hacks if they wanted
12565 1' instead of `Theorem 1'.
12566 Thanks to Georg Baum, that is no longer the case.
12569 \begin_layout Standard
12571 \begin_inset Flex Code
12574 \begin_layout Plain Layout
12580 defines text that is to appear in the typeset document, it may use
12581 \begin_inset Flex Code
12584 \begin_layout Plain Layout
12591 \begin_inset Flex Code
12594 \begin_layout Plain Layout
12600 to support non-English and even multi-language documents correctly.
12601 The following excerpt (from the
12602 \begin_inset Flex Code
12605 \begin_layout Plain Layout
12611 file) shows how this works:
12614 \begin_layout LyX-Code
12619 \begin_layout LyX-Code
12622 theoremstyle{remark}
12625 \begin_layout LyX-Code
12628 newtheorem{claim}[thm]{
12635 \begin_layout LyX-Code
12639 \begin_layout LyX-Code
12643 \begin_layout LyX-Code
12648 claimname}{_(Claim)}
12651 \begin_layout LyX-Code
12655 \begin_layout LyX-Code
12659 \begin_layout LyX-Code
12668 claimname}{_(Claim)}}
12671 \begin_layout LyX-Code
12676 \begin_layout Standard
12677 In principle, any legal LaTeX may appear in the
12678 \begin_inset Flex Code
12681 \begin_layout Plain Layout
12688 \begin_inset Flex Code
12691 \begin_layout Plain Layout
12697 tags, but in practice they will typically look as they do here.
12698 The key to correct translation of the typeset text is the definition of
12700 \begin_inset Flex Code
12703 \begin_layout Plain Layout
12712 \begin_inset Flex Code
12715 \begin_layout Plain Layout
12727 \begin_layout Standard
12729 \begin_inset Flex Code
12732 \begin_layout Plain Layout
12738 tag provides for internationalization based upon the overall language of
12740 The contents of the tag will be included in the preamble, just as with
12742 \begin_inset Flex Code
12745 \begin_layout Plain Layout
12752 What makes it special is the use of the
12753 \begin_inset Quotes eld
12757 \begin_inset Quotes erd
12761 \begin_inset Flex Code
12764 \begin_layout Plain Layout
12770 , which will be replaced, when LyX produces LaTeX output, with the translation
12771 of its argument into the document language.
12774 \begin_layout Standard
12776 \begin_inset Flex Code
12779 \begin_layout Plain Layout
12785 tag is more complex, since it is meant to provide support for multi-language
12786 documents and so offers an interface to the
12787 \begin_inset Flex Code
12790 \begin_layout Plain Layout
12797 Its contents will be added to the preamble once for each language that
12798 appears in the document.
12799 In this case, the argument to
12800 \begin_inset Flex Code
12803 \begin_layout Plain Layout
12809 will be replaced with its translation into the language in question; the
12811 \begin_inset Flex Code
12814 \begin_layout Plain Layout
12820 is replaced by the language name (as used by the babel package).
12823 \begin_layout Standard
12824 A German document that also included a French section would thus have the
12825 following in the preamble:
12828 \begin_layout LyX-Code
12837 claimname}{Affirmation}}
12845 claimname}{Behauptung}}
12849 claimname}{Behauptung}
12852 \begin_layout Standard
12854 \begin_inset Flex Code
12857 \begin_layout Plain Layout
12863 will then conspire to produce the correct text in the output.
12866 \begin_layout Standard
12867 One important point to note here is that the translations are provided by
12868 LyX itself, through the same mechanism it uses for internationalization
12869 of the user interface.
12870 This means, in effect, that
12871 \begin_inset Flex Code
12874 \begin_layout Plain Layout
12881 \begin_inset Flex Code
12884 \begin_layout Plain Layout
12890 are really only of use in layout files that are provided with LyX, since
12891 text entered in user-created layout files will not be seen by LyX's internation
12892 alization routines.
12893 That said, however, any layout created with the intention that it will
12894 be included with LyX should use these tags where appropriate.
12897 \begin_layout Subsection
12899 \begin_inset CommandInset label
12908 \begin_layout Standard
12909 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12910 define the floats (
12911 \begin_inset Flex MenuItem
12914 \begin_layout Plain Layout
12921 \begin_inset Flex MenuItem
12924 \begin_layout Plain Layout
12930 , \SpecialChar \ldots{}
12931 ) in the text class itself.
12932 Standard floats are included in the file
12933 \begin_inset Flex Code
12936 \begin_layout Plain Layout
12942 , so you may have to do no more than add
12945 \begin_layout LyX-Code
12946 Input stdfloats.inc
12949 \begin_layout Standard
12950 to your layout file.
12951 If you want to implement a text class that proposes some other float types
12952 (like the AGU class bundled with LyX), the information below will hopefully
12956 \begin_layout Description
12957 \begin_inset Flex Code
12960 \begin_layout Plain Layout
12967 \begin_inset Flex Code
12970 \begin_layout Plain Layout
12977 \begin_inset Quotes erd
12981 \begin_inset Quotes erd
12984 ] The file name extension of an auxiliary file for the list of figures (or
12986 LaTeX writes the captions to this file.
12989 \begin_layout Description
12990 \begin_inset Flex Code
12993 \begin_layout Plain Layout
13000 \begin_inset Flex Code
13003 \begin_layout Plain Layout
13010 \begin_inset Quotes erd
13014 \begin_inset Quotes erd
13017 ] The string that will be used in the menus and also for the caption.
13018 This is translated to the current language if babel is used.
13021 \begin_layout Description
13022 \begin_inset Flex Code
13025 \begin_layout Plain Layout
13031 These are used for XHTML output.
13033 \begin_inset CommandInset ref
13035 reference "sec:Tags-for-XHTML"
13042 \begin_layout Description
13043 \begin_inset Flex Code
13046 \begin_layout Plain Layout
13055 \begin_inset Flex Code
13058 \begin_layout Plain Layout
13067 \begin_inset Flex Code
13070 \begin_layout Plain Layout
13076 ] Indicates whether the float is already defined in the document class or
13077 if we instead need to load
13078 \begin_inset Flex Code
13081 \begin_layout Plain Layout
13087 and use what it provides to define it on-the-fly.
13089 \begin_inset Flex Code
13092 \begin_layout Plain Layout
13099 \begin_inset Flex Code
13102 \begin_layout Plain Layout
13109 It should be set to
13110 \begin_inset Flex Code
13113 \begin_layout Plain Layout
13119 if the float is already defined by the LaTeX document class.
13122 \begin_layout Description
13123 \begin_inset Flex Code
13126 \begin_layout Plain Layout
13133 \begin_inset Flex Code
13136 \begin_layout Plain Layout
13143 \begin_inset Quotes erd
13147 \begin_inset Quotes erd
13150 ] The command used to generate a list of floats of this type; the leading
13153 ' should be omitted.
13159 \begin_inset Flex Code
13162 \begin_layout Plain Layout
13168 is false, since there is no standard way to generate this command.
13170 \begin_inset Flex Code
13173 \begin_layout Plain Layout
13179 is true, since in that case there is a standard way to define the command.
13182 \begin_layout Description
13183 \begin_inset Flex Code
13186 \begin_layout Plain Layout
13193 \begin_inset Flex Code
13196 \begin_layout Plain Layout
13203 \begin_inset Quotes erd
13207 \begin_inset Quotes erd
13210 ] A title for a list of floats of this kind (list of figures, tables, or
13212 It is used for the screen label within LyX; it is passed to LaTeX for use
13213 as the title there; and it is used as the title in XHTML output.
13214 It will be translated to the document language.
13217 \begin_layout Description
13218 \begin_inset Flex Code
13221 \begin_layout Plain Layout
13228 \begin_inset Flex Code
13231 \begin_layout Plain Layout
13238 \begin_inset Quotes erd
13242 \begin_inset Quotes erd
13245 ] This (optional) argument determines whether floats of this class will
13246 be numbered within some sectional unit of the document.
13247 For example, if within is equal to
13248 \begin_inset Flex Code
13251 \begin_layout Plain Layout
13257 , the floats will be numbered within chapters.
13261 \begin_layout Description
13262 \begin_inset Flex Code
13265 \begin_layout Plain Layout
13272 \begin_inset Flex Code
13275 \begin_layout Plain Layout
13282 \begin_inset Quotes erd
13286 \begin_inset Quotes erd
13289 ] The default placement for the given class of floats.
13290 The string should be as in standard LaTeX:
13291 \begin_inset Flex Code
13294 \begin_layout Plain Layout
13301 \begin_inset Flex Code
13304 \begin_layout Plain Layout
13311 \begin_inset Flex Code
13314 \begin_layout Plain Layout
13321 \begin_inset Flex Code
13324 \begin_layout Plain Layout
13330 for top, bottom, page, and here, respectively.
13334 \begin_layout Plain Layout
13335 Note that the order of these letters in the string is irrelevant, like in
13341 On top of that there is a new type,
13342 \begin_inset Flex Code
13345 \begin_layout Plain Layout
13351 , which does not really correspond to a float, since it means: put it
13352 \begin_inset Quotes eld
13356 \begin_inset Quotes erd
13360 Note however that the
13361 \begin_inset Flex Code
13364 \begin_layout Plain Layout
13370 specifier is special and, because of implementation details, cannot be
13371 used in non-built in float types.
13372 If you do not understand what this means, just use
13373 \begin_inset Quotes eld
13377 \begin_inset Flex Code
13380 \begin_layout Plain Layout
13387 \begin_inset Quotes erd
13393 \begin_layout Description
13394 \begin_inset Flex Code
13397 \begin_layout Plain Layout
13404 \begin_inset Flex Code
13407 \begin_layout Plain Layout
13413 ] The prefix to use when creating labels referring to floats of this type.
13414 This allows the use of formatted references.
13415 Note that you can remove any
13416 \begin_inset Flex Code
13419 \begin_layout Plain Layout
13425 set by a copied style by using the special value
13426 \begin_inset Quotes eld
13430 \begin_inset Quotes erd
13433 , which must be all caps.
13436 \begin_layout Description
13437 \begin_inset Flex Code
13440 \begin_layout Plain Layout
13447 \begin_inset Flex Code
13450 \begin_layout Plain Layout
13457 \begin_inset Quotes erd
13461 \begin_inset Quotes erd
13464 ] The style used when defining the float using
13465 \begin_inset Flex Code
13468 \begin_layout Plain Layout
13479 \begin_layout Description
13480 \begin_inset Flex Code
13483 \begin_layout Plain Layout
13490 \begin_inset Flex Code
13493 \begin_layout Plain Layout
13500 \begin_inset Quotes erd
13504 \begin_inset Quotes erd
13508 \begin_inset Quotes eld
13512 \begin_inset Quotes erd
13515 of the new class of floats, like program or algorithm.
13516 After the appropriate
13517 \begin_inset Flex Code
13520 \begin_layout Plain Layout
13529 \begin_inset Flex Code
13532 \begin_layout Plain Layout
13541 \begin_inset Flex Code
13544 \begin_layout Plain Layout
13555 \begin_layout Description
13556 \begin_inset Flex Code
13559 \begin_layout Plain Layout
13566 \begin_inset Flex Code
13569 \begin_layout Plain Layout
13576 \begin_inset Flex Code
13579 \begin_layout Plain Layout
13587 ] Tells us whether this float is defined using the facilities provided by
13589 \begin_inset Flex Code
13592 \begin_layout Plain Layout
13598 , either by the class file or a package, or on-the-fly by LyX itself.
13601 \begin_layout Standard
13602 Note that defining a float with type
13603 \begin_inset Flex Code
13606 \begin_layout Plain Layout
13614 automatically defines the corresponding counter with name
13615 \begin_inset Flex Code
13618 \begin_layout Plain Layout
13629 \begin_layout Subsection
13630 Flex insets and InsetLayout
13631 \begin_inset CommandInset label
13633 name "sub:Flex-insets-and"
13640 \begin_layout Standard
13641 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13642 these are called Flex insets.
13646 \begin_layout Standard
13647 Flex insets come in three different kinds:
13650 \begin_layout Itemize
13652 \begin_inset Flex Code
13655 \begin_layout Plain Layout
13661 ): These define semantic markup corresponding to such LaTeX commands as
13663 \begin_inset Flex Code
13666 \begin_layout Plain Layout
13675 \begin_inset Flex Code
13678 \begin_layout Plain Layout
13689 \begin_layout Itemize
13691 \begin_inset Flex Code
13694 \begin_layout Plain Layout
13700 ): These can be used to define custom collapsible insets, similar to TeX
13701 code, footnote, and the like.
13702 An obvious example is an endnote inset, which is defined in the
13703 \begin_inset Flex Code
13706 \begin_layout Plain Layout
13715 \begin_layout Itemize
13717 \begin_inset Flex Code
13720 \begin_layout Plain Layout
13726 ): For use with DocBook classes.
13729 \begin_layout Standard
13730 Flex insets are defined using the
13731 \begin_inset Flex Code
13734 \begin_layout Plain Layout
13740 tag, which shall be explained in a moment.
13743 \begin_layout Standard
13745 \begin_inset Flex Code
13748 \begin_layout Plain Layout
13754 tag also serves another function: It can be used to customize the general
13755 layout of many different types of insets.
13757 \begin_inset Flex Code
13760 \begin_layout Plain Layout
13766 can be used to customize the layout parameters for footnotes, marginal
13767 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13768 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13769 define Flex insets.
13772 \begin_layout Standard
13774 \begin_inset Flex Code
13777 \begin_layout Plain Layout
13783 definition must begin with a line of the form:
13786 \begin_layout LyX-Code
13790 \begin_layout Standard
13792 \begin_inset Flex Code
13795 \begin_layout Plain Layout
13801 indicates the inset whose layout is being defined, and here there are two
13805 \begin_layout Enumerate
13806 The layout for a pre-existing inset is being modified.
13807 In this case, can be
13808 \begin_inset Flex Code
13811 \begin_layout Plain Layout
13817 any one of the following:
13818 \begin_inset Flex Code
13821 \begin_layout Plain Layout
13828 \begin_inset Flex Code
13831 \begin_layout Plain Layout
13838 \begin_inset Flex Code
13841 \begin_layout Plain Layout
13848 \begin_inset Flex Code
13851 \begin_layout Plain Layout
13858 \begin_inset Flex Code
13861 \begin_layout Plain Layout
13868 \begin_inset Flex Code
13871 \begin_layout Plain Layout
13878 \begin_inset Flex Code
13881 \begin_layout Plain Layout
13888 \begin_inset Flex Code
13891 \begin_layout Plain Layout
13898 \begin_inset Flex Code
13901 \begin_layout Plain Layout
13908 \begin_inset Flex Code
13911 \begin_layout Plain Layout
13918 \begin_inset Flex Code
13921 \begin_layout Plain Layout
13928 \begin_inset Flex Code
13931 \begin_layout Plain Layout
13938 \begin_inset Flex Code
13941 \begin_layout Plain Layout
13948 \begin_inset Flex Code
13951 \begin_layout Plain Layout
13958 \begin_inset Flex Code
13961 \begin_layout Plain Layout
13968 \begin_inset Flex Code
13971 \begin_layout Plain Layout
13978 \begin_inset Flex Code
13981 \begin_layout Plain Layout
13988 \begin_inset Flex Code
13991 \begin_layout Plain Layout
13998 \begin_inset Flex Code
14001 \begin_layout Plain Layout
14008 \begin_inset Flex Code
14011 \begin_layout Plain Layout
14020 \begin_layout Enumerate
14021 The layout for a Flex inset is being defined.
14023 \begin_inset Flex Code
14026 \begin_layout Plain Layout
14032 must be of the form
14033 \begin_inset Quotes eld
14037 \begin_inset Flex Code
14040 \begin_layout Plain Layout
14047 \begin_inset Quotes erd
14051 \begin_inset Flex Code
14054 \begin_layout Plain Layout
14060 may be be any valid identifier not used by a pre-existing Flex inset.
14061 The identifier may include spaces, but in that case the whole thing must
14062 be wrapped in quotes.
14063 Note that the definition of a flex inset
14068 \begin_inset Flex Code
14071 \begin_layout Plain Layout
14077 entry, declaring which type of inset it defines.
14080 \begin_layout Standard
14082 \begin_inset Flex Code
14085 \begin_layout Plain Layout
14091 definition can contain the following entries:
14094 \begin_layout Description
14095 \begin_inset Flex Code
14098 \begin_layout Plain Layout
14104 The color for the inset's background.
14105 The valid colors are defined in
14106 \begin_inset Flex Code
14109 \begin_layout Plain Layout
14118 \begin_layout Description
14119 \begin_inset Flex Code
14122 \begin_layout Plain Layout
14129 \begin_inset Flex Code
14132 \begin_layout Plain Layout
14141 \begin_inset Flex Code
14144 \begin_layout Plain Layout
14150 ] Whether to use the content of the inset as the label, when the inset is
14155 \begin_layout Description
14156 \begin_inset Flex Code
14159 \begin_layout Plain Layout
14166 \begin_inset Flex Code
14169 \begin_layout Plain Layout
14175 Copies all the features of an existing style into the current one.
14179 \begin_layout Description
14180 \begin_inset Flex Code
14183 \begin_layout Plain Layout
14190 \begin_inset Flex Code
14193 \begin_layout Plain Layout
14202 \begin_inset Flex Code
14205 \begin_layout Plain Layout
14211 ] Indicates whether the user may employ the Paragraph Settings dialog to
14212 customize the paragraph.
14215 \begin_layout Description
14216 \begin_inset Flex Code
14219 \begin_layout Plain Layout
14226 \begin_inset Flex Code
14229 \begin_layout Plain Layout
14236 \begin_inset Flex Code
14239 \begin_layout Plain Layout
14246 \begin_inset Flex Code
14249 \begin_layout Plain Layout
14255 , describing the rendering style used for the inset's frame and buttons.
14256 Footnotes generally use
14257 \begin_inset Flex Code
14260 \begin_layout Plain Layout
14266 , ERT insets generally
14267 \begin_inset Flex Code
14270 \begin_layout Plain Layout
14276 , and character styles
14277 \begin_inset Flex Code
14280 \begin_layout Plain Layout
14289 \begin_layout Description
14290 \begin_inset Flex Code
14293 \begin_layout Plain Layout
14300 \begin_inset Flex Code
14303 \begin_layout Plain Layout
14310 \begin_inset Flex Code
14313 \begin_layout Plain Layout
14322 \begin_inset Flex Code
14325 \begin_layout Plain Layout
14332 \begin_inset Flex Code
14335 \begin_layout Plain Layout
14342 Indicates whether the environment will stand on its own in LaTeX output
14343 or will appear inline with the surrounding text.
14344 If set to false, it is supposed that the LaTeX environment ignores white
14345 space (including one newline character) after the
14346 \begin_inset Flex Code
14349 \begin_layout Plain Layout
14362 \begin_inset Flex Code
14365 \begin_layout Plain Layout
14381 \begin_layout Description
14382 \begin_inset Flex Code
14385 \begin_layout Plain Layout
14391 Required at the end of the InsetLayout declarations.
14394 \begin_layout Description
14395 \begin_inset Flex Code
14398 \begin_layout Plain Layout
14404 The font used for both the text body
14410 \begin_inset space ~
14414 \begin_inset CommandInset ref
14416 reference "sub:Font-description"
14421 Note that defining this font automatically defines the
14422 \begin_inset Flex Code
14425 \begin_layout Plain Layout
14431 to the same value, so define this first and define
14432 \begin_inset Flex Code
14435 \begin_layout Plain Layout
14441 later if you want them to be different.
14444 \begin_layout Description
14445 \begin_inset Flex Code
14448 \begin_layout Plain Layout
14455 \begin_inset Quotes eld
14459 \begin_inset Quotes erd
14462 language, leading to Left-to-Right (latin) output, e.
14463 \begin_inset space \thinspace{}
14467 \begin_inset space \space{}
14470 in TeX code or URL.
14474 \begin_layout Description
14475 \begin_inset Flex Code
14478 \begin_layout Plain Layout
14485 \begin_inset Flex Code
14488 \begin_layout Plain Layout
14497 \begin_inset Flex Code
14500 \begin_layout Plain Layout
14506 ] Indicates whether the
14507 \begin_inset Flex Code
14510 \begin_layout Plain Layout
14516 should be used or, instead, the user can change the paragraph style used
14521 \begin_layout Description
14522 \begin_inset Flex Code
14525 \begin_layout Plain Layout
14532 \begin_inset Flex Code
14535 \begin_layout Plain Layout
14544 \begin_inset Flex Code
14547 \begin_layout Plain Layout
14553 ] Usually LyX doesn't allow you to insert more than one space between words,
14554 since a space is considered as the separation between two words, not a
14555 character or symbol of its own.
14556 This is a very fine thing but sometimes annoying, for example, when typing
14557 program code or plain LaTeX code.
14559 \begin_inset Flex Code
14562 \begin_layout Plain Layout
14569 Note that LyX will create protected blanks for the additional blanks when
14570 in another mode than LaTeX-mode.
14574 \begin_layout Description
14575 \begin_inset Flex Code
14578 \begin_layout Plain Layout
14584 These tags control XHTML output.
14586 \begin_inset CommandInset ref
14588 reference "sec:Tags-for-XHTML"
14595 \begin_layout Description
14596 \begin_inset Flex Code
14599 \begin_layout Plain Layout
14606 \begin_inset Flex Code
14609 \begin_layout Plain Layout
14618 \begin_inset Flex Code
14621 \begin_layout Plain Layout
14627 ] Whether to include the contents of this inset in the strings generated
14628 for the `Outline' pane.
14629 One would not, for example, want the content of a footnote in a section
14630 header to be included in the TOC displayed in the outline, but one would
14631 normally want the content of a character style displayed.
14632 Default is false: not to include.
14635 \begin_layout Description
14636 \begin_inset Flex Code
14639 \begin_layout Plain Layout
14646 \begin_inset Flex Code
14649 \begin_layout Plain Layout
14658 \begin_inset Flex Code
14661 \begin_layout Plain Layout
14667 ] Usually LyX does not allow you to leave a paragraph empty, since it would
14668 lead to empty LaTeX output.
14669 There are some cases where this could be desirable however: in a letter
14670 template, the required fields can be provided as empty fields, so that
14671 people do not forget them; in some special classes, a style can be used
14672 as some kind of break, which does not contain actual text.
14676 \begin_layout Description
14677 \begin_inset Flex Code
14680 \begin_layout Plain Layout
14686 The font used for the label.
14688 \begin_inset space ~
14692 \begin_inset CommandInset ref
14694 reference "sub:Font-description"
14699 Note that this definition can never appear before
14700 \begin_inset Flex Code
14703 \begin_layout Plain Layout
14709 , lest it be ineffective.
14712 \begin_layout Description
14713 \begin_inset Flex Code
14716 \begin_layout Plain Layout
14722 What will be displayed on the button or elsewhere as the inset label.
14724 \begin_inset Flex Code
14727 \begin_layout Plain Layout
14734 \begin_inset Flex Code
14737 \begin_layout Plain Layout
14743 ) modify this label on the fly.
14746 \begin_layout Description
14747 \begin_inset Flex Code
14750 \begin_layout Plain Layout
14756 The name of the corresponding LaTeX stuff.
14757 Either the environment or command name.
14760 \begin_layout Description
14761 \begin_inset Flex Code
14764 \begin_layout Plain Layout
14770 The optional parameter for the corresponding
14771 \begin_inset Flex Code
14774 \begin_layout Plain Layout
14780 stuff, including possible bracket pairs like
14781 \begin_inset Flex Code
14784 \begin_layout Plain Layout
14791 This parameter cannot be changed from within LyX.
14794 \begin_layout Description
14795 \begin_inset Flex Code
14798 \begin_layout Plain Layout
14805 \begin_inset Flex Code
14808 \begin_layout Plain Layout
14813 , Command, Environment, Item_Environment,
14819 \begin_inset Flex Code
14822 \begin_layout Plain Layout
14823 List_Environment, Bib_Environment
14828 ] How the style should be translated into LaTeX.
14832 \begin_layout Plain Layout
14833 \begin_inset Flex Code
14836 \begin_layout Plain Layout
14842 is perhaps a bit misleading, since these rules apply to SGML classes, too.
14843 Visit the SGML class files for specific examples.
14852 \begin_layout Itemize
14853 \begin_inset Flex Code
14856 \begin_layout Plain Layout
14862 means nothing special.
14866 \begin_layout Itemize
14867 \begin_inset Flex Code
14870 \begin_layout Plain Layout
14877 \begin_inset Flex Code
14880 \begin_layout Plain Layout
14887 {\SpecialChar \ldots{}
14896 \begin_layout Itemize
14897 \begin_inset Flex Code
14900 \begin_layout Plain Layout
14907 \begin_inset Flex Code
14910 \begin_layout Plain Layout
14917 }\SpecialChar \ldots{}
14933 \begin_layout Itemize
14934 \begin_inset Flex Code
14937 \begin_layout Plain Layout
14944 \begin_inset Flex Code
14947 \begin_layout Plain Layout
14954 \begin_inset Flex Code
14957 \begin_layout Plain Layout
14965 is generated for each paragraph of this environment.
14969 \begin_layout Itemize
14970 \begin_inset Flex Code
14973 \begin_layout Plain Layout
14980 \begin_inset Flex Code
14983 \begin_layout Plain Layout
14990 \begin_inset Flex Code
14993 \begin_layout Plain Layout
14999 is passed as an argument to the environment.
15001 \begin_inset Flex Code
15004 \begin_layout Plain Layout
15010 can be defined in the
15011 \begin_inset Flex MenuItem
15014 \begin_layout Plain Layout
15019 \SpecialChar \menuseparator
15025 \begin_inset space ~
15037 \begin_layout Standard
15038 Putting the last few things together, the LaTeX output will be either:
15041 \begin_layout LyX-Code
15044 latexname[latexparam]{\SpecialChar \ldots{}
15048 \begin_layout Standard
15052 \begin_layout LyX-Code
15055 begin{latexname}[latexparam] \SpecialChar \ldots{}
15061 \begin_layout Standard
15062 depending upon the LaTeX type.
15066 \begin_layout Description
15067 \begin_inset Flex Code
15070 \begin_layout Plain Layout
15077 \begin_inset Flex Code
15080 \begin_layout Plain Layout
15087 \begin_inset Flex Code
15090 \begin_layout Plain Layout
15097 \begin_inset Flex Code
15100 \begin_layout Plain Layout
15107 \begin_inset Flex Code
15110 \begin_layout Plain Layout
15116 (indicating a dummy definition ending definitions of charstyles, etc).
15117 This entry is required in and is only meaningful for Flex insets.
15118 Among other things, it determines on which menu this inset will appear.
15120 \begin_inset Flex Code
15123 \begin_layout Plain Layout
15130 \begin_inset Flex Code
15133 \begin_layout Plain Layout
15140 \begin_inset Flex Code
15143 \begin_layout Plain Layout
15151 \begin_inset Flex Code
15154 \begin_layout Plain Layout
15160 can be set to true for charstyle insets, if you wish, by setting it
15165 \begin_inset Flex Code
15168 \begin_layout Plain Layout
15177 \begin_layout Description
15178 \begin_inset Flex Code
15181 \begin_layout Plain Layout
15188 \begin_inset Flex Code
15191 \begin_layout Plain Layout
15200 \begin_inset Flex Code
15203 \begin_layout Plain Layout
15209 ] Whether multiple paragraphs are permitted in this inset.
15211 \begin_inset Flex Code
15214 \begin_layout Plain Layout
15220 to the same value and
15221 \begin_inset Flex Code
15224 \begin_layout Plain Layout
15230 to the opposite value.
15231 These can be reset to other values, if they are used
15236 \begin_inset Flex Code
15239 \begin_layout Plain Layout
15249 \begin_layout Description
15250 \begin_inset Flex Code
15253 \begin_layout Plain Layout
15260 \begin_inset Flex Code
15263 \begin_layout Plain Layout
15272 \begin_inset Flex Code
15275 \begin_layout Plain Layout
15281 ] Whether fragile commands in this inset should be
15282 \begin_inset Flex Code
15285 \begin_layout Plain Layout
15298 whether the command should itself be protected.) Default is false.
15301 \begin_layout Description
15302 \begin_inset Flex Code
15305 \begin_layout Plain Layout
15312 \begin_inset Flex Code
15315 \begin_layout Plain Layout
15324 \begin_inset Flex Code
15327 \begin_layout Plain Layout
15333 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
15334 output, but only by a line break; together with
15335 \begin_inset Flex Code
15338 \begin_layout Plain Layout
15344 , this allows to emulate a plain text editor (like the ERT inset).
15348 \begin_layout Description
15349 \begin_inset Flex Code
15352 \begin_layout Plain Layout
15359 \begin_inset Flex Code
15362 \begin_layout Plain Layout
15371 \begin_inset Flex Code
15374 \begin_layout Plain Layout
15380 ] Whether the contents of this paragraph should be output in raw form, meaning
15381 without special translations that LaTeX would require.
15384 \begin_layout Description
15385 \begin_inset Flex Code
15388 \begin_layout Plain Layout
15394 Information to be included in the LaTeX preamble when this style is used.
15395 Used to define macros, load packages, etc., required by this particular
15398 \begin_inset Quotes eld
15402 \begin_inset Flex Code
15405 \begin_layout Plain Layout
15412 \begin_inset Quotes erd
15418 \begin_layout Description
15419 \begin_inset Flex Code
15422 \begin_layout Plain Layout
15429 \begin_inset Flex Code
15432 \begin_layout Plain Layout
15438 ] The prefix to use when creating labels referring to insets of this type.
15439 This allows the use of formatted references.
15442 \begin_layout Description
15443 \begin_inset Flex Code
15446 \begin_layout Plain Layout
15453 \begin_inset Flex Code
15456 \begin_layout Plain Layout
15462 ] Whether the style requires the feature
15463 \begin_inset Flex Code
15466 \begin_layout Plain Layout
15473 See the description of
15474 \begin_inset Flex Code
15477 \begin_layout Plain Layout
15484 \begin_inset CommandInset ref
15485 LatexCommand pageref
15486 reference "des:FreeSpacing"
15490 ) for information on `features'.
15494 \begin_layout Description
15495 \begin_inset Flex Code
15498 \begin_layout Plain Layout
15505 \begin_inset Flex Code
15508 \begin_layout Plain Layout
15515 \begin_inset Flex Code
15518 \begin_layout Plain Layout
15526 ] Whether this inset should use the font of its surrounding environment
15528 Default is true: uses its own.
15531 \begin_layout Description
15532 \begin_inset Flex Code
15535 \begin_layout Plain Layout
15542 \begin_inset Flex Code
15545 \begin_layout Plain Layout
15552 \begin_inset Flex Code
15555 \begin_layout Plain Layout
15563 ] Spellcheck the contents of this inset.
15567 \begin_layout Subsection
15569 \begin_inset CommandInset label
15571 name "sub:Counters"
15578 \begin_layout Standard
15579 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15581 \begin_inset Flex MenuItem
15584 \begin_layout Plain Layout
15591 \begin_inset Flex MenuItem
15594 \begin_layout Plain Layout
15600 , \SpecialChar \ldots{}
15601 ) in the text class itself.
15602 The standard counters are defined in the file
15603 \begin_inset Flex Code
15606 \begin_layout Plain Layout
15612 , so you may have to do no more than add
15615 \begin_layout LyX-Code
15616 Input stdcounters.inc
15619 \begin_layout Standard
15620 to your layout file to get them to work.
15621 But if you want to define custom counters, then you can do so.
15622 The counter declaration must begin with:
15625 \begin_layout LyX-Code
15626 Counter CounterName
15629 \begin_layout Standard
15631 \begin_inset Flex Code
15634 \begin_layout Plain Layout
15640 ' is replaced by the name of the counter.
15641 And it must end with
15642 \begin_inset Quotes eld
15646 \begin_inset Flex Code
15649 \begin_layout Plain Layout
15656 \begin_inset Quotes erd
15660 The following parameters can also be used:
15663 \begin_layout Description
15664 \begin_inset Flex Code
15667 \begin_layout Plain Layout
15674 \begin_inset Flex Code
15677 \begin_layout Plain Layout
15684 \begin_inset Quotes erd
15688 \begin_inset Quotes erd
15691 ] When defined, this string defines how the counter is displayed.
15692 Setting this value sets
15693 \begin_inset Flex Code
15696 \begin_layout Plain Layout
15697 LabelStringAppendix
15703 The following special constructs can be used in the string:
15707 \begin_layout Itemize
15708 \begin_inset Flex Code
15711 \begin_layout Plain Layout
15719 will be replaced by the expansion of the
15720 \begin_inset Flex Code
15723 \begin_layout Plain Layout
15730 \begin_inset Flex Code
15733 \begin_layout Plain Layout
15734 LabelStringAppendix
15740 \begin_inset Flex Code
15743 \begin_layout Plain Layout
15753 \begin_layout Itemize
15754 counter values can be expressed using LaTeX-like macros
15755 \begin_inset Flex Code
15758 \begin_layout Plain Layout
15775 \begin_inset Flex Code
15778 \begin_layout Plain Layout
15790 \begin_layout Plain Layout
15800 Actually, the situation is a bit more complicated: any
15819 other than those described below will produce arabic numerals.
15820 It would not be surprising to see this change in the future.
15826 \begin_inset Flex Code
15829 \begin_layout Plain Layout
15835 : 1, 2, 3,\SpecialChar \ldots{}
15837 \begin_inset Flex Code
15840 \begin_layout Plain Layout
15846 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15848 \begin_inset Flex Code
15851 \begin_layout Plain Layout
15857 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15859 \begin_inset Flex Code
15862 \begin_layout Plain Layout
15868 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15870 \begin_inset Flex Code
15873 \begin_layout Plain Layout
15879 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15881 \begin_inset Flex Code
15884 \begin_layout Plain Layout
15890 for hebrew numerals.
15894 \begin_layout Standard
15895 If LabelString is not defined, a default value is constructed as follows:
15896 if the counter has a master counter
15897 \begin_inset Flex Code
15900 \begin_layout Plain Layout
15907 \begin_inset Flex Code
15910 \begin_layout Plain Layout
15917 \begin_inset Flex Code
15920 \begin_layout Plain Layout
15930 is used; otherwise the string
15931 \begin_inset Flex Code
15934 \begin_layout Plain Layout
15945 \begin_layout Description
15946 \begin_inset Flex Code
15949 \begin_layout Plain Layout
15950 LabelStringAppendix
15956 \begin_inset Flex Code
15959 \begin_layout Plain Layout
15966 \begin_inset Quotes erd
15970 \begin_inset Quotes erd
15974 \begin_inset Flex Code
15977 \begin_layout Plain Layout
15983 , but for use in the Appendix.
15986 \begin_layout Description
15987 \begin_inset Flex Code
15990 \begin_layout Plain Layout
15997 \begin_inset Flex Code
16000 \begin_layout Plain Layout
16007 \begin_inset Quotes erd
16011 \begin_inset Quotes erd
16014 ] A format for use with formatted references to this counter.
16015 For example, one might want to have references to section numbers appear
16017 \begin_inset Quotes eld
16021 \begin_inset Quotes erd
16025 The string should contain
16026 \begin_inset Quotes eld
16030 \begin_inset Quotes erd
16034 This will be replaced by the counter number itself.
16035 So, for sections, it would be: Section ##.
16038 \begin_layout Description
16039 \begin_inset Flex Code
16042 \begin_layout Plain Layout
16049 \begin_inset Flex Code
16052 \begin_layout Plain Layout
16059 \begin_inset Quotes erd
16063 \begin_inset Quotes erd
16066 ] If this is set to the name of another counter, the present counter will
16067 be reset every time the other one is increased.
16069 \begin_inset Flex Code
16072 \begin_layout Plain Layout
16079 \begin_inset Flex Code
16082 \begin_layout Plain Layout
16091 \begin_layout Subsection
16093 \begin_inset CommandInset label
16095 name "sub:Font-description"
16102 \begin_layout Standard
16103 A font description looks like this:
16106 \begin_layout LyX-Code
16116 \begin_layout LyX-Code
16120 \begin_layout LyX-Code
16124 \begin_layout Standard
16125 The following commands are available:
16128 \begin_layout Description
16129 \begin_inset Flex Code
16132 \begin_layout Plain Layout
16139 \begin_inset Flex Code
16142 \begin_layout Plain Layout
16151 \begin_inset Flex Code
16154 \begin_layout Plain Layout
16161 \begin_inset Flex Code
16164 \begin_layout Plain Layout
16171 \begin_inset Flex Code
16174 \begin_layout Plain Layout
16181 \begin_inset Flex Code
16184 \begin_layout Plain Layout
16191 \begin_inset Flex Code
16194 \begin_layout Plain Layout
16201 \begin_inset Flex Code
16204 \begin_layout Plain Layout
16211 \begin_inset Flex Code
16214 \begin_layout Plain Layout
16221 \begin_inset Flex Code
16224 \begin_layout Plain Layout
16233 \begin_layout Description
16234 \begin_inset Flex Code
16237 \begin_layout Plain Layout
16244 \begin_inset Flex Code
16247 \begin_layout Plain Layout
16256 \begin_inset Flex Code
16259 \begin_layout Plain Layout
16266 \begin_inset Flex Code
16269 \begin_layout Plain Layout
16278 \begin_layout Description
16279 \begin_inset Flex Code
16282 \begin_layout Plain Layout
16289 \begin_inset Flex Code
16292 \begin_layout Plain Layout
16298 ] Valid arguments are:
16299 \begin_inset Flex Code
16302 \begin_layout Plain Layout
16309 \begin_inset Flex Code
16312 \begin_layout Plain Layout
16319 \begin_inset Flex Code
16322 \begin_layout Plain Layout
16329 \begin_inset Flex Code
16332 \begin_layout Plain Layout
16339 \begin_inset Flex Code
16342 \begin_layout Plain Layout
16349 \begin_inset Flex Code
16352 \begin_layout Plain Layout
16359 \begin_inset Flex Code
16362 \begin_layout Plain Layout
16369 \begin_inset Flex Code
16372 \begin_layout Plain Layout
16379 \begin_inset Flex Code
16382 \begin_layout Plain Layout
16389 \begin_inset Flex Code
16392 \begin_layout Plain Layout
16399 \begin_inset Flex Code
16402 \begin_layout Plain Layout
16409 \begin_inset Flex Code
16412 \begin_layout Plain Layout
16419 Each of these turns on or off the corresponding attribute.
16421 \begin_inset Flex Code
16424 \begin_layout Plain Layout
16430 turns on emphasis, and
16431 \begin_inset Flex Code
16434 \begin_layout Plain Layout
16442 \begin_inset Newline newline
16445 If the latter seems puzzling, remember that the font settings for the present
16446 context are generally inherited from the surrounding context.
16448 \begin_inset Flex Code
16451 \begin_layout Plain Layout
16457 would turn off the emphasis that was anyway in effect, say, in a theorem
16461 \begin_layout Description
16462 \begin_inset Flex Code
16465 \begin_layout Plain Layout
16472 \begin_inset Flex Code
16475 \begin_layout Plain Layout
16484 \begin_inset Flex Code
16487 \begin_layout Plain Layout
16496 \begin_layout Description
16497 \begin_inset Flex Code
16500 \begin_layout Plain Layout
16507 \begin_inset Flex Code
16510 \begin_layout Plain Layout
16519 \begin_inset Flex Code
16522 \begin_layout Plain Layout
16529 \begin_inset Flex Code
16532 \begin_layout Plain Layout
16539 \begin_inset Flex Code
16542 \begin_layout Plain Layout
16551 \begin_layout Description
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 \begin_inset Flex Code
16585 \begin_layout Plain Layout
16594 \begin_inset Flex Code
16597 \begin_layout Plain Layout
16604 \begin_inset Flex Code
16607 \begin_layout Plain Layout
16614 \begin_inset Flex Code
16617 \begin_layout Plain Layout
16624 \begin_inset Flex Code
16627 \begin_layout Plain Layout
16634 \begin_inset Flex Code
16637 \begin_layout Plain Layout
16646 \begin_layout Subsection
16647 \begin_inset CommandInset label
16649 name "sub:Citation-format-description"
16653 Citation format description
16656 \begin_layout Standard
16658 \begin_inset Flex Code
16661 \begin_layout Plain Layout
16667 blocks are used to describe how bibliographic information should be displayed,
16668 both within LyX itself (in the citation dialog and in tooltips, for example)
16669 and in XHTML output.
16670 Such a block might look like this:
16673 \begin_layout LyX-Code
16677 \begin_layout LyX-Code
16681 \begin_layout LyX-Code
16685 \begin_layout LyX-Code
16689 \begin_layout Standard
16690 The individual lines define how the bibliographic information associated
16691 with an article or book, respectively, is to be displayed, and such a definitio
16692 n can be given for any `entry type' that might be present in a BibTeX file.
16693 LyX defines a default format in the source code that will be used if no
16694 specific definition has been given.
16695 LyX predefines several formats in the file
16696 \begin_inset Flex Code
16699 \begin_layout Plain Layout
16705 , which is included in most of LyX's document classes.
16708 \begin_layout Standard
16709 The definitions use a simple language that allows BibTeX keys to be replaced
16711 Keys should be enclosed in
16712 \begin_inset Flex Code
16715 \begin_layout Plain Layout
16722 \begin_inset Flex Code
16725 \begin_layout Plain Layout
16732 So a simple definition might look like this:
16735 \begin_layout LyX-Code
16737 \begin_inset Quotes eld
16741 \begin_inset Quotes erd
16747 \begin_layout Standard
16748 This would print the author, followed by a comma, followed by the title,
16749 in quotes, followed by a period.
16752 \begin_layout Standard
16753 Of course, sometimes you may want to print a key only if it exists.
16754 This can be done by using a conditional construction, such as:
16755 \begin_inset Flex Code
16758 \begin_layout Plain Layout
16760 \begin_inset space ~
16770 \begin_inset Flex Code
16773 \begin_layout Plain Layout
16779 key exists, then print
16780 \begin_inset Quotes eld
16784 \begin_inset space ~
16788 \begin_inset Quotes erd
16791 followed by the volume key.
16792 It is also possible to have an else clause in the conditional, such as:
16794 \begin_inset Flex Code
16797 \begin_layout Plain Layout
16798 {%author%[[%author%]][[%editor%, ed.]]}
16805 \begin_inset Flex Code
16808 \begin_layout Plain Layout
16814 key is printed if it exists; otherwise, the editor key is printed, followed
16816 \begin_inset Quotes eld
16820 \begin_inset space ~
16824 \begin_inset Quotes erd
16827 Note that the key is again enclosed in
16828 \begin_inset Flex Code
16831 \begin_layout Plain Layout
16837 signs; the entire conditional is enclosed in braces; and the if and else
16838 clauses are enclosed in double brackets,
16839 \begin_inset Quotes eld
16843 \begin_inset Flex Code
16846 \begin_layout Plain Layout
16853 \begin_inset Quotes eld
16857 \begin_inset Quotes eld
16861 \begin_inset Flex Code
16864 \begin_layout Plain Layout
16871 \begin_inset Quotes erd
16875 There must be no space between any of these.
16878 \begin_layout Standard
16879 There is one other piece of syntax available in definitions, which looks
16881 \begin_inset Flex Code
16884 \begin_layout Plain Layout
16891 This defines a piece of formatting information that is to be used when
16893 \begin_inset Quotes eld
16897 \begin_inset Quotes erd
16901 Obviously, we do not want to output HTML tags when writing plain text,
16902 so they should be wrapped in
16903 \begin_inset Quotes eld
16907 \begin_inset Quotes erd
16911 \begin_inset Quotes eld
16915 \begin_inset Quotes erd
16921 \begin_layout Standard
16922 Two special sorts of definitions are also possible in a
16923 \begin_inset Flex Code
16926 \begin_layout Plain Layout
16933 An example of the first would be:
16936 \begin_layout LyX-Code
16938 \begin_inset Quotes eld
16942 \begin_inset Quotes erd
16948 \begin_layout Standard
16949 This is an abbreviation, or macro, and it can be used by treating it as
16951 \begin_inset Flex Code
16954 \begin_layout Plain Layout
16962 \begin_inset Flex Code
16965 \begin_layout Plain Layout
16971 exactly as it would treat its definition.
16972 So, let us issue the obvious
16980 \begin_layout LyX-Code
16984 \begin_layout Standard
16985 or anything like it.
16986 LyX shouldn't go into an infinite loop, but it may go into a long one before
16990 \begin_layout Standard
16991 The second sort of special definition might look like this:
16994 \begin_layout LyX-Code
16998 \begin_layout Standard
16999 This defines a translatable piece of text, which allows relevant parts of
17000 the bibliography to be translated.
17001 It can be included in a definition by treating it as a key:
17002 \begin_inset Flex Code
17005 \begin_layout Plain Layout
17012 Several of these are predefined in
17013 \begin_inset Flex Code
17016 \begin_layout Plain Layout
17023 Note that these are not macros, in the sense just defined.
17024 They will not be expanded.
17027 \begin_layout Standard
17028 So here then is an example that use all these features:
17031 \begin_layout LyX-Code
17032 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
17035 \begin_layout Standard
17036 This defines a macro that prints the author, followed by a comma, if the
17038 \begin_inset Flex Code
17041 \begin_layout Plain Layout
17047 key is defined, or else prints the name of the editor, followed by the
17049 \begin_inset Flex Code
17052 \begin_layout Plain Layout
17058 or its translation (it is by default
17059 \begin_inset Quotes eld
17063 \begin_inset Quotes erd
17067 \begin_inset Flex Code
17070 \begin_layout Plain Layout
17077 Note that this is in fact defined in
17078 \begin_inset Flex Code
17081 \begin_layout Plain Layout
17087 , so you can use it in your own definitions, or re-definitions, if you load
17091 \begin_layout Section
17092 \begin_inset CommandInset label
17094 name "sec:Tags-for-XHTML"
17098 Tags for XHTML output
17101 \begin_layout Standard
17102 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
17103 by layout information.
17104 In general, LyX provides sensible defaults and, as mentioned earlier, it
17105 will even construct default CSS style rules from the other layout tags.
17106 For example, LyX will attempt to use the information provided in the
17107 \begin_inset Flex Code
17110 \begin_layout Plain Layout
17116 declaration for the Chapter style to write CSS that will appropriately
17117 format chapter headings.
17120 \begin_layout Standard
17121 In many cases, then, you may not have to do anything at all to get acceptable
17122 XHTML output for your own environments, custom insets, and so forth.
17123 But in some cases you will, and so LyX provides a number of layout tags
17124 that can be used to customize the XHTML and CSS that are generated.
17127 \begin_layout Standard
17128 Note that there are two tags,
17129 \begin_inset Flex Code
17132 \begin_layout Plain Layout
17139 \begin_inset Flex Code
17142 \begin_layout Plain Layout
17148 that may appear outside style and inset declarations.
17150 \begin_inset CommandInset ref
17152 reference "sub:General-text-class"
17156 for details on these.
17159 \begin_layout Subsection
17160 \begin_inset CommandInset label
17162 name "sub:Paragraph-Style-XHTML"
17169 \begin_layout Standard
17170 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
17171 dealing with a normal paragraph, a command, or an environment, where this
17172 is itself determined by the contents of the corresponding
17173 \begin_inset Flex Code
17176 \begin_layout Plain Layout
17186 \begin_layout Standard
17187 For a command or normal paragraph, the output XHTML has the following form:
17190 \begin_layout LyX-Code
17192 \begin_inset Quotes erd
17196 \begin_inset Quotes erd
17202 \begin_layout LyX-Code
17204 \begin_inset Quotes erd
17208 \begin_inset Quotes erd
17214 \begin_layout LyX-Code
17215 Contents of the paragraph.
17218 \begin_layout LyX-Code
17222 \begin_layout Standard
17223 The label tags are of course omitted if the paragraph does not have a label.
17226 \begin_layout Standard
17227 For an environment that is not some sort of list, the XHTML takes this form:
17230 \begin_layout LyX-Code
17232 \begin_inset Quotes erd
17236 \begin_inset Quotes erd
17242 \begin_layout LyX-Code
17244 \begin_inset Quotes erd
17248 \begin_inset Quotes erd
17252 \begin_inset Quotes erd
17256 \begin_inset Quotes erd
17259 >Environment Label</labeltag>First paragraph.</itemtag>
17262 \begin_layout LyX-Code
17263 <itemtag>Second paragraph.</itemtag>
17266 \begin_layout LyX-Code
17270 \begin_layout Standard
17271 Note that the label is output only for the first paragraph, as it should
17272 be for a theorem, for example.
17276 \begin_layout Standard
17277 For a list, we have one of these forms:
17280 \begin_layout LyX-Code
17282 \begin_inset Quotes erd
17286 \begin_inset Quotes erd
17292 \begin_layout LyX-Code
17294 \begin_inset Quotes erd
17298 \begin_inset Quotes erd
17302 \begin_inset Quotes erd
17306 \begin_inset Quotes erd
17309 >List Label</labeltag>First item.</itemtag>
17312 \begin_layout LyX-Code
17314 \begin_inset Quotes erd
17318 \begin_inset Quotes erd
17322 \begin_inset Quotes erd
17326 \begin_inset Quotes erd
17329 >List Label</labeltag>Second item.</itemtag>
17332 \begin_layout LyX-Code
17336 \begin_layout LyX-Code
17340 \begin_layout LyX-Code
17342 \begin_inset Quotes erd
17346 \begin_inset Quotes erd
17352 \begin_layout LyX-Code
17354 \begin_inset Quotes erd
17358 \begin_inset Quotes erd
17361 >List Label</labeltag><itemtag attr=
17362 \begin_inset Quotes erd
17366 \begin_inset Quotes erd
17369 >First item.</itemtag>
17372 \begin_layout LyX-Code
17374 \begin_inset Quotes erd
17378 \begin_inset Quotes erd
17381 >List Label</labeltag><itemtag attr=
17382 \begin_inset Quotes erd
17386 \begin_inset Quotes erd
17389 >Second item.</itemtag>
17392 \begin_layout LyX-Code
17396 \begin_layout Standard
17397 Note the different orders of
17398 \begin_inset Flex Code
17401 \begin_layout Plain Layout
17408 \begin_inset Flex Code
17411 \begin_layout Plain Layout
17418 Which order we get depends upon the setting of
17419 \begin_inset Flex Code
17422 \begin_layout Plain Layout
17429 \begin_inset Flex Code
17432 \begin_layout Plain Layout
17438 is false (the default), you get the first of these, with the label within
17439 the item; if true, you get the second, with the label outside the item.
17442 \begin_layout Standard
17443 The specific tags and attributes output for each paragraph type can be controlle
17444 d by means of the layout tags we are about to describe.
17445 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17446 so you often may not need to do very much to get good XHTML output.
17447 Think of the available tags as there so you can tweak things to your liking.
17450 \begin_layout Description
17451 \begin_inset Flex Code
17454 \begin_layout Plain Layout
17461 \begin_inset Flex Code
17464 \begin_layout Plain Layout
17470 ] Specifies attribute information to be output with the main tag.
17472 \begin_inset Quotes eld
17476 \begin_inset Flex Code
17479 \begin_layout Plain Layout
17486 \begin_inset Quotes erd
17490 By default, LyX will output
17491 \begin_inset Quotes eld
17495 \begin_inset Flex Code
17498 \begin_layout Plain Layout
17505 \begin_inset Quotes erd
17509 \begin_inset Flex Code
17512 \begin_layout Plain Layout
17518 is the LyX name of the layout, made lowercase, for example: chapter.
17523 contain any style information.
17525 \begin_inset Flex Code
17528 \begin_layout Plain Layout
17537 \begin_layout Description
17538 \begin_inset Flex Code
17541 \begin_layout Plain Layout
17548 \begin_inset Flex Code
17551 \begin_layout Plain Layout
17561 ] Whether to output the default CSS information LyX generates for this layout,
17562 even if additional information is explicitly provided via
17563 \begin_inset Flex Code
17566 \begin_layout Plain Layout
17574 \begin_inset Flex Code
17577 \begin_layout Plain Layout
17583 allows you to alter or augment the generated CSS, rather than to override
17586 \begin_inset Flex Code
17589 \begin_layout Plain Layout
17598 \begin_layout Description
17599 \begin_inset Flex Code
17602 \begin_layout Plain Layout
17609 \begin_inset Flex Code
17612 \begin_layout Plain Layout
17618 ] The tag to be used for individual paragraphs of environments, replacing
17620 \begin_inset Flex Code
17623 \begin_layout Plain Layout
17629 in the examples above.
17631 \begin_inset Flex Code
17634 \begin_layout Plain Layout
17643 \begin_layout Description
17644 \begin_inset Flex Code
17647 \begin_layout Plain Layout
17654 \begin_inset Flex Code
17657 \begin_layout Plain Layout
17663 ] Attributes for the item tag.
17665 \begin_inset Quotes eld
17669 \begin_inset Flex Code
17672 \begin_layout Plain Layout
17673 class=`layoutname_item'
17679 \begin_inset Quotes erd
17687 contain any style information.
17689 \begin_inset Flex Code
17692 \begin_layout Plain Layout
17701 \begin_layout Description
17702 \begin_inset Flex Code
17705 \begin_layout Plain Layout
17712 \begin_inset Flex Code
17715 \begin_layout Plain Layout
17721 ] The tag to be used for paragraph and item labels, replacing
17722 \begin_inset Flex Code
17725 \begin_layout Plain Layout
17731 in the examples above.
17733 \begin_inset Flex Code
17736 \begin_layout Plain Layout
17743 \begin_inset Flex Code
17746 \begin_layout Plain Layout
17753 \begin_inset Flex Code
17756 \begin_layout Plain Layout
17763 \begin_inset Flex Code
17766 \begin_layout Plain Layout
17767 Centered_Top_Environment
17772 , in which case it defaults to
17773 \begin_inset Flex Code
17776 \begin_layout Plain Layout
17785 \begin_layout Description
17786 \begin_inset Flex Code
17789 \begin_layout Plain Layout
17796 \begin_inset Flex Code
17799 \begin_layout Plain Layout
17805 ] Attributes for the label tag.
17807 \begin_inset Quotes eld
17811 \begin_inset Flex Code
17814 \begin_layout Plain Layout
17815 class=`layoutname_label'
17821 \begin_inset Quotes erd
17829 contain any style information.
17831 \begin_inset Flex Code
17834 \begin_layout Plain Layout
17843 \begin_layout Description
17844 \begin_inset Flex Code
17847 \begin_layout Plain Layout
17854 \begin_inset Flex Code
17857 \begin_layout Plain Layout
17867 ] Meaningful only for list-like environments, this tag controls whether
17868 the label tag is output before or inside the item tag.
17869 This is used, for example, in the description environment, where we want
17871 \begin_inset Flex Code
17874 \begin_layout Plain Layout
17875 <dt>\SpecialChar \ldots{}
17876 </dt><dd>\SpecialChar \ldots{}
17884 \begin_inset Flex Code
17887 \begin_layout Plain Layout
17893 : The label tag is output inside the item tag.
17896 \begin_layout Description
17897 \begin_inset Flex Code
17900 \begin_layout Plain Layout
17906 Information to be output in the
17907 \begin_inset Flex Code
17910 \begin_layout Plain Layout
17916 section when this style is used.
17917 This might, for example, be used to include a
17918 \begin_inset Flex Code
17921 \begin_layout Plain Layout
17928 \begin_inset Flex Code
17931 \begin_layout Plain Layout
17940 \begin_layout Description
17941 \begin_inset Flex Code
17944 \begin_layout Plain Layout
17950 CSS style information to be included when this style is used.
17951 Note that this will automatically be wrapped in a layout-generated
17952 \begin_inset Flex Code
17955 \begin_layout Plain Layout
17961 block, so only the CSS itself need be included.
17964 \begin_layout Description
17965 \begin_inset Flex Code
17968 \begin_layout Plain Layout
17975 \begin_inset Flex Code
17978 \begin_layout Plain Layout
17984 ] The tag to be used for the main label, replacing
17985 \begin_inset Flex Code
17988 \begin_layout Plain Layout
17994 in the examples above.
17996 \begin_inset Flex Code
17999 \begin_layout Plain Layout
18008 \begin_layout Description
18009 \begin_inset Flex Code
18012 \begin_layout Plain Layout
18019 \begin_inset Flex Code
18022 \begin_layout Plain Layout
18032 ] Marks this style as the one to be used to generate the
18033 \begin_inset Flex Code
18036 \begin_layout Plain Layout
18042 tag for the XHTML file.
18043 By default, it is false.
18045 \begin_inset Flex Code
18048 \begin_layout Plain Layout
18054 file sets it to true for the
18055 \begin_inset Flex Code
18058 \begin_layout Plain Layout
18068 \begin_layout Subsection
18072 \begin_layout Standard
18073 The XHTML output of insets can also be controlled by information in layout
18078 \begin_layout Plain Layout
18079 At present, this is true only for
18080 \begin_inset Quotes eld
18084 \begin_inset Quotes erd
18087 insets (insets you can type into) and is not true for
18088 \begin_inset Quotes eld
18092 \begin_inset Quotes erd
18095 insets (insets that are associated with dialog boxes).
18100 Here, too, LyX tries to provide sensible defaults, and it constructs default
18102 But everything can be customized.
18105 \begin_layout Standard
18106 The XHTML LyX outputs for an inset has the following form:
18109 \begin_layout LyX-Code
18111 \begin_inset Quotes erd
18115 \begin_inset Quotes erd
18121 \begin_layout LyX-Code
18122 <labeltag>Label</labeltag>
18125 \begin_layout LyX-Code
18127 \begin_inset Quotes erd
18131 \begin_inset Quotes erd
18134 >Contents of the inset.</innertag>
18137 \begin_layout LyX-Code
18141 \begin_layout Standard
18142 If the inset permits multiple paragraphs---that is, if
18143 \begin_inset Flex Code
18146 \begin_layout Plain Layout
18152 is true---then the contents of the inset will itself be output as paragraphs
18153 formatted according to the styles used for those paragraphs (standard,
18154 quote, and the like).
18155 The label tag is of course omitted if the paragraph does not have a label
18156 and, at present, is always
18157 \begin_inset Flex Code
18160 \begin_layout Plain Layout
18167 The inner tag is optional and, by default, does not appear.
18170 \begin_layout Standard
18171 The specific tags and attributes output for each inset can be controlled
18172 by means of the following layout tags.
18175 \begin_layout Description
18176 \begin_inset Flex Code
18179 \begin_layout Plain Layout
18186 \begin_inset Flex Code
18189 \begin_layout Plain Layout
18195 ] Specifies attribute information to be output with the main tag.
18197 \begin_inset Quotes eld
18201 \begin_inset Flex Code
18204 \begin_layout Plain Layout
18205 class=`myinset' onclick=`\SpecialChar \ldots{}
18212 \begin_inset Quotes erd
18216 By default, LyX will output
18217 \begin_inset Quotes eld
18221 \begin_inset Flex Code
18224 \begin_layout Plain Layout
18231 \begin_inset Quotes erd
18235 \begin_inset Flex Code
18238 \begin_layout Plain Layout
18244 is the LyX name of the inset, made lowercase and with non-alphanumeric
18245 characters converted to underscores, for example: footnote.
18248 \begin_layout Description
18249 \begin_inset Flex Code
18252 \begin_layout Plain Layout
18259 \begin_inset Flex Code
18262 \begin_layout Plain Layout
18272 ] Whether to output the default CSS information LyX generates for this layout,
18273 even if additional information is explicitly provided via
18274 \begin_inset Flex Code
18277 \begin_layout Plain Layout
18285 \begin_inset Flex Code
18288 \begin_layout Plain Layout
18294 allows you to alter or augment the generated CSS, rather than to override
18299 \begin_layout Description
18300 \begin_inset Flex Code
18303 \begin_layout Plain Layout
18310 \begin_inset Flex Code
18313 \begin_layout Plain Layout
18319 ] Attributes for the inner tag.
18321 \begin_inset Quotes eld
18325 \begin_inset Flex Code
18328 \begin_layout Plain Layout
18329 class=`insetname_inner'
18335 \begin_inset Quotes erd
18341 \begin_layout Description
18342 \begin_inset Flex Code
18345 \begin_layout Plain Layout
18352 \begin_inset Flex Code
18355 \begin_layout Plain Layout
18361 ] The inner tag, replacing
18362 \begin_inset Flex Code
18365 \begin_layout Plain Layout
18371 in the examples above.
18372 By default, there is none.
18375 \begin_layout Description
18376 \begin_inset Flex Code
18379 \begin_layout Plain Layout
18386 \begin_inset Flex Code
18389 \begin_layout Plain Layout
18397 ] Whether this inset represents a standalone block of text (such as a footnote)
18398 or instead represents material that is included in the surrounding text
18399 (such as a branch).
18403 \begin_layout Description
18404 \begin_inset Flex Code
18407 \begin_layout Plain Layout
18414 \begin_inset Flex Code
18417 \begin_layout Plain Layout
18423 ] A label for this inset, possibly including a reference to a counter.
18424 For example, for footnote, it might be:
18425 \begin_inset Flex Code
18428 \begin_layout Plain Layout
18437 This is optional, and there is no default.
18440 \begin_layout Description
18441 \begin_inset Flex Code
18444 \begin_layout Plain Layout
18450 Information to be output in the
18451 \begin_inset Flex Code
18454 \begin_layout Plain Layout
18460 section when this style is used.
18461 This might, for example, be used to include a
18462 \begin_inset Flex Code
18465 \begin_layout Plain Layout
18472 \begin_inset Flex Code
18475 \begin_layout Plain Layout
18484 \begin_layout Description
18485 \begin_inset Flex Code
18488 \begin_layout Plain Layout
18494 CSS style information to be included when this style is used.
18495 Note that this will automatically be wrapped in a layout-generated
18496 \begin_inset Flex Code
18499 \begin_layout Plain Layout
18505 block, so only the CSS itself need be included.
18508 \begin_layout Description
18509 \begin_inset Flex Code
18512 \begin_layout Plain Layout
18519 \begin_inset Flex Code
18522 \begin_layout Plain Layout
18528 ] The tag to be used for the main label, replacing
18529 \begin_inset Flex Code
18532 \begin_layout Plain Layout
18538 in the examples above.
18539 The default depends upon the setting of
18540 \begin_inset Flex Code
18543 \begin_layout Plain Layout
18550 \begin_inset Flex Code
18553 \begin_layout Plain Layout
18559 is true, the default is
18560 \begin_inset Flex Code
18563 \begin_layout Plain Layout
18569 ; if it is false, the default is
18570 \begin_inset Flex Code
18573 \begin_layout Plain Layout
18582 \begin_layout Subsection
18586 \begin_layout Standard
18587 The XHTML output for floats too can be controlled by layout information.
18588 The output has the following form:
18591 \begin_layout LyX-Code
18593 \begin_inset Quotes erd
18597 \begin_inset Quotes erd
18603 \begin_layout LyX-Code
18604 Contents of the float.
18607 \begin_layout LyX-Code
18611 \begin_layout Standard
18612 The caption, if there is one, is a separate inset and will be output as
18614 Its appearance can be controlled via the InsetLayout for caption insets.
18618 \begin_layout Description
18619 \begin_inset Flex Code
18622 \begin_layout Plain Layout
18629 \begin_inset Flex Code
18632 \begin_layout Plain Layout
18638 ] Specifies attribute information to be output with the main tag.
18640 \begin_inset Quotes eld
18644 \begin_inset Flex Code
18647 \begin_layout Plain Layout
18648 class=`myfloat' onclick=`\SpecialChar \ldots{}
18655 \begin_inset Quotes erd
18659 By default, LyX will output
18660 \begin_inset Quotes eld
18664 \begin_inset Flex Code
18667 \begin_layout Plain Layout
18668 class=`float float-floattype'
18674 \begin_inset Quotes erd
18678 \begin_inset Flex Code
18681 \begin_layout Plain Layout
18687 is LyX's name for this type of float, as determined by the float declaration
18689 \begin_inset CommandInset ref
18691 reference "sub:Floats"
18695 ), though made lowercase and with non-alphanumeric characters converted
18696 to underscores, for example: float-table.
18699 \begin_layout Description
18700 \begin_inset Flex Code
18703 \begin_layout Plain Layout
18709 CSS style information to be included when this float is used.
18710 Note that this will automatically be wrapped in a layout-generated
18711 \begin_inset Flex Code
18714 \begin_layout Plain Layout
18720 block, so only the CSS itself need be included.
18723 \begin_layout Description
18724 \begin_inset Flex Code
18727 \begin_layout Plain Layout
18734 \begin_inset Flex Code
18737 \begin_layout Plain Layout
18743 ] The tag to be used for this float, replacing
18744 \begin_inset Quotes eld
18748 \begin_inset Flex Code
18751 \begin_layout Plain Layout
18758 \begin_inset Quotes erd
18761 in the example above.
18763 \begin_inset Flex Code
18766 \begin_layout Plain Layout
18772 and will rarely need changing.
18775 \begin_layout Subsection
18776 Bibliography formatting
18779 \begin_layout Standard
18780 The bibliography can be formatted using
18781 \begin_inset Flex Code
18784 \begin_layout Plain Layout
18792 \begin_inset CommandInset ref
18794 reference "sub:Citation-format-description"
18801 \begin_layout Subsection
18805 \begin_layout Standard
18806 We have several times mentioned that LyX will generate default CSS style
18807 rules for both insets and paragraph styles, based upon the other layout
18808 information that is provided.
18809 In this section, we shall say a word about which layout information LyX
18813 \begin_layout Standard
18814 At present, LyX auto-generates CSS only for font information, making use
18816 \begin_inset Flex Code
18819 \begin_layout Plain Layout
18826 \begin_inset Flex Code
18829 \begin_layout Plain Layout
18836 \begin_inset Flex Code
18839 \begin_layout Plain Layout
18846 \begin_inset Flex Code
18849 \begin_layout Plain Layout
18856 \begin_inset Flex Code
18859 \begin_layout Plain Layout
18867 \begin_inset CommandInset ref
18869 reference "sub:Font-description"
18873 .) The translation is mostly straightforward and obvious.
18875 \begin_inset Quotes eld
18879 \begin_inset Flex Code
18882 \begin_layout Plain Layout
18889 \begin_inset Quotes erd
18893 \begin_inset Quotes eld
18897 \begin_inset Flex Code
18900 \begin_layout Plain Layout
18901 font-family: sans-serif;
18907 \begin_inset Quotes erd
18911 The correspondence of LyX sizes and CSS sizes is a little less obvious
18912 but nonetheless intuitive.
18914 \begin_inset Flex Code
18917 \begin_layout Plain Layout
18924 \begin_inset Flex URL
18927 \begin_layout Plain Layout
18937 \begin_layout Chapter
18938 Including External Material
18941 \begin_layout Standard
18942 \begin_inset Box Shadowbox
18952 height_special "totalheight"
18955 \begin_layout Plain Layout
18956 WARNING: This portion of the documentation has not been updated for some
18958 We certainly hope that it is still accurate, but there are no guarantees.
18966 \begin_layout Standard
18967 The use of material from sources external to LyX is covered in detail in
18973 This part of the manual covers what needs to happen behind the scenes for
18974 new sorts of material to be included.
18977 \begin_layout Section
18981 \begin_layout Standard
18982 The external material feature is based on the concept of a
18987 A template is a specification of how LyX should interface with a certain
18989 As bundled, LyX comes with predefined templates for Xfig figures, various
18990 raster format images, chess diagrams, and LilyPond music notation.
18991 You can check the actual list by using the menu
18992 \begin_inset Flex MenuItem
18995 \begin_layout Plain Layout
18996 Insert\SpecialChar \menuseparator
18997 File\SpecialChar \menuseparator
19004 Furthermore, it is possible to roll your own template to support a specific
19006 Later we'll describe in more detail what is involved, and hopefully you
19007 will submit all the templates you create so we can include them in a later
19011 \begin_layout Standard
19012 Another basic idea of the external material feature is to distinguish between
19013 the original file that serves as a base for final material and the produced
19014 file that is included in your exported or printed document.
19015 For example, consider the case of a figure produced with
19016 \begin_inset Flex Code
19019 \begin_layout Plain Layout
19026 The Xfig application itself works on an original file with the
19027 \begin_inset Flex Code
19030 \begin_layout Plain Layout
19037 Within Xfig, you create and change your figure, and when you are done,
19039 \begin_inset Flex Code
19042 \begin_layout Plain Layout
19049 When you want to include the figure in your document, you invoke
19050 \begin_inset Flex Code
19053 \begin_layout Plain Layout
19059 in order to create a PostScript file that can readily be included in your
19062 \begin_inset Flex Code
19065 \begin_layout Plain Layout
19071 file is the original file, and the PostScript file is the produced file.
19074 \begin_layout Standard
19075 This distinction is important in order to allow updating of the material
19076 while you are in the process of writing the document.
19077 Furthermore, it provides us with the flexibility that is needed to support
19078 multiple export formats.
19079 For instance, in the case of a plain text file, it is not exactly an award-winn
19080 ing idea to include the figure as raw PostScript.
19081 Instead, you would either prefer to just include a reference to the figure
19082 or try to invoke some graphics to ASCII converter to make the final result
19083 look similar to the real graphics.
19084 The external material management allows you to do this, because it is parametri
19085 zed on the different export formats that LyX supports.
19088 \begin_layout Standard
19089 Besides supporting the production of different products according to the
19090 exported format, it supports tight integration with editing and viewing
19092 In the case of an Xfig figure, you are able to invoke Xfig on the original
19093 file with a single click from within the external material dialog in LyX,
19094 and also preview the produced PostScript file with Ghostview with another
19096 No more fiddling around with the command line and/or file browsers to locate
19097 and manipulate the original or produced files.
19098 In this way, you are finally able to take full advantage of the many different
19099 applications that are relevant to use when you write your documents, and
19100 ultimately be more productive.
19103 \begin_layout Section
19104 The external template configuration file
19107 \begin_layout Standard
19108 It is relatively easy to add custom external template definitions to LyX.
19109 However, be aware that doing this in an careless manner most probably
19113 introduce an easily exploitable security hole.
19114 So before you do this, please read the discussion about security in section
19116 \begin_inset CommandInset ref
19118 reference "sec:Security-discussion"
19125 \begin_layout Standard
19126 Having said that, we encourage you to submit any interesting templates that
19131 \begin_layout Standard
19132 The external templates are defined in the
19133 \begin_inset Flex Code
19136 \begin_layout Plain Layout
19137 LyXDir/lib/external_templates
19143 You can place your own version in
19144 \begin_inset Flex Code
19147 \begin_layout Plain Layout
19148 UserDir/external_templates
19156 \begin_layout Standard
19157 A typical template looks like this:
19160 \begin_layout LyX-Code
19164 \begin_layout LyX-Code
19165 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
19168 \begin_layout LyX-Code
19172 \begin_layout LyX-Code
19176 \begin_layout LyX-Code
19180 \begin_layout LyX-Code
19184 \begin_layout LyX-Code
19188 \begin_layout LyX-Code
19189 AutomaticProduction true
19192 \begin_layout LyX-Code
19196 \begin_layout LyX-Code
19200 \begin_layout LyX-Code
19204 \begin_layout LyX-Code
19205 TransformCommand Rotate RotationLatexCommand
19208 \begin_layout LyX-Code
19209 TransformCommand Resize ResizeLatexCommand
19212 \begin_layout LyX-Code
19213 Product "$$RotateFront$$ResizeFront
19216 \begin_layout LyX-Code
19221 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
19224 \begin_layout LyX-Code
19225 $$ResizeBack$$RotateBack"
19228 \begin_layout LyX-Code
19232 \begin_layout LyX-Code
19233 UpdateResult "$$AbsPath$$Basename.pstex_t"
19236 \begin_layout LyX-Code
19237 Requirement "graphicx"
19240 \begin_layout LyX-Code
19241 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19244 \begin_layout LyX-Code
19245 ReferencedFile latex "$$AbsPath$$Basename.eps"
19248 \begin_layout LyX-Code
19249 ReferencedFile dvi "$$AbsPath$$Basename.eps"
19252 \begin_layout LyX-Code
19256 \begin_layout LyX-Code
19260 \begin_layout LyX-Code
19261 TransformCommand Rotate RotationLatexCommand
19264 \begin_layout LyX-Code
19265 TransformCommand Resize ResizeLatexCommand
19268 \begin_layout LyX-Code
19269 Product "$$RotateFront$$ResizeFront
19272 \begin_layout LyX-Code
19277 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
19280 \begin_layout LyX-Code
19281 $$ResizeBack$$RotateBack"
19284 \begin_layout LyX-Code
19285 UpdateFormat pdftex
19288 \begin_layout LyX-Code
19289 UpdateResult "$$AbsPath$$Basename.pdftex_t"
19292 \begin_layout LyX-Code
19293 Requirement "graphicx"
19296 \begin_layout LyX-Code
19297 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
19300 \begin_layout LyX-Code
19301 ReferencedFile latex "$$AbsPath$$Basename.pdf"
19304 \begin_layout LyX-Code
19308 \begin_layout LyX-Code
19312 \begin_layout LyX-Code
19313 Product "$$Contents(
19315 "$$AbsPath$$Basename.asc
19320 \begin_layout LyX-Code
19321 UpdateFormat asciixfig
19324 \begin_layout LyX-Code
19325 UpdateResult "$$AbsPath$$Basename.asc"
19328 \begin_layout LyX-Code
19332 \begin_layout LyX-Code
19336 \begin_layout LyX-Code
19337 Product "<graphic fileref=
19339 "$$AbsOrRelPathMaster$$Basename.eps
19344 \begin_layout LyX-Code
19348 \begin_layout LyX-Code
19352 \begin_layout LyX-Code
19353 UpdateResult "$$AbsPath$$Basename.eps"
19356 \begin_layout LyX-Code
19357 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19360 \begin_layout LyX-Code
19361 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19364 \begin_layout LyX-Code
19368 \begin_layout LyX-Code
19369 Product "[XFig: $$FName]"
19372 \begin_layout LyX-Code
19376 \begin_layout LyX-Code
19380 \begin_layout Standard
19381 As you can see, the template is enclosed in
19382 \begin_inset Flex Code
19385 \begin_layout Plain Layout
19391 \SpecialChar \ldots{}
19393 \begin_inset Flex Code
19396 \begin_layout Plain Layout
19403 It contains a header specifying some general settings and, for each supported
19404 primary document file format, a section
19405 \begin_inset Flex Code
19408 \begin_layout Plain Layout
19414 \SpecialChar \ldots{}
19416 \begin_inset Flex Code
19419 \begin_layout Plain Layout
19428 \begin_layout Subsection
19429 The template header
19432 \begin_layout Description
19433 \begin_inset Flex Code
19436 \begin_layout Plain Layout
19437 AutomaticProduction
19438 \begin_inset space ~
19446 Whether the file represented by the template must be generated by LyX.
19447 This command must occur exactly once.
19450 \begin_layout Description
19451 \begin_inset Flex Code
19454 \begin_layout Plain Layout
19456 \begin_inset space ~
19464 A glob pattern that is used in the file dialog to filter out the desired
19466 If there is more than one possible file extension (e.
19467 \begin_inset space \thinspace{}
19471 \begin_inset space \space{}
19475 \begin_inset Flex Code
19478 \begin_layout Plain Layout
19485 \begin_inset Flex Code
19488 \begin_layout Plain Layout
19494 ), use something like
19495 \begin_inset Flex Code
19498 \begin_layout Plain Layout
19505 This command must occur exactly once.
19508 \begin_layout Description
19509 \begin_inset Flex Code
19512 \begin_layout Plain Layout
19514 \begin_inset space ~
19522 The text that is displayed on the button.
19523 This command must occur exactly once.
19526 \begin_layout Description
19527 \begin_inset Flex Code
19530 \begin_layout Plain Layout
19532 \begin_inset space ~
19536 \begin_inset space ~
19544 The help text that is used in the External dialog.
19545 Provide enough information to explain to the user just what the template
19546 can provide him with.
19547 This command must occur exactly once.
19550 \begin_layout Description
19551 \begin_inset Flex Code
19554 \begin_layout Plain Layout
19556 \begin_inset space ~
19564 The file format of the original file.
19565 This must be the name of a format that is known to LyX (see section
19566 \begin_inset space ~
19570 \begin_inset CommandInset ref
19572 reference "sec:Formats"
19578 \begin_inset Quotes eld
19582 \begin_inset Flex Code
19585 \begin_layout Plain Layout
19592 \begin_inset Quotes erd
19595 if the template can handle original files of more than one format.
19596 LyX will attempt to interrogate the file itself in order to deduce its
19597 format in this case.
19598 This command must occur exactly once.
19601 \begin_layout Description
19602 \begin_inset Flex Code
19605 \begin_layout Plain Layout
19607 \begin_inset space ~
19615 A unique name for the template.
19616 It must not contain substitution macros (see below).
19619 \begin_layout Description
19620 \begin_inset Flex Code
19623 \begin_layout Plain Layout
19625 \begin_inset space ~
19628 Rotate|Resize|Clip|Extra
19633 This command specifies which transformations are supported by this template.
19634 It may occur zero or more times.
19635 This command enables the corresponding tabs in the external dialog.
19637 \begin_inset Flex Code
19640 \begin_layout Plain Layout
19646 command must have either a corresponding
19647 \begin_inset Flex Code
19650 \begin_layout Plain Layout
19657 \begin_inset Flex Code
19660 \begin_layout Plain Layout
19667 \begin_inset Flex Code
19670 \begin_layout Plain Layout
19677 Otherwise the transformation will not be supported by that format.
19680 \begin_layout Subsection
19684 \begin_layout Description
19685 \begin_inset Flex Code
19688 \begin_layout Plain Layout
19690 \begin_inset space ~
19693 LaTeX|PDFLaTeX|PlainText|DocBook
19698 The primary document file format that this format definition is for.
19699 Not every template has a sensible representation in all document file formats.
19700 Please define nevertheless a
19701 \begin_inset Flex Code
19704 \begin_layout Plain Layout
19710 section for all templates.
19711 Use a dummy text when no representation is available.
19712 Then you can at least see a reference to the external material in the exported
19716 \begin_layout Description
19717 \begin_inset Flex Code
19720 \begin_layout Plain Layout
19722 \begin_inset space ~
19726 \begin_inset space ~
19734 This command defines an additional macro
19735 \begin_inset Flex Code
19738 \begin_layout Plain Layout
19744 for substitution in
19745 \begin_inset Flex Code
19748 \begin_layout Plain Layout
19756 \begin_inset Flex Code
19759 \begin_layout Plain Layout
19765 itself may contain substitution macros.
19766 The advantage over using
19767 \begin_inset Flex Code
19770 \begin_layout Plain Layout
19777 \begin_inset Flex Code
19780 \begin_layout Plain Layout
19786 is that the substituted value of
19787 \begin_inset Flex Code
19790 \begin_layout Plain Layout
19796 is sanitized so that it is a valid optional argument in the document format.
19797 This command may occur zero or more times.
19800 \begin_layout Description
19801 \begin_inset Flex Code
19804 \begin_layout Plain Layout
19806 \begin_inset space ~
19814 The text that is inserted in the exported document.
19815 This is actually the most important command and can be quite complex.
19816 This command must occur exactly once.
19819 \begin_layout Description
19820 \begin_inset Flex Code
19823 \begin_layout Plain Layout
19825 \begin_inset space ~
19833 This command specifies a preamble snippet that will be included in the
19835 It has to be defined using
19836 \begin_inset Flex Code
19839 \begin_layout Plain Layout
19845 \SpecialChar \ldots{}
19847 \begin_inset Flex Code
19850 \begin_layout Plain Layout
19857 This command may occur zero or more times.
19860 \begin_layout Description
19861 \begin_inset Flex Code
19864 \begin_layout Plain Layout
19866 \begin_inset space ~
19870 \begin_inset space ~
19878 This command denotes files that are created by the conversion process and
19879 are needed for a particular export format.
19880 If the filename is relative, it is interpreted relative to the master document.
19881 This command may be given zero or more times.
19884 \begin_layout Description
19885 \begin_inset Flex Code
19888 \begin_layout Plain Layout
19890 \begin_inset space ~
19898 The name of a required LaTeX package.
19899 The package is included via
19900 \begin_inset Flex Code
19903 \begin_layout Plain Layout
19911 in the LaTeX preamble.
19912 This command may occur zero or more times.
19915 \begin_layout Description
19916 \begin_inset Flex Code
19919 \begin_layout Plain Layout
19921 \begin_inset space ~
19925 \begin_inset space ~
19928 RotationLatexCommand
19933 This command specifies that the built in LaTeX command should be used for
19935 This command may occur once or not at all.
19938 \begin_layout Description
19939 \begin_inset Flex Code
19942 \begin_layout Plain Layout
19944 \begin_inset space ~
19948 \begin_inset space ~
19956 This command specifies that the built in LaTeX command should be used for
19958 This command may occur once or not at all.
19961 \begin_layout Description
19962 \begin_inset Flex Code
19965 \begin_layout Plain Layout
19967 \begin_inset space ~
19971 \begin_inset space ~
19974 RotationLatexOption
19979 This command specifies that rotation is done via an optional argument.
19980 This command may occur once or not at all.
19983 \begin_layout Description
19984 \begin_inset Flex Code
19987 \begin_layout Plain Layout
19989 \begin_inset space ~
19993 \begin_inset space ~
20001 This command specifies that resizing is done via an optional argument.
20002 This command may occur once or not at all.
20005 \begin_layout Description
20006 \begin_inset Flex Code
20009 \begin_layout Plain Layout
20011 \begin_inset space ~
20015 \begin_inset space ~
20023 This command specifies that clipping is done via an optional argument.
20024 This command may occur once or not at all.
20027 \begin_layout Description
20028 \begin_inset Flex Code
20031 \begin_layout Plain Layout
20033 \begin_inset space ~
20037 \begin_inset space ~
20045 This command specifies that an extra optional argument is used.
20046 This command may occur once or not at all.
20049 \begin_layout Description
20050 \begin_inset Flex Code
20053 \begin_layout Plain Layout
20055 \begin_inset space ~
20063 The file format of the converted file.
20064 This must be the name of a format that is known to LyX (see the
20065 \begin_inset Flex MenuItem
20068 \begin_layout Plain Layout
20073 ools\SpecialChar \menuseparator
20078 references\SpecialChar \menuseparator
20079 File Handling\SpecialChar \menuseparator
20086 This command must occur exactly once.
20089 \begin_layout Description
20090 \begin_inset Flex Code
20093 \begin_layout Plain Layout
20095 \begin_inset space ~
20103 The file name of the converted file.
20104 The file name must be absolute.
20105 This command must occur exactly once.
20108 \begin_layout Subsection
20109 Preamble definitions
20112 \begin_layout Standard
20113 The external template configuration file may contain additional preamble
20114 definitions enclosed by
20115 \begin_inset Flex Code
20118 \begin_layout Plain Layout
20124 \SpecialChar \ldots{}
20126 \begin_inset Flex Code
20129 \begin_layout Plain Layout
20136 They can be used by the templates in the
20137 \begin_inset Flex Code
20140 \begin_layout Plain Layout
20149 \begin_layout Section
20150 The substitution mechanism
20153 \begin_layout Standard
20154 When the external material facility invokes an external program, it is done
20155 on the basis of a command defined in the template configuration file.
20156 These commands can contain various macros that are expanded before execution.
20157 Execution always take place in the directory of the containing document.
20160 \begin_layout Standard
20161 Also, whenever external material is to be displayed, the name will be produced
20162 by the substitution mechanism, and most other commands in the template
20163 definition support substitution as well.
20166 \begin_layout Standard
20167 The available macros are the following:
20170 \begin_layout Description
20171 \begin_inset Flex Code
20174 \begin_layout Plain Layout
20175 $$AbsOrRelPathMaster
20180 The file path, absolute or relative to the master LyX document.
20183 \begin_layout Description
20184 \begin_inset Flex Code
20187 \begin_layout Plain Layout
20188 $$AbsOrRelPathParent
20193 The file path, absolute or relative to the LyX document.
20196 \begin_layout Description
20197 \begin_inset Flex Code
20200 \begin_layout Plain Layout
20206 The absolute file path.
20209 \begin_layout Description
20210 \begin_inset Flex Code
20213 \begin_layout Plain Layout
20219 The filename without path and without the extension.
20222 \begin_layout Description
20223 \begin_inset Flex Code
20226 \begin_layout Plain Layout
20228 \begin_inset Quotes eld
20232 \begin_inset Quotes erd
20240 This macro will expand to the contents of the file with the name
20241 \begin_inset Flex Code
20244 \begin_layout Plain Layout
20253 \begin_layout Description
20254 \begin_inset Flex Code
20257 \begin_layout Plain Layout
20263 The file extension (including the dot).
20266 \begin_layout Description
20267 \begin_inset Flex Code
20270 \begin_layout Plain Layout
20276 The filename of the file specified in the external material dialog.
20277 This is either an absolute name, or it is relative to the LyX document.
20280 \begin_layout Description
20281 \begin_inset Flex Code
20284 \begin_layout Plain Layout
20291 \begin_inset Flex Code
20294 \begin_layout Plain Layout
20300 (absolute name or relative to the LyX document).
20303 \begin_layout Description
20304 \begin_inset Flex Code
20307 \begin_layout Plain Layout
20313 The file path, relative to the master LyX document.
20316 \begin_layout Description
20317 \begin_inset Flex Code
20320 \begin_layout Plain Layout
20326 The file path, relative to the LyX document.
20329 \begin_layout Description
20330 \begin_inset Flex Code
20333 \begin_layout Plain Layout
20339 This macro will expand to the absolute path of the system directory.
20340 This is typically used to point to the various helper scripts that are
20344 \begin_layout Description
20345 \begin_inset Flex Code
20348 \begin_layout Plain Layout
20354 A name and full path to a temporary file which will be automatically deleted
20355 whenever the containing document is closed, or the external material insertion
20359 \begin_layout Standard
20360 All path macros contain a trailing directory separator, so you can construct
20362 \begin_inset space \thinspace{}
20366 \begin_inset space \space{}
20369 the absolute filename with
20370 \begin_inset Flex Code
20373 \begin_layout Plain Layout
20374 $$AbsPath$$Basename$$Extension
20382 \begin_layout Standard
20383 The macros above are substituted in all commands unless otherwise noted.
20385 \begin_inset Flex Code
20388 \begin_layout Plain Layout
20394 supports additionally the following substitutions if they are enabled by
20396 \begin_inset Flex Code
20399 \begin_layout Plain Layout
20406 \begin_inset Flex Code
20409 \begin_layout Plain Layout
20418 \begin_layout Description
20419 \begin_inset Flex Code
20422 \begin_layout Plain Layout
20428 The front part of the resize command.
20431 \begin_layout Description
20432 \begin_inset Flex Code
20435 \begin_layout Plain Layout
20441 The back part of the resize command.
20444 \begin_layout Description
20445 \begin_inset Flex Code
20448 \begin_layout Plain Layout
20454 The front part of the rotation command.
20457 \begin_layout Description
20458 \begin_inset Flex Code
20461 \begin_layout Plain Layout
20467 The back part of the rotation command.
20470 \begin_layout Standard
20471 The value string of the
20472 \begin_inset Flex Code
20475 \begin_layout Plain Layout
20481 command supports additionally the following substitutions if they are enabled
20483 \begin_inset Flex Code
20486 \begin_layout Plain Layout
20493 \begin_inset Flex Code
20496 \begin_layout Plain Layout
20505 \begin_layout Description
20506 \begin_inset Flex Code
20509 \begin_layout Plain Layout
20518 \begin_layout Description
20519 \begin_inset Flex Code
20522 \begin_layout Plain Layout
20531 \begin_layout Description
20532 \begin_inset Flex Code
20535 \begin_layout Plain Layout
20544 \begin_layout Description
20545 \begin_inset Flex Code
20548 \begin_layout Plain Layout
20554 The rotation option.
20557 \begin_layout Standard
20558 You may ask why there are so many path macros.
20559 There are mainly two reasons:
20562 \begin_layout Enumerate
20563 Relative and absolute file names should remain relative or absolute, respectivel
20565 Users may have reasons to prefer either form.
20566 Relative names are useful for portable documents that should work on different
20567 machines, for example.
20568 Absolute names may be required by some programs.
20571 \begin_layout Enumerate
20572 LaTeX treats relative file names differently than LyX and other programs
20573 in nested included files.
20574 For LyX, a relative file name is always relative to the document that contains
20576 For LaTeX, it is always relative to the master document.
20577 These two definitions are identical if you have only one document, but
20578 differ if you have a master document that includes part documents.
20579 That means that relative filenames must be transformed when presented to
20581 Fortunately LyX does this automatically for you if you choose the right
20585 \begin_layout Standard
20586 So which path macro should be used in new template definitions? The rule
20590 \begin_layout Itemize
20592 \begin_inset Flex Code
20595 \begin_layout Plain Layout
20601 if an absolute path is required.
20604 \begin_layout Itemize
20606 \begin_inset Flex Code
20609 \begin_layout Plain Layout
20610 $$AbsOrRelPathMaster
20615 if the substituted string is some kind of LaTeX input.
20618 \begin_layout Itemize
20620 \begin_inset Flex Code
20623 \begin_layout Plain Layout
20624 $$AbsOrRelPathParent
20629 in order to preserve the user's choice.
20632 \begin_layout Standard
20633 There are special cases where this rule does not work and e.
20634 \begin_inset space \thinspace{}
20638 \begin_inset space \space{}
20641 relative names are needed, but normally it will work just fine.
20642 One example for such a case is the command
20643 \begin_inset Flex Code
20646 \begin_layout Plain Layout
20647 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20652 in the XFig template above: We can't use the absolute name because the
20654 \begin_inset Flex Code
20657 \begin_layout Plain Layout
20663 files needs the relative name in order to rewrite the file content.
20666 \begin_layout Section
20667 Security discussion
20668 \begin_inset CommandInset label
20670 name "sec:Security-discussion"
20677 \begin_layout Standard
20678 The external material feature interfaces with a lot of external programs
20679 and does so automatically, so we have to consider the security implications
20681 In particular, since you have the option of including your own filenames
20682 and/or parameter strings and those are expanded into a command, it seems
20683 that it would be possible to create a malicious document which executes
20684 arbitrary commands when a user views or prints the document.
20685 This is something we definitely want to avoid.
20688 \begin_layout Standard
20689 However, since the external program commands are specified in the template
20690 configuration file only, there are no security issues if LyX is properly
20691 configured with safe templates only.
20692 This is so because the external programs are invoked with the
20693 \begin_inset Flex Code
20696 \begin_layout Plain Layout
20702 -system call rather than the
20703 \begin_inset Flex Code
20706 \begin_layout Plain Layout
20712 system-call, so it's not possible to execute arbitrary commands from the
20713 filename or parameter section via the shell.
20716 \begin_layout Standard
20717 This also implies that you are restricted in what command strings you can
20718 use in the external material templates.
20719 In particular, pipes and redirection are not readily available.
20720 This has to be so if LyX should remain safe.
20721 If you want to use some of the shell features, you should write a safe
20722 script to do this in a controlled manner, and then invoke the script from
20723 the command string.
20727 \begin_layout Standard
20728 It is possible to design a template that interacts directly with the shell,
20729 but since this would allow a malicious user to execute arbitrary commands
20730 by writing clever filenames and/or parameters, we generally recommend that
20731 you only use safe scripts that work with the
20732 \begin_inset Flex Code
20735 \begin_layout Plain Layout
20741 system call in a controlled manner.
20742 Of course, for use in a controlled environment, it can be tempting to just
20743 fall back to use ordinary shell scripts.
20744 If you do so, be aware that you
20748 provide an easily exploitable security hole in your system.
20749 Of course it stands to reason that such unsafe templates will never be
20750 included in the standard LyX distribution, although we do encourage people
20751 to submit new templates in the open source tradition.
20752 But LyX as shipped from the official distribution channels will never have
20756 \begin_layout Standard
20757 Including external material provides a lot of power, and you have to be
20758 careful not to introduce security hazards with this power.
20759 A subtle error in a single line in an innocent looking script can open
20760 the door to huge security problems.
20761 So if you do not fully understand the issues, we recommend that you consult
20762 a knowledgeable security professional or the LyX development team if you
20763 have any questions about whether a given template is safe or not.
20764 And do this before you use it in an uncontrolled environment.