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 CSS styling information.
7825 This will either be output in a
7826 \begin_inset Quotes eld
7830 \begin_inset Flex Code
7833 \begin_layout Plain Layout
7840 \begin_inset Quotes erd
7843 block or, if the user has so chosen, to a separate CSS file.Must end with
7845 \begin_inset Quotes eld
7849 \begin_inset Flex Code
7852 \begin_layout Plain Layout
7859 \begin_inset Quotes erd
7865 \begin_layout Description
7866 \begin_inset Flex Code
7869 \begin_layout Plain Layout
7875 Adds information to the document preamble.
7877 \begin_inset Quotes eld
7881 \begin_inset Flex Code
7884 \begin_layout Plain Layout
7891 \begin_inset Quotes erd
7897 \begin_layout Description
7898 \begin_inset Flex Code
7901 \begin_layout Plain Layout
7907 Defines formats for use in the display of bibliographic information.
7909 \begin_inset CommandInset ref
7911 reference "sub:Citation-format-description"
7917 \begin_inset Quotes eld
7921 \begin_inset Flex Code
7924 \begin_layout Plain Layout
7931 \begin_inset Quotes erd
7937 \begin_layout Description
7938 \begin_inset Flex Code
7941 \begin_layout Plain Layout
7947 Describes various global options supported by the document class.
7949 \begin_inset space ~
7953 \begin_inset CommandInset ref
7955 reference "sub:ClassOptions"
7961 \begin_inset Quotes eld
7965 \begin_inset Flex Code
7968 \begin_layout Plain Layout
7975 \begin_inset Quotes erd
7981 \begin_layout Description
7982 \begin_inset Flex Code
7985 \begin_layout Plain Layout
7992 \begin_inset Flex Code
7995 \begin_layout Plain Layout
8004 \begin_inset Flex Code
8007 \begin_layout Plain Layout
8013 ] Whether the class should
8017 to having one or two columns.
8018 Can be changed in the
8019 \begin_inset Flex MenuItem
8022 \begin_layout Plain Layout
8023 Document\SpecialChar \menuseparator
8032 \begin_layout Description
8033 \begin_inset Flex Code
8036 \begin_layout Plain Layout
8043 \begin_inset Flex Code
8046 \begin_layout Plain Layout
8052 ] This sequence defines the properties for a counter.
8053 If the counter does not yet exist, it is created; if it does exist, it
8056 \begin_inset Quotes eld
8060 \begin_inset Flex Code
8063 \begin_layout Plain Layout
8070 \begin_inset Quotes erd
8074 \begin_inset Newline newline
8078 \begin_inset space ~
8082 \begin_inset CommandInset ref
8084 reference "sub:Counters"
8088 for details on counters.
8091 \begin_layout Description
8092 \begin_inset Flex Code
8095 \begin_layout Plain Layout
8101 Sets the default font used to display the document.
8103 \begin_inset space ~
8107 \begin_inset CommandInset ref
8109 reference "sub:Font-description"
8113 for how to declare fonts.
8115 \begin_inset Quotes eld
8119 \begin_inset Flex Code
8122 \begin_layout Plain Layout
8129 \begin_inset Quotes erd
8135 \begin_layout Description
8136 \begin_inset Flex Code
8139 \begin_layout Plain Layout
8146 \begin_inset Flex Code
8149 \begin_layout Plain Layout
8155 Specifies a module to be included by default with this document class.
8156 The module should be specified by filename without the
8157 \begin_inset Flex Code
8160 \begin_layout Plain Layout
8167 The user can still remove the module, but it will be active at the outset.
8168 (This applies only when new files are created, or when this class is chosen
8169 for an existing document.)
8172 \begin_layout Description
8173 \begin_inset Flex Code
8176 \begin_layout Plain Layout
8183 \begin_inset Flex Code
8186 \begin_layout Plain Layout
8192 ] This is the style that will be assigned to new paragraphs, usually
8193 \begin_inset Flex MenuItem
8196 \begin_layout Plain Layout
8203 This will default to the first defined style if not given, but you are
8204 encouraged to use this directive.
8207 \begin_layout Description
8208 \begin_inset Flex Code
8211 \begin_layout Plain Layout
8218 \begin_inset Flex Code
8221 \begin_layout Plain Layout
8227 ] This tag indicates that the module in question—which should be specified
8228 by filename without the
8229 \begin_inset Flex Code
8232 \begin_layout Plain Layout
8238 extension—cannot be used with this document class.
8239 This might be used in a journal-specific layout file to prevent, say, the
8241 \begin_inset Flex Code
8244 \begin_layout Plain Layout
8250 module that numbers theorems by section.
8255 be used in a module.
8256 Modules have their own way of excluding other modules (see
8257 \begin_inset CommandInset ref
8259 reference "sub:Layout-modules"
8266 \begin_layout Description
8267 \begin_inset Flex Code
8270 \begin_layout Plain Layout
8276 Defines a new float.
8278 \begin_inset space ~
8282 \begin_inset CommandInset ref
8284 reference "sub:Floats"
8290 \begin_inset Quotes eld
8294 \begin_inset Flex Code
8297 \begin_layout Plain Layout
8304 \begin_inset Quotes erd
8310 \begin_layout Description
8311 \begin_inset Flex Code
8314 \begin_layout Plain Layout
8320 Sets the information that will be output in the
8321 \begin_inset Flex Code
8324 \begin_layout Plain Layout
8330 block when this document class is output to XHTML.
8331 Note that this will completely override any prior
8332 \begin_inset Flex Code
8335 \begin_layout Plain Layout
8342 \begin_inset Flex Code
8345 \begin_layout Plain Layout
8353 \begin_inset Flex Code
8356 \begin_layout Plain Layout
8362 if you just want to add material to the preamble.) Must end with
8363 \begin_inset Quotes eld
8367 \begin_inset Flex Code
8370 \begin_layout Plain Layout
8377 \begin_inset Quotes erd
8383 \begin_layout Description
8384 \begin_inset Flex Code
8387 \begin_layout Plain Layout
8393 Sets CSS styling information.
8394 This will either be output in a
8395 \begin_inset Quotes eld
8399 \begin_inset Flex Code
8402 \begin_layout Plain Layout
8409 \begin_inset Quotes erd
8412 block or, if the user has so chosen, to a separate CSS file.
8413 Note that this will completely override any prior
8414 \begin_inset Flex Code
8417 \begin_layout Plain Layout
8424 \begin_inset Flex Code
8427 \begin_layout Plain Layout
8435 \begin_inset Flex Code
8438 \begin_layout Plain Layout
8444 if you just want to add material.) Must end with
8445 \begin_inset Quotes eld
8449 \begin_inset Flex Code
8452 \begin_layout Plain Layout
8459 \begin_inset Quotes erd
8465 \begin_layout Description
8466 \begin_inset Flex Code
8469 \begin_layout Plain Layout
8476 \begin_inset Flex Code
8479 \begin_layout Plain Layout
8485 ] The layout to use for the table of contents, bibliography, and so forth,
8486 when the document is output to HTML.
8487 For articles, this should normally be Section; for books, Chapter.
8488 If it is not given, then LyX will attempt to figure out which layout to
8492 \begin_layout Description
8493 \begin_inset Flex Code
8496 \begin_layout Plain Layout
8503 \begin_inset Flex Code
8506 \begin_layout Plain Layout
8512 ] Modifies the properties of the given counter.
8513 If the counter does not exist, the section is ignored.
8515 \begin_inset Quotes eld
8519 \begin_inset Flex Code
8522 \begin_layout Plain Layout
8529 \begin_inset Quotes erd
8533 \begin_inset Newline newline
8537 \begin_inset space ~
8541 \begin_inset CommandInset ref
8543 reference "sub:Counters"
8547 for details on counters.
8550 \begin_layout Description
8551 \begin_inset Flex Code
8554 \begin_layout Plain Layout
8561 \begin_inset Flex Code
8564 \begin_layout Plain Layout
8570 ] Modifies the properties of the given paragraph style.
8571 If the style does not exist, the section is ignored.
8573 \begin_inset Quotes eld
8577 \begin_inset Flex Code
8580 \begin_layout Plain Layout
8587 \begin_inset Quotes erd
8593 \begin_layout Description
8594 \begin_inset Flex Code
8597 \begin_layout Plain Layout
8603 As its name implies, this command allows you to include another layout
8604 definition file within yours to avoid duplicating commands.
8605 Common examples are the standard layout files, for example,
8606 \begin_inset Flex Code
8609 \begin_layout Plain Layout
8615 , which contains most of the basic layouts.
8618 \begin_layout Description
8619 \begin_inset Flex Code
8622 \begin_layout Plain Layout
8628 This section (re-)defines the layout of an inset.
8629 It can be applied to an existing inset or to a new, user-defined inset,
8630 e.g., a new character style.
8632 \begin_inset Quotes eld
8636 \begin_inset Flex Code
8639 \begin_layout Plain Layout
8646 \begin_inset Quotes erd
8650 \begin_inset Newline newline
8654 \begin_inset space ~
8658 \begin_inset CommandInset ref
8660 reference "sub:Flex-insets-and"
8664 for more information.
8668 \begin_layout Description
8669 \begin_inset Flex Code
8672 \begin_layout Plain Layout
8679 \begin_inset Flex Code
8682 \begin_layout Plain Layout
8688 ] A string that indicates the width of the left margin on the screen, for
8690 \begin_inset Quotes eld
8694 \begin_inset Quotes erd
8698 (Note that this is not a `length', like
8699 \begin_inset Quotes eld
8703 \begin_inset Quotes erd
8709 \begin_layout Description
8710 \begin_inset Flex Code
8713 \begin_layout Plain Layout
8720 \begin_inset Flex Code
8723 \begin_layout Plain Layout
8729 ] This command deletes an existing counter, usually one defined in an included
8733 \begin_layout Description
8734 \begin_inset Flex Code
8737 \begin_layout Plain Layout
8743 This command deletes an existing float.
8744 This is particularly useful when you want to suppress a float that has
8745 been defined in an input file.
8748 \begin_layout Description
8749 \begin_inset Flex Code
8752 \begin_layout Plain Layout
8758 This command deletes an existing style.
8759 This is particularly useful when you want to suppress a style that has
8760 be defined in an input file.
8763 \begin_layout Description
8764 \begin_inset Flex Code
8767 \begin_layout Plain Layout
8773 A string indicating the file format (as defined in the Preferences dialog)
8774 produced by this class.
8775 It is mainly useful when
8776 \begin_inset Flex Code
8779 \begin_layout Plain Layout
8785 is `literate' and one wants to define a new type of literate document.
8786 This string is reset to `docbook', `latex', or `literate' when the correspondin
8788 \begin_inset Flex Code
8791 \begin_layout Plain Layout
8797 parameter is encountered.
8800 \begin_layout Description
8801 \begin_inset Flex Code
8804 \begin_layout Plain Layout
8810 A string indicating what sort of output documents using this class will
8812 At present, the options are: `docbook', `latex', and `literate'.
8815 \begin_layout Description
8816 \begin_inset Flex Code
8819 \begin_layout Plain Layout
8826 \begin_inset Flex Code
8829 \begin_layout Plain Layout
8838 \begin_inset Flex Code
8841 \begin_layout Plain Layout
8848 \begin_inset Flex Code
8851 \begin_layout Plain Layout
8857 ] The default pagestyle.
8858 Can be changed in the
8859 \begin_inset Flex MenuItem
8862 \begin_layout Plain Layout
8863 Document\SpecialChar \menuseparator
8872 \begin_layout Description
8873 \begin_inset Flex Code
8876 \begin_layout Plain Layout
8882 Sets the preamble for the LaTeX document.
8883 Note that this will completely override any prior
8884 \begin_inset Flex Code
8887 \begin_layout Plain Layout
8894 \begin_inset Flex Code
8897 \begin_layout Plain Layout
8905 \begin_inset Flex Code
8908 \begin_layout Plain Layout
8914 if you just want to add material to the preamble.) Must end with
8915 \begin_inset Quotes eld
8919 \begin_inset Flex Code
8922 \begin_layout Plain Layout
8929 \begin_inset Quotes erd
8935 \begin_layout Description
8936 \begin_inset Flex Code
8939 \begin_layout Plain Layout
8946 \begin_inset Flex Code
8949 \begin_layout Plain Layout
8956 \begin_inset Flex Code
8959 \begin_layout Plain Layout
8968 \begin_inset Flex Code
8971 \begin_layout Plain Layout
8977 ] Whether the class already provides the feature
8978 \begin_inset Flex Code
8981 \begin_layout Plain Layout
8988 A feature is in general the name of a package (
8989 \begin_inset Flex Code
8992 \begin_layout Plain Layout
8999 \begin_inset Flex Code
9002 \begin_layout Plain Layout
9008 , \SpecialChar \ldots{}
9010 \begin_inset Flex Code
9013 \begin_layout Plain Layout
9020 \begin_inset Flex Code
9023 \begin_layout Plain Layout
9029 ,\SpecialChar \ldots{}
9030 ); the complete list of supported features is unfortunately not documented
9031 outside the LyX source code—but see
9032 \begin_inset Flex Code
9035 \begin_layout Plain Layout
9041 if you're interested.
9043 \begin_inset Flex MenuItem
9046 \begin_layout Plain Layout
9047 Help\SpecialChar \menuseparator
9053 also gives an overview of the supported packages.
9056 \begin_layout Description
9057 \begin_inset Flex Code
9060 \begin_layout Plain Layout
9067 \begin_inset Flex Code
9070 \begin_layout Plain Layout
9076 ] Indicates that this layout provides the functionality of the module mentioned,
9077 which should be specified by the filename without the
9078 \begin_inset Flex Code
9081 \begin_layout Plain Layout
9088 This will typically be used if the layout includes the module directly,
9089 rather than using the
9090 \begin_inset Flex Code
9093 \begin_layout Plain Layout
9099 tag to indicate that it ought to be used.
9100 It could also be used in a module that provided an alternate implementation
9101 of the same functionality.
9104 \begin_layout Description
9105 \begin_inset Flex Code
9108 \begin_layout Plain Layout
9115 \begin_inset Flex Code
9118 \begin_layout Plain Layout
9124 ] Whether the class requires the feature
9125 \begin_inset Flex Code
9128 \begin_layout Plain Layout
9135 Multiple features must be separated by commas.
9136 Note that you can only request supported features.
9138 \begin_inset Flex Code
9141 \begin_layout Plain Layout
9147 for a list of these.)
9150 \begin_layout Description
9151 \begin_inset Flex Code
9154 \begin_layout Plain Layout
9160 A string that indicates the width of the right margin on the screen, for
9162 \begin_inset Quotes eld
9166 \begin_inset Quotes erd
9172 \begin_layout Description
9173 \begin_inset Flex Code
9176 \begin_layout Plain Layout
9182 Sets which divisions get numbered.
9184 \begin_inset Flex Code
9187 \begin_layout Plain Layout
9196 \begin_layout Description
9197 \begin_inset Flex Code
9200 \begin_layout Plain Layout
9207 \begin_inset Flex Code
9210 \begin_layout Plain Layout
9219 \begin_inset Flex Code
9222 \begin_layout Plain Layout
9228 ] Whether the class-default should be printing on one or both sides of the
9230 Can be changed in the
9231 \begin_inset Flex MenuItem
9234 \begin_layout Plain Layout
9235 Document\SpecialChar \menuseparator
9244 \begin_layout Description
9245 \begin_inset Flex Code
9248 \begin_layout Plain Layout
9254 This sequence defines a paragraph style.
9255 If the style does not yet exist, it is created; if it does exist, its parameter
9258 \begin_inset Quotes eld
9262 \begin_inset Flex Code
9265 \begin_layout Plain Layout
9272 \begin_inset Quotes erd
9276 \begin_inset Newline newline
9280 \begin_inset space ~
9284 \begin_inset CommandInset ref
9286 reference "sub:Paragraph-Styles"
9290 for details on paragraph styles.
9293 \begin_layout Description
9294 \begin_inset Flex Code
9297 \begin_layout Plain Layout
9304 \begin_inset Flex Code
9307 \begin_layout Plain Layout
9313 ] The name of the command or environment to be used with
9314 \begin_inset Flex Code
9317 \begin_layout Plain Layout
9326 \begin_layout Description
9327 \begin_inset Flex Code
9330 \begin_layout Plain Layout
9337 \begin_inset Flex Code
9340 \begin_layout Plain Layout
9349 \begin_inset Flex Code
9352 \begin_layout Plain Layout
9358 ] Indicates what kind of markup is used to define the title of a document.
9360 \begin_inset Flex Code
9363 \begin_layout Plain Layout
9369 means that the macro with name
9370 \begin_inset Flex Code
9373 \begin_layout Plain Layout
9379 will be inserted after the last layout which has
9380 \begin_inset Quotes eld
9384 \begin_inset Flex Code
9387 \begin_layout Plain Layout
9394 \begin_inset Quotes erd
9399 \begin_inset Flex Code
9402 \begin_layout Plain Layout
9408 corresponds to the case where the block of paragraphs which have
9409 \begin_inset Quotes eld
9413 \begin_inset Flex Code
9416 \begin_layout Plain Layout
9423 \begin_inset Quotes erd
9426 should be enclosed into the
9427 \begin_inset Flex Code
9430 \begin_layout Plain Layout
9439 \begin_layout Description
9440 \begin_inset Flex Code
9443 \begin_layout Plain Layout
9449 Sets which divisions are included in the table of contents.
9451 \begin_inset Flex Code
9454 \begin_layout Plain Layout
9463 \begin_layout Subsection
9464 \begin_inset Flex Code
9467 \begin_layout Plain Layout
9474 \begin_inset CommandInset label
9476 name "sub:ClassOptions"
9483 \begin_layout Standard
9485 \begin_inset Flex Code
9488 \begin_layout Plain Layout
9494 section can contain the following entries:
9497 \begin_layout Description
9498 \begin_inset Flex Code
9501 \begin_layout Plain Layout
9508 \begin_inset Flex Code
9511 \begin_layout Plain Layout
9517 ] The list of available font sizes for the document's main font, separated
9519 \begin_inset Quotes eld
9523 \begin_inset Flex Code
9526 \begin_layout Plain Layout
9533 \begin_inset Quotes erd
9539 \begin_layout Description
9540 \begin_inset Flex Code
9543 \begin_layout Plain Layout
9549 Used to set the DTD line with XML-based output classes.
9551 \begin_inset space \thinspace{}
9555 \begin_inset Quotes eld
9558 -//OASIS//DTD DocBook V4.2//EN
9559 \begin_inset Quotes erd
9565 \begin_layout Description
9566 \begin_inset Flex Code
9569 \begin_layout Plain Layout
9576 \begin_inset Flex Code
9579 \begin_layout Plain Layout
9580 string="empty|plain|headings|fancy"
9585 ] The list of available page styles, separated by
9586 \begin_inset Quotes eld
9590 \begin_inset Flex Code
9593 \begin_layout Plain Layout
9600 \begin_inset Quotes erd
9606 \begin_layout Description
9607 \begin_inset Flex Code
9610 \begin_layout Plain Layout
9617 \begin_inset Flex Code
9620 \begin_layout Plain Layout
9626 ] Some document class options, separated by a comma, that will be added
9627 to the optional part of the
9628 \begin_inset Flex Code
9631 \begin_layout Plain Layout
9642 \begin_layout Standard
9644 \begin_inset Flex Code
9647 \begin_layout Plain Layout
9653 section must end with
9654 \begin_inset Quotes eld
9658 \begin_inset Flex Code
9661 \begin_layout Plain Layout
9668 \begin_inset Quotes erd
9674 \begin_layout Subsection
9676 \begin_inset CommandInset label
9678 name "sub:Paragraph-Styles"
9685 \begin_layout Standard
9686 A paragraph style description looks like this:
9690 \begin_layout Plain Layout
9691 Note that this will either define a new style or modify an existing one.
9699 \begin_layout LyX-Code
9706 \begin_layout LyX-Code
9710 \begin_layout LyX-Code
9714 \begin_layout Standard
9715 where the following commands are allowed:
9718 \begin_layout Description
9719 \begin_inset Flex Code
9722 \begin_layout Plain Layout
9729 \begin_inset Flex Code
9732 \begin_layout Plain Layout
9737 , left, right, center
9742 ] Paragraph alignment.
9745 \begin_layout Description
9746 \begin_inset Flex Code
9749 \begin_layout Plain Layout
9756 \begin_inset Flex Code
9759 \begin_layout Plain Layout
9764 , left, right, center
9769 ] A comma separated list of permitted alignments.
9770 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9772 For example a right-aligned or centered enumeration isn't possible.)
9775 \begin_layout Description
9776 \begin_inset Flex Code
9779 \begin_layout Plain Layout
9785 Note that this will completely override any prior
9786 \begin_inset Flex Code
9789 \begin_layout Plain Layout
9795 declaration for this style.
9797 \begin_inset Quotes eld
9801 \begin_inset Flex Code
9804 \begin_layout Plain Layout
9811 \begin_inset Quotes erd
9816 \begin_inset CommandInset ref
9818 reference "sub:I18n"
9822 for details on its use.
9825 \begin_layout Description
9826 \begin_inset Flex Code
9829 \begin_layout Plain Layout
9836 \begin_inset Flex Code
9839 \begin_layout Plain Layout
9849 \begin_layout Plain Layout
9850 Note that a `float' here is a real number, such as: 1.5.
9855 The vertical space with which the last of a chain of paragraphs with this
9856 style is separated from the following paragraph.
9857 If the next paragraph has another style, the separations are not simply
9858 added, but the maximum is taken.
9861 \begin_layout Description
9862 \begin_inset Flex Code
9865 \begin_layout Plain Layout
9872 \begin_inset Flex Code
9875 \begin_layout Plain Layout
9881 The category for this style.
9882 This is used to group related styles in the style combobox on the toolbar.
9883 Any string can be used, but you may want to use existing categories with
9888 \begin_layout Description
9889 \begin_inset Flex Code
9892 \begin_layout Plain Layout
9898 Depth of XML command.
9899 Used only with XML-type formats.
9902 \begin_layout Description
9903 \begin_inset Flex Code
9906 \begin_layout Plain Layout
9913 \begin_inset Flex Code
9916 \begin_layout Plain Layout
9922 Copies all the features of an existing style into the current one.
9926 \begin_layout Description
9927 \begin_inset Flex Code
9930 \begin_layout Plain Layout
9936 The name of a style whose preamble should be output
9941 This allows to ensure some ordering of the preamble snippets when macros
9942 definitions depend on one another.
9946 \begin_layout Plain Layout
9947 Note that, besides that functionality, there is no way to ensure any ordering
9949 The ordering that you see in a given version of LyX may change without
9950 warning in later versions.
9958 \begin_layout Description
9959 \begin_inset Flex Code
9962 \begin_layout Plain Layout
9969 \begin_inset Flex Code
9972 \begin_layout Plain Layout
9977 , Box, Filled_Box, Static
9982 ] The type of label that stands at the end of the paragraph (or sequence
9984 \begin_inset Flex Code
9987 \begin_layout Plain Layout
9994 \begin_inset Flex Code
9997 \begin_layout Plain Layout
10004 \begin_inset Flex Code
10007 \begin_layout Plain Layout
10014 \begin_inset Flex Code
10017 \begin_layout Plain Layout
10025 \begin_inset Flex Code
10028 \begin_layout Plain Layout
10035 \begin_inset Quotes eld
10039 \begin_inset Quotes erd
10043 \begin_inset Flex Code
10046 \begin_layout Plain Layout
10053 \begin_inset Flex Code
10056 \begin_layout Plain Layout
10057 \begin_inset space ~
10065 ) is a white (resp.
10066 \begin_inset space ~
10069 black) square suitable for end of proof markers,
10070 \begin_inset Flex Code
10073 \begin_layout Plain Layout
10079 is an explicit text string.
10082 \begin_layout Description
10083 \begin_inset Flex Code
10086 \begin_layout Plain Layout
10093 \begin_inset Flex Code
10096 \begin_layout Plain Layout
10102 ] The string used for a label with a
10103 \begin_inset Flex Code
10106 \begin_layout Plain Layout
10113 \begin_inset Flex Code
10116 \begin_layout Plain Layout
10126 \begin_layout Description
10127 \begin_inset Flex Code
10130 \begin_layout Plain Layout
10136 The font used for both the text body
10142 \begin_inset space ~
10146 \begin_inset CommandInset ref
10148 reference "sub:Font-description"
10153 Note that defining this font automatically defines the
10154 \begin_inset Flex Code
10157 \begin_layout Plain Layout
10164 So you should define this one first if you also want to define
10165 \begin_inset Flex Code
10168 \begin_layout Plain Layout
10177 \begin_layout Description
10178 \begin_inset Flex Code
10181 \begin_layout Plain Layout
10188 \begin_inset CommandInset label
10190 name "des:FreeSpacing"
10195 \begin_inset Flex Code
10198 \begin_layout Plain Layout
10207 \begin_inset Flex Code
10210 \begin_layout Plain Layout
10216 ] Usually LyX doesn't allow you to insert more than one space between words,
10217 since a space is considered as the separation between two words, not a
10218 character or symbol of its own.
10219 This is a very fine thing but sometimes annoying, for example, when typing
10220 program code or plain LaTeX code.
10222 \begin_inset Flex Code
10225 \begin_layout Plain Layout
10232 Note that LyX will create protected blanks for the additional blanks when
10233 in another mode than LaTeX-mode.
10236 \begin_layout Description
10237 \begin_inset Flex Code
10240 \begin_layout Plain Layout
10246 These tags are used with XHTML output.
10248 \begin_inset CommandInset ref
10250 reference "sub:Paragraph-Style-XHTML"
10257 \begin_layout Description
10258 \begin_inset Flex Code
10261 \begin_layout Plain Layout
10267 [[FIXME]] (Used only with XML-type formats.)
10270 \begin_layout Description
10271 \begin_inset Flex Code
10274 \begin_layout Plain Layout
10281 \begin_inset Flex Code
10284 \begin_layout Plain Layout
10290 If 1, marks the style as to be included in the document preamble rather
10291 than in the document body.
10292 This is useful for document classes that want such information as the title
10293 and author to appear in the preamble.
10294 Note that this works only for styles for which the
10295 \begin_inset Flex Code
10298 \begin_layout Plain Layout
10305 \begin_inset Flex Code
10308 \begin_layout Plain Layout
10315 \begin_inset Flex Code
10318 \begin_layout Plain Layout
10327 \begin_layout Description
10328 \begin_inset Flex Code
10331 \begin_layout Plain Layout
10338 \begin_inset Flex Code
10341 \begin_layout Plain Layout
10347 If 1, marks the style as being part of a title block (see also the
10348 \begin_inset Flex Code
10351 \begin_layout Plain Layout
10358 \begin_inset Flex Code
10361 \begin_layout Plain Layout
10370 \begin_layout Description
10371 \begin_inset Flex Code
10374 \begin_layout Plain Layout
10381 \begin_inset Flex Code
10384 \begin_layout Plain Layout
10390 ] This provides extra space between paragraphs that have the same style.
10391 If you put other styles into an environment, each is separated with the
10393 \begin_inset Flex Code
10396 \begin_layout Plain Layout
10403 But the whole items of the environment are additionally separated with
10405 \begin_inset Flex Code
10408 \begin_layout Plain Layout
10415 Note that this is a
10420 \begin_layout Description
10421 \begin_inset Flex Code
10424 \begin_layout Plain Layout
10430 [[FIXME]] (Used only with XML-type formats.)
10433 \begin_layout Description
10434 \begin_inset Flex Code
10437 \begin_layout Plain Layout
10444 \begin_inset Flex Code
10447 \begin_layout Plain Layout
10456 \begin_inset Flex Code
10459 \begin_layout Plain Layout
10465 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10466 lead to empty LaTeX output.
10467 There are some cases where this could be desirable however: in a letter
10468 template, the required fields can be provided as empty fields, so that
10469 people do not forget them; in some special classes, a style can be used
10470 as some kind of break, which does not contain actual text.
10473 \begin_layout Description
10474 \begin_inset Flex Code
10477 \begin_layout Plain Layout
10483 [float=0] The vertical space between the label and the text body.
10484 Only used for labels that are above the text body (
10485 \begin_inset Flex Code
10488 \begin_layout Plain Layout
10495 \begin_inset Flex Code
10498 \begin_layout Plain Layout
10499 Centered_Top_Environment
10507 \begin_layout Description
10508 \begin_inset Flex Code
10511 \begin_layout Plain Layout
10518 \begin_inset Flex Code
10521 \begin_layout Plain Layout
10528 \begin_inset Newline newline
10531 The name of the counter for automatic numbering.
10533 \begin_inset Newline newline
10541 \begin_inset Flex Code
10544 \begin_layout Plain Layout
10551 \begin_inset Flex Code
10554 \begin_layout Plain Layout
10561 In that case, the counter will be stepped each time the style appears.
10563 \begin_inset Newline newline
10571 \begin_inset Flex Code
10574 \begin_layout Plain Layout
10581 \begin_inset Flex Code
10584 \begin_layout Plain Layout
10590 , though this case is a bit complicated.
10591 Suppose you declare
10592 \begin_inset Quotes eld
10596 \begin_inset Flex Code
10599 \begin_layout Plain Layout
10600 LabelCounter myenum
10606 \begin_inset Quotes erd
10610 Then the actual counters used are
10611 \begin_inset Flex Code
10614 \begin_layout Plain Layout
10621 \begin_inset Flex Code
10624 \begin_layout Plain Layout
10631 \begin_inset Flex Code
10634 \begin_layout Plain Layout
10641 \begin_inset Flex Code
10644 \begin_layout Plain Layout
10650 , much as in LaTeX.
10651 These counters must all be declared separately.
10652 \begin_inset Newline newline
10656 \begin_inset CommandInset ref
10658 reference "sub:Counters"
10662 for details on counters.
10665 \begin_layout Description
10666 \begin_inset Flex Code
10669 \begin_layout Plain Layout
10675 The font used for the label.
10677 \begin_inset space ~
10681 \begin_inset CommandInset ref
10683 reference "sub:Font-description"
10690 \begin_layout Description
10691 \begin_inset Flex Code
10694 \begin_layout Plain Layout
10700 Text that indicates how far a label should be indented.
10703 \begin_layout Description
10704 \begin_inset Flex Code
10707 \begin_layout Plain Layout
10714 \begin_inset Flex Code
10717 \begin_layout Plain Layout
10723 ] The horizontal space between the label and the text body.
10724 Only used for labels that are not above the text body.
10727 \begin_layout Description
10728 \begin_inset Flex Code
10731 \begin_layout Plain Layout
10738 \begin_inset Flex Code
10741 \begin_layout Plain Layout
10747 ] The string used for a label with a
10748 \begin_inset Flex Code
10751 \begin_layout Plain Layout
10759 \begin_inset Flex Code
10762 \begin_layout Plain Layout
10768 is set, this string can be contain the special formatting commands described
10770 \begin_inset CommandInset ref
10772 reference "sub:Counters"
10780 \begin_layout Plain Layout
10781 For the sake of backwards compatibility, the string
10782 \begin_inset Flex Code
10785 \begin_layout Plain Layout
10795 will be replaced by the expanded
10796 \begin_inset Flex Code
10799 \begin_layout Plain Layout
10806 \begin_inset Flex Code
10809 \begin_layout Plain Layout
10818 This feature is now obsolete and should be replaced by the mechanisms of
10820 \begin_inset CommandInset ref
10822 reference "sub:Counters"
10834 \begin_layout Description
10835 \begin_inset Flex Code
10838 \begin_layout Plain Layout
10839 LabelStringAppendix
10845 \begin_inset Flex Code
10848 \begin_layout Plain Layout
10854 ] This is used inside the appendix instead of
10855 \begin_inset Flex Code
10858 \begin_layout Plain Layout
10866 \begin_inset Flex Code
10869 \begin_layout Plain Layout
10876 \begin_inset Flex Code
10879 \begin_layout Plain Layout
10880 LabelStringAppendix
10888 \begin_layout Description
10889 \begin_inset Flex Code
10892 \begin_layout Plain Layout
10898 [FIXME] (Used only with XML-type formats.)
10901 \begin_layout Description
10902 \begin_inset Flex Code
10905 \begin_layout Plain Layout
10912 \begin_inset Flex Code
10915 \begin_layout Plain Layout
10920 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10921 Enumerate, Itemize, Bibliography
10930 \begin_layout Itemize
10931 \begin_inset Flex Code
10934 \begin_layout Plain Layout
10940 means the label is the very first word (up to the first real blank).
10941 Use protected spaces (like
10942 \begin_inset space ~
10945 that one) if you want more than one word as the label.
10949 \begin_layout Itemize
10950 \begin_inset Flex Code
10953 \begin_layout Plain Layout
10959 means the label is simply whatever
10960 \begin_inset Flex Code
10963 \begin_layout Plain Layout
10970 Note that this really is `static'.
10973 \begin_layout Itemize
10974 \begin_inset Flex Code
10977 \begin_layout Plain Layout
10984 \begin_inset Flex Code
10987 \begin_layout Plain Layout
10988 Centered_Top_Environment
10993 are special cases of
10994 \begin_inset Flex Code
10997 \begin_layout Plain Layout
11004 The label will be printed above the paragraph, but only at the top of an
11005 environment or the top of a chain of paragraphs with this style.
11006 This might be used with the
11007 \begin_inset Flex MenuItem
11010 \begin_layout Plain Layout
11016 style, for example.
11019 \begin_layout Itemize
11020 \begin_inset Flex Code
11023 \begin_layout Plain Layout
11029 is a special case for the caption-labels
11030 \begin_inset Quotes eld
11034 \begin_inset Quotes erd
11038 \begin_inset Quotes eld
11042 \begin_inset Quotes erd
11047 \begin_inset Flex Code
11050 \begin_layout Plain Layout
11056 means the (hardcoded) label string depends on the kind of float: It is
11057 hardcoded to be `FloatType N', where N is the value of the counter associated
11061 \begin_layout Itemize
11063 \begin_inset Flex Code
11066 \begin_layout Plain Layout
11072 label type defines automatically numbered labels.
11074 \begin_inset Flex Code
11077 \begin_layout Plain Layout
11083 will be expanded to resolve any counter references it contains: For example,
11085 \begin_inset Quotes eld
11089 \begin_inset Flex Code
11092 \begin_layout Plain Layout
11103 \begin_inset Quotes erd
11108 \begin_inset CommandInset ref
11110 reference "sub:Counters"
11114 for more information on counters.
11117 \begin_layout Itemize
11118 \begin_inset Flex Code
11121 \begin_layout Plain Layout
11127 produces the usual sort of enumeration labels.
11128 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11129 small Roman numerals, and uppercase letters for the four possible depths.
11132 \begin_layout Itemize
11133 \begin_inset Flex Code
11136 \begin_layout Plain Layout
11142 produces various bullets at the different levels.
11143 It is also hardcoded.
11146 \begin_layout Itemize
11147 \begin_inset Flex Code
11150 \begin_layout Plain Layout
11156 is used internally by LyX and should be used only with
11157 \begin_inset Flex Code
11160 \begin_layout Plain Layout
11161 LatexType BibEnvironment
11170 \begin_layout Description
11171 \begin_inset Flex Code
11174 \begin_layout Plain Layout
11180 Note that this will completely override any prior
11181 \begin_inset Flex Code
11184 \begin_layout Plain Layout
11190 declaration for this style.
11192 \begin_inset Quotes eld
11196 \begin_inset Flex Code
11199 \begin_layout Plain Layout
11206 \begin_inset Quotes erd
11211 \begin_inset CommandInset ref
11213 reference "sub:I18n"
11217 for details on its use.
11220 \begin_layout Description
11221 \begin_inset Flex Code
11224 \begin_layout Plain Layout
11230 The name of the corresponding LaTeX stuff.
11231 Either the environment or command name.
11234 \begin_layout Description
11235 \begin_inset Flex Code
11238 \begin_layout Plain Layout
11244 An optional parameter for the corresponding
11245 \begin_inset Flex Code
11248 \begin_layout Plain Layout
11255 This parameter cannot be changed from within LyX.
11258 \begin_layout Description
11259 \begin_inset Flex Code
11262 \begin_layout Plain Layout
11269 \begin_inset Flex Code
11272 \begin_layout Plain Layout
11277 , Command, Environment, Item_Environment,
11283 \begin_inset Flex Code
11286 \begin_layout Plain Layout
11287 List_Environment, Bib_Environment
11292 ] How the style should be translated into LaTeX.
11296 \begin_layout Plain Layout
11297 \begin_inset Flex Code
11300 \begin_layout Plain Layout
11306 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11307 Visit the SGML class files for specific examples.
11316 \begin_layout Itemize
11317 \begin_inset Flex Code
11320 \begin_layout Plain Layout
11326 means nothing special.
11330 \begin_layout Itemize
11331 \begin_inset Flex Code
11334 \begin_layout Plain Layout
11341 \begin_inset Flex Code
11344 \begin_layout Plain Layout
11351 {\SpecialChar \ldots{}
11360 \begin_layout Itemize
11361 \begin_inset Flex Code
11364 \begin_layout Plain Layout
11371 \begin_inset Flex Code
11374 \begin_layout Plain Layout
11381 }\SpecialChar \ldots{}
11397 \begin_layout Itemize
11398 \begin_inset Flex Code
11401 \begin_layout Plain Layout
11408 \begin_inset Flex Code
11411 \begin_layout Plain Layout
11418 \begin_inset Flex Code
11421 \begin_layout Plain Layout
11429 is generated for each paragraph of this environment.
11433 \begin_layout Itemize
11434 \begin_inset Flex Code
11437 \begin_layout Plain Layout
11444 \begin_inset Flex Code
11447 \begin_layout Plain Layout
11454 \begin_inset Flex Code
11457 \begin_layout Plain Layout
11463 is passed as an argument to the environment.
11465 \begin_inset Flex Code
11468 \begin_layout Plain Layout
11474 can be defined in the
11475 \begin_inset Flex MenuItem
11478 \begin_layout Plain Layout
11479 Edit\SpecialChar \menuseparator
11481 \begin_inset space ~
11493 \begin_layout Standard
11494 Putting the last few things together, the LaTeX output will be either:
11497 \begin_layout LyX-Code
11500 latexname[latexparam]{\SpecialChar \ldots{}
11504 \begin_layout Standard
11508 \begin_layout LyX-Code
11511 begin{latexname}[latexparam] \SpecialChar \ldots{}
11517 \begin_layout Standard
11518 depending upon the LaTeX type.
11522 \begin_layout Description
11523 \begin_inset Flex Code
11526 \begin_layout Plain Layout
11533 \begin_inset Flex Code
11536 \begin_layout Plain Layout
11542 ] If you put styles into environments, the leftmargins are not simply added,
11543 but added with a factor
11544 \begin_inset Formula $\frac{4}{depth+4}$
11548 Note that this parameter is also used when the margin is defined as
11549 \begin_inset Flex Code
11552 \begin_layout Plain Layout
11559 \begin_inset Flex Code
11562 \begin_layout Plain Layout
11569 Then it is added to the manual or dynamic margin.
11571 \begin_inset Newline newline
11574 The argument is passed as a string.
11576 \begin_inset Quotes eld
11580 \begin_inset Flex Code
11583 \begin_layout Plain Layout
11590 \begin_inset Quotes erd
11593 means that the paragraph is indented with the width of
11594 \begin_inset Quotes eld
11598 \begin_inset Flex Code
11601 \begin_layout Plain Layout
11608 \begin_inset Quotes erd
11611 in the normal font.
11612 You can get a negative width by prefixing the string with
11613 \begin_inset Quotes eld
11617 \begin_inset Flex Code
11620 \begin_layout Plain Layout
11627 \begin_inset Quotes erd
11631 This way was chosen so that the look is the same with each used screen
11636 \begin_layout Description
11637 \begin_inset Flex Code
11640 \begin_layout Plain Layout
11647 \begin_inset Flex Code
11650 \begin_layout Plain Layout
11655 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11661 \begin_inset Newline newline
11664 The kind of margin that the style has on the left side.
11666 \begin_inset Flex Code
11669 \begin_layout Plain Layout
11675 just means a fixed margin.
11677 \begin_inset Flex Code
11680 \begin_layout Plain Layout
11686 means that the left margin depends on the string entered in the
11687 \begin_inset Flex MenuItem
11690 \begin_layout Plain Layout
11691 Edit\SpecialChar \menuseparator
11693 \begin_inset space ~
11702 This is used to typeset nice lists without tabulators.
11704 \begin_inset Flex Code
11707 \begin_layout Plain Layout
11713 means that the margin depends on the size of the label.
11714 This is used for automatic enumerated headlines.
11715 It is obvious that the headline
11716 \begin_inset Quotes eld
11719 5.4.3.2.1 Very long headline
11720 \begin_inset Quotes erd
11723 must have a wider left margin (as wide as
11724 \begin_inset Quotes eld
11728 \begin_inset Quotes erd
11731 plus the space) than
11732 \begin_inset Quotes eld
11735 3.2 Very long headline
11736 \begin_inset Quotes erd
11740 \begin_inset Quotes eld
11744 \begin_inset Quotes erd
11747 are not able to do this.
11749 \begin_inset Flex Code
11752 \begin_layout Plain Layout
11758 is similar, but only the very first row of the paragraph is dynamic, while
11759 the others are static; this is used, for example, for descriptions.
11761 \begin_inset Flex Code
11764 \begin_layout Plain Layout
11770 means the margin is chosen in a way that the longest row of this paragraph
11771 fits to the right margin.
11772 This is used to typeset an address on the right edge of the page.
11775 \begin_layout Description
11776 \begin_inset Flex Code
11779 \begin_layout Plain Layout
11786 \begin_inset Flex Code
11789 \begin_layout Plain Layout
11798 \begin_inset Flex Code
11801 \begin_layout Plain Layout
11807 ] Whether fragile commands in this style should be
11808 \begin_inset Flex Code
11811 \begin_layout Plain Layout
11824 whether this command should itself be protected.)
11827 \begin_layout Description
11828 \begin_inset Flex Code
11831 \begin_layout Plain Layout
11838 \begin_inset Flex Code
11841 \begin_layout Plain Layout
11848 \begin_inset Flex Code
11851 \begin_layout Plain Layout
11859 ] Whether newlines are translated into LaTeX newlines (
11860 \begin_inset Flex Code
11863 \begin_layout Plain Layout
11874 The translation can be switched off to allow more comfortable LaTeX editing
11878 \begin_layout Description
11879 \begin_inset Flex Code
11882 \begin_layout Plain Layout
11889 \begin_inset Flex Code
11892 \begin_layout Plain Layout
11899 \begin_inset Flex Code
11902 \begin_layout Plain Layout
11910 ] If set to true, and if
11911 \begin_inset Flex Code
11914 \begin_layout Plain Layout
11921 \begin_inset Flex Code
11924 \begin_layout Plain Layout
11930 ) paragraphs are being indented, then the indentation of such a paragraph
11931 following one of this type will be suppressed.
11932 (So this will not affect the display of non-default paragraphs.)
11935 \begin_layout Description
11936 \begin_inset Flex Code
11939 \begin_layout Plain Layout
11945 Name of a style that has replaced this style.
11946 This is used to rename a style, while keeping backward compatibility.
11949 \begin_layout Description
11950 \begin_inset Flex Code
11953 \begin_layout Plain Layout
11960 \begin_inset Flex Code
11963 \begin_layout Plain Layout
11969 ] The number of optional arguments that can be used with this style.
11970 This is useful for things like section headings, and only makes sense with
11972 Note that, on output, the optional arguments will all precede any required
11973 arguments (see below).
11974 So one can have constructs like:
11978 \begin_layout LyX-Code
11981 mycmd[opt1]{req1}{contents of paragraph}
11984 \begin_layout Standard
11985 but one cannot have things like:
11988 \begin_layout LyX-Code
11991 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11994 \begin_layout Standard
11995 at least, not without ERT (with which you can have anything).
12000 \begin_layout Description
12001 \begin_inset Flex Code
12004 \begin_layout Plain Layout
12011 \begin_inset Flex Code
12014 \begin_layout Plain Layout
12023 \begin_inset Flex Code
12026 \begin_layout Plain Layout
12032 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12033 output, but only by a line break; together with
12034 \begin_inset Flex Code
12037 \begin_layout Plain Layout
12043 , this allows to emulate a plain text editor (like the ERT inset).
12046 \begin_layout Description
12047 \begin_inset Flex Code
12050 \begin_layout Plain Layout
12057 \begin_inset Flex Code
12060 \begin_layout Plain Layout
12066 ] The indent of the very first line of a paragraph.
12068 \begin_inset Flex Code
12071 \begin_layout Plain Layout
12077 will be fixed for a certain style.
12078 The exception is the default style, since the indentation for these paragraphs
12079 can be prohibited with
12080 \begin_inset Flex Code
12083 \begin_layout Plain Layout
12091 \begin_inset Flex Code
12094 \begin_layout Plain Layout
12100 style paragraphs inside environments use the
12101 \begin_inset Flex Code
12104 \begin_layout Plain Layout
12110 of the environment, not their native one.
12112 \begin_inset Flex Code
12115 \begin_layout Plain Layout
12121 paragraphs inside an enumeration are not indented.
12124 \begin_layout Description
12125 \begin_inset Flex Code
12128 \begin_layout Plain Layout
12135 \begin_inset Flex Code
12138 \begin_layout Plain Layout
12144 ] The vertical space between two paragraphs of this style.
12147 \begin_layout Description
12148 \begin_inset Flex Code
12151 \begin_layout Plain Layout
12158 \begin_inset Flex Code
12161 \begin_layout Plain Layout
12167 ] LyX allows the user to choose either
12168 \begin_inset Quotes eld
12172 \begin_inset Quotes erd
12176 \begin_inset Quotes eld
12180 \begin_inset Quotes erd
12183 to typeset a document.
12185 \begin_inset Quotes eld
12189 \begin_inset Quotes erd
12192 is chosen, this value is completely ignored.
12194 \begin_inset Quotes eld
12198 \begin_inset Quotes erd
12201 is chosen, the parindent of a LaTeXtype
12202 \begin_inset Quotes eld
12206 \begin_inset Quotes erd
12209 style is ignored and all paragraphs are separated by this parskip argument.
12210 The vertical space is calculated with
12211 \begin_inset Flex Code
12214 \begin_layout Plain Layout
12216 \begin_inset space ~
12225 \begin_inset Flex Code
12228 \begin_layout Plain Layout
12234 is the height of a row with the normal font.
12235 This way, the look stays the same with different screen fonts.
12238 \begin_layout Description
12239 \begin_inset Flex Code
12242 \begin_layout Plain Layout
12249 \begin_inset Flex Code
12252 \begin_layout Plain Layout
12261 \begin_inset Flex Code
12264 \begin_layout Plain Layout
12270 ] Whether the contents of this paragraph should be output in raw form, meaning
12271 without special translations that LaTeX would require.
12274 \begin_layout Description
12275 \begin_inset Flex Code
12278 \begin_layout Plain Layout
12284 Information to be included in the LaTeX preamble when this style is used.
12285 Used to define macros, load packages, etc., required by this particular
12288 \begin_inset Quotes eld
12292 \begin_inset Flex Code
12295 \begin_layout Plain Layout
12302 \begin_inset Quotes erd
12308 \begin_layout Description
12309 \begin_inset Flex Code
12312 \begin_layout Plain Layout
12319 \begin_inset Flex Code
12322 \begin_layout Plain Layout
12328 ] The prefix to use when creating labels referring to paragraphs of this
12330 This allows the use of formatted references.
12333 \begin_layout Description
12334 \begin_inset Flex Code
12337 \begin_layout Plain Layout
12344 \begin_inset Flex Code
12347 \begin_layout Plain Layout
12353 ] The number of required arguments that the LaTeX command or environment
12354 corresponding to this style expects.
12355 In the case of a command, these are required arguments
12359 that associated with the content of the paragraph itself.
12360 These do not actually have to be provided: LyX will output empty arguments
12362 Note that optional arguments will be output before required arguments.
12363 See the discussion of the
12364 \begin_inset Flex Code
12367 \begin_layout Plain Layout
12373 tag above for more information.
12376 \begin_layout Description
12377 \begin_inset Flex Code
12380 \begin_layout Plain Layout
12387 \begin_inset Flex Code
12390 \begin_layout Plain Layout
12396 ] Whether the style requires the feature
12397 \begin_inset Flex Code
12400 \begin_layout Plain Layout
12407 See the description of
12408 \begin_inset Flex Code
12411 \begin_layout Plain Layout
12418 \begin_inset CommandInset ref
12419 LatexCommand pageref
12420 reference "des:FreeSpacing"
12424 ) for information on `features'.
12428 \begin_layout Description
12429 \begin_inset Flex Code
12432 \begin_layout Plain Layout
12439 \begin_inset Flex Code
12442 \begin_layout Plain Layout
12449 \begin_inset Flex Code
12452 \begin_layout Plain Layout
12461 \begin_layout Description
12462 \begin_inset Flex Code
12465 \begin_layout Plain Layout
12472 \begin_inset Flex Code
12475 \begin_layout Plain Layout
12480 , onehalf, double, other
12489 ] This defines what the default spacing should be in the style.
12491 \begin_inset Flex Code
12494 \begin_layout Plain Layout
12501 \begin_inset Flex Code
12504 \begin_layout Plain Layout
12511 \begin_inset Flex Code
12514 \begin_layout Plain Layout
12520 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12521 If you specify the argument
12522 \begin_inset Flex Code
12525 \begin_layout Plain Layout
12531 , then you should also provide a numerical argument which will be the actual
12533 Note that, contrary to other parameters,
12534 \begin_inset Flex Code
12537 \begin_layout Plain Layout
12543 implies the generation of specific LaTeX code, using the package
12546 \begin_inset Flex Code
12549 \begin_layout Plain Layout
12558 \begin_layout Description
12559 \begin_inset Flex Code
12562 \begin_layout Plain Layout
12569 \begin_inset Flex Code
12572 \begin_layout Plain Layout
12579 \begin_inset Flex Code
12582 \begin_layout Plain Layout
12590 ] Spellcheck paragraphs of this style.
12594 \begin_layout Description
12595 \begin_inset Flex Code
12598 \begin_layout Plain Layout
12604 The font used for the text body .
12606 \begin_inset CommandInset ref
12608 reference "sub:Font-description"
12615 \begin_layout Description
12616 \begin_inset Flex Code
12619 \begin_layout Plain Layout
12628 \begin_inset Flex Code
12631 \begin_layout Plain Layout
12641 The level of the style in the table of contents.
12642 This is used for automatic numbering of section headings.
12645 \begin_layout Description
12646 \begin_inset Flex Code
12649 \begin_layout Plain Layout
12656 \begin_inset Flex Code
12659 \begin_layout Plain Layout
12665 ] The vertical space with which the very first of a chain of paragraphs
12666 with this style is separated from the previous paragraph.
12667 If the previous paragraph has another style, the separations are not simply
12668 added, but the maximum is taken.
12671 \begin_layout Subsection
12672 \begin_inset CommandInset label
12678 Internationalization of Paragraph Styles
12681 \begin_layout Standard
12682 LyX has long supported internationalization of layout information, but,
12683 until version 2.0, this applied only to the user interface and not to, say,
12685 Thus, French authors were forced to resort to ugly hacks if they wanted
12690 1' instead of `Theorem 1'.
12691 Thanks to Georg Baum, that is no longer the case.
12694 \begin_layout Standard
12696 \begin_inset Flex Code
12699 \begin_layout Plain Layout
12705 defines text that is to appear in the typeset document, it may use
12706 \begin_inset Flex Code
12709 \begin_layout Plain Layout
12716 \begin_inset Flex Code
12719 \begin_layout Plain Layout
12725 to support non-English and even multi-language documents correctly.
12726 The following excerpt (from the
12727 \begin_inset Flex Code
12730 \begin_layout Plain Layout
12736 file) shows how this works:
12739 \begin_layout LyX-Code
12744 \begin_layout LyX-Code
12747 theoremstyle{remark}
12750 \begin_layout LyX-Code
12753 newtheorem{claim}[thm]{
12760 \begin_layout LyX-Code
12764 \begin_layout LyX-Code
12768 \begin_layout LyX-Code
12773 claimname}{_(Claim)}
12776 \begin_layout LyX-Code
12780 \begin_layout LyX-Code
12784 \begin_layout LyX-Code
12793 claimname}{_(Claim)}}
12796 \begin_layout LyX-Code
12801 \begin_layout Standard
12802 In principle, any legal LaTeX may appear in the
12803 \begin_inset Flex Code
12806 \begin_layout Plain Layout
12813 \begin_inset Flex Code
12816 \begin_layout Plain Layout
12822 tags, but in practice they will typically look as they do here.
12823 The key to correct translation of the typeset text is the definition of
12825 \begin_inset Flex Code
12828 \begin_layout Plain Layout
12837 \begin_inset Flex Code
12840 \begin_layout Plain Layout
12852 \begin_layout Standard
12854 \begin_inset Flex Code
12857 \begin_layout Plain Layout
12863 tag provides for internationalization based upon the overall language of
12865 The contents of the tag will be included in the preamble, just as with
12867 \begin_inset Flex Code
12870 \begin_layout Plain Layout
12877 What makes it special is the use of the
12878 \begin_inset Quotes eld
12882 \begin_inset Quotes erd
12886 \begin_inset Flex Code
12889 \begin_layout Plain Layout
12895 , which will be replaced, when LyX produces LaTeX output, with the translation
12896 of its argument into the document language.
12899 \begin_layout Standard
12901 \begin_inset Flex Code
12904 \begin_layout Plain Layout
12910 tag is more complex, since it is meant to provide support for multi-language
12911 documents and so offers an interface to the
12912 \begin_inset Flex Code
12915 \begin_layout Plain Layout
12922 Its contents will be added to the preamble once for each language that
12923 appears in the document.
12924 In this case, the argument to
12925 \begin_inset Flex Code
12928 \begin_layout Plain Layout
12934 will be replaced with its translation into the language in question; the
12936 \begin_inset Flex Code
12939 \begin_layout Plain Layout
12945 is replaced by the language name (as used by the babel package).
12948 \begin_layout Standard
12949 A German document that also included a French section would thus have the
12950 following in the preamble:
12953 \begin_layout LyX-Code
12962 claimname}{Affirmation}}
12970 claimname}{Behauptung}}
12974 claimname}{Behauptung}
12977 \begin_layout Standard
12979 \begin_inset Flex Code
12982 \begin_layout Plain Layout
12988 will then conspire to produce the correct text in the output.
12991 \begin_layout Standard
12992 One important point to note here is that the translations are provided by
12993 LyX itself, through the same mechanism it uses for internationalization
12994 of the user interface.
12995 This means, in effect, that
12996 \begin_inset Flex Code
12999 \begin_layout Plain Layout
13006 \begin_inset Flex Code
13009 \begin_layout Plain Layout
13015 are really only of use in layout files that are provided with LyX, since
13016 text entered in user-created layout files will not be seen by LyX's internation
13017 alization routines.
13018 That said, however, any layout created with the intention that it will
13019 be included with LyX should use these tags where appropriate.
13022 \begin_layout Subsection
13024 \begin_inset CommandInset label
13033 \begin_layout Standard
13034 Since version 1.3.0 of LyX, it is has been both possible and necessary to
13035 define the floats (
13036 \begin_inset Flex MenuItem
13039 \begin_layout Plain Layout
13046 \begin_inset Flex MenuItem
13049 \begin_layout Plain Layout
13055 , \SpecialChar \ldots{}
13056 ) in the text class itself.
13057 Standard floats are included in the file
13058 \begin_inset Flex Code
13061 \begin_layout Plain Layout
13067 , so you may have to do no more than add
13070 \begin_layout LyX-Code
13071 Input stdfloats.inc
13074 \begin_layout Standard
13075 to your layout file.
13076 If you want to implement a text class that proposes some other float types
13077 (like the AGU class bundled with LyX), the information below will hopefully
13081 \begin_layout Description
13082 \begin_inset Flex Code
13085 \begin_layout Plain Layout
13092 \begin_inset Flex Code
13095 \begin_layout Plain Layout
13102 \begin_inset Quotes erd
13106 \begin_inset Quotes erd
13109 ] The file name extension of an auxiliary file for the list of figures (or
13111 LaTeX writes the captions to this file.
13114 \begin_layout Description
13115 \begin_inset Flex Code
13118 \begin_layout Plain Layout
13125 \begin_inset Flex Code
13128 \begin_layout Plain Layout
13135 \begin_inset Quotes erd
13139 \begin_inset Quotes erd
13142 ] The string that will be used in the menus and also for the caption.
13143 This is translated to the current language if babel is used.
13146 \begin_layout Description
13147 \begin_inset Flex Code
13150 \begin_layout Plain Layout
13156 These are used for XHTML output.
13158 \begin_inset CommandInset ref
13160 reference "sec:Tags-for-XHTML"
13167 \begin_layout Description
13168 \begin_inset Flex Code
13171 \begin_layout Plain Layout
13180 \begin_inset Flex Code
13183 \begin_layout Plain Layout
13192 \begin_inset Flex Code
13195 \begin_layout Plain Layout
13201 ] Indicates whether the float is already defined in the document class or
13202 if we instead need to load
13203 \begin_inset Flex Code
13206 \begin_layout Plain Layout
13212 and use what it provides to define it on-the-fly.
13214 \begin_inset Flex Code
13217 \begin_layout Plain Layout
13224 \begin_inset Flex Code
13227 \begin_layout Plain Layout
13234 It should be set to
13235 \begin_inset Flex Code
13238 \begin_layout Plain Layout
13244 if the float is already defined by the LaTeX document class.
13247 \begin_layout Description
13248 \begin_inset Flex Code
13251 \begin_layout Plain Layout
13258 \begin_inset Flex Code
13261 \begin_layout Plain Layout
13268 \begin_inset Quotes erd
13272 \begin_inset Quotes erd
13275 ] The command used to generate a list of floats of this type; the leading
13278 ' should be omitted.
13284 \begin_inset Flex Code
13287 \begin_layout Plain Layout
13293 is false, since there is no standard way to generate this command.
13295 \begin_inset Flex Code
13298 \begin_layout Plain Layout
13304 is true, since in that case there is a standard way to define the command.
13307 \begin_layout Description
13308 \begin_inset Flex Code
13311 \begin_layout Plain Layout
13318 \begin_inset Flex Code
13321 \begin_layout Plain Layout
13328 \begin_inset Quotes erd
13332 \begin_inset Quotes erd
13335 ] A title for a list of floats of this kind (list of figures, tables, or
13337 It is used for the screen label within LyX; it is passed to LaTeX for use
13338 as the title there; and it is used as the title in XHTML output.
13339 It will be translated to the document language.
13342 \begin_layout Description
13343 \begin_inset Flex Code
13346 \begin_layout Plain Layout
13353 \begin_inset Flex Code
13356 \begin_layout Plain Layout
13363 \begin_inset Quotes erd
13367 \begin_inset Quotes erd
13370 ] This (optional) argument determines whether floats of this class will
13371 be numbered within some sectional unit of the document.
13372 For example, if within is equal to
13373 \begin_inset Flex Code
13376 \begin_layout Plain Layout
13382 , the floats will be numbered within chapters.
13386 \begin_layout Description
13387 \begin_inset Flex Code
13390 \begin_layout Plain Layout
13397 \begin_inset Flex Code
13400 \begin_layout Plain Layout
13407 \begin_inset Quotes erd
13411 \begin_inset Quotes erd
13414 ] The default placement for the given class of floats.
13415 The string should be as in standard LaTeX:
13416 \begin_inset Flex Code
13419 \begin_layout Plain Layout
13426 \begin_inset Flex Code
13429 \begin_layout Plain Layout
13436 \begin_inset Flex Code
13439 \begin_layout Plain Layout
13446 \begin_inset Flex Code
13449 \begin_layout Plain Layout
13455 for top, bottom, page, and here, respectively.
13459 \begin_layout Plain Layout
13460 Note that the order of these letters in the string is irrelevant, like in
13466 On top of that there is a new type,
13467 \begin_inset Flex Code
13470 \begin_layout Plain Layout
13476 , which does not really correspond to a float, since it means: put it
13477 \begin_inset Quotes eld
13481 \begin_inset Quotes erd
13485 Note however that the
13486 \begin_inset Flex Code
13489 \begin_layout Plain Layout
13495 specifier is special and, because of implementation details, cannot be
13496 used in non-built in float types.
13497 If you do not understand what this means, just use
13498 \begin_inset Quotes eld
13502 \begin_inset Flex Code
13505 \begin_layout Plain Layout
13512 \begin_inset Quotes erd
13518 \begin_layout Description
13519 \begin_inset Flex Code
13522 \begin_layout Plain Layout
13529 \begin_inset Flex Code
13532 \begin_layout Plain Layout
13538 ] The prefix to use when creating labels referring to floats of this type.
13539 This allows the use of formatted references.
13540 Note that you can remove any
13541 \begin_inset Flex Code
13544 \begin_layout Plain Layout
13550 set by a copied style by using the special value
13551 \begin_inset Quotes eld
13555 \begin_inset Quotes erd
13558 , which must be all caps.
13561 \begin_layout Description
13562 \begin_inset Flex Code
13565 \begin_layout Plain Layout
13572 \begin_inset Flex Code
13575 \begin_layout Plain Layout
13582 \begin_inset Quotes erd
13586 \begin_inset Quotes erd
13589 ] The style used when defining the float using
13590 \begin_inset Flex Code
13593 \begin_layout Plain Layout
13604 \begin_layout Description
13605 \begin_inset Flex Code
13608 \begin_layout Plain Layout
13615 \begin_inset Flex Code
13618 \begin_layout Plain Layout
13625 \begin_inset Quotes erd
13629 \begin_inset Quotes erd
13633 \begin_inset Quotes eld
13637 \begin_inset Quotes erd
13640 of the new class of floats, like program or algorithm.
13641 After the appropriate
13642 \begin_inset Flex Code
13645 \begin_layout Plain Layout
13654 \begin_inset Flex Code
13657 \begin_layout Plain Layout
13666 \begin_inset Flex Code
13669 \begin_layout Plain Layout
13680 \begin_layout Description
13681 \begin_inset Flex Code
13684 \begin_layout Plain Layout
13691 \begin_inset Flex Code
13694 \begin_layout Plain Layout
13701 \begin_inset Flex Code
13704 \begin_layout Plain Layout
13712 ] Tells us whether this float is defined using the facilities provided by
13714 \begin_inset Flex Code
13717 \begin_layout Plain Layout
13723 , either by the class file or a package, or on-the-fly by LyX itself.
13726 \begin_layout Standard
13727 Note that defining a float with type
13728 \begin_inset Flex Code
13731 \begin_layout Plain Layout
13739 automatically defines the corresponding counter with name
13740 \begin_inset Flex Code
13743 \begin_layout Plain Layout
13754 \begin_layout Subsection
13755 Flex insets and InsetLayout
13756 \begin_inset CommandInset label
13758 name "sub:Flex-insets-and"
13765 \begin_layout Standard
13766 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13767 these are called Flex insets.
13771 \begin_layout Standard
13772 Flex insets come in three different kinds:
13775 \begin_layout Itemize
13777 \begin_inset Flex Code
13780 \begin_layout Plain Layout
13786 ): These define semantic markup corresponding to such LaTeX commands as
13788 \begin_inset Flex Code
13791 \begin_layout Plain Layout
13800 \begin_inset Flex Code
13803 \begin_layout Plain Layout
13814 \begin_layout Itemize
13816 \begin_inset Flex Code
13819 \begin_layout Plain Layout
13825 ): These can be used to define custom collapsible insets, similar to TeX
13826 code, footnote, and the like.
13827 An obvious example is an endnote inset, which is defined in the
13828 \begin_inset Flex Code
13831 \begin_layout Plain Layout
13840 \begin_layout Itemize
13842 \begin_inset Flex Code
13845 \begin_layout Plain Layout
13851 ): For use with DocBook classes.
13854 \begin_layout Standard
13855 Flex insets are defined using the
13856 \begin_inset Flex Code
13859 \begin_layout Plain Layout
13865 tag, which shall be explained in a moment.
13868 \begin_layout Standard
13870 \begin_inset Flex Code
13873 \begin_layout Plain Layout
13879 tag also serves another function: It can be used to customize the general
13880 layout of many different types of insets.
13882 \begin_inset Flex Code
13885 \begin_layout Plain Layout
13891 can be used to customize the layout parameters for footnotes, marginal
13892 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13893 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13894 define Flex insets.
13897 \begin_layout Standard
13899 \begin_inset Flex Code
13902 \begin_layout Plain Layout
13908 definition must begin with a line of the form:
13911 \begin_layout LyX-Code
13915 \begin_layout Standard
13917 \begin_inset Flex Code
13920 \begin_layout Plain Layout
13926 indicates the inset whose layout is being defined, and here there are two
13930 \begin_layout Enumerate
13931 The layout for a pre-existing inset is being modified.
13932 In this case, can be
13933 \begin_inset Flex Code
13936 \begin_layout Plain Layout
13942 any one of the following:
13943 \begin_inset Flex Code
13946 \begin_layout Plain Layout
13953 \begin_inset Flex Code
13956 \begin_layout Plain Layout
13963 \begin_inset Flex Code
13966 \begin_layout Plain Layout
13973 \begin_inset Flex Code
13976 \begin_layout Plain Layout
13983 \begin_inset Flex Code
13986 \begin_layout Plain Layout
13993 \begin_inset Flex Code
13996 \begin_layout Plain Layout
14003 \begin_inset Flex Code
14006 \begin_layout Plain Layout
14013 \begin_inset Flex Code
14016 \begin_layout Plain Layout
14023 \begin_inset Flex Code
14026 \begin_layout Plain Layout
14033 \begin_inset Flex Code
14036 \begin_layout Plain Layout
14043 \begin_inset Flex Code
14046 \begin_layout Plain Layout
14053 \begin_inset Flex Code
14056 \begin_layout Plain Layout
14063 \begin_inset Flex Code
14066 \begin_layout Plain Layout
14073 \begin_inset Flex Code
14076 \begin_layout Plain Layout
14083 \begin_inset Flex Code
14086 \begin_layout Plain Layout
14093 \begin_inset Flex Code
14096 \begin_layout Plain Layout
14103 \begin_inset Flex Code
14106 \begin_layout Plain Layout
14113 \begin_inset Flex Code
14116 \begin_layout Plain Layout
14123 \begin_inset Flex Code
14126 \begin_layout Plain Layout
14133 \begin_inset Flex Code
14136 \begin_layout Plain Layout
14145 \begin_layout Enumerate
14146 The layout for a Flex inset is being defined.
14148 \begin_inset Flex Code
14151 \begin_layout Plain Layout
14157 must be of the form
14158 \begin_inset Quotes eld
14162 \begin_inset Flex Code
14165 \begin_layout Plain Layout
14172 \begin_inset Quotes erd
14176 \begin_inset Flex Code
14179 \begin_layout Plain Layout
14185 may be be any valid identifier not used by a pre-existing Flex inset.
14186 The identifier may include spaces, but in that case the whole thing must
14187 be wrapped in quotes.
14188 Note that the definition of a flex inset
14193 \begin_inset Flex Code
14196 \begin_layout Plain Layout
14202 entry, declaring which type of inset it defines.
14205 \begin_layout Standard
14207 \begin_inset Flex Code
14210 \begin_layout Plain Layout
14216 definition can contain the following entries:
14219 \begin_layout Description
14220 \begin_inset Flex Code
14223 \begin_layout Plain Layout
14229 The color for the inset's background.
14230 The valid colors are defined in
14231 \begin_inset Flex Code
14234 \begin_layout Plain Layout
14243 \begin_layout Description
14244 \begin_inset Flex Code
14247 \begin_layout Plain Layout
14254 \begin_inset Flex Code
14257 \begin_layout Plain Layout
14266 \begin_inset Flex Code
14269 \begin_layout Plain Layout
14275 ] Whether to use the content of the inset as the label, when the inset is
14280 \begin_layout Description
14281 \begin_inset Flex Code
14284 \begin_layout Plain Layout
14291 \begin_inset Flex Code
14294 \begin_layout Plain Layout
14300 Copies all the features of an existing style into the current one.
14304 \begin_layout Description
14305 \begin_inset Flex Code
14308 \begin_layout Plain Layout
14315 \begin_inset Flex Code
14318 \begin_layout Plain Layout
14327 \begin_inset Flex Code
14330 \begin_layout Plain Layout
14336 ] Indicates whether the user may employ the Paragraph Settings dialog to
14337 customize the paragraph.
14340 \begin_layout Description
14341 \begin_inset Flex Code
14344 \begin_layout Plain Layout
14351 \begin_inset Flex Code
14354 \begin_layout Plain Layout
14361 \begin_inset Flex Code
14364 \begin_layout Plain Layout
14371 \begin_inset Flex Code
14374 \begin_layout Plain Layout
14380 , describing the rendering style used for the inset's frame and buttons.
14381 Footnotes generally use
14382 \begin_inset Flex Code
14385 \begin_layout Plain Layout
14391 , ERT insets generally
14392 \begin_inset Flex Code
14395 \begin_layout Plain Layout
14401 , and character styles
14402 \begin_inset Flex Code
14405 \begin_layout Plain Layout
14414 \begin_layout Description
14415 \begin_inset Flex Code
14418 \begin_layout Plain Layout
14425 \begin_inset Flex Code
14428 \begin_layout Plain Layout
14435 \begin_inset Flex Code
14438 \begin_layout Plain Layout
14447 \begin_inset Flex Code
14450 \begin_layout Plain Layout
14457 \begin_inset Flex Code
14460 \begin_layout Plain Layout
14467 Indicates whether the environment will stand on its own in LaTeX output
14468 or will appear inline with the surrounding text.
14469 If set to false, it is supposed that the LaTeX environment ignores white
14470 space (including one newline character) after the
14471 \begin_inset Flex Code
14474 \begin_layout Plain Layout
14487 \begin_inset Flex Code
14490 \begin_layout Plain Layout
14506 \begin_layout Description
14507 \begin_inset Flex Code
14510 \begin_layout Plain Layout
14516 Required at the end of the InsetLayout declarations.
14519 \begin_layout Description
14520 \begin_inset Flex Code
14523 \begin_layout Plain Layout
14529 The font used for both the text body
14535 \begin_inset space ~
14539 \begin_inset CommandInset ref
14541 reference "sub:Font-description"
14546 Note that defining this font automatically defines the
14547 \begin_inset Flex Code
14550 \begin_layout Plain Layout
14556 to the same value, so define this first and define
14557 \begin_inset Flex Code
14560 \begin_layout Plain Layout
14566 later if you want them to be different.
14569 \begin_layout Description
14570 \begin_inset Flex Code
14573 \begin_layout Plain Layout
14580 \begin_inset Quotes eld
14584 \begin_inset Quotes erd
14587 language, leading to Left-to-Right (latin) output, e.
14588 \begin_inset space \thinspace{}
14592 \begin_inset space \space{}
14595 in TeX code or URL.
14599 \begin_layout Description
14600 \begin_inset Flex Code
14603 \begin_layout Plain Layout
14610 \begin_inset Flex Code
14613 \begin_layout Plain Layout
14622 \begin_inset Flex Code
14625 \begin_layout Plain Layout
14631 ] Indicates whether the
14632 \begin_inset Flex Code
14635 \begin_layout Plain Layout
14641 should be used or, instead, the user can change the paragraph style used
14646 \begin_layout Description
14647 \begin_inset Flex Code
14650 \begin_layout Plain Layout
14657 \begin_inset Flex Code
14660 \begin_layout Plain Layout
14669 \begin_inset Flex Code
14672 \begin_layout Plain Layout
14678 ] Usually LyX doesn't allow you to insert more than one space between words,
14679 since a space is considered as the separation between two words, not a
14680 character or symbol of its own.
14681 This is a very fine thing but sometimes annoying, for example, when typing
14682 program code or plain LaTeX code.
14684 \begin_inset Flex Code
14687 \begin_layout Plain Layout
14694 Note that LyX will create protected blanks for the additional blanks when
14695 in another mode than LaTeX-mode.
14699 \begin_layout Description
14700 \begin_inset Flex Code
14703 \begin_layout Plain Layout
14709 These tags control XHTML output.
14711 \begin_inset CommandInset ref
14713 reference "sec:Tags-for-XHTML"
14720 \begin_layout Description
14721 \begin_inset Flex Code
14724 \begin_layout Plain Layout
14731 \begin_inset Flex Code
14734 \begin_layout Plain Layout
14743 \begin_inset Flex Code
14746 \begin_layout Plain Layout
14752 ] Whether to include the contents of this inset in the strings generated
14753 for the `Outline' pane.
14754 One would not, for example, want the content of a footnote in a section
14755 header to be included in the TOC displayed in the outline, but one would
14756 normally want the content of a character style displayed.
14757 Default is false: not to include.
14760 \begin_layout Description
14761 \begin_inset Flex Code
14764 \begin_layout Plain Layout
14771 \begin_inset Flex Code
14774 \begin_layout Plain Layout
14783 \begin_inset Flex Code
14786 \begin_layout Plain Layout
14792 ] Usually LyX does not allow you to leave a paragraph empty, since it would
14793 lead to empty LaTeX output.
14794 There are some cases where this could be desirable however: in a letter
14795 template, the required fields can be provided as empty fields, so that
14796 people do not forget them; in some special classes, a style can be used
14797 as some kind of break, which does not contain actual text.
14801 \begin_layout Description
14802 \begin_inset Flex Code
14805 \begin_layout Plain Layout
14811 The font used for the label.
14813 \begin_inset space ~
14817 \begin_inset CommandInset ref
14819 reference "sub:Font-description"
14824 Note that this definition can never appear before
14825 \begin_inset Flex Code
14828 \begin_layout Plain Layout
14834 , lest it be ineffective.
14837 \begin_layout Description
14838 \begin_inset Flex Code
14841 \begin_layout Plain Layout
14847 What will be displayed on the button or elsewhere as the inset label.
14849 \begin_inset Flex Code
14852 \begin_layout Plain Layout
14859 \begin_inset Flex Code
14862 \begin_layout Plain Layout
14868 ) modify this label on the fly.
14871 \begin_layout Description
14872 \begin_inset Flex Code
14875 \begin_layout Plain Layout
14881 The name of the corresponding LaTeX stuff.
14882 Either the environment or command name.
14885 \begin_layout Description
14886 \begin_inset Flex Code
14889 \begin_layout Plain Layout
14895 The optional parameter for the corresponding
14896 \begin_inset Flex Code
14899 \begin_layout Plain Layout
14905 stuff, including possible bracket pairs like
14906 \begin_inset Flex Code
14909 \begin_layout Plain Layout
14916 This parameter cannot be changed from within LyX.
14919 \begin_layout Description
14920 \begin_inset Flex Code
14923 \begin_layout Plain Layout
14930 \begin_inset Flex Code
14933 \begin_layout Plain Layout
14938 , Command, Environment, Item_Environment,
14944 \begin_inset Flex Code
14947 \begin_layout Plain Layout
14948 List_Environment, Bib_Environment
14953 ] How the style should be translated into LaTeX.
14957 \begin_layout Plain Layout
14958 \begin_inset Flex Code
14961 \begin_layout Plain Layout
14967 is perhaps a bit misleading, since these rules apply to SGML classes, too.
14968 Visit the SGML class files for specific examples.
14977 \begin_layout Itemize
14978 \begin_inset Flex Code
14981 \begin_layout Plain Layout
14987 means nothing special.
14991 \begin_layout Itemize
14992 \begin_inset Flex Code
14995 \begin_layout Plain Layout
15002 \begin_inset Flex Code
15005 \begin_layout Plain Layout
15012 {\SpecialChar \ldots{}
15021 \begin_layout Itemize
15022 \begin_inset Flex Code
15025 \begin_layout Plain Layout
15032 \begin_inset Flex Code
15035 \begin_layout Plain Layout
15042 }\SpecialChar \ldots{}
15058 \begin_layout Itemize
15059 \begin_inset Flex Code
15062 \begin_layout Plain Layout
15069 \begin_inset Flex Code
15072 \begin_layout Plain Layout
15079 \begin_inset Flex Code
15082 \begin_layout Plain Layout
15090 is generated for each paragraph of this environment.
15094 \begin_layout Itemize
15095 \begin_inset Flex Code
15098 \begin_layout Plain Layout
15105 \begin_inset Flex Code
15108 \begin_layout Plain Layout
15115 \begin_inset Flex Code
15118 \begin_layout Plain Layout
15124 is passed as an argument to the environment.
15126 \begin_inset Flex Code
15129 \begin_layout Plain Layout
15135 can be defined in the
15136 \begin_inset Flex MenuItem
15139 \begin_layout Plain Layout
15144 \SpecialChar \menuseparator
15150 \begin_inset space ~
15162 \begin_layout Standard
15163 Putting the last few things together, the LaTeX output will be either:
15166 \begin_layout LyX-Code
15169 latexname[latexparam]{\SpecialChar \ldots{}
15173 \begin_layout Standard
15177 \begin_layout LyX-Code
15180 begin{latexname}[latexparam] \SpecialChar \ldots{}
15186 \begin_layout Standard
15187 depending upon the LaTeX type.
15191 \begin_layout Description
15192 \begin_inset Flex Code
15195 \begin_layout Plain Layout
15202 \begin_inset Flex Code
15205 \begin_layout Plain Layout
15212 \begin_inset Flex Code
15215 \begin_layout Plain Layout
15222 \begin_inset Flex Code
15225 \begin_layout Plain Layout
15232 \begin_inset Flex Code
15235 \begin_layout Plain Layout
15241 (indicating a dummy definition ending definitions of charstyles, etc).
15242 This entry is required in and is only meaningful for Flex insets.
15243 Among other things, it determines on which menu this inset will appear.
15245 \begin_inset Flex Code
15248 \begin_layout Plain Layout
15255 \begin_inset Flex Code
15258 \begin_layout Plain Layout
15265 \begin_inset Flex Code
15268 \begin_layout Plain Layout
15276 \begin_inset Flex Code
15279 \begin_layout Plain Layout
15285 can be set to true for charstyle insets, if you wish, by setting it
15290 \begin_inset Flex Code
15293 \begin_layout Plain Layout
15302 \begin_layout Description
15303 \begin_inset Flex Code
15306 \begin_layout Plain Layout
15313 \begin_inset Flex Code
15316 \begin_layout Plain Layout
15325 \begin_inset Flex Code
15328 \begin_layout Plain Layout
15334 ] Whether multiple paragraphs are permitted in this inset.
15336 \begin_inset Flex Code
15339 \begin_layout Plain Layout
15345 to the same value and
15346 \begin_inset Flex Code
15349 \begin_layout Plain Layout
15355 to the opposite value.
15356 These can be reset to other values, if they are used
15361 \begin_inset Flex Code
15364 \begin_layout Plain Layout
15374 \begin_layout Description
15375 \begin_inset Flex Code
15378 \begin_layout Plain Layout
15385 \begin_inset Flex Code
15388 \begin_layout Plain Layout
15397 \begin_inset Flex Code
15400 \begin_layout Plain Layout
15406 ] Whether fragile commands in this inset should be
15407 \begin_inset Flex Code
15410 \begin_layout Plain Layout
15423 whether the command should itself be protected.) Default is false.
15426 \begin_layout Description
15427 \begin_inset Flex Code
15430 \begin_layout Plain Layout
15437 \begin_inset Flex Code
15440 \begin_layout Plain Layout
15449 \begin_inset Flex Code
15452 \begin_layout Plain Layout
15458 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
15459 output, but only by a line break; together with
15460 \begin_inset Flex Code
15463 \begin_layout Plain Layout
15469 , this allows to emulate a plain text editor (like the ERT inset).
15473 \begin_layout Description
15474 \begin_inset Flex Code
15477 \begin_layout Plain Layout
15484 \begin_inset Flex Code
15487 \begin_layout Plain Layout
15496 \begin_inset Flex Code
15499 \begin_layout Plain Layout
15505 ] Whether the contents of this paragraph should be output in raw form, meaning
15506 without special translations that LaTeX would require.
15509 \begin_layout Description
15510 \begin_inset Flex Code
15513 \begin_layout Plain Layout
15519 Information to be included in the LaTeX preamble when this style is used.
15520 Used to define macros, load packages, etc., required by this particular
15523 \begin_inset Quotes eld
15527 \begin_inset Flex Code
15530 \begin_layout Plain Layout
15537 \begin_inset Quotes erd
15543 \begin_layout Description
15544 \begin_inset Flex Code
15547 \begin_layout Plain Layout
15554 \begin_inset Flex Code
15557 \begin_layout Plain Layout
15563 ] The prefix to use when creating labels referring to insets of this type.
15564 This allows the use of formatted references.
15567 \begin_layout Description
15568 \begin_inset Flex Code
15571 \begin_layout Plain Layout
15578 \begin_inset Flex Code
15581 \begin_layout Plain Layout
15587 ] Whether the style requires the feature
15588 \begin_inset Flex Code
15591 \begin_layout Plain Layout
15598 See the description of
15599 \begin_inset Flex Code
15602 \begin_layout Plain Layout
15609 \begin_inset CommandInset ref
15610 LatexCommand pageref
15611 reference "des:FreeSpacing"
15615 ) for information on `features'.
15619 \begin_layout Description
15620 \begin_inset Flex Code
15623 \begin_layout Plain Layout
15630 \begin_inset Flex Code
15633 \begin_layout Plain Layout
15640 \begin_inset Flex Code
15643 \begin_layout Plain Layout
15651 ] Whether this inset should use the font of its surrounding environment
15653 Default is true: uses its own.
15656 \begin_layout Description
15657 \begin_inset Flex Code
15660 \begin_layout Plain Layout
15667 \begin_inset Flex Code
15670 \begin_layout Plain Layout
15677 \begin_inset Flex Code
15680 \begin_layout Plain Layout
15688 ] Spellcheck the contents of this inset.
15692 \begin_layout Subsection
15694 \begin_inset CommandInset label
15696 name "sub:Counters"
15703 \begin_layout Standard
15704 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15706 \begin_inset Flex MenuItem
15709 \begin_layout Plain Layout
15716 \begin_inset Flex MenuItem
15719 \begin_layout Plain Layout
15725 , \SpecialChar \ldots{}
15726 ) in the text class itself.
15727 The standard counters are defined in the file
15728 \begin_inset Flex Code
15731 \begin_layout Plain Layout
15737 , so you may have to do no more than add
15740 \begin_layout LyX-Code
15741 Input stdcounters.inc
15744 \begin_layout Standard
15745 to your layout file to get them to work.
15746 But if you want to define custom counters, then you can do so.
15747 The counter declaration must begin with:
15750 \begin_layout LyX-Code
15751 Counter CounterName
15754 \begin_layout Standard
15756 \begin_inset Flex Code
15759 \begin_layout Plain Layout
15765 ' is replaced by the name of the counter.
15766 And it must end with
15767 \begin_inset Quotes eld
15771 \begin_inset Flex Code
15774 \begin_layout Plain Layout
15781 \begin_inset Quotes erd
15785 The following parameters can also be used:
15788 \begin_layout Description
15789 \begin_inset Flex Code
15792 \begin_layout Plain Layout
15799 \begin_inset Flex Code
15802 \begin_layout Plain Layout
15809 \begin_inset Quotes erd
15813 \begin_inset Quotes erd
15816 ] When defined, this string defines how the counter is displayed.
15817 Setting this value sets
15818 \begin_inset Flex Code
15821 \begin_layout Plain Layout
15822 LabelStringAppendix
15828 The following special constructs can be used in the string:
15832 \begin_layout Itemize
15833 \begin_inset Flex Code
15836 \begin_layout Plain Layout
15844 will be replaced by the expansion of the
15845 \begin_inset Flex Code
15848 \begin_layout Plain Layout
15855 \begin_inset Flex Code
15858 \begin_layout Plain Layout
15859 LabelStringAppendix
15865 \begin_inset Flex Code
15868 \begin_layout Plain Layout
15878 \begin_layout Itemize
15879 counter values can be expressed using LaTeX-like macros
15880 \begin_inset Flex Code
15883 \begin_layout Plain Layout
15900 \begin_inset Flex Code
15903 \begin_layout Plain Layout
15915 \begin_layout Plain Layout
15925 Actually, the situation is a bit more complicated: any
15944 other than those described below will produce arabic numerals.
15945 It would not be surprising to see this change in the future.
15951 \begin_inset Flex Code
15954 \begin_layout Plain Layout
15960 : 1, 2, 3,\SpecialChar \ldots{}
15962 \begin_inset Flex Code
15965 \begin_layout Plain Layout
15971 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15973 \begin_inset Flex Code
15976 \begin_layout Plain Layout
15982 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15984 \begin_inset Flex Code
15987 \begin_layout Plain Layout
15993 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15995 \begin_inset Flex Code
15998 \begin_layout Plain Layout
16004 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
16006 \begin_inset Flex Code
16009 \begin_layout Plain Layout
16015 for hebrew numerals.
16019 \begin_layout Standard
16020 If LabelString is not defined, a default value is constructed as follows:
16021 if the counter has a master counter
16022 \begin_inset Flex Code
16025 \begin_layout Plain Layout
16032 \begin_inset Flex Code
16035 \begin_layout Plain Layout
16042 \begin_inset Flex Code
16045 \begin_layout Plain Layout
16055 is used; otherwise the string
16056 \begin_inset Flex Code
16059 \begin_layout Plain Layout
16070 \begin_layout Description
16071 \begin_inset Flex Code
16074 \begin_layout Plain Layout
16075 LabelStringAppendix
16081 \begin_inset Flex Code
16084 \begin_layout Plain Layout
16091 \begin_inset Quotes erd
16095 \begin_inset Quotes erd
16099 \begin_inset Flex Code
16102 \begin_layout Plain Layout
16108 , but for use in the Appendix.
16111 \begin_layout Description
16112 \begin_inset Flex Code
16115 \begin_layout Plain Layout
16122 \begin_inset Flex Code
16125 \begin_layout Plain Layout
16132 \begin_inset Quotes erd
16136 \begin_inset Quotes erd
16139 ] A format for use with formatted references to this counter.
16140 For example, one might want to have references to section numbers appear
16142 \begin_inset Quotes eld
16146 \begin_inset Quotes erd
16150 The string should contain
16151 \begin_inset Quotes eld
16155 \begin_inset Quotes erd
16159 This will be replaced by the counter number itself.
16160 So, for sections, it would be: Section ##.
16163 \begin_layout Description
16164 \begin_inset Flex Code
16167 \begin_layout Plain Layout
16174 \begin_inset Flex Code
16177 \begin_layout Plain Layout
16184 \begin_inset Quotes erd
16188 \begin_inset Quotes erd
16191 ] If this is set to the name of another counter, the present counter will
16192 be reset every time the other one is increased.
16194 \begin_inset Flex Code
16197 \begin_layout Plain Layout
16204 \begin_inset Flex Code
16207 \begin_layout Plain Layout
16216 \begin_layout Subsection
16218 \begin_inset CommandInset label
16220 name "sub:Font-description"
16227 \begin_layout Standard
16228 A font description looks like this:
16231 \begin_layout LyX-Code
16241 \begin_layout LyX-Code
16245 \begin_layout LyX-Code
16249 \begin_layout Standard
16250 The following commands are available:
16253 \begin_layout Description
16254 \begin_inset Flex Code
16257 \begin_layout Plain Layout
16264 \begin_inset Flex Code
16267 \begin_layout Plain Layout
16276 \begin_inset Flex Code
16279 \begin_layout Plain Layout
16286 \begin_inset Flex Code
16289 \begin_layout Plain Layout
16296 \begin_inset Flex Code
16299 \begin_layout Plain Layout
16306 \begin_inset Flex Code
16309 \begin_layout Plain Layout
16316 \begin_inset Flex Code
16319 \begin_layout Plain Layout
16326 \begin_inset Flex Code
16329 \begin_layout Plain Layout
16336 \begin_inset Flex Code
16339 \begin_layout Plain Layout
16346 \begin_inset Flex Code
16349 \begin_layout Plain Layout
16358 \begin_layout Description
16359 \begin_inset Flex Code
16362 \begin_layout Plain Layout
16369 \begin_inset Flex Code
16372 \begin_layout Plain Layout
16381 \begin_inset Flex Code
16384 \begin_layout Plain Layout
16391 \begin_inset Flex Code
16394 \begin_layout Plain Layout
16403 \begin_layout Description
16404 \begin_inset Flex Code
16407 \begin_layout Plain Layout
16414 \begin_inset Flex Code
16417 \begin_layout Plain Layout
16423 ] Valid arguments are:
16424 \begin_inset Flex Code
16427 \begin_layout Plain Layout
16434 \begin_inset Flex Code
16437 \begin_layout Plain Layout
16444 \begin_inset Flex Code
16447 \begin_layout Plain Layout
16454 \begin_inset Flex Code
16457 \begin_layout Plain Layout
16464 \begin_inset Flex Code
16467 \begin_layout Plain Layout
16474 \begin_inset Flex Code
16477 \begin_layout Plain Layout
16484 \begin_inset Flex Code
16487 \begin_layout Plain Layout
16494 \begin_inset Flex Code
16497 \begin_layout Plain Layout
16504 \begin_inset Flex Code
16507 \begin_layout Plain Layout
16514 \begin_inset Flex Code
16517 \begin_layout Plain Layout
16524 \begin_inset Flex Code
16527 \begin_layout Plain Layout
16534 \begin_inset Flex Code
16537 \begin_layout Plain Layout
16544 Each of these turns on or off the corresponding attribute.
16546 \begin_inset Flex Code
16549 \begin_layout Plain Layout
16555 turns on emphasis, and
16556 \begin_inset Flex Code
16559 \begin_layout Plain Layout
16567 \begin_inset Newline newline
16570 If the latter seems puzzling, remember that the font settings for the present
16571 context are generally inherited from the surrounding context.
16573 \begin_inset Flex Code
16576 \begin_layout Plain Layout
16582 would turn off the emphasis that was anyway in effect, say, in a theorem
16586 \begin_layout Description
16587 \begin_inset Flex Code
16590 \begin_layout Plain Layout
16597 \begin_inset Flex Code
16600 \begin_layout Plain Layout
16609 \begin_inset Flex Code
16612 \begin_layout Plain Layout
16621 \begin_layout Description
16622 \begin_inset Flex Code
16625 \begin_layout Plain Layout
16632 \begin_inset Flex Code
16635 \begin_layout Plain Layout
16644 \begin_inset Flex Code
16647 \begin_layout Plain Layout
16654 \begin_inset Flex Code
16657 \begin_layout Plain Layout
16664 \begin_inset Flex Code
16667 \begin_layout Plain Layout
16676 \begin_layout Description
16677 \begin_inset Flex Code
16680 \begin_layout Plain Layout
16687 \begin_inset Flex Code
16690 \begin_layout Plain Layout
16697 \begin_inset Flex Code
16700 \begin_layout Plain Layout
16707 \begin_inset Flex Code
16710 \begin_layout Plain Layout
16719 \begin_inset Flex Code
16722 \begin_layout Plain Layout
16729 \begin_inset Flex Code
16732 \begin_layout Plain Layout
16739 \begin_inset Flex Code
16742 \begin_layout Plain Layout
16749 \begin_inset Flex Code
16752 \begin_layout Plain Layout
16759 \begin_inset Flex Code
16762 \begin_layout Plain Layout
16771 \begin_layout Subsection
16772 \begin_inset CommandInset label
16774 name "sub:Citation-format-description"
16778 Citation format description
16781 \begin_layout Standard
16783 \begin_inset Flex Code
16786 \begin_layout Plain Layout
16792 blocks are used to describe how bibliographic information should be displayed,
16793 both within LyX itself (in the citation dialog and in tooltips, for example)
16794 and in XHTML output.
16795 Such a block might look like this:
16798 \begin_layout LyX-Code
16802 \begin_layout LyX-Code
16806 \begin_layout LyX-Code
16810 \begin_layout LyX-Code
16814 \begin_layout Standard
16815 The individual lines define how the bibliographic information associated
16816 with an article or book, respectively, is to be displayed, and such a definitio
16817 n can be given for any `entry type' that might be present in a BibTeX file.
16818 LyX defines a default format in the source code that will be used if no
16819 specific definition has been given.
16820 LyX predefines several formats in the file
16821 \begin_inset Flex Code
16824 \begin_layout Plain Layout
16830 , which is included in most of LyX's document classes.
16833 \begin_layout Standard
16834 The definitions use a simple language that allows BibTeX keys to be replaced
16836 Keys should be enclosed in
16837 \begin_inset Flex Code
16840 \begin_layout Plain Layout
16847 \begin_inset Flex Code
16850 \begin_layout Plain Layout
16857 So a simple definition might look like this:
16860 \begin_layout LyX-Code
16862 \begin_inset Quotes eld
16866 \begin_inset Quotes erd
16872 \begin_layout Standard
16873 This would print the author, followed by a comma, followed by the title,
16874 in quotes, followed by a period.
16877 \begin_layout Standard
16878 Of course, sometimes you may want to print a key only if it exists.
16879 This can be done by using a conditional construction, such as:
16880 \begin_inset Flex Code
16883 \begin_layout Plain Layout
16885 \begin_inset space ~
16895 \begin_inset Flex Code
16898 \begin_layout Plain Layout
16904 key exists, then print
16905 \begin_inset Quotes eld
16909 \begin_inset space ~
16913 \begin_inset Quotes erd
16916 followed by the volume key.
16917 It is also possible to have an else clause in the conditional, such as:
16919 \begin_inset Flex Code
16922 \begin_layout Plain Layout
16923 {%author%[[%author%]][[%editor%, ed.]]}
16930 \begin_inset Flex Code
16933 \begin_layout Plain Layout
16939 key is printed if it exists; otherwise, the editor key is printed, followed
16941 \begin_inset Quotes eld
16945 \begin_inset space ~
16949 \begin_inset Quotes erd
16952 Note that the key is again enclosed in
16953 \begin_inset Flex Code
16956 \begin_layout Plain Layout
16962 signs; the entire conditional is enclosed in braces; and the if and else
16963 clauses are enclosed in double brackets,
16964 \begin_inset Quotes eld
16968 \begin_inset Flex Code
16971 \begin_layout Plain Layout
16978 \begin_inset Quotes eld
16982 \begin_inset Quotes eld
16986 \begin_inset Flex Code
16989 \begin_layout Plain Layout
16996 \begin_inset Quotes erd
17000 There must be no space between any of these.
17003 \begin_layout Standard
17004 There is one other piece of syntax available in definitions, which looks
17006 \begin_inset Flex Code
17009 \begin_layout Plain Layout
17016 This defines a piece of formatting information that is to be used when
17018 \begin_inset Quotes eld
17022 \begin_inset Quotes erd
17026 Obviously, we do not want to output HTML tags when writing plain text,
17027 so they should be wrapped in
17028 \begin_inset Quotes eld
17032 \begin_inset Quotes erd
17036 \begin_inset Quotes eld
17040 \begin_inset Quotes erd
17046 \begin_layout Standard
17047 Two special sorts of definitions are also possible in a
17048 \begin_inset Flex Code
17051 \begin_layout Plain Layout
17058 An example of the first would be:
17061 \begin_layout LyX-Code
17063 \begin_inset Quotes eld
17067 \begin_inset Quotes erd
17073 \begin_layout Standard
17074 This is an abbreviation, or macro, and it can be used by treating it as
17076 \begin_inset Flex Code
17079 \begin_layout Plain Layout
17087 \begin_inset Flex Code
17090 \begin_layout Plain Layout
17096 exactly as it would treat its definition.
17097 So, let us issue the obvious
17105 \begin_layout LyX-Code
17109 \begin_layout Standard
17110 or anything like it.
17111 LyX shouldn't go into an infinite loop, but it may go into a long one before
17115 \begin_layout Standard
17116 The second sort of special definition might look like this:
17119 \begin_layout LyX-Code
17123 \begin_layout Standard
17124 This defines a translatable piece of text, which allows relevant parts of
17125 the bibliography to be translated.
17126 It can be included in a definition by treating it as a key:
17127 \begin_inset Flex Code
17130 \begin_layout Plain Layout
17137 Several of these are predefined in
17138 \begin_inset Flex Code
17141 \begin_layout Plain Layout
17148 Note that these are not macros, in the sense just defined.
17149 They will not be expanded.
17152 \begin_layout Standard
17153 So here then is an example that use all these features:
17156 \begin_layout LyX-Code
17157 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
17160 \begin_layout Standard
17161 This defines a macro that prints the author, followed by a comma, if the
17163 \begin_inset Flex Code
17166 \begin_layout Plain Layout
17172 key is defined, or else prints the name of the editor, followed by the
17174 \begin_inset Flex Code
17177 \begin_layout Plain Layout
17183 or its translation (it is by default
17184 \begin_inset Quotes eld
17188 \begin_inset Quotes erd
17192 \begin_inset Flex Code
17195 \begin_layout Plain Layout
17202 Note that this is in fact defined in
17203 \begin_inset Flex Code
17206 \begin_layout Plain Layout
17212 , so you can use it in your own definitions, or re-definitions, if you load
17216 \begin_layout Section
17217 \begin_inset CommandInset label
17219 name "sec:Tags-for-XHTML"
17223 Tags for XHTML output
17226 \begin_layout Standard
17227 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
17228 by layout information.
17229 In general, LyX provides sensible defaults and, as mentioned earlier, it
17230 will even construct default CSS style rules from the other layout tags.
17231 For example, LyX will attempt to use the information provided in the
17232 \begin_inset Flex Code
17235 \begin_layout Plain Layout
17241 declaration for the Chapter style to write CSS that will appropriately
17242 format chapter headings.
17245 \begin_layout Standard
17246 In many cases, then, you may not have to do anything at all to get acceptable
17247 XHTML output for your own environments, custom insets, and so forth.
17248 But in some cases you will, and so LyX provides a number of layout tags
17249 that can be used to customize the XHTML and CSS that are generated.
17252 \begin_layout Standard
17253 Note that there are two tags,
17254 \begin_inset Flex Code
17257 \begin_layout Plain Layout
17264 \begin_inset Flex Code
17267 \begin_layout Plain Layout
17273 that may appear outside style and inset declarations.
17275 \begin_inset CommandInset ref
17277 reference "sub:General-text-class"
17281 for details on these.
17284 \begin_layout Subsection
17285 \begin_inset CommandInset label
17287 name "sub:Paragraph-Style-XHTML"
17294 \begin_layout Standard
17295 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
17296 dealing with a normal paragraph, a command, or an environment, where this
17297 is itself determined by the contents of the corresponding
17298 \begin_inset Flex Code
17301 \begin_layout Plain Layout
17311 \begin_layout Standard
17312 For a command or normal paragraph, the output XHTML has the following form:
17315 \begin_layout LyX-Code
17317 \begin_inset Quotes erd
17321 \begin_inset Quotes erd
17327 \begin_layout LyX-Code
17329 \begin_inset Quotes erd
17333 \begin_inset Quotes erd
17339 \begin_layout LyX-Code
17340 Contents of the paragraph.
17343 \begin_layout LyX-Code
17347 \begin_layout Standard
17348 The label tags are of course omitted if the paragraph does not have a label.
17351 \begin_layout Standard
17352 For an environment that is not some sort of list, the XHTML takes this form:
17355 \begin_layout LyX-Code
17357 \begin_inset Quotes erd
17361 \begin_inset Quotes erd
17367 \begin_layout LyX-Code
17369 \begin_inset Quotes erd
17373 \begin_inset Quotes erd
17377 \begin_inset Quotes erd
17381 \begin_inset Quotes erd
17384 >Environment Label</labeltag>First paragraph.</itemtag>
17387 \begin_layout LyX-Code
17388 <itemtag>Second paragraph.</itemtag>
17391 \begin_layout LyX-Code
17395 \begin_layout Standard
17396 Note that the label is output only for the first paragraph, as it should
17397 be for a theorem, for example.
17401 \begin_layout Standard
17402 For a list, we have one of these forms:
17405 \begin_layout LyX-Code
17407 \begin_inset Quotes erd
17411 \begin_inset Quotes erd
17417 \begin_layout LyX-Code
17419 \begin_inset Quotes erd
17423 \begin_inset Quotes erd
17427 \begin_inset Quotes erd
17431 \begin_inset Quotes erd
17434 >List Label</labeltag>First item.</itemtag>
17437 \begin_layout LyX-Code
17439 \begin_inset Quotes erd
17443 \begin_inset Quotes erd
17447 \begin_inset Quotes erd
17451 \begin_inset Quotes erd
17454 >List Label</labeltag>Second item.</itemtag>
17457 \begin_layout LyX-Code
17461 \begin_layout LyX-Code
17465 \begin_layout LyX-Code
17467 \begin_inset Quotes erd
17471 \begin_inset Quotes erd
17477 \begin_layout LyX-Code
17479 \begin_inset Quotes erd
17483 \begin_inset Quotes erd
17486 >List Label</labeltag><itemtag attr=
17487 \begin_inset Quotes erd
17491 \begin_inset Quotes erd
17494 >First item.</itemtag>
17497 \begin_layout LyX-Code
17499 \begin_inset Quotes erd
17503 \begin_inset Quotes erd
17506 >List Label</labeltag><itemtag attr=
17507 \begin_inset Quotes erd
17511 \begin_inset Quotes erd
17514 >Second item.</itemtag>
17517 \begin_layout LyX-Code
17521 \begin_layout Standard
17522 Note the different orders of
17523 \begin_inset Flex Code
17526 \begin_layout Plain Layout
17533 \begin_inset Flex Code
17536 \begin_layout Plain Layout
17543 Which order we get depends upon the setting of
17544 \begin_inset Flex Code
17547 \begin_layout Plain Layout
17554 \begin_inset Flex Code
17557 \begin_layout Plain Layout
17563 is false (the default), you get the first of these, with the label within
17564 the item; if true, you get the second, with the label outside the item.
17567 \begin_layout Standard
17568 The specific tags and attributes output for each paragraph type can be controlle
17569 d by means of the layout tags we are about to describe.
17570 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17571 so you often may not need to do very much to get good XHTML output.
17572 Think of the available tags as there so you can tweak things to your liking.
17575 \begin_layout Description
17576 \begin_inset Flex Code
17579 \begin_layout Plain Layout
17586 \begin_inset Flex Code
17589 \begin_layout Plain Layout
17595 ] Specifies attribute information to be output with the main tag.
17597 \begin_inset Quotes eld
17601 \begin_inset Flex Code
17604 \begin_layout Plain Layout
17611 \begin_inset Quotes erd
17615 By default, LyX will output
17616 \begin_inset Quotes eld
17620 \begin_inset Flex Code
17623 \begin_layout Plain Layout
17630 \begin_inset Quotes erd
17634 \begin_inset Flex Code
17637 \begin_layout Plain Layout
17643 is the LyX name of the layout, made lowercase, for example: chapter.
17648 contain any style information.
17650 \begin_inset Flex Code
17653 \begin_layout Plain Layout
17662 \begin_layout Description
17663 \begin_inset Flex Code
17666 \begin_layout Plain Layout
17673 \begin_inset Flex Code
17676 \begin_layout Plain Layout
17686 ] Whether to output the default CSS information LyX generates for this layout,
17687 even if additional information is explicitly provided via
17688 \begin_inset Flex Code
17691 \begin_layout Plain Layout
17699 \begin_inset Flex Code
17702 \begin_layout Plain Layout
17708 allows you to alter or augment the generated CSS, rather than to override
17711 \begin_inset Flex Code
17714 \begin_layout Plain Layout
17723 \begin_layout Description
17724 \begin_inset Flex Code
17727 \begin_layout Plain Layout
17734 \begin_inset Flex Code
17737 \begin_layout Plain Layout
17743 ] The tag to be used for individual paragraphs of environments, replacing
17745 \begin_inset Flex Code
17748 \begin_layout Plain Layout
17754 in the examples above.
17756 \begin_inset Flex Code
17759 \begin_layout Plain Layout
17768 \begin_layout Description
17769 \begin_inset Flex Code
17772 \begin_layout Plain Layout
17779 \begin_inset Flex Code
17782 \begin_layout Plain Layout
17788 ] Attributes for the item tag.
17790 \begin_inset Quotes eld
17794 \begin_inset Flex Code
17797 \begin_layout Plain Layout
17798 class=`layoutname_item'
17804 \begin_inset Quotes erd
17812 contain any style information.
17814 \begin_inset Flex Code
17817 \begin_layout Plain Layout
17826 \begin_layout Description
17827 \begin_inset Flex Code
17830 \begin_layout Plain Layout
17837 \begin_inset Flex Code
17840 \begin_layout Plain Layout
17846 ] The tag to be used for paragraph and item labels, replacing
17847 \begin_inset Flex Code
17850 \begin_layout Plain Layout
17856 in the examples above.
17858 \begin_inset Flex Code
17861 \begin_layout Plain Layout
17868 \begin_inset Flex Code
17871 \begin_layout Plain Layout
17878 \begin_inset Flex Code
17881 \begin_layout Plain Layout
17888 \begin_inset Flex Code
17891 \begin_layout Plain Layout
17892 Centered_Top_Environment
17897 , in which case it defaults to
17898 \begin_inset Flex Code
17901 \begin_layout Plain Layout
17910 \begin_layout Description
17911 \begin_inset Flex Code
17914 \begin_layout Plain Layout
17921 \begin_inset Flex Code
17924 \begin_layout Plain Layout
17930 ] Attributes for the label tag.
17932 \begin_inset Quotes eld
17936 \begin_inset Flex Code
17939 \begin_layout Plain Layout
17940 class=`layoutname_label'
17946 \begin_inset Quotes erd
17954 contain any style information.
17956 \begin_inset Flex Code
17959 \begin_layout Plain Layout
17968 \begin_layout Description
17969 \begin_inset Flex Code
17972 \begin_layout Plain Layout
17979 \begin_inset Flex Code
17982 \begin_layout Plain Layout
17992 ] Meaningful only for list-like environments, this tag controls whether
17993 the label tag is output before or inside the item tag.
17994 This is used, for example, in the description environment, where we want
17996 \begin_inset Flex Code
17999 \begin_layout Plain Layout
18000 <dt>\SpecialChar \ldots{}
18001 </dt><dd>\SpecialChar \ldots{}
18009 \begin_inset Flex Code
18012 \begin_layout Plain Layout
18018 : The label tag is output inside the item tag.
18021 \begin_layout Description
18022 \begin_inset Flex Code
18025 \begin_layout Plain Layout
18031 Information to be output in the
18032 \begin_inset Flex Code
18035 \begin_layout Plain Layout
18041 section when this style is used.
18042 This might, for example, be used to include a
18043 \begin_inset Flex Code
18046 \begin_layout Plain Layout
18053 \begin_inset Flex Code
18056 \begin_layout Plain Layout
18065 \begin_layout Description
18066 \begin_inset Flex Code
18069 \begin_layout Plain Layout
18075 CSS style information to be included when this style is used.
18076 Note that this will automatically be wrapped in a layout-generated
18077 \begin_inset Flex Code
18080 \begin_layout Plain Layout
18086 block, so only the CSS itself need be included.
18089 \begin_layout Description
18090 \begin_inset Flex Code
18093 \begin_layout Plain Layout
18100 \begin_inset Flex Code
18103 \begin_layout Plain Layout
18109 ] The tag to be used for the main label, replacing
18110 \begin_inset Flex Code
18113 \begin_layout Plain Layout
18119 in the examples above.
18121 \begin_inset Flex Code
18124 \begin_layout Plain Layout
18133 \begin_layout Description
18134 \begin_inset Flex Code
18137 \begin_layout Plain Layout
18144 \begin_inset Flex Code
18147 \begin_layout Plain Layout
18157 ] Marks this style as the one to be used to generate the
18158 \begin_inset Flex Code
18161 \begin_layout Plain Layout
18167 tag for the XHTML file.
18168 By default, it is false.
18170 \begin_inset Flex Code
18173 \begin_layout Plain Layout
18179 file sets it to true for the
18180 \begin_inset Flex Code
18183 \begin_layout Plain Layout
18193 \begin_layout Subsection
18197 \begin_layout Standard
18198 The XHTML output of insets can also be controlled by information in layout
18203 \begin_layout Plain Layout
18204 At present, this is true only for
18205 \begin_inset Quotes eld
18209 \begin_inset Quotes erd
18212 insets (insets you can type into) and is not true for
18213 \begin_inset Quotes eld
18217 \begin_inset Quotes erd
18220 insets (insets that are associated with dialog boxes).
18225 Here, too, LyX tries to provide sensible defaults, and it constructs default
18227 But everything can be customized.
18230 \begin_layout Standard
18231 The XHTML LyX outputs for an inset has the following form:
18234 \begin_layout LyX-Code
18236 \begin_inset Quotes erd
18240 \begin_inset Quotes erd
18246 \begin_layout LyX-Code
18247 <labeltag>Label</labeltag>
18250 \begin_layout LyX-Code
18252 \begin_inset Quotes erd
18256 \begin_inset Quotes erd
18259 >Contents of the inset.</innertag>
18262 \begin_layout LyX-Code
18266 \begin_layout Standard
18267 If the inset permits multiple paragraphs---that is, if
18268 \begin_inset Flex Code
18271 \begin_layout Plain Layout
18277 is true---then the contents of the inset will itself be output as paragraphs
18278 formatted according to the styles used for those paragraphs (standard,
18279 quote, and the like).
18280 The label tag is of course omitted if the paragraph does not have a label
18281 and, at present, is always
18282 \begin_inset Flex Code
18285 \begin_layout Plain Layout
18292 The inner tag is optional and, by default, does not appear.
18295 \begin_layout Standard
18296 The specific tags and attributes output for each inset can be controlled
18297 by means of the following layout tags.
18300 \begin_layout Description
18301 \begin_inset Flex Code
18304 \begin_layout Plain Layout
18311 \begin_inset Flex Code
18314 \begin_layout Plain Layout
18320 ] Specifies attribute information to be output with the main tag.
18322 \begin_inset Quotes eld
18326 \begin_inset Flex Code
18329 \begin_layout Plain Layout
18330 class=`myinset' onclick=`\SpecialChar \ldots{}
18337 \begin_inset Quotes erd
18341 By default, LyX will output
18342 \begin_inset Quotes eld
18346 \begin_inset Flex Code
18349 \begin_layout Plain Layout
18356 \begin_inset Quotes erd
18360 \begin_inset Flex Code
18363 \begin_layout Plain Layout
18369 is the LyX name of the inset, made lowercase and with non-alphanumeric
18370 characters converted to underscores, for example: footnote.
18373 \begin_layout Description
18374 \begin_inset Flex Code
18377 \begin_layout Plain Layout
18384 \begin_inset Flex Code
18387 \begin_layout Plain Layout
18397 ] Whether to output the default CSS information LyX generates for this layout,
18398 even if additional information is explicitly provided via
18399 \begin_inset Flex Code
18402 \begin_layout Plain Layout
18410 \begin_inset Flex Code
18413 \begin_layout Plain Layout
18419 allows you to alter or augment the generated CSS, rather than to override
18424 \begin_layout Description
18425 \begin_inset Flex Code
18428 \begin_layout Plain Layout
18435 \begin_inset Flex Code
18438 \begin_layout Plain Layout
18444 ] Attributes for the inner tag.
18446 \begin_inset Quotes eld
18450 \begin_inset Flex Code
18453 \begin_layout Plain Layout
18454 class=`insetname_inner'
18460 \begin_inset Quotes erd
18466 \begin_layout Description
18467 \begin_inset Flex Code
18470 \begin_layout Plain Layout
18477 \begin_inset Flex Code
18480 \begin_layout Plain Layout
18486 ] The inner tag, replacing
18487 \begin_inset Flex Code
18490 \begin_layout Plain Layout
18496 in the examples above.
18497 By default, there is none.
18500 \begin_layout Description
18501 \begin_inset Flex Code
18504 \begin_layout Plain Layout
18511 \begin_inset Flex Code
18514 \begin_layout Plain Layout
18522 ] Whether this inset represents a standalone block of text (such as a footnote)
18523 or instead represents material that is included in the surrounding text
18524 (such as a branch).
18528 \begin_layout Description
18529 \begin_inset Flex Code
18532 \begin_layout Plain Layout
18539 \begin_inset Flex Code
18542 \begin_layout Plain Layout
18548 ] A label for this inset, possibly including a reference to a counter.
18549 For example, for footnote, it might be:
18550 \begin_inset Flex Code
18553 \begin_layout Plain Layout
18562 This is optional, and there is no default.
18565 \begin_layout Description
18566 \begin_inset Flex Code
18569 \begin_layout Plain Layout
18575 Information to be output in the
18576 \begin_inset Flex Code
18579 \begin_layout Plain Layout
18585 section when this style is used.
18586 This might, for example, be used to include a
18587 \begin_inset Flex Code
18590 \begin_layout Plain Layout
18597 \begin_inset Flex Code
18600 \begin_layout Plain Layout
18609 \begin_layout Description
18610 \begin_inset Flex Code
18613 \begin_layout Plain Layout
18619 CSS style information to be included when this style is used.
18620 Note that this will automatically be wrapped in a layout-generated
18621 \begin_inset Flex Code
18624 \begin_layout Plain Layout
18630 block, so only the CSS itself need be included.
18633 \begin_layout Description
18634 \begin_inset Flex Code
18637 \begin_layout Plain Layout
18644 \begin_inset Flex Code
18647 \begin_layout Plain Layout
18653 ] The tag to be used for the main label, replacing
18654 \begin_inset Flex Code
18657 \begin_layout Plain Layout
18663 in the examples above.
18664 The default depends upon the setting of
18665 \begin_inset Flex Code
18668 \begin_layout Plain Layout
18675 \begin_inset Flex Code
18678 \begin_layout Plain Layout
18684 is true, the default is
18685 \begin_inset Flex Code
18688 \begin_layout Plain Layout
18694 ; if it is false, the default is
18695 \begin_inset Flex Code
18698 \begin_layout Plain Layout
18707 \begin_layout Subsection
18711 \begin_layout Standard
18712 The XHTML output for floats too can be controlled by layout information.
18713 The output has the following form:
18716 \begin_layout LyX-Code
18718 \begin_inset Quotes erd
18722 \begin_inset Quotes erd
18728 \begin_layout LyX-Code
18729 Contents of the float.
18732 \begin_layout LyX-Code
18736 \begin_layout Standard
18737 The caption, if there is one, is a separate inset and will be output as
18739 Its appearance can be controlled via the InsetLayout for caption insets.
18743 \begin_layout Description
18744 \begin_inset Flex Code
18747 \begin_layout Plain Layout
18754 \begin_inset Flex Code
18757 \begin_layout Plain Layout
18763 ] Specifies attribute information to be output with the main tag.
18765 \begin_inset Quotes eld
18769 \begin_inset Flex Code
18772 \begin_layout Plain Layout
18773 class=`myfloat' onclick=`\SpecialChar \ldots{}
18780 \begin_inset Quotes erd
18784 By default, LyX will output
18785 \begin_inset Quotes eld
18789 \begin_inset Flex Code
18792 \begin_layout Plain Layout
18793 class=`float float-floattype'
18799 \begin_inset Quotes erd
18803 \begin_inset Flex Code
18806 \begin_layout Plain Layout
18812 is LyX's name for this type of float, as determined by the float declaration
18814 \begin_inset CommandInset ref
18816 reference "sub:Floats"
18820 ), though made lowercase and with non-alphanumeric characters converted
18821 to underscores, for example: float-table.
18824 \begin_layout Description
18825 \begin_inset Flex Code
18828 \begin_layout Plain Layout
18834 CSS style information to be included when this float is used.
18835 Note that this will automatically be wrapped in a layout-generated
18836 \begin_inset Flex Code
18839 \begin_layout Plain Layout
18845 block, so only the CSS itself need be included.
18848 \begin_layout Description
18849 \begin_inset Flex Code
18852 \begin_layout Plain Layout
18859 \begin_inset Flex Code
18862 \begin_layout Plain Layout
18868 ] The tag to be used for this float, replacing
18869 \begin_inset Quotes eld
18873 \begin_inset Flex Code
18876 \begin_layout Plain Layout
18883 \begin_inset Quotes erd
18886 in the example above.
18888 \begin_inset Flex Code
18891 \begin_layout Plain Layout
18897 and will rarely need changing.
18900 \begin_layout Subsection
18901 Bibliography formatting
18904 \begin_layout Standard
18905 The bibliography can be formatted using
18906 \begin_inset Flex Code
18909 \begin_layout Plain Layout
18917 \begin_inset CommandInset ref
18919 reference "sub:Citation-format-description"
18926 \begin_layout Subsection
18930 \begin_layout Standard
18931 We have several times mentioned that LyX will generate default CSS style
18932 rules for both insets and paragraph styles, based upon the other layout
18933 information that is provided.
18934 In this section, we shall say a word about which layout information LyX
18938 \begin_layout Standard
18939 At present, LyX auto-generates CSS only for font information, making use
18941 \begin_inset Flex Code
18944 \begin_layout Plain Layout
18951 \begin_inset Flex Code
18954 \begin_layout Plain Layout
18961 \begin_inset Flex Code
18964 \begin_layout Plain Layout
18971 \begin_inset Flex Code
18974 \begin_layout Plain Layout
18981 \begin_inset Flex Code
18984 \begin_layout Plain Layout
18992 \begin_inset CommandInset ref
18994 reference "sub:Font-description"
18998 .) The translation is mostly straightforward and obvious.
19000 \begin_inset Quotes eld
19004 \begin_inset Flex Code
19007 \begin_layout Plain Layout
19014 \begin_inset Quotes erd
19018 \begin_inset Quotes eld
19022 \begin_inset Flex Code
19025 \begin_layout Plain Layout
19026 font-family: sans-serif;
19032 \begin_inset Quotes erd
19036 The correspondence of LyX sizes and CSS sizes is a little less obvious
19037 but nonetheless intuitive.
19039 \begin_inset Flex Code
19042 \begin_layout Plain Layout
19049 \begin_inset Flex URL
19052 \begin_layout Plain Layout
19062 \begin_layout Chapter
19063 Including External Material
19066 \begin_layout Standard
19067 \begin_inset Box Shadowbox
19077 height_special "totalheight"
19080 \begin_layout Plain Layout
19081 WARNING: This portion of the documentation has not been updated for some
19083 We certainly hope that it is still accurate, but there are no guarantees.
19091 \begin_layout Standard
19092 The use of material from sources external to LyX is covered in detail in
19098 This part of the manual covers what needs to happen behind the scenes for
19099 new sorts of material to be included.
19102 \begin_layout Section
19106 \begin_layout Standard
19107 The external material feature is based on the concept of a
19112 A template is a specification of how LyX should interface with a certain
19114 As bundled, LyX comes with predefined templates for Xfig figures, various
19115 raster format images, chess diagrams, and LilyPond music notation.
19116 You can check the actual list by using the menu
19117 \begin_inset Flex MenuItem
19120 \begin_layout Plain Layout
19121 Insert\SpecialChar \menuseparator
19122 File\SpecialChar \menuseparator
19129 Furthermore, it is possible to roll your own template to support a specific
19131 Later we'll describe in more detail what is involved, and hopefully you
19132 will submit all the templates you create so we can include them in a later
19136 \begin_layout Standard
19137 Another basic idea of the external material feature is to distinguish between
19138 the original file that serves as a base for final material and the produced
19139 file that is included in your exported or printed document.
19140 For example, consider the case of a figure produced with
19141 \begin_inset Flex Code
19144 \begin_layout Plain Layout
19151 The Xfig application itself works on an original file with the
19152 \begin_inset Flex Code
19155 \begin_layout Plain Layout
19162 Within Xfig, you create and change your figure, and when you are done,
19164 \begin_inset Flex Code
19167 \begin_layout Plain Layout
19174 When you want to include the figure in your document, you invoke
19175 \begin_inset Flex Code
19178 \begin_layout Plain Layout
19184 in order to create a PostScript file that can readily be included in your
19187 \begin_inset Flex Code
19190 \begin_layout Plain Layout
19196 file is the original file, and the PostScript file is the produced file.
19199 \begin_layout Standard
19200 This distinction is important in order to allow updating of the material
19201 while you are in the process of writing the document.
19202 Furthermore, it provides us with the flexibility that is needed to support
19203 multiple export formats.
19204 For instance, in the case of a plain text file, it is not exactly an award-winn
19205 ing idea to include the figure as raw PostScript.
19206 Instead, you would either prefer to just include a reference to the figure
19207 or try to invoke some graphics to ASCII converter to make the final result
19208 look similar to the real graphics.
19209 The external material management allows you to do this, because it is parametri
19210 zed on the different export formats that LyX supports.
19213 \begin_layout Standard
19214 Besides supporting the production of different products according to the
19215 exported format, it supports tight integration with editing and viewing
19217 In the case of an Xfig figure, you are able to invoke Xfig on the original
19218 file with a single click from within the external material dialog in LyX,
19219 and also preview the produced PostScript file with Ghostview with another
19221 No more fiddling around with the command line and/or file browsers to locate
19222 and manipulate the original or produced files.
19223 In this way, you are finally able to take full advantage of the many different
19224 applications that are relevant to use when you write your documents, and
19225 ultimately be more productive.
19228 \begin_layout Section
19229 The external template configuration file
19232 \begin_layout Standard
19233 It is relatively easy to add custom external template definitions to LyX.
19234 However, be aware that doing this in an careless manner most probably
19238 introduce an easily exploitable security hole.
19239 So before you do this, please read the discussion about security in section
19241 \begin_inset CommandInset ref
19243 reference "sec:Security-discussion"
19250 \begin_layout Standard
19251 Having said that, we encourage you to submit any interesting templates that
19256 \begin_layout Standard
19257 The external templates are defined in the
19258 \begin_inset Flex Code
19261 \begin_layout Plain Layout
19262 LyXDir/lib/external_templates
19268 You can place your own version in
19269 \begin_inset Flex Code
19272 \begin_layout Plain Layout
19273 UserDir/external_templates
19281 \begin_layout Standard
19282 A typical template looks like this:
19285 \begin_layout LyX-Code
19289 \begin_layout LyX-Code
19290 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
19293 \begin_layout LyX-Code
19297 \begin_layout LyX-Code
19301 \begin_layout LyX-Code
19305 \begin_layout LyX-Code
19309 \begin_layout LyX-Code
19313 \begin_layout LyX-Code
19314 AutomaticProduction true
19317 \begin_layout LyX-Code
19321 \begin_layout LyX-Code
19325 \begin_layout LyX-Code
19329 \begin_layout LyX-Code
19330 TransformCommand Rotate RotationLatexCommand
19333 \begin_layout LyX-Code
19334 TransformCommand Resize ResizeLatexCommand
19337 \begin_layout LyX-Code
19338 Product "$$RotateFront$$ResizeFront
19341 \begin_layout LyX-Code
19346 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
19349 \begin_layout LyX-Code
19350 $$ResizeBack$$RotateBack"
19353 \begin_layout LyX-Code
19357 \begin_layout LyX-Code
19358 UpdateResult "$$AbsPath$$Basename.pstex_t"
19361 \begin_layout LyX-Code
19362 Requirement "graphicx"
19365 \begin_layout LyX-Code
19366 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19369 \begin_layout LyX-Code
19370 ReferencedFile latex "$$AbsPath$$Basename.eps"
19373 \begin_layout LyX-Code
19374 ReferencedFile dvi "$$AbsPath$$Basename.eps"
19377 \begin_layout LyX-Code
19381 \begin_layout LyX-Code
19385 \begin_layout LyX-Code
19386 TransformCommand Rotate RotationLatexCommand
19389 \begin_layout LyX-Code
19390 TransformCommand Resize ResizeLatexCommand
19393 \begin_layout LyX-Code
19394 Product "$$RotateFront$$ResizeFront
19397 \begin_layout LyX-Code
19402 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
19405 \begin_layout LyX-Code
19406 $$ResizeBack$$RotateBack"
19409 \begin_layout LyX-Code
19410 UpdateFormat pdftex
19413 \begin_layout LyX-Code
19414 UpdateResult "$$AbsPath$$Basename.pdftex_t"
19417 \begin_layout LyX-Code
19418 Requirement "graphicx"
19421 \begin_layout LyX-Code
19422 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
19425 \begin_layout LyX-Code
19426 ReferencedFile latex "$$AbsPath$$Basename.pdf"
19429 \begin_layout LyX-Code
19433 \begin_layout LyX-Code
19437 \begin_layout LyX-Code
19438 Product "$$Contents(
19440 "$$AbsPath$$Basename.asc
19445 \begin_layout LyX-Code
19446 UpdateFormat asciixfig
19449 \begin_layout LyX-Code
19450 UpdateResult "$$AbsPath$$Basename.asc"
19453 \begin_layout LyX-Code
19457 \begin_layout LyX-Code
19461 \begin_layout LyX-Code
19462 Product "<graphic fileref=
19464 "$$AbsOrRelPathMaster$$Basename.eps
19469 \begin_layout LyX-Code
19473 \begin_layout LyX-Code
19477 \begin_layout LyX-Code
19478 UpdateResult "$$AbsPath$$Basename.eps"
19481 \begin_layout LyX-Code
19482 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19485 \begin_layout LyX-Code
19486 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19489 \begin_layout LyX-Code
19493 \begin_layout LyX-Code
19494 Product "[XFig: $$FName]"
19497 \begin_layout LyX-Code
19501 \begin_layout LyX-Code
19505 \begin_layout Standard
19506 As you can see, the template is enclosed in
19507 \begin_inset Flex Code
19510 \begin_layout Plain Layout
19516 \SpecialChar \ldots{}
19518 \begin_inset Flex Code
19521 \begin_layout Plain Layout
19528 It contains a header specifying some general settings and, for each supported
19529 primary document file format, a section
19530 \begin_inset Flex Code
19533 \begin_layout Plain Layout
19539 \SpecialChar \ldots{}
19541 \begin_inset Flex Code
19544 \begin_layout Plain Layout
19553 \begin_layout Subsection
19554 The template header
19557 \begin_layout Description
19558 \begin_inset Flex Code
19561 \begin_layout Plain Layout
19562 AutomaticProduction
19563 \begin_inset space ~
19571 Whether the file represented by the template must be generated by LyX.
19572 This command must occur exactly once.
19575 \begin_layout Description
19576 \begin_inset Flex Code
19579 \begin_layout Plain Layout
19581 \begin_inset space ~
19589 A glob pattern that is used in the file dialog to filter out the desired
19591 If there is more than one possible file extension (e.
19592 \begin_inset space \thinspace{}
19596 \begin_inset space \space{}
19600 \begin_inset Flex Code
19603 \begin_layout Plain Layout
19610 \begin_inset Flex Code
19613 \begin_layout Plain Layout
19619 ), use something like
19620 \begin_inset Flex Code
19623 \begin_layout Plain Layout
19630 This command must occur exactly once.
19633 \begin_layout Description
19634 \begin_inset Flex Code
19637 \begin_layout Plain Layout
19639 \begin_inset space ~
19647 The text that is displayed on the button.
19648 This command must occur exactly once.
19651 \begin_layout Description
19652 \begin_inset Flex Code
19655 \begin_layout Plain Layout
19657 \begin_inset space ~
19661 \begin_inset space ~
19669 The help text that is used in the External dialog.
19670 Provide enough information to explain to the user just what the template
19671 can provide him with.
19672 This command must occur exactly once.
19675 \begin_layout Description
19676 \begin_inset Flex Code
19679 \begin_layout Plain Layout
19681 \begin_inset space ~
19689 The file format of the original file.
19690 This must be the name of a format that is known to LyX (see section
19691 \begin_inset space ~
19695 \begin_inset CommandInset ref
19697 reference "sec:Formats"
19703 \begin_inset Quotes eld
19707 \begin_inset Flex Code
19710 \begin_layout Plain Layout
19717 \begin_inset Quotes erd
19720 if the template can handle original files of more than one format.
19721 LyX will attempt to interrogate the file itself in order to deduce its
19722 format in this case.
19723 This command must occur exactly once.
19726 \begin_layout Description
19727 \begin_inset Flex Code
19730 \begin_layout Plain Layout
19732 \begin_inset space ~
19740 A unique name for the template.
19741 It must not contain substitution macros (see below).
19744 \begin_layout Description
19745 \begin_inset Flex Code
19748 \begin_layout Plain Layout
19750 \begin_inset space ~
19753 Rotate|Resize|Clip|Extra
19758 This command specifies which transformations are supported by this template.
19759 It may occur zero or more times.
19760 This command enables the corresponding tabs in the external dialog.
19762 \begin_inset Flex Code
19765 \begin_layout Plain Layout
19771 command must have either a corresponding
19772 \begin_inset Flex Code
19775 \begin_layout Plain Layout
19782 \begin_inset Flex Code
19785 \begin_layout Plain Layout
19792 \begin_inset Flex Code
19795 \begin_layout Plain Layout
19802 Otherwise the transformation will not be supported by that format.
19805 \begin_layout Subsection
19809 \begin_layout Description
19810 \begin_inset Flex Code
19813 \begin_layout Plain Layout
19815 \begin_inset space ~
19818 LaTeX|PDFLaTeX|PlainText|DocBook
19823 The primary document file format that this format definition is for.
19824 Not every template has a sensible representation in all document file formats.
19825 Please define nevertheless a
19826 \begin_inset Flex Code
19829 \begin_layout Plain Layout
19835 section for all templates.
19836 Use a dummy text when no representation is available.
19837 Then you can at least see a reference to the external material in the exported
19841 \begin_layout Description
19842 \begin_inset Flex Code
19845 \begin_layout Plain Layout
19847 \begin_inset space ~
19851 \begin_inset space ~
19859 This command defines an additional macro
19860 \begin_inset Flex Code
19863 \begin_layout Plain Layout
19869 for substitution in
19870 \begin_inset Flex Code
19873 \begin_layout Plain Layout
19881 \begin_inset Flex Code
19884 \begin_layout Plain Layout
19890 itself may contain substitution macros.
19891 The advantage over using
19892 \begin_inset Flex Code
19895 \begin_layout Plain Layout
19902 \begin_inset Flex Code
19905 \begin_layout Plain Layout
19911 is that the substituted value of
19912 \begin_inset Flex Code
19915 \begin_layout Plain Layout
19921 is sanitized so that it is a valid optional argument in the document format.
19922 This command may occur zero or more times.
19925 \begin_layout Description
19926 \begin_inset Flex Code
19929 \begin_layout Plain Layout
19931 \begin_inset space ~
19939 The text that is inserted in the exported document.
19940 This is actually the most important command and can be quite complex.
19941 This command must occur exactly once.
19944 \begin_layout Description
19945 \begin_inset Flex Code
19948 \begin_layout Plain Layout
19950 \begin_inset space ~
19958 This command specifies a preamble snippet that will be included in the
19960 It has to be defined using
19961 \begin_inset Flex Code
19964 \begin_layout Plain Layout
19970 \SpecialChar \ldots{}
19972 \begin_inset Flex Code
19975 \begin_layout Plain Layout
19982 This command may occur zero or more times.
19985 \begin_layout Description
19986 \begin_inset Flex Code
19989 \begin_layout Plain Layout
19991 \begin_inset space ~
19995 \begin_inset space ~
20003 This command denotes files that are created by the conversion process and
20004 are needed for a particular export format.
20005 If the filename is relative, it is interpreted relative to the master document.
20006 This command may be given zero or more times.
20009 \begin_layout Description
20010 \begin_inset Flex Code
20013 \begin_layout Plain Layout
20015 \begin_inset space ~
20023 The name of a required LaTeX package.
20024 The package is included via
20025 \begin_inset Flex Code
20028 \begin_layout Plain Layout
20036 in the LaTeX preamble.
20037 This command may occur zero or more times.
20040 \begin_layout Description
20041 \begin_inset Flex Code
20044 \begin_layout Plain Layout
20046 \begin_inset space ~
20050 \begin_inset space ~
20053 RotationLatexCommand
20058 This command specifies that the built in LaTeX command should be used for
20060 This command may occur once or not at all.
20063 \begin_layout Description
20064 \begin_inset Flex Code
20067 \begin_layout Plain Layout
20069 \begin_inset space ~
20073 \begin_inset space ~
20081 This command specifies that the built in LaTeX command should be used for
20083 This command may occur once or not at all.
20086 \begin_layout Description
20087 \begin_inset Flex Code
20090 \begin_layout Plain Layout
20092 \begin_inset space ~
20096 \begin_inset space ~
20099 RotationLatexOption
20104 This command specifies that rotation is done via an optional argument.
20105 This command may occur once or not at all.
20108 \begin_layout Description
20109 \begin_inset Flex Code
20112 \begin_layout Plain Layout
20114 \begin_inset space ~
20118 \begin_inset space ~
20126 This command specifies that resizing is done via an optional argument.
20127 This command may occur once or not at all.
20130 \begin_layout Description
20131 \begin_inset Flex Code
20134 \begin_layout Plain Layout
20136 \begin_inset space ~
20140 \begin_inset space ~
20148 This command specifies that clipping is done via an optional argument.
20149 This command may occur once or not at all.
20152 \begin_layout Description
20153 \begin_inset Flex Code
20156 \begin_layout Plain Layout
20158 \begin_inset space ~
20162 \begin_inset space ~
20170 This command specifies that an extra optional argument is used.
20171 This command may occur once or not at all.
20174 \begin_layout Description
20175 \begin_inset Flex Code
20178 \begin_layout Plain Layout
20180 \begin_inset space ~
20188 The file format of the converted file.
20189 This must be the name of a format that is known to LyX (see the
20190 \begin_inset Flex MenuItem
20193 \begin_layout Plain Layout
20198 ools\SpecialChar \menuseparator
20203 references\SpecialChar \menuseparator
20204 File Handling\SpecialChar \menuseparator
20211 This command must occur exactly once.
20214 \begin_layout Description
20215 \begin_inset Flex Code
20218 \begin_layout Plain Layout
20220 \begin_inset space ~
20228 The file name of the converted file.
20229 The file name must be absolute.
20230 This command must occur exactly once.
20233 \begin_layout Subsection
20234 Preamble definitions
20237 \begin_layout Standard
20238 The external template configuration file may contain additional preamble
20239 definitions enclosed by
20240 \begin_inset Flex Code
20243 \begin_layout Plain Layout
20249 \SpecialChar \ldots{}
20251 \begin_inset Flex Code
20254 \begin_layout Plain Layout
20261 They can be used by the templates in the
20262 \begin_inset Flex Code
20265 \begin_layout Plain Layout
20274 \begin_layout Section
20275 The substitution mechanism
20278 \begin_layout Standard
20279 When the external material facility invokes an external program, it is done
20280 on the basis of a command defined in the template configuration file.
20281 These commands can contain various macros that are expanded before execution.
20282 Execution always take place in the directory of the containing document.
20285 \begin_layout Standard
20286 Also, whenever external material is to be displayed, the name will be produced
20287 by the substitution mechanism, and most other commands in the template
20288 definition support substitution as well.
20291 \begin_layout Standard
20292 The available macros are the following:
20295 \begin_layout Description
20296 \begin_inset Flex Code
20299 \begin_layout Plain Layout
20300 $$AbsOrRelPathMaster
20305 The file path, absolute or relative to the master LyX document.
20308 \begin_layout Description
20309 \begin_inset Flex Code
20312 \begin_layout Plain Layout
20313 $$AbsOrRelPathParent
20318 The file path, absolute or relative to the LyX document.
20321 \begin_layout Description
20322 \begin_inset Flex Code
20325 \begin_layout Plain Layout
20331 The absolute file path.
20334 \begin_layout Description
20335 \begin_inset Flex Code
20338 \begin_layout Plain Layout
20344 The filename without path and without the extension.
20347 \begin_layout Description
20348 \begin_inset Flex Code
20351 \begin_layout Plain Layout
20353 \begin_inset Quotes eld
20357 \begin_inset Quotes erd
20365 This macro will expand to the contents of the file with the name
20366 \begin_inset Flex Code
20369 \begin_layout Plain Layout
20378 \begin_layout Description
20379 \begin_inset Flex Code
20382 \begin_layout Plain Layout
20388 The file extension (including the dot).
20391 \begin_layout Description
20392 \begin_inset Flex Code
20395 \begin_layout Plain Layout
20401 The filename of the file specified in the external material dialog.
20402 This is either an absolute name, or it is relative to the LyX document.
20405 \begin_layout Description
20406 \begin_inset Flex Code
20409 \begin_layout Plain Layout
20416 \begin_inset Flex Code
20419 \begin_layout Plain Layout
20425 (absolute name or relative to the LyX document).
20428 \begin_layout Description
20429 \begin_inset Flex Code
20432 \begin_layout Plain Layout
20438 The file path, relative to the master LyX document.
20441 \begin_layout Description
20442 \begin_inset Flex Code
20445 \begin_layout Plain Layout
20451 The file path, relative to the LyX document.
20454 \begin_layout Description
20455 \begin_inset Flex Code
20458 \begin_layout Plain Layout
20464 This macro will expand to the absolute path of the system directory.
20465 This is typically used to point to the various helper scripts that are
20469 \begin_layout Description
20470 \begin_inset Flex Code
20473 \begin_layout Plain Layout
20479 A name and full path to a temporary file which will be automatically deleted
20480 whenever the containing document is closed, or the external material insertion
20484 \begin_layout Standard
20485 All path macros contain a trailing directory separator, so you can construct
20487 \begin_inset space \thinspace{}
20491 \begin_inset space \space{}
20494 the absolute filename with
20495 \begin_inset Flex Code
20498 \begin_layout Plain Layout
20499 $$AbsPath$$Basename$$Extension
20507 \begin_layout Standard
20508 The macros above are substituted in all commands unless otherwise noted.
20510 \begin_inset Flex Code
20513 \begin_layout Plain Layout
20519 supports additionally the following substitutions if they are enabled by
20521 \begin_inset Flex Code
20524 \begin_layout Plain Layout
20531 \begin_inset Flex Code
20534 \begin_layout Plain Layout
20543 \begin_layout Description
20544 \begin_inset Flex Code
20547 \begin_layout Plain Layout
20553 The front part of the resize command.
20556 \begin_layout Description
20557 \begin_inset Flex Code
20560 \begin_layout Plain Layout
20566 The back part of the resize command.
20569 \begin_layout Description
20570 \begin_inset Flex Code
20573 \begin_layout Plain Layout
20579 The front part of the rotation command.
20582 \begin_layout Description
20583 \begin_inset Flex Code
20586 \begin_layout Plain Layout
20592 The back part of the rotation command.
20595 \begin_layout Standard
20596 The value string of the
20597 \begin_inset Flex Code
20600 \begin_layout Plain Layout
20606 command supports additionally the following substitutions if they are enabled
20608 \begin_inset Flex Code
20611 \begin_layout Plain Layout
20618 \begin_inset Flex Code
20621 \begin_layout Plain Layout
20630 \begin_layout Description
20631 \begin_inset Flex Code
20634 \begin_layout Plain Layout
20643 \begin_layout Description
20644 \begin_inset Flex Code
20647 \begin_layout Plain Layout
20656 \begin_layout Description
20657 \begin_inset Flex Code
20660 \begin_layout Plain Layout
20669 \begin_layout Description
20670 \begin_inset Flex Code
20673 \begin_layout Plain Layout
20679 The rotation option.
20682 \begin_layout Standard
20683 You may ask why there are so many path macros.
20684 There are mainly two reasons:
20687 \begin_layout Enumerate
20688 Relative and absolute file names should remain relative or absolute, respectivel
20690 Users may have reasons to prefer either form.
20691 Relative names are useful for portable documents that should work on different
20692 machines, for example.
20693 Absolute names may be required by some programs.
20696 \begin_layout Enumerate
20697 LaTeX treats relative file names differently than LyX and other programs
20698 in nested included files.
20699 For LyX, a relative file name is always relative to the document that contains
20701 For LaTeX, it is always relative to the master document.
20702 These two definitions are identical if you have only one document, but
20703 differ if you have a master document that includes part documents.
20704 That means that relative filenames must be transformed when presented to
20706 Fortunately LyX does this automatically for you if you choose the right
20710 \begin_layout Standard
20711 So which path macro should be used in new template definitions? The rule
20715 \begin_layout Itemize
20717 \begin_inset Flex Code
20720 \begin_layout Plain Layout
20726 if an absolute path is required.
20729 \begin_layout Itemize
20731 \begin_inset Flex Code
20734 \begin_layout Plain Layout
20735 $$AbsOrRelPathMaster
20740 if the substituted string is some kind of LaTeX input.
20743 \begin_layout Itemize
20745 \begin_inset Flex Code
20748 \begin_layout Plain Layout
20749 $$AbsOrRelPathParent
20754 in order to preserve the user's choice.
20757 \begin_layout Standard
20758 There are special cases where this rule does not work and e.
20759 \begin_inset space \thinspace{}
20763 \begin_inset space \space{}
20766 relative names are needed, but normally it will work just fine.
20767 One example for such a case is the command
20768 \begin_inset Flex Code
20771 \begin_layout Plain Layout
20772 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20777 in the XFig template above: We can't use the absolute name because the
20779 \begin_inset Flex Code
20782 \begin_layout Plain Layout
20788 files needs the relative name in order to rewrite the file content.
20791 \begin_layout Section
20792 Security discussion
20793 \begin_inset CommandInset label
20795 name "sec:Security-discussion"
20802 \begin_layout Standard
20803 The external material feature interfaces with a lot of external programs
20804 and does so automatically, so we have to consider the security implications
20806 In particular, since you have the option of including your own filenames
20807 and/or parameter strings and those are expanded into a command, it seems
20808 that it would be possible to create a malicious document which executes
20809 arbitrary commands when a user views or prints the document.
20810 This is something we definitely want to avoid.
20813 \begin_layout Standard
20814 However, since the external program commands are specified in the template
20815 configuration file only, there are no security issues if LyX is properly
20816 configured with safe templates only.
20817 This is so because the external programs are invoked with the
20818 \begin_inset Flex Code
20821 \begin_layout Plain Layout
20827 -system call rather than the
20828 \begin_inset Flex Code
20831 \begin_layout Plain Layout
20837 system-call, so it's not possible to execute arbitrary commands from the
20838 filename or parameter section via the shell.
20841 \begin_layout Standard
20842 This also implies that you are restricted in what command strings you can
20843 use in the external material templates.
20844 In particular, pipes and redirection are not readily available.
20845 This has to be so if LyX should remain safe.
20846 If you want to use some of the shell features, you should write a safe
20847 script to do this in a controlled manner, and then invoke the script from
20848 the command string.
20852 \begin_layout Standard
20853 It is possible to design a template that interacts directly with the shell,
20854 but since this would allow a malicious user to execute arbitrary commands
20855 by writing clever filenames and/or parameters, we generally recommend that
20856 you only use safe scripts that work with the
20857 \begin_inset Flex Code
20860 \begin_layout Plain Layout
20866 system call in a controlled manner.
20867 Of course, for use in a controlled environment, it can be tempting to just
20868 fall back to use ordinary shell scripts.
20869 If you do so, be aware that you
20873 provide an easily exploitable security hole in your system.
20874 Of course it stands to reason that such unsafe templates will never be
20875 included in the standard LyX distribution, although we do encourage people
20876 to submit new templates in the open source tradition.
20877 But LyX as shipped from the official distribution channels will never have
20881 \begin_layout Standard
20882 Including external material provides a lot of power, and you have to be
20883 careful not to introduce security hazards with this power.
20884 A subtle error in a single line in an innocent looking script can open
20885 the door to huge security problems.
20886 So if you do not fully understand the issues, we recommend that you consult
20887 a knowledgeable security professional or the LyX development team if you
20888 have any questions about whether a given template is safe or not.
20889 And do this before you use it in an uncontrolled environment.