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 % used for multi-column text
37 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
38 \use_default_options false
42 \maintain_unincluded_children false
45 InsetLayout Flex:MenuItem
54 \newcommand*{\menuitem}[1]{{\sffamily #1}}
57 # In case we need to do with sans...
58 #InsetLayout CharStyle:Code
63 #\renewcommand{\code}[1]{{\sffamily #1}}
68 \language_package default
73 \font_typewriter default
74 \font_default_family default
75 \use_non_tex_fonts false
82 \default_output_format default
84 \bibtex_command default
85 \index_command default
89 \pdf_title "LyX Configuration Manual"
90 \pdf_author "LyX Team"
91 \pdf_subject "LyX-documentation Customization"
92 \pdf_keywords "LyX, documentation, customization"
94 \pdf_bookmarksnumbered true
95 \pdf_bookmarksopen true
96 \pdf_bookmarksopenlevel 1
101 \pdf_pdfusetitle false
102 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
112 \paperorientation portrait
126 \paragraph_separation indent
127 \paragraph_indentation default
128 \quotes_language english
131 \paperpagestyle headings
132 \tracking_changes false
133 \output_changes false
142 Customizing LyX: Features for the Advanced User
150 \begin_layout Plain Layout
152 If you have comments or error corrections, please send them to the LyX Documenta
154 \begin_inset CommandInset href
156 target "lyx-docs@lists.lyx.org"
163 \begin_inset Quotes eld
167 \begin_inset Quotes erd
170 in the subject header, and please cc the current maintainer of this file,
171 Richard Heck <rgheck@comcast.net>.
177 \begin_inset Newline newline
181 \begin_inset Newline newline
187 \begin_layout Standard
188 \begin_inset CommandInset toc
189 LatexCommand tableofcontents
196 \begin_layout Standard
197 \begin_inset Note Note
200 \begin_layout Plain Layout
201 Please use change tracking when modifying this document.
202 This makes it easier for our translators to recognize things that have
203 been changed, and it helps the maintainer keep up-to-date with what's been
212 \begin_layout Chapter
216 \begin_layout Standard
217 This manual covers the customization features present in LyX.
218 In it, we discuss issues like keyboard shortcuts, screen previewing options,
219 printer options, sending commands to LyX via the LyX Server, internationalizati
220 on, installing new LaTeX classes and LyX layouts, etc.
221 We can't possibly hope to touch on everything you can change—our developers
222 add new features faster than we can document them—but we will explain the
223 most common customizations and hopefully point you in the right direction
224 for some of the more obscure ones.
227 \begin_layout Standard
228 \begin_inset Branch OutDated
231 \begin_layout Standard
232 Information from previous versions of this document that now seems to be
233 outdated is contained in the OutDated branch of this document.
234 By default, this information will not appear in the LaTeX output.
242 \begin_layout Chapter
243 LyX configuration files
246 \begin_layout Standard
247 This chapter aims to help you to find your way through the LyX configuration
249 Before continuing to read this chapter, you should find out where your
250 LyX library and user directories are by using
251 \begin_inset Flex MenuItem
254 \begin_layout Plain Layout
255 Help\SpecialChar \menuseparator
266 The library directory is the place where LyX places its system-wide configurati
267 on files; the user directory is where you can place your modified versions.
268 We will call the former
269 \begin_inset Flex Code
272 \begin_layout Plain Layout
279 \begin_inset Flex MenuItem
282 \begin_layout Plain Layout
288 in the remainder of this document.
292 \begin_layout Section
294 \begin_inset Flex Code
297 \begin_layout Plain Layout
306 \begin_layout Standard
307 \begin_inset Flex Code
310 \begin_layout Plain Layout
316 and its sub-directories contain a number of files and that can be used
317 to customize LyX's behavior.
318 You can change many of these files from within LyX itself through the
319 \begin_inset Flex MenuItem
322 \begin_layout Plain Layout
323 Tools\SpecialChar \menuseparator
330 Most customization that you will want to do in LyX is possible through
332 However, many other inner aspects of LyX can be customized by modifying
334 \begin_inset Flex Code
337 \begin_layout Plain Layout
344 These files fall in different categories, described in the following subsection
348 \begin_layout Subsection
349 Automatically generated files
352 \begin_layout Standard
353 The files, which are to be found in
354 \begin_inset Flex MenuItem
357 \begin_layout Plain Layout
363 , are generated when you configure LyX.
364 They contain various default values that are guessed by inspection.
365 In general, it is not a good idea to modify them, since they might be overwritt
369 \begin_layout Labeling
370 \labelwidthstring 00.00.0000
371 \begin_inset Flex Code
374 \begin_layout Plain Layout
380 contains defaults for various commands.
383 \begin_layout Labeling
384 \labelwidthstring 00.00.0000
385 \begin_inset Flex Code
388 \begin_layout Plain Layout
394 contains the list of packages that have been recognized by LyX.
395 It is currently unused by the LyX program itself, but the information extracted
396 , and more, is made available with
397 \begin_inset Flex MenuItem
400 \begin_layout Plain Layout
401 Help\SpecialChar \menuseparator
414 \begin_layout Labeling
415 \labelwidthstring 00.00.0000
416 \begin_inset Flex Code
419 \begin_layout Plain Layout
425 the list of text classes that have been found in your
426 \begin_inset Flex Code
429 \begin_layout Plain Layout
435 directories, along with the associated LaTeX document class and their descripti
439 \begin_layout Labeling
440 \labelwidthstring 00.00.0000
441 \begin_inset Flex Code
444 \begin_layout Plain Layout
450 the list of layout modules found in your
451 \begin_inset Flex Code
454 \begin_layout Plain Layout
463 \begin_layout Labeling
464 \labelwidthstring 00.00.0000
465 \begin_inset Flex Code
468 \begin_layout Plain Layout
474 lists of various sorts of LaTeX-related files found on your system
477 \begin_layout Labeling
478 \labelwidthstring 00.00.0000
479 \begin_inset Flex Code
482 \begin_layout Plain Layout
488 is automatically generated during configuration from the file
489 \begin_inset Flex Code
492 \begin_layout Plain Layout
499 It contains information on your LaTeX configuration.
502 \begin_layout Subsection
506 \begin_layout Standard
507 These directories are duplicated between
508 \begin_inset Flex Code
511 \begin_layout Plain Layout
518 \begin_inset Flex Code
521 \begin_layout Plain Layout
528 If a particular files exists in both places, the one in
529 \begin_inset Flex Code
532 \begin_layout Plain Layout
541 \begin_layout Labeling
542 \labelwidthstring 00.00.0000
543 \begin_inset Flex Code
546 \begin_layout Plain Layout
552 this directory contains files with the extension
553 \begin_inset Flex Code
556 \begin_layout Plain Layout
562 that define the keybindings used in LyX.
563 If there exists an internationalized version of the bind file named
564 \begin_inset Flex Code
567 \begin_layout Plain Layout
573 , that will be used first.
576 \begin_layout Labeling
577 \labelwidthstring 00.00.0000
578 \begin_inset Flex Code
581 \begin_layout Plain Layout
587 contains graphics files that can be included in documents.
591 \begin_layout Labeling
592 \labelwidthstring 00.00.0000
593 \begin_inset Flex Code
596 \begin_layout Plain Layout
602 contains LyX documentation files (including the one you are currently reading).
604 \begin_inset Flex Code
607 \begin_layout Plain Layout
613 deserves special attention, as noted above.
614 The internationalized help docs are in subdirectories
615 \begin_inset Flex Code
618 \begin_layout Plain Layout
625 \begin_inset Quotes eld
629 \begin_inset Quotes erd
632 is the ISO language code.
638 \begin_inset CommandInset ref
640 reference "cha:Internationalizing-LyX"
647 \begin_layout Labeling
648 \labelwidthstring 00.00.0000
649 \begin_inset Flex Code
652 \begin_layout Plain Layout
658 contains example files that explain how to use some features.
659 In the file browser, press the
660 \begin_inset Flex MenuItem
663 \begin_layout Plain Layout
672 \begin_layout Labeling
673 \labelwidthstring 00.00.0000
674 \begin_inset Flex Code
677 \begin_layout Plain Layout
683 contains image files that are used by the
684 \begin_inset Flex MenuItem
687 \begin_layout Plain Layout
694 In addition, it also contains the individual icons used in the toolbar
695 and the banners that can be shown when LyX is launched.
698 \begin_layout Labeling
699 \labelwidthstring 00.00.0000
700 \begin_inset Flex Code
703 \begin_layout Plain Layout
709 contains keyboard keymapping files.
715 \begin_inset CommandInset ref
717 reference "sec:International-Keymap-Stuff"
724 \begin_layout Labeling
725 \labelwidthstring 00.00.0000
726 \begin_inset Flex Code
729 \begin_layout Plain Layout
735 contains the text class and module files described in Chapter
740 \begin_inset CommandInset ref
742 reference "cha:Installing-New-Document"
749 \begin_layout Labeling
750 \labelwidthstring 00.00.0000
751 \begin_inset Flex Code
754 \begin_layout Plain Layout
761 \begin_inset Flex Code
764 \begin_layout Plain Layout
770 Python scripts used to convert between LyX versions.
771 These can be run from the command line if, say, you want to batch-convert
775 \begin_layout Labeling
776 \labelwidthstring 00.00.0000
777 \begin_inset Flex Code
780 \begin_layout Plain Layout
786 contains some files that demonstrate the capabilities of the
787 \begin_inset Flex MenuItem
790 \begin_layout Plain Layout
801 Also contains some scripts used by LyX itself.
804 \begin_layout Labeling
805 \labelwidthstring 00.00.0000
806 \begin_inset Flex Code
809 \begin_layout Plain Layout
815 contains the standard LyX template files described in Chapter
820 \begin_inset CommandInset ref
822 reference "sub:Creating-Templates"
829 \begin_layout Labeling
830 \labelwidthstring 00.00.0000
831 \begin_inset Flex Code
834 \begin_layout Plain Layout
840 contains files with the extension
841 \begin_inset Flex Code
844 \begin_layout Plain Layout
850 that define the user interface to LyX.
851 That is, the files define which items appear in which menus and the items
852 appearing on the toolbar.
855 \begin_layout Subsection
856 Files you don't want to modify
859 \begin_layout Standard
860 These files are used internally by LyX and you generally do not need to
861 modify them unless you are a developer.
864 \begin_layout Labeling
865 \labelwidthstring 00.00.0000
866 \begin_inset Flex Code
869 \begin_layout Plain Layout
875 this file contains the list of LyX developers.
876 The contents are displayed with the menu entry
877 \begin_inset Flex MenuItem
880 \begin_layout Plain Layout
881 Help\SpecialChar \menuseparator
894 \begin_layout Labeling
895 \labelwidthstring 00.00.0000
896 \begin_inset Flex Code
899 \begin_layout Plain Layout
905 this is a LaTeX script used during the configuration process.
909 \begin_layout Labeling
910 \labelwidthstring 00.00.0000
911 \begin_inset Flex Code
914 \begin_layout Plain Layout
920 this is the script that is used to re-configure LyX.
921 It creates configuration files in the directory it was run from.
924 \begin_layout Subsection
925 Other files needing a line or two...
928 \begin_layout Labeling
929 \labelwidthstring 00.00.0000
930 \begin_inset Flex Code
933 \begin_layout Plain Layout
939 this contains tables describing how different character encodings can be
943 \begin_layout Labeling
944 \labelwidthstring 00.00.0000
945 \begin_inset Flex Code
948 \begin_layout Plain Layout
954 this file contains the templates available to the new
955 \begin_inset Flex MenuItem
958 \begin_layout Plain Layout
971 \begin_layout Labeling
972 \labelwidthstring 00.00.0000
973 \begin_inset Flex Code
976 \begin_layout Plain Layout
982 this file contains a list of all the languages currently supported by LyX.
985 \begin_layout Section
986 Your local configuration directory
989 \begin_layout Standard
990 Even if you are using LyX as an unprivileged user, you might want to change
991 LyX configuration for your own use.
993 \begin_inset Flex Code
996 \begin_layout Plain Layout
1002 directory contains all your personal configuration files.
1003 This is the directory described as
1004 \begin_inset Quotes eld
1008 \begin_inset Quotes erd
1012 \begin_inset Flex MenuItem
1015 \begin_layout Plain Layout
1016 Help\SpecialChar \menuseparator
1018 \begin_inset space ~
1027 This directory is used as a mirror of
1028 \begin_inset Flex Code
1031 \begin_layout Plain Layout
1037 , which means that every file in
1038 \begin_inset Flex Code
1041 \begin_layout Plain Layout
1047 is a replacement for the corresponding file in
1048 \begin_inset Flex Code
1051 \begin_layout Plain Layout
1058 Any configuration file described in the above sections can be placed either
1059 in the system-wide directory, in which case it will affect all users, or
1060 in your local directory for your own use.
1063 \begin_layout Standard
1064 To make things clearer, let's provide a few examples:
1067 \begin_layout Itemize
1068 The preferences set in the
1069 \begin_inset Flex MenuItem
1072 \begin_layout Plain Layout
1073 Tools\SpecialChar \menuseparator
1079 dialog are saved to a file
1080 \begin_inset Flex Code
1083 \begin_layout Plain Layout
1090 \begin_inset Flex Code
1093 \begin_layout Plain Layout
1102 \begin_layout Itemize
1103 When you reconfigure using
1104 \begin_inset Flex MenuItem
1107 \begin_layout Plain Layout
1108 Tools\SpecialChar \menuseparator
1115 \begin_inset Flex Code
1118 \begin_layout Plain Layout
1124 script, and the resulting files are written in your local configuration
1126 This means that any additional text class file that you might have added
1128 \begin_inset Flex Code
1131 \begin_layout Plain Layout
1137 will be added to the list of classes in the
1138 \begin_inset Flex MenuItem
1141 \begin_layout Plain Layout
1142 Document\SpecialChar \menuseparator
1151 \begin_layout Itemize
1152 If you get some updated documentation from LyX ftp site and cannot install
1153 it because you do not have sysadmin rights on your system, you can just
1155 \begin_inset Flex Code
1158 \begin_layout Plain Layout
1164 and the items in the
1165 \begin_inset Flex MenuItem
1168 \begin_layout Plain Layout
1174 menu will open them!
1177 \begin_layout Section
1178 Running LyX with multiple configurations
1181 \begin_layout Standard
1182 The configuration freedom of the local configuration directory may not suffice
1183 if you want to have more than one configuration at your disposal.
1184 For example, you may want to be use different key bindings or printer settings
1186 You can achieve this by having several such directories.
1187 You then specify which directory to use at run-time.
1190 \begin_layout Standard
1191 Invoking LyX with the command line switch
1192 \begin_inset Flex Code
1195 \begin_layout Plain Layout
1205 instructs the program to read the configuration from that directory, and
1206 not from the default directory.
1207 (You can determine the default directory by running LyX without the
1208 \begin_inset Flex Code
1211 \begin_layout Plain Layout
1217 switch.) If the specified directory does not exist, LyX offers to create
1218 it for you, just like it does for the default directory on the first time
1219 you run the program.
1220 You can modify the configuration options in this additional user directory
1221 exactly as you would for the default directory.
1222 These directories are completely independent (but read on).
1223 Note that setting the environment variable
1224 \begin_inset Flex Code
1227 \begin_layout Plain Layout
1233 to some value has exactly the same effect.
1236 \begin_layout Standard
1237 Having several configurations also requires more maintenance: if you want
1238 to add a new layout to
1239 \begin_inset Flex Code
1242 \begin_layout Plain Layout
1248 which you want available from all your configurations, you must add it
1249 to each directory separately.
1250 You can avoid this with the following trick: after LyX creates the additional
1251 directory, most of the subdirectories (see above) are empty.
1252 If you want the new configuration to mirror an existing one, replace the
1253 empty subdirectory with a symbolic link to the matching subdirectory in
1254 the existing configuration.
1256 \begin_inset Flex Code
1259 \begin_layout Plain Layout
1265 subdirectory, however, since it contains a file written by the configuration
1266 script (also accessible through
1267 \begin_inset Flex MenuItem
1270 \begin_layout Plain Layout
1271 Tools\SpecialChar \menuseparator
1277 ) which is configuration-specific.
1280 \begin_layout Chapter
1281 The Preferences dialog
1284 \begin_layout Standard
1285 All options of the preferences dialog are described in the Appendix
1287 The Preferences Dialog
1294 For some options you might find here more details.
1297 \begin_layout Section
1299 \begin_inset CommandInset label
1308 \begin_layout Standard
1309 The first step is to define your file formats if they are not already defined.
1311 \begin_inset Flex MenuItem
1314 \begin_layout Plain Layout
1315 Tools\SpecialChar \menuseparator
1323 \begin_inset Flex MenuItem
1326 \begin_layout Plain Layout
1327 File Handling\SpecialChar \menuseparator
1334 \begin_inset Flex MenuItem
1337 \begin_layout Plain Layout
1338 New\SpecialChar \ldots{}
1344 button to define your new format.
1346 \begin_inset Flex MenuItem
1349 \begin_layout Plain Layout
1355 field contains the name used to identify the format in the GUI.
1357 \begin_inset Flex MenuItem
1360 \begin_layout Plain Layout
1366 is used to identify the format internally.
1367 You will also need to enter a file extension.
1368 These are all required.
1370 \begin_inset Flex MenuItem
1373 \begin_layout Plain Layout
1379 field is used to provide a keyboard shortcut on the menus.
1380 (For example, pressing
1381 \begin_inset Flex MenuItem
1384 \begin_layout Plain Layout
1391 \begin_inset Flex MenuItem
1394 \begin_layout Plain Layout
1395 View\SpecialChar \menuseparator
1396 View (Other Formats)\SpecialChar \menuseparator
1405 \begin_layout Standard
1407 \begin_inset Flex MenuItem
1410 \begin_layout Plain Layout
1417 \begin_inset Flex MenuItem
1420 \begin_layout Plain Layout
1427 For example, you might want to use
1428 \begin_inset Flex MenuItem
1431 \begin_layout Plain Layout
1437 to view PostScript files.
1438 You can enter the command needed to start the program in the corresponding
1440 In defining this command, you can use the four variables listed in the
1442 The viewer is launched when you view an image in LyX or use the
1443 \begin_inset Flex MenuItem
1446 \begin_layout Plain Layout
1453 The editor is for example launched when you right-click on an image and
1455 \begin_inset Flex MenuItem
1458 \begin_layout Plain Layout
1464 in the appearing context menu.
1467 \begin_layout Standard
1469 \begin_inset Flex MenuItem
1472 \begin_layout Plain Layout
1478 option tells LyX that a format is suitable for document export.
1479 If this is set and if a suitable conversion route exists (see sec.
1480 \begin_inset space \thinspace{}
1484 \begin_inset CommandInset ref
1486 reference "sec:Converters"
1490 ), the format will appear in the
1491 \begin_inset Flex MenuItem
1494 \begin_layout Plain Layout
1495 File\SpecialChar \menuseparator
1502 The format will also appear in the
1503 \begin_inset Flex MenuItem
1506 \begin_layout Plain Layout
1512 menu if a viewer is specified for the format.
1513 Pure image formats, such as
1514 \begin_inset Flex Code
1517 \begin_layout Plain Layout
1523 , should not use this option.
1524 Formats that can both represent vector graphics and documents like
1525 \begin_inset Flex Code
1528 \begin_layout Plain Layout
1537 \begin_layout Standard
1539 \begin_inset Flex MenuItem
1542 \begin_layout Plain Layout
1543 Vector graphics format
1548 tells LyX that a format can contain vector graphics.
1549 This information is used to determine the target format of included graphics
1551 \begin_inset Flex MenuItem
1554 \begin_layout Plain Layout
1561 Included graphics may need to be converted to either
1562 \begin_inset Flex MenuItem
1565 \begin_layout Plain Layout
1572 \begin_inset Flex MenuItem
1575 \begin_layout Plain Layout
1582 \begin_inset Flex MenuItem
1585 \begin_layout Plain Layout
1592 \begin_inset Flex MenuItem
1595 \begin_layout Plain Layout
1601 cannot handle other image formats.
1602 If an included graphic is not already in
1603 \begin_inset Flex MenuItem
1606 \begin_layout Plain Layout
1613 \begin_inset Flex MenuItem
1616 \begin_layout Plain Layout
1623 \begin_inset Flex MenuItem
1626 \begin_layout Plain Layout
1632 format, it is converted to
1633 \begin_inset Flex MenuItem
1636 \begin_layout Plain Layout
1642 if the vector format option is set, and otherwise to
1643 \begin_inset Flex MenuItem
1646 \begin_layout Plain Layout
1655 \begin_layout Section
1659 \begin_layout Standard
1660 Since all conversions from one format to another take place in LyX's temporary
1661 directory, it is sometimes necessary to modify a file before copying it
1662 to the temporary directory in order that the conversion may be performed.
1666 \begin_layout Plain Layout
1667 For example, the file may refer to other files—images, for example—using
1668 relative file names, and these may become invalid when the file is copied
1669 to the temporary directory.
1674 This is done by a Copier: It copies a file to (or from) the temporary directory
1675 and may modify it in the process.
1678 \begin_layout Standard
1679 The definitions of the copiers may use four variables:
1682 \begin_layout Labeling
1683 \labelwidthstring 00.00.0000
1684 \begin_inset Flex Code
1687 \begin_layout Plain Layout
1693 The LyX system directory (e.
1694 \begin_inset space \thinspace{}
1698 \begin_inset space \space{}
1702 \begin_inset Flex MenuItem
1705 \begin_layout Plain Layout
1714 \begin_layout Labeling
1715 \labelwidthstring 00.00.0000
1716 \begin_inset Flex Code
1719 \begin_layout Plain Layout
1728 \begin_layout Labeling
1729 \labelwidthstring 00.00.0000
1730 \begin_inset Flex Code
1733 \begin_layout Plain Layout
1742 \begin_layout Labeling
1743 \labelwidthstring 00.00.0000
1744 \begin_inset Flex Code
1747 \begin_layout Plain Layout
1756 \begin_layout Standard
1757 The latter should be the filename as it would be used in a LaTeX's
1764 It is relevant only when exporting files suitable for such inclusion.
1767 \begin_layout Standard
1768 Copiers can be used to do almost anything with output files.
1769 For example, suppose you want generated pdf files to be copied to a special
1771 \begin_inset Flex Code
1774 \begin_layout Plain Layout
1781 Then you could write a shell script such as this one:
1784 \begin_layout Standard
1785 \begin_inset listings
1789 \begin_layout Plain Layout
1794 \begin_layout Plain Layout
1799 \begin_layout Plain Layout
1801 TOFILE=`basename $2`
1804 \begin_layout Plain Layout
1806 cp $FROMFILE /home/you/pdf/$TOFILE
1811 Save it in your local LyX directory—say,
1812 \begin_inset Flex Code
1815 \begin_layout Plain Layout
1816 /home/you/.lyx/scripts/pdfcopier.sh
1821 —and make it executable, if you need to do so on your platform.
1823 \begin_inset Flex MenuItem
1826 \begin_layout Plain Layout
1827 Tools\SpecialChar \menuseparator
1833 dialog, select under
1834 \begin_inset Flex MenuItem
1837 \begin_layout Plain Layout
1838 File Handling\SpecialChar \menuseparator
1845 \begin_inset Flex MenuItem
1848 \begin_layout Plain Layout
1854 format—or one of the other pdf formats—and enter
1855 \begin_inset Flex Code
1858 \begin_layout Plain Layout
1859 pdfcopier.sh $$i $$o
1865 \begin_inset Flex MenuItem
1868 \begin_layout Plain Layout
1878 \begin_layout Standard
1879 Copiers are used by LyX in various of its own conversions.
1880 For example, if appropriate programs are found, LyX will automatically
1881 install copiers for the
1882 \begin_inset Flex MenuItem
1885 \begin_layout Plain Layout
1892 \begin_inset Flex MenuItem
1895 \begin_layout Plain Layout
1897 \begin_inset space ~
1906 When these formats are exported, the copier sees that not just the main
1907 HTML file but various associated files (style files, images, etc.) are also
1909 All these files are written to a subdirectory of the directory in which
1910 the original LyX file was found.
1914 \begin_layout Plain Layout
1915 This copier can be customized.
1917 \begin_inset Quotes eld
1921 \begin_inset Quotes erd
1924 argument takes a comma-separated list of extensions to be copied; if it
1925 is omitted, all files will be copied.
1927 \begin_inset Quotes eld
1931 \begin_inset Quotes erd
1934 argument determines the extension added to the generated directory.
1936 \begin_inset Quotes eld
1940 \begin_inset Flex MenuItem
1943 \begin_layout Plain Layout
1950 \begin_inset Quotes erd
1953 , so HTML generated from
1954 \begin_inset Flex MenuItem
1957 \begin_layout Plain Layout
1958 /path/to/filename.lyx
1964 \begin_inset Flex MenuItem
1967 \begin_layout Plain Layout
1968 /path/to/filename.html.LyXconv
1982 \begin_layout Section
1984 \begin_inset CommandInset label
1986 name "sec:Converters"
1993 \begin_layout Standard
1994 You can define your own Converters to convert files between different formats.
1996 \begin_inset Flex MenuItem
1999 \begin_layout Plain Layout
2000 Tools\SpecialChar \menuseparator
2001 Preferences\SpecialChar \menuseparator
2002 File Handling\SpecialChar \menuseparator
2011 \begin_layout Standard
2012 To define a new converter, select the
2013 \begin_inset Flex MenuItem
2016 \begin_layout Plain Layout
2018 \begin_inset space ~
2027 \begin_inset Flex MenuItem
2030 \begin_layout Plain Layout
2032 \begin_inset space ~
2040 from the drop-down lists, enter the command needed for the conversion,
2042 \begin_inset Flex MenuItem
2045 \begin_layout Plain Layout
2052 Several variables can be used in the definition of converters:
2055 \begin_layout Labeling
2056 \labelwidthstring 00.00.0000
2057 \begin_inset Flex Code
2060 \begin_layout Plain Layout
2066 The LyX system directory
2069 \begin_layout Labeling
2070 \labelwidthstring 00.00.0000
2071 \begin_inset Flex Code
2074 \begin_layout Plain Layout
2083 \begin_layout Labeling
2084 \labelwidthstring 00.00.0000
2085 \begin_inset Flex Code
2088 \begin_layout Plain Layout
2097 \begin_layout Labeling
2098 \labelwidthstring 00.00.0000
2099 \begin_inset Flex Code
2102 \begin_layout Plain Layout
2108 The base filename of the input file (i.
2109 \begin_inset space \thinspace{}
2112 g., without the extension)
2115 \begin_layout Labeling
2116 \labelwidthstring 00.00.0000
2117 \begin_inset Flex Code
2120 \begin_layout Plain Layout
2126 The path to the input file
2129 \begin_layout Labeling
2130 \labelwidthstring 00.00.0000
2131 \begin_inset Flex Code
2134 \begin_layout Plain Layout
2140 The path to the original input file (this is different from $$p when a
2141 chain of converters is called)
2144 \begin_layout Labeling
2145 \labelwidthstring 00.00.0000
2146 \begin_inset Flex Code
2149 \begin_layout Plain Layout
2155 The iconv name for the encoding of the document.
2158 \begin_layout Standard
2160 \begin_inset Flex MenuItem
2163 \begin_layout Plain Layout
2165 \begin_inset space ~
2173 field you can enter the following flags, separated by commas:
2176 \begin_layout Labeling
2177 \labelwidthstring 00.00.0000
2178 \begin_inset Flex Code
2181 \begin_layout Plain Layout
2187 This converter runs some form of LaTeX.
2188 This will make LyX's LaTeX error logs available.
2191 \begin_layout Labeling
2192 \labelwidthstring 00.00.0000
2193 \begin_inset Flex Code
2196 \begin_layout Plain Layout
2203 \begin_inset Flex MenuItem
2206 \begin_layout Plain Layout
2212 file for the conversion.
2215 \begin_layout Labeling
2216 \labelwidthstring 00.00.0000
2217 \begin_inset Flex Code
2220 \begin_layout Plain Layout
2229 \begin_layout Standard
2230 The following three flags are not really flags at all because they take
2232 \begin_inset Flex MenuItem
2235 \begin_layout Plain Layout
2237 \begin_inset space ~
2241 \begin_inset space ~
2252 \begin_layout Labeling
2253 \labelwidthstring 00.00.0000
2254 \begin_inset Flex Code
2257 \begin_layout Plain Layout
2263 If set, the converter's standard error will be redirected to a file
2264 \begin_inset Flex Code
2267 \begin_layout Plain Layout
2273 , and the script given as argument will be run as:
2274 \begin_inset Flex Code
2277 \begin_layout Plain Layout
2278 script < infile.out > infile.log
2284 The argument may contain
2285 \begin_inset Flex Code
2288 \begin_layout Plain Layout
2297 \begin_layout Labeling
2298 \labelwidthstring 00.00.0000
2299 \begin_inset Flex Code
2302 \begin_layout Plain Layout
2308 The name of the directory in which the converter will dump the generated
2310 LyX will not create this directory, and it does not copy anything into
2311 it, though it will copy this directory to the destination.
2312 The argument may contain
2313 \begin_inset Flex Code
2316 \begin_layout Plain Layout
2322 , which will be replaced by the base name of the input and output files,
2323 respectively, when the directory is copied.
2324 \begin_inset Newline newline
2327 Note that resultdir and usetempdir make no sense together.
2328 The latter will be ignored if the former is given.
2331 \begin_layout Labeling
2332 \labelwidthstring 00.00.0000
2333 \begin_inset Flex Code
2336 \begin_layout Plain Layout
2342 Determines the output file name and may, contain
2343 \begin_inset Flex Code
2346 \begin_layout Plain Layout
2353 Sensible only with resultdir and optional even then; if not given, it defaults
2357 \begin_layout Standard
2358 None of these last three are presently used in any of the converters that
2359 are installed with LyX.
2363 \begin_layout Standard
2364 You do not have to define converters for all formats between which you want
2366 For example, you will note that there is no `LyX to PostScript' converter,
2367 but LyX will export PostScript.
2368 It does so by first creating a LaTeX file (no converter needs to be defined
2369 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2370 and finally converting the resulting DVI file to PostScript.
2371 LyX finds such `chains' of converters automatically, and it will always
2372 choose the shortest possible chain.
2373 You can, though, still define multiple conversion methods between file
2375 For example, the standard LyX configuration provides three ways to convert
2376 LaTeX to PDF: Directly, using
2377 \begin_inset Flex MenuItem
2380 \begin_layout Plain Layout
2386 ; via (DVI and) PostScript, using
2387 \begin_inset Flex MenuItem
2390 \begin_layout Plain Layout
2397 \begin_inset Flex MenuItem
2400 \begin_layout Plain Layout
2407 To define such alternate chains, you must define multiple target `file
2408 formats', as described in section
2409 \begin_inset CommandInset ref
2411 reference "sec:Formats"
2416 For example, in the standard configuration, the formats named
2417 \begin_inset Flex MenuItem
2420 \begin_layout Plain Layout
2427 \begin_inset Flex MenuItem
2430 \begin_layout Plain Layout
2437 \begin_inset Flex MenuItem
2440 \begin_layout Plain Layout
2446 are defined, all of which share the extension
2447 \begin_inset Flex MenuItem
2450 \begin_layout Plain Layout
2456 , and which correspond to the conversion methods just mentioned.
2459 \begin_layout Chapter
2460 Internationalizing LyX
2461 \begin_inset CommandInset label
2463 name "cha:Internationalizing-LyX"
2470 \begin_layout Standard
2471 LyX supports using a translated interface.
2472 Last time we checked, LyX provided text in thirty languages.
2473 The language of choice is called your
2478 (For further reading on locale settings, see also the documentation for
2479 locale that comes with your operating system.
2480 For Linux, the manual page for
2481 \begin_inset Flex Code
2484 \begin_layout Plain Layout
2490 could be a good place to start).
2493 \begin_layout Standard
2494 Notice that these translations will work, but do contain a few flaws.
2495 In particular, all dialogs have been designed with the English text in
2496 mind, which means that some of the translated text will be too large to
2497 fit within the space allocated.
2498 This is only a display problem and will not cause any harm.
2499 Also, you will find that some of the translations do not define shortcut
2500 keys for everything.
2501 Sometimes, there are simply not enough free letters to do it.
2502 Other times, the translator just hasn't got around to doing it yet.
2503 Our localization team, which you may wish to join,
2507 \begin_layout Plain Layout
2508 If you are a fluent speaker of a language other than English, joining these
2509 teams is a great way to give back to the LyX community!
2514 will of course try to fix these shortcomings in future versions of LyX.
2517 \begin_layout Section
2521 \begin_layout Subsection
2522 Translating the graphical user interface (text messages).
2525 \begin_layout Standard
2527 \begin_inset Flex Code
2530 \begin_layout Plain Layout
2536 library to handle the internationalization of the interface.
2537 To have LyX speak your favorite language in all menus and dialogs, you
2539 \begin_inset Flex Code
2542 \begin_layout Plain Layout
2548 -file for that language.
2549 When this is available, you'll have to generate a
2550 \begin_inset Flex Code
2553 \begin_layout Plain Layout
2559 -file from it and install the
2560 \begin_inset Flex Code
2563 \begin_layout Plain Layout
2570 The process of doing all of this is explained in the documentation for
2572 \begin_inset Flex Code
2575 \begin_layout Plain Layout
2582 It is possible to do this just for yourself, but if you're going to do
2583 it, you might as well share the results of your labors with the rest of
2585 Send a message to the LyX developers' list for more information about how
2589 \begin_layout Standard
2590 In short, this is what you should do (xx denotes the language code):
2593 \begin_layout Itemize
2594 Check out the LyX source code.
2596 \begin_inset CommandInset href
2598 name "information on the web"
2599 target "http://www.lyx.org/HowToUseSVN"
2606 \begin_layout Itemize
2608 \begin_inset Flex Code
2611 \begin_layout Plain Layout
2617 to the folder of the
2618 \begin_inset Flex Code
2621 \begin_layout Plain Layout
2629 \begin_inset Flex Code
2632 \begin_layout Plain Layout
2640 \begin_inset Flex Code
2643 \begin_layout Plain Layout
2649 doesn't exist anywhere, it can be remade with the console command
2650 \begin_inset Flex Code
2653 \begin_layout Plain Layout
2659 in that directory, or you can use an existing po-file for some other language
2663 \begin_layout Itemize
2665 \begin_inset Flex Code
2668 \begin_layout Plain Layout
2678 \begin_layout Plain Layout
2679 This is just a text file, so it can be edited in any text editor.
2680 But there are also specialized programs that support such editing, such
2685 (for all platforms) or
2694 contains a `mode' for editing
2695 \begin_inset Flex Code
2698 \begin_layout Plain Layout
2709 For some menu- and widget-labels, there are also shortcut keys that should
2711 Those keys are marked after a `|', and should be translated according to
2712 the words and phrases of the language.
2713 You should also fill also out the information at the beginning of the new
2715 \begin_inset Flex Code
2718 \begin_layout Plain Layout
2724 -file with your email-address, etc., so people know where to reach you with
2725 suggestions and entertaining flames.
2728 \begin_layout Standard
2729 If you are just doing this on your own, then:
2732 \begin_layout Itemize
2734 \begin_inset Flex Code
2737 \begin_layout Plain Layout
2744 This can be done with
2745 \begin_inset Flex Code
2748 \begin_layout Plain Layout
2749 msgfmt -o xx.mo < xx.po
2757 \begin_layout Itemize
2759 \begin_inset Flex Code
2762 \begin_layout Plain Layout
2768 -file to your locale-tree, at the correct directory for application messages
2773 xx, and under the name
2774 \begin_inset Flex Code
2777 \begin_layout Plain Layout
2784 \begin_inset space \thinspace{}
2788 \begin_inset space \space{}
2792 \begin_inset Flex Code
2795 \begin_layout Plain Layout
2796 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2806 \begin_layout Standard
2807 As said, however, it would be best if the new
2808 \begin_inset Flex Code
2811 \begin_layout Plain Layout
2817 -file could be added to the LyX distribution, so others can use it.
2818 Adding it involves making additional changes to LyX.
2819 So send an email to the developers' mailing list if you're interested in
2823 \begin_layout Subsubsection
2827 \begin_layout Standard
2828 Sometimes it turns out that one English message needs to be translated into
2829 different messages in the target language.
2830 One example is the message
2831 \begin_inset Flex Code
2834 \begin_layout Plain Layout
2840 which has the German translation
2848 , depending upon exactly what the English
2849 \begin_inset Quotes eld
2853 \begin_inset Quotes erd
2858 \begin_inset Flex Code
2861 \begin_layout Plain Layout
2867 does not handle such ambiguous translations.
2868 Therefore you have to add some context information to the message: Instead
2870 \begin_inset Flex Code
2873 \begin_layout Plain Layout
2880 \begin_inset Flex Code
2883 \begin_layout Plain Layout
2884 To[[as in 'From format x to format y']]
2890 \begin_inset Flex Code
2893 \begin_layout Plain Layout
2894 To[[as in 'From page x to page y']].
2899 Now the two occurrences of
2900 \begin_inset Flex Code
2903 \begin_layout Plain Layout
2910 \begin_inset Flex Code
2913 \begin_layout Plain Layout
2919 and can be translated correctly to
2930 \begin_layout Standard
2931 Of course the context information needs to be stripped off the original
2932 message when no translation is used.
2933 Therefore you have to put it in double square brackets at the end of the
2934 message (see the example above).
2935 The translation mechanism of LyX ensures that everything in double square
2936 brackets at the end of messages is removed before displaying the message.
2939 \begin_layout Subsection
2940 Translating the documentation.
2943 \begin_layout Standard
2944 The online documentation (in the
2945 \begin_inset Flex MenuItem
2948 \begin_layout Plain Layout
2954 -menu) can (and should!) be translated.
2955 If there are translated versions of the documentation available
2959 \begin_layout Plain Layout
2960 As of March 2008, at least some of the documents have been translated into
2961 fourteen languages, with the Tutorial available in a few more.
2966 and the locale is set accordingly, these will be used automagically by
2968 LyX looks for translated versions as
2969 \begin_inset Flex Code
2972 \begin_layout Plain Layout
2973 LyXDir/doc/xx/DocName.lyx
2979 \begin_inset Flex Code
2982 \begin_layout Plain Layout
2988 is the code for the language currently in use.
2989 If there are no translated documents, the default English versions will
2991 Note that the translated versions must have the same filenames (
2992 \begin_inset Flex Code
2995 \begin_layout Plain Layout
3001 above) as the original.
3002 If you feel up to translating the documentation (an excellent way to proof-read
3003 the original documentation by the way!), there are a few things you should
3007 \begin_layout Itemize
3008 Check out the documentation translation web page at
3009 \begin_inset CommandInset href
3011 name "http://www.lyx.org/Translation"
3012 target "http://www.lyx.org/Translation"
3017 That way, you can find out which (if any) documents have already been translate
3018 d into your language.
3019 You can also find out who (if anyone) is organizing the effort to translate
3020 the documentation into your language.
3021 If no one is organizing the effort, please let us know that you're interested.
3024 \begin_layout Standard
3025 Once you get to actually translating, here's a few hints for you that may
3029 \begin_layout Itemize
3030 Join the documentation team! There is information on how to do that in
3031 \begin_inset Flex Code
3034 \begin_layout Plain Layout
3041 \begin_inset Flex MenuItem
3044 \begin_layout Plain Layout
3045 Help\SpecialChar \menuseparator
3051 ), which by the way is the first document you should translate.
3054 \begin_layout Itemize
3055 Learn the typographic conventions for the language you are translating to.
3056 Typography is an ancient art and over the centuries, a great variety of
3057 conventions have developed throughout different parts of the world.
3058 Also study the professional terminology amongst typographers in your country.
3059 Inventing your own terminology will only confuse the users.
3062 (Warning! Typography is addictive!)
3065 \begin_layout Itemize
3066 Make a copy of the document.
3067 This will be your working copy.
3068 You can use this as your personal translated help-file by placing it in
3070 \begin_inset Flex Code
3073 \begin_layout Plain Layout
3082 \begin_layout Itemize
3083 Sometimes the original document (from the LyX-team) will be updated.
3084 Use the source viewer at
3085 \begin_inset CommandInset href
3087 name "http://www.lyx.org/trac/timeline"
3088 target "http://www.lyx.org/trac/timeline"
3092 to see what has been changed.
3093 That way you can easily see which parts of the translated document need
3097 \begin_layout Standard
3098 If you ever find an error in the original document, fix it and notify the
3099 rest of the documentation team of the changes! (You didn't forget to join
3100 the documentation team, did you?)
3103 \begin_layout Standard
3104 \begin_inset Branch OutDated
3107 \begin_layout Section
3108 International Keyboard Support
3111 \begin_layout Standard
3114 [Editor's Note: The following section is by
3122 It needs to be fixed to conform to the new Documentation Style sheet and
3123 to make use of the new v1.0 features.
3124 The whole thing also needs to be merged with the section following it.-jw
3125 It may also be badly out of date.-rh (2008)]
3128 \begin_layout Subsection
3129 Defining Own Keymaps: Keymap File Format
3132 \begin_layout Standard
3133 Let's look at a keyboard definition file a little closer.
3134 It is a plain text file defining
3137 \begin_layout Itemize
3138 key-to-key or key-to-string translations
3141 \begin_layout Itemize
3145 \begin_layout Itemize
3146 dead keys exceptions
3149 \begin_layout Standard
3150 To define key-to-key or key-to-string translation, use this command:
3153 \begin_layout Quotation
3154 \begin_inset Flex Code
3157 \begin_layout Plain Layout
3166 \begin_inset Flex Code
3169 \begin_layout Plain Layout
3178 \begin_layout Standard
3180 \begin_inset Flex Code
3183 \begin_layout Plain Layout
3189 is the key to be translated and
3190 \begin_inset Flex Code
3193 \begin_layout Plain Layout
3199 is the string to be inserted into the document.
3200 To define dead keys, use:
3203 \begin_layout Quotation
3204 \begin_inset Flex Code
3207 \begin_layout Plain Layout
3216 \begin_inset Flex Code
3219 \begin_layout Plain Layout
3228 \begin_layout Standard
3230 \begin_inset Flex Code
3233 \begin_layout Plain Layout
3239 is a keyboard key and
3240 \begin_inset Flex Code
3243 \begin_layout Plain Layout
3250 The following dead keys are supported (shortcut name is in parentheses):
3253 \begin_layout Quotation
3257 \begin_inset space \hfill{}
3263 \begin_layout Quotation
3265 \begin_inset space \hfill{}
3271 \begin_layout Quotation
3273 \begin_inset space \hfill{}
3279 \begin_layout Quotation
3281 \begin_inset space \hfill{}
3287 \begin_layout Quotation
3289 \begin_inset space \hfill{}
3295 \begin_layout Quotation
3297 \begin_inset space \hfill{}
3304 \begin_layout Plain Layout
3316 \begin_layout Quotation
3318 \begin_inset space \hfill{}
3324 \begin_layout Quotation
3326 \begin_inset space \hfill{}
3333 \begin_layout Plain Layout
3345 \begin_layout Quotation
3347 \begin_inset space \hfill{}
3353 \begin_layout Quotation
3355 \begin_inset space \hfill{}
3361 \begin_layout Quotation
3363 \begin_inset space \hfill{}
3370 \begin_layout Plain Layout
3382 \begin_layout Quotation
3384 \begin_inset space \hfill{}
3391 \begin_layout Plain Layout
3403 \begin_layout Quotation
3405 \begin_inset space \hfill{}
3411 \begin_layout Quotation
3412 hungarian umlaut (hug)
3413 \begin_inset space \hfill{}
3419 \begin_layout Quotation
3421 \begin_inset space \hfill{}
3427 \begin_layout Quotation
3429 \begin_inset space \hfill{}
3436 \begin_layout Plain Layout
3448 \begin_layout Standard
3449 Since in many international keyboards there are exceptions to what some
3450 dead keys should do, you can define them using
3453 \begin_layout Quotation
3454 \begin_inset Flex Code
3457 \begin_layout Plain Layout
3465 deadkey key outstring
3468 \begin_layout Standard
3469 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3473 \begin_layout Quotation
3474 \begin_inset Flex Code
3477 \begin_layout Plain Layout
3490 \begin_layout Standard
3491 to make it work correctly.
3492 Also, you have to define as exceptions dead keys over i and j, to remove
3493 the dot from them before inserting an accent mark.
3494 I will change this when the time comes, but so far I haven't had time.
3497 \begin_layout Standard
3498 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3501 \begin_inset Flex Code
3504 \begin_layout Plain Layout
3510 have different meaning.
3512 \begin_inset Flex Code
3515 \begin_layout Plain Layout
3521 marks comments, quotes start and end LaTeX-style commands.
3522 To enter quote, you'll need to use
3523 \begin_inset Flex Code
3526 \begin_layout Plain Layout
3535 \begin_inset Flex Code
3538 \begin_layout Plain Layout
3545 \begin_inset Flex Code
3548 \begin_layout Plain Layout
3559 \begin_layout Standard
3560 If you make a keyboard description file that works for your language, please
3561 mail it to me, so I can include it in the next keymap distribution.
3564 \begin_layout Standard
3565 More keywords will be supported in keymap configuration file in future,
3569 \begin_layout Itemize
3570 \begin_inset Flex Code
3573 \begin_layout Plain Layout
3584 \begin_inset space \hfill{}
3588 \begin_inset Flex Code
3591 \begin_layout Plain Layout
3600 \begin_layout Itemize
3601 \begin_inset Flex Code
3604 \begin_layout Plain Layout
3615 \begin_inset space \hfill{}
3619 \begin_inset Flex Code
3622 \begin_layout Plain Layout
3628 an external keymap translation program
3631 \begin_layout Standard
3632 Also, it should look into
3633 \begin_inset Flex Code
3636 \begin_layout Plain Layout
3642 file for defaults, too (for example, a
3643 \begin_inset Flex Code
3646 \begin_layout Plain Layout
3654 option to include default keyboard).
3662 \begin_layout Section
3663 International Keymap Stuff
3664 \begin_inset CommandInset label
3666 name "sec:International-Keymap-Stuff"
3673 \begin_layout Standard
3674 \begin_inset Note Note
3677 \begin_layout Plain Layout
3678 In doing the revisions on this document in March 2008, I did not look over
3679 this stuff, as I do not understand it.
3680 It would be good if someone else could do so.
3689 \begin_layout Standard
3690 The next two sections describe the
3691 \begin_inset Flex Code
3694 \begin_layout Plain Layout
3703 \begin_inset Flex Code
3706 \begin_layout Plain Layout
3714 file syntax in detail.
3715 These sections should help you design your own key map if the ones provided
3716 do not meet your needs.
3719 \begin_layout Subsection
3723 \begin_layout Standard
3727 \begin_inset Flex Code
3730 \begin_layout Plain Layout
3736 file maps keystrokes to characters or strings.
3737 As the name suggests, it sets a keyboard mapping.
3739 \begin_inset Flex Code
3742 \begin_layout Plain Layout
3753 \begin_inset Flex Code
3756 \begin_layout Plain Layout
3771 \begin_inset Flex Code
3774 \begin_layout Plain Layout
3787 \begin_inset Flex Code
3790 \begin_layout Plain Layout
3799 \begin_inset Flex Code
3802 \begin_layout Plain Layout
3810 are described in this section.
3813 \begin_layout Labeling
3814 \labelwidthstring 00.00.0000
3815 \begin_inset Flex Code
3818 \begin_layout Plain Layout
3826 Map a character to a string
3829 \begin_layout LyX-Code
3844 \begin_layout Standard
3877 the double-quote (")
3894 must be escaped with a preceding backslash (
3905 \begin_layout Standard
3907 \begin_inset Flex MenuItem
3910 \begin_layout Plain Layout
3918 statement to cause the symbol
3919 \begin_inset Flex MenuItem
3922 \begin_layout Plain Layout
3930 to be output for the keystroke
3931 \begin_inset Flex MenuItem
3934 \begin_layout Plain Layout
3945 \begin_layout LyX-Code
3951 \begin_layout Labeling
3952 \labelwidthstring 00.00.0000
3953 \begin_inset Flex Code
3956 \begin_layout Plain Layout
3964 Specify an accent character
3967 \begin_layout LyX-Code
3976 \begin_layout Standard
3977 This will make the cha
4015 This is the dead key
4019 \begin_layout Plain Layout
4026 refers to a key that does not produce a character by itself, but when followed
4027 with another key, produces the desired accent character.
4028 For example, a German characte
4030 r with an umlaut like
4040 can be produced in this manner.
4049 \begin_layout Standard
4062 and then another key not in
4079 followed by the other, not allowed key, as output.
4083 \begin_inset Flex MenuItem
4086 \begin_layout Plain Layout
4094 cancels a dead key, so if
4105 \begin_inset Flex MenuItem
4108 \begin_layout Plain Layout
4117 , the cursor will not go one position backwards but will instead cancel
4133 might have had on the next keystroke.
4137 \begin_layout Standard
4138 The following example specifies that the character ' is to be an acute accent,
4139 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4142 \begin_layout LyX-Code
4145 kmod ' acute aeiouAEIOU
4148 \begin_layout Labeling
4149 \labelwidthstring 00.00.0000
4150 \begin_inset Flex Code
4153 \begin_layout Plain Layout
4159 Specify an exception to the accent character
4162 \begin_layout LyX-Code
4171 \begin_layout Standard
4172 This defines an exce
4213 have been assigned a keystroke with a previous
4216 \begin_inset Flex Code
4219 \begin_layout Plain Layout
4243 must not belong in the
4290 If such a declaration does not exist in
4298 \begin_inset Flex Code
4301 \begin_layout Plain Layout
4335 \begin_inset Flex Code
4338 \begin_layout Plain Layout
4352 \begin_layout Standard
4353 The following command produces causes äi to be produced when you enter acute-i
4357 \begin_layout LyX-Code
4371 \begin_layout Labeling
4372 \labelwidthstring 00.00.0000
4373 \begin_inset Flex Code
4376 \begin_layout Plain Layout
4382 Combine two accent characters
4385 \begin_layout LyX-Code
4391 accent1 accent2 allowed
4394 \begin_layout Standard
4395 This one is getting pretty esoteric.
4396 It allows you to combine the effect
4452 \begin_inset Flex Code
4455 \begin_layout Plain Layout
4483 \begin_layout Standard
4484 Consider this example from the
4485 \begin_inset Flex Code
4488 \begin_layout Plain Layout
4499 \begin_layout LyX-Code
4502 kmod ; acute aeioyvhAEIOYVH
4506 kcomb acute umlaut iyIY
4509 \begin_layout Standard
4510 This allows you to press
4511 \begin_inset Flex MenuItem
4514 \begin_layout Plain Layout
4522 and get the effect of
4523 \begin_inset Flex Code
4526 \begin_layout Plain Layout
4545 in this case cancels the last dead key, so if you press
4546 \begin_inset Flex MenuItem
4549 \begin_layout Plain Layout
4558 \begin_inset Flex Code
4561 \begin_layout Plain Layout
4574 \begin_layout Subsection
4578 \begin_layout Standard
4580 \begin_inset Flex Code
4583 \begin_layout Plain Layout
4591 mapping is performed, a
4592 \begin_inset Flex Code
4595 \begin_layout Plain Layout
4605 file maps the strings that the symbols generate to characters in the current
4607 The LyX distribution currently includes at least the
4608 \begin_inset Flex Code
4611 \begin_layout Plain Layout
4620 \begin_inset Flex Code
4623 \begin_layout Plain Layout
4634 \begin_layout Standard
4636 \begin_inset Flex Code
4639 \begin_layout Plain Layout
4647 file is a sequence of declarations of the form
4650 \begin_layout LyX-Code
4663 \begin_layout Standard
4664 For example, in order to map
4665 \begin_inset Flex MenuItem
4668 \begin_layout Plain Layout
4678 to the corresponding character in the iso-8859-1 set (233), the following
4682 \begin_layout LyX-Code
4690 \begin_layout Standard
4692 \begin_inset Flex Code
4695 \begin_layout Plain Layout
4704 \begin_inset Flex Code
4707 \begin_layout Plain Layout
4725 the same character can apply to more than one string.
4727 \begin_inset Flex Code
4730 \begin_layout Plain Layout
4741 \begin_layout LyX-Code
4753 \begin_inset Newline newline
4769 \begin_layout Standard
4770 If LyX cannot find a mapping for the string produced by the keystroke or
4771 a deadkey sequence, it will check if it looks like an accented char and
4772 try to draw an accent over the character on screen.
4775 \begin_layout Subsection
4779 \begin_layout Standard
4780 There is a second way to add support for international characters through
4781 so-called dead-keys.
4782 A dead-key works in combination with a letter to produce an accented character.
4783 Here, we'll explain how to create a really simple dead-key to illustrate
4787 \begin_layout Standard
4788 Suppose you happen to need the circumflex character,
4789 \begin_inset Quotes eld
4793 \begin_inset Quotes erd
4798 \begin_inset Flex MenuItem
4801 \begin_layout Plain Layout
4808 \begin_inset space ~
4812 \begin_inset Flex MenuItem
4815 \begin_layout Plain Layout
4821 ] to the LyX command
4822 \begin_inset Flex Code
4825 \begin_layout Plain Layout
4832 \begin_inset Flex Code
4835 \begin_layout Plain Layout
4842 Now, whenever you type the
4843 \begin_inset Flex MenuItem
4846 \begin_layout Plain Layout
4852 -key followed by a letter, that letter will have a circumflex accent on
4854 For example, the sequence
4855 \begin_inset Quotes eld
4859 \begin_inset Flex MenuItem
4862 \begin_layout Plain Layout
4869 \begin_inset Quotes erd
4872 produces the letter:
4873 \begin_inset Quotes eld
4877 \begin_inset Quotes erd
4881 If you tried to type
4882 \begin_inset Quotes eld
4886 \begin_inset Flex MenuItem
4889 \begin_layout Plain Layout
4896 \begin_inset Quotes erd
4899 , however, LyX will complain with a beep, since a
4900 \begin_inset Quotes eld
4904 \begin_inset Flex MenuItem
4907 \begin_layout Plain Layout
4914 \begin_inset Quotes erd
4917 never takes a circumflex accent.
4919 \begin_inset Flex MenuItem
4922 \begin_layout Plain Layout
4928 after a dead-key produces the bare-accent.
4929 Please note this last point! If you bind a key to a dead-key, you'll need
4930 to rebind the character on that key to yet another key.
4932 \begin_inset Flex MenuItem
4935 \begin_layout Plain Layout
4941 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4944 \begin_layout Standard
4945 One common way to bind dead-keys is to use
4946 \begin_inset Flex MenuItem
4949 \begin_layout Plain Layout
4956 \begin_inset Flex MenuItem
4959 \begin_layout Plain Layout
4966 \begin_inset Flex MenuItem
4969 \begin_layout Plain Layout
4975 in combination with an accent, like
4976 \begin_inset Quotes eld
4980 \begin_inset Flex MenuItem
4983 \begin_layout Plain Layout
4990 \begin_inset Quotes erd
4994 \begin_inset Quotes eld
4998 \begin_inset Flex MenuItem
5001 \begin_layout Plain Layout
5008 \begin_inset Quotes erd
5012 \begin_inset Quotes eld
5016 \begin_inset Flex MenuItem
5019 \begin_layout Plain Layout
5026 \begin_inset Quotes erd
5030 Another way involves using
5031 \begin_inset Flex Code
5034 \begin_layout Plain Layout
5041 \begin_inset Flex Code
5044 \begin_layout Plain Layout
5050 to set up the special
5051 \begin_inset Flex Code
5054 \begin_layout Plain Layout
5062 \begin_inset Flex Code
5065 \begin_layout Plain Layout
5071 acts in some ways just like
5072 \begin_inset Flex MenuItem
5075 \begin_layout Plain Layout
5081 and permits you to bind keys to accented characters.
5082 You can also turn keys into dead-keys by binding them to something like
5084 \begin_inset Flex Code
5087 \begin_layout Plain Layout
5093 and then binding this symbolic key to the corresponding LyX command.
5097 \begin_layout Plain Layout
5102 : This is exactly what I do in my
5103 \begin_inset Flex Code
5106 \begin_layout Plain Layout
5113 \begin_inset Flex Code
5116 \begin_layout Plain Layout
5124 \begin_inset Flex MenuItem
5127 \begin_layout Plain Layout
5129 \begin_inset space ~
5138 \begin_inset Flex Code
5141 \begin_layout Plain Layout
5147 and a bunch of these
5148 \begin_inset Quotes eld
5152 \begin_inset Flex Code
5155 \begin_layout Plain Layout
5162 \begin_inset Quotes erd
5165 symbolic keys bound such things as
5166 \begin_inset Flex MenuItem
5169 \begin_layout Plain Layout
5171 \begin_inset space ~
5180 \begin_inset Flex MenuItem
5183 \begin_layout Plain Layout
5185 \begin_inset space ~
5194 This is how I produce my accented characters.
5199 You can make just about anything into the
5200 \begin_inset Flex Code
5203 \begin_layout Plain Layout
5210 \begin_inset Flex MenuItem
5213 \begin_layout Plain Layout
5219 keys, a spare function key, etc.
5220 As for the LyX commands that produce accents, check the entry for
5221 \begin_inset Flex Code
5224 \begin_layout Plain Layout
5235 You'll find the complete list there.
5238 \begin_layout Subsection
5239 Saving your Language Configuration
5242 \begin_layout Standard
5243 You can edit your preferences so that your desired language environment
5244 is automatically configured when LyX starts up, via the
5245 \begin_inset Flex MenuItem
5248 \begin_layout Plain Layout
5249 Edit\SpecialChar \menuseparator
5258 \begin_layout Chapter
5259 Installing New Document Classes, Layouts, and Templates
5260 \begin_inset CommandInset label
5262 name "cha:Installing-New-Document"
5267 \begin_inset Argument
5270 \begin_layout Plain Layout
5271 Installing New Document Classes
5279 \begin_layout Standard
5280 In this chapter, we describe the procedures for creating and installing
5281 new LyX layout and template files, as well as offer a refresher on correctly
5282 installing new LaTeX document classes.
5286 \begin_layout Standard
5287 First, let us a say a few words about how one ought to think about the relation
5288 between LyX and LaTeX.
5289 The thing to understand is that, in a certain sense, LyX doesn't know anything
5291 Indeed, from LyX's point of view, LaTeX is just one of several
5292 \begin_inset Quotes eld
5296 \begin_inset Quotes erd
5299 in which it is capable of producing output.
5300 Other such formats are DocBook, plaintext, and XHTML.
5301 LaTeX is, of course, a particularly important format, but very little of
5302 the information LyX has about LaTeX is actually contained in the program
5307 \begin_layout Plain Layout
5308 Some commands are sufficiently complex that they are
5309 \begin_inset Quotes eld
5313 \begin_inset Quotes erd
5317 But the developers generally regard this as a Bad Thing.
5322 Rather, that information, even for the standard classes like
5323 \begin_inset Flex Code
5326 \begin_layout Plain Layout
5332 , is contained in `layout files'.
5333 Similarly, LyX itself does not know much about DocBook or XHTML.
5334 What it knows is contained in layout files.
5337 \begin_layout Standard
5338 You can think of the layout file for a given document class as a translation
5339 manual between LyX constructs---paragraphs with their corresponding styles,
5340 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5342 Almost everything LyX knows about
5343 \begin_inset Flex Code
5346 \begin_layout Plain Layout
5352 , for example, is contained in the file
5353 \begin_inset Flex Code
5356 \begin_layout Plain Layout
5362 and in various other files it includes.
5363 For this reason, anyone intending to write layout files should plan to
5364 study the existing files.
5365 A good place to start is with
5366 \begin_inset Flex Code
5369 \begin_layout Plain Layout
5375 , which is included in
5376 \begin_inset Flex Code
5379 \begin_layout Plain Layout
5386 \begin_inset Flex Code
5389 \begin_layout Plain Layout
5395 , and many of the other layout files for document classes.
5396 This file is where sections and the like are defined:
5397 \begin_inset Flex Code
5400 \begin_layout Plain Layout
5406 tells LyX how paragraphs that are marked with the Section, Subsection,
5407 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5410 \begin_inset Flex Code
5413 \begin_layout Plain Layout
5419 file basically just includes several of these
5420 \begin_inset Flex Code
5423 \begin_layout Plain Layout
5432 \begin_layout Standard
5433 Defining the LyX--LaTeX correspondence is not the only thing layout files
5435 Their other job is to define how the LyX constructs themselves will appear
5437 The fact that layout files have these two jobs is often a source of confusion,
5438 because they are completely separate.
5439 Telling LyX how to translate a certain paragraph style into LaTeX does
5440 not tell LyX how to display it; conversely, telling LyX how to display
5441 a certain paragraph style does not tell LyX how to translate it into LaTeX
5442 (let alone tell LaTeX how to display it).
5443 So, in general, when you define a new LyX construct, you must always do
5444 two quite separate things: (i)
5445 \begin_inset space ~
5448 tell LyX how to translate it into LaTeX and (ii)
5449 \begin_inset space ~
5452 tell LyX how to display it.
5455 \begin_layout Standard
5456 Much the same is true, of course, as regards LyX's other backend formats,
5457 though XHTML is in some ways different, because in that case LyX
5461 able, to some extent, to use information about how it should display a
5462 paragraph on the screen to output information (in the form of CSS) about
5463 how the paragraph should be displayed in a browser.
5464 Even in this case, however, the distinction between what LyX does internally
5465 and how things are rendered externally remains in force, and the two can
5466 be controlled separately.
5468 \begin_inset CommandInset ref
5470 reference "sec:Tags-for-XHTML"
5477 \begin_layout Section
5478 Installing new LaTeX files
5481 \begin_layout Standard
5482 Some installations may not include a LaTeX package or class file that you
5483 would like to use within LyX.
5484 For example, you might need FoilTeX, a package for preparing slides for
5485 overhead projectors.
5486 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5487 a user interface for installing such packages.
5488 For example, with MiKTeX, you start the program
5489 \begin_inset Quotes eld
5493 \begin_inset space ~
5497 \begin_inset Quotes erd
5500 to get a list of available packages.
5501 To install one of them, right click on it or use the corresponding toolbar
5505 \begin_layout Standard
5506 If your LaTeX distribution does not provide such a `package manager', or
5507 if the package is not available from your distribution, then follow these
5508 steps to install it manually:
5511 \begin_layout Enumerate
5512 Get the package from
5513 \begin_inset CommandInset href
5516 target "http://www.ctan.org/"
5523 \begin_layout Enumerate
5524 If the package contains a file with the ending
5525 \begin_inset Quotes eld
5529 \begin_inset Flex Code
5532 \begin_layout Plain Layout
5539 \begin_inset Quotes erd
5542 (is the case for FoilTeX) then open a console, change to the folder of
5543 this file and execute the command
5544 \begin_inset Flex Code
5547 \begin_layout Plain Layout
5554 You have now unpacked the package and have all files to install it.
5555 Most LaTeX-packages are not packed and you can skip this step.
5558 \begin_layout Enumerate
5559 Now you need to decide if the package should be available for all users
5564 \begin_layout Enumerate
5565 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5566 for all users on your system, then install it in your `local' TeX tree,
5567 otherwise install it in your own `user' TeX tree.
5568 Where these trees should be created, if they do not already exist, depends
5570 To find this out, look in the file
5571 \begin_inset Flex Code
5574 \begin_layout Plain Layout
5584 \begin_layout Plain Layout
5585 This is usually in the directory
5586 \begin_inset Flex Code
5589 \begin_layout Plain Layout
5595 , though you can execute the command
5596 \begin_inset Flex Code
5599 \begin_layout Plain Layout
5610 The location of the `local' TeX tree is defined by the
5611 \begin_inset Flex Code
5614 \begin_layout Plain Layout
5620 variable; this is usually somewhere like
5621 \begin_inset Flex Code
5624 \begin_layout Plain Layout
5625 /usr/local/share/texmf
5631 The location of the `user' TeX tree is defined by
5632 \begin_inset Flex Code
5635 \begin_layout Plain Layout
5642 \begin_inset Flex Code
5645 \begin_layout Plain Layout
5652 (If these variables are not predefined, you have to define them.) You'll
5653 probably need root permissions to create or modify the `local' tree, but
5654 not for your `user' tree.
5655 \begin_inset Newline newline
5658 In general, it is recommended to install in the user tree because your user
5659 will not be modified or even overwritten when you upgrade your system.
5660 It will typically also be backed up together with everything else when
5661 you backup your home directory (which, of course, you do on a regular basis).
5664 \begin_layout Enumerate
5665 On Windows, if you want the new package to be available for all users on
5666 your system, change to the folder where LaTeX is installed and then change
5668 \begin_inset Flex Code
5671 \begin_layout Plain Layout
5682 (For MiKTeX, this would be by default the folder
5683 \begin_inset Flex Code
5686 \begin_layout Plain Layout
5704 \begin_layout Plain Layout
5705 Note that this will be the correct path only on English installations.
5706 On a German one, it would be
5707 \begin_inset Flex Code
5710 \begin_layout Plain Layout
5724 , and similarly for other languages.
5729 Create there a new folder
5730 \begin_inset Flex Code
5733 \begin_layout Plain Layout
5739 and copy all files of the package into it.
5741 \begin_inset Newline newline
5744 If the package should only available for you or you don't have admin permissions
5745 , do the same, but in the local LaTeX folder.
5747 \begin_inset space \thinspace{}
5751 \begin_inset space ~
5754 2.8 under Windows XP, this would be the folder:
5755 \begin_inset Newline newline
5761 \begin_inset Flex Code
5764 \begin_layout Plain Layout
5767 Documents and Settings
5779 \begin_inset Newline newline
5785 \begin_inset Phantom HPhantom
5788 \begin_layout Plain Layout
5799 \begin_inset Flex Code
5802 \begin_layout Plain Layout
5815 \begin_inset Newline newline
5818 On Vista, it would be:
5819 \begin_inset Newline newline
5823 \begin_inset Flex Code
5826 \begin_layout Plain Layout
5852 \begin_layout Enumerate
5853 Now one only need to tell LaTeX that there are new files.
5854 This depends on the used LaTeX-Distribution:
5858 \begin_layout Enumerate
5859 For TeXLive execute the command
5860 \begin_inset Flex Code
5863 \begin_layout Plain Layout
5870 If you installed the package for all users, then you will probably need
5871 to have root permissions for that.
5874 \begin_layout Enumerate
5875 For MiKTeX, if you have installed the package for all users, start the program
5877 \begin_inset Quotes eld
5881 \begin_inset space ~
5885 \begin_inset Quotes erd
5888 and press the button marked
5889 \begin_inset Quotes eld
5893 \begin_inset Quotes erd
5897 Otherwise start the program
5898 \begin_inset Quotes eld
5902 \begin_inset Quotes erd
5909 \begin_layout Enumerate
5910 Finally, you need to tell LyX that there are new packages available.
5911 So, in LyX, use the menu
5912 \begin_inset Flex MenuItem
5915 \begin_layout Plain Layout
5918 \SpecialChar \menuseparator
5924 and then restart LyX.
5927 \begin_layout Standard
5928 Now the package is installed.
5929 In our example, the document class
5930 \begin_inset Flex Code
5933 \begin_layout Plain Layout
5935 \begin_inset space ~
5942 \begin_layout Plain Layout
5954 will now be available under
5955 \begin_inset Flex MenuItem
5958 \begin_layout Plain Layout
5959 Document\SpecialChar \menuseparator
5960 Settings\SpecialChar \menuseparator
5970 \begin_layout Standard
5971 If you would like to use a LaTeX document class that is not even listed
5973 \begin_inset Flex MenuItem
5976 \begin_layout Plain Layout
5977 Document\SpecialChar \menuseparator
5978 Settings\SpecialChar \menuseparator
5984 , then you need to create a `layout' file for it.
5985 That is the topic of the next section.
5988 \begin_layout Section
5989 Types of layout files
5992 \begin_layout Standard
5993 This section describes the various sorts of LyX files that contain layout
5995 These files describe various paragraph and character styles, determining
5996 how LyX should display them and how they should be translated into LaTeX,
5997 DocBook, XHTML, or whatever output format is being used.
6001 \begin_layout Standard
6002 We shall try to provide a thorough description of the process of writing
6004 However, there are so many different types of documents supported even
6005 by just LaTeX that we can't hope to cover every different possibility or
6006 problem you might encounter.
6007 The LyX users' list is frequented by people with lots of experience with
6008 layout design who are willing to share what they've learned, so please
6009 feel free to ask questions there.
6012 \begin_layout Standard
6013 As you prepare to write a new layout, it is extremely helpful to look at
6014 the layouts distributed with LyX.
6015 If you write a LyX layout for a LaTeX document class that might also be
6016 used by others, or write a module that might be useful to others, then
6017 you should consider posting your layout to the
6018 \begin_inset CommandInset href
6020 name "layout section on the LyX wiki"
6021 target "http://wiki.lyx.org/Layouts/Layouts"
6025 or even to the LyX developers' list, so that it might be included in LyX
6030 \begin_layout Plain Layout
6031 Note that LyX is licensed under the General Public License, so any material
6032 that is contributed to LyX must be similarly licensed.
6040 \begin_layout Subsection
6042 \begin_inset CommandInset label
6044 name "sub:Layout-modules"
6051 \begin_layout Standard
6052 We have spoken to this point about `layout files'.
6053 But there are different sorts of files that contain layout information.
6054 Layout files, strictly so called, have the
6055 \begin_inset Flex Code
6058 \begin_layout Plain Layout
6064 extension and provide LyX with information about document classes.
6065 As of LyX 1.6, however, layout information can also be contained in layout
6071 \begin_inset Flex Code
6074 \begin_layout Plain Layout
6081 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6082 some modules—such as the
6083 \begin_inset Flex Code
6086 \begin_layout Plain Layout
6092 module—specifically provide support for one package.
6093 In a sense, layout modules are similar to included
6097 \begin_layout Plain Layout
6098 These can have any extension, but by convention have the
6099 \begin_inset Flex Code
6102 \begin_layout Plain Layout
6114 \begin_inset Flex Code
6117 \begin_layout Plain Layout
6123 —in that modules are not specific to a given document class but may be used
6124 with many different classes.
6125 The difference is that using an included file with
6126 \begin_inset Flex Code
6129 \begin_layout Plain Layout
6135 requires editing that file.
6136 Modules, by contrast, are selected in the
6137 \begin_inset Flex MenuItem
6140 \begin_layout Plain Layout
6141 Document\SpecialChar \menuseparator
6150 \begin_layout Standard
6151 Building modules is the easiest way to get started with layout editing,
6152 since it can be as simple as adding a single new paragraph style or flex
6154 But modules may, in principle, contain anything a layout file can contain.
6157 \begin_layout Standard
6158 After creating a new module and copying it to the
6159 \begin_inset Flex Code
6162 \begin_layout Plain Layout
6168 folder, you will need to reconfigure and then restart LyX for the module
6169 to appear in the menu.
6170 However, changes you make to the module will be seen immediately, if you
6172 \begin_inset Flex MenuItem
6175 \begin_layout Plain Layout
6176 Document\SpecialChar \menuseparator
6182 , highlight something, and then hit
6183 \begin_inset Quotes eld
6187 \begin_inset Quotes erd
6193 It is strongly recommended that you save your work before doing this
6198 it is strongly recommended that you not attempt to edit modules while simultaneo
6199 usly working on actual documents
6202 Though of course the developers strive to keep LyX stable in such situations,
6203 syntax errors and the like in your module file could cause strange behavior.
6206 \begin_layout Subsubsection
6210 \begin_layout Standard
6211 Modules are to LyX as packages are to LaTeX.
6212 Sometimes, however, you find yourself wanting a specific inset or character
6213 style just for one document and writing a module that will also be available
6214 to other documents makes little sense.
6215 What you need is LyX's
6216 \begin_inset Quotes eld
6220 \begin_inset Quotes erd
6226 \begin_layout Standard
6227 You will find it under
6229 Document\SpecialChar \menuseparator
6230 Settings\SpecialChar \menuseparator
6234 The large text box allows you to enter anything that you might enter in
6235 a layout file or module.
6236 You can think of a document's local layout, in fact, as a module that belongs
6238 So, in particular, you must enter a
6239 \begin_inset Flex Code
6242 \begin_layout Plain Layout
6249 Any format is acceptable, but one would normally use the format current
6251 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6252 layout is not supported by versions of LyX prior to 1.6, so you should not
6253 use it if you want to be able to export your document to LyX 1.5 or earlier
6254 (without, that is, losing the local layout information).
6255 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6256 though there is no UI for it---then you should use format 11 and, of course,
6257 use only layout constructs that were available in LyX 1.6.
6260 \begin_layout Standard
6261 When you have entered something in the
6262 \begin_inset Flex Code
6265 \begin_layout Plain Layout
6271 pane, LyX will enable the
6272 \begin_inset Quotes eld
6276 \begin_inset Quotes erd
6279 button at the bottom.
6280 Clicking this button will cause LyX to determine whether what you have
6281 entered is valid layout information for the chosen format.
6282 LyX will report the result but, unfortunately, will not tell you what errors
6283 there might have been.
6284 These will be written to the terminal, however, if LyX is started from
6286 You will not be permitted to save your local layout until you have entered
6290 \begin_layout Standard
6291 The warnings at the end of the previous section apply here, too.
6292 Do not play with local layout while you are actually working, especially
6293 if you have not saved your document.
6294 That said, using local layout with a test document can be a very convenient
6295 way to try out layout ideas, or even to start developing a module.
6298 \begin_layout Subsection
6300 \begin_inset Flex MenuItem
6303 \begin_layout Plain Layout
6312 \begin_layout Standard
6313 There are two situations you are likely to encounter when wanting to support
6314 a new LaTeX document class, involving style (
6315 \begin_inset Flex Code
6318 \begin_layout Plain Layout
6324 ) files and LaTeX2e class (
6325 \begin_inset Flex Code
6328 \begin_layout Plain Layout
6335 Supporting a style file is usually fairly easy.
6336 Supporting a new class file is a bit harder.
6337 We'll discuss the former in this section and the latter in the next.
6338 Similar remarks apply, of course, if you want to support a new DocBook
6342 \begin_layout Standard
6343 The easier case is the one in which your new document class is provided
6344 as a style file that is to be used in conjunction with an already supported
6346 For the sake of the example, we'll assume that the style file is called
6348 \begin_inset Flex MenuItem
6351 \begin_layout Plain Layout
6357 and that it is meant to be used with
6358 \begin_inset Flex MenuItem
6361 \begin_layout Plain Layout
6367 , which is a standard class.
6371 \begin_layout Standard
6372 Start by copying the existing class's layout file into your local directory:
6376 \begin_layout Plain Layout
6377 Of course, which directory is your local directory will vary by platform,
6378 and LyX allows you to specify your local directory on startup, too, using
6380 \begin_inset Flex Code
6383 \begin_layout Plain Layout
6397 \begin_layout LyX-Code
6398 cp report.layout ~/.lyx/layouts/myclass.layout
6401 \begin_layout Standard
6403 \begin_inset Flex Code
6406 \begin_layout Plain Layout
6412 and change the line:
6415 \begin_layout LyX-Code
6418 DeclareLaTeXClass{report}
6421 \begin_layout Standard
6425 \begin_layout LyX-Code
6428 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6431 \begin_layout Standard
6435 \begin_layout LyX-Code
6437 \begin_inset Newline newline
6443 \begin_inset Newline newline
6449 \begin_layout Standard
6450 near the top of the file.
6453 \begin_layout Standard
6454 Start LyX and select
6455 \begin_inset Flex MenuItem
6458 \begin_layout Plain Layout
6459 Tools\SpecialChar \menuseparator
6466 Then restart LyX and try creating a new document.
6468 \begin_inset Flex MenuItem
6471 \begin_layout Plain Layout
6477 " as a document class option in the
6478 \begin_inset Flex MenuItem
6481 \begin_layout Plain Layout
6482 Document\SpecialChar \menuseparator
6489 It is likely that some of the sectioning commands and such in your new
6490 class will work differently from how they worked in the base class—
6491 \begin_inset Flex Code
6494 \begin_layout Plain Layout
6500 in this example—so you can fiddle around with the settings for the different
6501 sections if you wish.
6502 The layout information for sections is contained in
6503 \begin_inset Flex Code
6506 \begin_layout Plain Layout
6512 , but you do not need to copy and change this file.
6513 Instead, you can simply add your changes to your layout file, after the
6515 \begin_inset Flex Code
6518 \begin_layout Plain Layout
6524 , which itself includes
6525 \begin_inset Flex Code
6528 \begin_layout Plain Layout
6535 For example, you might add these lines:
6538 \begin_layout LyX-Code
6542 \begin_layout LyX-Code
6546 \begin_layout LyX-Code
6550 \begin_layout LyX-Code
6554 \begin_layout LyX-Code
6558 \begin_layout Standard
6559 to change the font for chapter headings to sans-serif.
6560 This will override (or, in this case, add to) the existing declaration
6561 for the Chapter style.
6565 \begin_layout Standard
6566 Your new package may also provide commands or environments not present in
6568 In this case, you will want to add these to the layout file.
6570 \begin_inset CommandInset ref
6572 reference "sec:TextClass"
6576 for information on how to do so.
6579 \begin_layout Standard
6581 \begin_inset Flex MenuItem
6584 \begin_layout Plain Layout
6590 can be used with several different document classes, and even if it cannot,
6591 you might find it easiest just to write a module that you can load with
6593 The simplest possible such module would be:
6596 \begin_layout LyX-Code
6599 DeclareLyXModule{My Package}
6602 \begin_layout LyX-Code
6606 \begin_layout LyX-Code
6607 #Support for mypkg.sty.
6610 \begin_layout LyX-Code
6612 \begin_inset Newline newline
6618 \begin_layout LyX-Code
6620 \begin_inset Newline newline
6626 \begin_layout LyX-Code
6628 \begin_inset Newline newline
6634 \begin_inset Newline newline
6640 \begin_layout Standard
6641 A more complex module might modify the behavior of some existing constructs
6642 or define some new ones.
6644 \begin_inset CommandInset ref
6646 reference "sec:TextClass"
6653 \begin_layout Subsection
6655 \begin_inset Flex MenuItem
6658 \begin_layout Plain Layout
6667 \begin_layout Standard
6668 There are two possibilities here.
6669 One is that the class file is itself based upon an existing document class.
6670 For example, many thesis classes are based upon
6671 \begin_inset Flex MenuItem
6674 \begin_layout Plain Layout
6681 To see whether yours is, look for a line like
6684 \begin_layout LyX-Code
6690 \begin_layout Standard
6692 If so, then you may proceed largely as in the previous section, though
6694 \begin_inset Flex Code
6697 \begin_layout Plain Layout
6703 line will be different.
6704 If your new class is
6705 \begin_inset Flex Code
6708 \begin_layout Plain Layout
6714 and it is based upon
6715 \begin_inset Flex Code
6718 \begin_layout Plain Layout
6724 , then the line should read:
6728 \begin_layout Plain Layout
6729 And it will be easiest if you save the file to
6730 \begin_inset Flex Code
6733 \begin_layout Plain Layout
6739 : LyX assumes that the document class has the same name as the layout file.
6748 \begin_layout LyX-Code
6751 DeclareLaTeXClass[thesis,book]{thesis}
6754 \begin_layout Standard
6755 If, on the other hand, the new class is not based upon an existing class,
6756 you will probably have to
6757 \begin_inset Quotes eld
6761 \begin_inset Quotes erd
6765 We strongly suggest copying an existing layout file which uses a similar
6766 LaTeX class and then modifying it, if you can do so.
6767 At least use an existing file as a starting point so you can find out what
6768 items you need to worry about.
6769 Again, the specifics are covered below.
6772 \begin_layout Subsection
6774 \begin_inset CommandInset label
6776 name "sub:Creating-Templates"
6783 \begin_layout Standard
6784 Once you have written a layout file for a new document class, you might
6785 want to consider writing a
6790 A template acts as a kind of tutorial for your layout, showing how it might
6791 be used, though containing dummy content.
6792 You can of course look at the various templates included with LyX for ideas.
6795 \begin_layout Standard
6796 Templates are created just like usual documents: using LyX.
6797 The only difference is that usual documents contain all possible settings,
6798 including the font scheme and the paper size.
6799 Usually a user doesn't want a template to overwrite his preferred settings
6800 for such parameters.
6801 For that reason, the designer of a template should remove the corresponding
6803 \begin_inset Flex Code
6806 \begin_layout Plain Layout
6815 \begin_inset Flex Code
6818 \begin_layout Plain Layout
6826 from the template LyX file.
6827 This can be done with any simple text-editor, for example
6828 \begin_inset Flex Code
6831 \begin_layout Plain Layout
6838 \begin_inset Flex Code
6841 \begin_layout Plain Layout
6851 \begin_layout Standard
6852 Put the edited template files you create in
6853 \begin_inset Flex Code
6856 \begin_layout Plain Layout
6862 , copy the ones you use from the global template directory in
6863 \begin_inset Flex Code
6866 \begin_layout Plain Layout
6872 to the same place, and redefine the template path in the
6873 \begin_inset Flex MenuItem
6876 \begin_layout Plain Layout
6877 Tools\SpecialChar \menuseparator
6878 Preferences\SpecialChar \menuseparator
6887 \begin_layout Standard
6888 Note, by the way, that there is a template which has a particular meaning:
6890 \begin_inset Flex Code
6893 \begin_layout Plain Layout
6900 This template is loaded every time you create a new document with
6901 \begin_inset Flex MenuItem
6904 \begin_layout Plain Layout
6905 File\SpecialChar \menuseparator
6911 in order to provide useful defaults.
6912 To create this template from inside LyX, all you have to do is to open
6913 a document with the correct settings, and use the
6914 \begin_inset Flex MenuItem
6917 \begin_layout Plain Layout
6918 Save as Document Defaults
6926 \begin_layout Subsection
6927 Upgrading old layout files
6930 \begin_layout Standard
6931 The format of layout files changes with each LyX release, so old layout
6932 files need to be converted to the new format.
6933 This process has been automated since LyX 1.4: If LyX reads a layout file
6934 in an older format, it automatically calls the script
6935 \begin_inset Flex Code
6938 \begin_layout Plain Layout
6944 to convert it to a temporary file in current format.
6945 The original file is left untouched.
6946 If you use the layout file often, then, you may want to convert it permanently,
6947 so that LyX does not have to do so itself every time.
6948 To do this, you can call the converter manually:
6951 \begin_layout LyX-Code
6952 mv myclass.layout myclass.old
6955 \begin_layout LyX-Code
6956 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6959 \begin_layout Standard
6961 \begin_inset Flex Code
6964 \begin_layout Plain Layout
6970 with the name of your LyX system directory, of course.
6973 \begin_layout Standard
6974 Note that manual conversion does not affect included files, so these will
6975 have to be converted separately.
6978 \begin_layout Section
6979 \begin_inset CommandInset label
6981 name "sec:TextClass"
6985 The layout file format
6988 \begin_layout Standard
6989 When it's finally time to get your hands dirty and create or edit your own
6990 layout file, the following sections describe what you're up against.
6991 Our advice is to go slowly, save and test often, listen to soothing music,
6992 and enjoy one or two of your favorite adult beverages; more if you are
6993 getting particularly stuck.
6994 It's really not that hard, except that the multitude of options can become
6995 overwhelming if you try to do too much in one sitting.
6996 Go have another adult beverage, just for good measure.
6999 \begin_layout Standard
7000 Note that all the tags used in layout files are case-insensitive.
7002 \begin_inset Flex Code
7005 \begin_layout Plain Layout
7012 \begin_inset Flex Code
7015 \begin_layout Plain Layout
7022 \begin_inset Flex Code
7025 \begin_layout Plain Layout
7031 are really the same tag.
7032 The possible values are printed in brackets after the feature's name.
7033 The default value if a feature isn't specified inside a text class-description
7035 \begin_inset Flex Code
7038 \begin_layout Plain Layout
7047 If the argument has a data type like
7048 \begin_inset Quotes eld
7052 \begin_inset Quotes erd
7056 \begin_inset Quotes eld
7060 \begin_inset Quotes erd
7063 , the default is shown like this:
7064 \begin_inset Flex Code
7067 \begin_layout Plain Layout
7078 \begin_layout Subsection
7079 The document class declaration
7082 \begin_layout Standard
7083 Lines in a layout file which begin with
7084 \begin_inset Flex Code
7087 \begin_layout Plain Layout
7094 There is one exception to this rule.
7096 \begin_inset Flex Code
7099 \begin_layout Plain Layout
7105 files should begin with a line like:
7108 \begin_layout LyX-Code
7111 #% Do not delete the line below; configure depends on this
7114 \begin_layout LyX-Code
7119 DeclareLaTeXClass{article}
7122 \begin_layout Standard
7123 The second line is used when you (re)configure LyX.
7124 The layout file is read by the LaTeX script
7125 \begin_inset Flex Code
7128 \begin_layout Plain Layout
7134 , in a special mode where
7135 \begin_inset Flex Code
7138 \begin_layout Plain Layout
7145 The first line is just a LaTeX comment, and the second one contains the
7146 declaration of the text class.
7147 If these lines appear in a file named
7148 \begin_inset Flex Code
7151 \begin_layout Plain Layout
7157 , then they define a text class of name
7158 \begin_inset Flex Code
7161 \begin_layout Plain Layout
7167 (the name of the layout file) which uses the LaTeX document class
7168 \begin_inset Flex Code
7171 \begin_layout Plain Layout
7177 (the default is to use the same name as the layout).
7179 \begin_inset Quotes eld
7183 \begin_inset Quotes erd
7186 that appears above is used as a description of the text class in the
7187 \begin_inset Flex MenuItem
7190 \begin_layout Plain Layout
7191 Document\SpecialChar \menuseparator
7200 \begin_layout Standard
7201 Let's assume that you wrote your own text class that uses the
7202 \begin_inset Flex Code
7205 \begin_layout Plain Layout
7211 document class, but where you changed the appearance of the section headings.
7212 If you put it in a file
7213 \begin_inset Flex Code
7216 \begin_layout Plain Layout
7222 , the header of this file should be:
7225 \begin_layout LyX-Code
7228 #% Do not delete the line below; configure depends on this
7231 \begin_layout LyX-Code
7236 DeclareLaTeXClass[article]{article (with my own headings)}
7239 \begin_layout Standard
7240 This declares a text class
7241 \begin_inset Flex Code
7244 \begin_layout Plain Layout
7250 , associated with the LaTeX document class
7251 \begin_inset Flex Code
7254 \begin_layout Plain Layout
7261 \begin_inset Quotes eld
7264 article (with my own headings)
7265 \begin_inset Quotes erd
7269 If your text class depends on several packages, you can declare it as:
7272 \begin_layout LyX-Code
7275 #% Do not delete the line below; configure depends on this
7278 \begin_layout LyX-Code
7283 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7286 \begin_layout Standard
7287 This indicates that your text class uses the
7288 \begin_inset Flex Code
7291 \begin_layout Plain Layout
7298 Finally, it is also possible to declare classes for DocBook code.
7299 Typical declarations will look like:
7302 \begin_layout LyX-Code
7305 #% Do not delete the line below; configure depends on this
7308 \begin_layout LyX-Code
7313 DeclareDocBookClass[article]{SGML (DocBook article)}
7316 \begin_layout Standard
7317 Note that these declarations can also be given an optional parameter declaring
7318 the name of the document class (but not a list).
7321 \begin_layout Standard
7322 So, to be as explicit as possible, the form of the layout declaration is:
7325 \begin_layout LyX-Code
7330 DeclareLaTeXClass[class,package.sty]{layout description}
7333 \begin_layout Standard
7334 The class need only be specified if the name of the LaTeX class file and
7335 the name of the layout file are different or if there are packages to load.
7336 If the name of the class file is not specified, then LyX will simply assume
7337 that it is the same as the name of the layout file.
7340 \begin_layout Standard
7341 When the text class has been modified to your taste, all you have to do
7342 is to copy it either to
7343 \begin_inset Flex Code
7346 \begin_layout Plain Layout
7353 \begin_inset Flex Code
7356 \begin_layout Plain Layout
7363 \begin_inset Flex MenuItem
7366 \begin_layout Plain Layout
7367 Tools\SpecialChar \menuseparator
7373 , exit LyX and restart.
7374 Then your new text class should be available along with the others.
7377 \begin_layout Standard
7378 Once the layout file is installed, you can edit it and see your changes
7379 without having to reconfigure or to restart LyX.
7384 \begin_layout Plain Layout
7385 In versions of LyX prior to 1.6, this was not true.
7386 As a result, editing layout files was very time consuming, since you had
7387 constantly to restart LyX to see changes.
7392 You can force a reload of the current layout by using the LyX function
7394 \begin_inset Flex MenuItem
7397 \begin_layout Plain Layout
7404 There is no default binding for this function—though, of course, you can
7405 bind it to a key yourself.
7406 But you will normally use this function simply by entering it in the mini-buffe
7411 \begin_layout Standard
7417 \begin_inset Flex MenuItem
7420 \begin_layout Plain Layout
7426 is very much an `advanced feature'.
7431 recommended that you save your work before using this function.
7436 recommended that you not attempt to edit layout information while simultaneousl
7437 y working on a document that you care about.
7438 Use a test document.
7439 Syntax errors and the like in your layout file could cause peculiar behavior.
7440 In particular, such errors could cause LyX to regard the current layout
7441 as invalid and to attempt to switch to some other layout.
7445 \begin_layout Plain Layout
7446 Really bad syntax errors may even caused LyX to exit.
7447 This is because certain sorts of errors may make LyX unable to read
7457 The LyX team strives to keep LyX stable in such situations, but safe is
7462 \begin_layout Plain Layout
7463 While we're giving advice: make regular backups.
7464 And be nice to your mother.
7472 \begin_layout Subsection
7473 The Module declaration
7476 \begin_layout Standard
7477 A module must begin with a line like the following:
7480 \begin_layout LyX-Code
7483 DeclareLyXModule[endnotes.sty]{Endnotes}
7486 \begin_layout Standard
7487 The mandatory argument, in curly brackets, is the name of the module, as
7489 \begin_inset Flex MenuItem
7492 \begin_layout Plain Layout
7493 Document\SpecialChar \menuseparator
7494 Settings\SpecialChar \menuseparator
7501 The argument in square brackets is optional: It declares any LaTeX packages
7502 on which the module depends.
7503 Please note that only packages about which LyX knows should be listed in
7504 the square brackets.
7508 \begin_layout Plain Layout
7509 The list of such packages is documented only in the source code.
7514 LyX will not check for arbitrary packages.
7515 It is also possible to use the form
7516 \begin_inset Flex MenuItem
7519 \begin_layout Plain Layout
7525 as an optional argument, which declares that the module can only be used
7526 when there exists a conversion chain between the formats `
7527 \begin_inset Flex Code
7530 \begin_layout Plain Layout
7537 \begin_inset Flex Code
7540 \begin_layout Plain Layout
7549 \begin_layout Standard
7550 The module declaration should then be followed by lines like the following
7554 \begin_layout Plain Layout
7555 Preferably in English if the module should be published with LyX.
7556 This description will appear in the list of messages to be translated and
7557 will be thus translated with the next interface update.
7565 \begin_layout LyX-Code
7569 \begin_layout LyX-Code
7570 #Adds an endnote command, in addition to footnotes.
7574 \begin_layout LyX-Code
7575 #You will need to add
7577 theendnotes in TeX code where you
7580 \begin_layout LyX-Code
7581 #want the endnotes to appear.
7585 \begin_layout LyX-Code
7589 \begin_layout LyX-Code
7590 #Requires: somemodule | othermodule
7593 \begin_layout LyX-Code
7594 #Excludes: badmodule
7597 \begin_layout Standard
7598 The description is used in
7599 \begin_inset Flex MenuItem
7602 \begin_layout Plain Layout
7603 Document\SpecialChar \menuseparator
7604 Settings\SpecialChar \menuseparator
7610 to provide the user with information about what the module does.
7612 \begin_inset Flex Code
7615 \begin_layout Plain Layout
7621 line is used to identify other modules with which this one must be used;
7623 \begin_inset Flex Code
7626 \begin_layout Plain Layout
7632 line is used to identify modules with which this one may not be used.
7633 Both are optional, and, as shown, multiple modules should be separated
7634 with the pipe symbol: |.
7635 Note that the required modules are treated disjunctively:
7639 of the required modules must be used.
7644 excluded module may be used.
7645 Note that modules are identified here by their
7650 \begin_inset Flex Code
7653 \begin_layout Plain Layout
7661 \begin_inset Flex Code
7664 \begin_layout Plain Layout
7671 \begin_inset Flex Code
7674 \begin_layout Plain Layout
7683 \begin_layout Subsection
7687 \begin_layout Standard
7688 The first non-comment line of any layout file, included file, or module
7693 contain the file format number:
7696 \begin_layout Description
7697 \begin_inset Flex Code
7700 \begin_layout Plain Layout
7707 \begin_inset Flex Code
7710 \begin_layout Plain Layout
7716 ] The format of the layout file.
7719 \begin_layout Standard
7720 This tag was introduced with LyX 1.4.0.
7721 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7722 and are considered to be of format 1.
7723 The format for the present version of LyX is format 21.
7724 But each version of LyX is capable of reading earlier versions' layout
7725 files, just as they are capable of reading files produced by earlier versions
7727 There is, however, no provision for converting to earlier formats.
7728 So LyX 1.6.x will not read layout files in format 21 but only files in format
7732 \begin_layout Subsection
7733 \begin_inset CommandInset label
7735 name "sub:General-text-class"
7739 General text class parameters
7742 \begin_layout Standard
7743 These are general parameters that govern the behavior of an entire document
7749 mean that they must appear in
7750 \begin_inset Flex Code
7753 \begin_layout Plain Layout
7759 files rather than in modules.
7760 A module can contain any layout tag.)
7763 \begin_layout Description
7764 \begin_inset Flex Code
7767 \begin_layout Plain Layout
7773 Adds information that will be output in the
7774 \begin_inset Flex Code
7777 \begin_layout Plain Layout
7783 block when this document class is output to XHTML.
7784 Typically, this would be used to output CSS style information, but it can
7785 be used for anything that can appear in
7786 \begin_inset Flex Code
7789 \begin_layout Plain Layout
7797 \begin_inset Quotes eld
7801 \begin_inset Flex Code
7804 \begin_layout Plain Layout
7811 \begin_inset Quotes erd
7817 \begin_layout Description
7818 \begin_inset Flex Code
7821 \begin_layout Plain Layout
7827 Adds information to the document preamble.
7829 \begin_inset Quotes eld
7833 \begin_inset Flex Code
7836 \begin_layout Plain Layout
7843 \begin_inset Quotes erd
7849 \begin_layout Description
7850 \begin_inset Flex Code
7853 \begin_layout Plain Layout
7859 Defines formats for use in the display of bibliographic information.
7861 \begin_inset CommandInset ref
7863 reference "sub:Citation-format-description"
7869 \begin_inset Quotes eld
7873 \begin_inset Flex Code
7876 \begin_layout Plain Layout
7883 \begin_inset Quotes erd
7889 \begin_layout Description
7890 \begin_inset Flex Code
7893 \begin_layout Plain Layout
7899 Describes various global options supported by the document class.
7901 \begin_inset space ~
7905 \begin_inset CommandInset ref
7907 reference "sub:ClassOptions"
7913 \begin_inset Quotes eld
7917 \begin_inset Flex Code
7920 \begin_layout Plain Layout
7927 \begin_inset Quotes erd
7933 \begin_layout Description
7934 \begin_inset Flex Code
7937 \begin_layout Plain Layout
7944 \begin_inset Flex Code
7947 \begin_layout Plain Layout
7956 \begin_inset Flex Code
7959 \begin_layout Plain Layout
7965 ] Whether the class should
7969 to having one or two columns.
7970 Can be changed in the
7971 \begin_inset Flex MenuItem
7974 \begin_layout Plain Layout
7975 Document\SpecialChar \menuseparator
7984 \begin_layout Description
7985 \begin_inset Flex Code
7988 \begin_layout Plain Layout
7995 \begin_inset Flex Code
7998 \begin_layout Plain Layout
8004 ] This sequence defines the properties for a counter.
8005 If the counter does not yet exist, it is created; if it does exist, it
8008 \begin_inset Quotes eld
8012 \begin_inset Flex Code
8015 \begin_layout Plain Layout
8022 \begin_inset Quotes erd
8026 \begin_inset Newline newline
8030 \begin_inset space ~
8034 \begin_inset CommandInset ref
8036 reference "sub:Counters"
8040 for details on counters.
8043 \begin_layout Description
8044 \begin_inset Flex Code
8047 \begin_layout Plain Layout
8053 Sets the default font used to display the document.
8055 \begin_inset space ~
8059 \begin_inset CommandInset ref
8061 reference "sub:Font-description"
8065 for how to declare fonts.
8067 \begin_inset Quotes eld
8071 \begin_inset Flex Code
8074 \begin_layout Plain Layout
8081 \begin_inset Quotes erd
8087 \begin_layout Description
8088 \begin_inset Flex Code
8091 \begin_layout Plain Layout
8098 \begin_inset Flex Code
8101 \begin_layout Plain Layout
8107 Specifies a module to be included by default with this document class.
8108 The module should be specified by filename without the
8109 \begin_inset Flex Code
8112 \begin_layout Plain Layout
8119 The user can still remove the module, but it will be active at the outset.
8120 (This applies only when new files are created, or when this class is chosen
8121 for an existing document.)
8124 \begin_layout Description
8125 \begin_inset Flex Code
8128 \begin_layout Plain Layout
8135 \begin_inset Flex Code
8138 \begin_layout Plain Layout
8144 ] This is the style that will be assigned to new paragraphs, usually
8145 \begin_inset Flex MenuItem
8148 \begin_layout Plain Layout
8155 This will default to the first defined style if not given, but you are
8156 encouraged to use this directive.
8159 \begin_layout Description
8160 \begin_inset Flex Code
8163 \begin_layout Plain Layout
8170 \begin_inset Flex Code
8173 \begin_layout Plain Layout
8179 ] This tag indicates that the module in question—which should be specified
8180 by filename without the
8181 \begin_inset Flex Code
8184 \begin_layout Plain Layout
8190 extension—cannot be used with this document class.
8191 This might be used in a journal-specific layout file to prevent, say, the
8193 \begin_inset Flex Code
8196 \begin_layout Plain Layout
8202 module that numbers theorems by section.
8207 be used in a module.
8208 Modules have their own way of excluding other modules (see
8209 \begin_inset CommandInset ref
8211 reference "sub:Layout-modules"
8218 \begin_layout Description
8219 \begin_inset Flex Code
8222 \begin_layout Plain Layout
8228 Defines a new float.
8230 \begin_inset space ~
8234 \begin_inset CommandInset ref
8236 reference "sub:Floats"
8242 \begin_inset Quotes eld
8246 \begin_inset Flex Code
8249 \begin_layout Plain Layout
8256 \begin_inset Quotes erd
8262 \begin_layout Description
8263 \begin_inset Flex Code
8266 \begin_layout Plain Layout
8272 Sets the information that will be output in the
8273 \begin_inset Flex Code
8276 \begin_layout Plain Layout
8282 block when this document class is output to XHTML.
8283 Note that this will completely override any prior
8284 \begin_inset Flex Code
8287 \begin_layout Plain Layout
8294 \begin_inset Flex Code
8297 \begin_layout Plain Layout
8305 \begin_inset Flex Code
8308 \begin_layout Plain Layout
8314 if you just want to add material to the preamble.) Must end with
8315 \begin_inset Quotes eld
8319 \begin_inset Flex Code
8322 \begin_layout Plain Layout
8329 \begin_inset Quotes erd
8335 \begin_layout Description
8336 \begin_inset Flex Code
8339 \begin_layout Plain Layout
8346 \begin_inset Flex Code
8349 \begin_layout Plain Layout
8355 ] The layout to use for the table of contents, bibliography, and so forth,
8356 when the document is output to HTML.
8357 For articles, this should normally be Section; for books, Chapter.
8358 If it is not given, then LyX will attempt to figure out which layout to
8362 \begin_layout Description
8363 \begin_inset Flex Code
8366 \begin_layout Plain Layout
8373 \begin_inset Flex Code
8376 \begin_layout Plain Layout
8382 ] Modifies the properties of the given counter.
8383 If the counter does not exist, the section is ignored.
8385 \begin_inset Quotes eld
8389 \begin_inset Flex Code
8392 \begin_layout Plain Layout
8399 \begin_inset Quotes erd
8403 \begin_inset Newline newline
8407 \begin_inset space ~
8411 \begin_inset CommandInset ref
8413 reference "sub:Counters"
8417 for details on counters.
8420 \begin_layout Description
8421 \begin_inset Flex Code
8424 \begin_layout Plain Layout
8431 \begin_inset Flex Code
8434 \begin_layout Plain Layout
8440 ] Modifies the properties of the given paragraph style.
8441 If the style does not exist, the section is ignored.
8443 \begin_inset Quotes eld
8447 \begin_inset Flex Code
8450 \begin_layout Plain Layout
8457 \begin_inset Quotes erd
8463 \begin_layout Description
8464 \begin_inset Flex Code
8467 \begin_layout Plain Layout
8473 As its name implies, this command allows you to include another layout
8474 definition file within yours to avoid duplicating commands.
8475 Common examples are the standard layout files, for example,
8476 \begin_inset Flex Code
8479 \begin_layout Plain Layout
8485 , which contains most of the basic layouts.
8488 \begin_layout Description
8489 \begin_inset Flex Code
8492 \begin_layout Plain Layout
8498 This section (re-)defines the layout of an inset.
8499 It can be applied to an existing inset or to a new, user-defined inset,
8500 e.g., a new character style.
8502 \begin_inset Quotes eld
8506 \begin_inset Flex Code
8509 \begin_layout Plain Layout
8516 \begin_inset Quotes erd
8520 \begin_inset Newline newline
8524 \begin_inset space ~
8528 \begin_inset CommandInset ref
8530 reference "sub:Flex-insets-and"
8534 for more information.
8538 \begin_layout Description
8539 \begin_inset Flex Code
8542 \begin_layout Plain Layout
8549 \begin_inset Flex Code
8552 \begin_layout Plain Layout
8558 ] A string that indicates the width of the left margin on the screen, for
8560 \begin_inset Quotes eld
8564 \begin_inset Quotes erd
8568 (Note that this is not a `length', like
8569 \begin_inset Quotes eld
8573 \begin_inset Quotes erd
8579 \begin_layout Description
8580 \begin_inset Flex Code
8583 \begin_layout Plain Layout
8590 \begin_inset Flex Code
8593 \begin_layout Plain Layout
8599 ] This command deletes an existing counter, usually one defined in an included
8603 \begin_layout Description
8604 \begin_inset Flex Code
8607 \begin_layout Plain Layout
8613 This command deletes an existing float.
8614 This is particularly useful when you want to suppress a float that has
8615 been defined in an input file.
8618 \begin_layout Description
8619 \begin_inset Flex Code
8622 \begin_layout Plain Layout
8628 This command deletes an existing style.
8629 This is particularly useful when you want to suppress a style that has
8630 be defined in an input file.
8633 \begin_layout Description
8634 \begin_inset Flex Code
8637 \begin_layout Plain Layout
8643 A string indicating the file format (as defined in the Preferences dialog)
8644 produced by this class.
8645 It is mainly useful when
8646 \begin_inset Flex Code
8649 \begin_layout Plain Layout
8655 is `literate' and one wants to define a new type of literate document.
8656 This string is reset to `docbook', `latex', or `literate' when the correspondin
8658 \begin_inset Flex Code
8661 \begin_layout Plain Layout
8667 parameter is encountered.
8670 \begin_layout Description
8671 \begin_inset Flex Code
8674 \begin_layout Plain Layout
8680 A string indicating what sort of output documents using this class will
8682 At present, the options are: `docbook', `latex', and `literate'.
8685 \begin_layout Description
8686 \begin_inset Flex Code
8689 \begin_layout Plain Layout
8696 \begin_inset Flex Code
8699 \begin_layout Plain Layout
8708 \begin_inset Flex Code
8711 \begin_layout Plain Layout
8718 \begin_inset Flex Code
8721 \begin_layout Plain Layout
8727 ] The default pagestyle.
8728 Can be changed in the
8729 \begin_inset Flex MenuItem
8732 \begin_layout Plain Layout
8733 Document\SpecialChar \menuseparator
8742 \begin_layout Description
8743 \begin_inset Flex Code
8746 \begin_layout Plain Layout
8752 Sets the preamble for the LaTeX document.
8753 Note that this will completely override any prior
8754 \begin_inset Flex Code
8757 \begin_layout Plain Layout
8764 \begin_inset Flex Code
8767 \begin_layout Plain Layout
8775 \begin_inset Flex Code
8778 \begin_layout Plain Layout
8784 if you just want to add material to the preamble.) Must end with
8785 \begin_inset Quotes eld
8789 \begin_inset Flex Code
8792 \begin_layout Plain Layout
8799 \begin_inset Quotes erd
8805 \begin_layout Description
8806 \begin_inset Flex Code
8809 \begin_layout Plain Layout
8816 \begin_inset Flex Code
8819 \begin_layout Plain Layout
8826 \begin_inset Flex Code
8829 \begin_layout Plain Layout
8838 \begin_inset Flex Code
8841 \begin_layout Plain Layout
8847 ] Whether the class already provides the feature
8848 \begin_inset Flex Code
8851 \begin_layout Plain Layout
8858 A feature is in general the name of a package (
8859 \begin_inset Flex Code
8862 \begin_layout Plain Layout
8869 \begin_inset Flex Code
8872 \begin_layout Plain Layout
8878 , \SpecialChar \ldots{}
8880 \begin_inset Flex Code
8883 \begin_layout Plain Layout
8890 \begin_inset Flex Code
8893 \begin_layout Plain Layout
8899 ,\SpecialChar \ldots{}
8900 ); the complete list of supported features is unfortunately not documented
8901 outside the LyX source code—but see
8902 \begin_inset Flex Code
8905 \begin_layout Plain Layout
8911 if you're interested.
8913 \begin_inset Flex MenuItem
8916 \begin_layout Plain Layout
8917 Help\SpecialChar \menuseparator
8923 also gives an overview of the supported packages.
8926 \begin_layout Description
8927 \begin_inset Flex Code
8930 \begin_layout Plain Layout
8937 \begin_inset Flex Code
8940 \begin_layout Plain Layout
8946 ] Indicates that this layout provides the functionality of the module mentioned,
8947 which should be specified by the filename without the
8948 \begin_inset Flex Code
8951 \begin_layout Plain Layout
8958 This will typically be used if the layout includes the module directly,
8959 rather than using the
8960 \begin_inset Flex Code
8963 \begin_layout Plain Layout
8969 tag to indicate that it ought to be used.
8970 It could also be used in a module that provided an alternate implementation
8971 of the same functionality.
8974 \begin_layout Description
8975 \begin_inset Flex Code
8978 \begin_layout Plain Layout
8985 \begin_inset Flex Code
8988 \begin_layout Plain Layout
8994 ] Whether the class requires the feature
8995 \begin_inset Flex Code
8998 \begin_layout Plain Layout
9005 Multiple features must be separated by commas.
9006 Note that you can only request supported features.
9008 \begin_inset Flex Code
9011 \begin_layout Plain Layout
9017 for a list of these.)
9020 \begin_layout Description
9021 \begin_inset Flex Code
9024 \begin_layout Plain Layout
9030 A string that indicates the width of the right margin on the screen, for
9032 \begin_inset Quotes eld
9036 \begin_inset Quotes erd
9042 \begin_layout Description
9043 \begin_inset Flex Code
9046 \begin_layout Plain Layout
9052 Sets which divisions get numbered.
9054 \begin_inset Flex Code
9057 \begin_layout Plain Layout
9066 \begin_layout Description
9067 \begin_inset Flex Code
9070 \begin_layout Plain Layout
9077 \begin_inset Flex Code
9080 \begin_layout Plain Layout
9089 \begin_inset Flex Code
9092 \begin_layout Plain Layout
9098 ] Whether the class-default should be printing on one or both sides of the
9100 Can be changed in the
9101 \begin_inset Flex MenuItem
9104 \begin_layout Plain Layout
9105 Document\SpecialChar \menuseparator
9114 \begin_layout Description
9115 \begin_inset Flex Code
9118 \begin_layout Plain Layout
9124 This sequence defines a paragraph style.
9125 If the style does not yet exist, it is created; if it does exist, its parameter
9128 \begin_inset Quotes eld
9132 \begin_inset Flex Code
9135 \begin_layout Plain Layout
9142 \begin_inset Quotes erd
9146 \begin_inset Newline newline
9150 \begin_inset space ~
9154 \begin_inset CommandInset ref
9156 reference "sub:Paragraph-Styles"
9160 for details on paragraph styles.
9163 \begin_layout Description
9164 \begin_inset Flex Code
9167 \begin_layout Plain Layout
9174 \begin_inset Flex Code
9177 \begin_layout Plain Layout
9183 ] The name of the command or environment to be used with
9184 \begin_inset Flex Code
9187 \begin_layout Plain Layout
9196 \begin_layout Description
9197 \begin_inset Flex Code
9200 \begin_layout Plain Layout
9207 \begin_inset Flex Code
9210 \begin_layout Plain Layout
9219 \begin_inset Flex Code
9222 \begin_layout Plain Layout
9228 ] Indicates what kind of markup is used to define the title of a document.
9230 \begin_inset Flex Code
9233 \begin_layout Plain Layout
9239 means that the macro with name
9240 \begin_inset Flex Code
9243 \begin_layout Plain Layout
9249 will be inserted after the last layout which has
9250 \begin_inset Quotes eld
9254 \begin_inset Flex Code
9257 \begin_layout Plain Layout
9264 \begin_inset Quotes erd
9269 \begin_inset Flex Code
9272 \begin_layout Plain Layout
9278 corresponds to the case where the block of paragraphs which have
9279 \begin_inset Quotes eld
9283 \begin_inset Flex Code
9286 \begin_layout Plain Layout
9293 \begin_inset Quotes erd
9296 should be enclosed into the
9297 \begin_inset Flex Code
9300 \begin_layout Plain Layout
9309 \begin_layout Description
9310 \begin_inset Flex Code
9313 \begin_layout Plain Layout
9319 Sets which divisions are included in the table of contents.
9321 \begin_inset Flex Code
9324 \begin_layout Plain Layout
9333 \begin_layout Subsection
9334 \begin_inset Flex Code
9337 \begin_layout Plain Layout
9344 \begin_inset CommandInset label
9346 name "sub:ClassOptions"
9353 \begin_layout Standard
9355 \begin_inset Flex Code
9358 \begin_layout Plain Layout
9364 section can contain the following entries:
9367 \begin_layout Description
9368 \begin_inset Flex Code
9371 \begin_layout Plain Layout
9378 \begin_inset Flex Code
9381 \begin_layout Plain Layout
9387 ] The list of available font sizes for the document's main font, separated
9389 \begin_inset Quotes eld
9393 \begin_inset Flex Code
9396 \begin_layout Plain Layout
9403 \begin_inset Quotes erd
9409 \begin_layout Description
9410 \begin_inset Flex Code
9413 \begin_layout Plain Layout
9419 Used to set the DTD line with XML-based output classes.
9421 \begin_inset space \thinspace{}
9425 \begin_inset Quotes eld
9428 -//OASIS//DTD DocBook V4.2//EN
9429 \begin_inset Quotes erd
9435 \begin_layout Description
9436 \begin_inset Flex Code
9439 \begin_layout Plain Layout
9446 \begin_inset Flex Code
9449 \begin_layout Plain Layout
9450 string="empty|plain|headings|fancy"
9455 ] The list of available page styles, separated by
9456 \begin_inset Quotes eld
9460 \begin_inset Flex Code
9463 \begin_layout Plain Layout
9470 \begin_inset Quotes erd
9476 \begin_layout Description
9477 \begin_inset Flex Code
9480 \begin_layout Plain Layout
9487 \begin_inset Flex Code
9490 \begin_layout Plain Layout
9496 ] Some document class options, separated by a comma, that will be added
9497 to the optional part of the
9498 \begin_inset Flex Code
9501 \begin_layout Plain Layout
9512 \begin_layout Standard
9514 \begin_inset Flex Code
9517 \begin_layout Plain Layout
9523 section must end with
9524 \begin_inset Quotes eld
9528 \begin_inset Flex Code
9531 \begin_layout Plain Layout
9538 \begin_inset Quotes erd
9544 \begin_layout Subsection
9546 \begin_inset CommandInset label
9548 name "sub:Paragraph-Styles"
9555 \begin_layout Standard
9556 A paragraph style description looks like this:
9560 \begin_layout Plain Layout
9561 Note that this will either define a new style or modify an existing one.
9569 \begin_layout LyX-Code
9576 \begin_layout LyX-Code
9580 \begin_layout LyX-Code
9584 \begin_layout Standard
9585 where the following commands are allowed:
9588 \begin_layout Description
9589 \begin_inset Flex Code
9592 \begin_layout Plain Layout
9599 \begin_inset Flex Code
9602 \begin_layout Plain Layout
9607 , left, right, center
9612 ] Paragraph alignment.
9615 \begin_layout Description
9616 \begin_inset Flex Code
9619 \begin_layout Plain Layout
9626 \begin_inset Flex Code
9629 \begin_layout Plain Layout
9634 , left, right, center
9639 ] A comma separated list of permitted alignments.
9640 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9642 For example a right-aligned or centered enumeration isn't possible.)
9645 \begin_layout Description
9646 \begin_inset Flex Code
9649 \begin_layout Plain Layout
9655 Note that this will completely override any prior
9656 \begin_inset Flex Code
9659 \begin_layout Plain Layout
9665 declaration for this style.
9667 \begin_inset Quotes eld
9671 \begin_inset Flex Code
9674 \begin_layout Plain Layout
9681 \begin_inset Quotes erd
9686 \begin_inset CommandInset ref
9688 reference "sub:I18n"
9692 for details on its use.
9695 \begin_layout Description
9696 \begin_inset Flex Code
9699 \begin_layout Plain Layout
9706 \begin_inset Flex Code
9709 \begin_layout Plain Layout
9719 \begin_layout Plain Layout
9720 Note that a `float' here is a real number, such as: 1.5.
9725 The vertical space with which the last of a chain of paragraphs with this
9726 style is separated from the following paragraph.
9727 If the next paragraph has another style, the separations are not simply
9728 added, but the maximum is taken.
9731 \begin_layout Description
9732 \begin_inset Flex Code
9735 \begin_layout Plain Layout
9742 \begin_inset Flex Code
9745 \begin_layout Plain Layout
9751 The category for this style.
9752 This is used to group related styles in the style combobox on the toolbar.
9753 Any string can be used, but you may want to use existing categories with
9758 \begin_layout Description
9759 \begin_inset Flex Code
9762 \begin_layout Plain Layout
9768 Depth of XML command.
9769 Used only with XML-type formats.
9772 \begin_layout Description
9773 \begin_inset Flex Code
9776 \begin_layout Plain Layout
9783 \begin_inset CommandInset label
9785 name "des:CopyStyle"
9790 \begin_inset Flex Code
9793 \begin_layout Plain Layout
9799 Copies all the features of an existing style into the current one.
9803 \begin_layout Description
9804 \begin_inset Flex Code
9807 \begin_layout Plain Layout
9813 The name of a style whose preamble should be output
9818 This allows to ensure some ordering of the preamble snippets when macros
9819 definitions depend on one another.
9823 \begin_layout Plain Layout
9824 Note that, besides that functionality, there is no way to ensure any ordering
9826 The ordering that you see in a given version of LyX may change without
9827 warning in later versions.
9835 \begin_layout Description
9836 \begin_inset Flex Code
9839 \begin_layout Plain Layout
9846 \begin_inset Flex Code
9849 \begin_layout Plain Layout
9854 , Box, Filled_Box, Static
9859 ] The type of label that stands at the end of the paragraph (or sequence
9861 \begin_inset Flex Code
9864 \begin_layout Plain Layout
9871 \begin_inset Flex Code
9874 \begin_layout Plain Layout
9881 \begin_inset Flex Code
9884 \begin_layout Plain Layout
9891 \begin_inset Flex Code
9894 \begin_layout Plain Layout
9902 \begin_inset Flex Code
9905 \begin_layout Plain Layout
9912 \begin_inset Quotes eld
9916 \begin_inset Quotes erd
9920 \begin_inset Flex Code
9923 \begin_layout Plain Layout
9930 \begin_inset Flex Code
9933 \begin_layout Plain Layout
9934 \begin_inset space ~
9943 \begin_inset space ~
9946 black) square suitable for end of proof markers,
9947 \begin_inset Flex Code
9950 \begin_layout Plain Layout
9956 is an explicit text string.
9959 \begin_layout Description
9960 \begin_inset Flex Code
9963 \begin_layout Plain Layout
9970 \begin_inset Flex Code
9973 \begin_layout Plain Layout
9979 ] The string used for a label with a
9980 \begin_inset Flex Code
9983 \begin_layout Plain Layout
9990 \begin_inset Flex Code
9993 \begin_layout Plain Layout
10003 \begin_layout Description
10004 \begin_inset Flex Code
10007 \begin_layout Plain Layout
10013 The font used for both the text body
10019 \begin_inset space ~
10023 \begin_inset CommandInset ref
10025 reference "sub:Font-description"
10030 Note that defining this font automatically defines the
10031 \begin_inset Flex Code
10034 \begin_layout Plain Layout
10041 So you should define this one first if you also want to define
10042 \begin_inset Flex Code
10045 \begin_layout Plain Layout
10054 \begin_layout Description
10055 \begin_inset Flex Code
10058 \begin_layout Plain Layout
10065 \begin_inset CommandInset label
10067 name "des:FreeSpacing"
10072 \begin_inset Flex Code
10075 \begin_layout Plain Layout
10084 \begin_inset Flex Code
10087 \begin_layout Plain Layout
10093 ] Usually LyX doesn't allow you to insert more than one space between words,
10094 since a space is considered as the separation between two words, not a
10095 character or symbol of its own.
10096 This is a very fine thing but sometimes annoying, for example, when typing
10097 program code or plain LaTeX code.
10099 \begin_inset Flex Code
10102 \begin_layout Plain Layout
10109 Note that LyX will create protected blanks for the additional blanks when
10110 in another mode than LaTeX-mode.
10113 \begin_layout Description
10114 \begin_inset Flex Code
10117 \begin_layout Plain Layout
10123 These tags are used with XHTML output.
10125 \begin_inset CommandInset ref
10127 reference "sub:Paragraph-Style-XHTML"
10134 \begin_layout Description
10135 \begin_inset Flex Code
10138 \begin_layout Plain Layout
10144 [[FIXME]] (Used only with XML-type formats.)
10147 \begin_layout Description
10148 \begin_inset Flex Code
10151 \begin_layout Plain Layout
10158 \begin_inset Flex Code
10161 \begin_layout Plain Layout
10167 If 1, marks the style as to be included in the document preamble rather
10168 than in the document body.
10169 This is useful for document classes that want such information as the title
10170 and author to appear in the preamble.
10171 Note that this works only for styles for which the
10172 \begin_inset Flex Code
10175 \begin_layout Plain Layout
10182 \begin_inset Flex Code
10185 \begin_layout Plain Layout
10192 \begin_inset Flex Code
10195 \begin_layout Plain Layout
10204 \begin_layout Description
10205 \begin_inset Flex Code
10208 \begin_layout Plain Layout
10215 \begin_inset Flex Code
10218 \begin_layout Plain Layout
10224 If 1, marks the style as being part of a title block (see also the
10225 \begin_inset Flex Code
10228 \begin_layout Plain Layout
10235 \begin_inset Flex Code
10238 \begin_layout Plain Layout
10247 \begin_layout Description
10248 \begin_inset Flex Code
10251 \begin_layout Plain Layout
10258 \begin_inset Flex Code
10261 \begin_layout Plain Layout
10267 ] This provides extra space between paragraphs that have the same style.
10268 If you put other styles into an environment, each is separated with the
10270 \begin_inset Flex Code
10273 \begin_layout Plain Layout
10280 But the whole items of the environment are additionally separated with
10282 \begin_inset Flex Code
10285 \begin_layout Plain Layout
10292 Note that this is a
10297 \begin_layout Description
10298 \begin_inset Flex Code
10301 \begin_layout Plain Layout
10307 [[FIXME]] (Used only with XML-type formats.)
10310 \begin_layout Description
10311 \begin_inset Flex Code
10314 \begin_layout Plain Layout
10321 \begin_inset CommandInset label
10323 name "des:KeepEmpty"
10328 \begin_inset Flex Code
10331 \begin_layout Plain Layout
10340 \begin_inset Flex Code
10343 \begin_layout Plain Layout
10349 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10350 lead to empty LaTeX output.
10351 There are some cases where this could be desirable however: in a letter
10352 template, the required fields can be provided as empty fields, so that
10353 people do not forget them; in some special classes, a style can be used
10354 as some kind of break, which does not contain actual text.
10357 \begin_layout Description
10358 \begin_inset Flex Code
10361 \begin_layout Plain Layout
10367 [float=0] The vertical space between the label and the text body.
10368 Only used for labels that are above the text body (
10369 \begin_inset Flex Code
10372 \begin_layout Plain Layout
10379 \begin_inset Flex Code
10382 \begin_layout Plain Layout
10383 Centered_Top_Environment
10391 \begin_layout Description
10392 \begin_inset Flex Code
10395 \begin_layout Plain Layout
10402 \begin_inset Flex Code
10405 \begin_layout Plain Layout
10412 \begin_inset Newline newline
10415 The name of the counter for automatic numbering.
10417 \begin_inset Newline newline
10425 \begin_inset Flex Code
10428 \begin_layout Plain Layout
10435 \begin_inset Flex Code
10438 \begin_layout Plain Layout
10445 In that case, the counter will be stepped each time the style appears.
10447 \begin_inset Newline newline
10455 \begin_inset Flex Code
10458 \begin_layout Plain Layout
10465 \begin_inset Flex Code
10468 \begin_layout Plain Layout
10474 , though this case is a bit complicated.
10475 Suppose you declare
10476 \begin_inset Quotes eld
10480 \begin_inset Flex Code
10483 \begin_layout Plain Layout
10484 LabelCounter myenum
10490 \begin_inset Quotes erd
10494 Then the actual counters used are
10495 \begin_inset Flex Code
10498 \begin_layout Plain Layout
10505 \begin_inset Flex Code
10508 \begin_layout Plain Layout
10515 \begin_inset Flex Code
10518 \begin_layout Plain Layout
10525 \begin_inset Flex Code
10528 \begin_layout Plain Layout
10534 , much as in LaTeX.
10535 These counters must all be declared separately.
10536 \begin_inset Newline newline
10540 \begin_inset CommandInset ref
10542 reference "sub:Counters"
10546 for details on counters.
10549 \begin_layout Description
10550 \begin_inset Flex Code
10553 \begin_layout Plain Layout
10559 The font used for the label.
10561 \begin_inset space ~
10565 \begin_inset CommandInset ref
10567 reference "sub:Font-description"
10574 \begin_layout Description
10575 \begin_inset Flex Code
10578 \begin_layout Plain Layout
10584 Text that indicates how far a label should be indented.
10587 \begin_layout Description
10588 \begin_inset Flex Code
10591 \begin_layout Plain Layout
10598 \begin_inset Flex Code
10601 \begin_layout Plain Layout
10607 ] The horizontal space between the label and the text body.
10608 Only used for labels that are not above the text body.
10611 \begin_layout Description
10612 \begin_inset Flex Code
10615 \begin_layout Plain Layout
10622 \begin_inset Flex Code
10625 \begin_layout Plain Layout
10631 ] The string used for a label with a
10632 \begin_inset Flex Code
10635 \begin_layout Plain Layout
10643 \begin_inset Flex Code
10646 \begin_layout Plain Layout
10652 is set, this string can be contain the special formatting commands described
10654 \begin_inset CommandInset ref
10656 reference "sub:Counters"
10664 \begin_layout Plain Layout
10665 For the sake of backwards compatibility, the string
10666 \begin_inset Flex Code
10669 \begin_layout Plain Layout
10679 will be replaced by the expanded
10680 \begin_inset Flex Code
10683 \begin_layout Plain Layout
10690 \begin_inset Flex Code
10693 \begin_layout Plain Layout
10702 This feature is now obsolete and should be replaced by the mechanisms of
10704 \begin_inset CommandInset ref
10706 reference "sub:Counters"
10718 \begin_layout Description
10719 \begin_inset Flex Code
10722 \begin_layout Plain Layout
10723 LabelStringAppendix
10729 \begin_inset Flex Code
10732 \begin_layout Plain Layout
10738 ] This is used inside the appendix instead of
10739 \begin_inset Flex Code
10742 \begin_layout Plain Layout
10750 \begin_inset Flex Code
10753 \begin_layout Plain Layout
10760 \begin_inset Flex Code
10763 \begin_layout Plain Layout
10764 LabelStringAppendix
10772 \begin_layout Description
10773 \begin_inset Flex Code
10776 \begin_layout Plain Layout
10782 [FIXME] (Used only with XML-type formats.)
10785 \begin_layout Description
10786 \begin_inset Flex Code
10789 \begin_layout Plain Layout
10796 \begin_inset Flex Code
10799 \begin_layout Plain Layout
10804 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10805 Enumerate, Itemize, Bibliography
10814 \begin_layout Itemize
10815 \begin_inset Flex Code
10818 \begin_layout Plain Layout
10824 means the label is the very first word (up to the first real blank).
10825 Use protected spaces (like
10826 \begin_inset space ~
10829 that one) if you want more than one word as the label.
10833 \begin_layout Itemize
10834 \begin_inset Flex Code
10837 \begin_layout Plain Layout
10843 means the label is simply whatever
10844 \begin_inset Flex Code
10847 \begin_layout Plain Layout
10854 Note that this really is `static'.
10857 \begin_layout Itemize
10858 \begin_inset Flex Code
10861 \begin_layout Plain Layout
10868 \begin_inset Flex Code
10871 \begin_layout Plain Layout
10872 Centered_Top_Environment
10877 are special cases of
10878 \begin_inset Flex Code
10881 \begin_layout Plain Layout
10888 The label will be printed above the paragraph, but only at the top of an
10889 environment or the top of a chain of paragraphs with this style.
10890 This might be used with the
10891 \begin_inset Flex MenuItem
10894 \begin_layout Plain Layout
10900 style, for example.
10903 \begin_layout Itemize
10904 \begin_inset Flex Code
10907 \begin_layout Plain Layout
10913 is a special case for the caption-labels
10914 \begin_inset Quotes eld
10918 \begin_inset Quotes erd
10922 \begin_inset Quotes eld
10926 \begin_inset Quotes erd
10931 \begin_inset Flex Code
10934 \begin_layout Plain Layout
10940 means the (hardcoded) label string depends on the kind of float: It is
10941 hardcoded to be `FloatType N', where N is the value of the counter associated
10945 \begin_layout Itemize
10947 \begin_inset Flex Code
10950 \begin_layout Plain Layout
10956 label type defines automatically numbered labels.
10958 \begin_inset Flex Code
10961 \begin_layout Plain Layout
10967 will be expanded to resolve any counter references it contains: For example,
10969 \begin_inset Quotes eld
10973 \begin_inset Flex Code
10976 \begin_layout Plain Layout
10987 \begin_inset Quotes erd
10992 \begin_inset CommandInset ref
10994 reference "sub:Counters"
10998 for more information on counters.
11001 \begin_layout Itemize
11002 \begin_inset Flex Code
11005 \begin_layout Plain Layout
11011 produces the usual sort of enumeration labels.
11012 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11013 small Roman numerals, and uppercase letters for the four possible depths.
11016 \begin_layout Itemize
11017 \begin_inset Flex Code
11020 \begin_layout Plain Layout
11026 produces various bullets at the different levels.
11027 It is also hardcoded.
11030 \begin_layout Itemize
11031 \begin_inset Flex Code
11034 \begin_layout Plain Layout
11040 is used internally by LyX and should be used only with
11041 \begin_inset Flex Code
11044 \begin_layout Plain Layout
11045 LatexType BibEnvironment
11054 \begin_layout Description
11055 \begin_inset Flex Code
11058 \begin_layout Plain Layout
11064 Note that this will completely override any prior
11065 \begin_inset Flex Code
11068 \begin_layout Plain Layout
11074 declaration for this style.
11076 \begin_inset Quotes eld
11080 \begin_inset Flex Code
11083 \begin_layout Plain Layout
11090 \begin_inset Quotes erd
11095 \begin_inset CommandInset ref
11097 reference "sub:I18n"
11101 for details on its use.
11104 \begin_layout Description
11105 \begin_inset Flex Code
11108 \begin_layout Plain Layout
11114 The name of the corresponding LaTeX stuff.
11115 Either the environment or command name.
11118 \begin_layout Description
11119 \begin_inset Flex Code
11122 \begin_layout Plain Layout
11128 An optional parameter for the corresponding
11129 \begin_inset Flex Code
11132 \begin_layout Plain Layout
11139 This parameter cannot be changed from within LyX.
11142 \begin_layout Description
11143 \begin_inset Flex Code
11146 \begin_layout Plain Layout
11153 \begin_inset CommandInset label
11155 name "des:LatexType"
11160 \begin_inset Flex Code
11163 \begin_layout Plain Layout
11168 , Command, Environment, Item_Environment,
11174 \begin_inset Flex Code
11177 \begin_layout Plain Layout
11178 List_Environment, Bib_Environment
11183 ] How the style should be translated into LaTeX.
11187 \begin_layout Plain Layout
11188 \begin_inset Flex Code
11191 \begin_layout Plain Layout
11197 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11198 Visit the SGML class files for specific examples.
11207 \begin_layout Itemize
11208 \begin_inset Flex Code
11211 \begin_layout Plain Layout
11217 means nothing special.
11221 \begin_layout Itemize
11222 \begin_inset Flex Code
11225 \begin_layout Plain Layout
11232 \begin_inset Flex Code
11235 \begin_layout Plain Layout
11242 {\SpecialChar \ldots{}
11251 \begin_layout Itemize
11252 \begin_inset Flex Code
11255 \begin_layout Plain Layout
11262 \begin_inset Flex Code
11265 \begin_layout Plain Layout
11272 }\SpecialChar \ldots{}
11288 \begin_layout Itemize
11289 \begin_inset Flex Code
11292 \begin_layout Plain Layout
11299 \begin_inset Flex Code
11302 \begin_layout Plain Layout
11309 \begin_inset Flex Code
11312 \begin_layout Plain Layout
11320 is generated for each paragraph of this environment.
11324 \begin_layout Itemize
11325 \begin_inset Flex Code
11328 \begin_layout Plain Layout
11335 \begin_inset Flex Code
11338 \begin_layout Plain Layout
11345 \begin_inset Flex Code
11348 \begin_layout Plain Layout
11354 is passed as an argument to the environment.
11356 \begin_inset Flex Code
11359 \begin_layout Plain Layout
11365 can be defined in the
11366 \begin_inset Flex MenuItem
11369 \begin_layout Plain Layout
11374 \SpecialChar \menuseparator
11380 \begin_inset space ~
11392 \begin_layout Standard
11393 Putting the last few things together, the LaTeX output will be either:
11396 \begin_layout LyX-Code
11399 latexname[latexparam]{\SpecialChar \ldots{}
11403 \begin_layout Standard
11407 \begin_layout LyX-Code
11410 begin{latexname}[latexparam] \SpecialChar \ldots{}
11416 \begin_layout Standard
11417 depending upon the LaTeX type.
11421 \begin_layout Description
11422 \begin_inset Flex Code
11425 \begin_layout Plain Layout
11432 \begin_inset Flex Code
11435 \begin_layout Plain Layout
11441 ] If you put styles into environments, the leftmargins are not simply added,
11442 but added with a factor
11443 \begin_inset Formula $\frac{4}{depth+4}$
11447 Note that this parameter is also used when the margin is defined as
11448 \begin_inset Flex Code
11451 \begin_layout Plain Layout
11458 \begin_inset Flex Code
11461 \begin_layout Plain Layout
11468 Then it is added to the manual or dynamic margin.
11470 \begin_inset Newline newline
11473 The argument is passed as a string.
11475 \begin_inset Quotes eld
11479 \begin_inset Flex Code
11482 \begin_layout Plain Layout
11489 \begin_inset Quotes erd
11492 means that the paragraph is indented with the width of
11493 \begin_inset Quotes eld
11497 \begin_inset Flex Code
11500 \begin_layout Plain Layout
11507 \begin_inset Quotes erd
11510 in the normal font.
11511 You can get a negative width by prefixing the string with
11512 \begin_inset Quotes eld
11516 \begin_inset Flex Code
11519 \begin_layout Plain Layout
11526 \begin_inset Quotes erd
11530 This way was chosen so that the look is the same with each used screen
11535 \begin_layout Description
11536 \begin_inset Flex Code
11539 \begin_layout Plain Layout
11546 \begin_inset Flex Code
11549 \begin_layout Plain Layout
11554 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11560 \begin_inset Newline newline
11563 The kind of margin that the style has on the left side.
11565 \begin_inset Flex Code
11568 \begin_layout Plain Layout
11574 just means a fixed margin.
11576 \begin_inset Flex Code
11579 \begin_layout Plain Layout
11585 means that the left margin depends on the string entered in the
11586 \begin_inset Flex MenuItem
11589 \begin_layout Plain Layout
11590 Edit\SpecialChar \menuseparator
11592 \begin_inset space ~
11601 This is used to typeset nice lists without tabulators.
11603 \begin_inset Flex Code
11606 \begin_layout Plain Layout
11612 means that the margin depends on the size of the label.
11613 This is used for automatic enumerated headlines.
11614 It is obvious that the headline
11615 \begin_inset Quotes eld
11618 5.4.3.2.1 Very long headline
11619 \begin_inset Quotes erd
11622 must have a wider left margin (as wide as
11623 \begin_inset Quotes eld
11627 \begin_inset Quotes erd
11630 plus the space) than
11631 \begin_inset Quotes eld
11634 3.2 Very long headline
11635 \begin_inset Quotes erd
11639 \begin_inset Quotes eld
11643 \begin_inset Quotes erd
11646 are not able to do this.
11648 \begin_inset Flex Code
11651 \begin_layout Plain Layout
11657 is similar, but only the very first row of the paragraph is dynamic, while
11658 the others are static; this is used, for example, for descriptions.
11660 \begin_inset Flex Code
11663 \begin_layout Plain Layout
11669 means the margin is chosen in a way that the longest row of this paragraph
11670 fits to the right margin.
11671 This is used to typeset an address on the right edge of the page.
11674 \begin_layout Description
11675 \begin_inset Flex Code
11678 \begin_layout Plain Layout
11685 \begin_inset Flex Code
11688 \begin_layout Plain Layout
11697 \begin_inset Flex Code
11700 \begin_layout Plain Layout
11706 ] Whether fragile commands in this style should be
11707 \begin_inset Flex Code
11710 \begin_layout Plain Layout
11723 whether this command should itself be protected.)
11726 \begin_layout Description
11727 \begin_inset Flex Code
11730 \begin_layout Plain Layout
11737 \begin_inset Flex Code
11740 \begin_layout Plain Layout
11747 \begin_inset Flex Code
11750 \begin_layout Plain Layout
11758 ] Whether newlines are translated into LaTeX newlines (
11759 \begin_inset Flex Code
11762 \begin_layout Plain Layout
11773 The translation can be switched off to allow more comfortable LaTeX editing
11777 \begin_layout Description
11778 \begin_inset Flex Code
11781 \begin_layout Plain Layout
11788 \begin_inset Flex Code
11791 \begin_layout Plain Layout
11798 \begin_inset Flex Code
11801 \begin_layout Plain Layout
11809 ] If set to true, and if
11810 \begin_inset Flex Code
11813 \begin_layout Plain Layout
11820 \begin_inset Flex Code
11823 \begin_layout Plain Layout
11829 ) paragraphs are being indented, then the indentation of such a paragraph
11830 following one of this type will be suppressed.
11831 (So this will not affect the display of non-default paragraphs.)
11834 \begin_layout Description
11835 \begin_inset Flex Code
11838 \begin_layout Plain Layout
11844 Name of a style that has replaced this style.
11845 This is used to rename a style, while keeping backward compatibility.
11848 \begin_layout Description
11849 \begin_inset Flex Code
11852 \begin_layout Plain Layout
11859 \begin_inset Flex Code
11862 \begin_layout Plain Layout
11868 ] The number of optional arguments that can be used with this style.
11869 This is useful for things like section headings, and only makes sense with
11871 Note that, on output, the optional arguments will all precede any required
11872 arguments (see below).
11873 So one can have constructs like:
11877 \begin_layout LyX-Code
11880 mycmd[opt1]{req1}{contents of paragraph}
11883 \begin_layout Standard
11884 but one cannot have things like:
11887 \begin_layout LyX-Code
11890 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11893 \begin_layout Standard
11894 at least, not without ERT (with which you can have anything).
11899 \begin_layout Description
11900 \begin_inset Flex Code
11903 \begin_layout Plain Layout
11910 \begin_inset CommandInset label
11912 name "des:ParbreakIsNewline"
11917 \begin_inset Flex Code
11920 \begin_layout Plain Layout
11929 \begin_inset Flex Code
11932 \begin_layout Plain Layout
11938 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11939 output, but only by a line break; together with
11940 \begin_inset Flex Code
11943 \begin_layout Plain Layout
11949 , this allows to emulate a plain text editor (like the ERT inset).
11952 \begin_layout Description
11953 \begin_inset Flex Code
11956 \begin_layout Plain Layout
11963 \begin_inset Flex Code
11966 \begin_layout Plain Layout
11972 ] The indent of the very first line of a paragraph.
11974 \begin_inset Flex Code
11977 \begin_layout Plain Layout
11983 will be fixed for a certain style.
11984 The exception is the default style, since the indentation for these paragraphs
11985 can be prohibited with
11986 \begin_inset Flex Code
11989 \begin_layout Plain Layout
11997 \begin_inset Flex Code
12000 \begin_layout Plain Layout
12006 style paragraphs inside environments use the
12007 \begin_inset Flex Code
12010 \begin_layout Plain Layout
12016 of the environment, not their native one.
12018 \begin_inset Flex Code
12021 \begin_layout Plain Layout
12027 paragraphs inside an enumeration are not indented.
12030 \begin_layout Description
12031 \begin_inset Flex Code
12034 \begin_layout Plain Layout
12041 \begin_inset Flex Code
12044 \begin_layout Plain Layout
12050 ] The vertical space between two paragraphs of this style.
12053 \begin_layout Description
12054 \begin_inset Flex Code
12057 \begin_layout Plain Layout
12064 \begin_inset Flex Code
12067 \begin_layout Plain Layout
12073 ] LyX allows the user to choose either
12074 \begin_inset Quotes eld
12078 \begin_inset Quotes erd
12082 \begin_inset Quotes eld
12086 \begin_inset Quotes erd
12089 to typeset a document.
12091 \begin_inset Quotes eld
12095 \begin_inset Quotes erd
12098 is chosen, this value is completely ignored.
12100 \begin_inset Quotes eld
12104 \begin_inset Quotes erd
12107 is chosen, the parindent of a LaTeXtype
12108 \begin_inset Quotes eld
12112 \begin_inset Quotes erd
12115 style is ignored and all paragraphs are separated by this parskip argument.
12116 The vertical space is calculated with
12117 \begin_inset Flex Code
12120 \begin_layout Plain Layout
12122 \begin_inset space ~
12131 \begin_inset Flex Code
12134 \begin_layout Plain Layout
12140 is the height of a row with the normal font.
12141 This way, the look stays the same with different screen fonts.
12144 \begin_layout Description
12145 \begin_inset Flex Code
12148 \begin_layout Plain Layout
12155 \begin_inset CommandInset label
12157 name "des:PassThru"
12162 \begin_inset Flex Code
12165 \begin_layout Plain Layout
12174 \begin_inset Flex Code
12177 \begin_layout Plain Layout
12183 ] Whether the contents of this paragraph should be output in raw form, meaning
12184 without special translations that LaTeX would require.
12187 \begin_layout Description
12188 \begin_inset Flex Code
12191 \begin_layout Plain Layout
12198 \begin_inset CommandInset label
12200 name "des:Preamble"
12204 Information to be included in the LaTeX preamble when this style is used.
12205 Used to define macros, load packages, etc., required by this particular
12208 \begin_inset Quotes eld
12212 \begin_inset Flex Code
12215 \begin_layout Plain Layout
12222 \begin_inset Quotes erd
12228 \begin_layout Description
12229 \begin_inset Flex Code
12232 \begin_layout Plain Layout
12239 \begin_inset Flex Code
12242 \begin_layout Plain Layout
12248 ] The prefix to use when creating labels referring to paragraphs of this
12250 This allows the use of formatted references.
12253 \begin_layout Description
12254 \begin_inset Flex Code
12257 \begin_layout Plain Layout
12264 \begin_inset Flex Code
12267 \begin_layout Plain Layout
12273 ] The number of required arguments that the LaTeX command or environment
12274 corresponding to this style expects.
12275 In the case of a command, these are required arguments
12279 that associated with the content of the paragraph itself.
12280 These do not actually have to be provided: LyX will output empty arguments
12282 Note that optional arguments will be output before required arguments.
12283 See the discussion of the
12284 \begin_inset Flex Code
12287 \begin_layout Plain Layout
12293 tag above for more information.
12296 \begin_layout Description
12297 \begin_inset Flex Code
12300 \begin_layout Plain Layout
12307 \begin_inset Flex Code
12310 \begin_layout Plain Layout
12317 \begin_inset CommandInset label
12319 name "des:Requires"
12323 Whether the style requires the feature
12324 \begin_inset Flex Code
12327 \begin_layout Plain Layout
12334 See the description of
12335 \begin_inset Flex Code
12338 \begin_layout Plain Layout
12345 \begin_inset CommandInset ref
12346 LatexCommand pageref
12347 reference "des:FreeSpacing"
12351 ) for information on `features'.
12355 \begin_layout Description
12356 \begin_inset Flex Code
12359 \begin_layout Plain Layout
12366 \begin_inset Flex Code
12369 \begin_layout Plain Layout
12376 \begin_inset Flex Code
12379 \begin_layout Plain Layout
12388 \begin_layout Description
12389 \begin_inset Flex Code
12392 \begin_layout Plain Layout
12399 \begin_inset Flex Code
12402 \begin_layout Plain Layout
12407 , onehalf, double, other
12416 ] This defines what the default spacing should be in the style.
12418 \begin_inset Flex Code
12421 \begin_layout Plain Layout
12428 \begin_inset Flex Code
12431 \begin_layout Plain Layout
12438 \begin_inset Flex Code
12441 \begin_layout Plain Layout
12447 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12448 If you specify the argument
12449 \begin_inset Flex Code
12452 \begin_layout Plain Layout
12458 , then you should also provide a numerical argument which will be the actual
12460 Note that, contrary to other parameters,
12461 \begin_inset Flex Code
12464 \begin_layout Plain Layout
12470 implies the generation of specific LaTeX code, using the package
12473 \begin_inset Flex Code
12476 \begin_layout Plain Layout
12485 \begin_layout Description
12486 \begin_inset Flex Code
12489 \begin_layout Plain Layout
12496 \begin_inset Flex Code
12499 \begin_layout Plain Layout
12506 \begin_inset Flex Code
12509 \begin_layout Plain Layout
12517 ] Spellcheck paragraphs of this style.
12521 \begin_layout Description
12522 \begin_inset Flex Code
12525 \begin_layout Plain Layout
12531 The font used for the text body .
12533 \begin_inset CommandInset ref
12535 reference "sub:Font-description"
12542 \begin_layout Description
12543 \begin_inset Flex Code
12546 \begin_layout Plain Layout
12555 \begin_inset Flex Code
12558 \begin_layout Plain Layout
12568 The level of the style in the table of contents.
12569 This is used for automatic numbering of section headings.
12572 \begin_layout Description
12573 \begin_inset Flex Code
12576 \begin_layout Plain Layout
12583 \begin_inset Flex Code
12586 \begin_layout Plain Layout
12592 ] The vertical space with which the very first of a chain of paragraphs
12593 with this style is separated from the previous paragraph.
12594 If the previous paragraph has another style, the separations are not simply
12595 added, but the maximum is taken.
12598 \begin_layout Subsection
12599 \begin_inset CommandInset label
12605 Internationalization of Paragraph Styles
12608 \begin_layout Standard
12609 LyX has long supported internationalization of layout information, but,
12610 until version 2.0, this applied only to the user interface and not to, say,
12612 Thus, French authors were forced to resort to ugly hacks if they wanted
12617 1' instead of `Theorem 1'.
12618 Thanks to Georg Baum, that is no longer the case.
12621 \begin_layout Standard
12623 \begin_inset Flex Code
12626 \begin_layout Plain Layout
12632 defines text that is to appear in the typeset document, it may use
12633 \begin_inset Flex Code
12636 \begin_layout Plain Layout
12643 \begin_inset Flex Code
12646 \begin_layout Plain Layout
12652 to support non-English and even multi-language documents correctly.
12653 The following excerpt (from the
12654 \begin_inset Flex Code
12657 \begin_layout Plain Layout
12663 file) shows how this works:
12666 \begin_layout LyX-Code
12671 \begin_layout LyX-Code
12674 theoremstyle{remark}
12677 \begin_layout LyX-Code
12680 newtheorem{claim}[thm]{
12687 \begin_layout LyX-Code
12691 \begin_layout LyX-Code
12695 \begin_layout LyX-Code
12700 claimname}{_(Claim)}
12703 \begin_layout LyX-Code
12707 \begin_layout LyX-Code
12711 \begin_layout LyX-Code
12720 claimname}{_(Claim)}}
12723 \begin_layout LyX-Code
12728 \begin_layout Standard
12729 In principle, any legal LaTeX may appear in the
12730 \begin_inset Flex Code
12733 \begin_layout Plain Layout
12740 \begin_inset Flex Code
12743 \begin_layout Plain Layout
12749 tags, but in practice they will typically look as they do here.
12750 The key to correct translation of the typeset text is the definition of
12752 \begin_inset Flex Code
12755 \begin_layout Plain Layout
12764 \begin_inset Flex Code
12767 \begin_layout Plain Layout
12779 \begin_layout Standard
12781 \begin_inset Flex Code
12784 \begin_layout Plain Layout
12790 tag provides for internationalization based upon the overall language of
12792 The contents of the tag will be included in the preamble, just as with
12794 \begin_inset Flex Code
12797 \begin_layout Plain Layout
12804 What makes it special is the use of the
12805 \begin_inset Quotes eld
12809 \begin_inset Quotes erd
12813 \begin_inset Flex Code
12816 \begin_layout Plain Layout
12822 , which will be replaced, when LyX produces LaTeX output, with the translation
12823 of its argument into the document language.
12826 \begin_layout Standard
12828 \begin_inset Flex Code
12831 \begin_layout Plain Layout
12837 tag is more complex, since it is meant to provide support for multi-language
12838 documents and so offers an interface to the
12839 \begin_inset Flex Code
12842 \begin_layout Plain Layout
12849 Its contents will be added to the preamble once for each language that
12850 appears in the document.
12851 In this case, the argument to
12852 \begin_inset Flex Code
12855 \begin_layout Plain Layout
12861 will be replaced with its translation into the language in question; the
12863 \begin_inset Flex Code
12866 \begin_layout Plain Layout
12872 is replaced by the language name (as used by the babel package).
12875 \begin_layout Standard
12876 A German document that also included a French section would thus have the
12877 following in the preamble:
12880 \begin_layout LyX-Code
12889 claimname}{Affirmation}}
12897 claimname}{Behauptung}}
12901 claimname}{Behauptung}
12904 \begin_layout Standard
12906 \begin_inset Flex Code
12909 \begin_layout Plain Layout
12915 will then conspire to produce the correct text in the output.
12918 \begin_layout Standard
12919 One important point to note here is that the translations are provided by
12920 LyX itself, through the same mechanism it uses for internationalization
12921 of the user interface.
12922 This means, in effect, that
12923 \begin_inset Flex Code
12926 \begin_layout Plain Layout
12933 \begin_inset Flex Code
12936 \begin_layout Plain Layout
12942 are really only of use in layout files that are provided with LyX, since
12943 text entered in user-created layout files will not be seen by LyX's internation
12944 alization routines.
12945 That said, however, any layout created with the intention that it will
12946 be included with LyX should use these tags where appropriate.
12949 \begin_layout Subsection
12951 \begin_inset CommandInset label
12960 \begin_layout Standard
12961 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12962 define the floats (
12963 \begin_inset Flex MenuItem
12966 \begin_layout Plain Layout
12973 \begin_inset Flex MenuItem
12976 \begin_layout Plain Layout
12982 , \SpecialChar \ldots{}
12983 ) in the text class itself.
12984 Standard floats are included in the file
12985 \begin_inset Flex Code
12988 \begin_layout Plain Layout
12994 , so you may have to do no more than add
12997 \begin_layout LyX-Code
12998 Input stdfloats.inc
13001 \begin_layout Standard
13002 to your layout file.
13003 If you want to implement a text class that proposes some other float types
13004 (like the AGU class bundled with LyX), the information below will hopefully
13008 \begin_layout Description
13009 \begin_inset Flex Code
13012 \begin_layout Plain Layout
13019 \begin_inset Flex Code
13022 \begin_layout Plain Layout
13029 \begin_inset Quotes erd
13033 \begin_inset Quotes erd
13036 ] The file name extension of an auxiliary file for the list of figures (or
13038 LaTeX writes the captions to this file.
13041 \begin_layout Description
13042 \begin_inset Flex Code
13045 \begin_layout Plain Layout
13052 \begin_inset Flex Code
13055 \begin_layout Plain Layout
13062 \begin_inset Quotes erd
13066 \begin_inset Quotes erd
13069 ] The string that will be used in the menus and also for the caption.
13070 This is translated to the current language if babel is used.
13073 \begin_layout Description
13074 \begin_inset Flex Code
13077 \begin_layout Plain Layout
13083 These are used for XHTML output.
13085 \begin_inset CommandInset ref
13087 reference "sec:Tags-for-XHTML"
13094 \begin_layout Description
13095 \begin_inset Flex Code
13098 \begin_layout Plain Layout
13107 \begin_inset Flex Code
13110 \begin_layout Plain Layout
13119 \begin_inset Flex Code
13122 \begin_layout Plain Layout
13128 ] Indicates whether the float is already defined in the document class or
13129 if we instead need to load
13130 \begin_inset Flex Code
13133 \begin_layout Plain Layout
13139 and use what it provides to define it on-the-fly.
13141 \begin_inset Flex Code
13144 \begin_layout Plain Layout
13151 \begin_inset Flex Code
13154 \begin_layout Plain Layout
13161 It should be set to
13162 \begin_inset Flex Code
13165 \begin_layout Plain Layout
13171 if the float is already defined by the LaTeX document class.
13174 \begin_layout Description
13175 \begin_inset Flex Code
13178 \begin_layout Plain Layout
13185 \begin_inset Flex Code
13188 \begin_layout Plain Layout
13195 \begin_inset Quotes erd
13199 \begin_inset Quotes erd
13202 ] The command used to generate a list of floats of this type; the leading
13205 ' should be omitted.
13211 \begin_inset Flex Code
13214 \begin_layout Plain Layout
13220 is false, since there is no standard way to generate this command.
13222 \begin_inset Flex Code
13225 \begin_layout Plain Layout
13231 is true, since in that case there is a standard way to define the command.
13234 \begin_layout Description
13235 \begin_inset Flex Code
13238 \begin_layout Plain Layout
13245 \begin_inset Flex Code
13248 \begin_layout Plain Layout
13255 \begin_inset Quotes erd
13259 \begin_inset Quotes erd
13262 ] A title for a list of floats of this kind (list of figures, tables, or
13264 It is used for the screen label within LyX; it is passed to LaTeX for use
13265 as the title there; and it is used as the title in XHTML output.
13266 It will be translated to the document language.
13269 \begin_layout Description
13270 \begin_inset Flex Code
13273 \begin_layout Plain Layout
13280 \begin_inset Flex Code
13283 \begin_layout Plain Layout
13290 \begin_inset Quotes erd
13294 \begin_inset Quotes erd
13297 ] This (optional) argument determines whether floats of this class will
13298 be numbered within some sectional unit of the document.
13299 For example, if within is equal to
13300 \begin_inset Flex Code
13303 \begin_layout Plain Layout
13309 , the floats will be numbered within chapters.
13313 \begin_layout Description
13314 \begin_inset Flex Code
13317 \begin_layout Plain Layout
13324 \begin_inset Flex Code
13327 \begin_layout Plain Layout
13334 \begin_inset Quotes erd
13338 \begin_inset Quotes erd
13341 ] The default placement for the given class of floats.
13342 The string should be as in standard LaTeX:
13343 \begin_inset Flex Code
13346 \begin_layout Plain Layout
13353 \begin_inset Flex Code
13356 \begin_layout Plain Layout
13363 \begin_inset Flex Code
13366 \begin_layout Plain Layout
13373 \begin_inset Flex Code
13376 \begin_layout Plain Layout
13382 for top, bottom, page, and here, respectively.
13386 \begin_layout Plain Layout
13387 Note that the order of these letters in the string is irrelevant, like in
13393 On top of that there is a new type,
13394 \begin_inset Flex Code
13397 \begin_layout Plain Layout
13403 , which does not really correspond to a float, since it means: put it
13404 \begin_inset Quotes eld
13408 \begin_inset Quotes erd
13412 Note however that the
13413 \begin_inset Flex Code
13416 \begin_layout Plain Layout
13422 specifier is special and, because of implementation details, cannot be
13423 used in non-built in float types.
13424 If you do not understand what this means, just use
13425 \begin_inset Quotes eld
13429 \begin_inset Flex Code
13432 \begin_layout Plain Layout
13439 \begin_inset Quotes erd
13445 \begin_layout Description
13446 \begin_inset Flex Code
13449 \begin_layout Plain Layout
13456 \begin_inset Flex Code
13459 \begin_layout Plain Layout
13465 ] The prefix to use when creating labels referring to floats of this type.
13466 This allows the use of formatted references.
13467 Note that you can remove any
13468 \begin_inset Flex Code
13471 \begin_layout Plain Layout
13477 set by a copied style by using the special value
13478 \begin_inset Quotes eld
13482 \begin_inset Quotes erd
13485 , which must be all caps.
13488 \begin_layout Description
13489 \begin_inset Flex Code
13492 \begin_layout Plain Layout
13499 \begin_inset Flex Code
13502 \begin_layout Plain Layout
13509 \begin_inset Quotes erd
13513 \begin_inset Quotes erd
13516 ] The style used when defining the float using
13517 \begin_inset Flex Code
13520 \begin_layout Plain Layout
13531 \begin_layout Description
13532 \begin_inset Flex Code
13535 \begin_layout Plain Layout
13542 \begin_inset Flex Code
13545 \begin_layout Plain Layout
13552 \begin_inset Quotes erd
13556 \begin_inset Quotes erd
13560 \begin_inset Quotes eld
13564 \begin_inset Quotes erd
13567 of the new class of floats, like program or algorithm.
13568 After the appropriate
13569 \begin_inset Flex Code
13572 \begin_layout Plain Layout
13581 \begin_inset Flex Code
13584 \begin_layout Plain Layout
13593 \begin_inset Flex Code
13596 \begin_layout Plain Layout
13607 \begin_layout Description
13608 \begin_inset Flex Code
13611 \begin_layout Plain Layout
13618 \begin_inset Flex Code
13621 \begin_layout Plain Layout
13628 \begin_inset Flex Code
13631 \begin_layout Plain Layout
13639 ] Tells us whether this float is defined using the facilities provided by
13641 \begin_inset Flex Code
13644 \begin_layout Plain Layout
13650 , either by the class file or a package, or on-the-fly by LyX itself.
13653 \begin_layout Standard
13654 Note that defining a float with type
13655 \begin_inset Flex Code
13658 \begin_layout Plain Layout
13666 automatically defines the corresponding counter with name
13667 \begin_inset Flex Code
13670 \begin_layout Plain Layout
13681 \begin_layout Subsection
13682 Flex insets and InsetLayout
13683 \begin_inset CommandInset label
13685 name "sub:Flex-insets-and"
13692 \begin_layout Standard
13693 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13694 these are called Flex insets.
13698 \begin_layout Standard
13699 Flex insets come in three different kinds:
13702 \begin_layout Itemize
13704 \begin_inset Flex Code
13707 \begin_layout Plain Layout
13713 ): These define semantic markup corresponding to such LaTeX commands as
13715 \begin_inset Flex Code
13718 \begin_layout Plain Layout
13727 \begin_inset Flex Code
13730 \begin_layout Plain Layout
13741 \begin_layout Itemize
13743 \begin_inset Flex Code
13746 \begin_layout Plain Layout
13752 ): These can be used to define custom collapsible insets, similar to TeX
13753 code, footnote, and the like.
13754 An obvious example is an endnote inset, which is defined in the
13755 \begin_inset Flex Code
13758 \begin_layout Plain Layout
13767 \begin_layout Itemize
13769 \begin_inset Flex Code
13772 \begin_layout Plain Layout
13778 ): For use with DocBook classes.
13781 \begin_layout Standard
13782 Flex insets are defined using the
13783 \begin_inset Flex Code
13786 \begin_layout Plain Layout
13792 tag, which shall be explained in a moment.
13795 \begin_layout Standard
13797 \begin_inset Flex Code
13800 \begin_layout Plain Layout
13806 tag also serves another function: It can be used to customize the general
13807 layout of many different types of insets.
13809 \begin_inset Flex Code
13812 \begin_layout Plain Layout
13818 can be used to customize the layout parameters for footnotes, marginal
13819 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13820 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13821 define Flex insets.
13824 \begin_layout Standard
13826 \begin_inset Flex Code
13829 \begin_layout Plain Layout
13835 definition must begin with a line of the form:
13838 \begin_layout LyX-Code
13842 \begin_layout Standard
13844 \begin_inset Flex Code
13847 \begin_layout Plain Layout
13853 indicates the inset whose layout is being defined, and here there are two
13857 \begin_layout Enumerate
13858 The layout for a pre-existing inset is being modified.
13859 In this case, can be
13860 \begin_inset Flex Code
13863 \begin_layout Plain Layout
13869 any one of the following:
13870 \begin_inset Flex Code
13873 \begin_layout Plain Layout
13880 \begin_inset Flex Code
13883 \begin_layout Plain Layout
13890 \begin_inset Flex Code
13893 \begin_layout Plain Layout
13900 \begin_inset Flex Code
13903 \begin_layout Plain Layout
13910 \begin_inset Flex Code
13913 \begin_layout Plain Layout
13920 \begin_inset Flex Code
13923 \begin_layout Plain Layout
13930 \begin_inset Flex Code
13933 \begin_layout Plain Layout
13940 \begin_inset Flex Code
13943 \begin_layout Plain Layout
13950 \begin_inset Flex Code
13953 \begin_layout Plain Layout
13960 \begin_inset Flex Code
13963 \begin_layout Plain Layout
13970 \begin_inset Flex Code
13973 \begin_layout Plain Layout
13980 \begin_inset Flex Code
13983 \begin_layout Plain Layout
13990 \begin_inset Flex Code
13993 \begin_layout Plain Layout
14000 \begin_inset Flex Code
14003 \begin_layout Plain Layout
14010 \begin_inset Flex Code
14013 \begin_layout Plain Layout
14020 \begin_inset Flex Code
14023 \begin_layout Plain Layout
14030 \begin_inset Flex Code
14033 \begin_layout Plain Layout
14040 \begin_inset Flex Code
14043 \begin_layout Plain Layout
14050 \begin_inset Flex Code
14053 \begin_layout Plain Layout
14060 \begin_inset Flex Code
14063 \begin_layout Plain Layout
14072 \begin_layout Enumerate
14073 The layout for a Flex inset is being defined.
14075 \begin_inset Flex Code
14078 \begin_layout Plain Layout
14084 must be of the form
14085 \begin_inset Quotes eld
14089 \begin_inset Flex Code
14092 \begin_layout Plain Layout
14099 \begin_inset Quotes erd
14103 \begin_inset Flex Code
14106 \begin_layout Plain Layout
14112 may be be any valid identifier not used by a pre-existing Flex inset.
14113 The identifier may include spaces, but in that case the whole thing must
14114 be wrapped in quotes.
14115 Note that the definition of a flex inset
14120 \begin_inset Flex Code
14123 \begin_layout Plain Layout
14129 entry, declaring which type of inset it defines.
14132 \begin_layout Standard
14134 \begin_inset Flex Code
14137 \begin_layout Plain Layout
14143 definition can contain the following entries:
14146 \begin_layout Description
14147 \begin_inset Flex Code
14150 \begin_layout Plain Layout
14156 The color for the inset's background.
14157 The valid colors are defined in
14158 \begin_inset Flex Code
14161 \begin_layout Plain Layout
14170 \begin_layout Description
14171 \begin_inset Flex Code
14174 \begin_layout Plain Layout
14181 \begin_inset Flex Code
14184 \begin_layout Plain Layout
14193 \begin_inset Flex Code
14196 \begin_layout Plain Layout
14202 ] Whether to use the content of the inset as the label, when the inset is
14207 \begin_layout Description
14208 \begin_inset Flex Code
14211 \begin_layout Plain Layout
14217 As with paragraph styles (see page
14218 \begin_inset CommandInset ref
14220 reference "des:CopyStyle"
14227 \begin_layout Description
14228 \begin_inset Flex Code
14231 \begin_layout Plain Layout
14238 \begin_inset Flex Code
14241 \begin_layout Plain Layout
14250 \begin_inset Flex Code
14253 \begin_layout Plain Layout
14259 ] Indicates whether the user may employ the Paragraph Settings dialog to
14260 customize the paragraph.
14263 \begin_layout Description
14264 \begin_inset Flex Code
14267 \begin_layout Plain Layout
14274 \begin_inset Flex Code
14277 \begin_layout Plain Layout
14284 \begin_inset Flex Code
14287 \begin_layout Plain Layout
14294 \begin_inset Flex Code
14297 \begin_layout Plain Layout
14303 , describing the rendering style used for the inset's frame and buttons.
14304 Footnotes generally use
14305 \begin_inset Flex Code
14308 \begin_layout Plain Layout
14314 , ERT insets generally
14315 \begin_inset Flex Code
14318 \begin_layout Plain Layout
14324 , and character styles
14325 \begin_inset Flex Code
14328 \begin_layout Plain Layout
14337 \begin_layout Description
14338 \begin_inset Flex Code
14341 \begin_layout Plain Layout
14348 \begin_inset Flex Code
14351 \begin_layout Plain Layout
14358 \begin_inset Flex Code
14361 \begin_layout Plain Layout
14370 \begin_inset Flex Code
14373 \begin_layout Plain Layout
14380 \begin_inset Flex Code
14383 \begin_layout Plain Layout
14390 Indicates whether the environment will stand on its own in LaTeX output
14391 or will appear inline with the surrounding text.
14392 If set to false, it is supposed that the LaTeX environment ignores white
14393 space (including one newline character) after the
14394 \begin_inset Flex Code
14397 \begin_layout Plain Layout
14410 \begin_inset Flex Code
14413 \begin_layout Plain Layout
14429 \begin_layout Description
14430 \begin_inset Flex Code
14433 \begin_layout Plain Layout
14439 Required at the end of the InsetLayout declarations.
14442 \begin_layout Description
14443 \begin_inset Flex Code
14446 \begin_layout Plain Layout
14452 The font used for both the text body
14458 \begin_inset space ~
14462 \begin_inset CommandInset ref
14464 reference "sub:Font-description"
14469 Note that defining this font automatically defines the
14470 \begin_inset Flex Code
14473 \begin_layout Plain Layout
14479 to the same value, so define this first and define
14480 \begin_inset Flex Code
14483 \begin_layout Plain Layout
14489 later if you want them to be different.
14492 \begin_layout Description
14493 \begin_inset Flex Code
14496 \begin_layout Plain Layout
14503 \begin_inset Quotes eld
14507 \begin_inset Quotes erd
14510 language, leading to Left-to-Right (latin) output, e.
14511 \begin_inset space \thinspace{}
14515 \begin_inset space \space{}
14518 in TeX code or URL.
14522 \begin_layout Description
14523 \begin_inset Flex Code
14526 \begin_layout Plain Layout
14533 \begin_inset Flex Code
14536 \begin_layout Plain Layout
14545 \begin_inset Flex Code
14548 \begin_layout Plain Layout
14554 ] Indicates whether the
14555 \begin_inset Flex Code
14558 \begin_layout Plain Layout
14564 should be used or, instead, the user can change the paragraph style used
14569 \begin_layout Description
14570 \begin_inset Flex Code
14573 \begin_layout Plain Layout
14579 As with paragraph styles (see page
14580 \begin_inset CommandInset ref
14581 LatexCommand pageref
14582 reference "des:FreeSpacing"
14590 \begin_layout Description
14591 \begin_inset Flex Code
14594 \begin_layout Plain Layout
14600 These tags control XHTML output.
14602 \begin_inset CommandInset ref
14604 reference "sec:Tags-for-XHTML"
14611 \begin_layout Description
14612 \begin_inset Flex Code
14615 \begin_layout Plain Layout
14622 \begin_inset Flex Code
14625 \begin_layout Plain Layout
14634 \begin_inset Flex Code
14637 \begin_layout Plain Layout
14643 ] Whether to include the contents of this inset in the strings generated
14644 for the `Outline' pane.
14645 One would not, for example, want the content of a footnote in a section
14646 header to be included in the TOC displayed in the outline, but one would
14647 normally want the content of a character style displayed.
14648 Default is false: not to include.
14651 \begin_layout Description
14652 \begin_inset Flex Code
14655 \begin_layout Plain Layout
14661 As with paragraph styles (see page
14662 \begin_inset CommandInset ref
14663 LatexCommand pageref
14664 reference "des:KeepEmpty"
14672 \begin_layout Description
14673 \begin_inset Flex Code
14676 \begin_layout Plain Layout
14682 The font used for the label.
14684 \begin_inset space ~
14688 \begin_inset CommandInset ref
14690 reference "sub:Font-description"
14695 Note that this definition can never appear before
14696 \begin_inset Flex Code
14699 \begin_layout Plain Layout
14705 , lest it be ineffective.
14708 \begin_layout Description
14709 \begin_inset Flex Code
14712 \begin_layout Plain Layout
14718 What will be displayed on the button or elsewhere as the inset label.
14720 \begin_inset Flex Code
14723 \begin_layout Plain Layout
14730 \begin_inset Flex Code
14733 \begin_layout Plain Layout
14739 ) modify this label on the fly.
14742 \begin_layout Description
14743 \begin_inset Flex Code
14746 \begin_layout Plain Layout
14752 The name of the corresponding LaTeX stuff.
14753 Either the environment or command name.
14756 \begin_layout Description
14757 \begin_inset Flex Code
14760 \begin_layout Plain Layout
14766 The optional parameter for the corresponding
14767 \begin_inset Flex Code
14770 \begin_layout Plain Layout
14776 stuff, including possible bracket pairs like
14777 \begin_inset Flex Code
14780 \begin_layout Plain Layout
14787 This parameter cannot be changed from within LyX.
14790 \begin_layout Description
14791 \begin_inset Flex Code
14794 \begin_layout Plain Layout
14800 As with paragraph styles (see page
14801 \begin_inset CommandInset ref
14802 LatexCommand pageref
14803 reference "des:LatexType"
14810 \begin_layout Description
14811 \begin_inset Flex Code
14814 \begin_layout Plain Layout
14821 \begin_inset Flex Code
14824 \begin_layout Plain Layout
14831 \begin_inset Flex Code
14834 \begin_layout Plain Layout
14841 \begin_inset Flex Code
14844 \begin_layout Plain Layout
14851 \begin_inset Flex Code
14854 \begin_layout Plain Layout
14860 (indicating a dummy definition ending definitions of charstyles, etc).
14861 This entry is required in and is only meaningful for Flex insets.
14862 Among other things, it determines on which menu this inset will appear.
14864 \begin_inset Flex Code
14867 \begin_layout Plain Layout
14874 \begin_inset Flex Code
14877 \begin_layout Plain Layout
14884 \begin_inset Flex Code
14887 \begin_layout Plain Layout
14895 \begin_inset Flex Code
14898 \begin_layout Plain Layout
14904 can be set to true for charstyle insets, if you wish, by setting it
14909 \begin_inset Flex Code
14912 \begin_layout Plain Layout
14921 \begin_layout Description
14922 \begin_inset Flex Code
14925 \begin_layout Plain Layout
14932 \begin_inset Flex Code
14935 \begin_layout Plain Layout
14944 \begin_inset Flex Code
14947 \begin_layout Plain Layout
14953 ] Whether multiple paragraphs are permitted in this inset.
14955 \begin_inset Flex Code
14958 \begin_layout Plain Layout
14964 to the same value and
14965 \begin_inset Flex Code
14968 \begin_layout Plain Layout
14974 to the opposite value.
14975 These can be reset to other values, if they are used
14980 \begin_inset Flex Code
14983 \begin_layout Plain Layout
14993 \begin_layout Description
14994 \begin_inset Flex Code
14997 \begin_layout Plain Layout
15004 \begin_inset Flex Code
15007 \begin_layout Plain Layout
15016 \begin_inset Flex Code
15019 \begin_layout Plain Layout
15025 ] Whether fragile commands in this inset should be
15026 \begin_inset Flex Code
15029 \begin_layout Plain Layout
15042 whether the command should itself be protected.) Default is false.
15045 \begin_layout Description
15046 \begin_inset Flex Code
15049 \begin_layout Plain Layout
15056 \begin_inset Flex Code
15059 \begin_layout Plain Layout
15068 \begin_inset Flex Code
15071 \begin_layout Plain Layout
15077 ] As with paragraph styles (see page
15078 \begin_inset CommandInset ref
15079 LatexCommand pageref
15080 reference "des:ParbreakIsNewline"
15088 \begin_layout Description
15089 \begin_inset Flex Code
15092 \begin_layout Plain Layout
15099 \begin_inset Flex Code
15102 \begin_layout Plain Layout
15111 \begin_inset Flex Code
15114 \begin_layout Plain Layout
15120 ] As with paragraph styles (see page
15121 \begin_inset CommandInset ref
15122 LatexCommand pageref
15123 reference "des:PassThru"
15131 \begin_layout Description
15132 \begin_inset Flex Code
15135 \begin_layout Plain Layout
15141 As with paragraph styles (see page
15142 \begin_inset CommandInset ref
15143 LatexCommand pageref
15144 reference "des:Preamble"
15151 \begin_layout Description
15152 \begin_inset Flex Code
15155 \begin_layout Plain Layout
15162 \begin_inset Flex Code
15165 \begin_layout Plain Layout
15171 ] The prefix to use when creating labels referring to insets of this type.
15172 This allows the use of formatted references.
15175 \begin_layout Description
15176 \begin_inset Flex Code
15179 \begin_layout Plain Layout
15186 \begin_inset Flex Code
15189 \begin_layout Plain Layout
15195 ] As with paragraph styles (see page
15196 \begin_inset CommandInset ref
15197 LatexCommand pageref
15198 reference "des:Requires"
15205 \begin_layout Description
15206 \begin_inset Flex Code
15209 \begin_layout Plain Layout
15216 \begin_inset Flex Code
15219 \begin_layout Plain Layout
15226 \begin_inset Flex Code
15229 \begin_layout Plain Layout
15237 ] Whether this inset should use the font of its surrounding environment
15239 Default is true: uses its own.
15242 \begin_layout Description
15243 \begin_inset Flex Code
15246 \begin_layout Plain Layout
15253 \begin_inset Flex Code
15256 \begin_layout Plain Layout
15263 \begin_inset Flex Code
15266 \begin_layout Plain Layout
15274 ] Spellcheck the contents of this inset.
15278 \begin_layout Subsection
15280 \begin_inset CommandInset label
15282 name "sub:Counters"
15289 \begin_layout Standard
15290 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15292 \begin_inset Flex MenuItem
15295 \begin_layout Plain Layout
15302 \begin_inset Flex MenuItem
15305 \begin_layout Plain Layout
15311 , \SpecialChar \ldots{}
15312 ) in the text class itself.
15313 The standard counters are defined in the file
15314 \begin_inset Flex Code
15317 \begin_layout Plain Layout
15323 , so you may have to do no more than add
15326 \begin_layout LyX-Code
15327 Input stdcounters.inc
15330 \begin_layout Standard
15331 to your layout file to get them to work.
15332 But if you want to define custom counters, then you can do so.
15333 The counter declaration must begin with:
15336 \begin_layout LyX-Code
15337 Counter CounterName
15340 \begin_layout Standard
15342 \begin_inset Flex Code
15345 \begin_layout Plain Layout
15351 ' is replaced by the name of the counter.
15352 And it must end with
15353 \begin_inset Quotes eld
15357 \begin_inset Flex Code
15360 \begin_layout Plain Layout
15367 \begin_inset Quotes erd
15371 The following parameters can also be used:
15374 \begin_layout Description
15375 \begin_inset Flex Code
15378 \begin_layout Plain Layout
15385 \begin_inset Flex Code
15388 \begin_layout Plain Layout
15395 \begin_inset Quotes erd
15399 \begin_inset Quotes erd
15402 ] When defined, this string defines how the counter is displayed.
15403 Setting this value sets
15404 \begin_inset Flex Code
15407 \begin_layout Plain Layout
15408 LabelStringAppendix
15414 The following special constructs can be used in the string:
15418 \begin_layout Itemize
15419 \begin_inset Flex Code
15422 \begin_layout Plain Layout
15430 will be replaced by the expansion of the
15431 \begin_inset Flex Code
15434 \begin_layout Plain Layout
15441 \begin_inset Flex Code
15444 \begin_layout Plain Layout
15445 LabelStringAppendix
15451 \begin_inset Flex Code
15454 \begin_layout Plain Layout
15464 \begin_layout Itemize
15465 counter values can be expressed using LaTeX-like macros
15466 \begin_inset Flex Code
15469 \begin_layout Plain Layout
15486 \begin_inset Flex Code
15489 \begin_layout Plain Layout
15501 \begin_layout Plain Layout
15511 Actually, the situation is a bit more complicated: any
15530 other than those described below will produce arabic numerals.
15531 It would not be surprising to see this change in the future.
15537 \begin_inset Flex Code
15540 \begin_layout Plain Layout
15546 : 1, 2, 3,\SpecialChar \ldots{}
15548 \begin_inset Flex Code
15551 \begin_layout Plain Layout
15557 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15559 \begin_inset Flex Code
15562 \begin_layout Plain Layout
15568 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15570 \begin_inset Flex Code
15573 \begin_layout Plain Layout
15579 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15581 \begin_inset Flex Code
15584 \begin_layout Plain Layout
15590 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15592 \begin_inset Flex Code
15595 \begin_layout Plain Layout
15601 for hebrew numerals.
15605 \begin_layout Standard
15606 If LabelString is not defined, a default value is constructed as follows:
15607 if the counter has a master counter
15608 \begin_inset Flex Code
15611 \begin_layout Plain Layout
15618 \begin_inset Flex Code
15621 \begin_layout Plain Layout
15628 \begin_inset Flex Code
15631 \begin_layout Plain Layout
15641 is used; otherwise the string
15642 \begin_inset Flex Code
15645 \begin_layout Plain Layout
15656 \begin_layout Description
15657 \begin_inset Flex Code
15660 \begin_layout Plain Layout
15661 LabelStringAppendix
15667 \begin_inset Flex Code
15670 \begin_layout Plain Layout
15677 \begin_inset Quotes erd
15681 \begin_inset Quotes erd
15685 \begin_inset Flex Code
15688 \begin_layout Plain Layout
15694 , but for use in the Appendix.
15697 \begin_layout Description
15698 \begin_inset Flex Code
15701 \begin_layout Plain Layout
15708 \begin_inset Flex Code
15711 \begin_layout Plain Layout
15718 \begin_inset Quotes erd
15722 \begin_inset Quotes erd
15725 ] A format for use with formatted references to this counter.
15726 For example, one might want to have references to section numbers appear
15728 \begin_inset Quotes eld
15732 \begin_inset Quotes erd
15736 The string should contain
15737 \begin_inset Quotes eld
15741 \begin_inset Quotes erd
15745 This will be replaced by the counter number itself.
15746 So, for sections, it would be: Section ##.
15749 \begin_layout Description
15750 \begin_inset Flex Code
15753 \begin_layout Plain Layout
15760 \begin_inset Flex Code
15763 \begin_layout Plain Layout
15770 \begin_inset Quotes erd
15774 \begin_inset Quotes erd
15777 ] If this is set to the name of another counter, the present counter will
15778 be reset every time the other one is increased.
15780 \begin_inset Flex Code
15783 \begin_layout Plain Layout
15790 \begin_inset Flex Code
15793 \begin_layout Plain Layout
15802 \begin_layout Subsection
15804 \begin_inset CommandInset label
15806 name "sub:Font-description"
15813 \begin_layout Standard
15814 A font description looks like this:
15817 \begin_layout LyX-Code
15827 \begin_layout LyX-Code
15831 \begin_layout LyX-Code
15835 \begin_layout Standard
15836 The following commands are available:
15839 \begin_layout Description
15840 \begin_inset Flex Code
15843 \begin_layout Plain Layout
15850 \begin_inset Flex Code
15853 \begin_layout Plain Layout
15862 \begin_inset Flex Code
15865 \begin_layout Plain Layout
15872 \begin_inset Flex Code
15875 \begin_layout Plain Layout
15882 \begin_inset Flex Code
15885 \begin_layout Plain Layout
15892 \begin_inset Flex Code
15895 \begin_layout Plain Layout
15902 \begin_inset Flex Code
15905 \begin_layout Plain Layout
15912 \begin_inset Flex Code
15915 \begin_layout Plain Layout
15922 \begin_inset Flex Code
15925 \begin_layout Plain Layout
15932 \begin_inset Flex Code
15935 \begin_layout Plain Layout
15944 \begin_layout Description
15945 \begin_inset Flex Code
15948 \begin_layout Plain Layout
15955 \begin_inset Flex Code
15958 \begin_layout Plain Layout
15967 \begin_inset Flex Code
15970 \begin_layout Plain Layout
15977 \begin_inset Flex Code
15980 \begin_layout Plain Layout
15989 \begin_layout Description
15990 \begin_inset Flex Code
15993 \begin_layout Plain Layout
16000 \begin_inset Flex Code
16003 \begin_layout Plain Layout
16009 ] Valid arguments are:
16010 \begin_inset Flex Code
16013 \begin_layout Plain Layout
16020 \begin_inset Flex Code
16023 \begin_layout Plain Layout
16030 \begin_inset Flex Code
16033 \begin_layout Plain Layout
16040 \begin_inset Flex Code
16043 \begin_layout Plain Layout
16050 \begin_inset Flex Code
16053 \begin_layout Plain Layout
16060 \begin_inset Flex Code
16063 \begin_layout Plain Layout
16070 Each of these turns on or off the corresponding attribute.
16072 \begin_inset Flex Code
16075 \begin_layout Plain Layout
16081 turns on emphasis, and
16082 \begin_inset Flex Code
16085 \begin_layout Plain Layout
16093 \begin_inset Newline newline
16096 If the latter seems puzzling, remember that the font settings for the present
16097 context are generally inherited from the surrounding context.
16099 \begin_inset Flex Code
16102 \begin_layout Plain Layout
16108 would turn off the emphasis that was anyway in effect, say, in a theorem
16112 \begin_layout Description
16113 \begin_inset Flex Code
16116 \begin_layout Plain Layout
16123 \begin_inset Flex Code
16126 \begin_layout Plain Layout
16135 \begin_inset Flex Code
16138 \begin_layout Plain Layout
16147 \begin_layout Description
16148 \begin_inset Flex Code
16151 \begin_layout Plain Layout
16158 \begin_inset Flex Code
16161 \begin_layout Plain Layout
16170 \begin_inset Flex Code
16173 \begin_layout Plain Layout
16180 \begin_inset Flex Code
16183 \begin_layout Plain Layout
16190 \begin_inset Flex Code
16193 \begin_layout Plain Layout
16202 \begin_layout Description
16203 \begin_inset Flex Code
16206 \begin_layout Plain Layout
16213 \begin_inset Flex Code
16216 \begin_layout Plain Layout
16223 \begin_inset Flex Code
16226 \begin_layout Plain Layout
16233 \begin_inset Flex Code
16236 \begin_layout Plain Layout
16245 \begin_inset Flex Code
16248 \begin_layout Plain Layout
16255 \begin_inset Flex Code
16258 \begin_layout Plain Layout
16265 \begin_inset Flex Code
16268 \begin_layout Plain Layout
16275 \begin_inset Flex Code
16278 \begin_layout Plain Layout
16285 \begin_inset Flex Code
16288 \begin_layout Plain Layout
16297 \begin_layout Subsection
16298 \begin_inset CommandInset label
16300 name "sub:Citation-format-description"
16304 Citation format description
16307 \begin_layout Standard
16309 \begin_inset Flex Code
16312 \begin_layout Plain Layout
16318 blocks are used to describe how bibliographic information should be displayed,
16319 both within LyX itself (in the citation dialog and in tooltips, for example)
16320 and in XHTML output.
16321 Such a block might look like this:
16324 \begin_layout LyX-Code
16328 \begin_layout LyX-Code
16332 \begin_layout LyX-Code
16336 \begin_layout LyX-Code
16340 \begin_layout Standard
16341 The individual lines define how the bibliographic information associated
16342 with an article or book, respectively, is to be displayed, and such a definitio
16343 n can be given for any `entry type' that might be present in a BibTeX file.
16344 LyX defines a default format in the source code that will be used if no
16345 specific definition has been given.
16346 LyX predefines several formats in the file
16347 \begin_inset Flex Code
16350 \begin_layout Plain Layout
16356 , which is included in most of LyX's document classes.
16359 \begin_layout Standard
16360 The definitions use a simple language that allows BibTeX keys to be replaced
16362 Keys should be enclosed in
16363 \begin_inset Flex Code
16366 \begin_layout Plain Layout
16373 \begin_inset Flex Code
16376 \begin_layout Plain Layout
16383 So a simple definition might look like this:
16386 \begin_layout LyX-Code
16388 \begin_inset Quotes eld
16392 \begin_inset Quotes erd
16398 \begin_layout Standard
16399 This would print the author, followed by a comma, followed by the title,
16400 in quotes, followed by a period.
16403 \begin_layout Standard
16404 Of course, sometimes you may want to print a key only if it exists.
16405 This can be done by using a conditional construction, such as:
16406 \begin_inset Flex Code
16409 \begin_layout Plain Layout
16411 \begin_inset space ~
16421 \begin_inset Flex Code
16424 \begin_layout Plain Layout
16430 key exists, then print
16431 \begin_inset Quotes eld
16435 \begin_inset space ~
16439 \begin_inset Quotes erd
16442 followed by the volume key.
16443 It is also possible to have an else clause in the conditional, such as:
16445 \begin_inset Flex Code
16448 \begin_layout Plain Layout
16449 {%author%[[%author%]][[%editor%, ed.]]}
16456 \begin_inset Flex Code
16459 \begin_layout Plain Layout
16465 key is printed if it exists; otherwise, the editor key is printed, followed
16467 \begin_inset Quotes eld
16471 \begin_inset space ~
16475 \begin_inset Quotes erd
16478 Note that the key is again enclosed in
16479 \begin_inset Flex Code
16482 \begin_layout Plain Layout
16488 signs; the entire conditional is enclosed in braces; and the if and else
16489 clauses are enclosed in double brackets,
16490 \begin_inset Quotes eld
16494 \begin_inset Flex Code
16497 \begin_layout Plain Layout
16504 \begin_inset Quotes eld
16508 \begin_inset Quotes eld
16512 \begin_inset Flex Code
16515 \begin_layout Plain Layout
16522 \begin_inset Quotes erd
16526 There must be no space between any of these.
16529 \begin_layout Standard
16530 There is one other piece of syntax available in definitions, which looks
16532 \begin_inset Flex Code
16535 \begin_layout Plain Layout
16542 This defines a piece of formatting information that is to be used when
16544 \begin_inset Quotes eld
16548 \begin_inset Quotes erd
16552 Obviously, we do not want to output HTML tags when writing plain text,
16553 so they should be wrapped in
16554 \begin_inset Quotes eld
16558 \begin_inset Quotes erd
16562 \begin_inset Quotes eld
16566 \begin_inset Quotes erd
16572 \begin_layout Standard
16573 Two special sorts of definitions are also possible in a
16574 \begin_inset Flex Code
16577 \begin_layout Plain Layout
16584 An example of the first would be:
16587 \begin_layout LyX-Code
16589 \begin_inset Quotes eld
16593 \begin_inset Quotes erd
16599 \begin_layout Standard
16600 This is an abbreviation, or macro, and it can be used by treating it as
16602 \begin_inset Flex Code
16605 \begin_layout Plain Layout
16613 \begin_inset Flex Code
16616 \begin_layout Plain Layout
16622 exactly as it would treat its definition.
16623 So, let us issue the obvious
16631 \begin_layout LyX-Code
16635 \begin_layout Standard
16636 or anything like it.
16637 LyX shouldn't go into an infinite loop, but it may go into a long one before
16641 \begin_layout Standard
16642 The second sort of special definition might look like this:
16645 \begin_layout LyX-Code
16649 \begin_layout Standard
16650 This defines a translatable piece of text, which allows relevant parts of
16651 the bibliography to be translated.
16652 It can be included in a definition by treating it as a key:
16653 \begin_inset Flex Code
16656 \begin_layout Plain Layout
16663 Several of these are predefined in
16664 \begin_inset Flex Code
16667 \begin_layout Plain Layout
16674 Note that these are not macros, in the sense just defined.
16675 They will not be expanded.
16678 \begin_layout Standard
16679 So here then is an example that use all these features:
16682 \begin_layout LyX-Code
16683 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16686 \begin_layout Standard
16687 This defines a macro that prints the author, followed by a comma, if the
16689 \begin_inset Flex Code
16692 \begin_layout Plain Layout
16698 key is defined, or else prints the name of the editor, followed by the
16700 \begin_inset Flex Code
16703 \begin_layout Plain Layout
16709 or its translation (it is by default
16710 \begin_inset Quotes eld
16714 \begin_inset Quotes erd
16718 \begin_inset Flex Code
16721 \begin_layout Plain Layout
16728 Note that this is in fact defined in
16729 \begin_inset Flex Code
16732 \begin_layout Plain Layout
16738 , so you can use it in your own definitions, or re-definitions, if you load
16742 \begin_layout Section
16743 \begin_inset CommandInset label
16745 name "sec:Tags-for-XHTML"
16749 Tags for XHTML output
16752 \begin_layout Standard
16753 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16754 by layout information.
16755 In general, LyX provides sensible defaults and, as mentioned earlier, it
16756 will even construct default CSS style rules from the other layout tags.
16757 For example, LyX will attempt to use the information provided in the
16758 \begin_inset Flex Code
16761 \begin_layout Plain Layout
16767 declaration for the Chapter style to write CSS that will appropriately
16768 format chapter headings.
16771 \begin_layout Standard
16772 In many cases, then, you may not have to do anything at all to get acceptable
16773 XHTML output for your own environments, custom insets, and so forth.
16774 But in some cases you will, and so LyX provides a number of layout tags
16775 that can be used to customize the XHTML and CSS that are generated.
16778 \begin_layout Standard
16779 Note that there are two tags,
16780 \begin_inset Flex Code
16783 \begin_layout Plain Layout
16790 \begin_inset Flex Code
16793 \begin_layout Plain Layout
16799 that may appear outside style and inset declarations.
16801 \begin_inset CommandInset ref
16803 reference "sub:General-text-class"
16807 for details on these.
16810 \begin_layout Subsection
16811 \begin_inset CommandInset label
16813 name "sub:Paragraph-Style-XHTML"
16820 \begin_layout Standard
16821 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16822 dealing with a normal paragraph, a command, or an environment, where this
16823 is itself determined by the contents of the corresponding
16824 \begin_inset Flex Code
16827 \begin_layout Plain Layout
16837 \begin_layout Standard
16838 For a command or normal paragraph, the output XHTML has the following form:
16841 \begin_layout LyX-Code
16843 \begin_inset Quotes erd
16847 \begin_inset Quotes erd
16853 \begin_layout LyX-Code
16855 \begin_inset Quotes erd
16859 \begin_inset Quotes erd
16865 \begin_layout LyX-Code
16866 Contents of the paragraph.
16869 \begin_layout LyX-Code
16873 \begin_layout Standard
16874 The label tags are of course omitted if the paragraph does not have a label.
16877 \begin_layout Standard
16878 For an environment that is not some sort of list, the XHTML takes this form:
16881 \begin_layout LyX-Code
16883 \begin_inset Quotes erd
16887 \begin_inset Quotes erd
16893 \begin_layout LyX-Code
16895 \begin_inset Quotes erd
16899 \begin_inset Quotes erd
16903 \begin_inset Quotes erd
16907 \begin_inset Quotes erd
16910 >Environment Label</labeltag>First paragraph.</itemtag>
16913 \begin_layout LyX-Code
16914 <itemtag>Second paragraph.</itemtag>
16917 \begin_layout LyX-Code
16921 \begin_layout Standard
16922 Note that the label is output only for the first paragraph, as it should
16923 be for a theorem, for example.
16927 \begin_layout Standard
16928 For a list, we have one of these forms:
16931 \begin_layout LyX-Code
16933 \begin_inset Quotes erd
16937 \begin_inset Quotes erd
16943 \begin_layout LyX-Code
16945 \begin_inset Quotes erd
16949 \begin_inset Quotes erd
16953 \begin_inset Quotes erd
16957 \begin_inset Quotes erd
16960 >List Label</labeltag>First item.</itemtag>
16963 \begin_layout LyX-Code
16965 \begin_inset Quotes erd
16969 \begin_inset Quotes erd
16973 \begin_inset Quotes erd
16977 \begin_inset Quotes erd
16980 >List Label</labeltag>Second item.</itemtag>
16983 \begin_layout LyX-Code
16987 \begin_layout LyX-Code
16991 \begin_layout LyX-Code
16993 \begin_inset Quotes erd
16997 \begin_inset Quotes erd
17003 \begin_layout LyX-Code
17005 \begin_inset Quotes erd
17009 \begin_inset Quotes erd
17012 >List Label</labeltag><itemtag attr=
17013 \begin_inset Quotes erd
17017 \begin_inset Quotes erd
17020 >First item.</itemtag>
17023 \begin_layout LyX-Code
17025 \begin_inset Quotes erd
17029 \begin_inset Quotes erd
17032 >List Label</labeltag><itemtag attr=
17033 \begin_inset Quotes erd
17037 \begin_inset Quotes erd
17040 >Second item.</itemtag>
17043 \begin_layout LyX-Code
17047 \begin_layout Standard
17048 Note the different orders of
17049 \begin_inset Flex Code
17052 \begin_layout Plain Layout
17059 \begin_inset Flex Code
17062 \begin_layout Plain Layout
17069 Which order we get depends upon the setting of
17070 \begin_inset Flex Code
17073 \begin_layout Plain Layout
17080 \begin_inset Flex Code
17083 \begin_layout Plain Layout
17089 is false (the default), you get the first of these, with the label within
17090 the item; if true, you get the second, with the label outside the item.
17093 \begin_layout Standard
17094 The specific tags and attributes output for each paragraph type can be controlle
17095 d by means of the layout tags we are about to describe.
17096 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17097 so you often may not need to do very much to get good XHTML output.
17098 Think of the available tags as there so you can tweak things to your liking.
17101 \begin_layout Description
17102 \begin_inset Flex Code
17105 \begin_layout Plain Layout
17112 \begin_inset Flex Code
17115 \begin_layout Plain Layout
17121 ] Specifies attribute information to be output with the main tag.
17123 \begin_inset Quotes eld
17127 \begin_inset Flex Code
17130 \begin_layout Plain Layout
17137 \begin_inset Quotes erd
17141 By default, LyX will output
17142 \begin_inset Quotes eld
17146 \begin_inset Flex Code
17149 \begin_layout Plain Layout
17156 \begin_inset Quotes erd
17160 \begin_inset Flex Code
17163 \begin_layout Plain Layout
17169 is the LyX name of the layout, made lowercase, for example: chapter.
17174 contain any style information.
17176 \begin_inset Flex Code
17179 \begin_layout Plain Layout
17188 \begin_layout Description
17189 \begin_inset Flex Code
17192 \begin_layout Plain Layout
17199 \begin_inset Flex Code
17202 \begin_layout Plain Layout
17212 ] Whether to output the default CSS information LyX generates for this layout,
17213 even if additional information is explicitly provided via
17214 \begin_inset Flex Code
17217 \begin_layout Plain Layout
17225 \begin_inset Flex Code
17228 \begin_layout Plain Layout
17234 allows you to alter or augment the generated CSS, rather than to override
17237 \begin_inset Flex Code
17240 \begin_layout Plain Layout
17249 \begin_layout Description
17250 \begin_inset Flex Code
17253 \begin_layout Plain Layout
17260 \begin_inset Flex Code
17263 \begin_layout Plain Layout
17269 ] The tag to be used for individual paragraphs of environments, replacing
17271 \begin_inset Flex Code
17274 \begin_layout Plain Layout
17280 in the examples above.
17282 \begin_inset Flex Code
17285 \begin_layout Plain Layout
17294 \begin_layout Description
17295 \begin_inset Flex Code
17298 \begin_layout Plain Layout
17305 \begin_inset Flex Code
17308 \begin_layout Plain Layout
17314 ] Attributes for the item tag.
17316 \begin_inset Quotes eld
17320 \begin_inset Flex Code
17323 \begin_layout Plain Layout
17324 class=`layoutname_item'
17330 \begin_inset Quotes erd
17338 contain any style information.
17340 \begin_inset Flex Code
17343 \begin_layout Plain Layout
17352 \begin_layout Description
17353 \begin_inset Flex Code
17356 \begin_layout Plain Layout
17363 \begin_inset Flex Code
17366 \begin_layout Plain Layout
17372 ] The tag to be used for paragraph and item labels, replacing
17373 \begin_inset Flex Code
17376 \begin_layout Plain Layout
17382 in the examples above.
17384 \begin_inset Flex Code
17387 \begin_layout Plain Layout
17394 \begin_inset Flex Code
17397 \begin_layout Plain Layout
17404 \begin_inset Flex Code
17407 \begin_layout Plain Layout
17414 \begin_inset Flex Code
17417 \begin_layout Plain Layout
17418 Centered_Top_Environment
17423 , in which case it defaults to
17424 \begin_inset Flex Code
17427 \begin_layout Plain Layout
17436 \begin_layout Description
17437 \begin_inset Flex Code
17440 \begin_layout Plain Layout
17447 \begin_inset Flex Code
17450 \begin_layout Plain Layout
17456 ] Attributes for the label tag.
17458 \begin_inset Quotes eld
17462 \begin_inset Flex Code
17465 \begin_layout Plain Layout
17466 class=`layoutname_label'
17472 \begin_inset Quotes erd
17480 contain any style information.
17482 \begin_inset Flex Code
17485 \begin_layout Plain Layout
17494 \begin_layout Description
17495 \begin_inset Flex Code
17498 \begin_layout Plain Layout
17505 \begin_inset Flex Code
17508 \begin_layout Plain Layout
17518 ] Meaningful only for list-like environments, this tag controls whether
17519 the label tag is output before or inside the item tag.
17520 This is used, for example, in the description environment, where we want
17522 \begin_inset Flex Code
17525 \begin_layout Plain Layout
17526 <dt>\SpecialChar \ldots{}
17527 </dt><dd>\SpecialChar \ldots{}
17535 \begin_inset Flex Code
17538 \begin_layout Plain Layout
17544 : The label tag is output inside the item tag.
17547 \begin_layout Description
17548 \begin_inset Flex Code
17551 \begin_layout Plain Layout
17557 Information to be output in the
17558 \begin_inset Flex Code
17561 \begin_layout Plain Layout
17567 section when this style is used.
17568 This might, for example, be used to include a
17569 \begin_inset Flex Code
17572 \begin_layout Plain Layout
17579 \begin_inset Flex Code
17582 \begin_layout Plain Layout
17591 \begin_layout Description
17592 \begin_inset Flex Code
17595 \begin_layout Plain Layout
17601 CSS style information to be included when this style is used.
17602 Note that this will automatically be wrapped in a layout-generated
17603 \begin_inset Flex Code
17606 \begin_layout Plain Layout
17612 block, so only the CSS itself need be included.
17615 \begin_layout Description
17616 \begin_inset Flex Code
17619 \begin_layout Plain Layout
17626 \begin_inset Flex Code
17629 \begin_layout Plain Layout
17635 ] The tag to be used for the main label, replacing
17636 \begin_inset Flex Code
17639 \begin_layout Plain Layout
17645 in the examples above.
17647 \begin_inset Flex Code
17650 \begin_layout Plain Layout
17659 \begin_layout Description
17660 \begin_inset Flex Code
17663 \begin_layout Plain Layout
17670 \begin_inset Flex Code
17673 \begin_layout Plain Layout
17683 ] Marks this style as the one to be used to generate the
17684 \begin_inset Flex Code
17687 \begin_layout Plain Layout
17693 tag for the XHTML file.
17694 By default, it is false.
17696 \begin_inset Flex Code
17699 \begin_layout Plain Layout
17705 file sets it to true for the
17706 \begin_inset Flex Code
17709 \begin_layout Plain Layout
17719 \begin_layout Subsection
17723 \begin_layout Standard
17724 The XHTML output of insets can also be controlled by information in layout
17729 \begin_layout Plain Layout
17730 At present, this is true only for
17731 \begin_inset Quotes eld
17735 \begin_inset Quotes erd
17738 insets (insets you can type into) and is not true for
17739 \begin_inset Quotes eld
17743 \begin_inset Quotes erd
17746 insets (insets that are associated with dialog boxes).
17751 Here, too, LyX tries to provide sensible defaults, and it constructs default
17753 But everything can be customized.
17756 \begin_layout Standard
17757 The XHTML LyX outputs for an inset has the following form:
17760 \begin_layout LyX-Code
17762 \begin_inset Quotes erd
17766 \begin_inset Quotes erd
17772 \begin_layout LyX-Code
17773 <labeltag>Label</labeltag>
17776 \begin_layout LyX-Code
17778 \begin_inset Quotes erd
17782 \begin_inset Quotes erd
17785 >Contents of the inset.</innertag>
17788 \begin_layout LyX-Code
17792 \begin_layout Standard
17793 If the inset permits multiple paragraphs---that is, if
17794 \begin_inset Flex Code
17797 \begin_layout Plain Layout
17803 is true---then the contents of the inset will itself be output as paragraphs
17804 formatted according to the styles used for those paragraphs (standard,
17805 quote, and the like).
17806 The label tag is of course omitted if the paragraph does not have a label
17807 and, at present, is always
17808 \begin_inset Flex Code
17811 \begin_layout Plain Layout
17818 The inner tag is optional and, by default, does not appear.
17821 \begin_layout Standard
17822 The specific tags and attributes output for each inset can be controlled
17823 by means of the following layout tags.
17826 \begin_layout Description
17827 \begin_inset Flex Code
17830 \begin_layout Plain Layout
17837 \begin_inset Flex Code
17840 \begin_layout Plain Layout
17846 ] Specifies attribute information to be output with the main tag.
17848 \begin_inset Quotes eld
17852 \begin_inset Flex Code
17855 \begin_layout Plain Layout
17856 class=`myinset' onclick=`\SpecialChar \ldots{}
17863 \begin_inset Quotes erd
17867 By default, LyX will output
17868 \begin_inset Quotes eld
17872 \begin_inset Flex Code
17875 \begin_layout Plain Layout
17882 \begin_inset Quotes erd
17886 \begin_inset Flex Code
17889 \begin_layout Plain Layout
17895 is the LyX name of the inset, made lowercase and with non-alphanumeric
17896 characters converted to underscores, for example: footnote.
17899 \begin_layout Description
17900 \begin_inset Flex Code
17903 \begin_layout Plain Layout
17910 \begin_inset Flex Code
17913 \begin_layout Plain Layout
17923 ] Whether to output the default CSS information LyX generates for this layout,
17924 even if additional information is explicitly provided via
17925 \begin_inset Flex Code
17928 \begin_layout Plain Layout
17936 \begin_inset Flex Code
17939 \begin_layout Plain Layout
17945 allows you to alter or augment the generated CSS, rather than to override
17950 \begin_layout Description
17951 \begin_inset Flex Code
17954 \begin_layout Plain Layout
17961 \begin_inset Flex Code
17964 \begin_layout Plain Layout
17970 ] Attributes for the inner tag.
17972 \begin_inset Quotes eld
17976 \begin_inset Flex Code
17979 \begin_layout Plain Layout
17980 class=`insetname_inner'
17986 \begin_inset Quotes erd
17992 \begin_layout Description
17993 \begin_inset Flex Code
17996 \begin_layout Plain Layout
18003 \begin_inset Flex Code
18006 \begin_layout Plain Layout
18012 ] The inner tag, replacing
18013 \begin_inset Flex Code
18016 \begin_layout Plain Layout
18022 in the examples above.
18023 By default, there is none.
18026 \begin_layout Description
18027 \begin_inset Flex Code
18030 \begin_layout Plain Layout
18037 \begin_inset Flex Code
18040 \begin_layout Plain Layout
18048 ] Whether this inset represents a standalone block of text (such as a footnote)
18049 or instead represents material that is included in the surrounding text
18050 (such as a branch).
18054 \begin_layout Description
18055 \begin_inset Flex Code
18058 \begin_layout Plain Layout
18065 \begin_inset Flex Code
18068 \begin_layout Plain Layout
18074 ] A label for this inset, possibly including a reference to a counter.
18075 For example, for footnote, it might be:
18076 \begin_inset Flex Code
18079 \begin_layout Plain Layout
18088 This is optional, and there is no default.
18091 \begin_layout Description
18092 \begin_inset Flex Code
18095 \begin_layout Plain Layout
18101 Information to be output in the
18102 \begin_inset Flex Code
18105 \begin_layout Plain Layout
18111 section when this style is used.
18112 This might, for example, be used to include a
18113 \begin_inset Flex Code
18116 \begin_layout Plain Layout
18123 \begin_inset Flex Code
18126 \begin_layout Plain Layout
18135 \begin_layout Description
18136 \begin_inset Flex Code
18139 \begin_layout Plain Layout
18145 CSS style information to be included when this style is used.
18146 Note that this will automatically be wrapped in a layout-generated
18147 \begin_inset Flex Code
18150 \begin_layout Plain Layout
18156 block, so only the CSS itself need be included.
18159 \begin_layout Description
18160 \begin_inset Flex Code
18163 \begin_layout Plain Layout
18170 \begin_inset Flex Code
18173 \begin_layout Plain Layout
18179 ] The tag to be used for the main label, replacing
18180 \begin_inset Flex Code
18183 \begin_layout Plain Layout
18189 in the examples above.
18190 The default depends upon the setting of
18191 \begin_inset Flex Code
18194 \begin_layout Plain Layout
18201 \begin_inset Flex Code
18204 \begin_layout Plain Layout
18210 is true, the default is
18211 \begin_inset Flex Code
18214 \begin_layout Plain Layout
18220 ; if it is false, the default is
18221 \begin_inset Flex Code
18224 \begin_layout Plain Layout
18233 \begin_layout Subsection
18237 \begin_layout Standard
18238 The XHTML output for floats too can be controlled by layout information.
18239 The output has the following form:
18242 \begin_layout LyX-Code
18244 \begin_inset Quotes erd
18248 \begin_inset Quotes erd
18254 \begin_layout LyX-Code
18255 Contents of the float.
18258 \begin_layout LyX-Code
18262 \begin_layout Standard
18263 The caption, if there is one, is a separate inset and will be output as
18265 Its appearance can be controlled via the InsetLayout for caption insets.
18269 \begin_layout Description
18270 \begin_inset Flex Code
18273 \begin_layout Plain Layout
18280 \begin_inset Flex Code
18283 \begin_layout Plain Layout
18289 ] Specifies attribute information to be output with the main tag.
18291 \begin_inset Quotes eld
18295 \begin_inset Flex Code
18298 \begin_layout Plain Layout
18299 class=`myfloat' onclick=`\SpecialChar \ldots{}
18306 \begin_inset Quotes erd
18310 By default, LyX will output
18311 \begin_inset Quotes eld
18315 \begin_inset Flex Code
18318 \begin_layout Plain Layout
18319 class=`float float-floattype'
18325 \begin_inset Quotes erd
18329 \begin_inset Flex Code
18332 \begin_layout Plain Layout
18338 is LyX's name for this type of float, as determined by the float declaration
18340 \begin_inset CommandInset ref
18342 reference "sub:Floats"
18346 ), though made lowercase and with non-alphanumeric characters converted
18347 to underscores, for example: float-table.
18350 \begin_layout Description
18351 \begin_inset Flex Code
18354 \begin_layout Plain Layout
18360 CSS style information to be included when this float is used.
18361 Note that this will automatically be wrapped in a layout-generated
18362 \begin_inset Flex Code
18365 \begin_layout Plain Layout
18371 block, so only the CSS itself need be included.
18374 \begin_layout Description
18375 \begin_inset Flex Code
18378 \begin_layout Plain Layout
18385 \begin_inset Flex Code
18388 \begin_layout Plain Layout
18394 ] The tag to be used for this float, replacing
18395 \begin_inset Quotes eld
18399 \begin_inset Flex Code
18402 \begin_layout Plain Layout
18409 \begin_inset Quotes erd
18412 in the example above.
18414 \begin_inset Flex Code
18417 \begin_layout Plain Layout
18423 and will rarely need changing.
18426 \begin_layout Subsection
18427 Bibliography formatting
18430 \begin_layout Standard
18431 The bibliography can be formatted using
18432 \begin_inset Flex Code
18435 \begin_layout Plain Layout
18443 \begin_inset CommandInset ref
18445 reference "sub:Citation-format-description"
18452 \begin_layout Subsection
18456 \begin_layout Standard
18457 We have several times mentioned that LyX will generate default CSS style
18458 rules for both insets and paragraph styles, based upon the other layout
18459 information that is provided.
18460 In this section, we shall say a word about which layout information LyX
18464 \begin_layout Standard
18465 At present, LyX auto-generates CSS only for font information, making use
18467 \begin_inset Flex Code
18470 \begin_layout Plain Layout
18477 \begin_inset Flex Code
18480 \begin_layout Plain Layout
18487 \begin_inset Flex Code
18490 \begin_layout Plain Layout
18497 \begin_inset Flex Code
18500 \begin_layout Plain Layout
18507 \begin_inset Flex Code
18510 \begin_layout Plain Layout
18518 \begin_inset CommandInset ref
18520 reference "sub:Font-description"
18524 .) The translation is mostly straightforward and obvious.
18526 \begin_inset Quotes eld
18530 \begin_inset Flex Code
18533 \begin_layout Plain Layout
18540 \begin_inset Quotes erd
18544 \begin_inset Quotes eld
18548 \begin_inset Flex Code
18551 \begin_layout Plain Layout
18552 font-family: sans-serif;
18558 \begin_inset Quotes erd
18562 The correspondence of LyX sizes and CSS sizes is a little less obvious
18563 but nonetheless intuitive.
18565 \begin_inset Flex Code
18568 \begin_layout Plain Layout
18575 \begin_inset Flex URL
18578 \begin_layout Plain Layout
18589 \begin_layout Chapter
18590 Including External Material
18593 \begin_layout Standard
18594 \begin_inset Box Shadowbox
18604 height_special "totalheight"
18607 \begin_layout Plain Layout
18608 WARNING: This portion of the documentation has not been updated for some
18610 We certainly hope that it is still accurate, but there are no guarantees.
18618 \begin_layout Standard
18619 The use of material from sources external to LyX is covered in detail in
18625 This part of the manual covers what needs to happen behind the scenes for
18626 new sorts of material to be included.
18629 \begin_layout Section
18633 \begin_layout Standard
18634 The external material feature is based on the concept of a
18639 A template is a specification of how LyX should interface with a certain
18641 As bundled, LyX comes with predefined templates for Xfig figures, various
18642 raster format images, chess diagrams, and LilyPond music notation.
18643 You can check the actual list by using the menu
18644 \begin_inset Flex MenuItem
18647 \begin_layout Plain Layout
18648 Insert\SpecialChar \menuseparator
18649 File\SpecialChar \menuseparator
18656 Furthermore, it is possible to roll your own template to support a specific
18658 Later we'll describe in more detail what is involved, and hopefully you
18659 will submit all the templates you create so we can include them in a later
18663 \begin_layout Standard
18664 Another basic idea of the external material feature is to distinguish between
18665 the original file that serves as a base for final material and the produced
18666 file that is included in your exported or printed document.
18667 For example, consider the case of a figure produced with
18668 \begin_inset Flex Code
18671 \begin_layout Plain Layout
18678 The Xfig application itself works on an original file with the
18679 \begin_inset Flex Code
18682 \begin_layout Plain Layout
18689 Within Xfig, you create and change your figure, and when you are done,
18691 \begin_inset Flex Code
18694 \begin_layout Plain Layout
18701 When you want to include the figure in your document, you invoke
18702 \begin_inset Flex Code
18705 \begin_layout Plain Layout
18711 in order to create a PostScript file that can readily be included in your
18714 \begin_inset Flex Code
18717 \begin_layout Plain Layout
18723 file is the original file, and the PostScript file is the produced file.
18726 \begin_layout Standard
18727 This distinction is important in order to allow updating of the material
18728 while you are in the process of writing the document.
18729 Furthermore, it provides us with the flexibility that is needed to support
18730 multiple export formats.
18731 For instance, in the case of a plain text file, it is not exactly an award-winn
18732 ing idea to include the figure as raw PostScript.
18733 Instead, you would either prefer to just include a reference to the figure
18734 or try to invoke some graphics to ASCII converter to make the final result
18735 look similar to the real graphics.
18736 The external material management allows you to do this, because it is parametri
18737 zed on the different export formats that LyX supports.
18740 \begin_layout Standard
18741 Besides supporting the production of different products according to the
18742 exported format, it supports tight integration with editing and viewing
18744 In the case of an Xfig figure, you are able to invoke Xfig on the original
18745 file with a single click from within the external material dialog in LyX,
18746 and also preview the produced PostScript file with Ghostview with another
18748 No more fiddling around with the command line and/or file browsers to locate
18749 and manipulate the original or produced files.
18750 In this way, you are finally able to take full advantage of the many different
18751 applications that are relevant to use when you write your documents, and
18752 ultimately be more productive.
18755 \begin_layout Section
18756 The external template configuration file
18759 \begin_layout Standard
18760 It is relatively easy to add custom external template definitions to LyX.
18761 However, be aware that doing this in an careless manner most probably
18765 introduce an easily exploitable security hole.
18766 So before you do this, please read the discussion about security in section
18768 \begin_inset CommandInset ref
18770 reference "sec:Security-discussion"
18777 \begin_layout Standard
18778 Having said that, we encourage you to submit any interesting templates that
18783 \begin_layout Standard
18784 The external templates are defined in the
18785 \begin_inset Flex Code
18788 \begin_layout Plain Layout
18789 LyXDir/lib/external_templates
18795 You can place your own version in
18796 \begin_inset Flex Code
18799 \begin_layout Plain Layout
18800 UserDir/external_templates
18808 \begin_layout Standard
18809 A typical template looks like this:
18812 \begin_layout LyX-Code
18816 \begin_layout LyX-Code
18817 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18820 \begin_layout LyX-Code
18824 \begin_layout LyX-Code
18828 \begin_layout LyX-Code
18832 \begin_layout LyX-Code
18836 \begin_layout LyX-Code
18840 \begin_layout LyX-Code
18841 AutomaticProduction true
18844 \begin_layout LyX-Code
18848 \begin_layout LyX-Code
18852 \begin_layout LyX-Code
18856 \begin_layout LyX-Code
18857 TransformCommand Rotate RotationLatexCommand
18860 \begin_layout LyX-Code
18861 TransformCommand Resize ResizeLatexCommand
18864 \begin_layout LyX-Code
18865 Product "$$RotateFront$$ResizeFront
18868 \begin_layout LyX-Code
18873 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18876 \begin_layout LyX-Code
18877 $$ResizeBack$$RotateBack"
18880 \begin_layout LyX-Code
18884 \begin_layout LyX-Code
18885 UpdateResult "$$AbsPath$$Basename.pstex_t"
18888 \begin_layout LyX-Code
18889 Requirement "graphicx"
18892 \begin_layout LyX-Code
18893 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18896 \begin_layout LyX-Code
18897 ReferencedFile latex "$$AbsPath$$Basename.eps"
18900 \begin_layout LyX-Code
18901 ReferencedFile dvi "$$AbsPath$$Basename.eps"
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.pdftex_t}
18932 \begin_layout LyX-Code
18933 $$ResizeBack$$RotateBack"
18936 \begin_layout LyX-Code
18937 UpdateFormat pdftex
18940 \begin_layout LyX-Code
18941 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18944 \begin_layout LyX-Code
18945 Requirement "graphicx"
18948 \begin_layout LyX-Code
18949 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18952 \begin_layout LyX-Code
18953 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18956 \begin_layout LyX-Code
18960 \begin_layout LyX-Code
18964 \begin_layout LyX-Code
18965 Product "$$Contents(
18967 "$$AbsPath$$Basename.asc
18972 \begin_layout LyX-Code
18973 UpdateFormat asciixfig
18976 \begin_layout LyX-Code
18977 UpdateResult "$$AbsPath$$Basename.asc"
18980 \begin_layout LyX-Code
18984 \begin_layout LyX-Code
18988 \begin_layout LyX-Code
18989 Product "<graphic fileref=
18991 "$$AbsOrRelPathMaster$$Basename.eps
18996 \begin_layout LyX-Code
19000 \begin_layout LyX-Code
19004 \begin_layout LyX-Code
19005 UpdateResult "$$AbsPath$$Basename.eps"
19008 \begin_layout LyX-Code
19009 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19012 \begin_layout LyX-Code
19013 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19016 \begin_layout LyX-Code
19020 \begin_layout LyX-Code
19021 Product "[XFig: $$FName]"
19024 \begin_layout LyX-Code
19028 \begin_layout LyX-Code
19032 \begin_layout Standard
19033 As you can see, the template is enclosed in
19034 \begin_inset Flex Code
19037 \begin_layout Plain Layout
19043 \SpecialChar \ldots{}
19045 \begin_inset Flex Code
19048 \begin_layout Plain Layout
19055 It contains a header specifying some general settings and, for each supported
19056 primary document file format, a section
19057 \begin_inset Flex Code
19060 \begin_layout Plain Layout
19066 \SpecialChar \ldots{}
19068 \begin_inset Flex Code
19071 \begin_layout Plain Layout
19080 \begin_layout Subsection
19081 The template header
19084 \begin_layout Description
19085 \begin_inset Flex Code
19088 \begin_layout Plain Layout
19089 AutomaticProduction
19090 \begin_inset space ~
19098 Whether the file represented by the template must be generated by LyX.
19099 This command must occur exactly once.
19102 \begin_layout Description
19103 \begin_inset Flex Code
19106 \begin_layout Plain Layout
19108 \begin_inset space ~
19116 A glob pattern that is used in the file dialog to filter out the desired
19118 If there is more than one possible file extension (e.
19119 \begin_inset space \thinspace{}
19123 \begin_inset space \space{}
19127 \begin_inset Flex Code
19130 \begin_layout Plain Layout
19137 \begin_inset Flex Code
19140 \begin_layout Plain Layout
19146 ), use something like
19147 \begin_inset Flex Code
19150 \begin_layout Plain Layout
19157 This command must occur exactly once.
19160 \begin_layout Description
19161 \begin_inset Flex Code
19164 \begin_layout Plain Layout
19166 \begin_inset space ~
19174 The text that is displayed on the button.
19175 This command must occur exactly once.
19178 \begin_layout Description
19179 \begin_inset Flex Code
19182 \begin_layout Plain Layout
19184 \begin_inset space ~
19188 \begin_inset space ~
19196 The help text that is used in the External dialog.
19197 Provide enough information to explain to the user just what the template
19198 can provide him with.
19199 This command must occur exactly once.
19202 \begin_layout Description
19203 \begin_inset Flex Code
19206 \begin_layout Plain Layout
19208 \begin_inset space ~
19216 The file format of the original file.
19217 This must be the name of a format that is known to LyX (see section
19218 \begin_inset space ~
19222 \begin_inset CommandInset ref
19224 reference "sec:Formats"
19230 \begin_inset Quotes eld
19234 \begin_inset Flex Code
19237 \begin_layout Plain Layout
19244 \begin_inset Quotes erd
19247 if the template can handle original files of more than one format.
19248 LyX will attempt to interrogate the file itself in order to deduce its
19249 format in this case.
19250 This command must occur exactly once.
19253 \begin_layout Description
19254 \begin_inset Flex Code
19257 \begin_layout Plain Layout
19259 \begin_inset space ~
19267 A unique name for the template.
19268 It must not contain substitution macros (see below).
19271 \begin_layout Description
19272 \begin_inset Flex Code
19275 \begin_layout Plain Layout
19277 \begin_inset space ~
19280 Rotate|Resize|Clip|Extra
19285 This command specifies which transformations are supported by this template.
19286 It may occur zero or more times.
19287 This command enables the corresponding tabs in the external dialog.
19289 \begin_inset Flex Code
19292 \begin_layout Plain Layout
19298 command must have either a corresponding
19299 \begin_inset Flex Code
19302 \begin_layout Plain Layout
19309 \begin_inset Flex Code
19312 \begin_layout Plain Layout
19319 \begin_inset Flex Code
19322 \begin_layout Plain Layout
19329 Otherwise the transformation will not be supported by that format.
19332 \begin_layout Subsection
19336 \begin_layout Description
19337 \begin_inset Flex Code
19340 \begin_layout Plain Layout
19342 \begin_inset space ~
19345 LaTeX|PDFLaTeX|PlainText|DocBook
19350 The primary document file format that this format definition is for.
19351 Not every template has a sensible representation in all document file formats.
19352 Please define nevertheless a
19353 \begin_inset Flex Code
19356 \begin_layout Plain Layout
19362 section for all templates.
19363 Use a dummy text when no representation is available.
19364 Then you can at least see a reference to the external material in the exported
19368 \begin_layout Description
19369 \begin_inset Flex Code
19372 \begin_layout Plain Layout
19374 \begin_inset space ~
19378 \begin_inset space ~
19386 This command defines an additional macro
19387 \begin_inset Flex Code
19390 \begin_layout Plain Layout
19396 for substitution in
19397 \begin_inset Flex Code
19400 \begin_layout Plain Layout
19408 \begin_inset Flex Code
19411 \begin_layout Plain Layout
19417 itself may contain substitution macros.
19418 The advantage over using
19419 \begin_inset Flex Code
19422 \begin_layout Plain Layout
19429 \begin_inset Flex Code
19432 \begin_layout Plain Layout
19438 is that the substituted value of
19439 \begin_inset Flex Code
19442 \begin_layout Plain Layout
19448 is sanitized so that it is a valid optional argument in the document format.
19449 This command may occur zero or more times.
19452 \begin_layout Description
19453 \begin_inset Flex Code
19456 \begin_layout Plain Layout
19458 \begin_inset space ~
19466 The text that is inserted in the exported document.
19467 This is actually the most important command and can be quite complex.
19468 This command must occur exactly once.
19471 \begin_layout Description
19472 \begin_inset Flex Code
19475 \begin_layout Plain Layout
19477 \begin_inset space ~
19485 This command specifies a preamble snippet that will be included in the
19487 It has to be defined using
19488 \begin_inset Flex Code
19491 \begin_layout Plain Layout
19497 \SpecialChar \ldots{}
19499 \begin_inset Flex Code
19502 \begin_layout Plain Layout
19509 This command may occur zero or more times.
19512 \begin_layout Description
19513 \begin_inset Flex Code
19516 \begin_layout Plain Layout
19518 \begin_inset space ~
19522 \begin_inset space ~
19530 This command denotes files that are created by the conversion process and
19531 are needed for a particular export format.
19532 If the filename is relative, it is interpreted relative to the master document.
19533 This command may be given zero or more times.
19536 \begin_layout Description
19537 \begin_inset Flex Code
19540 \begin_layout Plain Layout
19542 \begin_inset space ~
19550 The name of a required LaTeX package.
19551 The package is included via
19552 \begin_inset Flex Code
19555 \begin_layout Plain Layout
19563 in the LaTeX preamble.
19564 This command may occur zero or more times.
19567 \begin_layout Description
19568 \begin_inset Flex Code
19571 \begin_layout Plain Layout
19573 \begin_inset space ~
19577 \begin_inset space ~
19580 RotationLatexCommand
19585 This command specifies that the built in LaTeX command should be used for
19587 This command may occur once or not at all.
19590 \begin_layout Description
19591 \begin_inset Flex Code
19594 \begin_layout Plain Layout
19596 \begin_inset space ~
19600 \begin_inset space ~
19608 This command specifies that the built in LaTeX command should be used for
19610 This command may occur once or not at all.
19613 \begin_layout Description
19614 \begin_inset Flex Code
19617 \begin_layout Plain Layout
19619 \begin_inset space ~
19623 \begin_inset space ~
19626 RotationLatexOption
19631 This command specifies that rotation is done via an optional argument.
19632 This command may occur once or not at all.
19635 \begin_layout Description
19636 \begin_inset Flex Code
19639 \begin_layout Plain Layout
19641 \begin_inset space ~
19645 \begin_inset space ~
19653 This command specifies that resizing is done via an optional argument.
19654 This command may occur once or not at all.
19657 \begin_layout Description
19658 \begin_inset Flex Code
19661 \begin_layout Plain Layout
19663 \begin_inset space ~
19667 \begin_inset space ~
19675 This command specifies that clipping is done via an optional argument.
19676 This command may occur once or not at all.
19679 \begin_layout Description
19680 \begin_inset Flex Code
19683 \begin_layout Plain Layout
19685 \begin_inset space ~
19689 \begin_inset space ~
19697 This command specifies that an extra optional argument is used.
19698 This command may occur once or not at all.
19701 \begin_layout Description
19702 \begin_inset Flex Code
19705 \begin_layout Plain Layout
19707 \begin_inset space ~
19715 The file format of the converted file.
19716 This must be the name of a format that is known to LyX (see the
19717 \begin_inset Flex MenuItem
19720 \begin_layout Plain Layout
19725 ools\SpecialChar \menuseparator
19730 references\SpecialChar \menuseparator
19731 File Handling\SpecialChar \menuseparator
19738 This command must occur exactly once.
19741 \begin_layout Description
19742 \begin_inset Flex Code
19745 \begin_layout Plain Layout
19747 \begin_inset space ~
19755 The file name of the converted file.
19756 The file name must be absolute.
19757 This command must occur exactly once.
19760 \begin_layout Subsection
19761 Preamble definitions
19764 \begin_layout Standard
19765 The external template configuration file may contain additional preamble
19766 definitions enclosed by
19767 \begin_inset Flex Code
19770 \begin_layout Plain Layout
19776 \SpecialChar \ldots{}
19778 \begin_inset Flex Code
19781 \begin_layout Plain Layout
19788 They can be used by the templates in the
19789 \begin_inset Flex Code
19792 \begin_layout Plain Layout
19801 \begin_layout Section
19802 The substitution mechanism
19805 \begin_layout Standard
19806 When the external material facility invokes an external program, it is done
19807 on the basis of a command defined in the template configuration file.
19808 These commands can contain various macros that are expanded before execution.
19809 Execution always take place in the directory of the containing document.
19812 \begin_layout Standard
19813 Also, whenever external material is to be displayed, the name will be produced
19814 by the substitution mechanism, and most other commands in the template
19815 definition support substitution as well.
19818 \begin_layout Standard
19819 The available macros are the following:
19822 \begin_layout Description
19823 \begin_inset Flex Code
19826 \begin_layout Plain Layout
19827 $$AbsOrRelPathMaster
19832 The file path, absolute or relative to the master LyX document.
19835 \begin_layout Description
19836 \begin_inset Flex Code
19839 \begin_layout Plain Layout
19840 $$AbsOrRelPathParent
19845 The file path, absolute or relative to the LyX document.
19848 \begin_layout Description
19849 \begin_inset Flex Code
19852 \begin_layout Plain Layout
19858 The absolute file path.
19861 \begin_layout Description
19862 \begin_inset Flex Code
19865 \begin_layout Plain Layout
19871 The filename without path and without the extension.
19874 \begin_layout Description
19875 \begin_inset Flex Code
19878 \begin_layout Plain Layout
19880 \begin_inset Quotes eld
19884 \begin_inset Quotes erd
19892 This macro will expand to the contents of the file with the name
19893 \begin_inset Flex Code
19896 \begin_layout Plain Layout
19905 \begin_layout Description
19906 \begin_inset Flex Code
19909 \begin_layout Plain Layout
19915 The file extension (including the dot).
19918 \begin_layout Description
19919 \begin_inset Flex Code
19922 \begin_layout Plain Layout
19928 The filename of the file specified in the external material dialog.
19929 This is either an absolute name, or it is relative to the LyX document.
19932 \begin_layout Description
19933 \begin_inset Flex Code
19936 \begin_layout Plain Layout
19943 \begin_inset Flex Code
19946 \begin_layout Plain Layout
19952 (absolute name or relative to the LyX document).
19955 \begin_layout Description
19956 \begin_inset Flex Code
19959 \begin_layout Plain Layout
19965 The file path, relative to the master LyX document.
19968 \begin_layout Description
19969 \begin_inset Flex Code
19972 \begin_layout Plain Layout
19978 The file path, relative to the LyX document.
19981 \begin_layout Description
19982 \begin_inset Flex Code
19985 \begin_layout Plain Layout
19991 This macro will expand to the absolute path of the system directory.
19992 This is typically used to point to the various helper scripts that are
19996 \begin_layout Description
19997 \begin_inset Flex Code
20000 \begin_layout Plain Layout
20006 A name and full path to a temporary file which will be automatically deleted
20007 whenever the containing document is closed, or the external material insertion
20011 \begin_layout Standard
20012 All path macros contain a trailing directory separator, so you can construct
20014 \begin_inset space \thinspace{}
20018 \begin_inset space \space{}
20021 the absolute filename with
20022 \begin_inset Flex Code
20025 \begin_layout Plain Layout
20026 $$AbsPath$$Basename$$Extension
20034 \begin_layout Standard
20035 The macros above are substituted in all commands unless otherwise noted.
20037 \begin_inset Flex Code
20040 \begin_layout Plain Layout
20046 supports additionally the following substitutions if they are enabled by
20048 \begin_inset Flex Code
20051 \begin_layout Plain Layout
20058 \begin_inset Flex Code
20061 \begin_layout Plain Layout
20070 \begin_layout Description
20071 \begin_inset Flex Code
20074 \begin_layout Plain Layout
20080 The front part of the resize command.
20083 \begin_layout Description
20084 \begin_inset Flex Code
20087 \begin_layout Plain Layout
20093 The back part of the resize command.
20096 \begin_layout Description
20097 \begin_inset Flex Code
20100 \begin_layout Plain Layout
20106 The front part of the rotation command.
20109 \begin_layout Description
20110 \begin_inset Flex Code
20113 \begin_layout Plain Layout
20119 The back part of the rotation command.
20122 \begin_layout Standard
20123 The value string of the
20124 \begin_inset Flex Code
20127 \begin_layout Plain Layout
20133 command supports additionally the following substitutions if they are enabled
20135 \begin_inset Flex Code
20138 \begin_layout Plain Layout
20145 \begin_inset Flex Code
20148 \begin_layout Plain Layout
20157 \begin_layout Description
20158 \begin_inset Flex Code
20161 \begin_layout Plain Layout
20170 \begin_layout Description
20171 \begin_inset Flex Code
20174 \begin_layout Plain Layout
20183 \begin_layout Description
20184 \begin_inset Flex Code
20187 \begin_layout Plain Layout
20196 \begin_layout Description
20197 \begin_inset Flex Code
20200 \begin_layout Plain Layout
20206 The rotation option.
20209 \begin_layout Standard
20210 You may ask why there are so many path macros.
20211 There are mainly two reasons:
20214 \begin_layout Enumerate
20215 Relative and absolute file names should remain relative or absolute, respectivel
20217 Users may have reasons to prefer either form.
20218 Relative names are useful for portable documents that should work on different
20219 machines, for example.
20220 Absolute names may be required by some programs.
20223 \begin_layout Enumerate
20224 LaTeX treats relative file names differently than LyX and other programs
20225 in nested included files.
20226 For LyX, a relative file name is always relative to the document that contains
20228 For LaTeX, it is always relative to the master document.
20229 These two definitions are identical if you have only one document, but
20230 differ if you have a master document that includes part documents.
20231 That means that relative filenames must be transformed when presented to
20233 Fortunately LyX does this automatically for you if you choose the right
20237 \begin_layout Standard
20238 So which path macro should be used in new template definitions? The rule
20242 \begin_layout Itemize
20244 \begin_inset Flex Code
20247 \begin_layout Plain Layout
20253 if an absolute path is required.
20256 \begin_layout Itemize
20258 \begin_inset Flex Code
20261 \begin_layout Plain Layout
20262 $$AbsOrRelPathMaster
20267 if the substituted string is some kind of LaTeX input.
20270 \begin_layout Itemize
20272 \begin_inset Flex Code
20275 \begin_layout Plain Layout
20276 $$AbsOrRelPathParent
20281 in order to preserve the user's choice.
20284 \begin_layout Standard
20285 There are special cases where this rule does not work and e.
20286 \begin_inset space \thinspace{}
20290 \begin_inset space \space{}
20293 relative names are needed, but normally it will work just fine.
20294 One example for such a case is the command
20295 \begin_inset Flex Code
20298 \begin_layout Plain Layout
20299 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20304 in the XFig template above: We can't use the absolute name because the
20306 \begin_inset Flex Code
20309 \begin_layout Plain Layout
20315 files needs the relative name in order to rewrite the file content.
20318 \begin_layout Section
20319 Security discussion
20320 \begin_inset CommandInset label
20322 name "sec:Security-discussion"
20329 \begin_layout Standard
20330 The external material feature interfaces with a lot of external programs
20331 and does so automatically, so we have to consider the security implications
20333 In particular, since you have the option of including your own filenames
20334 and/or parameter strings and those are expanded into a command, it seems
20335 that it would be possible to create a malicious document which executes
20336 arbitrary commands when a user views or prints the document.
20337 This is something we definitely want to avoid.
20340 \begin_layout Standard
20341 However, since the external program commands are specified in the template
20342 configuration file only, there are no security issues if LyX is properly
20343 configured with safe templates only.
20344 This is so because the external programs are invoked with the
20345 \begin_inset Flex Code
20348 \begin_layout Plain Layout
20354 -system call rather than the
20355 \begin_inset Flex Code
20358 \begin_layout Plain Layout
20364 system-call, so it's not possible to execute arbitrary commands from the
20365 filename or parameter section via the shell.
20368 \begin_layout Standard
20369 This also implies that you are restricted in what command strings you can
20370 use in the external material templates.
20371 In particular, pipes and redirection are not readily available.
20372 This has to be so if LyX should remain safe.
20373 If you want to use some of the shell features, you should write a safe
20374 script to do this in a controlled manner, and then invoke the script from
20375 the command string.
20379 \begin_layout Standard
20380 It is possible to design a template that interacts directly with the shell,
20381 but since this would allow a malicious user to execute arbitrary commands
20382 by writing clever filenames and/or parameters, we generally recommend that
20383 you only use safe scripts that work with the
20384 \begin_inset Flex Code
20387 \begin_layout Plain Layout
20393 system call in a controlled manner.
20394 Of course, for use in a controlled environment, it can be tempting to just
20395 fall back to use ordinary shell scripts.
20396 If you do so, be aware that you
20400 provide an easily exploitable security hole in your system.
20401 Of course it stands to reason that such unsafe templates will never be
20402 included in the standard LyX distribution, although we do encourage people
20403 to submit new templates in the open source tradition.
20404 But LyX as shipped from the official distribution channels will never have
20408 \begin_layout Standard
20409 Including external material provides a lot of power, and you have to be
20410 careful not to introduce security hazards with this power.
20411 A subtle error in a single line in an innocent looking script can open
20412 the door to huge security problems.
20413 So if you do not fully understand the issues, we recommend that you consult
20414 a knowledgeable security professional or the LyX development team if you
20415 have any questions about whether a given template is safe or not.
20416 And do this before you use it in an uncontrolled environment.