1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
35 \use_default_options false
39 \maintain_unincluded_children false
42 InsetLayout Flex:MenuItem
51 \newcommand*{\menuitem}[1]{{\sffamily #1}}
54 # In case we need to do with sans...
55 #InsetLayout CharStyle:Code
60 #\renewcommand{\code}[1]{{\sffamily #1}}
65 \language_package default
70 \font_typewriter default
71 \font_default_family default
72 \use_non_tex_fonts false
79 \default_output_format default
81 \bibtex_command default
82 \index_command default
86 \pdf_title "LyX Configuration Manual"
87 \pdf_author "LyX Team"
88 \pdf_subject "LyX-documentation Customization"
89 \pdf_keywords "LyX, documentation, customization"
91 \pdf_bookmarksnumbered true
92 \pdf_bookmarksopen true
93 \pdf_bookmarksopenlevel 1
98 \pdf_pdfusetitle false
99 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
109 \paperorientation portrait
123 \paragraph_separation indent
124 \paragraph_indentation default
125 \quotes_language english
128 \paperpagestyle headings
129 \tracking_changes false
130 \output_changes false
139 Customizing LyX: Features for the Advanced User
147 \begin_layout Plain Layout
149 If you have comments or error corrections, please send them to the LyX Documenta
151 \begin_inset CommandInset href
153 target "lyx-docs@lists.lyx.org"
160 \begin_inset Quotes eld
164 \begin_inset Quotes erd
167 in the subject header, and please cc the current maintainer of this file,
168 Richard Heck <rgheck@comcast.net>.
174 \begin_inset Newline newline
178 \begin_inset Newline newline
184 \begin_layout Standard
185 \begin_inset CommandInset toc
186 LatexCommand tableofcontents
193 \begin_layout Standard
194 \begin_inset Note Note
197 \begin_layout Plain Layout
198 Please use change tracking when modifying this document.
199 This makes it easier for our translators to recognize things that have
200 been changed, and it helps the maintainer keep up-to-date with what's been
209 \begin_layout Chapter
213 \begin_layout Standard
214 This manual covers the customization features present in LyX.
215 In it, we discuss issues like keyboard shortcuts, screen previewing options,
216 printer options, sending commands to LyX via the LyX Server, internationalizati
217 on, installing new LaTeX classes and LyX layouts, etc.
218 We can't possibly hope to touch on everything you can change—our developers
219 add new features faster than we can document them—but we will explain the
220 most common customizations and hopefully point you in the right direction
221 for some of the more obscure ones.
224 \begin_layout Standard
225 \begin_inset Branch OutDated
228 \begin_layout Standard
229 Information from previous versions of this document that now seems to be
230 outdated is contained in the OutDated branch of this document.
231 By default, this information will not appear in the LaTeX output.
239 \begin_layout Chapter
240 LyX configuration files
243 \begin_layout Standard
244 This chapter aims to help you to find your way through the LyX configuration
246 Before continuing to read this chapter, you should find out where your
247 LyX library and user directories are by using
248 \begin_inset Flex MenuItem
251 \begin_layout Plain Layout
252 Help\SpecialChar \menuseparator
263 The library directory is the place where LyX places its system-wide configurati
264 on files; the user directory is where you can place your modified versions.
265 We will call the former
266 \begin_inset Flex Code
269 \begin_layout Plain Layout
276 \begin_inset Flex MenuItem
279 \begin_layout Plain Layout
285 in the remainder of this document.
289 \begin_layout Section
291 \begin_inset Flex Code
294 \begin_layout Plain Layout
303 \begin_layout Standard
304 \begin_inset Flex Code
307 \begin_layout Plain Layout
313 and its sub-directories contain a number of files and that can be used
314 to customize LyX's behavior.
315 You can change many of these files from within LyX itself through the
316 \begin_inset Flex MenuItem
319 \begin_layout Plain Layout
320 Tools\SpecialChar \menuseparator
327 Most customization that you will want to do in LyX is possible through
329 However, many other inner aspects of LyX can be customized by modifying
331 \begin_inset Flex Code
334 \begin_layout Plain Layout
341 These files fall in different categories, described in the following subsection
345 \begin_layout Subsection
346 Automatically generated files
349 \begin_layout Standard
350 The files, which are to be found in
351 \begin_inset Flex MenuItem
354 \begin_layout Plain Layout
360 , are generated when you configure LyX.
361 They contain various default values that are guessed by inspection.
362 In general, it is not a good idea to modify them, since they might be overwritt
366 \begin_layout Labeling
367 \labelwidthstring 00.00.0000
368 \begin_inset Flex Code
371 \begin_layout Plain Layout
377 contains defaults for various commands.
380 \begin_layout Labeling
381 \labelwidthstring 00.00.0000
382 \begin_inset Flex Code
385 \begin_layout Plain Layout
391 contains the list of packages that have been recognized by LyX.
392 It is currently unused by the LyX program itself, but the information extracted
393 , and more, is made available with
394 \begin_inset Flex MenuItem
397 \begin_layout Plain Layout
398 Help\SpecialChar \menuseparator
411 \begin_layout Labeling
412 \labelwidthstring 00.00.0000
413 \begin_inset Flex Code
416 \begin_layout Plain Layout
422 the list of text classes that have been found in your
423 \begin_inset Flex Code
426 \begin_layout Plain Layout
432 directories, along with the associated LaTeX document class and their descripti
436 \begin_layout Labeling
437 \labelwidthstring 00.00.0000
438 \begin_inset Flex Code
441 \begin_layout Plain Layout
447 the list of layout modules found in your
448 \begin_inset Flex Code
451 \begin_layout Plain Layout
460 \begin_layout Labeling
461 \labelwidthstring 00.00.0000
462 \begin_inset Flex Code
465 \begin_layout Plain Layout
471 lists of various sorts of LaTeX-related files found on your system
474 \begin_layout Labeling
475 \labelwidthstring 00.00.0000
476 \begin_inset Flex Code
479 \begin_layout Plain Layout
485 is automatically generated during configuration from the file
486 \begin_inset Flex Code
489 \begin_layout Plain Layout
496 It contains information on your LaTeX configuration.
499 \begin_layout Subsection
503 \begin_layout Standard
504 These directories are duplicated between
505 \begin_inset Flex Code
508 \begin_layout Plain Layout
515 \begin_inset Flex Code
518 \begin_layout Plain Layout
525 If a particular files exists in both places, the one in
526 \begin_inset Flex Code
529 \begin_layout Plain Layout
538 \begin_layout Labeling
539 \labelwidthstring 00.00.0000
540 \begin_inset Flex Code
543 \begin_layout Plain Layout
549 this directory contains files with the extension
550 \begin_inset Flex Code
553 \begin_layout Plain Layout
559 that define the keybindings used in LyX.
560 If there exists an internationalized version of the bind file named
561 \begin_inset Flex Code
564 \begin_layout Plain Layout
570 , that will be used first.
573 \begin_layout Labeling
574 \labelwidthstring 00.00.0000
575 \begin_inset Flex Code
578 \begin_layout Plain Layout
584 contains graphics files that can be included in documents.
588 \begin_layout Labeling
589 \labelwidthstring 00.00.0000
590 \begin_inset Flex Code
593 \begin_layout Plain Layout
599 contains LyX documentation files (including the one you are currently reading).
601 \begin_inset Flex Code
604 \begin_layout Plain Layout
610 deserves special attention, as noted above.
611 The internationalized help docs are in subdirectories
612 \begin_inset Flex Code
615 \begin_layout Plain Layout
622 \begin_inset Quotes eld
626 \begin_inset Quotes erd
629 is the ISO language code.
635 \begin_inset CommandInset ref
637 reference "cha:Internationalizing-LyX"
644 \begin_layout Labeling
645 \labelwidthstring 00.00.0000
646 \begin_inset Flex Code
649 \begin_layout Plain Layout
655 contains example files that explain how to use some features.
656 In the file browser, press the
657 \begin_inset Flex MenuItem
660 \begin_layout Plain Layout
669 \begin_layout Labeling
670 \labelwidthstring 00.00.0000
671 \begin_inset Flex Code
674 \begin_layout Plain Layout
680 contains image files that are used by the
681 \begin_inset Flex MenuItem
684 \begin_layout Plain Layout
691 In addition, it also contains the individual icons used in the toolbar
692 and the banners that can be shown when LyX is launched.
695 \begin_layout Labeling
696 \labelwidthstring 00.00.0000
697 \begin_inset Flex Code
700 \begin_layout Plain Layout
706 contains keyboard keymapping files.
712 \begin_inset CommandInset ref
714 reference "sec:International-Keymap-Stuff"
721 \begin_layout Labeling
722 \labelwidthstring 00.00.0000
723 \begin_inset Flex Code
726 \begin_layout Plain Layout
732 contains the text class and module files described in Chapter
737 \begin_inset CommandInset ref
739 reference "cha:Installing-New-Document"
746 \begin_layout Labeling
747 \labelwidthstring 00.00.0000
748 \begin_inset Flex Code
751 \begin_layout Plain Layout
758 \begin_inset Flex Code
761 \begin_layout Plain Layout
767 Python scripts used to convert between LyX versions.
768 These can be run from the command line if, say, you want to batch-convert
772 \begin_layout Labeling
773 \labelwidthstring 00.00.0000
774 \begin_inset Flex Code
777 \begin_layout Plain Layout
783 contains some files that demonstrate the capabilities of the
784 \begin_inset Flex MenuItem
787 \begin_layout Plain Layout
798 Also contains some scripts used by LyX itself.
801 \begin_layout Labeling
802 \labelwidthstring 00.00.0000
803 \begin_inset Flex Code
806 \begin_layout Plain Layout
812 contains the standard LyX template files described in Chapter
817 \begin_inset CommandInset ref
819 reference "sub:Creating-Templates"
826 \begin_layout Labeling
827 \labelwidthstring 00.00.0000
828 \begin_inset Flex Code
831 \begin_layout Plain Layout
837 contains files with the extension
838 \begin_inset Flex Code
841 \begin_layout Plain Layout
847 that define the user interface to LyX.
848 That is, the files define which items appear in which menus and the items
849 appearing on the toolbar.
852 \begin_layout Subsection
853 Files you don't want to modify
856 \begin_layout Standard
857 These files are used internally by LyX and you generally do not need to
858 modify them unless you are a developer.
861 \begin_layout Labeling
862 \labelwidthstring 00.00.0000
863 \begin_inset Flex Code
866 \begin_layout Plain Layout
872 this file contains the list of LyX developers.
873 The contents are displayed with the menu entry
874 \begin_inset Flex MenuItem
877 \begin_layout Plain Layout
878 Help\SpecialChar \menuseparator
891 \begin_layout Labeling
892 \labelwidthstring 00.00.0000
893 \begin_inset Flex Code
896 \begin_layout Plain Layout
902 this is a LaTeX script used during the configuration process.
906 \begin_layout Labeling
907 \labelwidthstring 00.00.0000
908 \begin_inset Flex Code
911 \begin_layout Plain Layout
917 this is the script that is used to re-configure LyX.
918 It creates configuration files in the directory it was run from.
921 \begin_layout Subsection
922 Other files needing a line or two...
925 \begin_layout Labeling
926 \labelwidthstring 00.00.0000
927 \begin_inset Flex Code
930 \begin_layout Plain Layout
936 this contains tables describing how different character encodings can be
940 \begin_layout Labeling
941 \labelwidthstring 00.00.0000
942 \begin_inset Flex Code
945 \begin_layout Plain Layout
951 this file contains the templates available to the new
952 \begin_inset Flex MenuItem
955 \begin_layout Plain Layout
968 \begin_layout Labeling
969 \labelwidthstring 00.00.0000
970 \begin_inset Flex Code
973 \begin_layout Plain Layout
979 this file contains a list of all the languages currently supported by LyX.
982 \begin_layout Section
983 Your local configuration directory
986 \begin_layout Standard
987 Even if you are using LyX as an unprivileged user, you might want to change
988 LyX configuration for your own use.
990 \begin_inset Flex Code
993 \begin_layout Plain Layout
999 directory contains all your personal configuration files.
1000 This is the directory described as
1001 \begin_inset Quotes eld
1005 \begin_inset Quotes erd
1009 \begin_inset Flex MenuItem
1012 \begin_layout Plain Layout
1013 Help\SpecialChar \menuseparator
1015 \begin_inset space ~
1024 This directory is used as a mirror of
1025 \begin_inset Flex Code
1028 \begin_layout Plain Layout
1034 , which means that every file in
1035 \begin_inset Flex Code
1038 \begin_layout Plain Layout
1044 is a replacement for the corresponding file in
1045 \begin_inset Flex Code
1048 \begin_layout Plain Layout
1055 Any configuration file described in the above sections can be placed either
1056 in the system-wide directory, in which case it will affect all users, or
1057 in your local directory for your own use.
1060 \begin_layout Standard
1061 To make things clearer, let's provide a few examples:
1064 \begin_layout Itemize
1065 The preferences set in the
1066 \begin_inset Flex MenuItem
1069 \begin_layout Plain Layout
1070 Tools\SpecialChar \menuseparator
1076 dialog are saved to a file
1077 \begin_inset Flex Code
1080 \begin_layout Plain Layout
1087 \begin_inset Flex Code
1090 \begin_layout Plain Layout
1099 \begin_layout Itemize
1100 When you reconfigure using
1101 \begin_inset Flex MenuItem
1104 \begin_layout Plain Layout
1105 Tools\SpecialChar \menuseparator
1112 \begin_inset Flex Code
1115 \begin_layout Plain Layout
1121 script, and the resulting files are written in your local configuration
1123 This means that any additional text class file that you might have added
1125 \begin_inset Flex Code
1128 \begin_layout Plain Layout
1134 will be added to the list of classes in the
1135 \begin_inset Flex MenuItem
1138 \begin_layout Plain Layout
1139 Document\SpecialChar \menuseparator
1148 \begin_layout Itemize
1149 If you get some updated documentation from LyX ftp site and cannot install
1150 it because you do not have sysadmin rights on your system, you can just
1152 \begin_inset Flex Code
1155 \begin_layout Plain Layout
1161 and the items in the
1162 \begin_inset Flex MenuItem
1165 \begin_layout Plain Layout
1171 menu will open them!
1174 \begin_layout Section
1175 Running LyX with multiple configurations
1178 \begin_layout Standard
1179 The configuration freedom of the local configuration directory may not suffice
1180 if you want to have more than one configuration at your disposal.
1181 For example, you may want to be use different key bindings or printer settings
1183 You can achieve this by having several such directories.
1184 You then specify which directory to use at run-time.
1187 \begin_layout Standard
1188 Invoking LyX with the command line switch
1189 \begin_inset Flex Code
1192 \begin_layout Plain Layout
1202 instructs the program to read the configuration from that directory, and
1203 not from the default directory.
1204 (You can determine the default directory by running LyX without the
1205 \begin_inset Flex Code
1208 \begin_layout Plain Layout
1214 switch.) If the specified directory does not exist, LyX offers to create
1215 it for you, just like it does for the default directory on the first time
1216 you run the program.
1217 You can modify the configuration options in this additional user directory
1218 exactly as you would for the default directory.
1219 These directories are completely independent (but read on).
1220 Note that setting the environment variable
1221 \begin_inset Flex Code
1224 \begin_layout Plain Layout
1230 to some value has exactly the same effect.
1233 \begin_layout Standard
1234 Having several configurations also requires more maintenance: if you want
1235 to add a new layout to
1236 \begin_inset Flex Code
1239 \begin_layout Plain Layout
1245 which you want available from all your configurations, you must add it
1246 to each directory separately.
1247 You can avoid this with the following trick: after LyX creates the additional
1248 directory, most of the subdirectories (see above) are empty.
1249 If you want the new configuration to mirror an existing one, replace the
1250 empty subdirectory with a symbolic link to the matching subdirectory in
1251 the existing configuration.
1253 \begin_inset Flex Code
1256 \begin_layout Plain Layout
1262 subdirectory, however, since it contains a file written by the configuration
1263 script (also accessible through
1264 \begin_inset Flex MenuItem
1267 \begin_layout Plain Layout
1268 Tools\SpecialChar \menuseparator
1274 ) which is configuration-specific.
1277 \begin_layout Chapter
1278 The Preferences dialog
1281 \begin_layout Standard
1282 All options of the preferences dialog are described in the Appendix
1284 The Preferences Dialog
1291 For some options you might find here more details.
1294 \begin_layout Section
1296 \begin_inset CommandInset label
1305 \begin_layout Standard
1306 The first step is to define your file formats if they are not already defined.
1308 \begin_inset Flex MenuItem
1311 \begin_layout Plain Layout
1312 Tools\SpecialChar \menuseparator
1320 \begin_inset Flex MenuItem
1323 \begin_layout Plain Layout
1324 File Handling\SpecialChar \menuseparator
1331 \begin_inset Flex MenuItem
1334 \begin_layout Plain Layout
1335 New\SpecialChar \ldots{}
1341 button to define your new format.
1343 \begin_inset Flex MenuItem
1346 \begin_layout Plain Layout
1352 field contains the name used to identify the format in the GUI.
1354 \begin_inset Flex MenuItem
1357 \begin_layout Plain Layout
1363 is used to identify the format internally.
1364 You will also need to enter a file extension.
1365 These are all required.
1367 \begin_inset Flex MenuItem
1370 \begin_layout Plain Layout
1376 field is used to provide a keyboard shortcut on the menus.
1377 (For example, pressing
1378 \begin_inset Flex MenuItem
1381 \begin_layout Plain Layout
1388 \begin_inset Flex MenuItem
1391 \begin_layout Plain Layout
1392 View\SpecialChar \menuseparator
1393 View (Other Formats)\SpecialChar \menuseparator
1402 \begin_layout Standard
1404 \begin_inset Flex MenuItem
1407 \begin_layout Plain Layout
1414 \begin_inset Flex MenuItem
1417 \begin_layout Plain Layout
1424 For example, you might want to use
1425 \begin_inset Flex MenuItem
1428 \begin_layout Plain Layout
1434 to view PostScript files.
1435 You can enter the command needed to start the program in the corresponding
1437 In defining this command, you can use the four variables listed in the
1439 The viewer is launched when you view an image in LyX or use the
1440 \begin_inset Flex MenuItem
1443 \begin_layout Plain Layout
1450 The editor is for example launched when you right-click on an image and
1452 \begin_inset Flex MenuItem
1455 \begin_layout Plain Layout
1461 in the appearing context menu.
1464 \begin_layout Standard
1466 \begin_inset Flex MenuItem
1469 \begin_layout Plain Layout
1475 option tells LyX that a format is suitable for document export.
1476 If this is set and if a suitable conversion route exists (see sec.
1477 \begin_inset space \thinspace{}
1481 \begin_inset CommandInset ref
1483 reference "sec:Converters"
1487 ), the format will appear in the
1488 \begin_inset Flex MenuItem
1491 \begin_layout Plain Layout
1492 File\SpecialChar \menuseparator
1499 The format will also appear in the
1500 \begin_inset Flex MenuItem
1503 \begin_layout Plain Layout
1509 menu if a viewer is specified for the format.
1510 Pure image formats, such as
1511 \begin_inset Flex Code
1514 \begin_layout Plain Layout
1520 , should not use this option.
1521 Formats that can both represent vector graphics and documents like
1522 \begin_inset Flex Code
1525 \begin_layout Plain Layout
1534 \begin_layout Standard
1536 \begin_inset Flex MenuItem
1539 \begin_layout Plain Layout
1540 Vector graphics format
1545 tells LyX that a format can contain vector graphics.
1546 This information is used to determine the target format of included graphics
1548 \begin_inset Flex MenuItem
1551 \begin_layout Plain Layout
1558 Included graphics may need to be converted to either
1559 \begin_inset Flex MenuItem
1562 \begin_layout Plain Layout
1569 \begin_inset Flex MenuItem
1572 \begin_layout Plain Layout
1579 \begin_inset Flex MenuItem
1582 \begin_layout Plain Layout
1589 \begin_inset Flex MenuItem
1592 \begin_layout Plain Layout
1598 cannot handle other image formats.
1599 If an included graphic is not already in
1600 \begin_inset Flex MenuItem
1603 \begin_layout Plain Layout
1610 \begin_inset Flex MenuItem
1613 \begin_layout Plain Layout
1620 \begin_inset Flex MenuItem
1623 \begin_layout Plain Layout
1629 format, it is converted to
1630 \begin_inset Flex MenuItem
1633 \begin_layout Plain Layout
1639 if the vector format option is set, and otherwise to
1640 \begin_inset Flex MenuItem
1643 \begin_layout Plain Layout
1652 \begin_layout Section
1656 \begin_layout Standard
1657 Since all conversions from one format to another take place in LyX's temporary
1658 directory, it is sometimes necessary to modify a file before copying it
1659 to the temporary directory in order that the conversion may be performed.
1663 \begin_layout Plain Layout
1664 For example, the file may refer to other files—images, for example—using
1665 relative file names, and these may become invalid when the file is copied
1666 to the temporary directory.
1671 This is done by a Copier: It copies a file to (or from) the temporary directory
1672 and may modify it in the process.
1675 \begin_layout Standard
1676 The definitions of the copiers may use four variables:
1679 \begin_layout Labeling
1680 \labelwidthstring 00.00.0000
1681 \begin_inset Flex Code
1684 \begin_layout Plain Layout
1690 The LyX system directory (e.
1691 \begin_inset space \thinspace{}
1695 \begin_inset space \space{}
1699 \begin_inset Flex MenuItem
1702 \begin_layout Plain Layout
1711 \begin_layout Labeling
1712 \labelwidthstring 00.00.0000
1713 \begin_inset Flex Code
1716 \begin_layout Plain Layout
1725 \begin_layout Labeling
1726 \labelwidthstring 00.00.0000
1727 \begin_inset Flex Code
1730 \begin_layout Plain Layout
1739 \begin_layout Labeling
1740 \labelwidthstring 00.00.0000
1741 \begin_inset Flex Code
1744 \begin_layout Plain Layout
1753 \begin_layout Standard
1754 The latter should be the filename as it would be used in a LaTeX's
1761 It is relevant only when exporting files suitable for such inclusion.
1764 \begin_layout Standard
1765 Copiers can be used to do almost anything with output files.
1766 For example, suppose you want generated pdf files to be copied to a special
1768 \begin_inset Flex Code
1771 \begin_layout Plain Layout
1778 Then you could write a shell script such as this one:
1781 \begin_layout Standard
1782 \begin_inset listings
1786 \begin_layout Plain Layout
1791 \begin_layout Plain Layout
1796 \begin_layout Plain Layout
1798 TOFILE=`basename $2`
1801 \begin_layout Plain Layout
1803 cp $FROMFILE /home/you/pdf/$TOFILE
1808 Save it in your local LyX directory—say,
1809 \begin_inset Flex Code
1812 \begin_layout Plain Layout
1813 /home/you/.lyx/scripts/pdfcopier.sh
1818 —and make it executable, if you need to do so on your platform.
1820 \begin_inset Flex MenuItem
1823 \begin_layout Plain Layout
1824 Tools\SpecialChar \menuseparator
1830 dialog, select under
1831 \begin_inset Flex MenuItem
1834 \begin_layout Plain Layout
1835 File Handling\SpecialChar \menuseparator
1842 \begin_inset Flex MenuItem
1845 \begin_layout Plain Layout
1851 format—or one of the other pdf formats—and enter
1852 \begin_inset Flex Code
1855 \begin_layout Plain Layout
1856 pdfcopier.sh $$i $$o
1862 \begin_inset Flex MenuItem
1865 \begin_layout Plain Layout
1875 \begin_layout Standard
1876 Copiers are used by LyX in various of its own conversions.
1877 For example, if appropriate programs are found, LyX will automatically
1878 install copiers for the
1879 \begin_inset Flex MenuItem
1882 \begin_layout Plain Layout
1889 \begin_inset Flex MenuItem
1892 \begin_layout Plain Layout
1894 \begin_inset space ~
1903 When these formats are exported, the copier sees that not just the main
1904 HTML file but various associated files (style files, images, etc.) are also
1906 All these files are written to a subdirectory of the directory in which
1907 the original LyX file was found.
1911 \begin_layout Plain Layout
1912 This copier can be customized.
1914 \begin_inset Quotes eld
1918 \begin_inset Quotes erd
1921 argument takes a comma-separated list of extensions to be copied; if it
1922 is omitted, all files will be copied.
1924 \begin_inset Quotes eld
1928 \begin_inset Quotes erd
1931 argument determines the extension added to the generated directory.
1933 \begin_inset Quotes eld
1937 \begin_inset Flex MenuItem
1940 \begin_layout Plain Layout
1947 \begin_inset Quotes erd
1950 , so HTML generated from
1951 \begin_inset Flex MenuItem
1954 \begin_layout Plain Layout
1955 /path/to/filename.lyx
1961 \begin_inset Flex MenuItem
1964 \begin_layout Plain Layout
1965 /path/to/filename.html.LyXconv
1979 \begin_layout Section
1981 \begin_inset CommandInset label
1983 name "sec:Converters"
1990 \begin_layout Standard
1991 You can define your own Converters to convert files between different formats.
1993 \begin_inset Flex MenuItem
1996 \begin_layout Plain Layout
1997 Tools\SpecialChar \menuseparator
1998 Preferences\SpecialChar \menuseparator
1999 File Handling\SpecialChar \menuseparator
2008 \begin_layout Standard
2009 To define a new converter, select the
2010 \begin_inset Flex MenuItem
2013 \begin_layout Plain Layout
2015 \begin_inset space ~
2024 \begin_inset Flex MenuItem
2027 \begin_layout Plain Layout
2029 \begin_inset space ~
2037 from the drop-down lists, enter the command needed for the conversion,
2039 \begin_inset Flex MenuItem
2042 \begin_layout Plain Layout
2049 Several variables can be used in the definition of converters:
2052 \begin_layout Labeling
2053 \labelwidthstring 00.00.0000
2054 \begin_inset Flex Code
2057 \begin_layout Plain Layout
2063 The LyX system directory
2066 \begin_layout Labeling
2067 \labelwidthstring 00.00.0000
2068 \begin_inset Flex Code
2071 \begin_layout Plain Layout
2080 \begin_layout Labeling
2081 \labelwidthstring 00.00.0000
2082 \begin_inset Flex Code
2085 \begin_layout Plain Layout
2094 \begin_layout Labeling
2095 \labelwidthstring 00.00.0000
2096 \begin_inset Flex Code
2099 \begin_layout Plain Layout
2105 The base filename of the input file (i.
2106 \begin_inset space \thinspace{}
2109 g., without the extension)
2112 \begin_layout Labeling
2113 \labelwidthstring 00.00.0000
2114 \begin_inset Flex Code
2117 \begin_layout Plain Layout
2123 The path to the input file
2126 \begin_layout Labeling
2127 \labelwidthstring 00.00.0000
2128 \begin_inset Flex Code
2131 \begin_layout Plain Layout
2137 The path to the original input file (this is different from $$p when a
2138 chain of converters is called)
2141 \begin_layout Labeling
2142 \labelwidthstring 00.00.0000
2143 \begin_inset Flex Code
2146 \begin_layout Plain Layout
2152 The iconv name for the encoding of the document.
2155 \begin_layout Standard
2157 \begin_inset Flex MenuItem
2160 \begin_layout Plain Layout
2162 \begin_inset space ~
2170 field you can enter the following flags, separated by commas:
2173 \begin_layout Labeling
2174 \labelwidthstring 00.00.0000
2175 \begin_inset Flex Code
2178 \begin_layout Plain Layout
2184 This converter runs some form of LaTeX.
2185 This will make LyX's LaTeX error logs available.
2188 \begin_layout Labeling
2189 \labelwidthstring 00.00.0000
2190 \begin_inset Flex Code
2193 \begin_layout Plain Layout
2200 \begin_inset Flex MenuItem
2203 \begin_layout Plain Layout
2209 file for the conversion.
2212 \begin_layout Labeling
2213 \labelwidthstring 00.00.0000
2214 \begin_inset Flex Code
2217 \begin_layout Plain Layout
2226 \begin_layout Standard
2227 The following three flags are not really flags at all because they take
2229 \begin_inset Flex MenuItem
2232 \begin_layout Plain Layout
2234 \begin_inset space ~
2238 \begin_inset space ~
2249 \begin_layout Labeling
2250 \labelwidthstring 00.00.0000
2251 \begin_inset Flex Code
2254 \begin_layout Plain Layout
2260 If set, the converter's standard error will be redirected to a file
2261 \begin_inset Flex Code
2264 \begin_layout Plain Layout
2270 , and the script given as argument will be run as:
2271 \begin_inset Flex Code
2274 \begin_layout Plain Layout
2275 script < infile.out > infile.log
2281 The argument may contain
2282 \begin_inset Flex Code
2285 \begin_layout Plain Layout
2294 \begin_layout Labeling
2295 \labelwidthstring 00.00.0000
2296 \begin_inset Flex Code
2299 \begin_layout Plain Layout
2305 The name of the directory in which the converter will dump the generated
2307 LyX will not create this directory, and it does not copy anything into
2308 it, though it will copy this directory to the destination.
2309 The argument may contain
2310 \begin_inset Flex Code
2313 \begin_layout Plain Layout
2319 , which will be replaced by the base name of the input and output files,
2320 respectively, when the directory is copied.
2321 \begin_inset Newline newline
2324 Note that resultdir and usetempdir make no sense together.
2325 The latter will be ignored if the former is given.
2328 \begin_layout Labeling
2329 \labelwidthstring 00.00.0000
2330 \begin_inset Flex Code
2333 \begin_layout Plain Layout
2339 Determines the output file name and may, contain
2340 \begin_inset Flex Code
2343 \begin_layout Plain Layout
2350 Sensible only with resultdir and optional even then; if not given, it defaults
2354 \begin_layout Standard
2355 None of these last three are presently used in any of the converters that
2356 are installed with LyX.
2360 \begin_layout Standard
2361 You do not have to define converters for all formats between which you want
2363 For example, you will note that there is no `LyX to PostScript' converter,
2364 but LyX will export PostScript.
2365 It does so by first creating a LaTeX file (no converter needs to be defined
2366 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2367 and finally converting the resulting DVI file to PostScript.
2368 LyX finds such `chains' of converters automatically, and it will always
2369 choose the shortest possible chain.
2370 You can, though, still define multiple conversion methods between file
2372 For example, the standard LyX configuration provides three ways to convert
2373 LaTeX to PDF: Directly, using
2374 \begin_inset Flex MenuItem
2377 \begin_layout Plain Layout
2383 ; via (DVI and) PostScript, using
2384 \begin_inset Flex MenuItem
2387 \begin_layout Plain Layout
2394 \begin_inset Flex MenuItem
2397 \begin_layout Plain Layout
2404 To define such alternate chains, you must define multiple target `file
2405 formats', as described in section
2406 \begin_inset CommandInset ref
2408 reference "sec:Formats"
2413 For example, in the standard configuration, the formats named
2414 \begin_inset Flex MenuItem
2417 \begin_layout Plain Layout
2424 \begin_inset Flex MenuItem
2427 \begin_layout Plain Layout
2434 \begin_inset Flex MenuItem
2437 \begin_layout Plain Layout
2443 are defined, all of which share the extension
2444 \begin_inset Flex MenuItem
2447 \begin_layout Plain Layout
2453 , and which correspond to the conversion methods just mentioned.
2456 \begin_layout Chapter
2457 Internationalizing LyX
2458 \begin_inset CommandInset label
2460 name "cha:Internationalizing-LyX"
2467 \begin_layout Standard
2468 LyX supports using a translated interface.
2469 Last time we checked, LyX provided text in thirty languages.
2470 The language of choice is called your
2475 (For further reading on locale settings, see also the documentation for
2476 locale that comes with your operating system.
2477 For Linux, the manual page for
2478 \begin_inset Flex Code
2481 \begin_layout Plain Layout
2487 could be a good place to start).
2490 \begin_layout Standard
2491 Notice that these translations will work, but do contain a few flaws.
2492 In particular, all dialogs have been designed with the English text in
2493 mind, which means that some of the translated text will be too large to
2494 fit within the space allocated.
2495 This is only a display problem and will not cause any harm.
2496 Also, you will find that some of the translations do not define shortcut
2497 keys for everything.
2498 Sometimes, there are simply not enough free letters to do it.
2499 Other times, the translator just hasn't got around to doing it yet.
2500 Our localization team, which you may wish to join,
2504 \begin_layout Plain Layout
2505 If you are a fluent speaker of a language other than English, joining these
2506 teams is a great way to give back to the LyX community!
2511 will of course try to fix these shortcomings in future versions of LyX.
2514 \begin_layout Section
2518 \begin_layout Subsection
2519 Translating the graphical user interface (text messages).
2522 \begin_layout Standard
2524 \begin_inset Flex Code
2527 \begin_layout Plain Layout
2533 library to handle the internationalization of the interface.
2534 To have LyX speak your favorite language in all menus and dialogs, you
2536 \begin_inset Flex Code
2539 \begin_layout Plain Layout
2545 -file for that language.
2546 When this is available, you'll have to generate a
2547 \begin_inset Flex Code
2550 \begin_layout Plain Layout
2556 -file from it and install the
2557 \begin_inset Flex Code
2560 \begin_layout Plain Layout
2567 The process of doing all of this is explained in the documentation for
2569 \begin_inset Flex Code
2572 \begin_layout Plain Layout
2579 It is possible to do this just for yourself, but if you're going to do
2580 it, you might as well share the results of your labors with the rest of
2582 Send a message to the LyX developers' list for more information about how
2586 \begin_layout Standard
2587 In short, this is what you should do (xx denotes the language code):
2590 \begin_layout Itemize
2591 Check out the LyX source code.
2593 \begin_inset CommandInset href
2595 name "information on the web"
2596 target "http://www.lyx.org/HowToUseSVN"
2603 \begin_layout Itemize
2605 \begin_inset Flex Code
2608 \begin_layout Plain Layout
2614 to the folder of the
2615 \begin_inset Flex Code
2618 \begin_layout Plain Layout
2626 \begin_inset Flex Code
2629 \begin_layout Plain Layout
2637 \begin_inset Flex Code
2640 \begin_layout Plain Layout
2646 doesn't exist anywhere, it can be remade with the console command
2647 \begin_inset Flex Code
2650 \begin_layout Plain Layout
2656 in that directory, or you can use an existing po-file for some other language
2660 \begin_layout Itemize
2662 \begin_inset Flex Code
2665 \begin_layout Plain Layout
2675 \begin_layout Plain Layout
2676 This is just a text file, so it can be edited in any text editor.
2677 But there are also specialized programs that support such editing, such
2682 (for all platforms) or
2691 contains a `mode' for editing
2692 \begin_inset Flex Code
2695 \begin_layout Plain Layout
2706 For some menu- and widget-labels, there are also shortcut keys that should
2708 Those keys are marked after a `|', and should be translated according to
2709 the words and phrases of the language.
2710 You should also fill also out the information at the beginning of the new
2712 \begin_inset Flex Code
2715 \begin_layout Plain Layout
2721 -file with your email-address, etc., so people know where to reach you with
2722 suggestions and entertaining flames.
2725 \begin_layout Standard
2726 If you are just doing this on your own, then:
2729 \begin_layout Itemize
2731 \begin_inset Flex Code
2734 \begin_layout Plain Layout
2741 This can be done with
2742 \begin_inset Flex Code
2745 \begin_layout Plain Layout
2746 msgfmt -o xx.mo < xx.po
2754 \begin_layout Itemize
2756 \begin_inset Flex Code
2759 \begin_layout Plain Layout
2765 -file to your locale-tree, at the correct directory for application messages
2770 xx, and under the name
2771 \begin_inset Flex Code
2774 \begin_layout Plain Layout
2781 \begin_inset space \thinspace{}
2785 \begin_inset space \space{}
2789 \begin_inset Flex Code
2792 \begin_layout Plain Layout
2793 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2803 \begin_layout Standard
2804 As said, however, it would be best if the new
2805 \begin_inset Flex Code
2808 \begin_layout Plain Layout
2814 -file could be added to the LyX distribution, so others can use it.
2815 Adding it involves making additional changes to LyX.
2816 So send an email to the developers' mailing list if you're interested in
2820 \begin_layout Subsubsection
2824 \begin_layout Standard
2825 Sometimes it turns out that one English message needs to be translated into
2826 different messages in the target language.
2827 One example is the message
2828 \begin_inset Flex Code
2831 \begin_layout Plain Layout
2837 which has the German translation
2845 , depending upon exactly what the English
2846 \begin_inset Quotes eld
2850 \begin_inset Quotes erd
2855 \begin_inset Flex Code
2858 \begin_layout Plain Layout
2864 does not handle such ambiguous translations.
2865 Therefore you have to add some context information to the message: Instead
2867 \begin_inset Flex Code
2870 \begin_layout Plain Layout
2877 \begin_inset Flex Code
2880 \begin_layout Plain Layout
2881 To[[as in 'From format x to format y']]
2887 \begin_inset Flex Code
2890 \begin_layout Plain Layout
2891 To[[as in 'From page x to page y']].
2896 Now the two occurrences of
2897 \begin_inset Flex Code
2900 \begin_layout Plain Layout
2907 \begin_inset Flex Code
2910 \begin_layout Plain Layout
2916 and can be translated correctly to
2927 \begin_layout Standard
2928 Of course the context information needs to be stripped off the original
2929 message when no translation is used.
2930 Therefore you have to put it in double square brackets at the end of the
2931 message (see the example above).
2932 The translation mechanism of LyX ensures that everything in double square
2933 brackets at the end of messages is removed before displaying the message.
2936 \begin_layout Subsection
2937 Translating the documentation.
2940 \begin_layout Standard
2941 The online documentation (in the
2942 \begin_inset Flex MenuItem
2945 \begin_layout Plain Layout
2951 -menu) can (and should!) be translated.
2952 If there are translated versions of the documentation available
2956 \begin_layout Plain Layout
2957 As of March 2008, at least some of the documents have been translated into
2958 fourteen languages, with the Tutorial available in a few more.
2963 and the locale is set accordingly, these will be used automagically by
2965 LyX looks for translated versions as
2966 \begin_inset Flex Code
2969 \begin_layout Plain Layout
2970 LyXDir/doc/xx/DocName.lyx
2976 \begin_inset Flex Code
2979 \begin_layout Plain Layout
2985 is the code for the language currently in use.
2986 If there are no translated documents, the default English versions will
2988 Note that the translated versions must have the same filenames (
2989 \begin_inset Flex Code
2992 \begin_layout Plain Layout
2998 above) as the original.
2999 If you feel up to translating the documentation (an excellent way to proof-read
3000 the original documentation by the way!), there are a few things you should
3004 \begin_layout Itemize
3005 Check out the documentation translation web page at
3006 \begin_inset CommandInset href
3008 name "http://www.lyx.org/Translation"
3009 target "http://www.lyx.org/Translation"
3014 That way, you can find out which (if any) documents have already been translate
3015 d into your language.
3016 You can also find out who (if anyone) is organizing the effort to translate
3017 the documentation into your language.
3018 If no one is organizing the effort, please let us know that you're interested.
3021 \begin_layout Standard
3022 Once you get to actually translating, here's a few hints for you that may
3026 \begin_layout Itemize
3027 Join the documentation team! There is information on how to do that in
3028 \begin_inset Flex Code
3031 \begin_layout Plain Layout
3038 \begin_inset Flex MenuItem
3041 \begin_layout Plain Layout
3042 Help\SpecialChar \menuseparator
3048 ), which by the way is the first document you should translate.
3051 \begin_layout Itemize
3052 Learn the typographic conventions for the language you are translating to.
3053 Typography is an ancient art and over the centuries, a great variety of
3054 conventions have developed throughout different parts of the world.
3055 Also study the professional terminology amongst typographers in your country.
3056 Inventing your own terminology will only confuse the users.
3059 (Warning! Typography is addictive!)
3062 \begin_layout Itemize
3063 Make a copy of the document.
3064 This will be your working copy.
3065 You can use this as your personal translated help-file by placing it in
3067 \begin_inset Flex Code
3070 \begin_layout Plain Layout
3079 \begin_layout Itemize
3080 Sometimes the original document (from the LyX-team) will be updated.
3081 Use the source viewer at
3082 \begin_inset CommandInset href
3084 name "http://www.lyx.org/trac/timeline"
3085 target "http://www.lyx.org/trac/timeline"
3089 to see what has been changed.
3090 That way you can easily see which parts of the translated document need
3094 \begin_layout Standard
3095 If you ever find an error in the original document, fix it and notify the
3096 rest of the documentation team of the changes! (You didn't forget to join
3097 the documentation team, did you?)
3100 \begin_layout Standard
3101 \begin_inset Branch OutDated
3104 \begin_layout Section
3105 International Keyboard Support
3108 \begin_layout Standard
3111 [Editor's Note: The following section is by
3119 It needs to be fixed to conform to the new Documentation Style sheet and
3120 to make use of the new v1.0 features.
3121 The whole thing also needs to be merged with the section following it.-jw
3122 It may also be badly out of date.-rh (2008)]
3125 \begin_layout Subsection
3126 Defining Own Keymaps: Keymap File Format
3129 \begin_layout Standard
3130 Let's look at a keyboard definition file a little closer.
3131 It is a plain text file defining
3134 \begin_layout Itemize
3135 key-to-key or key-to-string translations
3138 \begin_layout Itemize
3142 \begin_layout Itemize
3143 dead keys exceptions
3146 \begin_layout Standard
3147 To define key-to-key or key-to-string translation, use this command:
3150 \begin_layout Quotation
3151 \begin_inset Flex Code
3154 \begin_layout Plain Layout
3163 \begin_inset Flex Code
3166 \begin_layout Plain Layout
3175 \begin_layout Standard
3177 \begin_inset Flex Code
3180 \begin_layout Plain Layout
3186 is the key to be translated and
3187 \begin_inset Flex Code
3190 \begin_layout Plain Layout
3196 is the string to be inserted into the document.
3197 To define dead keys, use:
3200 \begin_layout Quotation
3201 \begin_inset Flex Code
3204 \begin_layout Plain Layout
3213 \begin_inset Flex Code
3216 \begin_layout Plain Layout
3225 \begin_layout Standard
3227 \begin_inset Flex Code
3230 \begin_layout Plain Layout
3236 is a keyboard key and
3237 \begin_inset Flex Code
3240 \begin_layout Plain Layout
3247 The following dead keys are supported (shortcut name is in parentheses):
3250 \begin_layout Quotation
3254 \begin_inset space \hfill{}
3260 \begin_layout Quotation
3262 \begin_inset space \hfill{}
3268 \begin_layout Quotation
3270 \begin_inset space \hfill{}
3276 \begin_layout Quotation
3278 \begin_inset space \hfill{}
3284 \begin_layout Quotation
3286 \begin_inset space \hfill{}
3292 \begin_layout Quotation
3294 \begin_inset space \hfill{}
3301 \begin_layout Plain Layout
3313 \begin_layout Quotation
3315 \begin_inset space \hfill{}
3321 \begin_layout Quotation
3323 \begin_inset space \hfill{}
3330 \begin_layout Plain Layout
3342 \begin_layout Quotation
3344 \begin_inset space \hfill{}
3350 \begin_layout Quotation
3352 \begin_inset space \hfill{}
3358 \begin_layout Quotation
3360 \begin_inset space \hfill{}
3367 \begin_layout Plain Layout
3379 \begin_layout Quotation
3381 \begin_inset space \hfill{}
3388 \begin_layout Plain Layout
3400 \begin_layout Quotation
3402 \begin_inset space \hfill{}
3408 \begin_layout Quotation
3409 hungarian umlaut (hug)
3410 \begin_inset space \hfill{}
3416 \begin_layout Quotation
3418 \begin_inset space \hfill{}
3424 \begin_layout Quotation
3426 \begin_inset space \hfill{}
3433 \begin_layout Plain Layout
3445 \begin_layout Standard
3446 Since in many international keyboards there are exceptions to what some
3447 dead keys should do, you can define them using
3450 \begin_layout Quotation
3451 \begin_inset Flex Code
3454 \begin_layout Plain Layout
3462 deadkey key outstring
3465 \begin_layout Standard
3466 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3470 \begin_layout Quotation
3471 \begin_inset Flex Code
3474 \begin_layout Plain Layout
3487 \begin_layout Standard
3488 to make it work correctly.
3489 Also, you have to define as exceptions dead keys over i and j, to remove
3490 the dot from them before inserting an accent mark.
3491 I will change this when the time comes, but so far I haven't had time.
3494 \begin_layout Standard
3495 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3498 \begin_inset Flex Code
3501 \begin_layout Plain Layout
3507 have different meaning.
3509 \begin_inset Flex Code
3512 \begin_layout Plain Layout
3518 marks comments, quotes start and end LaTeX-style commands.
3519 To enter quote, you'll need to use
3520 \begin_inset Flex Code
3523 \begin_layout Plain Layout
3532 \begin_inset Flex Code
3535 \begin_layout Plain Layout
3542 \begin_inset Flex Code
3545 \begin_layout Plain Layout
3556 \begin_layout Standard
3557 If you make a keyboard description file that works for your language, please
3558 mail it to me, so I can include it in the next keymap distribution.
3561 \begin_layout Standard
3562 More keywords will be supported in keymap configuration file in future,
3566 \begin_layout Itemize
3567 \begin_inset Flex Code
3570 \begin_layout Plain Layout
3581 \begin_inset space \hfill{}
3585 \begin_inset Flex Code
3588 \begin_layout Plain Layout
3597 \begin_layout Itemize
3598 \begin_inset Flex Code
3601 \begin_layout Plain Layout
3612 \begin_inset space \hfill{}
3616 \begin_inset Flex Code
3619 \begin_layout Plain Layout
3625 an external keymap translation program
3628 \begin_layout Standard
3629 Also, it should look into
3630 \begin_inset Flex Code
3633 \begin_layout Plain Layout
3639 file for defaults, too (for example, a
3640 \begin_inset Flex Code
3643 \begin_layout Plain Layout
3651 option to include default keyboard).
3659 \begin_layout Section
3660 International Keymap Stuff
3661 \begin_inset CommandInset label
3663 name "sec:International-Keymap-Stuff"
3670 \begin_layout Standard
3671 \begin_inset Note Note
3674 \begin_layout Plain Layout
3675 In doing the revisions on this document in March 2008, I did not look over
3676 this stuff, as I do not understand it.
3677 It would be good if someone else could do so.
3686 \begin_layout Standard
3687 The next two sections describe the
3688 \begin_inset Flex Code
3691 \begin_layout Plain Layout
3700 \begin_inset Flex Code
3703 \begin_layout Plain Layout
3711 file syntax in detail.
3712 These sections should help you design your own key map if the ones provided
3713 do not meet your needs.
3716 \begin_layout Subsection
3720 \begin_layout Standard
3724 \begin_inset Flex Code
3727 \begin_layout Plain Layout
3733 file maps keystrokes to characters or strings.
3734 As the name suggests, it sets a keyboard mapping.
3736 \begin_inset Flex Code
3739 \begin_layout Plain Layout
3750 \begin_inset Flex Code
3753 \begin_layout Plain Layout
3768 \begin_inset Flex Code
3771 \begin_layout Plain Layout
3784 \begin_inset Flex Code
3787 \begin_layout Plain Layout
3796 \begin_inset Flex Code
3799 \begin_layout Plain Layout
3807 are described in this section.
3810 \begin_layout Labeling
3811 \labelwidthstring 00.00.0000
3812 \begin_inset Flex Code
3815 \begin_layout Plain Layout
3823 Map a character to a string
3826 \begin_layout LyX-Code
3841 \begin_layout Standard
3874 the double-quote (")
3891 must be escaped with a preceding backslash (
3902 \begin_layout Standard
3904 \begin_inset Flex MenuItem
3907 \begin_layout Plain Layout
3915 statement to cause the symbol
3916 \begin_inset Flex MenuItem
3919 \begin_layout Plain Layout
3927 to be output for the keystroke
3928 \begin_inset Flex MenuItem
3931 \begin_layout Plain Layout
3942 \begin_layout LyX-Code
3948 \begin_layout Labeling
3949 \labelwidthstring 00.00.0000
3950 \begin_inset Flex Code
3953 \begin_layout Plain Layout
3961 Specify an accent character
3964 \begin_layout LyX-Code
3973 \begin_layout Standard
3974 This will make the cha
4012 This is the dead key
4016 \begin_layout Plain Layout
4023 refers to a key that does not produce a character by itself, but when followed
4024 with another key, produces the desired accent character.
4025 For example, a German characte
4027 r with an umlaut like
4037 can be produced in this manner.
4046 \begin_layout Standard
4059 and then another key not in
4076 followed by the other, not allowed key, as output.
4080 \begin_inset Flex MenuItem
4083 \begin_layout Plain Layout
4091 cancels a dead key, so if
4102 \begin_inset Flex MenuItem
4105 \begin_layout Plain Layout
4114 , the cursor will not go one position backwards but will instead cancel
4130 might have had on the next keystroke.
4134 \begin_layout Standard
4135 The following example specifies that the character ' is to be an acute accent,
4136 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4139 \begin_layout LyX-Code
4142 kmod ' acute aeiouAEIOU
4145 \begin_layout Labeling
4146 \labelwidthstring 00.00.0000
4147 \begin_inset Flex Code
4150 \begin_layout Plain Layout
4156 Specify an exception to the accent character
4159 \begin_layout LyX-Code
4168 \begin_layout Standard
4169 This defines an exce
4210 have been assigned a keystroke with a previous
4213 \begin_inset Flex Code
4216 \begin_layout Plain Layout
4240 must not belong in the
4287 If such a declaration does not exist in
4295 \begin_inset Flex Code
4298 \begin_layout Plain Layout
4332 \begin_inset Flex Code
4335 \begin_layout Plain Layout
4349 \begin_layout Standard
4350 The following command produces causes äi to be produced when you enter acute-i
4354 \begin_layout LyX-Code
4368 \begin_layout Labeling
4369 \labelwidthstring 00.00.0000
4370 \begin_inset Flex Code
4373 \begin_layout Plain Layout
4379 Combine two accent characters
4382 \begin_layout LyX-Code
4388 accent1 accent2 allowed
4391 \begin_layout Standard
4392 This one is getting pretty esoteric.
4393 It allows you to combine the effect
4449 \begin_inset Flex Code
4452 \begin_layout Plain Layout
4480 \begin_layout Standard
4481 Consider this example from the
4482 \begin_inset Flex Code
4485 \begin_layout Plain Layout
4496 \begin_layout LyX-Code
4499 kmod ; acute aeioyvhAEIOYVH
4503 kcomb acute umlaut iyIY
4506 \begin_layout Standard
4507 This allows you to press
4508 \begin_inset Flex MenuItem
4511 \begin_layout Plain Layout
4519 and get the effect of
4520 \begin_inset Flex Code
4523 \begin_layout Plain Layout
4542 in this case cancels the last dead key, so if you press
4543 \begin_inset Flex MenuItem
4546 \begin_layout Plain Layout
4555 \begin_inset Flex Code
4558 \begin_layout Plain Layout
4571 \begin_layout Subsection
4575 \begin_layout Standard
4577 \begin_inset Flex Code
4580 \begin_layout Plain Layout
4588 mapping is performed, a
4589 \begin_inset Flex Code
4592 \begin_layout Plain Layout
4602 file maps the strings that the symbols generate to characters in the current
4604 The LyX distribution currently includes at least the
4605 \begin_inset Flex Code
4608 \begin_layout Plain Layout
4617 \begin_inset Flex Code
4620 \begin_layout Plain Layout
4631 \begin_layout Standard
4633 \begin_inset Flex Code
4636 \begin_layout Plain Layout
4644 file is a sequence of declarations of the form
4647 \begin_layout LyX-Code
4660 \begin_layout Standard
4661 For example, in order to map
4662 \begin_inset Flex MenuItem
4665 \begin_layout Plain Layout
4675 to the corresponding character in the iso-8859-1 set (233), the following
4679 \begin_layout LyX-Code
4687 \begin_layout Standard
4689 \begin_inset Flex Code
4692 \begin_layout Plain Layout
4701 \begin_inset Flex Code
4704 \begin_layout Plain Layout
4722 the same character can apply to more than one string.
4724 \begin_inset Flex Code
4727 \begin_layout Plain Layout
4738 \begin_layout LyX-Code
4750 \begin_inset Newline newline
4766 \begin_layout Standard
4767 If LyX cannot find a mapping for the string produced by the keystroke or
4768 a deadkey sequence, it will check if it looks like an accented char and
4769 try to draw an accent over the character on screen.
4772 \begin_layout Subsection
4776 \begin_layout Standard
4777 There is a second way to add support for international characters through
4778 so-called dead-keys.
4779 A dead-key works in combination with a letter to produce an accented character.
4780 Here, we'll explain how to create a really simple dead-key to illustrate
4784 \begin_layout Standard
4785 Suppose you happen to need the circumflex character,
4786 \begin_inset Quotes eld
4790 \begin_inset Quotes erd
4795 \begin_inset Flex MenuItem
4798 \begin_layout Plain Layout
4805 \begin_inset space ~
4809 \begin_inset Flex MenuItem
4812 \begin_layout Plain Layout
4818 ] to the LyX command
4819 \begin_inset Flex Code
4822 \begin_layout Plain Layout
4829 \begin_inset Flex Code
4832 \begin_layout Plain Layout
4839 Now, whenever you type the
4840 \begin_inset Flex MenuItem
4843 \begin_layout Plain Layout
4849 -key followed by a letter, that letter will have a circumflex accent on
4851 For example, the sequence
4852 \begin_inset Quotes eld
4856 \begin_inset Flex MenuItem
4859 \begin_layout Plain Layout
4866 \begin_inset Quotes erd
4869 produces the letter:
4870 \begin_inset Quotes eld
4874 \begin_inset Quotes erd
4878 If you tried to type
4879 \begin_inset Quotes eld
4883 \begin_inset Flex MenuItem
4886 \begin_layout Plain Layout
4893 \begin_inset Quotes erd
4896 , however, LyX will complain with a beep, since a
4897 \begin_inset Quotes eld
4901 \begin_inset Flex MenuItem
4904 \begin_layout Plain Layout
4911 \begin_inset Quotes erd
4914 never takes a circumflex accent.
4916 \begin_inset Flex MenuItem
4919 \begin_layout Plain Layout
4925 after a dead-key produces the bare-accent.
4926 Please note this last point! If you bind a key to a dead-key, you'll need
4927 to rebind the character on that key to yet another key.
4929 \begin_inset Flex MenuItem
4932 \begin_layout Plain Layout
4938 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4941 \begin_layout Standard
4942 One common way to bind dead-keys is to use
4943 \begin_inset Flex MenuItem
4946 \begin_layout Plain Layout
4953 \begin_inset Flex MenuItem
4956 \begin_layout Plain Layout
4963 \begin_inset Flex MenuItem
4966 \begin_layout Plain Layout
4972 in combination with an accent, like
4973 \begin_inset Quotes eld
4977 \begin_inset Flex MenuItem
4980 \begin_layout Plain Layout
4987 \begin_inset Quotes erd
4991 \begin_inset Quotes eld
4995 \begin_inset Flex MenuItem
4998 \begin_layout Plain Layout
5005 \begin_inset Quotes erd
5009 \begin_inset Quotes eld
5013 \begin_inset Flex MenuItem
5016 \begin_layout Plain Layout
5023 \begin_inset Quotes erd
5027 Another way involves using
5028 \begin_inset Flex Code
5031 \begin_layout Plain Layout
5038 \begin_inset Flex Code
5041 \begin_layout Plain Layout
5047 to set up the special
5048 \begin_inset Flex Code
5051 \begin_layout Plain Layout
5059 \begin_inset Flex Code
5062 \begin_layout Plain Layout
5068 acts in some ways just like
5069 \begin_inset Flex MenuItem
5072 \begin_layout Plain Layout
5078 and permits you to bind keys to accented characters.
5079 You can also turn keys into dead-keys by binding them to something like
5081 \begin_inset Flex Code
5084 \begin_layout Plain Layout
5090 and then binding this symbolic key to the corresponding LyX command.
5094 \begin_layout Plain Layout
5099 : This is exactly what I do in my
5100 \begin_inset Flex Code
5103 \begin_layout Plain Layout
5110 \begin_inset Flex Code
5113 \begin_layout Plain Layout
5121 \begin_inset Flex MenuItem
5124 \begin_layout Plain Layout
5126 \begin_inset space ~
5135 \begin_inset Flex Code
5138 \begin_layout Plain Layout
5144 and a bunch of these
5145 \begin_inset Quotes eld
5149 \begin_inset Flex Code
5152 \begin_layout Plain Layout
5159 \begin_inset Quotes erd
5162 symbolic keys bound such things as
5163 \begin_inset Flex MenuItem
5166 \begin_layout Plain Layout
5168 \begin_inset space ~
5177 \begin_inset Flex MenuItem
5180 \begin_layout Plain Layout
5182 \begin_inset space ~
5191 This is how I produce my accented characters.
5196 You can make just about anything into the
5197 \begin_inset Flex Code
5200 \begin_layout Plain Layout
5207 \begin_inset Flex MenuItem
5210 \begin_layout Plain Layout
5216 keys, a spare function key, etc.
5217 As for the LyX commands that produce accents, check the entry for
5218 \begin_inset Flex Code
5221 \begin_layout Plain Layout
5232 You'll find the complete list there.
5235 \begin_layout Subsection
5236 Saving your Language Configuration
5239 \begin_layout Standard
5240 You can edit your preferences so that your desired language environment
5241 is automatically configured when LyX starts up, via the
5242 \begin_inset Flex MenuItem
5245 \begin_layout Plain Layout
5246 Edit\SpecialChar \menuseparator
5255 \begin_layout Chapter
5256 Installing New Document Classes, Layouts, and Templates
5257 \begin_inset CommandInset label
5259 name "cha:Installing-New-Document"
5264 \begin_inset Argument
5267 \begin_layout Plain Layout
5268 Installing New Document Classes
5276 \begin_layout Standard
5277 In this chapter, we describe the procedures for creating and installing
5278 new LyX layout and template files, as well as offer a refresher on correctly
5279 installing new LaTeX document classes.
5283 \begin_layout Standard
5284 First, let us a say a few words about how one ought to think about the relation
5285 between LyX and LaTeX.
5286 The thing to understand is that, in a certain sense, LyX doesn't know anything
5288 Indeed, from LyX's point of view, LaTeX is just one of several
5289 \begin_inset Quotes eld
5293 \begin_inset Quotes erd
5296 in which it is capable of producing output.
5297 Other such formats are DocBook, plaintext, and XHTML.
5298 LaTeX is, of course, a particularly important format, but very little of
5299 the information LyX has about LaTeX is actually contained in the program
5304 \begin_layout Plain Layout
5305 Some commands are sufficiently complex that they are
5306 \begin_inset Quotes eld
5310 \begin_inset Quotes erd
5314 But the developers generally regard this as a Bad Thing.
5319 Rather, that information, even for the standard classes like
5320 \begin_inset Flex Code
5323 \begin_layout Plain Layout
5329 , is contained in `layout files'.
5330 Similarly, LyX itself does not know much about DocBook or XHTML.
5331 What it knows is contained in layout files.
5334 \begin_layout Standard
5335 You can think of the layout file for a given document class as a translation
5336 manual between LyX constructs---paragraphs with their corresponding styles,
5337 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5339 Almost everything LyX knows about
5340 \begin_inset Flex Code
5343 \begin_layout Plain Layout
5349 , for example, is contained in the file
5350 \begin_inset Flex Code
5353 \begin_layout Plain Layout
5359 and in various other files it includes.
5360 For this reason, anyone intending to write layout files should plan to
5361 study the existing files.
5362 A good place to start is with
5363 \begin_inset Flex Code
5366 \begin_layout Plain Layout
5372 , which is included in
5373 \begin_inset Flex Code
5376 \begin_layout Plain Layout
5383 \begin_inset Flex Code
5386 \begin_layout Plain Layout
5392 , and many of the other layout files for document classes.
5393 This file is where sections and the like are defined:
5394 \begin_inset Flex Code
5397 \begin_layout Plain Layout
5403 tells LyX how paragraphs that are marked with the Section, Subsection,
5404 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5407 \begin_inset Flex Code
5410 \begin_layout Plain Layout
5416 file basically just includes several of these
5417 \begin_inset Flex Code
5420 \begin_layout Plain Layout
5429 \begin_layout Standard
5430 Defining the LyX--LaTeX correspondence is not the only thing layout files
5432 Their other job is to define how the LyX constructs themselves will appear
5434 The fact that layout files have these two jobs is often a source of confusion,
5435 because they are completely separate.
5436 Telling LyX how to translate a certain paragraph style into LaTeX does
5437 not tell LyX how to display it; conversely, telling LyX how to display
5438 a certain paragraph style does not tell LyX how to translate it into LaTeX
5439 (let alone tell LaTeX how to display it).
5440 So, in general, when you define a new LyX construct, you must always do
5441 two quite separate things: (i)
5442 \begin_inset space ~
5445 tell LyX how to translate it into LaTeX and (ii)
5446 \begin_inset space ~
5449 tell LyX how to display it.
5452 \begin_layout Standard
5453 Much the same is true, of course, as regards LyX's other backend formats,
5454 though XHTML is in some ways different, because in that case LyX
5458 able, to some extent, to use information about how it should display a
5459 paragraph on the screen to output information (in the form of CSS) about
5460 how the paragraph should be displayed in a browser.
5461 Even in this case, however, the distinction between what LyX does internally
5462 and how things are rendered externally remains in force, and the two can
5463 be controlled separately.
5465 \begin_inset CommandInset ref
5467 reference "sec:Tags-for-XHTML"
5474 \begin_layout Section
5475 Installing new LaTeX files
5478 \begin_layout Standard
5479 Some installations may not include a LaTeX package or class file that you
5480 would like to use within LyX.
5481 For example, you might need FoilTeX, a package for preparing slides for
5482 overhead projectors.
5483 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5484 a user interface for installing such packages.
5485 For example, with MiKTeX, you start the program
5486 \begin_inset Quotes eld
5490 \begin_inset space ~
5494 \begin_inset Quotes erd
5497 to get a list of available packages.
5498 To install one of them, right click on it or use the corresponding toolbar
5502 \begin_layout Standard
5503 If your LaTeX distribution does not provide such a `package manager', or
5504 if the package is not available from your distribution, then follow these
5505 steps to install it manually:
5508 \begin_layout Enumerate
5509 Get the package from
5510 \begin_inset CommandInset href
5513 target "http://www.ctan.org/"
5520 \begin_layout Enumerate
5521 If the package contains a file with the ending
5522 \begin_inset Quotes eld
5526 \begin_inset Flex Code
5529 \begin_layout Plain Layout
5536 \begin_inset Quotes erd
5539 (is the case for FoilTeX) then open a console, change to the folder of
5540 this file and execute the command
5541 \begin_inset Flex Code
5544 \begin_layout Plain Layout
5551 You have now unpacked the package and have all files to install it.
5552 Most LaTeX-packages are not packed and you can skip this step.
5555 \begin_layout Enumerate
5556 Now you need to decide if the package should be available for all users
5561 \begin_layout Enumerate
5562 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5563 for all users on your system, then install it in your `local' TeX tree,
5564 otherwise install it in your own `user' TeX tree.
5565 Where these trees should be created, if they do not already exist, depends
5567 To find this out, look in the file
5568 \begin_inset Flex Code
5571 \begin_layout Plain Layout
5581 \begin_layout Plain Layout
5582 This is usually in the directory
5583 \begin_inset Flex Code
5586 \begin_layout Plain Layout
5592 , though you can execute the command
5593 \begin_inset Flex Code
5596 \begin_layout Plain Layout
5607 The location of the `local' TeX tree is defined by the
5608 \begin_inset Flex Code
5611 \begin_layout Plain Layout
5617 variable; this is usually somewhere like
5618 \begin_inset Flex Code
5621 \begin_layout Plain Layout
5622 /usr/local/share/texmf
5628 The location of the `user' TeX tree is defined by
5629 \begin_inset Flex Code
5632 \begin_layout Plain Layout
5639 \begin_inset Flex Code
5642 \begin_layout Plain Layout
5649 (If these variables are not predefined, you have to define them.) You'll
5650 probably need root permissions to create or modify the `local' tree, but
5651 not for your `user' tree.
5652 \begin_inset Newline newline
5655 In general, it is recommended to install in the user tree because your user
5656 will not be modified or even overwritten when you upgrade your system.
5657 It will typically also be backed up together with everything else when
5658 you backup your home directory (which, of course, you do on a regular basis).
5661 \begin_layout Enumerate
5662 On Windows, if you want the new package to be available for all users on
5663 your system, change to the folder where LaTeX is installed and then change
5665 \begin_inset Flex Code
5668 \begin_layout Plain Layout
5679 (For MiKTeX, this would be by default the folder
5680 \begin_inset Flex Code
5683 \begin_layout Plain Layout
5701 \begin_layout Plain Layout
5702 Note that this will be the correct path only on English installations.
5703 On a German one, it would be
5704 \begin_inset Flex Code
5707 \begin_layout Plain Layout
5721 , and similarly for other languages.
5726 Create there a new folder
5727 \begin_inset Flex Code
5730 \begin_layout Plain Layout
5736 and copy all files of the package into it.
5738 \begin_inset Newline newline
5741 If the package should only available for you or you don't have admin permissions
5742 , do the same, but in the local LaTeX folder.
5744 \begin_inset space \thinspace{}
5748 \begin_inset space ~
5751 2.8 under Windows XP, this would be the folder:
5752 \begin_inset Newline newline
5758 \begin_inset Flex Code
5761 \begin_layout Plain Layout
5764 Documents and Settings
5776 \begin_inset Newline newline
5782 \begin_inset Phantom HPhantom
5785 \begin_layout Plain Layout
5796 \begin_inset Flex Code
5799 \begin_layout Plain Layout
5812 \begin_inset Newline newline
5815 On Vista, it would be:
5816 \begin_inset Newline newline
5820 \begin_inset Flex Code
5823 \begin_layout Plain Layout
5849 \begin_layout Enumerate
5850 Now one only need to tell LaTeX that there are new files.
5851 This depends on the used LaTeX-Distribution:
5855 \begin_layout Enumerate
5856 For TeXLive execute the command
5857 \begin_inset Flex Code
5860 \begin_layout Plain Layout
5867 If you installed the package for all users, then you will probably need
5868 to have root permissions for that.
5871 \begin_layout Enumerate
5872 For MiKTeX, if you have installed the package for all users, start the program
5874 \begin_inset Quotes eld
5878 \begin_inset space ~
5882 \begin_inset Quotes erd
5885 and press the button marked
5886 \begin_inset Quotes eld
5890 \begin_inset Quotes erd
5894 Otherwise start the program
5895 \begin_inset Quotes eld
5899 \begin_inset Quotes erd
5906 \begin_layout Enumerate
5907 Finally, you need to tell LyX that there are new packages available.
5908 So, in LyX, use the menu
5909 \begin_inset Flex MenuItem
5912 \begin_layout Plain Layout
5915 \SpecialChar \menuseparator
5921 and then restart LyX.
5924 \begin_layout Standard
5925 Now the package is installed.
5926 In our example, the document class
5927 \begin_inset Flex Code
5930 \begin_layout Plain Layout
5932 \begin_inset space ~
5939 \begin_layout Plain Layout
5951 will now be available under
5952 \begin_inset Flex MenuItem
5955 \begin_layout Plain Layout
5956 Document\SpecialChar \menuseparator
5957 Settings\SpecialChar \menuseparator
5967 \begin_layout Standard
5968 If you would like to use a LaTeX document class that is not even listed
5970 \begin_inset Flex MenuItem
5973 \begin_layout Plain Layout
5974 Document\SpecialChar \menuseparator
5975 Settings\SpecialChar \menuseparator
5981 , then you need to create a `layout' file for it.
5982 That is the topic of the next section.
5985 \begin_layout Section
5986 Types of layout files
5989 \begin_layout Standard
5990 This section describes the various sorts of LyX files that contain layout
5992 These files describe various paragraph and character styles, determining
5993 how LyX should display them and how they should be translated into LaTeX,
5994 DocBook, XHTML, or whatever output format is being used.
5998 \begin_layout Standard
5999 We shall try to provide a thorough description of the process of writing
6001 However, there are so many different types of documents supported even
6002 by just LaTeX that we can't hope to cover every different possibility or
6003 problem you might encounter.
6004 The LyX users' list is frequented by people with lots of experience with
6005 layout design who are willing to share what they've learned, so please
6006 feel free to ask questions there.
6009 \begin_layout Standard
6010 As you prepare to write a new layout, it is extremely helpful to look at
6011 the layouts distributed with LyX.
6012 If you write a LyX layout for a LaTeX document class that might also be
6013 used by others, or write a module that might be useful to others, then
6014 you should consider posting your layout to the
6015 \begin_inset CommandInset href
6017 name "layout section on the LyX wiki"
6018 target "http://wiki.lyx.org/Layouts/Layouts"
6022 or even to the LyX developers' list, so that it might be included in LyX
6027 \begin_layout Plain Layout
6028 Note that LyX is licensed under the General Public License, so any material
6029 that is contributed to LyX must be similarly licensed.
6037 \begin_layout Subsection
6039 \begin_inset CommandInset label
6041 name "sub:Layout-modules"
6048 \begin_layout Standard
6049 We have spoken to this point about `layout files'.
6050 But there are different sorts of files that contain layout information.
6051 Layout files, strictly so called, have the
6052 \begin_inset Flex Code
6055 \begin_layout Plain Layout
6061 extension and provide LyX with information about document classes.
6062 As of LyX 1.6, however, layout information can also be contained in layout
6068 \begin_inset Flex Code
6071 \begin_layout Plain Layout
6078 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6079 some modules—such as the
6080 \begin_inset Flex Code
6083 \begin_layout Plain Layout
6089 module—specifically provide support for one package.
6090 In a sense, layout modules are similar to included
6094 \begin_layout Plain Layout
6095 These can have any extension, but by convention have the
6096 \begin_inset Flex Code
6099 \begin_layout Plain Layout
6111 \begin_inset Flex Code
6114 \begin_layout Plain Layout
6120 —in that modules are not specific to a given document class but may be used
6121 with many different classes.
6122 The difference is that using an included file with
6123 \begin_inset Flex Code
6126 \begin_layout Plain Layout
6132 requires editing that file.
6133 Modules, by contrast, are selected in the
6134 \begin_inset Flex MenuItem
6137 \begin_layout Plain Layout
6138 Document\SpecialChar \menuseparator
6147 \begin_layout Standard
6148 Building modules is the easiest way to get started with layout editing,
6149 since it can be as simple as adding a single new paragraph style or flex
6151 But modules may, in principle, contain anything a layout file can contain.
6154 \begin_layout Standard
6155 After creating a new module and copying it to the
6156 \begin_inset Flex Code
6159 \begin_layout Plain Layout
6165 folder, you will need to reconfigure and then restart LyX for the module
6166 to appear in the menu.
6167 However, changes you make to the module will be seen immediately, if you
6169 \begin_inset Flex MenuItem
6172 \begin_layout Plain Layout
6173 Document\SpecialChar \menuseparator
6179 , highlight something, and then hit
6180 \begin_inset Quotes eld
6184 \begin_inset Quotes erd
6190 It is strongly recommended that you save your work before doing this
6195 it is strongly recommended that you not attempt to edit modules while simultaneo
6196 usly working on actual documents
6199 Though of course the developers strive to keep LyX stable in such situations,
6200 syntax errors and the like in your module file could cause strange behavior.
6203 \begin_layout Subsubsection
6207 \begin_layout Standard
6208 Modules are to LyX as packages are to LaTeX.
6209 Sometimes, however, you find yourself wanting a specific inset or character
6210 style just for one document and writing a module that will also be available
6211 to other documents makes little sense.
6212 What you need is LyX's
6213 \begin_inset Quotes eld
6217 \begin_inset Quotes erd
6223 \begin_layout Standard
6224 You will find it under
6226 Document\SpecialChar \menuseparator
6227 Settings\SpecialChar \menuseparator
6231 The large text box allows you to enter anything that you might enter in
6232 a layout file or module.
6233 You can think of a document's local layout, in fact, as a module that belongs
6235 So, in particular, you must enter a
6236 \begin_inset Flex Code
6239 \begin_layout Plain Layout
6246 Any format is acceptable, but one would normally use the format current
6248 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6249 layout is not supported by versions of LyX prior to 1.6, so you should not
6250 use it if you want to be able to export your document to LyX 1.5 or earlier
6251 (without, that is, losing the local layout information).
6252 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6253 though there is no UI for it---then you should use format 11 and, of course,
6254 use only layout constructs that were available in LyX 1.6.
6257 \begin_layout Standard
6258 When you have entered something in the
6259 \begin_inset Flex Code
6262 \begin_layout Plain Layout
6268 pane, LyX will enable the
6269 \begin_inset Quotes eld
6273 \begin_inset Quotes erd
6276 button at the bottom.
6277 Clicking this button will cause LyX to determine whether what you have
6278 entered is valid layout information for the chosen format.
6279 LyX will report the result but, unfortunately, will not tell you what errors
6280 there might have been.
6281 These will be written to the terminal, however, if LyX is started from
6283 You will not be permitted to save your local layout until you have entered
6287 \begin_layout Standard
6288 The warnings at the end of the previous section apply here, too.
6289 Do not play with local layout while you are actually working, especially
6290 if you have not saved your document.
6291 That said, using local layout with a test document can be a very convenient
6292 way to try out layout ideas, or even to start developing a module.
6295 \begin_layout Subsection
6297 \begin_inset Flex MenuItem
6300 \begin_layout Plain Layout
6309 \begin_layout Standard
6310 There are two situations you are likely to encounter when wanting to support
6311 a new LaTeX document class, involving style (
6312 \begin_inset Flex Code
6315 \begin_layout Plain Layout
6321 ) files and LaTeX2e class (
6322 \begin_inset Flex Code
6325 \begin_layout Plain Layout
6332 Supporting a style file is usually fairly easy.
6333 Supporting a new class file is a bit harder.
6334 We'll discuss the former in this section and the latter in the next.
6335 Similar remarks apply, of course, if you want to support a new DocBook
6339 \begin_layout Standard
6340 The easier case is the one in which your new document class is provided
6341 as a style file that is to be used in conjunction with an already supported
6343 For the sake of the example, we'll assume that the style file is called
6345 \begin_inset Flex MenuItem
6348 \begin_layout Plain Layout
6354 and that it is meant to be used with
6355 \begin_inset Flex MenuItem
6358 \begin_layout Plain Layout
6364 , which is a standard class.
6368 \begin_layout Standard
6369 Start by copying the existing class's layout file into your local directory:
6373 \begin_layout Plain Layout
6374 Of course, which directory is your local directory will vary by platform,
6375 and LyX allows you to specify your local directory on startup, too, using
6377 \begin_inset Flex Code
6380 \begin_layout Plain Layout
6394 \begin_layout LyX-Code
6395 cp report.layout ~/.lyx/layouts/myclass.layout
6398 \begin_layout Standard
6400 \begin_inset Flex Code
6403 \begin_layout Plain Layout
6409 and change the line:
6412 \begin_layout LyX-Code
6415 DeclareLaTeXClass{report}
6418 \begin_layout Standard
6422 \begin_layout LyX-Code
6425 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6428 \begin_layout Standard
6432 \begin_layout LyX-Code
6434 \begin_inset Newline newline
6440 \begin_inset Newline newline
6446 \begin_layout Standard
6447 near the top of the file.
6450 \begin_layout Standard
6451 Start LyX and select
6452 \begin_inset Flex MenuItem
6455 \begin_layout Plain Layout
6456 Tools\SpecialChar \menuseparator
6463 Then restart LyX and try creating a new document.
6465 \begin_inset Flex MenuItem
6468 \begin_layout Plain Layout
6474 " as a document class option in the
6475 \begin_inset Flex MenuItem
6478 \begin_layout Plain Layout
6479 Document\SpecialChar \menuseparator
6486 It is likely that some of the sectioning commands and such in your new
6487 class will work differently from how they worked in the base class—
6488 \begin_inset Flex Code
6491 \begin_layout Plain Layout
6497 in this example—so you can fiddle around with the settings for the different
6498 sections if you wish.
6499 The layout information for sections is contained in
6500 \begin_inset Flex Code
6503 \begin_layout Plain Layout
6509 , but you do not need to copy and change this file.
6510 Instead, you can simply add your changes to your layout file, after the
6512 \begin_inset Flex Code
6515 \begin_layout Plain Layout
6521 , which itself includes
6522 \begin_inset Flex Code
6525 \begin_layout Plain Layout
6532 For example, you might add these lines:
6535 \begin_layout LyX-Code
6539 \begin_layout LyX-Code
6543 \begin_layout LyX-Code
6547 \begin_layout LyX-Code
6551 \begin_layout LyX-Code
6555 \begin_layout Standard
6556 to change the font for chapter headings to sans-serif.
6557 This will override (or, in this case, add to) the existing declaration
6558 for the Chapter style.
6562 \begin_layout Standard
6563 Your new package may also provide commands or environments not present in
6565 In this case, you will want to add these to the layout file.
6567 \begin_inset CommandInset ref
6569 reference "sec:TextClass"
6573 for information on how to do so.
6576 \begin_layout Standard
6578 \begin_inset Flex MenuItem
6581 \begin_layout Plain Layout
6587 can be used with several different document classes, and even if it cannot,
6588 you might find it easiest just to write a module that you can load with
6590 The simplest possible such module would be:
6593 \begin_layout LyX-Code
6596 DeclareLyXModule{My Package}
6599 \begin_layout LyX-Code
6603 \begin_layout LyX-Code
6604 #Support for mypkg.sty.
6607 \begin_layout LyX-Code
6609 \begin_inset Newline newline
6615 \begin_layout LyX-Code
6617 \begin_inset Newline newline
6623 \begin_layout LyX-Code
6625 \begin_inset Newline newline
6631 \begin_inset Newline newline
6637 \begin_layout Standard
6638 A more complex module might modify the behavior of some existing constructs
6639 or define some new ones.
6641 \begin_inset CommandInset ref
6643 reference "sec:TextClass"
6650 \begin_layout Subsection
6652 \begin_inset Flex MenuItem
6655 \begin_layout Plain Layout
6664 \begin_layout Standard
6665 There are two possibilities here.
6666 One is that the class file is itself based upon an existing document class.
6667 For example, many thesis classes are based upon
6668 \begin_inset Flex MenuItem
6671 \begin_layout Plain Layout
6678 To see whether yours is, look for a line like
6681 \begin_layout LyX-Code
6687 \begin_layout Standard
6689 If so, then you may proceed largely as in the previous section, though
6691 \begin_inset Flex Code
6694 \begin_layout Plain Layout
6700 line will be different.
6701 If your new class is
6702 \begin_inset Flex Code
6705 \begin_layout Plain Layout
6711 and it is based upon
6712 \begin_inset Flex Code
6715 \begin_layout Plain Layout
6721 , then the line should read:
6725 \begin_layout Plain Layout
6726 And it will be easiest if you save the file to
6727 \begin_inset Flex Code
6730 \begin_layout Plain Layout
6736 : LyX assumes that the document class has the same name as the layout file.
6745 \begin_layout LyX-Code
6748 DeclareLaTeXClass[thesis,book]{thesis}
6751 \begin_layout Standard
6752 If, on the other hand, the new class is not based upon an existing class,
6753 you will probably have to
6754 \begin_inset Quotes eld
6758 \begin_inset Quotes erd
6762 We strongly suggest copying an existing layout file which uses a similar
6763 LaTeX class and then modifying it, if you can do so.
6764 At least use an existing file as a starting point so you can find out what
6765 items you need to worry about.
6766 Again, the specifics are covered below.
6769 \begin_layout Subsection
6771 \begin_inset CommandInset label
6773 name "sub:Creating-Templates"
6780 \begin_layout Standard
6781 Once you have written a layout file for a new document class, you might
6782 want to consider writing a
6787 A template acts as a kind of tutorial for your layout, showing how it might
6788 be used, though containing dummy content.
6789 You can of course look at the various templates included with LyX for ideas.
6792 \begin_layout Standard
6793 Templates are created just like usual documents: using LyX.
6794 The only difference is that usual documents contain all possible settings,
6795 including the font scheme and the paper size.
6796 Usually a user doesn't want a template to overwrite his preferred settings
6797 for such parameters.
6798 For that reason, the designer of a template should remove the corresponding
6800 \begin_inset Flex Code
6803 \begin_layout Plain Layout
6812 \begin_inset Flex Code
6815 \begin_layout Plain Layout
6823 from the template LyX file.
6824 This can be done with any simple text-editor, for example
6825 \begin_inset Flex Code
6828 \begin_layout Plain Layout
6835 \begin_inset Flex Code
6838 \begin_layout Plain Layout
6848 \begin_layout Standard
6849 Put the edited template files you create in
6850 \begin_inset Flex Code
6853 \begin_layout Plain Layout
6859 , copy the ones you use from the global template directory in
6860 \begin_inset Flex Code
6863 \begin_layout Plain Layout
6869 to the same place, and redefine the template path in the
6870 \begin_inset Flex MenuItem
6873 \begin_layout Plain Layout
6874 Tools\SpecialChar \menuseparator
6875 Preferences\SpecialChar \menuseparator
6884 \begin_layout Standard
6885 Note, by the way, that there is a template which has a particular meaning:
6887 \begin_inset Flex Code
6890 \begin_layout Plain Layout
6897 This template is loaded every time you create a new document with
6898 \begin_inset Flex MenuItem
6901 \begin_layout Plain Layout
6902 File\SpecialChar \menuseparator
6908 in order to provide useful defaults.
6909 To create this template from inside LyX, all you have to do is to open
6910 a document with the correct settings, and use the
6911 \begin_inset Flex MenuItem
6914 \begin_layout Plain Layout
6915 Save as Document Defaults
6923 \begin_layout Subsection
6924 Upgrading old layout files
6927 \begin_layout Standard
6928 The format of layout files changes with each LyX release, so old layout
6929 files need to be converted to the new format.
6930 This process has been automated since LyX 1.4: If LyX reads a layout file
6931 in an older format, it automatically calls the script
6932 \begin_inset Flex Code
6935 \begin_layout Plain Layout
6941 to convert it to a temporary file in current format.
6942 The original file is left untouched.
6943 If you use the layout file often, then, you may want to convert it permanently,
6944 so that LyX does not have to do so itself every time.
6945 To do this, you can call the converter manually:
6948 \begin_layout LyX-Code
6949 mv myclass.layout myclass.old
6952 \begin_layout LyX-Code
6953 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6956 \begin_layout Standard
6958 \begin_inset Flex Code
6961 \begin_layout Plain Layout
6967 with the name of your LyX system directory, of course.
6970 \begin_layout Standard
6971 Note that manual conversion does not affect included files, so these will
6972 have to be converted separately.
6975 \begin_layout Section
6976 \begin_inset CommandInset label
6978 name "sec:TextClass"
6982 The layout file format
6985 \begin_layout Standard
6986 When it's finally time to get your hands dirty and create or edit your own
6987 layout file, the following sections describe what you're up against.
6988 Our advice is to go slowly, save and test often, listen to soothing music,
6989 and enjoy one or two of your favorite adult beverages; more if you are
6990 getting particularly stuck.
6991 It's really not that hard, except that the multitude of options can become
6992 overwhelming if you try to do too much in one sitting.
6993 Go have another adult beverage, just for good measure.
6996 \begin_layout Standard
6997 Note that all the tags used in layout files are case-insensitive.
6999 \begin_inset Flex Code
7002 \begin_layout Plain Layout
7009 \begin_inset Flex Code
7012 \begin_layout Plain Layout
7019 \begin_inset Flex Code
7022 \begin_layout Plain Layout
7028 are really the same tag.
7029 The possible values are printed in brackets after the feature's name.
7030 The default value if a feature isn't specified inside a text class-description
7032 \begin_inset Flex Code
7035 \begin_layout Plain Layout
7044 If the argument has a data type like
7045 \begin_inset Quotes eld
7049 \begin_inset Quotes erd
7053 \begin_inset Quotes eld
7057 \begin_inset Quotes erd
7060 , the default is shown like this:
7061 \begin_inset Flex Code
7064 \begin_layout Plain Layout
7075 \begin_layout Subsection
7076 The document class declaration
7079 \begin_layout Standard
7080 Lines in a layout file which begin with
7081 \begin_inset Flex Code
7084 \begin_layout Plain Layout
7091 There is one exception to this rule.
7093 \begin_inset Flex Code
7096 \begin_layout Plain Layout
7102 files should begin with a line like:
7105 \begin_layout LyX-Code
7108 #% Do not delete the line below; configure depends on this
7111 \begin_layout LyX-Code
7116 DeclareLaTeXClass{article}
7119 \begin_layout Standard
7120 The second line is used when you (re)configure LyX.
7121 The layout file is read by the LaTeX script
7122 \begin_inset Flex Code
7125 \begin_layout Plain Layout
7131 , in a special mode where
7132 \begin_inset Flex Code
7135 \begin_layout Plain Layout
7142 The first line is just a LaTeX comment, and the second one contains the
7143 declaration of the text class.
7144 If these lines appear in a file named
7145 \begin_inset Flex Code
7148 \begin_layout Plain Layout
7154 , then they define a text class of name
7155 \begin_inset Flex Code
7158 \begin_layout Plain Layout
7164 (the name of the layout file) which uses the LaTeX document class
7165 \begin_inset Flex Code
7168 \begin_layout Plain Layout
7174 (the default is to use the same name as the layout).
7176 \begin_inset Quotes eld
7180 \begin_inset Quotes erd
7183 that appears above is used as a description of the text class in the
7184 \begin_inset Flex MenuItem
7187 \begin_layout Plain Layout
7188 Document\SpecialChar \menuseparator
7197 \begin_layout Standard
7198 Let's assume that you wrote your own text class that uses the
7199 \begin_inset Flex Code
7202 \begin_layout Plain Layout
7208 document class, but where you changed the appearance of the section headings.
7209 If you put it in a file
7210 \begin_inset Flex Code
7213 \begin_layout Plain Layout
7219 , the header of this file should be:
7222 \begin_layout LyX-Code
7225 #% Do not delete the line below; configure depends on this
7228 \begin_layout LyX-Code
7233 DeclareLaTeXClass[article]{article (with my own headings)}
7236 \begin_layout Standard
7237 This declares a text class
7238 \begin_inset Flex Code
7241 \begin_layout Plain Layout
7247 , associated with the LaTeX document class
7248 \begin_inset Flex Code
7251 \begin_layout Plain Layout
7258 \begin_inset Quotes eld
7261 article (with my own headings)
7262 \begin_inset Quotes erd
7266 If your text class depends on several packages, you can declare it as:
7269 \begin_layout LyX-Code
7272 #% Do not delete the line below; configure depends on this
7275 \begin_layout LyX-Code
7280 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7283 \begin_layout Standard
7284 This indicates that your text class uses the
7285 \begin_inset Flex Code
7288 \begin_layout Plain Layout
7295 Finally, it is also possible to declare classes for DocBook code.
7296 Typical declarations will look like:
7299 \begin_layout LyX-Code
7302 #% Do not delete the line below; configure depends on this
7305 \begin_layout LyX-Code
7310 DeclareDocBookClass[article]{SGML (DocBook article)}
7313 \begin_layout Standard
7314 Note that these declarations can also be given an optional parameter declaring
7315 the name of the document class (but not a list).
7318 \begin_layout Standard
7319 So, to be as explicit as possible, the form of the layout declaration is:
7322 \begin_layout LyX-Code
7327 DeclareLaTeXClass[class,package.sty]{layout description}
7330 \begin_layout Standard
7331 The class need only be specified if the name of the LaTeX class file and
7332 the name of the layout file are different or if there are packages to load.
7333 If the name of the class file is not specified, then LyX will simply assume
7334 that it is the same as the name of the layout file.
7337 \begin_layout Standard
7338 When the text class has been modified to your taste, all you have to do
7339 is to copy it either to
7340 \begin_inset Flex Code
7343 \begin_layout Plain Layout
7350 \begin_inset Flex Code
7353 \begin_layout Plain Layout
7360 \begin_inset Flex MenuItem
7363 \begin_layout Plain Layout
7364 Tools\SpecialChar \menuseparator
7370 , exit LyX and restart.
7371 Then your new text class should be available along with the others.
7374 \begin_layout Standard
7375 Once the layout file is installed, you can edit it and see your changes
7376 without having to reconfigure or to restart LyX.
7381 \begin_layout Plain Layout
7382 In versions of LyX prior to 1.6, this was not true.
7383 As a result, editing layout files was very time consuming, since you had
7384 constantly to restart LyX to see changes.
7389 You can force a reload of the current layout by using the LyX function
7391 \begin_inset Flex MenuItem
7394 \begin_layout Plain Layout
7401 There is no default binding for this function—though, of course, you can
7402 bind it to a key yourself.
7403 But you will normally use this function simply by entering it in the mini-buffe
7408 \begin_layout Standard
7414 \begin_inset Flex MenuItem
7417 \begin_layout Plain Layout
7423 is very much an `advanced feature'.
7428 recommended that you save your work before using this function.
7433 recommended that you not attempt to edit layout information while simultaneousl
7434 y working on a document that you care about.
7435 Use a test document.
7436 Syntax errors and the like in your layout file could cause peculiar behavior.
7437 In particular, such errors could cause LyX to regard the current layout
7438 as invalid and to attempt to switch to some other layout.
7442 \begin_layout Plain Layout
7443 Really bad syntax errors may even caused LyX to exit.
7444 This is because certain sorts of errors may make LyX unable to read
7454 The LyX team strives to keep LyX stable in such situations, but safe is
7459 \begin_layout Plain Layout
7460 While we're giving advice: make regular backups.
7461 And be nice to your mother.
7469 \begin_layout Subsection
7470 The Module declaration
7473 \begin_layout Standard
7474 A module must begin with a line like the following:
7477 \begin_layout LyX-Code
7480 DeclareLyXModule[endnotes.sty]{Endnotes}
7483 \begin_layout Standard
7484 The mandatory argument, in curly brackets, is the name of the module, as
7486 \begin_inset Flex MenuItem
7489 \begin_layout Plain Layout
7490 Document\SpecialChar \menuseparator
7491 Settings\SpecialChar \menuseparator
7498 The argument in square brackets is optional: It declares any LaTeX packages
7499 on which the module depends.
7500 Please note that only packages about which LyX knows should be listed in
7501 the square brackets.
7505 \begin_layout Plain Layout
7506 The list of such packages is documented only in the source code.
7511 LyX will not check for arbitrary packages.
7512 It is also possible to use the form
7513 \begin_inset Flex MenuItem
7516 \begin_layout Plain Layout
7522 as an optional argument, which declares that the module can only be used
7523 when there exists a conversion chain between the formats `
7524 \begin_inset Flex Code
7527 \begin_layout Plain Layout
7534 \begin_inset Flex Code
7537 \begin_layout Plain Layout
7546 \begin_layout Standard
7547 The module declaration should then be followed by lines like the following
7551 \begin_layout Plain Layout
7552 Preferably in English if the module should be published with LyX.
7553 This description will appear in the list of messages to be translated and
7554 will be thus translated with the next interface update.
7562 \begin_layout LyX-Code
7566 \begin_layout LyX-Code
7567 #Adds an endnote command, in addition to footnotes.
7571 \begin_layout LyX-Code
7572 #You will need to add
7574 theendnotes in TeX code where you
7577 \begin_layout LyX-Code
7578 #want the endnotes to appear.
7582 \begin_layout LyX-Code
7586 \begin_layout LyX-Code
7587 #Requires: somemodule | othermodule
7590 \begin_layout LyX-Code
7591 #Excludes: badmodule
7594 \begin_layout Standard
7595 The description is used in
7596 \begin_inset Flex MenuItem
7599 \begin_layout Plain Layout
7600 Document\SpecialChar \menuseparator
7601 Settings\SpecialChar \menuseparator
7607 to provide the user with information about what the module does.
7609 \begin_inset Flex Code
7612 \begin_layout Plain Layout
7618 line is used to identify other modules with which this one must be used;
7620 \begin_inset Flex Code
7623 \begin_layout Plain Layout
7629 line is used to identify modules with which this one may not be used.
7630 Both are optional, and, as shown, multiple modules should be separated
7631 with the pipe symbol: |.
7632 Note that the required modules are treated disjunctively:
7636 of the required modules must be used.
7641 excluded module may be used.
7642 Note that modules are identified here by their
7647 \begin_inset Flex Code
7650 \begin_layout Plain Layout
7658 \begin_inset Flex Code
7661 \begin_layout Plain Layout
7668 \begin_inset Flex Code
7671 \begin_layout Plain Layout
7680 \begin_layout Subsection
7684 \begin_layout Standard
7685 The first non-comment line of any layout file, included file, or module
7690 contain the file format number:
7693 \begin_layout Description
7694 \begin_inset Flex Code
7697 \begin_layout Plain Layout
7704 \begin_inset Flex Code
7707 \begin_layout Plain Layout
7713 ] The format of the layout file.
7716 \begin_layout Standard
7717 This tag was introduced with LyX 1.4.0.
7718 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7719 and are considered to be of format 1.
7720 The format for the present version of LyX is format 21.
7721 But each version of LyX is capable of reading earlier versions' layout
7722 files, just as they are capable of reading files produced by earlier versions
7724 There is, however, no provision for converting to earlier formats.
7725 So LyX 1.6.x will not read layout files in format 21 but only files in format
7729 \begin_layout Subsection
7730 \begin_inset CommandInset label
7732 name "sub:General-text-class"
7736 General text class parameters
7739 \begin_layout Standard
7740 These are general parameters that govern the behavior of an entire document
7746 mean that they must appear in
7747 \begin_inset Flex Code
7750 \begin_layout Plain Layout
7756 files rather than in modules.
7757 A module can contain any layout tag.)
7760 \begin_layout Description
7761 \begin_inset Flex Code
7764 \begin_layout Plain Layout
7770 Adds information that will be output in the
7771 \begin_inset Flex Code
7774 \begin_layout Plain Layout
7780 block when this document class is output to XHTML.
7781 Typically, this would be used to output CSS style information, but it can
7782 be used for anything that can appear in
7783 \begin_inset Flex Code
7786 \begin_layout Plain Layout
7794 \begin_inset Quotes eld
7798 \begin_inset Flex Code
7801 \begin_layout Plain Layout
7808 \begin_inset Quotes erd
7814 \begin_layout Description
7815 \begin_inset Flex Code
7818 \begin_layout Plain Layout
7824 Adds information to the document preamble.
7826 \begin_inset Quotes eld
7830 \begin_inset Flex Code
7833 \begin_layout Plain Layout
7840 \begin_inset Quotes erd
7846 \begin_layout Description
7847 \begin_inset Flex Code
7850 \begin_layout Plain Layout
7856 Defines formats for use in the display of bibliographic information.
7858 \begin_inset CommandInset ref
7860 reference "sub:Citation-format-description"
7866 \begin_inset Quotes eld
7870 \begin_inset Flex Code
7873 \begin_layout Plain Layout
7880 \begin_inset Quotes erd
7886 \begin_layout Description
7887 \begin_inset Flex Code
7890 \begin_layout Plain Layout
7896 Describes various global options supported by the document class.
7898 \begin_inset space ~
7902 \begin_inset CommandInset ref
7904 reference "sub:ClassOptions"
7910 \begin_inset Quotes eld
7914 \begin_inset Flex Code
7917 \begin_layout Plain Layout
7924 \begin_inset Quotes erd
7930 \begin_layout Description
7931 \begin_inset Flex Code
7934 \begin_layout Plain Layout
7941 \begin_inset Flex Code
7944 \begin_layout Plain Layout
7953 \begin_inset Flex Code
7956 \begin_layout Plain Layout
7962 ] Whether the class should
7966 to having one or two columns.
7967 Can be changed in the
7968 \begin_inset Flex MenuItem
7971 \begin_layout Plain Layout
7972 Document\SpecialChar \menuseparator
7981 \begin_layout Description
7982 \begin_inset Flex Code
7985 \begin_layout Plain Layout
7992 \begin_inset Flex Code
7995 \begin_layout Plain Layout
8001 ] This sequence defines the properties for a counter.
8002 If the counter does not yet exist, it is created; if it does exist, it
8005 \begin_inset Quotes eld
8009 \begin_inset Flex Code
8012 \begin_layout Plain Layout
8019 \begin_inset Quotes erd
8023 \begin_inset Newline newline
8027 \begin_inset space ~
8031 \begin_inset CommandInset ref
8033 reference "sub:Counters"
8037 for details on counters.
8040 \begin_layout Description
8041 \begin_inset Flex Code
8044 \begin_layout Plain Layout
8050 Sets the default font used to display the document.
8052 \begin_inset space ~
8056 \begin_inset CommandInset ref
8058 reference "sub:Font-description"
8062 for how to declare fonts.
8064 \begin_inset Quotes eld
8068 \begin_inset Flex Code
8071 \begin_layout Plain Layout
8078 \begin_inset Quotes erd
8084 \begin_layout Description
8085 \begin_inset Flex Code
8088 \begin_layout Plain Layout
8095 \begin_inset Flex Code
8098 \begin_layout Plain Layout
8104 Specifies a module to be included by default with this document class.
8105 The module should be specified by filename without the
8106 \begin_inset Flex Code
8109 \begin_layout Plain Layout
8116 The user can still remove the module, but it will be active at the outset.
8117 (This applies only when new files are created, or when this class is chosen
8118 for an existing document.)
8121 \begin_layout Description
8122 \begin_inset Flex Code
8125 \begin_layout Plain Layout
8132 \begin_inset Flex Code
8135 \begin_layout Plain Layout
8141 ] This is the style that will be assigned to new paragraphs, usually
8142 \begin_inset Flex MenuItem
8145 \begin_layout Plain Layout
8152 This will default to the first defined style if not given, but you are
8153 encouraged to use this directive.
8156 \begin_layout Description
8157 \begin_inset Flex Code
8160 \begin_layout Plain Layout
8167 \begin_inset Flex Code
8170 \begin_layout Plain Layout
8176 ] This tag indicates that the module in question—which should be specified
8177 by filename without the
8178 \begin_inset Flex Code
8181 \begin_layout Plain Layout
8187 extension—cannot be used with this document class.
8188 This might be used in a journal-specific layout file to prevent, say, the
8190 \begin_inset Flex Code
8193 \begin_layout Plain Layout
8199 module that numbers theorems by section.
8204 be used in a module.
8205 Modules have their own way of excluding other modules (see
8206 \begin_inset CommandInset ref
8208 reference "sub:Layout-modules"
8215 \begin_layout Description
8216 \begin_inset Flex Code
8219 \begin_layout Plain Layout
8225 Defines a new float.
8227 \begin_inset space ~
8231 \begin_inset CommandInset ref
8233 reference "sub:Floats"
8239 \begin_inset Quotes eld
8243 \begin_inset Flex Code
8246 \begin_layout Plain Layout
8253 \begin_inset Quotes erd
8259 \begin_layout Description
8260 \begin_inset Flex Code
8263 \begin_layout Plain Layout
8269 Sets the information that will be output in the
8270 \begin_inset Flex Code
8273 \begin_layout Plain Layout
8279 block when this document class is output to XHTML.
8280 Note that this will completely override any prior
8281 \begin_inset Flex Code
8284 \begin_layout Plain Layout
8291 \begin_inset Flex Code
8294 \begin_layout Plain Layout
8302 \begin_inset Flex Code
8305 \begin_layout Plain Layout
8311 if you just want to add material to the preamble.) Must end with
8312 \begin_inset Quotes eld
8316 \begin_inset Flex Code
8319 \begin_layout Plain Layout
8326 \begin_inset Quotes erd
8332 \begin_layout Description
8333 \begin_inset Flex Code
8336 \begin_layout Plain Layout
8343 \begin_inset Flex Code
8346 \begin_layout Plain Layout
8352 ] The layout to use for the table of contents, bibliography, and so forth,
8353 when the document is output to HTML.
8354 For articles, this should normally be Section; for books, Chapter.
8355 If it is not given, then LyX will attempt to figure out which layout to
8359 \begin_layout Description
8360 \begin_inset Flex Code
8363 \begin_layout Plain Layout
8370 \begin_inset Flex Code
8373 \begin_layout Plain Layout
8379 ] Modifies the properties of the given counter.
8380 If the counter does not exist, the section is ignored.
8382 \begin_inset Quotes eld
8386 \begin_inset Flex Code
8389 \begin_layout Plain Layout
8396 \begin_inset Quotes erd
8400 \begin_inset Newline newline
8404 \begin_inset space ~
8408 \begin_inset CommandInset ref
8410 reference "sub:Counters"
8414 for details on counters.
8417 \begin_layout Description
8418 \begin_inset Flex Code
8421 \begin_layout Plain Layout
8428 \begin_inset Flex Code
8431 \begin_layout Plain Layout
8437 ] Modifies the properties of the given paragraph style.
8438 If the style does not exist, the section is ignored.
8440 \begin_inset Quotes eld
8444 \begin_inset Flex Code
8447 \begin_layout Plain Layout
8454 \begin_inset Quotes erd
8460 \begin_layout Description
8461 \begin_inset Flex Code
8464 \begin_layout Plain Layout
8470 As its name implies, this command allows you to include another layout
8471 definition file within yours to avoid duplicating commands.
8472 Common examples are the standard layout files, for example,
8473 \begin_inset Flex Code
8476 \begin_layout Plain Layout
8482 , which contains most of the basic layouts.
8485 \begin_layout Description
8486 \begin_inset Flex Code
8489 \begin_layout Plain Layout
8495 This section (re-)defines the layout of an inset.
8496 It can be applied to an existing inset or to a new, user-defined inset,
8497 e.g., a new character style.
8499 \begin_inset Quotes eld
8503 \begin_inset Flex Code
8506 \begin_layout Plain Layout
8513 \begin_inset Quotes erd
8517 \begin_inset Newline newline
8521 \begin_inset space ~
8525 \begin_inset CommandInset ref
8527 reference "sub:Flex-insets-and"
8531 for more information.
8535 \begin_layout Description
8536 \begin_inset Flex Code
8539 \begin_layout Plain Layout
8546 \begin_inset Flex Code
8549 \begin_layout Plain Layout
8555 ] A string that indicates the width of the left margin on the screen, for
8557 \begin_inset Quotes eld
8561 \begin_inset Quotes erd
8565 (Note that this is not a `length', like
8566 \begin_inset Quotes eld
8570 \begin_inset Quotes erd
8576 \begin_layout Description
8577 \begin_inset Flex Code
8580 \begin_layout Plain Layout
8587 \begin_inset Flex Code
8590 \begin_layout Plain Layout
8596 ] This command deletes an existing counter, usually one defined in an included
8600 \begin_layout Description
8601 \begin_inset Flex Code
8604 \begin_layout Plain Layout
8610 This command deletes an existing float.
8611 This is particularly useful when you want to suppress a float that has
8612 been defined in an input file.
8615 \begin_layout Description
8616 \begin_inset Flex Code
8619 \begin_layout Plain Layout
8625 This command deletes an existing style.
8626 This is particularly useful when you want to suppress a style that has
8627 be defined in an input file.
8630 \begin_layout Description
8631 \begin_inset Flex Code
8634 \begin_layout Plain Layout
8640 A string indicating the file format (as defined in the Preferences dialog)
8641 produced by this class.
8642 It is mainly useful when
8643 \begin_inset Flex Code
8646 \begin_layout Plain Layout
8652 is `literate' and one wants to define a new type of literate document.
8653 This string is reset to `docbook', `latex', or `literate' when the correspondin
8655 \begin_inset Flex Code
8658 \begin_layout Plain Layout
8664 parameter is encountered.
8667 \begin_layout Description
8668 \begin_inset Flex Code
8671 \begin_layout Plain Layout
8677 A string indicating what sort of output documents using this class will
8679 At present, the options are: `docbook', `latex', and `literate'.
8682 \begin_layout Description
8683 \begin_inset Flex Code
8686 \begin_layout Plain Layout
8693 \begin_inset Flex Code
8696 \begin_layout Plain Layout
8705 \begin_inset Flex Code
8708 \begin_layout Plain Layout
8715 \begin_inset Flex Code
8718 \begin_layout Plain Layout
8724 ] The default pagestyle.
8725 Can be changed in the
8726 \begin_inset Flex MenuItem
8729 \begin_layout Plain Layout
8730 Document\SpecialChar \menuseparator
8739 \begin_layout Description
8740 \begin_inset Flex Code
8743 \begin_layout Plain Layout
8749 Sets the preamble for the LaTeX document.
8750 Note that this will completely override any prior
8751 \begin_inset Flex Code
8754 \begin_layout Plain Layout
8761 \begin_inset Flex Code
8764 \begin_layout Plain Layout
8772 \begin_inset Flex Code
8775 \begin_layout Plain Layout
8781 if you just want to add material to the preamble.) Must end with
8782 \begin_inset Quotes eld
8786 \begin_inset Flex Code
8789 \begin_layout Plain Layout
8796 \begin_inset Quotes erd
8802 \begin_layout Description
8803 \begin_inset Flex Code
8806 \begin_layout Plain Layout
8813 \begin_inset Flex Code
8816 \begin_layout Plain Layout
8823 \begin_inset Flex Code
8826 \begin_layout Plain Layout
8835 \begin_inset Flex Code
8838 \begin_layout Plain Layout
8844 ] Whether the class already provides the feature
8845 \begin_inset Flex Code
8848 \begin_layout Plain Layout
8855 A feature is in general the name of a package (
8856 \begin_inset Flex Code
8859 \begin_layout Plain Layout
8866 \begin_inset Flex Code
8869 \begin_layout Plain Layout
8875 , \SpecialChar \ldots{}
8877 \begin_inset Flex Code
8880 \begin_layout Plain Layout
8887 \begin_inset Flex Code
8890 \begin_layout Plain Layout
8896 ,\SpecialChar \ldots{}
8897 ); the complete list of supported features is unfortunately not documented
8898 outside the LyX source code—but see
8899 \begin_inset Flex Code
8902 \begin_layout Plain Layout
8908 if you're interested.
8910 \begin_inset Flex MenuItem
8913 \begin_layout Plain Layout
8914 Help\SpecialChar \menuseparator
8920 also gives an overview of the supported packages.
8923 \begin_layout Description
8924 \begin_inset Flex Code
8927 \begin_layout Plain Layout
8934 \begin_inset Flex Code
8937 \begin_layout Plain Layout
8943 ] Indicates that this layout provides the functionality of the module mentioned,
8944 which should be specified by the filename without the
8945 \begin_inset Flex Code
8948 \begin_layout Plain Layout
8955 This will typically be used if the layout includes the module directly,
8956 rather than using the
8957 \begin_inset Flex Code
8960 \begin_layout Plain Layout
8966 tag to indicate that it ought to be used.
8967 It could also be used in a module that provided an alternate implementation
8968 of the same functionality.
8971 \begin_layout Description
8972 \begin_inset Flex Code
8975 \begin_layout Plain Layout
8982 \begin_inset Flex Code
8985 \begin_layout Plain Layout
8991 ] Whether the class requires the feature
8992 \begin_inset Flex Code
8995 \begin_layout Plain Layout
9002 Multiple features must be separated by commas.
9003 Note that you can only request supported features.
9005 \begin_inset Flex Code
9008 \begin_layout Plain Layout
9014 for a list of these.)
9017 \begin_layout Description
9018 \begin_inset Flex Code
9021 \begin_layout Plain Layout
9027 A string that indicates the width of the right margin on the screen, for
9029 \begin_inset Quotes eld
9033 \begin_inset Quotes erd
9039 \begin_layout Description
9040 \begin_inset Flex Code
9043 \begin_layout Plain Layout
9049 Sets which divisions get numbered.
9051 \begin_inset Flex Code
9054 \begin_layout Plain Layout
9063 \begin_layout Description
9064 \begin_inset Flex Code
9067 \begin_layout Plain Layout
9074 \begin_inset Flex Code
9077 \begin_layout Plain Layout
9086 \begin_inset Flex Code
9089 \begin_layout Plain Layout
9095 ] Whether the class-default should be printing on one or both sides of the
9097 Can be changed in the
9098 \begin_inset Flex MenuItem
9101 \begin_layout Plain Layout
9102 Document\SpecialChar \menuseparator
9111 \begin_layout Description
9112 \begin_inset Flex Code
9115 \begin_layout Plain Layout
9121 This sequence defines a paragraph style.
9122 If the style does not yet exist, it is created; if it does exist, its parameter
9125 \begin_inset Quotes eld
9129 \begin_inset Flex Code
9132 \begin_layout Plain Layout
9139 \begin_inset Quotes erd
9143 \begin_inset Newline newline
9147 \begin_inset space ~
9151 \begin_inset CommandInset ref
9153 reference "sub:Paragraph-Styles"
9157 for details on paragraph styles.
9160 \begin_layout Description
9161 \begin_inset Flex Code
9164 \begin_layout Plain Layout
9171 \begin_inset Flex Code
9174 \begin_layout Plain Layout
9180 ] The name of the command or environment to be used with
9181 \begin_inset Flex Code
9184 \begin_layout Plain Layout
9193 \begin_layout Description
9194 \begin_inset Flex Code
9197 \begin_layout Plain Layout
9204 \begin_inset Flex Code
9207 \begin_layout Plain Layout
9216 \begin_inset Flex Code
9219 \begin_layout Plain Layout
9225 ] Indicates what kind of markup is used to define the title of a document.
9227 \begin_inset Flex Code
9230 \begin_layout Plain Layout
9236 means that the macro with name
9237 \begin_inset Flex Code
9240 \begin_layout Plain Layout
9246 will be inserted after the last layout which has
9247 \begin_inset Quotes eld
9251 \begin_inset Flex Code
9254 \begin_layout Plain Layout
9261 \begin_inset Quotes erd
9266 \begin_inset Flex Code
9269 \begin_layout Plain Layout
9275 corresponds to the case where the block of paragraphs which have
9276 \begin_inset Quotes eld
9280 \begin_inset Flex Code
9283 \begin_layout Plain Layout
9290 \begin_inset Quotes erd
9293 should be enclosed into the
9294 \begin_inset Flex Code
9297 \begin_layout Plain Layout
9306 \begin_layout Description
9307 \begin_inset Flex Code
9310 \begin_layout Plain Layout
9316 Sets which divisions are included in the table of contents.
9318 \begin_inset Flex Code
9321 \begin_layout Plain Layout
9330 \begin_layout Subsection
9331 \begin_inset Flex Code
9334 \begin_layout Plain Layout
9341 \begin_inset CommandInset label
9343 name "sub:ClassOptions"
9350 \begin_layout Standard
9352 \begin_inset Flex Code
9355 \begin_layout Plain Layout
9361 section can contain the following entries:
9364 \begin_layout Description
9365 \begin_inset Flex Code
9368 \begin_layout Plain Layout
9375 \begin_inset Flex Code
9378 \begin_layout Plain Layout
9384 ] The list of available font sizes for the document's main font, separated
9386 \begin_inset Quotes eld
9390 \begin_inset Flex Code
9393 \begin_layout Plain Layout
9400 \begin_inset Quotes erd
9406 \begin_layout Description
9407 \begin_inset Flex Code
9410 \begin_layout Plain Layout
9416 Used to set the DTD line with XML-based output classes.
9418 \begin_inset space \thinspace{}
9422 \begin_inset Quotes eld
9425 -//OASIS//DTD DocBook V4.2//EN
9426 \begin_inset Quotes erd
9432 \begin_layout Description
9433 \begin_inset Flex Code
9436 \begin_layout Plain Layout
9443 \begin_inset Flex Code
9446 \begin_layout Plain Layout
9447 string="empty|plain|headings|fancy"
9452 ] The list of available page styles, separated by
9453 \begin_inset Quotes eld
9457 \begin_inset Flex Code
9460 \begin_layout Plain Layout
9467 \begin_inset Quotes erd
9473 \begin_layout Description
9474 \begin_inset Flex Code
9477 \begin_layout Plain Layout
9484 \begin_inset Flex Code
9487 \begin_layout Plain Layout
9493 ] Some document class options, separated by a comma, that will be added
9494 to the optional part of the
9495 \begin_inset Flex Code
9498 \begin_layout Plain Layout
9509 \begin_layout Standard
9511 \begin_inset Flex Code
9514 \begin_layout Plain Layout
9520 section must end with
9521 \begin_inset Quotes eld
9525 \begin_inset Flex Code
9528 \begin_layout Plain Layout
9535 \begin_inset Quotes erd
9541 \begin_layout Subsection
9543 \begin_inset CommandInset label
9545 name "sub:Paragraph-Styles"
9552 \begin_layout Standard
9553 A paragraph style description looks like this:
9557 \begin_layout Plain Layout
9558 Note that this will either define a new style or modify an existing one.
9566 \begin_layout LyX-Code
9573 \begin_layout LyX-Code
9577 \begin_layout LyX-Code
9581 \begin_layout Standard
9582 where the following commands are allowed:
9585 \begin_layout Description
9586 \begin_inset Flex Code
9589 \begin_layout Plain Layout
9596 \begin_inset Flex Code
9599 \begin_layout Plain Layout
9604 , left, right, center
9609 ] Paragraph alignment.
9612 \begin_layout Description
9613 \begin_inset Flex Code
9616 \begin_layout Plain Layout
9623 \begin_inset Flex Code
9626 \begin_layout Plain Layout
9631 , left, right, center
9636 ] A comma separated list of permitted alignments.
9637 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9639 For example a right-aligned or centered enumeration isn't possible.)
9642 \begin_layout Description
9643 \begin_inset Flex Code
9646 \begin_layout Plain Layout
9652 Note that this will completely override any prior
9653 \begin_inset Flex Code
9656 \begin_layout Plain Layout
9662 declaration for this style.
9664 \begin_inset Quotes eld
9668 \begin_inset Flex Code
9671 \begin_layout Plain Layout
9678 \begin_inset Quotes erd
9683 \begin_inset CommandInset ref
9685 reference "sub:I18n"
9689 for details on its use.
9692 \begin_layout Description
9693 \begin_inset Flex Code
9696 \begin_layout Plain Layout
9703 \begin_inset Flex Code
9706 \begin_layout Plain Layout
9716 \begin_layout Plain Layout
9717 Note that a `float' here is a real number, such as: 1.5.
9722 The vertical space with which the last of a chain of paragraphs with this
9723 style is separated from the following paragraph.
9724 If the next paragraph has another style, the separations are not simply
9725 added, but the maximum is taken.
9728 \begin_layout Description
9729 \begin_inset Flex Code
9732 \begin_layout Plain Layout
9739 \begin_inset Flex Code
9742 \begin_layout Plain Layout
9748 The category for this style.
9749 This is used to group related styles in the style combobox on the toolbar.
9750 Any string can be used, but you may want to use existing categories with
9755 \begin_layout Description
9756 \begin_inset Flex Code
9759 \begin_layout Plain Layout
9765 Depth of XML command.
9766 Used only with XML-type formats.
9769 \begin_layout Description
9770 \begin_inset Flex Code
9773 \begin_layout Plain Layout
9780 \begin_inset CommandInset label
9782 name "des:CopyStyle"
9787 \begin_inset Flex Code
9790 \begin_layout Plain Layout
9796 Copies all the features of an existing style into the current one.
9800 \begin_layout Description
9801 \begin_inset Flex Code
9804 \begin_layout Plain Layout
9810 The name of a style whose preamble should be output
9815 This allows to ensure some ordering of the preamble snippets when macros
9816 definitions depend on one another.
9820 \begin_layout Plain Layout
9821 Note that, besides that functionality, there is no way to ensure any ordering
9823 The ordering that you see in a given version of LyX may change without
9824 warning in later versions.
9832 \begin_layout Description
9833 \begin_inset Flex Code
9836 \begin_layout Plain Layout
9843 \begin_inset Flex Code
9846 \begin_layout Plain Layout
9851 , Box, Filled_Box, Static
9856 ] The type of label that stands at the end of the paragraph (or sequence
9858 \begin_inset Flex Code
9861 \begin_layout Plain Layout
9868 \begin_inset Flex Code
9871 \begin_layout Plain Layout
9878 \begin_inset Flex Code
9881 \begin_layout Plain Layout
9888 \begin_inset Flex Code
9891 \begin_layout Plain Layout
9899 \begin_inset Flex Code
9902 \begin_layout Plain Layout
9909 \begin_inset Quotes eld
9913 \begin_inset Quotes erd
9917 \begin_inset Flex Code
9920 \begin_layout Plain Layout
9927 \begin_inset Flex Code
9930 \begin_layout Plain Layout
9931 \begin_inset space ~
9940 \begin_inset space ~
9943 black) square suitable for end of proof markers,
9944 \begin_inset Flex Code
9947 \begin_layout Plain Layout
9953 is an explicit text string.
9956 \begin_layout Description
9957 \begin_inset Flex Code
9960 \begin_layout Plain Layout
9967 \begin_inset Flex Code
9970 \begin_layout Plain Layout
9976 ] The string used for a label with a
9977 \begin_inset Flex Code
9980 \begin_layout Plain Layout
9987 \begin_inset Flex Code
9990 \begin_layout Plain Layout
10000 \begin_layout Description
10001 \begin_inset Flex Code
10004 \begin_layout Plain Layout
10010 The font used for both the text body
10016 \begin_inset space ~
10020 \begin_inset CommandInset ref
10022 reference "sub:Font-description"
10027 Note that defining this font automatically defines the
10028 \begin_inset Flex Code
10031 \begin_layout Plain Layout
10038 So you should define this one first if you also want to define
10039 \begin_inset Flex Code
10042 \begin_layout Plain Layout
10051 \begin_layout Description
10052 \begin_inset Flex Code
10055 \begin_layout Plain Layout
10062 \begin_inset CommandInset label
10064 name "des:FreeSpacing"
10069 \begin_inset Flex Code
10072 \begin_layout Plain Layout
10081 \begin_inset Flex Code
10084 \begin_layout Plain Layout
10090 ] Usually LyX doesn't allow you to insert more than one space between words,
10091 since a space is considered as the separation between two words, not a
10092 character or symbol of its own.
10093 This is a very fine thing but sometimes annoying, for example, when typing
10094 program code or plain LaTeX code.
10096 \begin_inset Flex Code
10099 \begin_layout Plain Layout
10106 Note that LyX will create protected blanks for the additional blanks when
10107 in another mode than LaTeX-mode.
10110 \begin_layout Description
10111 \begin_inset Flex Code
10114 \begin_layout Plain Layout
10120 These tags are used with XHTML output.
10122 \begin_inset CommandInset ref
10124 reference "sub:Paragraph-Style-XHTML"
10131 \begin_layout Description
10132 \begin_inset Flex Code
10135 \begin_layout Plain Layout
10141 [[FIXME]] (Used only with XML-type formats.)
10144 \begin_layout Description
10145 \begin_inset Flex Code
10148 \begin_layout Plain Layout
10155 \begin_inset Flex Code
10158 \begin_layout Plain Layout
10164 If 1, marks the style as to be included in the document preamble rather
10165 than in the document body.
10166 This is useful for document classes that want such information as the title
10167 and author to appear in the preamble.
10168 Note that this works only for styles for which the
10169 \begin_inset Flex Code
10172 \begin_layout Plain Layout
10179 \begin_inset Flex Code
10182 \begin_layout Plain Layout
10189 \begin_inset Flex Code
10192 \begin_layout Plain Layout
10201 \begin_layout Description
10202 \begin_inset Flex Code
10205 \begin_layout Plain Layout
10212 \begin_inset Flex Code
10215 \begin_layout Plain Layout
10221 If 1, marks the style as being part of a title block (see also the
10222 \begin_inset Flex Code
10225 \begin_layout Plain Layout
10232 \begin_inset Flex Code
10235 \begin_layout Plain Layout
10244 \begin_layout Description
10245 \begin_inset Flex Code
10248 \begin_layout Plain Layout
10255 \begin_inset Flex Code
10258 \begin_layout Plain Layout
10264 ] This provides extra space between paragraphs that have the same style.
10265 If you put other styles into an environment, each is separated with the
10267 \begin_inset Flex Code
10270 \begin_layout Plain Layout
10277 But the whole items of the environment are additionally separated with
10279 \begin_inset Flex Code
10282 \begin_layout Plain Layout
10289 Note that this is a
10294 \begin_layout Description
10295 \begin_inset Flex Code
10298 \begin_layout Plain Layout
10304 [[FIXME]] (Used only with XML-type formats.)
10307 \begin_layout Description
10308 \begin_inset Flex Code
10311 \begin_layout Plain Layout
10318 \begin_inset CommandInset label
10320 name "des:KeepEmpty"
10325 \begin_inset Flex Code
10328 \begin_layout Plain Layout
10337 \begin_inset Flex Code
10340 \begin_layout Plain Layout
10346 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10347 lead to empty LaTeX output.
10348 There are some cases where this could be desirable however: in a letter
10349 template, the required fields can be provided as empty fields, so that
10350 people do not forget them; in some special classes, a style can be used
10351 as some kind of break, which does not contain actual text.
10354 \begin_layout Description
10355 \begin_inset Flex Code
10358 \begin_layout Plain Layout
10364 [float=0] The vertical space between the label and the text body.
10365 Only used for labels that are above the text body (
10366 \begin_inset Flex Code
10369 \begin_layout Plain Layout
10376 \begin_inset Flex Code
10379 \begin_layout Plain Layout
10380 Centered_Top_Environment
10388 \begin_layout Description
10389 \begin_inset Flex Code
10392 \begin_layout Plain Layout
10399 \begin_inset Flex Code
10402 \begin_layout Plain Layout
10409 \begin_inset Newline newline
10412 The name of the counter for automatic numbering.
10414 \begin_inset Newline newline
10422 \begin_inset Flex Code
10425 \begin_layout Plain Layout
10432 \begin_inset Flex Code
10435 \begin_layout Plain Layout
10442 In that case, the counter will be stepped each time the style appears.
10444 \begin_inset Newline newline
10452 \begin_inset Flex Code
10455 \begin_layout Plain Layout
10462 \begin_inset Flex Code
10465 \begin_layout Plain Layout
10471 , though this case is a bit complicated.
10472 Suppose you declare
10473 \begin_inset Quotes eld
10477 \begin_inset Flex Code
10480 \begin_layout Plain Layout
10481 LabelCounter myenum
10487 \begin_inset Quotes erd
10491 Then the actual counters used are
10492 \begin_inset Flex Code
10495 \begin_layout Plain Layout
10502 \begin_inset Flex Code
10505 \begin_layout Plain Layout
10512 \begin_inset Flex Code
10515 \begin_layout Plain Layout
10522 \begin_inset Flex Code
10525 \begin_layout Plain Layout
10531 , much as in LaTeX.
10532 These counters must all be declared separately.
10533 \begin_inset Newline newline
10537 \begin_inset CommandInset ref
10539 reference "sub:Counters"
10543 for details on counters.
10546 \begin_layout Description
10547 \begin_inset Flex Code
10550 \begin_layout Plain Layout
10556 The font used for the label.
10558 \begin_inset space ~
10562 \begin_inset CommandInset ref
10564 reference "sub:Font-description"
10571 \begin_layout Description
10572 \begin_inset Flex Code
10575 \begin_layout Plain Layout
10581 Text that indicates how far a label should be indented.
10584 \begin_layout Description
10585 \begin_inset Flex Code
10588 \begin_layout Plain Layout
10595 \begin_inset Flex Code
10598 \begin_layout Plain Layout
10604 ] The horizontal space between the label and the text body.
10605 Only used for labels that are not above the text body.
10608 \begin_layout Description
10609 \begin_inset Flex Code
10612 \begin_layout Plain Layout
10619 \begin_inset Flex Code
10622 \begin_layout Plain Layout
10628 ] The string used for a label with a
10629 \begin_inset Flex Code
10632 \begin_layout Plain Layout
10640 \begin_inset Flex Code
10643 \begin_layout Plain Layout
10649 is set, this string can be contain the special formatting commands described
10651 \begin_inset CommandInset ref
10653 reference "sub:Counters"
10661 \begin_layout Plain Layout
10662 For the sake of backwards compatibility, the string
10663 \begin_inset Flex Code
10666 \begin_layout Plain Layout
10676 will be replaced by the expanded
10677 \begin_inset Flex Code
10680 \begin_layout Plain Layout
10687 \begin_inset Flex Code
10690 \begin_layout Plain Layout
10699 This feature is now obsolete and should be replaced by the mechanisms of
10701 \begin_inset CommandInset ref
10703 reference "sub:Counters"
10715 \begin_layout Description
10716 \begin_inset Flex Code
10719 \begin_layout Plain Layout
10720 LabelStringAppendix
10726 \begin_inset Flex Code
10729 \begin_layout Plain Layout
10735 ] This is used inside the appendix instead of
10736 \begin_inset Flex Code
10739 \begin_layout Plain Layout
10747 \begin_inset Flex Code
10750 \begin_layout Plain Layout
10757 \begin_inset Flex Code
10760 \begin_layout Plain Layout
10761 LabelStringAppendix
10769 \begin_layout Description
10770 \begin_inset Flex Code
10773 \begin_layout Plain Layout
10779 [FIXME] (Used only with XML-type formats.)
10782 \begin_layout Description
10783 \begin_inset Flex Code
10786 \begin_layout Plain Layout
10793 \begin_inset Flex Code
10796 \begin_layout Plain Layout
10801 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10802 Enumerate, Itemize, Bibliography
10811 \begin_layout Itemize
10812 \begin_inset Flex Code
10815 \begin_layout Plain Layout
10821 means the label is the very first word (up to the first real blank).
10822 Use protected spaces (like
10823 \begin_inset space ~
10826 that one) if you want more than one word as the label.
10830 \begin_layout Itemize
10831 \begin_inset Flex Code
10834 \begin_layout Plain Layout
10840 means the label is simply whatever
10841 \begin_inset Flex Code
10844 \begin_layout Plain Layout
10851 Note that this really is `static'.
10854 \begin_layout Itemize
10855 \begin_inset Flex Code
10858 \begin_layout Plain Layout
10865 \begin_inset Flex Code
10868 \begin_layout Plain Layout
10869 Centered_Top_Environment
10874 are special cases of
10875 \begin_inset Flex Code
10878 \begin_layout Plain Layout
10885 The label will be printed above the paragraph, but only at the top of an
10886 environment or the top of a chain of paragraphs with this style.
10887 This might be used with the
10888 \begin_inset Flex MenuItem
10891 \begin_layout Plain Layout
10897 style, for example.
10900 \begin_layout Itemize
10901 \begin_inset Flex Code
10904 \begin_layout Plain Layout
10910 is a special case for the caption-labels
10911 \begin_inset Quotes eld
10915 \begin_inset Quotes erd
10919 \begin_inset Quotes eld
10923 \begin_inset Quotes erd
10928 \begin_inset Flex Code
10931 \begin_layout Plain Layout
10937 means the (hardcoded) label string depends on the kind of float: It is
10938 hardcoded to be `FloatType N', where N is the value of the counter associated
10942 \begin_layout Itemize
10944 \begin_inset Flex Code
10947 \begin_layout Plain Layout
10953 label type defines automatically numbered labels.
10955 \begin_inset Flex Code
10958 \begin_layout Plain Layout
10964 will be expanded to resolve any counter references it contains: For example,
10966 \begin_inset Quotes eld
10970 \begin_inset Flex Code
10973 \begin_layout Plain Layout
10984 \begin_inset Quotes erd
10989 \begin_inset CommandInset ref
10991 reference "sub:Counters"
10995 for more information on counters.
10998 \begin_layout Itemize
10999 \begin_inset Flex Code
11002 \begin_layout Plain Layout
11008 produces the usual sort of enumeration labels.
11009 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11010 small Roman numerals, and uppercase letters for the four possible depths.
11013 \begin_layout Itemize
11014 \begin_inset Flex Code
11017 \begin_layout Plain Layout
11023 produces various bullets at the different levels.
11024 It is also hardcoded.
11027 \begin_layout Itemize
11028 \begin_inset Flex Code
11031 \begin_layout Plain Layout
11037 is used internally by LyX and should be used only with
11038 \begin_inset Flex Code
11041 \begin_layout Plain Layout
11042 LatexType BibEnvironment
11051 \begin_layout Description
11052 \begin_inset Flex Code
11055 \begin_layout Plain Layout
11061 Note that this will completely override any prior
11062 \begin_inset Flex Code
11065 \begin_layout Plain Layout
11071 declaration for this style.
11073 \begin_inset Quotes eld
11077 \begin_inset Flex Code
11080 \begin_layout Plain Layout
11087 \begin_inset Quotes erd
11092 \begin_inset CommandInset ref
11094 reference "sub:I18n"
11098 for details on its use.
11101 \begin_layout Description
11102 \begin_inset Flex Code
11105 \begin_layout Plain Layout
11111 The name of the corresponding LaTeX stuff.
11112 Either the environment or command name.
11115 \begin_layout Description
11116 \begin_inset Flex Code
11119 \begin_layout Plain Layout
11125 An optional parameter for the corresponding
11126 \begin_inset Flex Code
11129 \begin_layout Plain Layout
11136 This parameter cannot be changed from within LyX.
11139 \begin_layout Description
11140 \begin_inset Flex Code
11143 \begin_layout Plain Layout
11150 \begin_inset CommandInset label
11152 name "des:LatexType"
11157 \begin_inset Flex Code
11160 \begin_layout Plain Layout
11165 , Command, Environment, Item_Environment,
11171 \begin_inset Flex Code
11174 \begin_layout Plain Layout
11175 List_Environment, Bib_Environment
11180 ] How the style should be translated into LaTeX.
11184 \begin_layout Plain Layout
11185 \begin_inset Flex Code
11188 \begin_layout Plain Layout
11194 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11195 Visit the SGML class files for specific examples.
11204 \begin_layout Itemize
11205 \begin_inset Flex Code
11208 \begin_layout Plain Layout
11214 means nothing special.
11218 \begin_layout Itemize
11219 \begin_inset Flex Code
11222 \begin_layout Plain Layout
11229 \begin_inset Flex Code
11232 \begin_layout Plain Layout
11239 {\SpecialChar \ldots{}
11248 \begin_layout Itemize
11249 \begin_inset Flex Code
11252 \begin_layout Plain Layout
11259 \begin_inset Flex Code
11262 \begin_layout Plain Layout
11269 }\SpecialChar \ldots{}
11285 \begin_layout Itemize
11286 \begin_inset Flex Code
11289 \begin_layout Plain Layout
11296 \begin_inset Flex Code
11299 \begin_layout Plain Layout
11306 \begin_inset Flex Code
11309 \begin_layout Plain Layout
11317 is generated for each paragraph of this environment.
11321 \begin_layout Itemize
11322 \begin_inset Flex Code
11325 \begin_layout Plain Layout
11332 \begin_inset Flex Code
11335 \begin_layout Plain Layout
11342 \begin_inset Flex Code
11345 \begin_layout Plain Layout
11351 is passed as an argument to the environment.
11353 \begin_inset Flex Code
11356 \begin_layout Plain Layout
11362 can be defined in the
11363 \begin_inset Flex MenuItem
11366 \begin_layout Plain Layout
11371 \SpecialChar \menuseparator
11377 \begin_inset space ~
11389 \begin_layout Standard
11390 Putting the last few things together, the LaTeX output will be either:
11393 \begin_layout LyX-Code
11396 latexname[latexparam]{\SpecialChar \ldots{}
11400 \begin_layout Standard
11404 \begin_layout LyX-Code
11407 begin{latexname}[latexparam] \SpecialChar \ldots{}
11413 \begin_layout Standard
11414 depending upon the LaTeX type.
11418 \begin_layout Description
11419 \begin_inset Flex Code
11422 \begin_layout Plain Layout
11429 \begin_inset Flex Code
11432 \begin_layout Plain Layout
11438 ] If you put styles into environments, the leftmargins are not simply added,
11439 but added with a factor
11440 \begin_inset Formula $\frac{4}{depth+4}$
11444 Note that this parameter is also used when the margin is defined as
11445 \begin_inset Flex Code
11448 \begin_layout Plain Layout
11455 \begin_inset Flex Code
11458 \begin_layout Plain Layout
11465 Then it is added to the manual or dynamic margin.
11467 \begin_inset Newline newline
11470 The argument is passed as a string.
11472 \begin_inset Quotes eld
11476 \begin_inset Flex Code
11479 \begin_layout Plain Layout
11486 \begin_inset Quotes erd
11489 means that the paragraph is indented with the width of
11490 \begin_inset Quotes eld
11494 \begin_inset Flex Code
11497 \begin_layout Plain Layout
11504 \begin_inset Quotes erd
11507 in the normal font.
11508 You can get a negative width by prefixing the string with
11509 \begin_inset Quotes eld
11513 \begin_inset Flex Code
11516 \begin_layout Plain Layout
11523 \begin_inset Quotes erd
11527 This way was chosen so that the look is the same with each used screen
11532 \begin_layout Description
11533 \begin_inset Flex Code
11536 \begin_layout Plain Layout
11543 \begin_inset Flex Code
11546 \begin_layout Plain Layout
11551 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11557 \begin_inset Newline newline
11560 The kind of margin that the style has on the left side.
11562 \begin_inset Flex Code
11565 \begin_layout Plain Layout
11571 just means a fixed margin.
11573 \begin_inset Flex Code
11576 \begin_layout Plain Layout
11582 means that the left margin depends on the string entered in the
11583 \begin_inset Flex MenuItem
11586 \begin_layout Plain Layout
11587 Edit\SpecialChar \menuseparator
11589 \begin_inset space ~
11598 This is used to typeset nice lists without tabulators.
11600 \begin_inset Flex Code
11603 \begin_layout Plain Layout
11609 means that the margin depends on the size of the label.
11610 This is used for automatic enumerated headlines.
11611 It is obvious that the headline
11612 \begin_inset Quotes eld
11615 5.4.3.2.1 Very long headline
11616 \begin_inset Quotes erd
11619 must have a wider left margin (as wide as
11620 \begin_inset Quotes eld
11624 \begin_inset Quotes erd
11627 plus the space) than
11628 \begin_inset Quotes eld
11631 3.2 Very long headline
11632 \begin_inset Quotes erd
11636 \begin_inset Quotes eld
11640 \begin_inset Quotes erd
11643 are not able to do this.
11645 \begin_inset Flex Code
11648 \begin_layout Plain Layout
11654 is similar, but only the very first row of the paragraph is dynamic, while
11655 the others are static; this is used, for example, for descriptions.
11657 \begin_inset Flex Code
11660 \begin_layout Plain Layout
11666 means the margin is chosen in a way that the longest row of this paragraph
11667 fits to the right margin.
11668 This is used to typeset an address on the right edge of the page.
11671 \begin_layout Description
11672 \begin_inset Flex Code
11675 \begin_layout Plain Layout
11682 \begin_inset Flex Code
11685 \begin_layout Plain Layout
11694 \begin_inset Flex Code
11697 \begin_layout Plain Layout
11703 ] Whether fragile commands in this style should be
11704 \begin_inset Flex Code
11707 \begin_layout Plain Layout
11720 whether this command should itself be protected.)
11723 \begin_layout Description
11724 \begin_inset Flex Code
11727 \begin_layout Plain Layout
11734 \begin_inset Flex Code
11737 \begin_layout Plain Layout
11744 \begin_inset Flex Code
11747 \begin_layout Plain Layout
11755 ] Whether newlines are translated into LaTeX newlines (
11756 \begin_inset Flex Code
11759 \begin_layout Plain Layout
11770 The translation can be switched off to allow more comfortable LaTeX editing
11774 \begin_layout Description
11775 \begin_inset Flex Code
11778 \begin_layout Plain Layout
11785 \begin_inset Flex Code
11788 \begin_layout Plain Layout
11795 \begin_inset Flex Code
11798 \begin_layout Plain Layout
11806 ] If set to true, and if
11807 \begin_inset Flex Code
11810 \begin_layout Plain Layout
11817 \begin_inset Flex Code
11820 \begin_layout Plain Layout
11826 ) paragraphs are being indented, then the indentation of such a paragraph
11827 following one of this type will be suppressed.
11828 (So this will not affect the display of non-default paragraphs.)
11831 \begin_layout Description
11832 \begin_inset Flex Code
11835 \begin_layout Plain Layout
11841 Name of a style that has replaced this style.
11842 This is used to rename a style, while keeping backward compatibility.
11845 \begin_layout Description
11846 \begin_inset Flex Code
11849 \begin_layout Plain Layout
11856 \begin_inset Flex Code
11859 \begin_layout Plain Layout
11865 ] The number of optional arguments that can be used with this style.
11866 This is useful for things like section headings, and only makes sense with
11868 Note that, on output, the optional arguments will all precede any required
11869 arguments (see below).
11870 So one can have constructs like:
11874 \begin_layout LyX-Code
11877 mycmd[opt1]{req1}{contents of paragraph}
11880 \begin_layout Standard
11881 but one cannot have things like:
11884 \begin_layout LyX-Code
11887 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11890 \begin_layout Standard
11891 at least, not without ERT (with which you can have anything).
11896 \begin_layout Description
11897 \begin_inset Flex Code
11900 \begin_layout Plain Layout
11907 \begin_inset CommandInset label
11909 name "des:ParbreakIsNewline"
11914 \begin_inset Flex Code
11917 \begin_layout Plain Layout
11926 \begin_inset Flex Code
11929 \begin_layout Plain Layout
11935 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11936 output, but only by a line break; together with
11937 \begin_inset Flex Code
11940 \begin_layout Plain Layout
11946 , this allows to emulate a plain text editor (like the ERT inset).
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 indent of the very first line of a paragraph.
11971 \begin_inset Flex Code
11974 \begin_layout Plain Layout
11980 will be fixed for a certain style.
11981 The exception is the default style, since the indentation for these paragraphs
11982 can be prohibited with
11983 \begin_inset Flex Code
11986 \begin_layout Plain Layout
11994 \begin_inset Flex Code
11997 \begin_layout Plain Layout
12003 style paragraphs inside environments use the
12004 \begin_inset Flex Code
12007 \begin_layout Plain Layout
12013 of the environment, not their native one.
12015 \begin_inset Flex Code
12018 \begin_layout Plain Layout
12024 paragraphs inside an enumeration are not indented.
12027 \begin_layout Description
12028 \begin_inset Flex Code
12031 \begin_layout Plain Layout
12038 \begin_inset Flex Code
12041 \begin_layout Plain Layout
12047 ] The vertical space between two paragraphs of this style.
12050 \begin_layout Description
12051 \begin_inset Flex Code
12054 \begin_layout Plain Layout
12061 \begin_inset Flex Code
12064 \begin_layout Plain Layout
12070 ] LyX allows the user to choose either
12071 \begin_inset Quotes eld
12075 \begin_inset Quotes erd
12079 \begin_inset Quotes eld
12083 \begin_inset Quotes erd
12086 to typeset a document.
12088 \begin_inset Quotes eld
12092 \begin_inset Quotes erd
12095 is chosen, this value is completely ignored.
12097 \begin_inset Quotes eld
12101 \begin_inset Quotes erd
12104 is chosen, the parindent of a LaTeXtype
12105 \begin_inset Quotes eld
12109 \begin_inset Quotes erd
12112 style is ignored and all paragraphs are separated by this parskip argument.
12113 The vertical space is calculated with
12114 \begin_inset Flex Code
12117 \begin_layout Plain Layout
12119 \begin_inset space ~
12128 \begin_inset Flex Code
12131 \begin_layout Plain Layout
12137 is the height of a row with the normal font.
12138 This way, the look stays the same with different screen fonts.
12141 \begin_layout Description
12142 \begin_inset Flex Code
12145 \begin_layout Plain Layout
12152 \begin_inset CommandInset label
12154 name "des:PassThru"
12159 \begin_inset Flex Code
12162 \begin_layout Plain Layout
12171 \begin_inset Flex Code
12174 \begin_layout Plain Layout
12180 ] Whether the contents of this paragraph should be output in raw form, meaning
12181 without special translations that LaTeX would require.
12184 \begin_layout Description
12185 \begin_inset Flex Code
12188 \begin_layout Plain Layout
12195 \begin_inset CommandInset label
12197 name "des:Preamble"
12201 Information to be included in the LaTeX preamble when this style is used.
12202 Used to define macros, load packages, etc., required by this particular
12205 \begin_inset Quotes eld
12209 \begin_inset Flex Code
12212 \begin_layout Plain Layout
12219 \begin_inset Quotes erd
12225 \begin_layout Description
12226 \begin_inset Flex Code
12229 \begin_layout Plain Layout
12236 \begin_inset Flex Code
12239 \begin_layout Plain Layout
12245 ] The prefix to use when creating labels referring to paragraphs of this
12247 This allows the use of formatted references.
12250 \begin_layout Description
12251 \begin_inset Flex Code
12254 \begin_layout Plain Layout
12261 \begin_inset Flex Code
12264 \begin_layout Plain Layout
12270 ] The number of required arguments that the LaTeX command or environment
12271 corresponding to this style expects.
12272 In the case of a command, these are required arguments
12276 that associated with the content of the paragraph itself.
12277 These do not actually have to be provided: LyX will output empty arguments
12279 Note that optional arguments will be output before required arguments.
12280 See the discussion of the
12281 \begin_inset Flex Code
12284 \begin_layout Plain Layout
12290 tag above for more information.
12293 \begin_layout Description
12294 \begin_inset Flex Code
12297 \begin_layout Plain Layout
12304 \begin_inset Flex Code
12307 \begin_layout Plain Layout
12314 \begin_inset CommandInset label
12316 name "des:Requires"
12320 Whether the style requires the feature
12321 \begin_inset Flex Code
12324 \begin_layout Plain Layout
12331 See the description of
12332 \begin_inset Flex Code
12335 \begin_layout Plain Layout
12342 \begin_inset CommandInset ref
12343 LatexCommand pageref
12344 reference "des:FreeSpacing"
12348 ) for information on `features'.
12352 \begin_layout Description
12353 \begin_inset Flex Code
12356 \begin_layout Plain Layout
12363 \begin_inset Flex Code
12366 \begin_layout Plain Layout
12373 \begin_inset Flex Code
12376 \begin_layout Plain Layout
12385 \begin_layout Description
12386 \begin_inset Flex Code
12389 \begin_layout Plain Layout
12396 \begin_inset Flex Code
12399 \begin_layout Plain Layout
12404 , onehalf, double, other
12413 ] This defines what the default spacing should be in the style.
12415 \begin_inset Flex Code
12418 \begin_layout Plain Layout
12425 \begin_inset Flex Code
12428 \begin_layout Plain Layout
12435 \begin_inset Flex Code
12438 \begin_layout Plain Layout
12444 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12445 If you specify the argument
12446 \begin_inset Flex Code
12449 \begin_layout Plain Layout
12455 , then you should also provide a numerical argument which will be the actual
12457 Note that, contrary to other parameters,
12458 \begin_inset Flex Code
12461 \begin_layout Plain Layout
12467 implies the generation of specific LaTeX code, using the package
12470 \begin_inset Flex Code
12473 \begin_layout Plain Layout
12482 \begin_layout Description
12483 \begin_inset Flex Code
12486 \begin_layout Plain Layout
12493 \begin_inset Flex Code
12496 \begin_layout Plain Layout
12503 \begin_inset Flex Code
12506 \begin_layout Plain Layout
12514 ] Spellcheck paragraphs of this style.
12518 \begin_layout Description
12519 \begin_inset Flex Code
12522 \begin_layout Plain Layout
12528 The font used for the text body .
12530 \begin_inset CommandInset ref
12532 reference "sub:Font-description"
12539 \begin_layout Description
12540 \begin_inset Flex Code
12543 \begin_layout Plain Layout
12552 \begin_inset Flex Code
12555 \begin_layout Plain Layout
12565 The level of the style in the table of contents.
12566 This is used for automatic numbering of section headings.
12569 \begin_layout Description
12570 \begin_inset Flex Code
12573 \begin_layout Plain Layout
12580 \begin_inset Flex Code
12583 \begin_layout Plain Layout
12589 ] The vertical space with which the very first of a chain of paragraphs
12590 with this style is separated from the previous paragraph.
12591 If the previous paragraph has another style, the separations are not simply
12592 added, but the maximum is taken.
12595 \begin_layout Subsection
12596 \begin_inset CommandInset label
12602 Internationalization of Paragraph Styles
12605 \begin_layout Standard
12606 LyX has long supported internationalization of layout information, but,
12607 until version 2.0, this applied only to the user interface and not to, say,
12609 Thus, French authors were forced to resort to ugly hacks if they wanted
12614 1' instead of `Theorem 1'.
12615 Thanks to Georg Baum, that is no longer the case.
12618 \begin_layout Standard
12620 \begin_inset Flex Code
12623 \begin_layout Plain Layout
12629 defines text that is to appear in the typeset document, it may use
12630 \begin_inset Flex Code
12633 \begin_layout Plain Layout
12640 \begin_inset Flex Code
12643 \begin_layout Plain Layout
12649 to support non-English and even multi-language documents correctly.
12650 The following excerpt (from the
12651 \begin_inset Flex Code
12654 \begin_layout Plain Layout
12660 file) shows how this works:
12663 \begin_layout LyX-Code
12668 \begin_layout LyX-Code
12671 theoremstyle{remark}
12674 \begin_layout LyX-Code
12677 newtheorem{claim}[thm]{
12684 \begin_layout LyX-Code
12688 \begin_layout LyX-Code
12692 \begin_layout LyX-Code
12697 claimname}{_(Claim)}
12700 \begin_layout LyX-Code
12704 \begin_layout LyX-Code
12708 \begin_layout LyX-Code
12717 claimname}{_(Claim)}}
12720 \begin_layout LyX-Code
12725 \begin_layout Standard
12726 In principle, any legal LaTeX may appear in the
12727 \begin_inset Flex Code
12730 \begin_layout Plain Layout
12737 \begin_inset Flex Code
12740 \begin_layout Plain Layout
12746 tags, but in practice they will typically look as they do here.
12747 The key to correct translation of the typeset text is the definition of
12749 \begin_inset Flex Code
12752 \begin_layout Plain Layout
12761 \begin_inset Flex Code
12764 \begin_layout Plain Layout
12776 \begin_layout Standard
12778 \begin_inset Flex Code
12781 \begin_layout Plain Layout
12787 tag provides for internationalization based upon the overall language of
12789 The contents of the tag will be included in the preamble, just as with
12791 \begin_inset Flex Code
12794 \begin_layout Plain Layout
12801 What makes it special is the use of the
12802 \begin_inset Quotes eld
12806 \begin_inset Quotes erd
12810 \begin_inset Flex Code
12813 \begin_layout Plain Layout
12819 , which will be replaced, when LyX produces LaTeX output, with the translation
12820 of its argument into the document language.
12823 \begin_layout Standard
12825 \begin_inset Flex Code
12828 \begin_layout Plain Layout
12834 tag is more complex, since it is meant to provide support for multi-language
12835 documents and so offers an interface to the
12836 \begin_inset Flex Code
12839 \begin_layout Plain Layout
12846 Its contents will be added to the preamble once for each language that
12847 appears in the document.
12848 In this case, the argument to
12849 \begin_inset Flex Code
12852 \begin_layout Plain Layout
12858 will be replaced with its translation into the language in question; the
12860 \begin_inset Flex Code
12863 \begin_layout Plain Layout
12869 is replaced by the language name (as used by the babel package).
12872 \begin_layout Standard
12873 A German document that also included a French section would thus have the
12874 following in the preamble:
12877 \begin_layout LyX-Code
12886 claimname}{Affirmation}}
12894 claimname}{Behauptung}}
12898 claimname}{Behauptung}
12901 \begin_layout Standard
12903 \begin_inset Flex Code
12906 \begin_layout Plain Layout
12912 will then conspire to produce the correct text in the output.
12915 \begin_layout Standard
12916 One important point to note here is that the translations are provided by
12917 LyX itself, through the same mechanism it uses for internationalization
12918 of the user interface.
12919 This means, in effect, that
12920 \begin_inset Flex Code
12923 \begin_layout Plain Layout
12930 \begin_inset Flex Code
12933 \begin_layout Plain Layout
12939 are really only of use in layout files that are provided with LyX, since
12940 text entered in user-created layout files will not be seen by LyX's internation
12941 alization routines.
12942 That said, however, any layout created with the intention that it will
12943 be included with LyX should use these tags where appropriate.
12946 \begin_layout Subsection
12948 \begin_inset CommandInset label
12957 \begin_layout Standard
12958 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12959 define the floats (
12960 \begin_inset Flex MenuItem
12963 \begin_layout Plain Layout
12970 \begin_inset Flex MenuItem
12973 \begin_layout Plain Layout
12979 , \SpecialChar \ldots{}
12980 ) in the text class itself.
12981 Standard floats are included in the file
12982 \begin_inset Flex Code
12985 \begin_layout Plain Layout
12991 , so you may have to do no more than add
12994 \begin_layout LyX-Code
12995 Input stdfloats.inc
12998 \begin_layout Standard
12999 to your layout file.
13000 If you want to implement a text class that proposes some other float types
13001 (like the AGU class bundled with LyX), the information below will hopefully
13005 \begin_layout Description
13006 \begin_inset Flex Code
13009 \begin_layout Plain Layout
13016 \begin_inset Flex Code
13019 \begin_layout Plain Layout
13026 \begin_inset Quotes erd
13030 \begin_inset Quotes erd
13033 ] The file name extension of an auxiliary file for the list of figures (or
13035 LaTeX writes the captions to this file.
13038 \begin_layout Description
13039 \begin_inset Flex Code
13042 \begin_layout Plain Layout
13049 \begin_inset Flex Code
13052 \begin_layout Plain Layout
13059 \begin_inset Quotes erd
13063 \begin_inset Quotes erd
13066 ] The string that will be used in the menus and also for the caption.
13067 This is translated to the current language if babel is used.
13070 \begin_layout Description
13071 \begin_inset Flex Code
13074 \begin_layout Plain Layout
13080 These are used for XHTML output.
13082 \begin_inset CommandInset ref
13084 reference "sec:Tags-for-XHTML"
13091 \begin_layout Description
13092 \begin_inset Flex Code
13095 \begin_layout Plain Layout
13104 \begin_inset Flex Code
13107 \begin_layout Plain Layout
13116 \begin_inset Flex Code
13119 \begin_layout Plain Layout
13125 ] Indicates whether the float is already defined in the document class or
13126 if we instead need to load
13127 \begin_inset Flex Code
13130 \begin_layout Plain Layout
13136 and use what it provides to define it on-the-fly.
13138 \begin_inset Flex Code
13141 \begin_layout Plain Layout
13148 \begin_inset Flex Code
13151 \begin_layout Plain Layout
13158 It should be set to
13159 \begin_inset Flex Code
13162 \begin_layout Plain Layout
13168 if the float is already defined by the LaTeX document class.
13171 \begin_layout Description
13172 \begin_inset Flex Code
13175 \begin_layout Plain Layout
13182 \begin_inset Flex Code
13185 \begin_layout Plain Layout
13192 \begin_inset Quotes erd
13196 \begin_inset Quotes erd
13199 ] The command used to generate a list of floats of this type; the leading
13202 ' should be omitted.
13208 \begin_inset Flex Code
13211 \begin_layout Plain Layout
13217 is false, since there is no standard way to generate this command.
13219 \begin_inset Flex Code
13222 \begin_layout Plain Layout
13228 is true, since in that case there is a standard way to define the command.
13231 \begin_layout Description
13232 \begin_inset Flex Code
13235 \begin_layout Plain Layout
13242 \begin_inset Flex Code
13245 \begin_layout Plain Layout
13252 \begin_inset Quotes erd
13256 \begin_inset Quotes erd
13259 ] A title for a list of floats of this kind (list of figures, tables, or
13261 It is used for the screen label within LyX; it is passed to LaTeX for use
13262 as the title there; and it is used as the title in XHTML output.
13263 It will be translated to the document language.
13266 \begin_layout Description
13267 \begin_inset Flex Code
13270 \begin_layout Plain Layout
13277 \begin_inset Flex Code
13280 \begin_layout Plain Layout
13287 \begin_inset Quotes erd
13291 \begin_inset Quotes erd
13294 ] This (optional) argument determines whether floats of this class will
13295 be numbered within some sectional unit of the document.
13296 For example, if within is equal to
13297 \begin_inset Flex Code
13300 \begin_layout Plain Layout
13306 , the floats will be numbered within chapters.
13310 \begin_layout Description
13311 \begin_inset Flex Code
13314 \begin_layout Plain Layout
13321 \begin_inset Flex Code
13324 \begin_layout Plain Layout
13331 \begin_inset Quotes erd
13335 \begin_inset Quotes erd
13338 ] The default placement for the given class of floats.
13339 The string should be as in standard LaTeX:
13340 \begin_inset Flex Code
13343 \begin_layout Plain Layout
13350 \begin_inset Flex Code
13353 \begin_layout Plain Layout
13360 \begin_inset Flex Code
13363 \begin_layout Plain Layout
13370 \begin_inset Flex Code
13373 \begin_layout Plain Layout
13379 for top, bottom, page, and here, respectively.
13383 \begin_layout Plain Layout
13384 Note that the order of these letters in the string is irrelevant, like in
13390 On top of that there is a new type,
13391 \begin_inset Flex Code
13394 \begin_layout Plain Layout
13400 , which does not really correspond to a float, since it means: put it
13401 \begin_inset Quotes eld
13405 \begin_inset Quotes erd
13409 Note however that the
13410 \begin_inset Flex Code
13413 \begin_layout Plain Layout
13419 specifier is special and, because of implementation details, cannot be
13420 used in non-built in float types.
13421 If you do not understand what this means, just use
13422 \begin_inset Quotes eld
13426 \begin_inset Flex Code
13429 \begin_layout Plain Layout
13436 \begin_inset Quotes erd
13442 \begin_layout Description
13443 \begin_inset Flex Code
13446 \begin_layout Plain Layout
13453 \begin_inset Flex Code
13456 \begin_layout Plain Layout
13462 ] The prefix to use when creating labels referring to floats of this type.
13463 This allows the use of formatted references.
13464 Note that you can remove any
13465 \begin_inset Flex Code
13468 \begin_layout Plain Layout
13474 set by a copied style by using the special value
13475 \begin_inset Quotes eld
13479 \begin_inset Quotes erd
13482 , which must be all caps.
13485 \begin_layout Description
13486 \begin_inset Flex Code
13489 \begin_layout Plain Layout
13496 \begin_inset Flex Code
13499 \begin_layout Plain Layout
13506 \begin_inset Quotes erd
13510 \begin_inset Quotes erd
13513 ] The style used when defining the float using
13514 \begin_inset Flex Code
13517 \begin_layout Plain Layout
13528 \begin_layout Description
13529 \begin_inset Flex Code
13532 \begin_layout Plain Layout
13539 \begin_inset Flex Code
13542 \begin_layout Plain Layout
13549 \begin_inset Quotes erd
13553 \begin_inset Quotes erd
13557 \begin_inset Quotes eld
13561 \begin_inset Quotes erd
13564 of the new class of floats, like program or algorithm.
13565 After the appropriate
13566 \begin_inset Flex Code
13569 \begin_layout Plain Layout
13578 \begin_inset Flex Code
13581 \begin_layout Plain Layout
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 Flex Code
13628 \begin_layout Plain Layout
13636 ] Tells us whether this float is defined using the facilities provided by
13638 \begin_inset Flex Code
13641 \begin_layout Plain Layout
13647 , either by the class file or a package, or on-the-fly by LyX itself.
13650 \begin_layout Standard
13651 Note that defining a float with type
13652 \begin_inset Flex Code
13655 \begin_layout Plain Layout
13663 automatically defines the corresponding counter with name
13664 \begin_inset Flex Code
13667 \begin_layout Plain Layout
13678 \begin_layout Subsection
13679 Flex insets and InsetLayout
13680 \begin_inset CommandInset label
13682 name "sub:Flex-insets-and"
13689 \begin_layout Standard
13690 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13691 these are called Flex insets.
13695 \begin_layout Standard
13696 Flex insets come in three different kinds:
13699 \begin_layout Itemize
13701 \begin_inset Flex Code
13704 \begin_layout Plain Layout
13710 ): These define semantic markup corresponding to such LaTeX commands as
13712 \begin_inset Flex Code
13715 \begin_layout Plain Layout
13724 \begin_inset Flex Code
13727 \begin_layout Plain Layout
13738 \begin_layout Itemize
13740 \begin_inset Flex Code
13743 \begin_layout Plain Layout
13749 ): These can be used to define custom collapsible insets, similar to TeX
13750 code, footnote, and the like.
13751 An obvious example is an endnote inset, which is defined in the
13752 \begin_inset Flex Code
13755 \begin_layout Plain Layout
13764 \begin_layout Itemize
13766 \begin_inset Flex Code
13769 \begin_layout Plain Layout
13775 ): For use with DocBook classes.
13778 \begin_layout Standard
13779 Flex insets are defined using the
13780 \begin_inset Flex Code
13783 \begin_layout Plain Layout
13789 tag, which shall be explained in a moment.
13792 \begin_layout Standard
13794 \begin_inset Flex Code
13797 \begin_layout Plain Layout
13803 tag also serves another function: It can be used to customize the general
13804 layout of many different types of insets.
13806 \begin_inset Flex Code
13809 \begin_layout Plain Layout
13815 can be used to customize the layout parameters for footnotes, marginal
13816 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13817 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13818 define Flex insets.
13821 \begin_layout Standard
13823 \begin_inset Flex Code
13826 \begin_layout Plain Layout
13832 definition must begin with a line of the form:
13835 \begin_layout LyX-Code
13839 \begin_layout Standard
13841 \begin_inset Flex Code
13844 \begin_layout Plain Layout
13850 indicates the inset whose layout is being defined, and here there are two
13854 \begin_layout Enumerate
13855 The layout for a pre-existing inset is being modified.
13856 In this case, can be
13857 \begin_inset Flex Code
13860 \begin_layout Plain Layout
13866 any one of the following:
13867 \begin_inset Flex Code
13870 \begin_layout Plain Layout
13877 \begin_inset Flex Code
13880 \begin_layout Plain Layout
13887 \begin_inset Flex Code
13890 \begin_layout Plain Layout
13897 \begin_inset Flex Code
13900 \begin_layout Plain Layout
13907 \begin_inset Flex Code
13910 \begin_layout Plain Layout
13917 \begin_inset Flex Code
13920 \begin_layout Plain Layout
13927 \begin_inset Flex Code
13930 \begin_layout Plain Layout
13937 \begin_inset Flex Code
13940 \begin_layout Plain Layout
13947 \begin_inset Flex Code
13950 \begin_layout Plain Layout
13957 \begin_inset Flex Code
13960 \begin_layout Plain Layout
13967 \begin_inset Flex Code
13970 \begin_layout Plain Layout
13977 \begin_inset Flex Code
13980 \begin_layout Plain Layout
13987 \begin_inset Flex Code
13990 \begin_layout Plain Layout
13997 \begin_inset Flex Code
14000 \begin_layout Plain Layout
14007 \begin_inset Flex Code
14010 \begin_layout Plain Layout
14017 \begin_inset Flex Code
14020 \begin_layout Plain Layout
14027 \begin_inset Flex Code
14030 \begin_layout Plain Layout
14037 \begin_inset Flex Code
14040 \begin_layout Plain Layout
14047 \begin_inset Flex Code
14050 \begin_layout Plain Layout
14057 \begin_inset Flex Code
14060 \begin_layout Plain Layout
14069 \begin_layout Enumerate
14070 The layout for a Flex inset is being defined.
14072 \begin_inset Flex Code
14075 \begin_layout Plain Layout
14081 must be of the form
14082 \begin_inset Quotes eld
14086 \begin_inset Flex Code
14089 \begin_layout Plain Layout
14096 \begin_inset Quotes erd
14100 \begin_inset Flex Code
14103 \begin_layout Plain Layout
14109 may be be any valid identifier not used by a pre-existing Flex inset.
14110 The identifier may include spaces, but in that case the whole thing must
14111 be wrapped in quotes.
14112 Note that the definition of a flex inset
14117 \begin_inset Flex Code
14120 \begin_layout Plain Layout
14126 entry, declaring which type of inset it defines.
14129 \begin_layout Standard
14131 \begin_inset Flex Code
14134 \begin_layout Plain Layout
14140 definition can contain the following entries:
14143 \begin_layout Description
14144 \begin_inset Flex Code
14147 \begin_layout Plain Layout
14153 The color for the inset's background.
14154 The valid colors are defined in
14155 \begin_inset Flex Code
14158 \begin_layout Plain Layout
14167 \begin_layout Description
14168 \begin_inset Flex Code
14171 \begin_layout Plain Layout
14178 \begin_inset Flex Code
14181 \begin_layout Plain Layout
14190 \begin_inset Flex Code
14193 \begin_layout Plain Layout
14199 ] Whether to use the content of the inset as the label, when the inset is
14204 \begin_layout Description
14205 \begin_inset Flex Code
14208 \begin_layout Plain Layout
14214 As with paragraph styles (see page
14215 \begin_inset CommandInset ref
14217 reference "des:CopyStyle"
14224 \begin_layout Description
14225 \begin_inset Flex Code
14228 \begin_layout Plain Layout
14235 \begin_inset Flex Code
14238 \begin_layout Plain Layout
14247 \begin_inset Flex Code
14250 \begin_layout Plain Layout
14256 ] Indicates whether the user may employ the Paragraph Settings dialog to
14257 customize the paragraph.
14260 \begin_layout Description
14261 \begin_inset Flex Code
14264 \begin_layout Plain Layout
14271 \begin_inset Flex Code
14274 \begin_layout Plain Layout
14281 \begin_inset Flex Code
14284 \begin_layout Plain Layout
14291 \begin_inset Flex Code
14294 \begin_layout Plain Layout
14300 , describing the rendering style used for the inset's frame and buttons.
14301 Footnotes generally use
14302 \begin_inset Flex Code
14305 \begin_layout Plain Layout
14311 , ERT insets generally
14312 \begin_inset Flex Code
14315 \begin_layout Plain Layout
14321 , and character styles
14322 \begin_inset Flex Code
14325 \begin_layout Plain Layout
14334 \begin_layout Description
14335 \begin_inset Flex Code
14338 \begin_layout Plain Layout
14345 \begin_inset Flex Code
14348 \begin_layout Plain Layout
14355 \begin_inset Flex Code
14358 \begin_layout Plain Layout
14367 \begin_inset Flex Code
14370 \begin_layout Plain Layout
14377 \begin_inset Flex Code
14380 \begin_layout Plain Layout
14387 Indicates whether the environment will stand on its own in LaTeX output
14388 or will appear inline with the surrounding text.
14389 If set to false, it is supposed that the LaTeX environment ignores white
14390 space (including one newline character) after the
14391 \begin_inset Flex Code
14394 \begin_layout Plain Layout
14407 \begin_inset Flex Code
14410 \begin_layout Plain Layout
14426 \begin_layout Description
14427 \begin_inset Flex Code
14430 \begin_layout Plain Layout
14436 Required at the end of the InsetLayout declarations.
14439 \begin_layout Description
14440 \begin_inset Flex Code
14443 \begin_layout Plain Layout
14449 The font used for both the text body
14455 \begin_inset space ~
14459 \begin_inset CommandInset ref
14461 reference "sub:Font-description"
14466 Note that defining this font automatically defines the
14467 \begin_inset Flex Code
14470 \begin_layout Plain Layout
14476 to the same value, so define this first and define
14477 \begin_inset Flex Code
14480 \begin_layout Plain Layout
14486 later if you want them to be different.
14489 \begin_layout Description
14490 \begin_inset Flex Code
14493 \begin_layout Plain Layout
14500 \begin_inset Quotes eld
14504 \begin_inset Quotes erd
14507 language, leading to Left-to-Right (latin) output, e.
14508 \begin_inset space \thinspace{}
14512 \begin_inset space \space{}
14515 in TeX code or URL.
14519 \begin_layout Description
14520 \begin_inset Flex Code
14523 \begin_layout Plain Layout
14530 \begin_inset Flex Code
14533 \begin_layout Plain Layout
14542 \begin_inset Flex Code
14545 \begin_layout Plain Layout
14551 ] Indicates whether the
14552 \begin_inset Flex Code
14555 \begin_layout Plain Layout
14561 should be used or, instead, the user can change the paragraph style used
14566 \begin_layout Description
14567 \begin_inset Flex Code
14570 \begin_layout Plain Layout
14576 As with paragraph styles (see page
14577 \begin_inset CommandInset ref
14578 LatexCommand pageref
14579 reference "des:FreeSpacing"
14587 \begin_layout Description
14588 \begin_inset Flex Code
14591 \begin_layout Plain Layout
14597 These tags control XHTML output.
14599 \begin_inset CommandInset ref
14601 reference "sec:Tags-for-XHTML"
14608 \begin_layout Description
14609 \begin_inset Flex Code
14612 \begin_layout Plain Layout
14619 \begin_inset Flex Code
14622 \begin_layout Plain Layout
14631 \begin_inset Flex Code
14634 \begin_layout Plain Layout
14640 ] Whether to include the contents of this inset in the strings generated
14641 for the `Outline' pane.
14642 One would not, for example, want the content of a footnote in a section
14643 header to be included in the TOC displayed in the outline, but one would
14644 normally want the content of a character style displayed.
14645 Default is false: not to include.
14648 \begin_layout Description
14649 \begin_inset Flex Code
14652 \begin_layout Plain Layout
14658 As with paragraph styles (see page
14659 \begin_inset CommandInset ref
14660 LatexCommand pageref
14661 reference "des:KeepEmpty"
14669 \begin_layout Description
14670 \begin_inset Flex Code
14673 \begin_layout Plain Layout
14679 The font used for the label.
14681 \begin_inset space ~
14685 \begin_inset CommandInset ref
14687 reference "sub:Font-description"
14692 Note that this definition can never appear before
14693 \begin_inset Flex Code
14696 \begin_layout Plain Layout
14702 , lest it be ineffective.
14705 \begin_layout Description
14706 \begin_inset Flex Code
14709 \begin_layout Plain Layout
14715 What will be displayed on the button or elsewhere as the inset label.
14717 \begin_inset Flex Code
14720 \begin_layout Plain Layout
14727 \begin_inset Flex Code
14730 \begin_layout Plain Layout
14736 ) modify this label on the fly.
14739 \begin_layout Description
14740 \begin_inset Flex Code
14743 \begin_layout Plain Layout
14749 The name of the corresponding LaTeX stuff.
14750 Either the environment or command name.
14753 \begin_layout Description
14754 \begin_inset Flex Code
14757 \begin_layout Plain Layout
14763 The optional parameter for the corresponding
14764 \begin_inset Flex Code
14767 \begin_layout Plain Layout
14773 stuff, including possible bracket pairs like
14774 \begin_inset Flex Code
14777 \begin_layout Plain Layout
14784 This parameter cannot be changed from within LyX.
14787 \begin_layout Description
14788 \begin_inset Flex Code
14791 \begin_layout Plain Layout
14797 As with paragraph styles (see page
14798 \begin_inset CommandInset ref
14799 LatexCommand pageref
14800 reference "des:LatexType"
14807 \begin_layout Description
14808 \begin_inset Flex Code
14811 \begin_layout Plain Layout
14818 \begin_inset Flex Code
14821 \begin_layout Plain Layout
14828 \begin_inset Flex Code
14831 \begin_layout Plain Layout
14838 \begin_inset Flex Code
14841 \begin_layout Plain Layout
14848 \begin_inset Flex Code
14851 \begin_layout Plain Layout
14857 (indicating a dummy definition ending definitions of charstyles, etc).
14858 This entry is required in and is only meaningful for Flex insets.
14859 Among other things, it determines on which menu this inset will appear.
14861 \begin_inset Flex Code
14864 \begin_layout Plain Layout
14871 \begin_inset Flex Code
14874 \begin_layout Plain Layout
14881 \begin_inset Flex Code
14884 \begin_layout Plain Layout
14892 \begin_inset Flex Code
14895 \begin_layout Plain Layout
14901 can be set to true for charstyle insets, if you wish, by setting it
14906 \begin_inset Flex Code
14909 \begin_layout Plain Layout
14918 \begin_layout Description
14919 \begin_inset Flex Code
14922 \begin_layout Plain Layout
14929 \begin_inset Flex Code
14932 \begin_layout Plain Layout
14941 \begin_inset Flex Code
14944 \begin_layout Plain Layout
14950 ] Whether multiple paragraphs are permitted in this inset.
14952 \begin_inset Flex Code
14955 \begin_layout Plain Layout
14961 to the same value and
14962 \begin_inset Flex Code
14965 \begin_layout Plain Layout
14971 to the opposite value.
14972 These can be reset to other values, if they are used
14977 \begin_inset Flex Code
14980 \begin_layout Plain Layout
14990 \begin_layout Description
14991 \begin_inset Flex Code
14994 \begin_layout Plain Layout
15001 \begin_inset Flex Code
15004 \begin_layout Plain Layout
15013 \begin_inset Flex Code
15016 \begin_layout Plain Layout
15022 ] Whether fragile commands in this inset should be
15023 \begin_inset Flex Code
15026 \begin_layout Plain Layout
15039 whether the command should itself be protected.) Default is false.
15042 \begin_layout Description
15043 \begin_inset Flex Code
15046 \begin_layout Plain Layout
15053 \begin_inset Flex Code
15056 \begin_layout Plain Layout
15065 \begin_inset Flex Code
15068 \begin_layout Plain Layout
15074 ] As with paragraph styles (see page
15075 \begin_inset CommandInset ref
15076 LatexCommand pageref
15077 reference "des:ParbreakIsNewline"
15085 \begin_layout Description
15086 \begin_inset Flex Code
15089 \begin_layout Plain Layout
15096 \begin_inset Flex Code
15099 \begin_layout Plain Layout
15108 \begin_inset Flex Code
15111 \begin_layout Plain Layout
15117 ] As with paragraph styles (see page
15118 \begin_inset CommandInset ref
15119 LatexCommand pageref
15120 reference "des:PassThru"
15128 \begin_layout Description
15129 \begin_inset Flex Code
15132 \begin_layout Plain Layout
15138 As with paragraph styles (see page
15139 \begin_inset CommandInset ref
15140 LatexCommand pageref
15141 reference "des:Preamble"
15148 \begin_layout Description
15149 \begin_inset Flex Code
15152 \begin_layout Plain Layout
15159 \begin_inset Flex Code
15162 \begin_layout Plain Layout
15168 ] The prefix to use when creating labels referring to insets of this type.
15169 This allows the use of formatted references.
15172 \begin_layout Description
15173 \begin_inset Flex Code
15176 \begin_layout Plain Layout
15183 \begin_inset Flex Code
15186 \begin_layout Plain Layout
15192 ] As with paragraph styles (see page
15193 \begin_inset CommandInset ref
15194 LatexCommand pageref
15195 reference "des:Requires"
15202 \begin_layout Description
15203 \begin_inset Flex Code
15206 \begin_layout Plain Layout
15213 \begin_inset Flex Code
15216 \begin_layout Plain Layout
15223 \begin_inset Flex Code
15226 \begin_layout Plain Layout
15234 ] Whether this inset should use the font of its surrounding environment
15236 Default is true: uses its own.
15239 \begin_layout Description
15240 \begin_inset Flex Code
15243 \begin_layout Plain Layout
15250 \begin_inset Flex Code
15253 \begin_layout Plain Layout
15260 \begin_inset Flex Code
15263 \begin_layout Plain Layout
15271 ] Spellcheck the contents of this inset.
15275 \begin_layout Subsection
15277 \begin_inset CommandInset label
15279 name "sub:Counters"
15286 \begin_layout Standard
15287 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15289 \begin_inset Flex MenuItem
15292 \begin_layout Plain Layout
15299 \begin_inset Flex MenuItem
15302 \begin_layout Plain Layout
15308 , \SpecialChar \ldots{}
15309 ) in the text class itself.
15310 The standard counters are defined in the file
15311 \begin_inset Flex Code
15314 \begin_layout Plain Layout
15320 , so you may have to do no more than add
15323 \begin_layout LyX-Code
15324 Input stdcounters.inc
15327 \begin_layout Standard
15328 to your layout file to get them to work.
15329 But if you want to define custom counters, then you can do so.
15330 The counter declaration must begin with:
15333 \begin_layout LyX-Code
15334 Counter CounterName
15337 \begin_layout Standard
15339 \begin_inset Flex Code
15342 \begin_layout Plain Layout
15348 ' is replaced by the name of the counter.
15349 And it must end with
15350 \begin_inset Quotes eld
15354 \begin_inset Flex Code
15357 \begin_layout Plain Layout
15364 \begin_inset Quotes erd
15368 The following parameters can also be used:
15371 \begin_layout Description
15372 \begin_inset Flex Code
15375 \begin_layout Plain Layout
15382 \begin_inset Flex Code
15385 \begin_layout Plain Layout
15392 \begin_inset Quotes erd
15396 \begin_inset Quotes erd
15399 ] When defined, this string defines how the counter is displayed.
15400 Setting this value sets
15401 \begin_inset Flex Code
15404 \begin_layout Plain Layout
15405 LabelStringAppendix
15411 The following special constructs can be used in the string:
15415 \begin_layout Itemize
15416 \begin_inset Flex Code
15419 \begin_layout Plain Layout
15427 will be replaced by the expansion of the
15428 \begin_inset Flex Code
15431 \begin_layout Plain Layout
15438 \begin_inset Flex Code
15441 \begin_layout Plain Layout
15442 LabelStringAppendix
15448 \begin_inset Flex Code
15451 \begin_layout Plain Layout
15461 \begin_layout Itemize
15462 counter values can be expressed using LaTeX-like macros
15463 \begin_inset Flex Code
15466 \begin_layout Plain Layout
15483 \begin_inset Flex Code
15486 \begin_layout Plain Layout
15498 \begin_layout Plain Layout
15508 Actually, the situation is a bit more complicated: any
15527 other than those described below will produce arabic numerals.
15528 It would not be surprising to see this change in the future.
15534 \begin_inset Flex Code
15537 \begin_layout Plain Layout
15543 : 1, 2, 3,\SpecialChar \ldots{}
15545 \begin_inset Flex Code
15548 \begin_layout Plain Layout
15554 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15556 \begin_inset Flex Code
15559 \begin_layout Plain Layout
15565 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15567 \begin_inset Flex Code
15570 \begin_layout Plain Layout
15576 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15578 \begin_inset Flex Code
15581 \begin_layout Plain Layout
15587 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15589 \begin_inset Flex Code
15592 \begin_layout Plain Layout
15598 for hebrew numerals.
15602 \begin_layout Standard
15603 If LabelString is not defined, a default value is constructed as follows:
15604 if the counter has a master counter
15605 \begin_inset Flex Code
15608 \begin_layout Plain Layout
15615 \begin_inset Flex Code
15618 \begin_layout Plain Layout
15625 \begin_inset Flex Code
15628 \begin_layout Plain Layout
15638 is used; otherwise the string
15639 \begin_inset Flex Code
15642 \begin_layout Plain Layout
15653 \begin_layout Description
15654 \begin_inset Flex Code
15657 \begin_layout Plain Layout
15658 LabelStringAppendix
15664 \begin_inset Flex Code
15667 \begin_layout Plain Layout
15674 \begin_inset Quotes erd
15678 \begin_inset Quotes erd
15682 \begin_inset Flex Code
15685 \begin_layout Plain Layout
15691 , but for use in the Appendix.
15694 \begin_layout Description
15695 \begin_inset Flex Code
15698 \begin_layout Plain Layout
15705 \begin_inset Flex Code
15708 \begin_layout Plain Layout
15715 \begin_inset Quotes erd
15719 \begin_inset Quotes erd
15722 ] A format for use with formatted references to this counter.
15723 For example, one might want to have references to section numbers appear
15725 \begin_inset Quotes eld
15729 \begin_inset Quotes erd
15733 The string should contain
15734 \begin_inset Quotes eld
15738 \begin_inset Quotes erd
15742 This will be replaced by the counter number itself.
15743 So, for sections, it would be: Section ##.
15746 \begin_layout Description
15747 \begin_inset Flex Code
15750 \begin_layout Plain Layout
15757 \begin_inset Flex Code
15760 \begin_layout Plain Layout
15767 \begin_inset Quotes erd
15771 \begin_inset Quotes erd
15774 ] If this is set to the name of another counter, the present counter will
15775 be reset every time the other one is increased.
15777 \begin_inset Flex Code
15780 \begin_layout Plain Layout
15787 \begin_inset Flex Code
15790 \begin_layout Plain Layout
15799 \begin_layout Subsection
15801 \begin_inset CommandInset label
15803 name "sub:Font-description"
15810 \begin_layout Standard
15811 A font description looks like this:
15814 \begin_layout LyX-Code
15824 \begin_layout LyX-Code
15828 \begin_layout LyX-Code
15832 \begin_layout Standard
15833 The following commands are available:
15836 \begin_layout Description
15837 \begin_inset Flex Code
15840 \begin_layout Plain Layout
15847 \begin_inset Flex Code
15850 \begin_layout Plain Layout
15859 \begin_inset Flex Code
15862 \begin_layout Plain Layout
15869 \begin_inset Flex Code
15872 \begin_layout Plain Layout
15879 \begin_inset Flex Code
15882 \begin_layout Plain Layout
15889 \begin_inset Flex Code
15892 \begin_layout Plain Layout
15899 \begin_inset Flex Code
15902 \begin_layout Plain Layout
15909 \begin_inset Flex Code
15912 \begin_layout Plain Layout
15919 \begin_inset Flex Code
15922 \begin_layout Plain Layout
15929 \begin_inset Flex Code
15932 \begin_layout Plain Layout
15941 \begin_layout Description
15942 \begin_inset Flex Code
15945 \begin_layout Plain Layout
15952 \begin_inset Flex Code
15955 \begin_layout Plain Layout
15964 \begin_inset Flex Code
15967 \begin_layout Plain Layout
15974 \begin_inset Flex Code
15977 \begin_layout Plain Layout
15986 \begin_layout Description
15987 \begin_inset Flex Code
15990 \begin_layout Plain Layout
15997 \begin_inset Flex Code
16000 \begin_layout Plain Layout
16006 ] Valid arguments are:
16007 \begin_inset Flex Code
16010 \begin_layout Plain Layout
16017 \begin_inset Flex Code
16020 \begin_layout Plain Layout
16027 \begin_inset Flex Code
16030 \begin_layout Plain Layout
16037 \begin_inset Flex Code
16040 \begin_layout Plain Layout
16047 \begin_inset Flex Code
16050 \begin_layout Plain Layout
16057 \begin_inset Flex Code
16060 \begin_layout Plain Layout
16067 \begin_inset Flex Code
16070 \begin_layout Plain Layout
16077 \begin_inset Flex Code
16080 \begin_layout Plain Layout
16087 \begin_inset Flex Code
16090 \begin_layout Plain Layout
16097 \begin_inset Flex Code
16100 \begin_layout Plain Layout
16107 \begin_inset Flex Code
16110 \begin_layout Plain Layout
16117 \begin_inset Flex Code
16120 \begin_layout Plain Layout
16127 Each of these turns on or off the corresponding attribute.
16129 \begin_inset Flex Code
16132 \begin_layout Plain Layout
16138 turns on emphasis, and
16139 \begin_inset Flex Code
16142 \begin_layout Plain Layout
16150 \begin_inset Newline newline
16153 If the latter seems puzzling, remember that the font settings for the present
16154 context are generally inherited from the surrounding context.
16156 \begin_inset Flex Code
16159 \begin_layout Plain Layout
16165 would turn off the emphasis that was anyway in effect, say, in a theorem
16169 \begin_layout Description
16170 \begin_inset Flex Code
16173 \begin_layout Plain Layout
16180 \begin_inset Flex Code
16183 \begin_layout Plain Layout
16192 \begin_inset Flex Code
16195 \begin_layout Plain Layout
16204 \begin_layout Description
16205 \begin_inset Flex Code
16208 \begin_layout Plain Layout
16215 \begin_inset Flex Code
16218 \begin_layout Plain Layout
16227 \begin_inset Flex Code
16230 \begin_layout Plain Layout
16237 \begin_inset Flex Code
16240 \begin_layout Plain Layout
16247 \begin_inset Flex Code
16250 \begin_layout Plain Layout
16259 \begin_layout Description
16260 \begin_inset Flex Code
16263 \begin_layout Plain Layout
16270 \begin_inset Flex Code
16273 \begin_layout Plain Layout
16280 \begin_inset Flex Code
16283 \begin_layout Plain Layout
16290 \begin_inset Flex Code
16293 \begin_layout Plain Layout
16302 \begin_inset Flex Code
16305 \begin_layout Plain Layout
16312 \begin_inset Flex Code
16315 \begin_layout Plain Layout
16322 \begin_inset Flex Code
16325 \begin_layout Plain Layout
16332 \begin_inset Flex Code
16335 \begin_layout Plain Layout
16342 \begin_inset Flex Code
16345 \begin_layout Plain Layout
16354 \begin_layout Subsection
16355 \begin_inset CommandInset label
16357 name "sub:Citation-format-description"
16361 Citation format description
16364 \begin_layout Standard
16366 \begin_inset Flex Code
16369 \begin_layout Plain Layout
16375 blocks are used to describe how bibliographic information should be displayed,
16376 both within LyX itself (in the citation dialog and in tooltips, for example)
16377 and in XHTML output.
16378 Such a block might look like this:
16381 \begin_layout LyX-Code
16385 \begin_layout LyX-Code
16389 \begin_layout LyX-Code
16393 \begin_layout LyX-Code
16397 \begin_layout Standard
16398 The individual lines define how the bibliographic information associated
16399 with an article or book, respectively, is to be displayed, and such a definitio
16400 n can be given for any `entry type' that might be present in a BibTeX file.
16401 LyX defines a default format in the source code that will be used if no
16402 specific definition has been given.
16403 LyX predefines several formats in the file
16404 \begin_inset Flex Code
16407 \begin_layout Plain Layout
16413 , which is included in most of LyX's document classes.
16416 \begin_layout Standard
16417 The definitions use a simple language that allows BibTeX keys to be replaced
16419 Keys should be enclosed in
16420 \begin_inset Flex Code
16423 \begin_layout Plain Layout
16430 \begin_inset Flex Code
16433 \begin_layout Plain Layout
16440 So a simple definition might look like this:
16443 \begin_layout LyX-Code
16445 \begin_inset Quotes eld
16449 \begin_inset Quotes erd
16455 \begin_layout Standard
16456 This would print the author, followed by a comma, followed by the title,
16457 in quotes, followed by a period.
16460 \begin_layout Standard
16461 Of course, sometimes you may want to print a key only if it exists.
16462 This can be done by using a conditional construction, such as:
16463 \begin_inset Flex Code
16466 \begin_layout Plain Layout
16468 \begin_inset space ~
16478 \begin_inset Flex Code
16481 \begin_layout Plain Layout
16487 key exists, then print
16488 \begin_inset Quotes eld
16492 \begin_inset space ~
16496 \begin_inset Quotes erd
16499 followed by the volume key.
16500 It is also possible to have an else clause in the conditional, such as:
16502 \begin_inset Flex Code
16505 \begin_layout Plain Layout
16506 {%author%[[%author%]][[%editor%, ed.]]}
16513 \begin_inset Flex Code
16516 \begin_layout Plain Layout
16522 key is printed if it exists; otherwise, the editor key is printed, followed
16524 \begin_inset Quotes eld
16528 \begin_inset space ~
16532 \begin_inset Quotes erd
16535 Note that the key is again enclosed in
16536 \begin_inset Flex Code
16539 \begin_layout Plain Layout
16545 signs; the entire conditional is enclosed in braces; and the if and else
16546 clauses are enclosed in double brackets,
16547 \begin_inset Quotes eld
16551 \begin_inset Flex Code
16554 \begin_layout Plain Layout
16561 \begin_inset Quotes eld
16565 \begin_inset Quotes eld
16569 \begin_inset Flex Code
16572 \begin_layout Plain Layout
16579 \begin_inset Quotes erd
16583 There must be no space between any of these.
16586 \begin_layout Standard
16587 There is one other piece of syntax available in definitions, which looks
16589 \begin_inset Flex Code
16592 \begin_layout Plain Layout
16599 This defines a piece of formatting information that is to be used when
16601 \begin_inset Quotes eld
16605 \begin_inset Quotes erd
16609 Obviously, we do not want to output HTML tags when writing plain text,
16610 so they should be wrapped in
16611 \begin_inset Quotes eld
16615 \begin_inset Quotes erd
16619 \begin_inset Quotes eld
16623 \begin_inset Quotes erd
16629 \begin_layout Standard
16630 Two special sorts of definitions are also possible in a
16631 \begin_inset Flex Code
16634 \begin_layout Plain Layout
16641 An example of the first would be:
16644 \begin_layout LyX-Code
16646 \begin_inset Quotes eld
16650 \begin_inset Quotes erd
16656 \begin_layout Standard
16657 This is an abbreviation, or macro, and it can be used by treating it as
16659 \begin_inset Flex Code
16662 \begin_layout Plain Layout
16670 \begin_inset Flex Code
16673 \begin_layout Plain Layout
16679 exactly as it would treat its definition.
16680 So, let us issue the obvious
16688 \begin_layout LyX-Code
16692 \begin_layout Standard
16693 or anything like it.
16694 LyX shouldn't go into an infinite loop, but it may go into a long one before
16698 \begin_layout Standard
16699 The second sort of special definition might look like this:
16702 \begin_layout LyX-Code
16706 \begin_layout Standard
16707 This defines a translatable piece of text, which allows relevant parts of
16708 the bibliography to be translated.
16709 It can be included in a definition by treating it as a key:
16710 \begin_inset Flex Code
16713 \begin_layout Plain Layout
16720 Several of these are predefined in
16721 \begin_inset Flex Code
16724 \begin_layout Plain Layout
16731 Note that these are not macros, in the sense just defined.
16732 They will not be expanded.
16735 \begin_layout Standard
16736 So here then is an example that use all these features:
16739 \begin_layout LyX-Code
16740 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16743 \begin_layout Standard
16744 This defines a macro that prints the author, followed by a comma, if the
16746 \begin_inset Flex Code
16749 \begin_layout Plain Layout
16755 key is defined, or else prints the name of the editor, followed by the
16757 \begin_inset Flex Code
16760 \begin_layout Plain Layout
16766 or its translation (it is by default
16767 \begin_inset Quotes eld
16771 \begin_inset Quotes erd
16775 \begin_inset Flex Code
16778 \begin_layout Plain Layout
16785 Note that this is in fact defined in
16786 \begin_inset Flex Code
16789 \begin_layout Plain Layout
16795 , so you can use it in your own definitions, or re-definitions, if you load
16799 \begin_layout Section
16800 \begin_inset CommandInset label
16802 name "sec:Tags-for-XHTML"
16806 Tags for XHTML output
16809 \begin_layout Standard
16810 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16811 by layout information.
16812 In general, LyX provides sensible defaults and, as mentioned earlier, it
16813 will even construct default CSS style rules from the other layout tags.
16814 For example, LyX will attempt to use the information provided in the
16815 \begin_inset Flex Code
16818 \begin_layout Plain Layout
16824 declaration for the Chapter style to write CSS that will appropriately
16825 format chapter headings.
16828 \begin_layout Standard
16829 In many cases, then, you may not have to do anything at all to get acceptable
16830 XHTML output for your own environments, custom insets, and so forth.
16831 But in some cases you will, and so LyX provides a number of layout tags
16832 that can be used to customize the XHTML and CSS that are generated.
16835 \begin_layout Standard
16836 Note that there are two tags,
16837 \begin_inset Flex Code
16840 \begin_layout Plain Layout
16847 \begin_inset Flex Code
16850 \begin_layout Plain Layout
16856 that may appear outside style and inset declarations.
16858 \begin_inset CommandInset ref
16860 reference "sub:General-text-class"
16864 for details on these.
16867 \begin_layout Subsection
16868 \begin_inset CommandInset label
16870 name "sub:Paragraph-Style-XHTML"
16877 \begin_layout Standard
16878 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16879 dealing with a normal paragraph, a command, or an environment, where this
16880 is itself determined by the contents of the corresponding
16881 \begin_inset Flex Code
16884 \begin_layout Plain Layout
16894 \begin_layout Standard
16895 For a command or normal paragraph, the output XHTML has the following form:
16898 \begin_layout LyX-Code
16900 \begin_inset Quotes erd
16904 \begin_inset Quotes erd
16910 \begin_layout LyX-Code
16912 \begin_inset Quotes erd
16916 \begin_inset Quotes erd
16922 \begin_layout LyX-Code
16923 Contents of the paragraph.
16926 \begin_layout LyX-Code
16930 \begin_layout Standard
16931 The label tags are of course omitted if the paragraph does not have a label.
16934 \begin_layout Standard
16935 For an environment that is not some sort of list, the XHTML takes this form:
16938 \begin_layout LyX-Code
16940 \begin_inset Quotes erd
16944 \begin_inset Quotes erd
16950 \begin_layout LyX-Code
16952 \begin_inset Quotes erd
16956 \begin_inset Quotes erd
16960 \begin_inset Quotes erd
16964 \begin_inset Quotes erd
16967 >Environment Label</labeltag>First paragraph.</itemtag>
16970 \begin_layout LyX-Code
16971 <itemtag>Second paragraph.</itemtag>
16974 \begin_layout LyX-Code
16978 \begin_layout Standard
16979 Note that the label is output only for the first paragraph, as it should
16980 be for a theorem, for example.
16984 \begin_layout Standard
16985 For a list, we have one of these forms:
16988 \begin_layout LyX-Code
16990 \begin_inset Quotes erd
16994 \begin_inset Quotes erd
17000 \begin_layout LyX-Code
17002 \begin_inset Quotes erd
17006 \begin_inset Quotes erd
17010 \begin_inset Quotes erd
17014 \begin_inset Quotes erd
17017 >List Label</labeltag>First item.</itemtag>
17020 \begin_layout LyX-Code
17022 \begin_inset Quotes erd
17026 \begin_inset Quotes erd
17030 \begin_inset Quotes erd
17034 \begin_inset Quotes erd
17037 >List Label</labeltag>Second item.</itemtag>
17040 \begin_layout LyX-Code
17044 \begin_layout LyX-Code
17048 \begin_layout LyX-Code
17050 \begin_inset Quotes erd
17054 \begin_inset Quotes erd
17060 \begin_layout LyX-Code
17062 \begin_inset Quotes erd
17066 \begin_inset Quotes erd
17069 >List Label</labeltag><itemtag attr=
17070 \begin_inset Quotes erd
17074 \begin_inset Quotes erd
17077 >First item.</itemtag>
17080 \begin_layout LyX-Code
17082 \begin_inset Quotes erd
17086 \begin_inset Quotes erd
17089 >List Label</labeltag><itemtag attr=
17090 \begin_inset Quotes erd
17094 \begin_inset Quotes erd
17097 >Second item.</itemtag>
17100 \begin_layout LyX-Code
17104 \begin_layout Standard
17105 Note the different orders of
17106 \begin_inset Flex Code
17109 \begin_layout Plain Layout
17116 \begin_inset Flex Code
17119 \begin_layout Plain Layout
17126 Which order we get depends upon the setting of
17127 \begin_inset Flex Code
17130 \begin_layout Plain Layout
17137 \begin_inset Flex Code
17140 \begin_layout Plain Layout
17146 is false (the default), you get the first of these, with the label within
17147 the item; if true, you get the second, with the label outside the item.
17150 \begin_layout Standard
17151 The specific tags and attributes output for each paragraph type can be controlle
17152 d by means of the layout tags we are about to describe.
17153 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17154 so you often may not need to do very much to get good XHTML output.
17155 Think of the available tags as there so you can tweak things to your liking.
17158 \begin_layout Description
17159 \begin_inset Flex Code
17162 \begin_layout Plain Layout
17169 \begin_inset Flex Code
17172 \begin_layout Plain Layout
17178 ] Specifies attribute information to be output with the main tag.
17180 \begin_inset Quotes eld
17184 \begin_inset Flex Code
17187 \begin_layout Plain Layout
17194 \begin_inset Quotes erd
17198 By default, LyX will output
17199 \begin_inset Quotes eld
17203 \begin_inset Flex Code
17206 \begin_layout Plain Layout
17213 \begin_inset Quotes erd
17217 \begin_inset Flex Code
17220 \begin_layout Plain Layout
17226 is the LyX name of the layout, made lowercase, for example: chapter.
17231 contain any style information.
17233 \begin_inset Flex Code
17236 \begin_layout Plain Layout
17245 \begin_layout Description
17246 \begin_inset Flex Code
17249 \begin_layout Plain Layout
17256 \begin_inset Flex Code
17259 \begin_layout Plain Layout
17269 ] Whether to output the default CSS information LyX generates for this layout,
17270 even if additional information is explicitly provided via
17271 \begin_inset Flex Code
17274 \begin_layout Plain Layout
17282 \begin_inset Flex Code
17285 \begin_layout Plain Layout
17291 allows you to alter or augment the generated CSS, rather than to override
17294 \begin_inset Flex Code
17297 \begin_layout Plain Layout
17306 \begin_layout Description
17307 \begin_inset Flex Code
17310 \begin_layout Plain Layout
17317 \begin_inset Flex Code
17320 \begin_layout Plain Layout
17326 ] The tag to be used for individual paragraphs of environments, replacing
17328 \begin_inset Flex Code
17331 \begin_layout Plain Layout
17337 in the examples above.
17339 \begin_inset Flex Code
17342 \begin_layout Plain Layout
17351 \begin_layout Description
17352 \begin_inset Flex Code
17355 \begin_layout Plain Layout
17362 \begin_inset Flex Code
17365 \begin_layout Plain Layout
17371 ] Attributes for the item tag.
17373 \begin_inset Quotes eld
17377 \begin_inset Flex Code
17380 \begin_layout Plain Layout
17381 class=`layoutname_item'
17387 \begin_inset Quotes erd
17395 contain any style information.
17397 \begin_inset Flex Code
17400 \begin_layout Plain Layout
17409 \begin_layout Description
17410 \begin_inset Flex Code
17413 \begin_layout Plain Layout
17420 \begin_inset Flex Code
17423 \begin_layout Plain Layout
17429 ] The tag to be used for paragraph and item labels, replacing
17430 \begin_inset Flex Code
17433 \begin_layout Plain Layout
17439 in the examples above.
17441 \begin_inset Flex Code
17444 \begin_layout Plain Layout
17451 \begin_inset Flex Code
17454 \begin_layout Plain Layout
17461 \begin_inset Flex Code
17464 \begin_layout Plain Layout
17471 \begin_inset Flex Code
17474 \begin_layout Plain Layout
17475 Centered_Top_Environment
17480 , in which case it defaults to
17481 \begin_inset Flex Code
17484 \begin_layout Plain Layout
17493 \begin_layout Description
17494 \begin_inset Flex Code
17497 \begin_layout Plain Layout
17504 \begin_inset Flex Code
17507 \begin_layout Plain Layout
17513 ] Attributes for the label tag.
17515 \begin_inset Quotes eld
17519 \begin_inset Flex Code
17522 \begin_layout Plain Layout
17523 class=`layoutname_label'
17529 \begin_inset Quotes erd
17537 contain any style information.
17539 \begin_inset Flex Code
17542 \begin_layout Plain Layout
17551 \begin_layout Description
17552 \begin_inset Flex Code
17555 \begin_layout Plain Layout
17562 \begin_inset Flex Code
17565 \begin_layout Plain Layout
17575 ] Meaningful only for list-like environments, this tag controls whether
17576 the label tag is output before or inside the item tag.
17577 This is used, for example, in the description environment, where we want
17579 \begin_inset Flex Code
17582 \begin_layout Plain Layout
17583 <dt>\SpecialChar \ldots{}
17584 </dt><dd>\SpecialChar \ldots{}
17592 \begin_inset Flex Code
17595 \begin_layout Plain Layout
17601 : The label tag is output inside the item tag.
17604 \begin_layout Description
17605 \begin_inset Flex Code
17608 \begin_layout Plain Layout
17614 Information to be output in the
17615 \begin_inset Flex Code
17618 \begin_layout Plain Layout
17624 section when this style is used.
17625 This might, for example, be used to include a
17626 \begin_inset Flex Code
17629 \begin_layout Plain Layout
17636 \begin_inset Flex Code
17639 \begin_layout Plain Layout
17648 \begin_layout Description
17649 \begin_inset Flex Code
17652 \begin_layout Plain Layout
17658 CSS style information to be included when this style is used.
17659 Note that this will automatically be wrapped in a layout-generated
17660 \begin_inset Flex Code
17663 \begin_layout Plain Layout
17669 block, so only the CSS itself need be included.
17672 \begin_layout Description
17673 \begin_inset Flex Code
17676 \begin_layout Plain Layout
17683 \begin_inset Flex Code
17686 \begin_layout Plain Layout
17692 ] The tag to be used for the main label, replacing
17693 \begin_inset Flex Code
17696 \begin_layout Plain Layout
17702 in the examples above.
17704 \begin_inset Flex Code
17707 \begin_layout Plain Layout
17716 \begin_layout Description
17717 \begin_inset Flex Code
17720 \begin_layout Plain Layout
17727 \begin_inset Flex Code
17730 \begin_layout Plain Layout
17740 ] Marks this style as the one to be used to generate the
17741 \begin_inset Flex Code
17744 \begin_layout Plain Layout
17750 tag for the XHTML file.
17751 By default, it is false.
17753 \begin_inset Flex Code
17756 \begin_layout Plain Layout
17762 file sets it to true for the
17763 \begin_inset Flex Code
17766 \begin_layout Plain Layout
17776 \begin_layout Subsection
17780 \begin_layout Standard
17781 The XHTML output of insets can also be controlled by information in layout
17786 \begin_layout Plain Layout
17787 At present, this is true only for
17788 \begin_inset Quotes eld
17792 \begin_inset Quotes erd
17795 insets (insets you can type into) and is not true for
17796 \begin_inset Quotes eld
17800 \begin_inset Quotes erd
17803 insets (insets that are associated with dialog boxes).
17808 Here, too, LyX tries to provide sensible defaults, and it constructs default
17810 But everything can be customized.
17813 \begin_layout Standard
17814 The XHTML LyX outputs for an inset has the following form:
17817 \begin_layout LyX-Code
17819 \begin_inset Quotes erd
17823 \begin_inset Quotes erd
17829 \begin_layout LyX-Code
17830 <labeltag>Label</labeltag>
17833 \begin_layout LyX-Code
17835 \begin_inset Quotes erd
17839 \begin_inset Quotes erd
17842 >Contents of the inset.</innertag>
17845 \begin_layout LyX-Code
17849 \begin_layout Standard
17850 If the inset permits multiple paragraphs---that is, if
17851 \begin_inset Flex Code
17854 \begin_layout Plain Layout
17860 is true---then the contents of the inset will itself be output as paragraphs
17861 formatted according to the styles used for those paragraphs (standard,
17862 quote, and the like).
17863 The label tag is of course omitted if the paragraph does not have a label
17864 and, at present, is always
17865 \begin_inset Flex Code
17868 \begin_layout Plain Layout
17875 The inner tag is optional and, by default, does not appear.
17878 \begin_layout Standard
17879 The specific tags and attributes output for each inset can be controlled
17880 by means of the following layout tags.
17883 \begin_layout Description
17884 \begin_inset Flex Code
17887 \begin_layout Plain Layout
17894 \begin_inset Flex Code
17897 \begin_layout Plain Layout
17903 ] Specifies attribute information to be output with the main tag.
17905 \begin_inset Quotes eld
17909 \begin_inset Flex Code
17912 \begin_layout Plain Layout
17913 class=`myinset' onclick=`\SpecialChar \ldots{}
17920 \begin_inset Quotes erd
17924 By default, LyX will output
17925 \begin_inset Quotes eld
17929 \begin_inset Flex Code
17932 \begin_layout Plain Layout
17939 \begin_inset Quotes erd
17943 \begin_inset Flex Code
17946 \begin_layout Plain Layout
17952 is the LyX name of the inset, made lowercase and with non-alphanumeric
17953 characters converted to underscores, for example: footnote.
17956 \begin_layout Description
17957 \begin_inset Flex Code
17960 \begin_layout Plain Layout
17967 \begin_inset Flex Code
17970 \begin_layout Plain Layout
17980 ] Whether to output the default CSS information LyX generates for this layout,
17981 even if additional information is explicitly provided via
17982 \begin_inset Flex Code
17985 \begin_layout Plain Layout
17993 \begin_inset Flex Code
17996 \begin_layout Plain Layout
18002 allows you to alter or augment the generated CSS, rather than to override
18007 \begin_layout Description
18008 \begin_inset Flex Code
18011 \begin_layout Plain Layout
18018 \begin_inset Flex Code
18021 \begin_layout Plain Layout
18027 ] Attributes for the inner tag.
18029 \begin_inset Quotes eld
18033 \begin_inset Flex Code
18036 \begin_layout Plain Layout
18037 class=`insetname_inner'
18043 \begin_inset Quotes erd
18049 \begin_layout Description
18050 \begin_inset Flex Code
18053 \begin_layout Plain Layout
18060 \begin_inset Flex Code
18063 \begin_layout Plain Layout
18069 ] The inner tag, replacing
18070 \begin_inset Flex Code
18073 \begin_layout Plain Layout
18079 in the examples above.
18080 By default, there is none.
18083 \begin_layout Description
18084 \begin_inset Flex Code
18087 \begin_layout Plain Layout
18094 \begin_inset Flex Code
18097 \begin_layout Plain Layout
18105 ] Whether this inset represents a standalone block of text (such as a footnote)
18106 or instead represents material that is included in the surrounding text
18107 (such as a branch).
18111 \begin_layout Description
18112 \begin_inset Flex Code
18115 \begin_layout Plain Layout
18122 \begin_inset Flex Code
18125 \begin_layout Plain Layout
18131 ] A label for this inset, possibly including a reference to a counter.
18132 For example, for footnote, it might be:
18133 \begin_inset Flex Code
18136 \begin_layout Plain Layout
18145 This is optional, and there is no default.
18148 \begin_layout Description
18149 \begin_inset Flex Code
18152 \begin_layout Plain Layout
18158 Information to be output in the
18159 \begin_inset Flex Code
18162 \begin_layout Plain Layout
18168 section when this style is used.
18169 This might, for example, be used to include a
18170 \begin_inset Flex Code
18173 \begin_layout Plain Layout
18180 \begin_inset Flex Code
18183 \begin_layout Plain Layout
18192 \begin_layout Description
18193 \begin_inset Flex Code
18196 \begin_layout Plain Layout
18202 CSS style information to be included when this style is used.
18203 Note that this will automatically be wrapped in a layout-generated
18204 \begin_inset Flex Code
18207 \begin_layout Plain Layout
18213 block, so only the CSS itself need be included.
18216 \begin_layout Description
18217 \begin_inset Flex Code
18220 \begin_layout Plain Layout
18227 \begin_inset Flex Code
18230 \begin_layout Plain Layout
18236 ] The tag to be used for the main label, replacing
18237 \begin_inset Flex Code
18240 \begin_layout Plain Layout
18246 in the examples above.
18247 The default depends upon the setting of
18248 \begin_inset Flex Code
18251 \begin_layout Plain Layout
18258 \begin_inset Flex Code
18261 \begin_layout Plain Layout
18267 is true, the default is
18268 \begin_inset Flex Code
18271 \begin_layout Plain Layout
18277 ; if it is false, the default is
18278 \begin_inset Flex Code
18281 \begin_layout Plain Layout
18290 \begin_layout Subsection
18294 \begin_layout Standard
18295 The XHTML output for floats too can be controlled by layout information.
18296 The output has the following form:
18299 \begin_layout LyX-Code
18301 \begin_inset Quotes erd
18305 \begin_inset Quotes erd
18311 \begin_layout LyX-Code
18312 Contents of the float.
18315 \begin_layout LyX-Code
18319 \begin_layout Standard
18320 The caption, if there is one, is a separate inset and will be output as
18322 Its appearance can be controlled via the InsetLayout for caption insets.
18326 \begin_layout Description
18327 \begin_inset Flex Code
18330 \begin_layout Plain Layout
18337 \begin_inset Flex Code
18340 \begin_layout Plain Layout
18346 ] Specifies attribute information to be output with the main tag.
18348 \begin_inset Quotes eld
18352 \begin_inset Flex Code
18355 \begin_layout Plain Layout
18356 class=`myfloat' onclick=`\SpecialChar \ldots{}
18363 \begin_inset Quotes erd
18367 By default, LyX will output
18368 \begin_inset Quotes eld
18372 \begin_inset Flex Code
18375 \begin_layout Plain Layout
18376 class=`float float-floattype'
18382 \begin_inset Quotes erd
18386 \begin_inset Flex Code
18389 \begin_layout Plain Layout
18395 is LyX's name for this type of float, as determined by the float declaration
18397 \begin_inset CommandInset ref
18399 reference "sub:Floats"
18403 ), though made lowercase and with non-alphanumeric characters converted
18404 to underscores, for example: float-table.
18407 \begin_layout Description
18408 \begin_inset Flex Code
18411 \begin_layout Plain Layout
18417 CSS style information to be included when this float is used.
18418 Note that this will automatically be wrapped in a layout-generated
18419 \begin_inset Flex Code
18422 \begin_layout Plain Layout
18428 block, so only the CSS itself need be included.
18431 \begin_layout Description
18432 \begin_inset Flex Code
18435 \begin_layout Plain Layout
18442 \begin_inset Flex Code
18445 \begin_layout Plain Layout
18451 ] The tag to be used for this float, replacing
18452 \begin_inset Quotes eld
18456 \begin_inset Flex Code
18459 \begin_layout Plain Layout
18466 \begin_inset Quotes erd
18469 in the example above.
18471 \begin_inset Flex Code
18474 \begin_layout Plain Layout
18480 and will rarely need changing.
18483 \begin_layout Subsection
18484 Bibliography formatting
18487 \begin_layout Standard
18488 The bibliography can be formatted using
18489 \begin_inset Flex Code
18492 \begin_layout Plain Layout
18500 \begin_inset CommandInset ref
18502 reference "sub:Citation-format-description"
18509 \begin_layout Subsection
18513 \begin_layout Standard
18514 We have several times mentioned that LyX will generate default CSS style
18515 rules for both insets and paragraph styles, based upon the other layout
18516 information that is provided.
18517 In this section, we shall say a word about which layout information LyX
18521 \begin_layout Standard
18522 At present, LyX auto-generates CSS only for font information, making use
18524 \begin_inset Flex Code
18527 \begin_layout Plain Layout
18534 \begin_inset Flex Code
18537 \begin_layout Plain Layout
18544 \begin_inset Flex Code
18547 \begin_layout Plain Layout
18554 \begin_inset Flex Code
18557 \begin_layout Plain Layout
18564 \begin_inset Flex Code
18567 \begin_layout Plain Layout
18575 \begin_inset CommandInset ref
18577 reference "sub:Font-description"
18581 .) The translation is mostly straightforward and obvious.
18583 \begin_inset Quotes eld
18587 \begin_inset Flex Code
18590 \begin_layout Plain Layout
18597 \begin_inset Quotes erd
18601 \begin_inset Quotes eld
18605 \begin_inset Flex Code
18608 \begin_layout Plain Layout
18609 font-family: sans-serif;
18615 \begin_inset Quotes erd
18619 The correspondence of LyX sizes and CSS sizes is a little less obvious
18620 but nonetheless intuitive.
18622 \begin_inset Flex Code
18625 \begin_layout Plain Layout
18632 \begin_inset Flex URL
18635 \begin_layout Plain Layout
18645 \begin_layout Chapter
18646 Including External Material
18649 \begin_layout Standard
18650 \begin_inset Box Shadowbox
18660 height_special "totalheight"
18663 \begin_layout Plain Layout
18664 WARNING: This portion of the documentation has not been updated for some
18666 We certainly hope that it is still accurate, but there are no guarantees.
18674 \begin_layout Standard
18675 The use of material from sources external to LyX is covered in detail in
18681 This part of the manual covers what needs to happen behind the scenes for
18682 new sorts of material to be included.
18685 \begin_layout Section
18689 \begin_layout Standard
18690 The external material feature is based on the concept of a
18695 A template is a specification of how LyX should interface with a certain
18697 As bundled, LyX comes with predefined templates for Xfig figures, various
18698 raster format images, chess diagrams, and LilyPond music notation.
18699 You can check the actual list by using the menu
18700 \begin_inset Flex MenuItem
18703 \begin_layout Plain Layout
18704 Insert\SpecialChar \menuseparator
18705 File\SpecialChar \menuseparator
18712 Furthermore, it is possible to roll your own template to support a specific
18714 Later we'll describe in more detail what is involved, and hopefully you
18715 will submit all the templates you create so we can include them in a later
18719 \begin_layout Standard
18720 Another basic idea of the external material feature is to distinguish between
18721 the original file that serves as a base for final material and the produced
18722 file that is included in your exported or printed document.
18723 For example, consider the case of a figure produced with
18724 \begin_inset Flex Code
18727 \begin_layout Plain Layout
18734 The Xfig application itself works on an original file with the
18735 \begin_inset Flex Code
18738 \begin_layout Plain Layout
18745 Within Xfig, you create and change your figure, and when you are done,
18747 \begin_inset Flex Code
18750 \begin_layout Plain Layout
18757 When you want to include the figure in your document, you invoke
18758 \begin_inset Flex Code
18761 \begin_layout Plain Layout
18767 in order to create a PostScript file that can readily be included in your
18770 \begin_inset Flex Code
18773 \begin_layout Plain Layout
18779 file is the original file, and the PostScript file is the produced file.
18782 \begin_layout Standard
18783 This distinction is important in order to allow updating of the material
18784 while you are in the process of writing the document.
18785 Furthermore, it provides us with the flexibility that is needed to support
18786 multiple export formats.
18787 For instance, in the case of a plain text file, it is not exactly an award-winn
18788 ing idea to include the figure as raw PostScript.
18789 Instead, you would either prefer to just include a reference to the figure
18790 or try to invoke some graphics to ASCII converter to make the final result
18791 look similar to the real graphics.
18792 The external material management allows you to do this, because it is parametri
18793 zed on the different export formats that LyX supports.
18796 \begin_layout Standard
18797 Besides supporting the production of different products according to the
18798 exported format, it supports tight integration with editing and viewing
18800 In the case of an Xfig figure, you are able to invoke Xfig on the original
18801 file with a single click from within the external material dialog in LyX,
18802 and also preview the produced PostScript file with Ghostview with another
18804 No more fiddling around with the command line and/or file browsers to locate
18805 and manipulate the original or produced files.
18806 In this way, you are finally able to take full advantage of the many different
18807 applications that are relevant to use when you write your documents, and
18808 ultimately be more productive.
18811 \begin_layout Section
18812 The external template configuration file
18815 \begin_layout Standard
18816 It is relatively easy to add custom external template definitions to LyX.
18817 However, be aware that doing this in an careless manner most probably
18821 introduce an easily exploitable security hole.
18822 So before you do this, please read the discussion about security in section
18824 \begin_inset CommandInset ref
18826 reference "sec:Security-discussion"
18833 \begin_layout Standard
18834 Having said that, we encourage you to submit any interesting templates that
18839 \begin_layout Standard
18840 The external templates are defined in the
18841 \begin_inset Flex Code
18844 \begin_layout Plain Layout
18845 LyXDir/lib/external_templates
18851 You can place your own version in
18852 \begin_inset Flex Code
18855 \begin_layout Plain Layout
18856 UserDir/external_templates
18864 \begin_layout Standard
18865 A typical template looks like this:
18868 \begin_layout LyX-Code
18872 \begin_layout LyX-Code
18873 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18876 \begin_layout LyX-Code
18880 \begin_layout LyX-Code
18884 \begin_layout LyX-Code
18888 \begin_layout LyX-Code
18892 \begin_layout LyX-Code
18896 \begin_layout LyX-Code
18897 AutomaticProduction true
18900 \begin_layout LyX-Code
18904 \begin_layout LyX-Code
18908 \begin_layout LyX-Code
18912 \begin_layout LyX-Code
18913 TransformCommand Rotate RotationLatexCommand
18916 \begin_layout LyX-Code
18917 TransformCommand Resize ResizeLatexCommand
18920 \begin_layout LyX-Code
18921 Product "$$RotateFront$$ResizeFront
18924 \begin_layout LyX-Code
18929 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18932 \begin_layout LyX-Code
18933 $$ResizeBack$$RotateBack"
18936 \begin_layout LyX-Code
18940 \begin_layout LyX-Code
18941 UpdateResult "$$AbsPath$$Basename.pstex_t"
18944 \begin_layout LyX-Code
18945 Requirement "graphicx"
18948 \begin_layout LyX-Code
18949 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18952 \begin_layout LyX-Code
18953 ReferencedFile latex "$$AbsPath$$Basename.eps"
18956 \begin_layout LyX-Code
18957 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18960 \begin_layout LyX-Code
18964 \begin_layout LyX-Code
18968 \begin_layout LyX-Code
18969 TransformCommand Rotate RotationLatexCommand
18972 \begin_layout LyX-Code
18973 TransformCommand Resize ResizeLatexCommand
18976 \begin_layout LyX-Code
18977 Product "$$RotateFront$$ResizeFront
18980 \begin_layout LyX-Code
18985 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18988 \begin_layout LyX-Code
18989 $$ResizeBack$$RotateBack"
18992 \begin_layout LyX-Code
18993 UpdateFormat pdftex
18996 \begin_layout LyX-Code
18997 UpdateResult "$$AbsPath$$Basename.pdftex_t"
19000 \begin_layout LyX-Code
19001 Requirement "graphicx"
19004 \begin_layout LyX-Code
19005 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
19008 \begin_layout LyX-Code
19009 ReferencedFile latex "$$AbsPath$$Basename.pdf"
19012 \begin_layout LyX-Code
19016 \begin_layout LyX-Code
19020 \begin_layout LyX-Code
19021 Product "$$Contents(
19023 "$$AbsPath$$Basename.asc
19028 \begin_layout LyX-Code
19029 UpdateFormat asciixfig
19032 \begin_layout LyX-Code
19033 UpdateResult "$$AbsPath$$Basename.asc"
19036 \begin_layout LyX-Code
19040 \begin_layout LyX-Code
19044 \begin_layout LyX-Code
19045 Product "<graphic fileref=
19047 "$$AbsOrRelPathMaster$$Basename.eps
19052 \begin_layout LyX-Code
19056 \begin_layout LyX-Code
19060 \begin_layout LyX-Code
19061 UpdateResult "$$AbsPath$$Basename.eps"
19064 \begin_layout LyX-Code
19065 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19068 \begin_layout LyX-Code
19069 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19072 \begin_layout LyX-Code
19076 \begin_layout LyX-Code
19077 Product "[XFig: $$FName]"
19080 \begin_layout LyX-Code
19084 \begin_layout LyX-Code
19088 \begin_layout Standard
19089 As you can see, the template is enclosed in
19090 \begin_inset Flex Code
19093 \begin_layout Plain Layout
19099 \SpecialChar \ldots{}
19101 \begin_inset Flex Code
19104 \begin_layout Plain Layout
19111 It contains a header specifying some general settings and, for each supported
19112 primary document file format, a section
19113 \begin_inset Flex Code
19116 \begin_layout Plain Layout
19122 \SpecialChar \ldots{}
19124 \begin_inset Flex Code
19127 \begin_layout Plain Layout
19136 \begin_layout Subsection
19137 The template header
19140 \begin_layout Description
19141 \begin_inset Flex Code
19144 \begin_layout Plain Layout
19145 AutomaticProduction
19146 \begin_inset space ~
19154 Whether the file represented by the template must be generated by LyX.
19155 This command must occur exactly once.
19158 \begin_layout Description
19159 \begin_inset Flex Code
19162 \begin_layout Plain Layout
19164 \begin_inset space ~
19172 A glob pattern that is used in the file dialog to filter out the desired
19174 If there is more than one possible file extension (e.
19175 \begin_inset space \thinspace{}
19179 \begin_inset space \space{}
19183 \begin_inset Flex Code
19186 \begin_layout Plain Layout
19193 \begin_inset Flex Code
19196 \begin_layout Plain Layout
19202 ), use something like
19203 \begin_inset Flex Code
19206 \begin_layout Plain Layout
19213 This command must occur exactly once.
19216 \begin_layout Description
19217 \begin_inset Flex Code
19220 \begin_layout Plain Layout
19222 \begin_inset space ~
19230 The text that is displayed on the button.
19231 This command must occur exactly once.
19234 \begin_layout Description
19235 \begin_inset Flex Code
19238 \begin_layout Plain Layout
19240 \begin_inset space ~
19244 \begin_inset space ~
19252 The help text that is used in the External dialog.
19253 Provide enough information to explain to the user just what the template
19254 can provide him with.
19255 This command must occur exactly once.
19258 \begin_layout Description
19259 \begin_inset Flex Code
19262 \begin_layout Plain Layout
19264 \begin_inset space ~
19272 The file format of the original file.
19273 This must be the name of a format that is known to LyX (see section
19274 \begin_inset space ~
19278 \begin_inset CommandInset ref
19280 reference "sec:Formats"
19286 \begin_inset Quotes eld
19290 \begin_inset Flex Code
19293 \begin_layout Plain Layout
19300 \begin_inset Quotes erd
19303 if the template can handle original files of more than one format.
19304 LyX will attempt to interrogate the file itself in order to deduce its
19305 format in this case.
19306 This command must occur exactly once.
19309 \begin_layout Description
19310 \begin_inset Flex Code
19313 \begin_layout Plain Layout
19315 \begin_inset space ~
19323 A unique name for the template.
19324 It must not contain substitution macros (see below).
19327 \begin_layout Description
19328 \begin_inset Flex Code
19331 \begin_layout Plain Layout
19333 \begin_inset space ~
19336 Rotate|Resize|Clip|Extra
19341 This command specifies which transformations are supported by this template.
19342 It may occur zero or more times.
19343 This command enables the corresponding tabs in the external dialog.
19345 \begin_inset Flex Code
19348 \begin_layout Plain Layout
19354 command must have either a corresponding
19355 \begin_inset Flex Code
19358 \begin_layout Plain Layout
19365 \begin_inset Flex Code
19368 \begin_layout Plain Layout
19375 \begin_inset Flex Code
19378 \begin_layout Plain Layout
19385 Otherwise the transformation will not be supported by that format.
19388 \begin_layout Subsection
19392 \begin_layout Description
19393 \begin_inset Flex Code
19396 \begin_layout Plain Layout
19398 \begin_inset space ~
19401 LaTeX|PDFLaTeX|PlainText|DocBook
19406 The primary document file format that this format definition is for.
19407 Not every template has a sensible representation in all document file formats.
19408 Please define nevertheless a
19409 \begin_inset Flex Code
19412 \begin_layout Plain Layout
19418 section for all templates.
19419 Use a dummy text when no representation is available.
19420 Then you can at least see a reference to the external material in the exported
19424 \begin_layout Description
19425 \begin_inset Flex Code
19428 \begin_layout Plain Layout
19430 \begin_inset space ~
19434 \begin_inset space ~
19442 This command defines an additional macro
19443 \begin_inset Flex Code
19446 \begin_layout Plain Layout
19452 for substitution in
19453 \begin_inset Flex Code
19456 \begin_layout Plain Layout
19464 \begin_inset Flex Code
19467 \begin_layout Plain Layout
19473 itself may contain substitution macros.
19474 The advantage over using
19475 \begin_inset Flex Code
19478 \begin_layout Plain Layout
19485 \begin_inset Flex Code
19488 \begin_layout Plain Layout
19494 is that the substituted value of
19495 \begin_inset Flex Code
19498 \begin_layout Plain Layout
19504 is sanitized so that it is a valid optional argument in the document format.
19505 This command may occur zero or more times.
19508 \begin_layout Description
19509 \begin_inset Flex Code
19512 \begin_layout Plain Layout
19514 \begin_inset space ~
19522 The text that is inserted in the exported document.
19523 This is actually the most important command and can be quite complex.
19524 This command must occur exactly once.
19527 \begin_layout Description
19528 \begin_inset Flex Code
19531 \begin_layout Plain Layout
19533 \begin_inset space ~
19541 This command specifies a preamble snippet that will be included in the
19543 It has to be defined using
19544 \begin_inset Flex Code
19547 \begin_layout Plain Layout
19553 \SpecialChar \ldots{}
19555 \begin_inset Flex Code
19558 \begin_layout Plain Layout
19565 This command may occur zero or more times.
19568 \begin_layout Description
19569 \begin_inset Flex Code
19572 \begin_layout Plain Layout
19574 \begin_inset space ~
19578 \begin_inset space ~
19586 This command denotes files that are created by the conversion process and
19587 are needed for a particular export format.
19588 If the filename is relative, it is interpreted relative to the master document.
19589 This command may be given zero or more times.
19592 \begin_layout Description
19593 \begin_inset Flex Code
19596 \begin_layout Plain Layout
19598 \begin_inset space ~
19606 The name of a required LaTeX package.
19607 The package is included via
19608 \begin_inset Flex Code
19611 \begin_layout Plain Layout
19619 in the LaTeX preamble.
19620 This command may occur zero or more times.
19623 \begin_layout Description
19624 \begin_inset Flex Code
19627 \begin_layout Plain Layout
19629 \begin_inset space ~
19633 \begin_inset space ~
19636 RotationLatexCommand
19641 This command specifies that the built in LaTeX command should be used for
19643 This command may occur once or not at all.
19646 \begin_layout Description
19647 \begin_inset Flex Code
19650 \begin_layout Plain Layout
19652 \begin_inset space ~
19656 \begin_inset space ~
19664 This command specifies that the built in LaTeX command should be used for
19666 This command may occur once or not at all.
19669 \begin_layout Description
19670 \begin_inset Flex Code
19673 \begin_layout Plain Layout
19675 \begin_inset space ~
19679 \begin_inset space ~
19682 RotationLatexOption
19687 This command specifies that rotation is done via an optional argument.
19688 This command may occur once or not at all.
19691 \begin_layout Description
19692 \begin_inset Flex Code
19695 \begin_layout Plain Layout
19697 \begin_inset space ~
19701 \begin_inset space ~
19709 This command specifies that resizing is done via an optional argument.
19710 This command may occur once or not at all.
19713 \begin_layout Description
19714 \begin_inset Flex Code
19717 \begin_layout Plain Layout
19719 \begin_inset space ~
19723 \begin_inset space ~
19731 This command specifies that clipping is done via an optional argument.
19732 This command may occur once or not at all.
19735 \begin_layout Description
19736 \begin_inset Flex Code
19739 \begin_layout Plain Layout
19741 \begin_inset space ~
19745 \begin_inset space ~
19753 This command specifies that an extra optional argument is used.
19754 This command may occur once or not at all.
19757 \begin_layout Description
19758 \begin_inset Flex Code
19761 \begin_layout Plain Layout
19763 \begin_inset space ~
19771 The file format of the converted file.
19772 This must be the name of a format that is known to LyX (see the
19773 \begin_inset Flex MenuItem
19776 \begin_layout Plain Layout
19781 ools\SpecialChar \menuseparator
19786 references\SpecialChar \menuseparator
19787 File Handling\SpecialChar \menuseparator
19794 This command must occur exactly once.
19797 \begin_layout Description
19798 \begin_inset Flex Code
19801 \begin_layout Plain Layout
19803 \begin_inset space ~
19811 The file name of the converted file.
19812 The file name must be absolute.
19813 This command must occur exactly once.
19816 \begin_layout Subsection
19817 Preamble definitions
19820 \begin_layout Standard
19821 The external template configuration file may contain additional preamble
19822 definitions enclosed by
19823 \begin_inset Flex Code
19826 \begin_layout Plain Layout
19832 \SpecialChar \ldots{}
19834 \begin_inset Flex Code
19837 \begin_layout Plain Layout
19844 They can be used by the templates in the
19845 \begin_inset Flex Code
19848 \begin_layout Plain Layout
19857 \begin_layout Section
19858 The substitution mechanism
19861 \begin_layout Standard
19862 When the external material facility invokes an external program, it is done
19863 on the basis of a command defined in the template configuration file.
19864 These commands can contain various macros that are expanded before execution.
19865 Execution always take place in the directory of the containing document.
19868 \begin_layout Standard
19869 Also, whenever external material is to be displayed, the name will be produced
19870 by the substitution mechanism, and most other commands in the template
19871 definition support substitution as well.
19874 \begin_layout Standard
19875 The available macros are the following:
19878 \begin_layout Description
19879 \begin_inset Flex Code
19882 \begin_layout Plain Layout
19883 $$AbsOrRelPathMaster
19888 The file path, absolute or relative to the master LyX document.
19891 \begin_layout Description
19892 \begin_inset Flex Code
19895 \begin_layout Plain Layout
19896 $$AbsOrRelPathParent
19901 The file path, absolute or relative to the LyX document.
19904 \begin_layout Description
19905 \begin_inset Flex Code
19908 \begin_layout Plain Layout
19914 The absolute file path.
19917 \begin_layout Description
19918 \begin_inset Flex Code
19921 \begin_layout Plain Layout
19927 The filename without path and without the extension.
19930 \begin_layout Description
19931 \begin_inset Flex Code
19934 \begin_layout Plain Layout
19936 \begin_inset Quotes eld
19940 \begin_inset Quotes erd
19948 This macro will expand to the contents of the file with the name
19949 \begin_inset Flex Code
19952 \begin_layout Plain Layout
19961 \begin_layout Description
19962 \begin_inset Flex Code
19965 \begin_layout Plain Layout
19971 The file extension (including the dot).
19974 \begin_layout Description
19975 \begin_inset Flex Code
19978 \begin_layout Plain Layout
19984 The filename of the file specified in the external material dialog.
19985 This is either an absolute name, or it is relative to the LyX document.
19988 \begin_layout Description
19989 \begin_inset Flex Code
19992 \begin_layout Plain Layout
19999 \begin_inset Flex Code
20002 \begin_layout Plain Layout
20008 (absolute name or relative to the LyX document).
20011 \begin_layout Description
20012 \begin_inset Flex Code
20015 \begin_layout Plain Layout
20021 The file path, relative to the master LyX document.
20024 \begin_layout Description
20025 \begin_inset Flex Code
20028 \begin_layout Plain Layout
20034 The file path, relative to the LyX document.
20037 \begin_layout Description
20038 \begin_inset Flex Code
20041 \begin_layout Plain Layout
20047 This macro will expand to the absolute path of the system directory.
20048 This is typically used to point to the various helper scripts that are
20052 \begin_layout Description
20053 \begin_inset Flex Code
20056 \begin_layout Plain Layout
20062 A name and full path to a temporary file which will be automatically deleted
20063 whenever the containing document is closed, or the external material insertion
20067 \begin_layout Standard
20068 All path macros contain a trailing directory separator, so you can construct
20070 \begin_inset space \thinspace{}
20074 \begin_inset space \space{}
20077 the absolute filename with
20078 \begin_inset Flex Code
20081 \begin_layout Plain Layout
20082 $$AbsPath$$Basename$$Extension
20090 \begin_layout Standard
20091 The macros above are substituted in all commands unless otherwise noted.
20093 \begin_inset Flex Code
20096 \begin_layout Plain Layout
20102 supports additionally the following substitutions if they are enabled by
20104 \begin_inset Flex Code
20107 \begin_layout Plain Layout
20114 \begin_inset Flex Code
20117 \begin_layout Plain Layout
20126 \begin_layout Description
20127 \begin_inset Flex Code
20130 \begin_layout Plain Layout
20136 The front part of the resize command.
20139 \begin_layout Description
20140 \begin_inset Flex Code
20143 \begin_layout Plain Layout
20149 The back part of the resize command.
20152 \begin_layout Description
20153 \begin_inset Flex Code
20156 \begin_layout Plain Layout
20162 The front part of the rotation command.
20165 \begin_layout Description
20166 \begin_inset Flex Code
20169 \begin_layout Plain Layout
20175 The back part of the rotation command.
20178 \begin_layout Standard
20179 The value string of the
20180 \begin_inset Flex Code
20183 \begin_layout Plain Layout
20189 command supports additionally the following substitutions if they are enabled
20191 \begin_inset Flex Code
20194 \begin_layout Plain Layout
20201 \begin_inset Flex Code
20204 \begin_layout Plain Layout
20213 \begin_layout Description
20214 \begin_inset Flex Code
20217 \begin_layout Plain Layout
20226 \begin_layout Description
20227 \begin_inset Flex Code
20230 \begin_layout Plain Layout
20239 \begin_layout Description
20240 \begin_inset Flex Code
20243 \begin_layout Plain Layout
20252 \begin_layout Description
20253 \begin_inset Flex Code
20256 \begin_layout Plain Layout
20262 The rotation option.
20265 \begin_layout Standard
20266 You may ask why there are so many path macros.
20267 There are mainly two reasons:
20270 \begin_layout Enumerate
20271 Relative and absolute file names should remain relative or absolute, respectivel
20273 Users may have reasons to prefer either form.
20274 Relative names are useful for portable documents that should work on different
20275 machines, for example.
20276 Absolute names may be required by some programs.
20279 \begin_layout Enumerate
20280 LaTeX treats relative file names differently than LyX and other programs
20281 in nested included files.
20282 For LyX, a relative file name is always relative to the document that contains
20284 For LaTeX, it is always relative to the master document.
20285 These two definitions are identical if you have only one document, but
20286 differ if you have a master document that includes part documents.
20287 That means that relative filenames must be transformed when presented to
20289 Fortunately LyX does this automatically for you if you choose the right
20293 \begin_layout Standard
20294 So which path macro should be used in new template definitions? The rule
20298 \begin_layout Itemize
20300 \begin_inset Flex Code
20303 \begin_layout Plain Layout
20309 if an absolute path is required.
20312 \begin_layout Itemize
20314 \begin_inset Flex Code
20317 \begin_layout Plain Layout
20318 $$AbsOrRelPathMaster
20323 if the substituted string is some kind of LaTeX input.
20326 \begin_layout Itemize
20328 \begin_inset Flex Code
20331 \begin_layout Plain Layout
20332 $$AbsOrRelPathParent
20337 in order to preserve the user's choice.
20340 \begin_layout Standard
20341 There are special cases where this rule does not work and e.
20342 \begin_inset space \thinspace{}
20346 \begin_inset space \space{}
20349 relative names are needed, but normally it will work just fine.
20350 One example for such a case is the command
20351 \begin_inset Flex Code
20354 \begin_layout Plain Layout
20355 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20360 in the XFig template above: We can't use the absolute name because the
20362 \begin_inset Flex Code
20365 \begin_layout Plain Layout
20371 files needs the relative name in order to rewrite the file content.
20374 \begin_layout Section
20375 Security discussion
20376 \begin_inset CommandInset label
20378 name "sec:Security-discussion"
20385 \begin_layout Standard
20386 The external material feature interfaces with a lot of external programs
20387 and does so automatically, so we have to consider the security implications
20389 In particular, since you have the option of including your own filenames
20390 and/or parameter strings and those are expanded into a command, it seems
20391 that it would be possible to create a malicious document which executes
20392 arbitrary commands when a user views or prints the document.
20393 This is something we definitely want to avoid.
20396 \begin_layout Standard
20397 However, since the external program commands are specified in the template
20398 configuration file only, there are no security issues if LyX is properly
20399 configured with safe templates only.
20400 This is so because the external programs are invoked with the
20401 \begin_inset Flex Code
20404 \begin_layout Plain Layout
20410 -system call rather than the
20411 \begin_inset Flex Code
20414 \begin_layout Plain Layout
20420 system-call, so it's not possible to execute arbitrary commands from the
20421 filename or parameter section via the shell.
20424 \begin_layout Standard
20425 This also implies that you are restricted in what command strings you can
20426 use in the external material templates.
20427 In particular, pipes and redirection are not readily available.
20428 This has to be so if LyX should remain safe.
20429 If you want to use some of the shell features, you should write a safe
20430 script to do this in a controlled manner, and then invoke the script from
20431 the command string.
20435 \begin_layout Standard
20436 It is possible to design a template that interacts directly with the shell,
20437 but since this would allow a malicious user to execute arbitrary commands
20438 by writing clever filenames and/or parameters, we generally recommend that
20439 you only use safe scripts that work with the
20440 \begin_inset Flex Code
20443 \begin_layout Plain Layout
20449 system call in a controlled manner.
20450 Of course, for use in a controlled environment, it can be tempting to just
20451 fall back to use ordinary shell scripts.
20452 If you do so, be aware that you
20456 provide an easily exploitable security hole in your system.
20457 Of course it stands to reason that such unsafe templates will never be
20458 included in the standard LyX distribution, although we do encourage people
20459 to submit new templates in the open source tradition.
20460 But LyX as shipped from the official distribution channels will never have
20464 \begin_layout Standard
20465 Including external material provides a lot of power, and you have to be
20466 careful not to introduce security hazards with this power.
20467 A subtle error in a single line in an innocent looking script can open
20468 the door to huge security problems.
20469 So if you do not fully understand the issues, we recommend that you consult
20470 a knowledgeable security professional or the LyX development team if you
20471 have any questions about whether a given template is safe or not.
20472 And do this before you use it in an uncontrolled environment.